[PATCH 4/4] aarch64: add tests for glibc.cpu.aarch64_bti behaviour

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Nov 19 12:05:53 GMT 2025



On 19/11/25 07:00, Yury Khrustalev wrote:
> On Mon, Nov 17, 2025 at 10:03:05AM -0300, Adhemerval Zanella Netto wrote:
>>
>> On 14/11/25 11:58, Yury Khrustalev wrote:
>>> Hi Adhemerval,
>>>
>>> Thank you for your comments, all will be fixed in the next version of
>>> this patch series.
>>>
>>> On Mon, Nov 10, 2025 at 12:02:50PM -0300, Adhemerval Zanella Netto wrote:
>>>>
>>>> ...
>>>>
>>>> I am seeing these failures when the toolchain does not have 
>>>> --enable-standard-branch-protection:
>>>>
>>>> FAIL: misc/tst-bti-dep-prot
>>>> FAIL: misc/tst-bti-dlopen-imm
>>>> FAIL: misc/tst-bti-dlopen-prot
>>>> FAIL: misc/tst-bti-dlopen-transitive
>>>>
>>>> It is because the binaries do not have the BTI property:
>>>
>>> A similar problem exists with some of the GCS tests too. In case when
>>> the toolchain's CC and LD support BTI (or GCS, etc) but we do not
>>> enable corresponding branch protection for the Glibc itself, we are
>>> going to see such test errors simply because libc.so won't have the
>>> marking.
>>>
>>> Ideally, we need a way to know if branch protection is enabled when
>>> compiling and linking libc.so and only then activate the corresponding
>>> tests.
>>>
>>> Perhaps before running the test we could check properties of libc.so
>>> and let these tests to fail as UNSUPPORTED?
>>
>> This can be a configure check that enabled Makefile flag.
> 
> I'm not sure how this can be a configure check. When we run configure,
> Glibc is not built yet, so we can't probe ELF properties of libc.so.
> 
> During configure run, is it possible to get a full compiler and linker
> commands that will be used to build libc.so that will take into account
> environment variables and various configure flags? We could use that to
> link a dummy binary and probe its properties perhaps?

I think we can assume that $CC/$CPPFLAGS/$CFLAGS will give us the expected
ABI and thus we can probe by building a binary and objdump the GNU flags.



More information about the Libc-alpha mailing list