This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed, elf32-cris.c: fix known GD offsets in GOT.


I've been sitting on this for a while.  With this and the next
few patches, the eglibc (glibc) testsuite TLS tests pass,
finally.  Real stuff works too.

bfd:
	* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
	<R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: Don't include the TLS size
	when emitting a known TP offset in the GOT.

ld/testsuite:
	* ld-cris/tls-e-20.d, ld-cris/tls-e-20a.d, ld-cris/tls-e-21.d,
	ld-cris/tls-e-80.d, ld-cris/tls-gd-3.d, ld-cris/tls-gd-3h.d,
	ld-cris/tls-global-74.d, ld-cris/tls-ldgde-14.d,
	ld-cris/tls-ldgde-15.d, ld-cris/tls-legd-16.d,
	ld-cris/tls-legd-17.d, ld-cris/tls-local-57.d,
	ld-cris/tls-local-58.d, ld-cris/tls-local-59.d: Adjust for BFD
	change in link-time known GOT contents for GD relocations.

Index: elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.101
diff -p -u -r1.101 elf32-cris.c
--- elf32-cris.c	27 Jan 2009 22:28:22 -0000	1.101
+++ elf32-cris.c	24 Mar 2009 03:24:47 -0000
@@ -1735,9 +1735,8 @@ cris_elf_relocate_section (output_bfd, i
 	      bfd_vma off;
 
 	      /* The symbol is defined in the program, so just write
-		 (1, -prog_tls_size+known_tpoffset) into the GOT.  */
+		 (1, known_tpoffset) into the GOT.  */
 	      relocation -= elf_hash_table (info)->tls_sec->vma;
-	      relocation -= elf_hash_table (info)->tls_size;
 
 	      if (h != NULL)
 		{

Index: ld-cris/tls-e-20.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-20.d,v
retrieving revision 1.3
diff -p -u -r1.3 tls-e-20.d
--- ld-cris/tls-e-20.d	27 Jan 2009 07:05:47 -0000	1.3
+++ ld-cris/tls-e-20.d	24 Mar 2009 03:28:17 -0000
@@ -53,7 +53,7 @@ Contents of section \.tdata:
  820b0 28000000 29000000 2a000000           .*
 Contents of section \.got:
  820bc 00000000 00000000 00000000 01000000  .*
- 820cc 00000000 f4ffffff 01000000 f4ffffff  .*
+ 820cc 00000000 f4ffffff 01000000 00000000  .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-e-20a.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-20a.d,v
retrieving revision 1.4
diff -p -u -r1.4 tls-e-20a.d
--- ld-cris/tls-e-20a.d	27 Jan 2009 07:05:47 -0000	1.4
+++ ld-cris/tls-e-20a.d	24 Mar 2009 03:28:17 -0000
@@ -75,7 +75,7 @@ Contents of section \.tdata:
  8215c 28000000 29000000 2a000000           .*
 Contents of section \.got:
  82168 00000000 00000000 00000000 01000000  .*
- 82178 00000000 f4ffffff 01000000 f4ffffff  .*
+ 82178 00000000 f4ffffff 01000000 80000000  .*
  82188 b4210800 ac210800 bc210800 b8210800  .*
  82198 a4210800 b0210800 a8210800           .*
 Contents of section \.data:
Index: ld-cris/tls-e-21.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-21.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-e-21.d
--- ld-cris/tls-e-21.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-e-21.d	24 Mar 2009 03:28:17 -0000
@@ -27,7 +27,7 @@ Contents of section \.tdata:
 #...
 Contents of section \.got:
  82124 00000000 00000000 00000000 01000000  .*
- 82134 fcffffff                             .*
+ 82134 80000000                             .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-e-80.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-80.d,v
retrieving revision 1.1
diff -p -u -r1.1 tls-e-80.d
--- ld-cris/tls-e-80.d	27 Jan 2009 22:31:19 -0000	1.1
+++ ld-cris/tls-e-80.d	24 Mar 2009 03:28:17 -0000
@@ -64,7 +64,7 @@ Contents of section \.tdata:
  820c0 28000000 2a000000 29000000 2a000000  .*
 Contents of section \.got:
  820d0 00000000 00000000 00000000 01000000  .*
- 820e0 00000000 b0ffffff 01000000 b0ffffff  .*
+ 820e0 00000000 b0ffffff 01000000 00000000  .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-gd-3.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-gd-3.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-gd-3.d
--- ld-cris/tls-gd-3.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-gd-3.d	24 Mar 2009 03:28:17 -0000
@@ -27,7 +27,7 @@ Contents of section \.tdata:
 #...
 Contents of section \.got:
  82124 00000000 00000000 00000000 01000000  .*
- 82134 fcffffff                             .*
+ 82134 80000000                             .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-gd-3h.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-gd-3h.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-gd-3h.d
--- ld-cris/tls-gd-3h.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-gd-3h.d	24 Mar 2009 03:28:17 -0000
@@ -27,7 +27,7 @@ Contents of section \.tdata:
 #...
 Contents of section \.got:
  82124 00000000 00000000 00000000 01000000  .*
- 82134 fcffffff                             .*
+ 82134 80000000                             .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-global-74.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-global-74.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-global-74.d
--- ld-cris/tls-global-74.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-global-74.d	24 Mar 2009 03:28:17 -0000
@@ -25,4 +25,4 @@ Contents of section .text:
 #...
 Contents of section \.got:
  820b4 0+ 0+ 0+ fcffffff  .*
- 820c4 010+ fcffffff  .*
+ 820c4 010+ 0+   .*
Index: ld-cris/tls-ldgde-14.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-ldgde-14.d,v
retrieving revision 1.3
diff -p -u -r1.3 tls-ldgde-14.d
--- ld-cris/tls-ldgde-14.d	27 Jan 2009 07:05:47 -0000	1.3
+++ ld-cris/tls-ldgde-14.d	24 Mar 2009 03:28:17 -0000
@@ -42,8 +42,8 @@ Contents of section \.tdata:
 #...
 Contents of section \.got:
  82138 00000000 00000000 00000000 01000000  .*
- 82148 00000000 01000000 f0ffffff 01000000  .*
- 82158 f4ffffff                             .*
+ 82148 00000000 01000000 80000000 01000000  .*
+ 82158 84000000   .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-ldgde-15.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-ldgde-15.d,v
retrieving revision 1.3
diff -p -u -r1.3 tls-ldgde-15.d
--- ld-cris/tls-ldgde-15.d	27 Jan 2009 07:05:47 -0000	1.3
+++ ld-cris/tls-ldgde-15.d	24 Mar 2009 03:28:17 -0000
@@ -42,8 +42,8 @@ Contents of section \.tdata:
 #...
 Contents of section \.got:
  82144 00000000 00000000 00000000 01000000  .*
- 82154 00000000 01000000 f0ffffff 01000000  .*
- 82164 f4ffffff                             .*
+ 82154 00000000 01000000 80000000 01000000  .*
+ 82164 84000000   .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-legd-16.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-legd-16.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-legd-16.d
--- ld-cris/tls-legd-16.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-legd-16.d	24 Mar 2009 03:28:17 -0000
@@ -39,7 +39,7 @@ Contents of section \.text:
 #...
 Contents of section \.got:
  82144 0+ 0+ 0+ 010+  .*
- 82154 f0ffffff 010+ f4ffffff  .*
+ 82154 80+ 010+ 840+   .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-legd-17.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-legd-17.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-legd-17.d
--- ld-cris/tls-legd-17.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-legd-17.d	24 Mar 2009 03:28:17 -0000
@@ -39,7 +39,7 @@ Contents of section \.text:
 #...
 Contents of section \.got:
  8213c 0+ 0+ 0+ 010+  .*
- 8214c f0ffffff 010+ f4ffffff  .*
+ 8214c 80+ 010+ 840+   .*
 
 Disassembly of section \.text:
 
Index: ld-cris/tls-local-57.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-local-57.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-local-57.d
--- ld-cris/tls-local-57.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-local-57.d	24 Mar 2009 03:28:17 -0000
@@ -20,4 +20,4 @@ Contents of section .text:
 #...
 Contents of section \.got:
  82124 0+ 0+ 0+ 010+  .*
- 82134 80ffffff  .*
+ 82134 040+   .*
Index: ld-cris/tls-local-58.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-local-58.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-local-58.d
--- ld-cris/tls-local-58.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-local-58.d	24 Mar 2009 03:28:17 -0000
@@ -21,4 +21,4 @@ Contents of section .text:
 #...
 Contents of section \.got:
  82128 0+ 0+ 0+ 010+  .*
- 82138 80ffffff  .*
+ 82138 040+   .*
Index: ld-cris/tls-local-59.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-local-59.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-local-59.d
--- ld-cris/tls-local-59.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-local-59.d	24 Mar 2009 03:28:17 -0000
@@ -22,4 +22,4 @@ Contents of section .text:
 #...
 Contents of section \.got:
  82130 0+ 0+ 0+ 80ffffff  .*
- 82140 010+ 80ffffff  .*
+ 82140 010+ 040+   .*

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]