How to save asm output from Linux kernel module assembly

I am working on a Linux kernel module for the 2.6.x kernel, and I need to look at the output of the assembly, although it is currently being done as a temporary file, deleted afterword. I would like the assembly to be mixed with my source C file, so I can easily track where my problem is. This is for the ARMv6 kernel, and apparently objdump does not support this architecture. I have included my makefile below.

ETREP=/xxSourceTreexx/
GNU_BIN=$(ETREP)/arm-none-linux-gnueabi/bin
CROSS_COMPILE := $(GNU_BIN)/arm-none-linux-gnueabi-
ARCH := arm
KDIR=$(ETREP)/linux-2.6.31/
MAKE= CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) make
obj-m += xxfile1xx.o

all:
 $(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
 $(MAKE) -C $(KDIR) M=$(PWD) clean
+5
source share
4 answers

Objdump supports this architecture. Your executable will be calledarm-none-linux-gnueabi-objdump

+7
source

, gcc gnu , objdump. gcc:

 -Wa,-alh=basename.s

basename , make:

 -Wa,-alh=$<.s

foo.c.s, . , , gcc, . gcc , .

Makefile CFLAGS ( "" "gnu info" .

+5

Linux, /Makefile.build.

#cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
cmd_cc_o_c = $(CC) $(c_flags) -c -Wa,-alh=$<.lst -o $(@D)/.tmp_$(@F) $<
+1

You can try the "-save-temps" flag in gcc. It works for me in my embedded project, I have not tried it when building the kernel.

0
source

All Articles