[PATCH] ld: Add -z start-stop-gc to let __start_/__stop_ not retain C identifier name sections
H.J. Lu
hjl.tools@gmail.com
Sat Feb 27 23:47:49 GMT 2021
On Sat, Feb 27, 2021 at 12:52 PM Fangrui Song via Binutils
<binutils@sourceware.org> wrote:
>
> This rule was initially added in PR11133 to work around glibc. However,
> it makes GC on C identifier name sections ineffective. In particular,
> many modern metadata sections (e.g. clang -fsanitize-coverage and
> -fprofile-generate) cannot be GCed.
>
> Add -z start-stop-gc to drop the rule.
>
> PR 27451
> include/
> * bfdlink.h (struct bfd_link_info): Add start_stop_gc.
> ld/
> * emultempl/elf.em: Handle -z start-stop-gc and -z nostart-stop-gc.
> * ldmain.c: Initialize start_stop_gc.
> * lang.c (lang_process): Handle start_stop_gc.
> * testsuite/ld-gc/gc.exp: New test.
> * testsuite/ld-gc/start.s: Add .weak directive.
> * testsuite/ld-gc/start2.d: New test.
> * ld.texi: Mention -z start-stop-gc and -z nostart-stop-gc.
> * NEWS: Mention -z start-stop-gc.
Does this option work with static glibc executable?
--
H.J.
More information about the Binutils
mailing list