Page MenuHomeFreeBSD

Fix compilation of locore.S with clang
ClosedPublic

Authored by mhorne on Aug 27 2019, 2:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 4, 1:27 PM
Unknown Object (File)
Thu, Nov 20, 5:42 PM
Unknown Object (File)
Thu, Nov 20, 5:42 PM
Unknown Object (File)
Thu, Nov 20, 5:38 PM
Unknown Object (File)
Thu, Nov 20, 5:38 PM
Unknown Object (File)
Thu, Nov 20, 5:28 PM
Unknown Object (File)
Thu, Nov 20, 6:33 AM
Unknown Object (File)
Nov 5 2025, 4:33 AM
Subscribers

Details

Summary

The branch from _start to mpentry has to cross a large section of data;
an offset larger than can be specified with a 12-bit branch immediate.
Fix this by converting the branch to an unconditional jump. The gcc
assembler does this conversion silently but is not done automatically by
clang.

Reported by: Jeremy Bennett <jeremy.bennett@embecosm.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/riscv/riscv/locore.S
73 ↗(On Diff #61352)

I would suggest adding a comment, since otherwise it looks like something that should be simplified.

This revision is now accepted and ready to land.Aug 27 2019, 2:22 PM

Add comment explaining the change

This revision now requires review to proceed.Sep 8 2019, 7:37 PM
This revision is now accepted and ready to land.Sep 8 2019, 7:48 PM
This revision was automatically updated to reflect the committed changes.