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)
Mon, Nov 25, 2:33 AM
Unknown Object (File)
Fri, Nov 22, 11:41 PM
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
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 8583
Build 8897: CI src buildJenkins

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

why not use b cerror directly?

lib/libc/aarch64/SYS.h
54

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.