[PW_SID:990359] vdso: Reject absolute relocations during build - #758
[PW_SID:990359] vdso: Reject absolute relocations during build#758linux-riscv-bot wants to merge 24 commits into
Conversation
While the numeric constants for relocations are architecture specific, it is still useful to get access to them from other architectures. Also the definitions are useful for userspace in general. For example tools processing elf files during a kernel cross-compilation can make use of them. Introduce a dedicated header for them, similar to the elf-em.h header. For now the header is empty but it will be filled step by step in upcomming commits. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. One arm64 header is also changed as it duplicates an arm definition. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These constants are useful for cross-platform userspace, for example to process ELF files during kernel cross-compilation. Move them from the kernel-private architecture-specific header to the UAPI. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Pick up changes from the UAPI ELF header files. This picks up general changes to elf.h, elf-em.h which was forgotten previously and the new elf-r.h. 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, see commit 0c314cd ("arm64: vdso: Work around invalid absolute relocations from GCC") Introduce a tool to check for absolute relocations during the build, as the current inline-shell logic is not expressive enough. 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. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These are used by userspace and are necessary for the vdsocheck tool. They share the numbers with their 64-bit variants. Also update the copy in tools/ so they can be used by vdsocheck. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Jan Stancek <jstancek@redhat.com> 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> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
These are used by userspace and are necessary for the vdsocheck tool. Also update the copy in tools/ so they can be used by vdsocheck. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The vdsocheck tool validates the object files and final .so library. It can detect if the compiler created relocations which are incompatible with the vDSO which need to be worked around. Wire it up for the architecture. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
All users of the generic vDSO are now using the vdsocheck tool. Remove the now unnecessary kconfig option. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v4,01/24] elf, uapi: Add a header for relocation constants" |
|
Patch 1: "[v4,01/24] elf, uapi: Add a header for relocation constants" |
|
Patch 1: "[v4,01/24] elf, uapi: Add a header for relocation constants" |
|
Patch 1: "[v4,01/24] elf, uapi: Add a header for relocation constants" |
|
Patch 1: "[v4,01/24] elf, uapi: Add a header for relocation constants" |
|
Patch 1: "[v4,01/24] elf, uapi: Add a header for relocation constants" |
|
Patch 22: "[v4,22/24] MIPS: ELF: Add more PC-relative relocation definitions" |
|
Patch 22: "[v4,22/24] MIPS: ELF: Add more PC-relative relocation definitions" |
|
Patch 22: "[v4,22/24] MIPS: ELF: Add more PC-relative relocation definitions" |
|
Patch 22: "[v4,22/24] MIPS: ELF: Add more PC-relative relocation definitions" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 23: "[v4,23/24] MIPS: vdso: Enable the vdsocheck tool" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
|
Patch 24: "[v4,24/24] vdso/vdsocheck: Drop the transitional kconfig option" |
PR for series 990359 applied to workflow__riscv__fixes
Name: vdso: Reject absolute relocations during build
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=990359
Version: 4