Add objdump and readelf to xcompile and use the results. This kills a few hardcodes introduced with my checker.
I'd appreciate tests with non-Linux machines.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: corebootv3-check_illegal_global_vars/Makefile =================================================================== --- corebootv3-check_illegal_global_vars/Makefile (Revision 794) +++ corebootv3-check_illegal_global_vars/Makefile (Arbeitskopie) @@ -96,6 +96,8 @@ LD := $(LD_$(ARCH)) NM := $(NM_$(ARCH)) OBJCOPY := $(OBJCOPY_$(ARCH)) +OBJDUMP := $(OBJDUMP_$(ARCH)) +READELF := $(READELF_$(ARCH)) AR := $(AR_$(ARCH))
CFLAGS += $(CFLAGS_$(ARCH)) Index: corebootv3-check_illegal_global_vars/util/xcompile/xcompile =================================================================== --- corebootv3-check_illegal_global_vars/util/xcompile/xcompile (Revision 794) +++ corebootv3-check_illegal_global_vars/util/xcompile/xcompile (Arbeitskopie) @@ -63,6 +63,8 @@ searchgnu ld >/dev/null && echo "LD_x86 := $(searchgnu ld) -b elf32-i386 -melf_i386" searchgnu nm >/dev/null && echo "NM_x86 := $(searchgnu nm)" searchgnu objcopy >/dev/null && echo "OBJCOPY_x86 := $(searchgnu objcopy)" + searchgnu objdump >/dev/null && echo "OBJDUMP_x86 := $(searchgnu objdump)" + searchgnu readelf >/dev/null && echo "READELF_x86 := $(searchgnu readelf)" ;; "x86") if [ "$OS" != "Darwin" ]; then @@ -74,6 +76,8 @@ searchgnu ld >/dev/null && echo "LD_x86 := $(searchgnu ld)" searchgnu nm >/dev/null && echo "NM_x86 := $(searchgnu nm)" searchgnu objcopy >/dev/null && echo "OBJCOPY_x86 := $(searchgnu objcopy)" + searchgnu objdump >/dev/null && echo "OBJDUMP_x86 := $(searchgnu objdump)" + searchgnu readelf >/dev/null && echo "READELF_x86 := $(searchgnu readelf)" else CC=`find /opt/local/bin/ -name "i386-elf-gcc-*"` if [ "$CC" == "" ]; then @@ -86,6 +90,8 @@ echo "LD_x86 := i386-elf-ld" echo "NM_x86 := i386-elf-nm" echo "OBJCOPY_x86 := i386-elf-objcopy" + echo "OBJDUMP_x86 := i386-elf-objdump" + echo "READELF_x86 := i386-elf-readelf" echo "INTLCFLAGS := -I/opt/local/include" echo "INTLLIBS := -L/opt/local/lib -lintl" fi @@ -99,6 +105,8 @@ echo "LD_x86 := i386-linux-ld" echo "NM_x86 := i386-linux-nm" echo "OBJCOPY_x86 := i386-linux-objcopy" + echo "OBJDUMP_x86 := i386-linux-objdump" + echo "READELF_x86 := i386-elf-readelf" ;; esac
Index: corebootv3-check_illegal_global_vars/arch/x86/Makefile =================================================================== --- corebootv3-check_illegal_global_vars/arch/x86/Makefile (Revision 794) +++ corebootv3-check_illegal_global_vars/arch/x86/Makefile (Arbeitskopie) @@ -145,7 +145,7 @@
$(Q)# .data and .bss must be empty because they aren't handled $(Q)printf " CHECK stage0 (non-empty writable/allocatable sections)\n" - $(Q)./util/sectionchecker/sectionchecker objdump readelf $(STAGE0_OBJ) + $(Q)./util/sectionchecker/sectionchecker $(OBJDUMP) $(READELF) $(STAGE0_OBJ)
$(Q)# Note: we invoke gcc (instead of ld directly) here, as we hit $(Q)# strange problems in the past. It seems that only gcc knows how @@ -271,7 +271,7 @@
$(Q)# .data and .bss must be empty because they aren't handled $(Q)printf " CHECK initram (non-empty writable/allocatable sections)\n" - $(Q)./util/sectionchecker/sectionchecker objdump readelf $(obj)/coreboot.initram_partiallylinked.o + $(Q)./util/sectionchecker/sectionchecker $(OBJDUMP) $(READELF) $(obj)/coreboot.initram_partiallylinked.o
$(Q)printf " WRAP $(subst $(shell pwd)/,,$(@)) (PIC->non-PIC)\n" $(Q)$(NM) --undefined-only $(obj)/coreboot.initram_partiallylinked.o |\