[PATCH 3/4] purgatory: Generate map file

Geoff Levand geoff at infradead.org
Wed Mar 18 16:04:03 PDT 2015


To aid in debugging purgatory and its relocation generate a linker map
file when purgatory is built.

Signed-off-by: Geoff Levand <geoff at infradead.org>
---
 purgatory/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/purgatory/Makefile b/purgatory/Makefile
index 6b17e71..2d6b2c0 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -12,6 +12,7 @@ PURGATORY_SRCS =
 PURGATORY_SRCS += purgatory/purgatory.c
 PURGATORY_SRCS += purgatory/printf.c
 PURGATORY_SRCS += purgatory/string.c
+PURGATORY_MAP = purgatory/purgatory.map
 
 dist += purgatory/Makefile $(PURGATORY_SRCS)				\
 	purgatory/include/purgatory.h purgatory/include/string.h
@@ -59,7 +60,8 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 			-I$(shell $(CC) -print-file-name=include)
 $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
 			-Wl,--no-undefined -nostartfiles -nostdlib \
-			-nodefaultlibs -e purgatory_start -r
+			-nodefaultlibs -e purgatory_start -r \
+			-Wl,-Map=$(PURGATORY_MAP)
 
 $(PURGATORY): $(PURGATORY_OBJS)
 	$(MKDIR) -p $(@D)
-- 
2.1.0





More information about the kexec mailing list