Page MenuHomeFreeBSD

libc: Teach libc about the BTI elf note
ClosedPublic

Authored by andrew on Oct 16 2023, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 11:53 PM
Unknown Object (File)
Tue, Apr 30, 1:38 PM
Unknown Object (File)
Tue, Apr 30, 1:37 PM
Unknown Object (File)
Tue, Apr 30, 1:37 PM
Unknown Object (File)
Tue, Apr 30, 7:16 AM
Unknown Object (File)
Thu, Apr 25, 6:11 AM
Unknown Object (File)
Mon, Apr 22, 7:27 AM
Unknown Object (File)
Mon, Apr 22, 7:27 AM
Subscribers

Details

Summary

Add the Branch Target Identification (BTI) note to libc assembly
sources. As all obect files need the note for the library to have it
we need to insert it in all asm files.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Can we have some simple regression test which compiles and links a sample program with combinations of PAC and BTI enabled and disabled, and then verifies that libc and rtld don't silently cause features to be disabled? I'm worried that this will be a maintenance burden as new MI asm files are added.

There is a flag for lld that will cause it to fail to link when the note is missing BTI support. I've been using it to find all assembly files missing the note.

There is a flag for lld that will cause it to fail to link when the note is missing BTI support. I've been using it to find all assembly files missing the note.

It would be nice if there was a way for the compiler to insert/update the note, rather than having to manually annotate every single assembly file...

This revision is now accepted and ready to land.Oct 23 2023, 2:04 PM
This revision was automatically updated to reflect the committed changes.