[coreboot] [commit] r5827 - in trunk: . src/arch/i386

repository service svn at coreboot.org
Thu Sep 23 17:38:55 CEST 2010


Author: mjones
Date: Thu Sep 23 17:38:55 2010
New Revision: 5827
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5827

Log:
Generate and extract debug sysmbols for coreboot. *.debug files can be
used for source level debug.

Signed-off-by: Marc Jones <marcj303 at gmail.com>
Acked-by: Peter Stuge <peter at stuge.se>

Modified:
   trunk/Makefile
   trunk/src/arch/i386/Makefile.bigbootblock.inc
   trunk/src/arch/i386/Makefile.bootblock.inc
   trunk/src/arch/i386/Makefile.inc

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Thu Sep 23 01:42:32 2010	(r5826)
+++ trunk/Makefile	Thu Sep 23 17:38:55 2010	(r5827)
@@ -287,7 +287,7 @@
 # abspath is a workaround for romcc
 INCLUDES += -include $(abspath $(obj)/config.h)
 
-CFLAGS = $(INCLUDES) -Os -nostdinc -pipe
+CFLAGS = $(INCLUDES) -Os -nostdinc -pipe -g
 CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
 CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
 CFLAGS += -Wstrict-aliasing -Wshadow

Modified: trunk/src/arch/i386/Makefile.bigbootblock.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.bigbootblock.inc	Thu Sep 23 01:42:32 2010	(r5826)
+++ trunk/src/arch/i386/Makefile.bigbootblock.inc	Thu Sep 23 17:38:55 2010	(r5827)
@@ -32,4 +32,7 @@
 	@printf "    LINK       $(subst $(obj)/,,$(@))\n"
 	$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(obj)/ldscript.ld $(initobjs)
 	$(NM) -n $(obj)/coreboot | sort > $(obj)/coreboot.map
+	$(OBJCOPY) --only-keep-debug $@ $(obj)/bootblock.debug
+	$(OBJCOPY) --strip-debug $@
+	$(OBJCOPY) --add-gnu-debuglink=$(obj)/bootblock.debug $@
 

Modified: trunk/src/arch/i386/Makefile.bootblock.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.bootblock.inc	Thu Sep 23 01:42:32 2010	(r5826)
+++ trunk/src/arch/i386/Makefile.bootblock.inc	Thu Sep 23 17:38:55 2010	(r5827)
@@ -75,6 +75,9 @@
 	@printf "    LINK       $(subst $(obj)/,,$(@))\n"
 	$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(obj)/bootblock/ldscript.ld $<
 	$(NM) -n $(obj)/bootblock.elf | sort > $(obj)/bootblock.map
+	$(OBJCOPY) --only-keep-debug $@ $(obj)/bootblock.debug
+	$(OBJCOPY) --strip-debug $@
+	$(OBJCOPY) --add-gnu-debuglink=$(obj)/bootblock.debug $@
 
 #######################################################################
 # Build the romstage
@@ -89,6 +92,9 @@
 	printf ';\nAUTO_XIP_ROM_BASE = CONFIG_ROMBASE & ~(CONFIG_XIP_ROM_SIZE - 1);\n' >> $(obj)/location.ld
 	$(CC) -nostdlib -nostartfiles -static -o $(obj)/romstage.elf -L$(obj) -T $(obj)/romstage/ldscript.ld $(initobjs)
 	$(NM) -n $(obj)/romstage.elf | sort > $(obj)/romstage.map
+	$(OBJCOPY) --only-keep-debug $(obj)/romstage.elf $(obj)/romstage.debug
+	$(OBJCOPY) --strip-debug $(obj)/romstage.elf
+	$(OBJCOPY) --add-gnu-debuglink=$(obj)/romstage.debug $(obj)/romstage.elf
 	$(OBJCOPY) -O binary $(obj)/romstage.elf $@
 
 $(obj)/romstage/ldscript.ld: $$(ldscripts) $(obj)/ldoptions

Modified: trunk/src/arch/i386/Makefile.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.inc	Thu Sep 23 01:42:32 2010	(r5826)
+++ trunk/src/arch/i386/Makefile.inc	Thu Sep 23 17:38:55 2010	(r5827)
@@ -107,6 +107,9 @@
 	@printf "    CC         $(subst $(obj)/,,$(@))\n"
 	$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(src)/arch/i386/coreboot_ram.ld $(obj)/coreboot_ram.o
 	$(NM) -n $(obj)/coreboot_ram | sort > $(obj)/coreboot_ram.map
+	$(OBJCOPY) --only-keep-debug $@ $(obj)/coreboot_ram.debug
+	$(OBJCOPY) --strip-debug $@
+	$(OBJCOPY) --add-gnu-debuglink=$(obj)/coreboot_ram.debug $@
 
 $(obj)/coreboot_ram.o: $(obj)/arch/i386/lib/c_start.o $$(drivers) $(obj)/coreboot.a $(LIBGCC_FILE_NAME)
 	@printf "    CC         $(subst $(obj)/,,$(@))\n"
@@ -125,6 +128,9 @@
 $(obj)/coreboot_ap: $(obj)/mainboard/$(MAINBOARDDIR)/ap_romstage.o
 	@printf "    CC         $(subst $(obj)/,,$(@))\n"
 	$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(src)/arch/i386/init/ldscript_apc.lb $^
+	$(OBJCOPY) --only-keep-debug $@ $(obj)/coreboot_ap.debug
+	$(OBJCOPY) --strip-debug $@
+	$(OBJCOPY) --add-gnu-debuglink=$(obj)/coreboot_ap.debug $@
 	$(NM) -n $(obj)/coreboot_ap | sort > $(obj)/coreboot_ap.map
 
 




More information about the coreboot mailing list