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)
Sep 27 2024, 12:53 PM
Unknown Object (File)
Sep 20 2024, 2:29 PM
Unknown Object (File)
Sep 16 2024, 11:13 AM
Unknown Object (File)
Sep 7 2024, 9:28 PM
Unknown Object (File)
Sep 7 2024, 9:28 PM
Unknown Object (File)
Sep 7 2024, 9:28 PM
Unknown Object (File)
Sep 7 2024, 9:20 PM
Unknown Object (File)
Aug 16 2024, 1:44 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.