Summary: | pie.exp: FAIL: weak undefined | ||
---|---|---|---|
Product: | binutils | Reporter: | John David Anglin <danglin> |
Component: | ld | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils, hjl.tools, vapier |
Priority: | P2 | ||
Version: | 2.17 | ||
Target Milestone: | --- | ||
Host: | hppa-unknown-linux-gnu | Target: | hppa-unknown-linux-gnu |
Build: | hppa-unknown-linux-gnu | Last reconfirmed: |
Description
John David Anglin
2006-02-22 00:10:27 UTC
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. |