14 .rodata    00000019 0804855c 0804855c 0000055c 2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA  15 __ex_table  00000010 08048578 08048578 00000578 2**2  CONTENTS, ALLOC, LOAD, READONLY, DATA  16 .data     00000010 08049588 08049588 00000588 2**2  CONTENTS, ALLOC, LOAD, DATA  CONTENTS, READONLY  ………………………………  26 .note     00000078 00000000 00000000 0000290d 2**0  CONTENTS, READONLY 
  上面通过objdump显示出来的可执行程序的头部信息中,有一些是读者所熟悉的,例如.text、.data以及被笔者省略掉的.bss,而我们所关心的是12和15,也就是.fixup和__ex_table。对照hello.s中段的定义来看,两个段声明中的FLAGS字段分别为'ax'和'a',而objdump的结果显示,.fixup段是可重定位的代码段,__ex_table段是可重定位的数据段,两者是吻合的。 
  那么为什么要通过.section定义独立的段呢?为了解开这个问题的答案,我们需要进一步看看我们所写的代码在可执行文件中是如何表示的。 
$objdump --disassemble --section=.text hello   hello:   file format elf32-i386      Disassembly of section .text:   8048498: 8b 45 c4       mov   0xffffffc4(%ebp),%eax   804849b: 83 e0 03       and   $0x3,%eax   804849e: 8b 55 c4       mov   0xffffffc4(%ebp),%edx   80484a1: 89 d1        mov   %edx,%ecx   80484a3: c1 e9 02       shr   $0x2,%ecx   80484a6: 8d 7d c8       lea   0xffffffc8(%ebp),%edi   80484a9: 8b 75 f4       mov   0xfffffff4(%ebp),%esi   80484ac: f3 a5        repz movsl %ds:(%esi),%es:(%edi)   80484ae: 89 c1        mov   %eax,%ecx   80484b0: f3 a4        repz movsb %ds:(%esi),%es:(%edi)   80484b2: 89 c8        mov   %ecx,%eax  
  前面的hello.s中的汇编片断在可执行文件中就是通过上面的11条指定来表达,读者也许会问,由.section伪操作定义的段怎么不见了?别着急,慢慢往下看,由.section伪操作定义的段并不在正常的程序执行路径上,它们是被安排在可执行文件的其它地方了: 
 $objdump --disassemble --section=.fixup hello   hello:   file format elf32-i386      Disassembly of section .fixup:      08048530 <.fixup>:   8048530: 8d 4c 88 00      lea  0x0(%eax,%ecx,4),%ecx   8048534: e9 79 ff ff ff    jmp  80484b2 <main+0x42> 
		    
                       
		      
		      
		   |