[PATCH v2] arm64: link with -z norelro for LLD or aarch64-elf

Catalin Marinas catalin.marinas at arm.com
Tue Jan 5 07:26:03 EST 2021


On Thu, 17 Dec 2020 16:24:32 -0800, Nick Desaulniers wrote:
> With GNU binutils 2.35+, linking with BFD produces warnings for vmlinux:
> aarch64-linux-gnu-ld: warning: -z norelro ignored
> 
> BFD can produce this warning when the target emulation mode does not
> support RELRO program headers, and -z relro or -z norelro is passed.
> 
> Alan Modra clarifies:
>   The default linker emulation for an aarch64-linux ld.bfd is
>   -maarch64linux, the default for an aarch64-elf linker is
>   -maarch64elf.  They are not equivalent.  If you choose -maarch64elf
>   you get an emulation that doesn't support -z relro.
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: link with -z norelro for LLD or aarch64-elf
      https://git.kernel.org/arm64/c/311bea3cb9ee

Also added the second Fixes tag with a cc stable.

-- 
Catalin




More information about the linux-arm-kernel mailing list