Skip to content

Add support to build bl2 with new binutils 2.39+

Vitor Sato Eschholz requested to merge vsatoes/binutils_2.39 into mtk-ddr-loader

Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces of a new warning when linking the bl*.elf in the form:

ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions

These new warnings are enabled by default to secure elf binaries:

Following the reasoning in 1, we set "-z noexecstack" for all linkers (although LLVM's LLD defaults to it). Based on 2, we add a macro helper to check if the linker supports a given option and add --no-warn-rwx-segments since this a ld.bfd related.

This commit was mainly based on 3.

Signed-off-by: Vitor Sato Eschholz vsatoes@baylibre.com

Merge request reports

Loading