Page MenuHomeFreeBSD

Do not use b.cs instruction to jump to cerror
ClosedPublic

Authored by kan on Apr 7 2017, 3:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 10:17 PM
Unknown Object (File)
Feb 24 2024, 11:31 AM
Unknown Object (File)
Jan 18 2024, 12:30 AM
Unknown Object (File)
Dec 23 2023, 4:38 AM
Unknown Object (File)
Dec 13 2023, 3:51 AM
Unknown Object (File)
Dec 8 2023, 12:34 PM
Unknown Object (File)
Nov 27 2023, 12:19 PM
Unknown Object (File)
Nov 17 2023, 3:59 AM
Subscribers

Details

Summary

The conditional jump can only be performed tp targets up to 1MB in
either direction and does not work too well when linker places cerror
further that that from the caller. In that case linker will complain
about relocation overflows.

Diff Detail

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

Event Timeline

Can you add a comment to point out why we use the b.cs ; ret ; b sequence.

lib/libc/aarch64/SYS.h
54 ↗(On Diff #27179)

why not use b cerror directly?

lib/libc/aarch64/SYS.h
54 ↗(On Diff #27179)

How? We still need to check the process state as that's how syscalls signal failure.

This LGTM with @andrew's note addressed, probably just make a comment out of a short version of the explanation that's in the Phabricator summary?

Also, with luck a future version of the linker will insert a thunk by itself when necessary, and we could then revert this.

This revision is now accepted and ready to land.Apr 7 2017, 3:54 PM
This revision was automatically updated to reflect the committed changes.