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)
Tue, Mar 31, 3:42 PM
Unknown Object (File)
Mon, Mar 23, 5:54 AM
Unknown Object (File)
Mon, Mar 23, 5:49 AM
Unknown Object (File)
Wed, Mar 18, 11:33 PM
Unknown Object (File)
Wed, Mar 18, 6:13 AM
Unknown Object (File)
Sun, Mar 15, 9:59 PM
Unknown Object (File)
Feb 8 2026, 5:11 AM
Unknown Object (File)
Feb 7 2026, 11:41 PM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26340
Build 24811: arc lint + arc unit

Event Timeline

sys/riscv/riscv/locore.S
72

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.