Add support for generating assembly listin [...]
PATCH 1/1 Add support for generating assembly listin [...]
Hello list,
inside the automatic U-Boot patch tracking system a new ticket [DNX#2007011742000303] was created:
<snip>
Quoted 90 lines
From: Timur Tabi <[email protected]>
This patch adds support for generating assembly listing files when building
U-Boot. When "LISTING=1" is specified on the "make" command line, each compiled .c and .S file will generate a .lst file in the same location as
the corresponding .o file. Assembly listing files contain the assembly instructions and opcodes that the compiler generates.Signed-off-by Timur Tabi <[email protected]>--- Makefile | 2 +- README | 15 +++++++++++++++ config.mk | 20 +++++++++----------- 3 files changed, 25 insertions(+), 12 deletions(-)Makefile +1
-1@@ -2302,7 +2302,7 @@ atstk1002_config : unconfig clean: find $(OBJTREE) -type f \ \( -name 'core' -o -name '*.bak' -o -name '*~' \ - -o -name '*.o' -o -name '*.a' \) -print \ + -o -name '*.o' -o -name '*.a' -o -name '*.lst' \) -print \ | xargs rm -f rm -f $(obj)examples/hello_world $(obj)examples/timer \ $(obj)examples/eepro100_eeprom $(obj)examples/sched \README +0
-0@@ -2425,6 +2425,21 @@ this behavior and build U-Boot to some e Note that the command line "O=" setting overrides the BUILD_DIRenvironment
variable.+To generate an assembly listing file for each source file (.c and .S), add
+"LISTING=1" on the make command line when building your image:README +8
-0+ + make LISTING=1 all + +or + + make O=/tmp/build LISTING=1 all + +A listing file contains the assembly instructions (with opcodes) thatthe
+compiler generated when it compiled a source file. Each listing file will be
+located in the same place as the corresponding .o file, and it will have
+a .lst extension. Listing files are useful when you want to examine the
+compiler's output, which may not be what you expect. They are also usefulREADME +1
-0+with hardware debuggers that do not support source code. Please be aware that the Makefiles assume you are using GNU make, so for instance on NetBSD you might need to use "gmake" instead ofconfig.mk +4
-11@@ -224,22 +224,20 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATF ######################################################################### -ifndef REMOTE_BUILD - -%.s: %.S - $(CPP) $(AFLAGS) -o $@ $< -%.o: %.S - $(CC) $(AFLAGS) -c -o $@ $< -%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< - -else - $(obj)%.s: %.S $(CPP) $(AFLAGS) -o $@ $< + $(obj)%.o: %.S +ifdef LISTING + $(CC) $(AFLAGS) -Wa,-alds=$(@D)/$(*F).lst -c -o $@ $< +else
config.mk export TEXT_BASE PLATFORM_CPPFLAGS PLATF · line 243
Quoted 10 lines
config.mk +5
-0$(CC) $(AFLAGS) -c -o $@ $< +endif + $(obj)%.o: %.c +ifdef LISTING + $(CC) $(CFLAGS) -Wa,-alds=$(@D)/$(*F).lst -c -o $@ $< +else $(CC) $(CFLAGS) -c -o $@ $< endif
</snip>
Your U-Boot support team