FROMLIST: Makefile: fix GDB warning with CONFIG_RELR
GDB produces the following warning when debugging kernels built with
CONFIG_RELR:
BFD: /android0/linux-next/vmlinux: unknown type [0x13] section `.relr.dyn'
when loading a kernel built with CONFIG_RELR into GDB. It can also
prevent debugging symbols using such relocations.
Peter sugguests:
[That flag] means that lld will use dynamic tags and section type
numbers in the OS-specific range rather than the generic range. The
kernel itself doesn't care about these numbers; it determines the
location of the RELR section using symbols defined by a linker script.
Suggested-by: Peter Collingbourne <pcc@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/1057
Bug: 182884953
(am from https://lore.kernel.org/linux-kbuild/20210319000708.1694662-1-ndesaulniers@google.com/T/#u)
Change-Id: I2c2508da33fcf3cf8485d63be60c523970e3d120
diff --git a/Makefile b/Makefile
index f930295..7909a24 100644
--- a/Makefile
+++ b/Makefile
@@ -1022,7 +1022,7 @@
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