]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RISC-V: pi: Force hidden visibility for all symbol references
authorJesse Taube <jesse@rivosinc.com>
Tue, 9 Jul 2024 17:39:34 +0000 (13:39 -0400)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 5 Aug 2024 19:06:38 +0000 (12:06 -0700)
Eliminate all GOT entries in the .pi section, by forcing hidden
visibility for all symbol references, which informs the compiler that
such references will be resolved at link time without the need for
allocating GOT entries.

Include linux/hidden.h in Makefile, like arm64, for the
hidden visibility attribute.

Signed-off-by: Jesse Taube <jesse@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240709173937.510084-2-jesse@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/pi/Makefile

index 50bc5ef7dd2fe53e0144eb7b20916b30c50601c3..1ef7584be0c3994f9afd6b358965ce998830231f 100644 (file)
@@ -5,6 +5,7 @@ KBUILD_CFLAGS   := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \
                   -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \
                   $(call cc-option,-mbranch-protection=none) \
                   -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
+                  -include $(srctree)/include/linux/hidden.h \
                   -D__DISABLE_EXPORTS -ffreestanding \
                   -fno-asynchronous-unwind-tables -fno-unwind-tables \
                   $(call cc-option,-fno-addrsig)