Skip to content
Commit 2882dab7 authored by Kesavan Yogeswaran's avatar Kesavan Yogeswaran Committed by Benjamin Cabé
Browse files

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: default avatarKesavan Yogeswaran <hikes@google.com>
parent 893f2e01
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment