]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld/testsuite: exclude relocs from section contributions PDB test
authorMark Harmstone <mark@harmstone.com>
Mon, 9 Sep 2024 21:01:00 +0000 (22:01 +0100)
committerMark Harmstone <mark@harmstone.com>
Wed, 11 Sep 2024 00:02:44 +0000 (01:02 +0100)
A bug in ld meant that we were erroneously generating image relocations
for .secrel32 ops, which we then reflected in our PDB section
contributions because the linker was adding a .reloc section.

This was incidental to what we were testing for, so pass
--disable-reloc-section to ld in order to ensure a consistent output.

ld/testsuite/ld-pe/pdb.exp
ld/testsuite/ld-pe/pdb2-section-contrib.d

index 7ca0fb66246fe481d5133b235e1a4cc4cbeee0bf..b530e0a639d1b66c138c07729dc453a3f6c87f40 100644 (file)
@@ -611,26 +611,6 @@ proc test_mod_info { mod_info } {
     if { [expr $off % 4] != 0 } {
        set off [expr $off + 4 - ($off % 4)]
     }
-
-    incr off 64
-
-    set obj3 [string range $mod_info $off [expr [string first \000 $mod_info $off] - 1]]
-    incr off [expr [string length $obj3] + 1]
-
-    set ar3 [string range $mod_info $off [expr [string first \000 $mod_info $off] - 1]]
-    incr off [expr [string length $ar3] + 1]
-
-    if [string equal $obj3 "* Linker *"] {
-       pass "Correct name for dummy object file"
-    } else {
-       fail "Incorrect name for dummy object file"
-    }
-
-    if [string equal $ar3 ""] {
-       pass "Correct archive name for dummy object file"
-    } else {
-       fail "Incorrect archive name for dummy object file"
-    }
 }
 
 proc test_section_contrib { section_contrib } {
@@ -677,7 +657,7 @@ proc test2 { } {
        return
     }
 
-    if ![ld_link $ld "tmpdir/pdb2.exe" "--pdb=tmpdir/pdb2.pdb --gc-sections -e foo tmpdir/pdb2a.o tmpdir/pdb2b.a"] {
+    if ![ld_link $ld "tmpdir/pdb2.exe" "--pdb=tmpdir/pdb2.pdb --gc-sections --disable-reloc-section -e foo tmpdir/pdb2a.o tmpdir/pdb2b.a"] {
        unsupported "Create PE image with PDB file"
        return
     }
index 5b1df9fd931af75a22e4acb20140e27f92354346..214eb11d3fb17ce717383d7861ca9cb33c56e17e 100644 (file)
@@ -7,6 +7,4 @@ Contents of section .data:
  0020 01000000 10000000 10000000 20000060  ............ ..`
  0030 01000000 00000000 00000000 02000000  ................
  0040 00000000 3d000000 40000040 00000000  ....=...@..@....
- 0050 00000000 00000000 04000000 00000000  ................
- 0060 0c000000 40000042 02000000 00000000  ....@..B........
- 0070 00000000                             ....            
+ 0050 00000000 00000000                    ........