RFC arm64: use PIE code generation for KASLR kernel
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 14 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | arm64: jump_label: use more precise asm constraintsarch/ | +4 | 5 replies | |
| 2/2 | arm64: kernel: switch to PIE code generation for relocatable kernelsarch/ arch/ | +8 | 9 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] arm64: use PIE code generation for KASLR kernel
Building the KASLR kernel without -fpie but linking it with -pie works in practice, but it is not something that is explicitly supported by the toolchains - it happens to work because the default 'small' code model used by both GCC and Clang relies mostly on ADRP+ADD/LDR to generate symbol references.
Code generation with -fpie used to result in unnecessary overhead, as all references to symbols with external visibility use emitted via entries in the GOT, resulting in an additional load from memory for each global variable access.
However, we can now manage this my using 'hidden' visibility (which is already used in places such as the decompressor or the EFI stub), so we can enable -fpie code generation without the overhead.
This series is RFC given that, beyond switching to a better supported combination of compiler and linker options, I am not aware of any advantages or disadvantages of making this change.
Ard Biesheuvel (2):
arm64: jump_label: use more precise asm constraints
arm64: kernel: switch to PIE code generation for relocatable kernels
arch/arm64/Makefile | 4 ++++ arch/arm64/include/asm/jump_label.h | 8 ++++---- arch/arm64/kernel/vmlinux.lds.S | 9 ++++----- 3 files changed, 12 insertions(+), 9 deletions(-)
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel