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: fix CRIS R_CRIS_nn_DTPREL relocation values


I missed this when correcting the GOT-located relocations recently.
Committed.

ld/testsuite:
	* ld-cris/tls-e-20.d, ld-cris/tls-e-20a.d, ld-cris/tls-e-22.d,
	ld-cris/tls-ldgde-14.d, ld-cris/tls-ldgde-15.d,
	ld-cris/tls-ldgdex-14.d, ld-cris/tls-ldgdex-15.d: Adjust for
	change in relocation values.

bfd:
	* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
	<R_CRIS_32_DTPREL>: Correct relocation value.

Index: elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.99
diff -p -u -r1.99 elf32-cris.c
--- elf32-cris.c	27 Jan 2009 06:07:54 -0000	1.99
+++ elf32-cris.c	27 Jan 2009 07:00:28 -0000
@@ -1687,9 +1687,14 @@ cris_elf_relocate_section (output_bfd, i
 	    }
 
 	  /* The thread-based offset to the local symbol is the
-	     relocation.  */
+	     relocation.
+	     For the executable, TLS data begins at the thread pointer plus
+	     the negative size of the TLS data.  For a DSO, that's part of
+	     the module TLS offset.  */
 	  relocation -= elf_hash_table (info)->tls_sec == NULL
-	    ? 0 : elf_hash_table (info)->tls_sec->vma;
+	    ? 0 : (elf_hash_table (info)->tls_sec->vma
+		   + (info->shared
+		      ? 0 : elf_hash_table (info)->tls_sec->size));
 	  break;
 
 	case R_CRIS_32_GD:

Index: ld-cris/tls-e-20.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-20.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-e-20.d
--- ld-cris/tls-e-20.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-e-20.d	27 Jan 2009 07:03:47 -0000
@@ -64,7 +64,7 @@ Disassembly of section \.text:
    80098:	6fae 1800 0000      	move\.d 18 <x2\+0x10>,\$r10
 #...
 000800a0 <tlsdsofn>:
-   800a0:	6fae 0000 0000      	move\.d 0 <x>,\$r10
+   800a0:	6fae f4ff ffff      	move\.d 0xfffffff4,\$r10
 #...
 000800a8 <tlsdsofn10>:
    800a8:	6fae 1400 0000      	move\.d 14 <x2\+0xc>,\$r10
Index: ld-cris/tls-e-20a.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-20a.d,v
retrieving revision 1.3
diff -p -u -r1.3 tls-e-20a.d
--- ld-cris/tls-e-20a.d	7 Jan 2009 03:27:11 -0000	1.3
+++ ld-cris/tls-e-20a.d	27 Jan 2009 07:03:47 -0000
@@ -102,7 +102,7 @@ Disassembly of section \.text:
 #...
 
 000800cc <tlsdsofn>:
-   800cc:	6fae 8000 0000      	move\.d 80 <x>,\$r10
+   800cc:	6fae f4ff ffff      	move\.d 0xfffffff4,\$r10
 #...
 
 000800d4 <tlsdsofn10>:
Index: ld-cris/tls-e-22.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-e-22.d,v
retrieving revision 1.1
diff -p -u -r1.1 tls-e-22.d
--- ld-cris/tls-e-22.d	25 Nov 2008 04:10:47 -0000	1.1
+++ ld-cris/tls-e-22.d	27 Jan 2009 07:03:47 -0000
@@ -35,5 +35,5 @@ Disassembly of section \.text:
    80094:	41b2                	moveq 1,\$r11
 #...
 00080098 <tlsdsofn>:
-   80098:	6fae 8000 0000      	move\.d 80 <x>,\$r10
+   80098:	6fae fcff ffff      	move\.d 0xfffffffc,\$r10
 #...
Index: ld-cris/tls-ldgde-14.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-ldgde-14.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-ldgde-14.d
--- ld-cris/tls-ldgde-14.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-ldgde-14.d	27 Jan 2009 07:03:47 -0000
@@ -51,8 +51,8 @@ Disassembly of section \.text:
    80094:	41b2                	moveq 1,\$r11
 #...
 00080098 <tlsdsofn>:
-   80098:	5fae 8800           	move\.w 0x88,\$r10
-   8009c:	5fbe 8c00           	move\.w 0x8c,\$r11
+   80098:	5fae f8ff           	move\.w 0xfff8,\$r10
+   8009c:	5fbe fcff           	move\.w 0xfffc,\$r11
 
 000800a0 <tlsdsofn0>:
    800a0:	5fae 1400           	move\.w 0x14,\$r10
Index: ld-cris/tls-ldgde-15.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-ldgde-15.d,v
retrieving revision 1.2
diff -p -u -r1.2 tls-ldgde-15.d
--- ld-cris/tls-ldgde-15.d	7 Jan 2009 03:27:11 -0000	1.2
+++ ld-cris/tls-ldgde-15.d	27 Jan 2009 07:03:47 -0000
@@ -51,8 +51,8 @@ Disassembly of section \.text:
    80094:	41b2                	moveq 1,\$r11
 #...
 00080098 <tlsdsofn>:
-   80098:	6fae 8800 0000      	move.d 88 <x1>,\$r10
-   8009e:	6fbe 8c00 0000      	move.d 8c <x2>,\$r11
+   80098:	6fae f8ff ffff      	move.d 0xfffffff8,\$r10
+   8009e:	6fbe fcff ffff      	move.d 0xfffffffc,\$r11
 000800a4 <tlsdsofn2>:
    800a4:	6fae 1400 0000      	move.d 14 <tls128\+0x14>,\$r10
 #...
Index: ld-cris/tls-ldgdex-14.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-ldgdex-14.d,v
retrieving revision 1.1
diff -p -u -r1.1 tls-ldgdex-14.d
--- ld-cris/tls-ldgdex-14.d	25 Nov 2008 04:10:47 -0000	1.1
+++ ld-cris/tls-ldgdex-14.d	27 Jan 2009 07:03:47 -0000
@@ -44,7 +44,7 @@ OFFSET   TYPE              VALUE 
 Contents of section .interp:
 #...
 Contents of section \.text:
- 801dc 41b20000 5fae8000 5fbe8400 5fae1400  .*
+ 801dc 41b20000 5faef8ff 5fbefcff 5fae1400  .*
  801ec 5fae1c00                             .*
 Contents of section \.tdata:
 #...
Index: ld-cris/tls-ldgdex-15.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/tls-ldgdex-15.d,v
retrieving revision 1.1
diff -p -u -r1.1 tls-ldgdex-15.d
--- ld-cris/tls-ldgdex-15.d	25 Nov 2008 04:10:47 -0000	1.1
+++ ld-cris/tls-ldgdex-15.d	27 Jan 2009 07:03:47 -0000
@@ -44,7 +44,7 @@ OFFSET   TYPE              VALUE 
 Contents of section \.interp:
 #...
 Contents of section \.text:
- 801dc 41b20000 6fae8000 00006fbe 84000000  .*
+ 801dc 41b20000 6faef8ff ffff6fbe fcffffff  .*
  801ec 6fae1400 00000000 6fae1c00 00000000  .*
 Contents of section \.tdata:
 #...
brgds, H-P


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