0x08048311
0x08048313
0x08048316
0x08048319
0x0804831e
0x08048320
0x0804832a
0x08048334
0x0804833b
0x0804833f
0x08048341
0x08048343
0x08048346
0x08048349
0x0804834c
0x0804834f
0x08048351
0x08048353
0x08048358
0x08048359
End of assembler dump.
gcc -c try3.c -o try 没link的binary
gcc -o try try3.c 生成可以执行的binary
try: file format elf32-i386
try
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000004a 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000004 00000000 00000000 00000080 2**2 <<
2 .bss 00000000 00000000 00000000 00000084 2**2
ALLOC
3 .rodata 00000005 00000000 00000000 00000084 2**0 <<< x = "abcd"
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .note.GNU-stack 00000000 00000000 00000000 00000089 2**0
CONTENTS, READONLY
5 .comment 00000034 00000000 00000000 00000089 2**0
CONTENTS, READONLY
SYMBOL TABLE:
00000000 l df *ABS* 00000000 try3.c
00000000 l d .text 00000000
00000000 l d .data 00000000
00000000 l d .bss 00000000
00000000 l d .rodata 00000000
00000000 l d .note.GNU-stack 00000000
00000000 l d .comment 00000000
00000000 g O .data 00000004 loc
00000000 g F .text 0000004a main
00000004 O *COM* 00000004 x
RELOCATION RECORDS FOR [.text]:
OFFSET TYPE VALUE
00000012 R_386_32 x <<<一些用到的变量
00000016 R_386_32 .rodata
0000001c R_386_32 loc
代码种如果是内部变量不会出现在.data 和 .bss段, 只会以栈的形式出现,地址类似
$1 = (int *) 0xbfffae74
即在段中不会出现局部变量. 局部变量都是以寄存器的形式传递.