This is the mail archive of the binutils@sourceware.org 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: glibc built without .gnu.warning.symbol sections


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.  */


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