2010年3月11日 星期四

arch/arm/kernel/process.o: Error: can't resolve `.text' {.text section} - `.LFB955' {.ARM.extab section}

Linux-2.6.31.1

Compiling failed after enable following two config:
CONFIG_FUNCTION_TRACER
CONFIG_ARM_UNWIND

  CC      arch/arm/kernel/process.o
/tmp/ccFkIp0z.s: Assembler messages:
/tmp/ccFkIp0z.s:1757: Error: can't resolve `.text' {.text section} - `.LFB955' {.ARM.extab section}
make[1]: *** [arch/arm/kernel/process.o] Error 1
make: *** [arch/arm/kernel] Error 2

Remove CONFIG_ARM_UNWIND could avoid the problem.


process.o fails to compile w/ ARM_UNWIND
http://article.gmane.org/gmane.linux.ports.arm.kernel/63682
After applying this patch, compiling would passed. However, the bootpImage wouldn't boot, even without CONFIG_TRACE_FUNCTION (with CONFIG_ARM_UNWIND):
[    3.610000] RAMDISK: Couldn't find valid RAM disk image starting at 0.
[    3.640000] List of all partitions:
[    3.650000] No filesystem could mount root, tried:  ext3 ext2 cramfs vfat
[    3.660000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[    3.670000] Backtrace: 
[    3.680000] [<c0035154>] (dump_backtrace+0x0/0x110) from [<c0302c54>] (dump_stack+0x1c/0x20)
[    3.700000]  r7:c80d9000 r6:c0028850 r5:c80d9016 r4:c8021f58
[    3.720000] [<c0302c38>] (dump_stack+0x0/0x20) from [<c0302ca0>] (panic+0x48/0x124)
[    3.740000] [<c0302c58>] (panic+0x0/0x124) from [<c0008f78>] (mount_block_root+0x264/0x2bc)
[    3.770000]  r3:00000000 r2:80000000 r1:c8021f58 r0:c038eb3d
[    3.780000] [<c0008d14>] (mount_block_root+0x0/0x2bc) from [<c0009024>] (mount_root+0x54/0x6c)
[    3.810000] [<c0008fd0>] (mount_root+0x0/0x6c) from [<c00091ac>] (prepare_namespace+0x170/0x1d4)
[    3.830000]  r5:c0028808 r4:c041ad38
[    3.840000] [<c000903c>] (prepare_namespace+0x0/0x1d4) from [<c0008470>] (kernel_init+0xdc/0x110)
[    3.870000]  r5:c0026e3c r4:c041ab18
[    3.880000] [<c0008394>] (kernel_init+0x0/0x110) from [<c005440c>] (do_exit+0x0/0x698)
[    3.910000]  r5:00000000 r4:00000000


without CONFIG_ARM_UNWIND and CONFIG_TRACE_FUNCTION: ....

what is stack winding and stack unwinding
http://www.unix.com/high-level-programming/41253-what-stack-winding-stack-unwinding.html
When program run, each function(data, registers, program counter, etc) is mapped onto the stack as it is called. Because the function calls other functions, they too are mapped onto the stack. This is stack winding.

Unwinding is the removal of the functions from the stack in the reverse order.


透過 User-Mode-Linux 來學習核心設計 (1)
http://blog.linux.org.tw/~jserv/archives/001871.html

[wiki]Call stack
http://en.wikipedia.org/wiki/Call_stack
[wiki] Unwinding
http://en.wikipedia.org/wiki/Call_stack#Unwinding

Using as: Using as, the Gnu Assembler, Chapter 8. Assembler Directives

8.78. .section name
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-assembler/section.html
assemble the following code into a section named name.

8.67. .previous
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-assembler/previous.html
In terms of the section stack, this directive swaps the current section with the top section on the section stack.

8.73. .pushsection name, subsection
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-assembler/pushsection.html
This directive pushes the current section (and subsection) onto the top of the section stack, and then replaces the current section and subsection with name and subsection.

8.68. .popsection
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-assembler/popsection.html
This directive replaces the current section (and subsection) with the top section (and subsection) on the section stack. This section is popped off the stack.

ftrace(1) - Linux man page
http://linux.die.net/man/1/ftrace

A look at ftrace
http://lwn.net/Articles/322666/

ftrace 简介
http://www.ibm.com/developerworks/cn/linux/l-cn-ftrace/index.html

沒有留言: