This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Thu, Apr 19, 2012 at 4:36 PM, Ian Lance Taylor <> wrote:
> Sriraman Tallam <> 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.

I am resurfacing this discussion as this was not resolved last time
around although Ian did approve including ".rodata.nptl_version"
always.  So, I have included a patch to keep ".rodata.nptl_version"
always in is_section_name_included.  The other ways to avoid baking
pthread knowledge into the linker is to add a --keep-section option or
to use a linker script which is not the gold way.

Please review.


> Ian

Attachment: nptl_version_patch.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]