From ce71e53d7439d6c74c800124e456ccafaa4f55a3 Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Tue, 23 Feb 2016 17:55:58 -0500 Subject: [PATCH 1/2] make: set OBJDUMP = $(PREFIX)objdump for gnu targets. --- Makefile.vars | 2 ++ cpu/Makefile.include.gnu | 1 + 2 files changed, 3 insertions(+) diff --git a/Makefile.vars b/Makefile.vars index 56cad8ebb5..ba5e8d0e06 100644 --- a/Makefile.vars +++ b/Makefile.vars @@ -35,6 +35,8 @@ export LINK # The command used to link the files. Must take the export LINKFLAGS # Flags to supply in the linking step. export OBJCOPY # The command used to create the HEXFILE. export OFLAGS # The parameter for OBJCOPY, e.g. to strip the debug information. +export OBJDUMP # The command used to create the assembly listing. +export OBJDUMPFLAGS # The parameter for OBJDUMP. export SIZE # The command to read to size of the ELF sections. export UNDEF # Set by the BOARD's and CPU's Makefile.include, this contains object files with must not be used in the ELFFILE even if the if no call to the functions. export WERROR # Treat all compiler warnings as errors if set to 1 (see -Werror flag in GCC manual) diff --git a/cpu/Makefile.include.gnu b/cpu/Makefile.include.gnu index f571741121..a2e5764c57 100644 --- a/cpu/Makefile.include.gnu +++ b/cpu/Makefile.include.gnu @@ -6,4 +6,5 @@ export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy +export OBJDUMP = $(PREFIX)objdump export DBG = $(GDBPREFIX)gdb From 332d8c7818ba049a4afc00cd1feafd9acc4b5aaf Mon Sep 17 00:00:00 2001 From: Ian Martin Date: Wed, 24 Feb 2016 12:14:05 -0500 Subject: [PATCH 2/2] make: use $(OBJDUMP) and $(OBJDUMPFLAGS) in the main objdump target too. --- Makefile.include | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.include b/Makefile.include index 525f86fd68..55ff7092e2 100644 --- a/Makefile.include +++ b/Makefile.include @@ -316,12 +316,15 @@ reset: exit 1; } $(RESET) $(RESET_FLAGS) +# Default OBJDUMPFLAGS for platforms which do not specify it: +OBJDUMPFLAGS ?= -S -D -h + objdump: - $(AD)command -v $(PREFIX)objdump >/dev/null 2>&1 || \ + $(AD)command -v $(OBJDUMP) >/dev/null 2>&1 || \ { $(COLOR_ECHO) \ - '${COLOR_RED} Objdump program $(PREFIX)objdump not found. Aborting.${COLOR_RESET}'; \ + '${COLOR_RED} Objdump program $(OBJDUMP) not found. Aborting.${COLOR_RESET}'; \ exit 1; } - $(PREFIX)objdump -S -D -h $(ELFFILE) | less + $(OBJDUMP) $(OBJDUMPFLAGS) $(ELFFILE) | less # Generate an XML file containing all macro definitions and include paths for # use in Eclipse CDT