From 72cd2c70977943054ff784b7278cef5262288f32 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 23 Sep 2024 15:26:29 +0200 Subject: 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. --- ld/testsuite/ld-pe/pe.exp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ld/testsuite/ld-pe/pe.exp') 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" -- cgit v1.1