[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2012-01-27 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #10 from cvs-commit at gcc dot gnu.org  2012-01-28 02:25:40 UTC ---
CVSROOT:/cvs/src
Module name:src
Branch: binutils-2_22-branch
Changes by:dang...@sourceware.org2012-01-28 02:25:35

Modified files:
bfd: ChangeLog elf32-hppa.c 

Log message:
Backport from mainline:
2011-12-11  John Davis Anglin  

PR binutils/13476
* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
R_PARISC_DPREL21L when not doing a shared link.  Likewise convert
R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
R_PARISC_DPREL14R.  Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.5473.2.34&r2=1.5473.2.35
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-hppa.c.diff?cvsroot=src&only_with_tag=binutils-2_22-branch&r1=1.179.2.1&r2=1.179.2.2

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-11 Thread nick.hudson at gmx dot co.uk
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #9 from nick.hudson at gmx dot co.uk 2011-12-12 07:48:11 UTC ---
On Sunday 11 December 2011 15:54:11 danglin at gcc dot gnu.org wrote:
> http://sourceware.org/bugzilla/show_bug.cgi?id=13476
> 
> --- Comment #7 from John David Anglin 
>  2011-12-11 15:54:11 UTC --- Fixed.
> 
I can confirm this fixes the problem I saw.

Thanks,
Nick

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-11 Thread danglin at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

John David Anglin  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #8 from John David Anglin  2011-12-11 
15:54:35 UTC ---
...

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-11 Thread danglin at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #7 from John David Anglin  2011-12-11 
15:54:11 UTC ---
Fixed.

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-11 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #6 from cvs-commit at gcc dot gnu.org  2011-12-11 15:42:17 UTC ---
CVSROOT:/cvs/src
Module name:src
Changes by:dang...@sourceware.org2011-12-11 15:42:11

Modified files:
bfd: ChangeLog elf32-hppa.c 

Log message:
PR binutils/13476
* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
R_PARISC_DPREL21L when not doing a shared link.  Likewise convert
R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
R_PARISC_DPREL14R.  Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5536&r2=1.5537
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-hppa.c.diff?cvsroot=src&r1=1.182&r2=1.183

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-08 Thread dave.anglin at bell dot net
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #5 from dave.anglin at bell dot net 2011-12-08 15:06:37 UTC ---
Could you try the attached change?

The PIC TLS relocs are now only changed to dp relative when !info->shared.
I looked briefly at this case this morning and it seems to work.  
However, there
are some subtle aspects to this.

Dave

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-08 Thread dave.anglin at bell dot net
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #4 from dave.anglin at bell dot net 2011-12-08 11:54:44 UTC ---
On 8-Dec-11, at 2:43 AM, skrll at netbsd dot org wrote:

> --- Comment #3 from Nick Hudson  2011-12-08  
> 07:43:50 UTC ---
> To hopefully show the bug clearer here's some more output.


I believe that I have a patch.  Will send when it has some testing.

Dave
--
John David Anglindave.ang...@bell.net

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-07 Thread skrll at netbsd dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #3 from Nick Hudson  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 
04e8 T testf
$   
$ objdump -D dso.so --start-address=0x4e8 --stop-address=0x504  

dso.so: file format elf32-hppa-netbsd


Disassembly of section .text:

04e8 :
 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 004c  00b4  00b4  00b4  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA   
  1 .dynsym   00e0  0100  0100  0100  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA   
  2 .dynstr   0083  01e0  01e0  01e0  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA   
  3 .rela.dyn 00cc  0264  0264  0264  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA   
  4 .rela.plt 0024  0330  0330  0330  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA   
  5 .init 0030  0354  0354  0354  2**0
  CONTENTS, ALLOC, LOAD, READONLY, CODE   
  6 .text 0384  0384  0384  0384  2**2
  CONTENTS, ALLOC, LOAD, READONLY, CODE   
  7 .fini 0028  0708  0708  0708  2**0
  CONTENTS, ALLOC, LOAD, READONLY, CODE   
  8 .note.netbsd.ident 0018  0730  0730  0730  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .note.netbsd.pax 0014  0748  0748  0748  2**2  
  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .PARISC.unwind 00b0  075c  075c  075c  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .eh_frame 0004  080c  080c  080c  2**2 
  CONTENTS, ALLOC, LOAD, READONLY, DATA
 12 .ctors0008  1000  1000  1000  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 13 .dtors0008  1008  1008  1008  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 14 .jcr  0004  1010  1010  1010  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 15 .data.rel.ro  0008  1014  1014  1014  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 16 .dynamic  00a8  101c  101c  101c  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 17 .data 0004  10c4  10c4  10c4  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 18 .plt  0034  10c8  10c8  10c8  2**2 
  CONTENTS, ALLOC, LOAD, CODE  
 19 .got  0040  10fc  10fc  10fc  2**2 
  CONTENTS, ALLOC, LOAD, DATA  
 20 .bss  0014  113c  113c  113c  2**2 
  ALLOC
 21 .comment  0042      113c  2**0 
  CONTENTS, READONLY   
 22 .debug_aranges 0020      117e  2**0
  CONTENTS, READONLY, DEBUGGING
 23 .debug_pubnames 0039      119e  2**0   
  CONTENTS, READONLY, DEBUGGING
 24 .debug_info   01d9      11d7  2**0 
  CONTENTS, READONLY, DEBUGGING
 25 .debug_abbrev 0120      13b0  2**0 
  CONTENTS, RE

[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-07 Thread danglin at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

--- Comment #2 from John David Anglin  2011-12-08 
02:08:56 UTC ---
Looking a bit more, I think this break is questionable:

  /* Now try to make things easy for the dynamic linker.  */

  break;

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-07 Thread danglin at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

John David Anglin  changed:

   What|Removed |Added

 CC||danglin at gcc dot gnu.org

--- Comment #1 from John David Anglin  2011-12-08 
01:43:58 UTC ---
1) The testcase doesn't show the bug.

2) The register is still r19 (PIC register).  The addil hasn't been changed
   to dp or r0, so the I fail to see how the commit referenced changed
   the situation.

The first hunk doesn't apply because this is a shared link.  The second
hunk doesn't apply because the register isn't dp.  So, we should fallthru
to the original code.

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13476] Incorrect TLS relocations created in DSOs on hppa

2011-12-07 Thread vapier at gentoo dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

Mike Frysinger  changed:

   What|Removed |Added

 CC||toolchain at gentoo dot org

-- 
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 mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils