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, Nov 21, 4:32 PM
Unknown Object (File)
Wed, Nov 20, 4:08 AM
Unknown Object (File)
Mon, Nov 18, 3:06 AM
Unknown Object (File)
Mon, Nov 18, 3:05 AM
Unknown Object (File)
Wed, Nov 13, 5:41 PM
Unknown Object (File)
Tue, Nov 12, 9:57 PM
Unknown Object (File)
Tue, Nov 5, 12:40 PM
Unknown Object (File)
Oct 17 2024, 2:33 PM
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.