diff options
| author | Ian McIntyre <ianpmcintyre@gmail.com> | 2023-09-29 14:48:23 -0400 |
|---|---|---|
| committer | Ian McIntyre <ianpmcintyre@gmail.com> | 2023-09-29 16:41:57 -0400 |
| commit | c485a9090a3b623a5de0c2e6da6c857770bf079a (patch) | |
| tree | b2c734c95abdd39ab79cf464a2b9d363c6fe49a6 /src/host | |
| parent | 6a16c13573c78e86a247565b9cbb98e5d0f04787 (diff) | |
Use an absolute address for __dcd
LLVM's lld and GNU's ld have different ways of handling assignments in
output sections. Unless we specify ABSOLUTE, ld treats the number '0' as
a relative address from the section start, 0x6000_0000. On the other
hand, lld treats '0' as if it were written with ABSOLUTE, and it ignores
the ABSOLUTE function. So depending on your linker, __dcd would change
values.
This commit forces an absolute number for __dcd, ensuring a consistent
value no matter the linker.
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/imxrt-boot-header.x | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/imxrt-boot-header.x b/src/host/imxrt-boot-header.x index ed9d789..615fc65 100644 --- a/src/host/imxrt-boot-header.x +++ b/src/host/imxrt-boot-header.x @@ -71,7 +71,7 @@ SECTIONS __dcd_start = .; KEEP(*(.dcd)); /* Device Configuration Data */ __dcd_end = .; - __dcd = ((__dcd_end - __dcd_start) > 0) ? __dcd_start : 0; + __dcd = ((__dcd_end - __dcd_start) > 0) ? __dcd_start : ABSOLUTE(0); *(.Reset); /* Jam the imxrt-rt reset handler into flash. */ *(.__pre_init); /* Also jam the pre-init function, since we need it to run before instructions are placed. */ . = ORIGIN(FLASH) + 0x2000; /* Reserve the remaining 8K as a convenience for a non-XIP boot. */ |
