我们来看一下目标文件和链接后的可执行文件的“.text”段。下面分别列出了目标文件hello.o、foo1.o、foo2.o以及可执行文件hello的段表中的“.text”段的相关信息。由于篇幅限制,我们删除了输出的后面几列。 root@baisheng:~/demo# readelf -S hello.o There are 12 section headers, starting at offset 0x118: Section Headers: [Nr] Name Type Addr Off Size [ 0] NULL 00000000 000000 000000 [ 1] .text PROGBITS 00000000 000034 000026 ... root@baisheng:~/demo# readelf -S foo1.o There are 12 section headers, starting at offset 0x104: Section Headers: [Nr] Name Type Addr Off Size [ 0] NULL 00000000 000000 000000 [ 1] .text PROGBITS 00000000 000034 000010 ... root@baisheng:~/demo# readelf -S foo2.o There are 12 section headers, starting at offset 0x104: Section Headers: [Nr] Name Type Addr Off Size [ 0] NULL 00000000 000000 000000 [ 1] .text PROGBITS 00000000 000034 000010 ... root@baisheng:~/demo# readelf -S hello There are 30 section headers, starting at offset 0x1198:我们来看一下目标文件和链接后的可执行文件的“.text”段。下面分别列出了目标文件hello.o、foo1.o、foo2.o以及可执行文件hello的段表中的“.text”段的相关信息。由于篇幅限制,我们删除了输出的后面几列。 root@baisheng:~/demo# readelf -S hello.o There are 12 section headers, starting at offset 0x118: Section Headers: [Nr] Name Type Addr Off Size [ 0] NULL 00000000 000000 000000 [ 1] .text PROGBITS 00000000 000034 000026 ... root@baisheng:~/demo# readelf -S foo1.o There are 12 section headers, starting at offset 0x104: Section Headers: [Nr] Name Type Addr Off Size [ 0] NULL 00000000 000000 000000 [ 1] .text PROGBITS 00000000 000034 000010 ... root@baisheng:~/demo# readelf -S foo2.o There are 12 section headers, starting at offset 0x104: Section Headers: [Nr] Name Type Addr Off Size [ 0] NULL 00000000 000000 000000 [ 1] .text PROGBITS 00000000 000034 000010 ... root@baisheng:~/demo# readelf -S hello There are 30 section headers, starting at offset 0x1198: |
|