This is the mail archive of the binutils@sources.redhat.com 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 ld/testsuite/ld-cris regarding section reorder of2004-05


Finally fixed the failures apparently introduced at least in
part by the section-reordering bits in
<URL:http://sources.redhat.com/ml/binutils/2004-05/msg00143.html>.
Some of the adjustments are also necessary after getting rid of
.dynsym STT_SECTION symbols, IIUC, which was a separate patch.
For the record, the test-cases should have been adjusted as part
of those patches.

Testsuite results for cris-axis-linux-gnu are again clean
(referring to my latest update; fingers crossed), and my
autotester (which a .procmailrc bug rendered inactive for a few
months including the time of the change) will hopefully stop
nagging me to investigate.

The benefit of the section reordering wasn't apparent to me, so I had
to look it up in the discussion thread.  FWIW, it's fine by me, but I
think the rationale (that the new order makes overwriting the GOT from
accesses to .data in case of a bug/exploit less likely) should have
been made clear, for example with a comment in the code.  If I visit
that corner of the code and remember it, I'll add one as obvious.

	* ld-cris/expdyn1.d, ld-cris/expdyn5.d, ld-cris/expdyn6.d,
	ld-cris/expdyn7.d, ld-cris/gotplt2.d, ld-cris/gotplt3.d,
	ld-cris/libdso-1.d, ld-cris/libdso-2.d, ld-cris/locref1.d,
	ld-cris/nodyn4.d, ld-cris/nodyn5.d: Adjust for reordered
	sections.

Index: ld-cris/expdyn1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/expdyn1.d,v
retrieving revision 1.2
diff -u -p -r1.2 expdyn1.d
--- ld-cris/expdyn1.d	7 Mar 2002 14:03:05 -0000	1.2
+++ ld-cris/expdyn1.d	21 Aug 2004 09:18:20 -0000
@@ -10,5 +10,5 @@
 DYNAMIC SYMBOL TABLE:
 #...
 00080206 g    DF .text	00000002 expfn
-00082220 g    DO .data	00000000 expobj
+00082... g    DO .data	00000000 expobj
 #pass
Index: ld-cris/expdyn5.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/expdyn5.d,v
retrieving revision 1.1
diff -u -p -r1.1 expdyn5.d
--- ld-cris/expdyn5.d	7 Nov 2002 13:25:48 -0000	1.1
+++ ld-cris/expdyn5.d	21 Aug 2004 09:18:20 -0000
@@ -9,5 +9,5 @@

 .*:     file format elf32-cris
 Contents of section \.got:
- 8228c 24220800 00000000 00000000 06020800  .*
- 8229c 20220800                             .*
+ 82288 20220800 00000000 00000000 06020800  .*
+ 82298 9c220800                             .*
Index: ld-cris/expdyn6.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/expdyn6.d,v
retrieving revision 1.1
diff -u -p -r1.1 expdyn6.d
--- ld-cris/expdyn6.d	7 Nov 2002 13:25:48 -0000	1.1
+++ ld-cris/expdyn6.d	21 Aug 2004 09:18:20 -0000
@@ -9,5 +9,5 @@

 .*:     file format elf32-cris
 Contents of section \.got:
- 822ec 84220800 00000000 00000000 00000000  .*
- 822fc 4e020800 80220800                    .*
+ 822e8 80220800 00000000 00000000 00000000  .*
+ 822f8 4e020800 00230800                    .*
Index: ld-cris/expdyn7.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/expdyn7.d,v
retrieving revision 1.1
diff -u -p -r1.1 expdyn7.d
--- ld-cris/expdyn7.d	7 Nov 2002 13:25:48 -0000	1.1
+++ ld-cris/expdyn7.d	21 Aug 2004 09:18:20 -0000
@@ -9,5 +9,5 @@

 .*:     file format elf32-cris
 Contents of section \.got:
- 822ec 84220800 00000000 00000000 04230800  .*
- 822fc 4b020800 80220800                    .*
+ 822e8 80220800 00000000 00000000 04230800  .*
+ 822f8 4b020800 00230800                    .*
Index: ld-cris/gotplt2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/gotplt2.d,v
retrieving revision 1.1
diff -u -p -r1.1 gotplt2.d
--- ld-cris/gotplt2.d	22 Mar 2004 04:06:06 -0000	1.1
+++ ld-cris/gotplt2.d	21 Aug 2004 09:18:20 -0000
@@ -16,22 +16,22 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0000235c R_CRIS_GLOB_DAT   dsofn
+000022bc R_CRIS_GLOB_DAT   dsofn

 Contents of section .*
 #...
 Contents of section \.rela\.got:
- 02a8 5c230000 0a120000 00000000           .*
+ 01f8 bc220000 0a0c0000 00000000           .*
 Contents of section \.text:
- 02b4 5f1d0c00 30096f1d 0c000000 30090000  .*
- 02c4 6f0d0c00 0000611a 6f3e7cdf ffff0000  .*
+ 0204 5f1d0c00 30096f1d 0c000000 30090000  .*
+ 0214 6f0d0c00 0000611a 6f3e6cdf ffff0000  .*
 Contents of section \.dynamic:
