New flag --keep-section <section_name> to prevent certain sections from being linker garbage collected.

Ian Lance Taylor iant@google.com
Thu Apr 19 23:59:00 GMT 2012


Sriraman Tallam <tmsriram@google.com> writes:

> It comes from libpthread.a when linking statically. For GNU ld, this
> requirement can be placed in the linker script. For gold, I could hard
> code the name in "is_section_name_included" function. Do you prefer
> that?  Right now, to include symbols that are discarded by gc, we can
> get away by using -u <symbol>. However, for local symbols this is a
> problem which is the case with .rodata.nptl_version.

If the .rodata.nptl_version section should not be removed by the garbage
collector, then I think it would be fine to add .rodata.nptl_version to
is_section_name_included with an appropriate comment.

Ian



More information about the Binutils mailing list