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)
Nov 15 2023, 8:16 AM
Unknown Object (File)
Nov 13 2023, 8:15 AM
Unknown Object (File)
Nov 12 2023, 9:38 AM
Unknown Object (File)
Nov 10 2023, 10:14 AM
Unknown Object (File)
Nov 10 2023, 9:41 AM
Unknown Object (File)
Nov 8 2023, 9:39 AM
Unknown Object (File)
Oct 10 2023, 7:15 AM
Unknown Object (File)
Oct 9 2023, 9:06 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.