当前位置: 技术问答>linux和unix
请教格式
来源: 互联网 发布时间:2015-11-19
本文导语: m.c,源代码如下: int i = 1; int j = 2; extern int sum(); int main() { int s; s = sum(i, j); return 0; } $ gcc -c m.c $ objdump -x m.0 m.o: file format elf32-i386 m.o architecture: i386, flags 0x...
m.c,源代码如下:
int i = 1;
int j = 2;
extern int sum();
int main()
{
int s;
s = sum(i, j);
return 0;
}
$ gcc -c m.c
$ objdump -x m.0
m.o: file format elf32-i386
m.o
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000003d 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000008 00000000 00000000 00000074 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 0000007c 2**2
ALLOC
3 .note.GNU-stack 00000000 00000000 00000000 0000007c 2**0
CONTENTS, READONLY
4 .comment 0000002d 00000000 00000000 0000007c 2**0
CONTENTS, READONLY
SYMBOL TABLE:
00000000 l df *ABS* 00000000 m.c
00000000 l d .text 00000000
00000000 l d .data 00000000
00000000 l d .bss 00000000
00000000 l d .note.GNU-stack 00000000
00000000 l d .comment 00000000
00000000 g O .data 00000004 i
00000004 g O .data 00000004 j
00000000 g F .text 0000003d main
00000000 *UND* 00000000 sum
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000021 R_386_32 j
00000027 R_386_32 i
0000002c R_386_PC32 sum
哪位能把这份.o文件里面各种符号都是代表什么意思告诉一下?
int i = 1;
int j = 2;
extern int sum();
int main()
{
int s;
s = sum(i, j);
return 0;
}
$ gcc -c m.c
$ objdump -x m.0
m.o: file format elf32-i386
m.o
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000003d 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000008 00000000 00000000 00000074 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 0000007c 2**2
ALLOC
3 .note.GNU-stack 00000000 00000000 00000000 0000007c 2**0
CONTENTS, READONLY
4 .comment 0000002d 00000000 00000000 0000007c 2**0
CONTENTS, READONLY
SYMBOL TABLE:
00000000 l df *ABS* 00000000 m.c
00000000 l d .text 00000000
00000000 l d .data 00000000
00000000 l d .bss 00000000
00000000 l d .note.GNU-stack 00000000
00000000 l d .comment 00000000
00000000 g O .data 00000004 i
00000004 g O .data 00000004 j
00000000 g F .text 0000003d main
00000000 *UND* 00000000 sum
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000021 R_386_32 j
00000027 R_386_32 i
0000002c R_386_PC32 sum
哪位能把这份.o文件里面各种符号都是代表什么意思告诉一下?
|
自己看ELF的格式吧:)