aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-11-18 19:33:51 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-11-18 19:33:51 +1100
commitc38c2e8d08e03e905b72334747a9f8795f3526c2 (patch)
tree94a7e5ec6124998eee1d1a27577370b03304c4e6 /Makefile.main
parent94796c825b0708c8c86e7135d60c435fc3fd00a5 (diff)
downloadskiboot-c38c2e8d08e03e905b72334747a9f8795f3526c2.zip
skiboot-c38c2e8d08e03e905b72334747a9f8795f3526c2.tar.gz
skiboot-c38c2e8d08e03e905b72334747a9f8795f3526c2.tar.bz2
Add symbolic backtraces and expose skiboot map to Linux
We use a double link technique, doing a first pass with a .o containing a dummy symbol map, then re-linking with a new .o Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'Makefile.main')
-rw-r--r--Makefile.main15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile.main b/Makefile.main
index aff145e..129d38b 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -119,14 +119,19 @@ OBJS += $(LIBPORE)
endif
OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ) gitid.o
+OBJS_1 = $(OBJS) asm/dummy_map.o
+OBJS_2 = $(OBJS) asm/real_map.o
+
$(TARGET).lid: $(TARGET).elf
$(call Q,OBJCOPY, $(OBJCOPY) -O binary -S $^ $@, $@)
-$(TARGET).elf: $(OBJS) $(TARGET).lds $(KERNEL)
- $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(OBJS) -o $@, $@)
+$(TARGET).tmp.elf: $(OBJS_1) $(TARGET).lds $(KERNEL)
+ $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(OBJS_1) -o $@, $@)
+
+asm/real_map.o : $(TARGET).tmp.map
-$(TARGET).map: $(TARGET).elf
- $(call Q,NM, $(NM) -n $< | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $@, $@)
+$(TARGET).elf: $(OBJS_2) $(TARGET).lds $(KERNEL)
+ $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(OBJS_2) -o $@, $@)
$(SUBDIRS):
$(call Q,MKDIR,mkdir $@, $@)
@@ -165,7 +170,7 @@ cscope:
clean:
$(RM) *.[odsa] $(SUBDIRS:%=%/*.[odsa])
- $(RM) $(TARGET).elf $(TARGET).lid $(TARGET).map $(TARGET).lds
+ $(RM) *.elf $(TARGET).lid *.map $(TARGET).lds
$(RM) include/asm-offsets.h gitid.c
distclean: clean