soc: nxp: Fix boot header placement when using lld
As well described in a previous PR [1], the GNU ld and LLVM lld linkers treat the location counter (`.`) differently. lld always inteprets the location counter as an absolute address whereas ld interprets it as an offset from the start of the current object. The NXP boot header linker script files use `.` assignment to specify an offset within the rom_start region (ld-style). This causes lld to error out since it interprets this as the location counter moving backwards. To fix this, re-use the idea from the previous PR [1]: replace `. = FOO` with `. += FOO - (. - __rom_start_address)` This sets the location counter in a way that works with both ld and lld. [1] https://github.com/zephyrproject-rtos/zephyr/pull/58315 Signed-off-by:Kesavan Yogeswaran <hikes@google.com>
Loading
Please sign in to comment