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: [buildrobot] non-PIC references to __ehdr_start (was: gdb and binutils branch master updated. 4199e3b8669d0a36448687850374fdc2ad7240b6)


On Wed, Jan 15, 2014 at 5:30 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Wed, 2014-01-15 11:53:31 -0000, amodra@sourceware.org <amodra@sourceware.org> wrote:
>> commit 4199e3b8669d0a36448687850374fdc2ad7240b6
>> Author: Alan Modra <amodra@gmail.com>
>> Date:   Wed Jan 15 21:50:55 2014 +1030
>>
>>     non-PIC references to __ehdr_start in pie and shared
>>
>>     Rather than hacking every backend to not discard dynamic relocations
>>     against an undefined hidden __ehdr_start, make it appear to be defined
>>     early.
>
> This patch apparently produces fallout on gcc76.fsffrance.org for (at
> least)
> score-elf: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91138
> nds32be-elf: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91139
> tic6x-uclinux: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91206
> bfin-elf: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91207
> rl78-elf: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91212
> am33_2.0-linux: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91213
> rx-elf: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91215
> vax-linux: http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=91235
>
> It's like:
>
> cp /home/jbglaw/repos/binutils_gdb/ld/emultempl/astring.sed stringify.sed
> LIB_PATH='' /bin/sh /home/jbglaw/repos/binutils_gdb/ld/genscripts.sh "/home/jbglaw/repos/binutils_gdb/ld" "/home/jbglaw/build/vax-linux/_install_/lib" "/home/jbglaw/build/vax-linux/_install_" "/home/jbglaw/build/vax-linux/_install_" x86_64-unknown-linux-gnu vax-dec-linux-gnu vax-linux "elf32vax" "/usr/local/lib /lib /usr/lib" no no elf32vax "vax-linux"
> gcc -DHAVE_CONFIG_H -I. -I/home/jbglaw/repos/binutils_gdb/ld  -I. -I/home/jbglaw/repos/binutils_gdb/ld -I../bfd -I/home/jbglaw/repos/binutils_gdb/ld/../bfd -I/home/jbglaw/repos/binutils_gdb/ld/../include  -g -O2 -DENABLE_PLUGINS -DLOCALEDIR="\"/home/jbglaw/build/vax-linux/_install_/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT eelf32vax.o -MD -MP -MF .deps/eelf32vax.Tpo -c -o eelf32vax.o eelf32vax.c
> cc1: warnings being treated as errors
> eelf32vax.c: In function ‘gldelf32vax_before_allocation’:
> eelf32vax.c:1050: error: ‘ehdr_start_save.type’ may be used uninitialized in this function
> make[3]: *** [eelf32vax.o] Error 1
>

I checked in this patch to fix it.

-- 
H.J.
--
commit f9c316c4d75be236bbaa8464ef803ed2d3859d6d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jan 15 07:43:19 2014 -0800

    Silence uninitialized warning on ehdr_start_save

    Older GCC, like 4.1/4.2, will issue an uninitialized warning on
    ehdr_start_save.  This patch silences by using

    struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;

    * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
    Silence uninitialized warning on ehdr_start_save with older
    GCC.

diff --git a/ld/ChangeLog b/ld/ChangeLog
index eaa6b93..91055de 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2014-01-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
+ Silence uninitialized warning on ehdr_start_save with older
+ GCC.
+
 2014-01-15  Alan Modra  <amodra@gmail.com>

  * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Define
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 13f86f0..569c7f7 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1481,7 +1481,7 @@ gld${EMULATION_NAME}_before_allocation (void)
   asection *sinterp;
   bfd *abfd;
   struct elf_link_hash_entry *ehdr_start = NULL;
-  struct bfd_link_hash_entry ehdr_start_save;
+  struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;

   if (is_elf_hash_table (link_info.hash))
     {


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