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)
Tue, Dec 24, 7:21 AM
Unknown Object (File)
Sun, Dec 15, 9:49 AM
Unknown Object (File)
Sat, Dec 7, 1:54 AM
Unknown Object (File)
Wed, Dec 4, 3:10 PM
Unknown Object (File)
Mon, Dec 2, 2:54 AM
Unknown Object (File)
Tue, Nov 26, 6:20 PM
Unknown Object (File)
Nov 25 2024, 2:33 AM
Unknown Object (File)
Nov 22 2024, 11:41 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.