[root@localhost test]# objdump -V GNU objdump 2.17.50.0.6-14.el5 20061020 Copyright 2005 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.
**查看档案库文件中的信息: **
1 2 3 4 5 6
[root@localhost test]# objdump -a libmy2.a In archive libmy2.a: myfile.o: file format elf32-i386 rwxrwxrwx 0/0 2724 Nov 16 16:06 2009 myfile.o mytest.o: file format elf32-i386 rw-r--r-- 0/0 727 Jul 13 15:32 2011 mytest.o
[root@localhost test]# objdump -i BFD header file version 2.17.50.0.6-14.el5 20061020 elf32-i386 (header little endian, data little endian) i386 a.out-i386-linux (header little endian, data little endian) i386 efi-app-ia32 (header little endian, data little endian) i386 elf64-x86-64 (header little endian, data little endian) i386 elf64-little (header little endian, data little endian) i386 elf64-big (header big endian, data big endian) i386 elf32-little (header little endian, data little endian) i386 elf32-big (header big endian, data big endian) i386 srec (header endianness unknown, data endianness unknown) i386 symbolsrec (header endianness unknown, data endianness unknown) i386 tekhex (header endianness unknown, data endianness unknown) i386 binary (header endianness unknown, data endianness unknown) i386 ihex (header endianness unknown, data endianness unknown) i386 trad-core (header endianness unknown, data endianness unknown)
[root@localhost test]# objdump -t mytest.o mytest.o: file format elf32-i386
SYMBOL TABLE: 00000000 l df *ABS* 00000000 mytest.cpp 00000000 l d .text 00000000 .text 00000000 l d .data 00000000 .data 00000000 l d .bss 00000000 .bss 00000000 l d .debug_abbrev 00000000 .debug_abbrev 00000000 l d .debug_info 00000000 .debug_info 00000000 l d .debug_line 00000000 .debug_line 00000000 l d .debug_frame 00000000 .debug_frame 00000000 l d .debug_loc 00000000 .debug_loc 00000000 l d .debug_pubnames 00000000 .debug_pubnames 00000000 l d .debug_aranges 00000000 .debug_aranges 00000000 l d .note.GNU-stack 00000000 .note.GNU-stack 00000000 l d .comment 00000000 .comment 00000000 g F .text 0000000c _Z9printTestv 00000000 *UND* 00000000 __gxx_personality_v0 0000000c g F .text 00000013 _Z10printTest2v
这里,输出的信息类似nm -s命令的输出,相比较之下,nm命令的输出如下:
1 2 3 4
[root@localhost test]# nm -s mytest.o 0000000c T _Z10printTest2v 00000000 T _Z9printTestv U __gxx_personality_v0
**显示文件的符号表入口,将底层符号解码并表示成用户级别: **
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[root@localhost test]# objdump -t -C mytest.o mytest.o: file format elf32-i386 SYMBOL TABLE: 00000000 l df *ABS* 00000000 mytest.cpp 00000000 l d .text 00000000 .text 00000000 l d .data 00000000 .data 00000000 l d .bss 00000000 .bss 00000000 l d .debug_abbrev 00000000 .debug_abbrev 00000000 l d .debug_info 00000000 .debug_info 00000000 l d .debug_line 00000000 .debug_line 00000000 l d .debug_frame 00000000 .debug_frame 00000000 l d .debug_loc 00000000 .debug_loc 00000000 l d .debug_pubnames 00000000 .debug_pubnames 00000000 l d .debug_aranges 00000000 .debug_aranges 00000000 l d .note.GNU-stack 00000000 .note.GNU-stack 00000000 l d .comment 00000000 .comment 00000000 g F .text 0000000c printTest() 00000000 *UND* 00000000 __gxx_personality_v0 0000000c g F .text 00000013 printTest2()