[lld] d7f32c2 - [ELF,test] eh-frame-hdr-sdata8.s: use AT() to avoid huge PT_LOAD segments
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 16 10:24:54 PST 2026
Author: Fangrui Song
Date: 2026-02-16T10:24:48-08:00
New Revision: d7f32c28a79a6b6701e0d54791b87115bd60f125
URL: https://github.com/llvm/llvm-project/commit/d7f32c28a79a6b6701e0d54791b87115bd60f125
DIFF: https://github.com/llvm/llvm-project/commit/d7f32c28a79a6b6701e0d54791b87115bd60f125.diff
LOG: [ELF,test] eh-frame-hdr-sdata8.s: use AT() to avoid huge PT_LOAD segments
Use AT() to ensure output sections with huge addresses are placed in separate
PT_LOAD segments. Without this, 2.lds and 3.lds created a huge PT_LOAD
segment, making the sparse file size larger than 4GiB, unsupported by
some 32-bit systems.
https://github.com/llvm/llvm-project/pull/179089#issuecomment-3908549089
Added:
Modified:
lld/test/ELF/eh-frame-hdr-sdata8.s
Removed:
################################################################################
diff --git a/lld/test/ELF/eh-frame-hdr-sdata8.s b/lld/test/ELF/eh-frame-hdr-sdata8.s
index f249e2418282c..4e843ddcddae4 100644
--- a/lld/test/ELF/eh-frame-hdr-sdata8.s
+++ b/lld/test/ELF/eh-frame-hdr-sdata8.s
@@ -1,4 +1,4 @@
-# REQUIRES: x86
+# REQUIRES: x86 && llvm-64-bits
## Test that .eh_frame_hdr uses DW_EH_PE_sdata8 instead of DW_EH_PE_sdata4 when
## eh_frame_ptr or a table entry exceeds the 32-bit range.
@@ -66,11 +66,13 @@ _start:
.dc.a __ehdr_start
#--- 1.lds
+## Use AT() to place output sections with huge addresses in separate PT_LOAD
+## segments, avoiding a huge PT_LOAD whose sparse file size would exceed 4GiB.
SECTIONS {
. = 0x1000;
.eh_frame_hdr : {}
.eh_frame : {}
- .text 0x100002000 : {}
+ .text 0x100002000 : AT(0x2000) {}
}
#--- 2.lds
@@ -78,7 +80,7 @@ SECTIONS {
. = 0x1000;
.text : {}
.eh_frame_hdr : {}
- .eh_frame 0x100002000 : {}
+ .eh_frame 0x100002000 : AT(0x2000) {}
}
#--- 3.lds
@@ -95,7 +97,7 @@ SECTIONS {
.relr.dyn : {}
.data : { *(.data) . += 63*8-40 + SIZEOF(.eh_frame_hdr); *(.data.*) }
. = SIZEOF(.relr.dyn) > 16 ? 0x100008000 : 0x3000;
- .text : {}
+ .text : AT(0x2000) {}
ASSERT(SIZEOF(.relr.dyn) > 16, ".relr.dyn size should increase from 16 to 24")
}
More information about the llvm-commits
mailing list