gold --incremental not producing DWARF such that nm can handle it, internal error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On gcc 4.8.1, nm and gold 2.26.20160125

I'm getting some strange effects trying to use nm on binaries produced
with --incremental.
Full log below but the upshot is:

* --incremental gold produces binaries st nm --line-numbers complains like this:

     $ nm --line-numbers instrument_test >/dev/null
     nm: Dwarf Error: Bad abbrev number: 0.
     nm: Dwarf Error: found dwarf version '0', this reader only
handles version 2, 3 and 4 information.
     nm: Dwarf Error: found dwarf version '0', this reader only
handles version 2, 3 and 4 information.

  nm still coughs up the requested information but these are pretty
disturbing warnings.

* --incremental never succeeds, first time it say

       instrument_test: stat: No such file or directory
       linking with --incremental-full

  for obvious reasons.  But then after touching one source file:

       $ make instrument_test
       # See the comments in instrument.h for the reasons for these options
       # and for the double build.
       gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O2 -fPIC
instrument_test.c -o instrument_test.o
       gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O0 -fPIC
instrument_test.c -o instrument_test.o
       # See the Program Library Howto for a real life shared lib/DLL setup
       gcc -Wl,-rpath,`pwd` -gdwarf-4 -fuse-ld=gold -Wl,--incremental
-fPIC instrument_test.o instrument.o libdemo_shared_lib.so -ldl -o
instrument_test
       /home/bkerin/opt/binutils-2.26/bin/ld.gold: internal error in
init_got_plt_for_update, at target.h:1023
       collect2: error: ld returned 1 exit status
       make: *** [instrument_test] Error 1
       2 $

Looking at gold/target.h:1023 it says something about a target needing
to imlement a virtual function to support incremental linking, so
maybe I didn't compile something right?  I just built
binutils with ./configure --enable-gold=yes, perhaps something more is
required to support incremental linking?

Britton

$ make instrument_test
# See the comments in instrument.h for the reasons for these options
# and for the double build.
gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O2 -fPIC
instrument_test.c -o instrument_test.o
gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O0 -fPIC
instrument_test.c -o instrument_test.o
# See the comments in instrument.h for the reasons for these options
# and for the double build.
gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O2 -fPIC
instrument.c -o instrument.o
gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O0 -fPIC
instrument.c -o instrument.o
# See the comments in instrument.h for the reasons for these options
# and for the double build.
gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O2 -fPIC
demo_shared_lib.c -o demo_shared_lib.o
gcc -c -D_GNU_SOURCE -Wall -Wextra -Werror -gdwarf-4 -O0 -fPIC
demo_shared_lib.c -o demo_shared_lib.o
# See the Program Library Howto for a real life shared lib/DLL setup
gcc -Wl,-soname,libdemo_shared_lib.so -gdwarf-4 -fuse-ld=gold
-Wl,--incremental -fPIC -rdynamic -shared demo_shared_lib.o -o
libdemo_shared_lib.so
libdemo_shared_lib.so: stat: No such file or directory
linking with --incremental-full
# See the Program Library Howto for a real life shared lib/DLL setup
gcc -Wl,-rpath,`pwd` -gdwarf-4 -fuse-ld=gold -Wl,--incremental -fPIC
instrument_test.o instrument.o libdemo_shared_lib.so -ldl -o
instrument_test
instrument_test: stat: No such file or directory
linking with --incremental-full
$ nm --line-numbers instrument_test >/dev/null
nm: Dwarf Error: Bad abbrev number: 0.
nm: Dwarf Error: found dwarf version '0', this reader only handles
version 2, 3 and 4 information.
nm: Dwarf Error: found dwarf version '0', this reader only handles
version 2, 3 and 4 information.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux