On 6/11/20 8:31 PM, Martin Liška wrote:
On 6/11/20 7:48 PM, Mark Wielaard wrote:
ELFUTILS 0.180 -http://elfutils.org/

Hello.

Thank you for the release. I'm seeing a linking error during test build:

[   84s] gcc -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/usr/share/locale"' 
-I. -I..  \
[   84s]   -I. -I. -I../lib -I.. -I../libasm -I../libdw -I../libdwfl 
-I../libdwelf -I../libebl -I../libelf -I../lib -I..  \
[   84s]   -g -O0 ../libelf/libelf.so -o test-nlist test-nlist.c
[   84s] 
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: 
/tmp/ccyqAIyN.o: in function `main':
[   84s] /home/abuild/rpmbuild/BUILD/elfutils-0.180/tests/test-nlist.c:49: 
undefined reference to `nlist'
[   84s] 
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: 
/home/abuild/rpmbuild/BUILD/elfutils-0.180/tests/test-nlist.c:50: undefined 
reference to `nlist'
[   84s] collect2: error: ld returned 1 exit status
[   84s] make[2]: *** [Makefile:4516: test-nlist] Error 1
[   84s] make[2]: *** Waiting for unfinished jobs....

Can you please take a look?
Thanks,
Martin

Small analysis:

$ gcc test-nlist.c -I../libelf -c
$ gcc test-nlist.o ../libelf/libelf.so
$ gcc ../libelf/libelf.so test-nlist.o
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: 
test-nlist.o: in function `main':
test-nlist.c:(.text+0x91): undefined reference to `nlist'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: 
test-nlist.c:(.text+0xab): undefined reference to `nlist'
collect2: error: ld returned 1 exit status

apparently gold is fine:

$ gcc ../libelf/libelf.so test-nlist.o -fuse-ld=gold
[ok]

$ objdump -t test-nlist.o | grep nlist
test-nlist.o:     file format elf64-x86-64
0000000000000000 l    df *ABS*  0000000000000000 test-nlist.c
0000000000000000         *UND*  0000000000000000 nlist

$ objdump -t ../libelf/libelf.so | grep nlist
0000000000000000 l    df *ABS*  0000000000000000              nlist.c
00000000000113a0 l     F .text  00000000000000f1              
nlist_fshash_lookup
00000000000114a0 g     F .text  0000000000000388              nlist

May it be related to some order mentioned in 
51cfbaabefd6d5ebdd7513b876daf78d07470f8c?

Thanks,
Martin

Reply via email to