[PATCH v3 2/2] aarch64: Add memory tagging support for setjmp/longjmp routines
Claudiu Zissulescu
claudiu.zissulescu-ianculescu@oracle.com
Thu Mar 12 10:37:07 GMT 2026
>> +static int
>> +do_test (void)
>> +{
>> + unsigned long hwcap2;
>> +
>> + hwcap2 = getauxval (AT_HWCAP2);
>> + if ((hwcap2 & HWCAP2_MTE) == 0)
>> + return EXIT_UNSUPPORTED;
>
> This check is too late because by the time main() is called, we already
> have
>
> tst-mte-stack: error while loading shared libraries:
> MTE Stack: cannot set stack with PROT_MTE: Invalid argument
>
> on a system without MTE support. Same for another test.
>
The above error is given by the dynamic loader, and it will do so for
any attempt to load and execute an app which sets DT
_AARCH64_MEMTAG_STACK dynamic tag. Without the dynamic linker check, an
MTE app, most probably, will just fail with an unrecognized instruction
exception.
This is happening when one is forcing the execution of the tests in a
system without MTE support by configuring the glibc build with
--enable-memory-tagging.
Best wishes,
Claudiu
More information about the Libc-alpha
mailing list