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, Aug 11, 12:56 PM
Unknown Object (File)
Sun, Aug 9, 10:28 PM
Unknown Object (File)
Sun, Aug 9, 10:28 PM
Unknown Object (File)
Sun, Aug 9, 10:27 PM
Unknown Object (File)
Sat, Aug 8, 11:20 PM
Unknown Object (File)
Sat, Aug 8, 7:42 AM
Unknown Object (File)
Fri, Aug 7, 5:03 PM
Unknown Object (File)
Fri, Aug 7, 11:08 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.