diff options
author | Fangrui Song <maskray@google.com> | 2023-05-02 09:41:05 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2023-05-02 14:12:45 +0200 |
commit | 0fddb79bf283a561eb81f09d01f5ac8f61bf8966 (patch) | |
tree | 07d6471e07776fabb3ed9f10261500859a205cf3 /arch/arm/boot/dts/intel-ixp4xx-reference-design.dtsi | |
parent | arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text (diff) | |
download | linux-0fddb79bf283a561eb81f09d01f5ac8f61bf8966.tar.xz linux-0fddb79bf283a561eb81f09d01f5ac8f61bf8966.zip |
arm64: lds: move .got section out of .text
Currently, the .got section is placed within the output section .text.
However, when .got is non-empty, the SHF_WRITE flag is set for .text
when linked by lld. GNU ld recognizes .text as a special section and
ignores the SHF_WRITE flag. By renaming .text, we can also get the
SHF_WRITE flag.
The kernel has performed R_AARCH64_RELATIVE resolving very early, and can
then assume that .got is read-only. Let's move .got to the vmlinux_rodata
pseudo-segment.
As Ard Biesheuvel notes:
"This matters to consumers of the vmlinux ELF representation of the
kernel image, such as syzkaller, which disregards writable PT_LOAD
segments when resolving code symbols. The kernel itself does not care
about this distinction, but given that the GOT contains data and not
code, it does not require executable permissions, and therefore does
not belong in .text to begin with."
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Fangrui Song <maskray@google.com>
Link: https://lore.kernel.org/r/20230502074105.1541926-1-maskray@google.com
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm/boot/dts/intel-ixp4xx-reference-design.dtsi')
0 files changed, 0 insertions, 0 deletions