gcc -B/home/dave/gnu/binutils-2.16.91/objdir/ld/tmpdir/gas/ -I/home/dave/gnu/bi nutils-2.16.91/src/ld/testsuite/ld-pie -g -O0 -L/home/dave/gnu/binutils-2.16.9 1/objdir/./ld -c -g -O0 -fPIC -c /home/dave/gnu/binutils-2.16.91/src/ld/testsuit e/ld-pie/weakundef.c -o tmpdir/weakundef.o gcc -L/home/dave/gnu/binutils-2.16.91/objdir/./ld -B/home/dave/gnu/binutils-2.16 .91/objdir/ld/tmpdir/ld/ -L/home/dave/opt/gnu/hppa-linux/lib -L/home/dave/opt/gn u/lib -L/usr/local/lib -L/lib -L/usr/lib -o tmpdir/weakundef -L/home/dave/gnu/b inutils-2.16.91/src/ld/testsuite/ld-pie -pie tmpdir/weakundef.o Running: tmpdir/weakundef > tmpdir/weakundef.out tmpdir/weakundef: error while loading shared libraries: unexpected reloc type 0x 42 FAIL: weak undefined Also, gcc -B/home/dave/gnu/binutils-2.16.91/objdir/ld/tmpdir/gas/ -I/home/dave/gnu/bi nutils-2.16.91/src/ld/testsuite/ld-pie -g -O0 -L/home/dave/gnu/binutils-2.16.9 1/objdir/./ld -c -g -O0 -fPIC -c /home/dave/gnu/binutils-2.16.91/src/ld/testsuit e/ld-pie/weakundef-data.c -o tmpdir/weakundef-data.o gcc -L/home/dave/gnu/binutils-2.16.91/objdir/./ld -B/home/dave/gnu/binutils-2.16 .91/objdir/ld/tmpdir/ld/ -L/home/dave/opt/gnu/hppa-linux/lib -L/home/dave/opt/gn u/lib -L/usr/local/lib -L/lib -L/usr/lib -o tmpdir/weakundef-data -L/home/dave/ gnu/binutils-2.16.91/src/ld/testsuite/ld-pie -pie tmpdir/weakundef-data.o Running: tmpdir/weakundef-data > tmpdir/weakundef-data.out tmpdir/weakundef-data: error while loading shared libraries: unexpected reloc ty pe 0x42 FAIL: weak undefined data
Subject: Re: New: pie.exp: FAIL: weak undefined > tmpdir/weakundef: error while loading shared libraries: unexpected reloc type 0x > 42 This is R_PARISC_PLABEL21L. Dave
Subject: Re: New: pie.exp: FAIL: weak undefined > > tmpdir/weakundef: error while loading shared libraries: unexpected reloc type 0x > > 42 > > This is R_PARISC_PLABEL21L. This is a glibc bug. The dynamic loader doesn't yet support R_PARISC_PLABEL21L and R_PARISC_PLABEL14R, and the startup file /usr/lib/Scrt1.o introduces them into the executable when -pie is specified: /usr/lib/Scrt1.o: file format elf32-hppa-linux RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 00000000 R_PARISC_PLABEL21L main 00000004 R_PARISC_PLABEL14R main 00000010 R_PARISC_PLABEL21L __libc_csu_init 00000014 R_PARISC_PLABEL14R __libc_csu_init 00000018 R_PARISC_PLABEL21L __libc_csu_fini 0000001c R_PARISC_PLABEL14R __libc_csu_fini Dave
See http://sourceware.org/ml/binutils/2006-02/msg00278.html hppa may need a similar fix.
Subject: Re: pie.exp: FAIL: weak undefined > See > > http://sourceware.org/ml/binutils/2006-02/msg00278.html > > hppa may need a similar fix. You mean something like: Index: elf32-hppa.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-hppa.c,v retrieving revision 1.144 diff -u -3 -p -r1.144 elf32-hppa.c --- elf32-hppa.c 16 Mar 2006 12:20:15 -0000 1.144 +++ elf32-hppa.c 20 Mar 2006 02:04:22 -0000 @@ -4261,6 +4261,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte #define elf_backend_fake_sections elf_hppa_fake_sections #define elf_backend_relocate_section elf32_hppa_relocate_section #define elf_backend_hide_symbol elf32_hppa_hide_symbol +#define elf_backend_fixup_symbol _bfd_elf_link_hash_fixup_symbol #define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections This doesn't work. Possibly, I don't understand but the testsuite fails don't appear to have anything to do with undefined weak symbols: dave@gsyprf11:~/binutils-2.16.91/objdir$ nm /usr/lib/Scrt1.o|less U $global$ 00000000 R _IO_stdin_used 00000000 D __data_start U __libc_csu_fini U __libc_csu_init U __libc_start_main 00000000 T _start 00000000 W data_start U main The problem is main, __libc_csu_init and __libc_csu_fini are in a shared library, and the dynamic loader can't do the necessary fixups. Dave
Does PIE work on hppa at all?
Subject: Re: pie.exp: FAIL: weak undefined > Does PIE work on hppa at all? My understanding is that it does when the dynamic loader issue is fixed in libc6 2.3.6-1. It seems 2.3.6 was released today (I just did an apt-get update and upgrade a few minutes ago) and tests no longer fail. This PR can now be closed. Dave
Fixed by updating to glibc 2.3.6-3.