- 22e0 04000000 94000000 05000000 5c020000  .*
- 22f0 06000000 2c010000 0a000000 49000000  .*
- 2300 0b000000 10000000 07000000 a8020000  .*
- 2310 08000000 0c000000 09000000 0c000000  .*
- 2320 00000000 00000000 00000000 00000000  .*
- 2330 00000000 00000000 00000000 00000000  .*
- 2340 00000000 00000000 00000000 00000000  .*
+ 2240 04000000 94000000 05000000 ac010000  .*
+ 2250 06000000 dc000000 0a000000 49000000  .*
+ 2260 0b000000 10000000 07000000 f8010000  .*
+ 2270 08000000 0c000000 09000000 0c000000  .*
+ 2280 00000000 00000000 00000000 00000000  .*
+ 2290 00000000 00000000 00000000 00000000  .*
+ 22a0 00000000 00000000 00000000 00000000  .*
 Contents of section \.got:
- 2350 e0220000 00000000 00000000 00000000  .*
+ 22b0 40220000 00000000 00000000 00000000  .*
Index: ld-cris/gotplt3.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/gotplt3.d,v
retrieving revision 1.1
diff -u -p -r1.1 gotplt3.d
--- ld-cris/gotplt3.d	22 Mar 2004 04:06:06 -0000	1.1
+++ ld-cris/gotplt3.d	21 Aug 2004 09:18:20 -0000
@@ -13,23 +13,23 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0000235c R_CRIS_GLOB_DAT   dsofn
+000022bc R_CRIS_GLOB_DAT   dsofn

 Contents of section .*
 #...
 Contents of section \.rela\.got:
- 02a8 5c230000 0a120000 00000000           .*
+ 01f8 bc220000 0a0c0000 00000000           .*
 Contents of section \.text:
- 02b4 5f1d0c00 30096f1d 0c000000 30090000  .*
- 02c4 6f0d0c00 0000611a 6f3e7cdf ffff0000  .*
- 02d4 0f050000                             .*
+ 0204 5f1d0c00 30096f1d 0c000000 30090000  .*
+ 0214 6f0d0c00 0000611a 6f3e6cdf ffff0000  .*
+ 0224 0f050000                             .*
 Contents of section \.dynamic:
- 22e0 04000000 94000000 05000000 5c020000  .*
- 22f0 06000000 2c010000 0a000000 49000000  .*
- 2300 0b000000 10000000 07000000 a8020000  .*
- 2310 08000000 0c000000 09000000 0c000000  .*
- 2320 00000000 00000000 00000000 00000000  .*
- 2330 00000000 00000000 00000000 00000000  .*
- 2340 00000000 00000000 00000000 00000000  .*
+ 2240 04000000 94000000 05000000 ac010000  .*
+ 2250 06000000 dc000000 0a000000 49000000  .*
+ 2260 0b000000 10000000 07000000 f8010000  .*
+ 2270 08000000 0c000000 09000000 0c000000  .*
+ 2280 00000000 00000000 00000000 00000000  .*
+ 2290 00000000 00000000 00000000 00000000  .*
+ 22a0 00000000 00000000 00000000 00000000  .*
 Contents of section \.got:
- 2350 e0220000 00000000 00000000 00000000  .*
+ 22b0 40220000 00000000 00000000 00000000  .*
Index: ld-cris/libdso-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/libdso-1.d,v
retrieving revision 1.3
diff -u -p -r1.3 libdso-1.d
--- ld-cris/libdso-1.d	9 Jul 2002 02:41:15 -0000	1.3
+++ ld-cris/libdso-1.d	21 Aug 2004 09:18:20 -0000
@@ -9,5 +9,5 @@

 DYNAMIC SYMBOL TABLE:
 #...
-000002.[02468ace] g    DF .text	00000000 dsofn
+00000[12].[02468ace] g    DF .text	00000000 dsofn
 #pass
Index: ld-cris/libdso-2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/libdso-2.d,v
retrieving revision 1.2
diff -u -p -r1.2 libdso-2.d
--- ld-cris/libdso-2.d	28 May 2002 01:44:46 -0000	1.2
+++ ld-cris/libdso-2.d	21 Aug 2004 09:18:20 -0000
@@ -19,9 +19,9 @@ There are 15 section headers.*
   \[ 5\] \.gnu\.version_d    VERDEF  .*
   \[ 6\] \.rela\.dyn         RELA    .*
   \[ 7\] \.text             PROGBITS .*
-  \[ 8\] \.data             PROGBITS .*
-  \[ 9\] \.dynamic          DYNAMIC  .*
-  \[10\] \.got              PROGBITS .*
+  \[ 8\] \.dynamic          DYNAMIC  .*
+  \[ 9\] \.got              PROGBITS .*
+  \[10\] \.data             PROGBITS .*
   \[11\] \.bss              NOBITS   .*
   \[12\] \.shstrtab         STRTAB   .*
   \[13\] \.symtab           SYMTAB   .*
@@ -29,24 +29,16 @@ There are 15 section headers.*
 #...
 Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
 #...
