summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2021-06-24 15:31:41 +0300
committerWill Deacon <will@kernel.org>2021-06-24 15:31:41 +0300
commit216fe62d6fa85b0a3a6a0e66f11da29db4be7490 (patch)
treeb93d5911f0f2e99a9116236e435b42a8993315d8
parente7cf636cba4cf0650169ddbc449645d03a5eedae (diff)
parent27f2a4db76e8d8a8b601fc1c6a7a17f88bd907ab (diff)
downloadlinux-216fe62d6fa85b0a3a6a0e66f11da29db4be7490.tar.xz
Merge branch 'for-next/build' into for-next/core
Tweak linker flags so that GDB can understand vmlinux when using RELR relocations. * for-next/build: Makefile: fix GDB warning with CONFIG_RELR
-rw-r--r--Makefile2
-rwxr-xr-xscripts/tools-support-relr.sh3
2 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e4468353425a..e38c74d0433c 100644
--- a/Makefile
+++ b/Makefile
@@ -1031,7 +1031,7 @@ LDFLAGS_vmlinux += $(call ld-option, -X,)
endif
ifeq ($(CONFIG_RELR),y)
-LDFLAGS_vmlinux += --pack-dyn-relocs=relr
+LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags
endif
# We never want expected sections to be placed heuristically by the
diff --git a/scripts/tools-support-relr.sh b/scripts/tools-support-relr.sh
index 45e8aa360b45..cb55878bd5b8 100755
--- a/scripts/tools-support-relr.sh
+++ b/scripts/tools-support-relr.sh
@@ -7,7 +7,8 @@ trap "rm -f $tmp_file.o $tmp_file $tmp_file.bin" EXIT
cat << "END" | $CC -c -x c - -o $tmp_file.o >/dev/null 2>&1
void *p = &p;
END
-$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr -o $tmp_file
+$LD $tmp_file.o -shared -Bsymbolic --pack-dyn-relocs=relr \
+ --use-android-relr-tags -o $tmp_file
# Despite printing an error message, GNU nm still exits with exit code 0 if it
# sees a relr section. So we need to check that nothing is printed to stderr.