aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan McIntyre <ianpmcintyre@gmail.com>2023-09-29 16:15:09 -0400
committerIan McIntyre <ianpmcintyre@gmail.com>2023-09-29 16:43:28 -0400
commitaf9f52fb4ac327240d949df220a5a51d8e73fb81 (patch)
treecbb06552591d1e0feddf60c9772cf106d6758a03
parentcfaac90ddfbab00aa5709c1f6dc2b796e63c6d77 (diff)
Relax asserts for .rodata and .text offsets
Haven't fully dug into this one, but GNU ld and LLVM lld have slightly different section positions when we cross from text to data. We can relax the asserts to show ordering without strictly requiring an offset.
-rw-r--r--tests/inspect_elf.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/inspect_elf.rs b/tests/inspect_elf.rs
index 5638801..34da382 100644
--- a/tests/inspect_elf.rs
+++ b/tests/inspect_elf.rs
@@ -360,10 +360,7 @@ fn baseline_teensy4(binary: &ImxrtBinary, dcd_at_runtime: u32) {
vector_table.address + vector_table.size,
"rodata LMA & VMA expected behind text"
);
- assert_eq!(
- binary.section_lma(".rodata"),
- binary.section_lma(".text") + aligned(text.size, 16)
- );
+ assert!(binary.section_lma(".rodata") >= binary.section_lma(".text") + aligned(text.size, 4));
let data = binary.section(".data").unwrap();
assert_eq!(
@@ -534,9 +531,8 @@ fn imxrt1170evk_cm7() {
vector_table.address + vector_table.size,
"rodata moved to DTCM behind vector table"
);
- assert_eq!(
- binary.section_lma(".rodata"),
- 0x3000_2000 + vector_table.size + aligned(text.size, 16),
+ assert!(
+ binary.section_lma(".rodata") >= 0x3000_2000 + vector_table.size + aligned(text.size, 4),
);
let data = binary.section(".data").unwrap();