[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa
From: |
skrll at netbsd dot org |
Subject: |
[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa |
Date: |
Thu, 08 Dec 2011 07:43:50 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=13476
--- Comment #3 from Nick Hudson <skrll at netbsd dot org> 2011-12-08 07:43:50
UTC ---
To hopefully show the bug clearer here's some more output.
$ cc -c -O2 -fPIC -o h_tls.o h_tls.c
$
$ ../prefix/bin/hppa--netbsd-ld -v
GNU ld (GNU Binutils) 2.22.51.20111207
$
$ ../prefix/bin/hppa--netbsd-ld --eh-frame-hdr -shared -o dso.so -L /usr/lib
/usr/lib/crti.o /usr/lib/crtbeginS.o h_tls.o -lgcc -lc -lgcc /usr/lib/crtendS.o
/usr/lib/crtn.o
$
$ nm dso.so | grep test
000004e8 T testf
$
$ objdump -D dso.so --start-address=0x4e8 --stop-address=0x504
dso.so: file format elf32-hppa-netbsd
Disassembly of section .text:
000004e8 <testf>:
4e8: 6b c2 3f d9 stw rp,-14(sp)
4ec: 6f c4 01 00 stw,ma r4,80(sp)
4f0: 6b c3 3f 09 stw r3,-7c(sp)
4f4: 08 1a 02 43 copy r26,r3
4f8: 2a 60 20 00 addil L%1000,r19,r1 ! r1 = gp + 0x1000
4fc: 34 3a 00 70 ldo 38(r1),r26 ! r26 = gp + 0x1038
500: e8 5f 1d 1d b,l 394 <_init+0x40>,rp
$
$ # On elf32-hppa-netbsd gp is always set to point to the GOT. GOT + 0x1038 is
$ # well outside the got
$ #
$ objdump -h dso.so
dso.so: file format elf32-hppa-netbsd
Sections:
Idx Name Size VMA LMA File off Algn
0 .hash 0000004c 000000b4 000000b4 000000b4 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .dynsym 000000e0 00000100 00000100 00000100 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynstr 00000083 000001e0 000001e0 000001e0 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .rela.dyn 000000cc 00000264 00000264 00000264 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .rela.plt 00000024 00000330 00000330 00000330 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .init 00000030 00000354 00000354 00000354 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
6 .text 00000384 00000384 00000384 00000384 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
7 .fini 00000028 00000708 00000708 00000708 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
8 .note.netbsd.ident 00000018 00000730 00000730 00000730 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .note.netbsd.pax 00000014 00000748 00000748 00000748 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .PARISC.unwind 000000b0 0000075c 0000075c 0000075c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
11 .eh_frame 00000004 0000080c 0000080c 0000080c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
12 .ctors 00000008 00001000 00001000 00001000 2**2
CONTENTS, ALLOC, LOAD, DATA
13 .dtors 00000008 00001008 00001008 00001008 2**2
CONTENTS, ALLOC, LOAD, DATA
14 .jcr 00000004 00001010 00001010 00001010 2**2
CONTENTS, ALLOC, LOAD, DATA
15 .data.rel.ro 00000008 00001014 00001014 00001014 2**2
CONTENTS, ALLOC, LOAD, DATA
16 .dynamic 000000a8 0000101c 0000101c 0000101c 2**2
CONTENTS, ALLOC, LOAD, DATA
17 .data 00000004 000010c4 000010c4 000010c4 2**2
CONTENTS, ALLOC, LOAD, DATA
18 .plt 00000034 000010c8 000010c8 000010c8 2**2
CONTENTS, ALLOC, LOAD, CODE
19 .got 00000040 000010fc 000010fc 000010fc 2**2
CONTENTS, ALLOC, LOAD, DATA
20 .bss 00000014 0000113c 0000113c 0000113c 2**2
ALLOC
21 .comment 00000042 00000000 00000000 0000113c 2**0
CONTENTS, READONLY
22 .debug_aranges 00000020 00000000 00000000 0000117e 2**0
CONTENTS, READONLY, DEBUGGING
23 .debug_pubnames 00000039 00000000 00000000 0000119e 2**0
CONTENTS, READONLY, DEBUGGING
24 .debug_info 000001d9 00000000 00000000 000011d7 2**0
CONTENTS, READONLY, DEBUGGING
25 .debug_abbrev 00000120 00000000 00000000 000013b0 2**0
CONTENTS, READONLY, DEBUGGING
26 .debug_line 000000e7 00000000 00000000 000014d0 2**0
CONTENTS, READONLY, DEBUGGING
27 .debug_frame 0000002c 00000000 00000000 000015b8 2**2
CONTENTS, READONLY, DEBUGGING
28 .debug_str 00000145 00000000 00000000 000015e4 2**0
CONTENTS, READONLY, DEBUGGING
29 .debug_loc 00000140 00000000 00000000 00001729 2**0
CONTENTS, READONLY, DEBUGGING
30 .debug_pubtypes 0000003b 00000000 00000000 00001869 2**0
CONTENTS, READONLY, DEBUGGING
$ objdump -D dso.so --start-address=0x394 --stop-address=0x3a4
dso.so: file format elf32-hppa-netbsd
Disassembly of section .text:
00000394 <__do_global_dtors_aux-0x14>:
394: 2a 7f ff ff addil L%-800,r19,r1 ! r1 = GOT - 0x800
398: 48 35 0f b8 ldw 7dc(r1),r21 ! r21 = GOT - 0x14
39c: ea a0 c0 00 bv r0(r21) ! = 0x10d8
3a0: 48 33 0f c0 ldw 7e0(r1),r19
$
$ objdump -R dso.so
dso.so: file format elf32-hppa-netbsd
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
00001104 R_PARISC_DIR32 *ABS*+0x00001008
00001108 R_PARISC_DIR32 *ABS*+0x00001010
0000110c R_PARISC_DIR32 *ABS*+0x0000113c
00001110 R_PARISC_DIR32 *ABS*+0x00001140
00001114 R_PARISC_DIR32 *ABS*+0x00001014
00001118 R_PARISC_DIR32 *ABS*+0x00001018
0000111c R_PARISC_DIR32 *ABS*+0x00001144
00001120 R_PARISC_DIR32 *ABS*+0x00001148
00001124 R_PARISC_DIR32 *ABS*+0x00001004
00001128 R_PARISC_DIR32 *ABS*+0x0000100c
00001130 R_PARISC_DIR32 *ABS*+0x000010c4
00001014 R_PARISC_PLABEL32 __cxa_finalize
00001018 R_PARISC_PLABEL32 _Jv_RegisterClasses
000010c4 R_PARISC_DIR32 .init+0x00000d70
0000112c R_PARISC_DIR32 _GLOBAL_OFFSET_TABLE_
00001134 R_PARISC_TLS_DTPMOD32 var1
00001138 R_PARISC_TLS_DTPOFF32 var1
000010c8 R_PARISC_IPLT _Jv_RegisterClasses
000010d0 R_PARISC_IPLT __cxa_finalize
000010d8 R_PARISC_IPLT __tls_get_addr ! <--- calling this
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
- [Bug binutils/13476] New: Incorrect TLS relocations created in DSOs on hppa, skrll at netbsd dot org, 2011/12/07
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, vapier at gentoo dot org, 2011/12/07
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, danglin at gcc dot gnu.org, 2011/12/07
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, danglin at gcc dot gnu.org, 2011/12/07
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa,
skrll at netbsd dot org <=
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, dave.anglin at bell dot net, 2011/12/08
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, dave.anglin at bell dot net, 2011/12/08
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, cvs-commit at gcc dot gnu.org, 2011/12/11
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, danglin at gcc dot gnu.org, 2011/12/11
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, danglin at gcc dot gnu.org, 2011/12/11
- [Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa, nick.hudson at gmx dot co.uk, 2011/12/12