-000022f4  0000000c R_CRIS_RELATIVE                              00000234
+00002234  0000000c R_CRIS_RELATIVE                              00000184
 #...
-Symbol table '\.dynsym' contains 14 entries:
+Symbol table '\.dynsym' contains 6 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
      0: 0+     0 NOTYPE  LOCAL  DEFAULT  UND
-     1: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    1
-     2: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    2
-     3: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    3
-     4: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    4
-     5: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    5
-     6: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    6
-     7: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    7
-     8: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    8
-     9: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    9
-    10: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   10
-    11: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   11
-    12: 0+     0 OBJECT  GLOBAL DEFAULT  ABS TST1
-    13: 0+238     0 FUNC    GLOBAL DEFAULT    7 export_1@@TST1
+     1: [0-9a-f]+     0 SECTION LOCAL  DEFAULT    7
+     2: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   10
+     3: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   11
+     4: 0+     0 OBJECT  GLOBAL DEFAULT  ABS TST1
+     5: 0+188     0 FUNC    GLOBAL DEFAULT    7 export_1@@TST1

 Symbol table '\.symtab' contains 23 entries:
    Num:    Value  Size Type    Bind   Vis      Ndx Name
@@ -65,11 +57,11 @@ Symbol table '\.symtab' contains 23 entr
     12: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   12
     13: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   13
     14: [0-9a-f]+     0 SECTION LOCAL  DEFAULT   14
-    15: 0+2260     0 OBJECT  LOCAL  DEFAULT  ABS _DYNAMIC
-    16: 0+22f8     0 NOTYPE  LOCAL  DEFAULT  ABS __bss_start
-    17: 0+22f8     0 NOTYPE  LOCAL  DEFAULT  ABS _edata
-    18: 0+22e8     0 OBJECT  LOCAL  DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
-    19: 0+2300     0 NOTYPE  LOCAL  DEFAULT  ABS _end
-    20: 0+234     0 FUNC    LOCAL  DEFAULT    7 dsofn
+    15: 0+21a0     0 OBJECT  LOCAL  DEFAULT  ABS _DYNAMIC
+    16: 0+2238     0 NOTYPE  LOCAL  DEFAULT  ABS __bss_start
+    17: 0+2238     0 NOTYPE  LOCAL  DEFAULT  ABS _edata
+    18: 0+2228     0 OBJECT  LOCAL  DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
+    19: 0+2240     0 NOTYPE  LOCAL  DEFAULT  ABS _end
+    20: 0+184     0 FUNC    LOCAL  DEFAULT    7 dsofn
     21: 0+     0 OBJECT  GLOBAL DEFAULT  ABS TST1
-    22: 0+238     0 FUNC    GLOBAL DEFAULT    7 export_1
+    22: 0+188     0 FUNC    GLOBAL DEFAULT    7 export_1
Index: ld-cris/locref1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/locref1.d,v
retrieving revision 1.1
diff -u -p -r1.1 locref1.d
--- ld-cris/locref1.d	18 Jun 2003 04:11:13 -0000	1.1
+++ ld-cris/locref1.d	21 Aug 2004 09:18:20 -0000
@@ -12,12 +12,12 @@
 SYMBOL TABLE:
 #...
 0+80076 g     F \.text	0+2 expfn
-0+820a0 g     O \.data	0+ expobj
+0+820ac g     O \.data	0+ expobj
 #...
-0+820a4 g     O \.got	0+ _GLOBAL_OFFSET_TABLE_
+0+820a0 g     O \.got	0+ _GLOBAL_OFFSET_TABLE_
 #...
 Disassembly of section \.text:
 #...
 0+80078 <y>:
-   80078:	6fae d2df ffff  .*
-   8007e:	6fbe fcff ffff  .*
+   80078:	6fae d6df ffff  .*
+   8007e:	6fbe 0c00 0000  .*
Index: ld-cris/nodyn4.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/nodyn4.d,v
retrieving revision 1.1
diff -u -p -r1.1 nodyn4.d
--- ld-cris/nodyn4.d	12 Jul 2002 15:51:54 -0000	1.1
+++ ld-cris/nodyn4.d	21 Aug 2004 09:18:20 -0000
@@ -15,5 +15,5 @@ There are 2 program headers, .*
   LOAD [0-9a-fx ]+ RW  0x2000
 #...
    00     \.text[ ]*
-   01     \.data \.got \.bss[ ]*
+   01     \.got \.data \.bss[ ]*
 #pass
Index: ld-cris/nodyn5.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-cris/nodyn5.d,v
retrieving revision 1.1
diff -u -p -r1.1 nodyn5.d
--- ld-cris/nodyn5.d	7 Nov 2002 13:25:48 -0000	1.1
+++ ld-cris/nodyn5.d	21 Aug 2004 09:18:20 -0000
@@ -9,5 +9,5 @@

 .*:     file format elf32-cris
 Contents of section \.got:
- 820c4 00000000 00000000 00000000 dc200800  .*
- 820d4 76000800 c0200800                    .*
+ 820c0 00000000 00000000 00000000 dc200800  .*
+ 820d0 76000800 d8200800                    .*

brgds, H-P


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