Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
elfloader/linker: Fix arithmetic in the linker script
Linker's operators precedence [1] which follows C makes "+" higher than shifting "<<". Thus, ". + CONFIG_MAX_NODES" will be shifted by 12 in this case, which is wrong and is not the intended behavior. In lld (which properly implements C's operators precedence, unlike ld.bfd), the arithmetic results in a significant value. The outcome is either a huge ELF file size, or a linking error (e.g., relocation R_AARCH64_ADR_PREL_PG_HI21 out of range). This commit fixes the arithmetic and uses += which is more portable. [1] https://sourceware.org/binutils/docs/ld.html Sponsored by: DARPA. Signed-off-by: Hesham Almatary <[email protected]>
- Loading branch information