[PW_SID:970729] vdso: Reject absolute relocations during build#512
[PW_SID:970729] vdso: Reject absolute relocations during build#512linux-riscv-bot wants to merge 4 commits into
Conversation
All vDSO objects need the same treatment. To make changes to both the list of objects and the list of removed flags easier, introduce a helper variable. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
All the other architectures supporting LTO (x86, arm64, loongarch) do not use it for the vDSO. Its is problematic for some upcoming compile-time validation of the generated object code. The LTO object files do not contain the necessary relocation information and -flto-fat-objects is not compatible with clang < 16. For consistency and to enable the mentioned compile-time checks, disable LTO for the vDSO. The vDSO heavily uses __always_inline anyways. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
All vDSO code needs to be completely position independent. Symbol references are marked as hidden so the compiler emits PC-relative relocations. However there are cases where the compiler may still emit absolute relocations, as they are valid in regular PIC DSO code. These would be resolved by the linker and will break at runtime. This has been observed on arm64 under some circumstances, see commit 0c314cd ("arm64: vdso: Work around invalid absolute relocations from GCC") Introduce a build-time check for absolute relocations. The check is done on the object files as the relocations will not exist anymore in the final DSO. As there is no extension point for the compilation of each object file, perform the validation in vdso_check. Debug information can contain legal absolute relocations and readelf can not print relocations from the .text section only. Make use of the fact that all global vDSO symbols follow the naming pattern "vdso_u_". Link: https://lore.kernel.org/lkml/aApGPAoctq_eoE2g@t14ultra/ Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120002 Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 1: "[v3,1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 2: "[v3,2/3] riscv: vdso: Disable LTO for the vDSO" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
|
Patch 3: "[v3,3/3] vdso: Reject absolute relocations during build" |
0b44c19 to
8023d1f
Compare
PR for series 970729 applied to workflow__riscv__fixes
Name: vdso: Reject absolute relocations during build
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=970729
Version: 3