aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-09-23 15:26:29 +0200
committerJan Beulich <jbeulich@suse.com>2024-09-23 15:26:29 +0200
commit72cd2c70977943054ff784b7278cef5262288f32 (patch)
tree9d49f5e9745eb7596a4348d2fd5e5848f682d5d5 /ld/testsuite
parente02f4847761b2d80309b7ca1f7b90b4fb8caf96a (diff)
downloadgdb-72cd2c70977943054ff784b7278cef5262288f32.zip
gdb-72cd2c70977943054ff784b7278cef5262288f32.tar.gz
gdb-72cd2c70977943054ff784b7278cef5262288f32.tar.bz2
ld/PE: no base relocs for section (relative) ones
Even more so than image relative (RVA) relocations, section relative ones as well as section ones should not have base relocations created in the final PE image. Reportedly section relative relocations will want using for TLS support in the (Windows) compiler. While there also correct the names for two of the "image base" relocs.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-pe/pe.exp14
-rw-r--r--ld/testsuite/ld-pe/secidx-reloc.d5
-rw-r--r--ld/testsuite/ld-pe/secrel-reloc.d5
3 files changed, 24 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index 6a1afef..04b53b8 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -37,6 +37,10 @@ if {[istarget i*86-*-cygwin*]
{{objdump -s secrel_64.d}} "secrel.x"}
{".secidx" "--disable-reloc-section" "" "" {secidx1.s secidx2.s}
{{objdump -s secidx_64.d}} "secidx.x"}
+ {".secrel32 w/ relocs" "--enable-reloc-section" "" "" {secrel1.s secrel2.s}
+ {{objdump -p secrel-reloc.d}} "secrel.x"}
+ {".secidx w/ relocs" "--enable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -p secidx-reloc.d}} "secidx.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports64.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
@@ -48,6 +52,10 @@ if {[istarget i*86-*-cygwin*]
{{objdump -s secrel.d}} "secrel.x"}
{".secidx" "--disable-auto-import --disable-reloc-section" "" "" {secidx1.s secidx2.s}
{{objdump -s secidx.d}} "secidx.x"}
+ {".secrel32 w/ relocs" "--disable-auto-import --enable-reloc-section" "" "" {secrel1.s secrel2.s}
+ {{objdump -p secrel-reloc.d}} "secrel-reloc.x"}
+ {".secidx w/ relocs" "--disable-auto-import --enable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -p secidx-reloc.d}} "secidx-reloc.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
@@ -57,6 +65,8 @@ if {[istarget i*86-*-cygwin*]
set pe_tests {
{".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {".secrel32 w/ relocs" "" "" "" {secrel1.s secrel2.s}
+ {{objdump -p secrel-reloc.d}} "secrel-reloc.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
@@ -68,6 +78,10 @@ if {[istarget i*86-*-cygwin*]
{{objdump -s secrel.d}} "secrel.x"}
{".secidx" "--disable-reloc-section" "" "" {secidx1.s secidx2.s}
{{objdump -s secidx.d}} "secidx.x"}
+ {".secrel32 w/ relocs" " --enable-reloc-section" "" "" {secrel1.s secrel2.s}
+ {{objdump -p secrel-reloc.d}} "secrel-reloc.x"}
+ {".secidx w/ relocs" " --enable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -p secidx-reloc.d}} "secidx-reloc.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
diff --git a/ld/testsuite/ld-pe/secidx-reloc.d b/ld/testsuite/ld-pe/secidx-reloc.d
new file mode 100644
index 0000000..043182d
--- /dev/null
+++ b/ld/testsuite/ld-pe/secidx-reloc.d
@@ -0,0 +1,5 @@
+#...
+The Data Directory
+#...
+Entry 5 0+ 0+ Base Relocation Directory \[\.reloc\]
+#...
diff --git a/ld/testsuite/ld-pe/secrel-reloc.d b/ld/testsuite/ld-pe/secrel-reloc.d
new file mode 100644
index 0000000..043182d
--- /dev/null
+++ b/ld/testsuite/ld-pe/secrel-reloc.d
@@ -0,0 +1,5 @@
+#...
+The Data Directory
+#...
+Entry 5 0+ 0+ Base Relocation Directory \[\.reloc\]
+#...