[PATCH 4/4] Update tests for protected data and function symbols

Florian Weimer fweimer@redhat.com
Mon Jun 21 07:19:51 GMT 2021


* H. J. Lu via Libc-alpha:

> Protected data and function symbols don't work well without
> -fsingle-global-definition:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37611
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44166
>
> 1. Compile tst-protected1[ab].c and tst-protected1mod[ab].c with
> -fsingle-global-definition if possible so that GOT entries are used
> for undefined data accesses.
> 2. Add tests for protected function pointers.
> 3. Build tst-prelink.c without single global definition to keepp COPY
> relocation.

I think these tests need to check that the statically linked bits from
GCC have been built with -fsingle-global-definition.  I don't think
that's guaranteed even if GCC supports -fsingle-global-definition.

I think this shows the limitation of the single bit of markup: the
statically linked GCC bits are all hidden, so setting
GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION so is not correct as a
marker to *require* a single global definition, but neither is not
setting it because libgcc.a etc. should be *compatible* with
GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION.

Thanks,
Florian



More information about the Libc-alpha mailing list