This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: glibc built without .gnu.warning.symbol sections
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Wed, 24 Jul 2013 11:46:59 -0700
- Subject: Re: glibc built without .gnu.warning.symbol sections
- References: <20130720094728 dot GB3294 at bubble dot grove dot modra dot org> <CAMe9rOr_ojZv=FNqx6rWbV_sw+A_7goaRRnrZdvFRjMNGKyxMg at mail dot gmail dot com>
On Wed, Jul 24, 2013 at 10:26 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Jul 20, 2013 at 2:47 AM, Alan Modra <amodra@gmail.com> wrote:
>> The fix for PR 12761 results in glibc libc.so.6 being built without
>> warning sections. Fixed as follows.
>>
>> PR ld/15762
>> * elflink.c (elf_link_add_object_symbols): Don't clobber
>> .gnu.warning.symbol sections when shared.
>>
>> Index: bfd/elflink.c
>> ===================================================================
>> RCS file: /cvs/src/src/bfd/elflink.c,v
>> retrieving revision 1.494
>> diff -u -p -r1.494 elflink.c
>> --- bfd/elflink.c 8 May 2013 23:31:38 -0000 1.494
>> +++ bfd/elflink.c 20 Jul 2013 09:34:39 -0000
>> @@ -3444,7 +3445,7 @@ elf_link_add_object_symbols (bfd *abfd,
>> FALSE, bed->collect, NULL)))
>> goto error_return;
>>
>> - if (! info->relocatable)
>> + if (!info->relocatable && !info->shared)
>
> This looks wrong. It will generate .gnu.warning.symbol sections in PIE.
> Shouldn't the check be if (info->executable)?
>
Here is a patch. OK to install?
Thanks.
--
H.J.
--
2013-07-24 H.J. Lu <hongjiu.lu@intel.com>
PR ld/15762
* elflink.c (elf_link_add_object_symbols): Always clobber
.gnu.warning.symbol sections when building executable.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 55f00da..e4044e3 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3444,7 +3444,7 @@ elf_link_add_object_symbols (bfd *abfd, struct
bfd_link_info *info)
FALSE, bed->collect, NULL)))
goto error_return;
- if (!info->relocatable && !info->shared)
+ if (info->executable)
{
/* Clobber the section size so that the warning does
not get copied into the output file. */