debug 版 | dbg.o: file format elf32-powerpc-vxworks architecture: powerpc:common, flags 0x00000011: HAS_RELOC, HAS_SYMS start address 0x00000000 |
release版 | rls.o: file format elf32-powerpc-vxworks architecture: powerpc:common, flags 0x00000012: EXEC_P, HAS_SYMS start address 0x00100000 |
debug 版 | rls.o: file format elf32-powerpc-vxworks |
release版 | rls.o: file format elf32-powerpc-vxworks Program Header: LOAD off 0x00000060 vaddr 0x00100000 paddr 0x00100000 align 2**5 filesz 0x00b87da0 memsz 0x0115e328 flags rwx |
Sections: Idx Name Size VMA LMA File off Algn 0 .text 009e4540 00100000 00100000 00000060 2**4 CONTENTS, ALLOC, LOAD, CODE 1 .init$00 000000 00ae4540 00ae4540 009e45a0 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .init$99 00000010 00ae455c 00ae455c 009e45bc 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 3 .fini$00 0000001c 00ae456c 00ae456c 009e45cc 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 4 .fini$99 00000010 00ae4588 00ae4588 009e45e8 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 5 .sdata2 00000318 00ae4598 00ae4598 009e45f8 2**3 CONTENTS, ALLOC, LOAD, DATA 6 .data 0019dfa0 00ae48c0 00ae48c0 009e4920 2**5 CONTENTS, ALLOC, LOAD, DATA 7 .sdata 00000dd0 00c82860 00c82860 00b828c0 2**3 CONTENTS, ALLOC, LOAD, DATA 8 .sbss 00001440 00c83630 00c83630 00b83690 2**3 ALLOC 9 .bss 005d9a70 00c84a70 00c84a70 00b83690 2**4 ALLOC 10 .bss._ZZN10dmsbHarqMs11notifyBurstEjjE7dbgUsed 00000004 0125e4e0 0125e4e0 00b83690 2**2 ALLOC 11 .bss._ZZN10dmsbHarqMs11notifyBurstEjjE8dbgFrame 00000004 0125e4e4 0125e4e4 00b83690 2**2 ALLOC 12 .debug_frame 00002400 00000000 00000000 00b83690 2**2 CONTENTS, READONLY, DEBUGGING |
start address 0x00100000 Program Header: LOAD off 0x00000060 vaddr 0x00100000 paddr 0x00100000 align 2**5 filesz 0x00b83630 memsz 0x0115e4e8 flags rwx |
进行的操作 | 结果 |
源码: 最简单的函数调用 | void test(void) {} void test2(void) { test(); } |
ccppc -c test.c objdump -d test.o: bl本来应该跳转到函数test,但由于该文件还没有链接,因此只是调转到下一行。 | lwz r3,8(r31) bl 48 <test2+0x1c> mr r0,r3 |
objdumpppc -r: -r命令可以打出重定向符号。可以看到0x48处有个符号需要重定向。文件链接时,会用test的地址代替0x48处的跳转地址。 | test.o: file format elf32-powerpc-vxworks RELOCATION RECORDS FOR [.text]: OFFSET TYPE VALUE 00000048 R_PPC_REL24 test |
Debug与Release | GNU objdump (Wind River VxWorks G++ 4.1-82) 2.17.50.20070509 Copyright 2007 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. |
源码 | class T1 { public: int T1Test(); }; |
未加-C | 01800054 g F .text 00000028 _ZN2T15T1TetsEv |
加上-C | 01800054 g F .text 00000028 T1::T1Test() |
欢迎光临 天空小小岛技术网站 (http://tkxxd.net/) | Powered by Discuz! X3.1 |