实例分析ELF文件静态链接
参考文献:
《程序员的自我修养---链接、装载与库》第4章 静态链接
开发平台:
[thm@tanghuimin static_link]$ uname -a
Linux tanghuimin 2.6.-.el6.x86_64 # SMP Fri Feb :: UTC x86_64 x86_64 x86_64 GNU/Linux
1.ELF文件格式概貌
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAElCAIAAADvGeXhAAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAAIABJREFUeJzt3XtAE2e2APAzBBEQBYEg8hCIUJCHojzkpRUNxQe0oNK6ZV11rVrZXrF62+LVrrqtpS9tkVvULVuL7pa2+ChKlBWVIkJAkacaAREETHgohHcSEub+MW1uFpIIZBSB8/sr+TJz5pvhcAjfzDdDkCQJCCGE6KM10h1ACKGxBgsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRbOwX1tdee43NZre1tSk2Njc3s9ns7du3q1nx7t27bDb7448/7tc+mHWf6ujRo2w2OyUlRd7yr3/9i81mHz9+nJb4aJSi0rWflpaW57N1unIP01t7pDvwzGVlZbW1tfX29io2SiSSgoICbW11u9/e3n7lyhVTU9N+7YNZ96leeumlK1euTJw4MSIigmo5fvz4lStXDhw4QEt8NEpR6TplyhSCIOSN/bKXdlZWVg0NDVKplK7cw/Qe47uniqmpaXp6+uTJkwGgp6enpKTE0NDQysoqOzt70qRJAQEBDAZDcfne3t5bt24BgJeXl3xd9StWV1ffvn3b29tbJBIJBAJnZ+cpU6bIAy5cuNDMzOzq1avd3d36+vodHR3Xrl2ztbX19vaWSCTyvlEePHhw+/Ztc3NzT09PLS2tW7du9fb2ent7a2lp3b59u7Ozc86cOXp6ejwer62tzdXV1cDA4HkcRPTMPHz40MjISP62oqKiurp62rRpdnZ2HR0dd+7cAQAqAWBAelCrNDQ0FBQU6Ovr+/r66unpAQC1oqmpqb29PQDcv3//8ePHzs7OBEH09fWRJCkUCk1MTPrlnlAozM/Pl0ql3t7eTCYTBvf7Mvj0Htj5MZLe5FhnaGgIAM3NzYqNdXV1AODv70+SJI/HAwA3NzcrKyvqmCxatEgmk3G5XAB44403+vr63n77bQDYt2+f4rqqViRJMiEhgcoSQ0NDNpsNANnZ2f06tnXrVgBIS0sjSfLMmTMAEBMT069vfX19O3fulP+w/Pz8njx5snjxYgC4c+dOX1+fmZkZAKSnp5MkyWKxtLW129ransdhRc8Gla6tra2KjZcuXQIAGxsbkUj03nvvAcD69etJFelBkmRcXJz8K6GFhUVpaSlJklQ+R0ZGUjEjIyOptJwzZ448QnV1tTz3SJI8efKkvr4+9ZGOjk58fDyp+vel3448Nb1VdX5spDcW1t8SRUtL69ChQ2fPnrWwsACAvLw8eWGNi4sDgM2bN1N/2PsV1oErVldXa2trGxsb//zzz5988gmVNwML66+//goAb7/9NkmSb731FgAUFxf369vFixcB4LXXXquqqtq3bx8AbNq06fPPPweAv//979SvAQDs37+/qamJSvHnc1TRM0Klq62t7czfUTWUypD33ntPV1fX3Ny8paWFVJEePB6PIAgWi5WVlfXtt98CwOLFi0nVhbWystLMzExLS6usrKy2tlaee9XV1RMmTDAyMjp79iyHwzE3NycIorS0VFXa99uRp6a30s6TJDk20nvsn7wapICAgHfffTcsLCwkJAQAmpubqfYbN268++67dnZ233zzjeKwl5oVz507J5VKt2/fHhERsWvXrmXLlqnaorm5OYfDIUnywoULTk5Os2fP7rfML7/8AgD+/v4PHjyYP3++lpZWamrq0qVLASA3NzcvL09LS2vhwoX5+fn5+fkAoGpbaHQxUED9I//ll19aWlp+8cUXIpHoyJEjU6dOBRXpQWXUX/7yl4ULF7711ltxcXHqs8Le3n7ChAkEQbi6uipm+Llz53p7e6Ojo8PCwpYvX75r1y6SJKktgurfF7mnprfSzgPA2EjvcTrGOhCVvgAwYcIExXbq62d1dXVmZmZQUNBgVuTz+QDw0ksvUW/d3NyoP879MBiM1atX/+///u+//v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fxJsfKF16xZIxAIsrKyqqurORxOd3c31U4tMG7vNomFFaGxw9TUlLopFAAkJyenp6e///77JElyudzc3FzqFrHXrl377LPPPv74Y/h9GJQqf/JaqTSI/FMA6OzsLC0t9fHx6erqunjx4rZt28zMzKRS6d69eydPnkzdi0tx+XEIhwIQGjt27969atWqkpISkiRbWlo4HI6dnV1VVVVLS8ucOXMcHR1NTU0rKiq++eabJUuWAEBlZWVeXl58fHxUVFR+fv4nn3yiNIitrS2Xy42KiqK2UlBQwGQybW1tSZJ0dXV944035s6dW19fb2tr293d/dNPP73++uv5+fl79uwZyWMxorCwIjR2hISEPHz4sLCw0MjIyMvLi7oilcvlzp49Oz09PScnRyQSzZ8/39DQkFr+0KFDubm5zs7ODAajvb1dTZCGhgb5VhYtWkS9JQgiPz//+vXr2travr6+WlpaV65cmTNnjpaWFnVz7nELCytCY4q5ufny5csVW6j/9xkMxsKFC/stbGJiQj0d9qlBVNHX13/llVfkbwe51piHY6wIjXFVVVUDSyp6pvAbK0JjnPyKffTc4DdWhBCiGRZWhBCiGRZWhBCiGRZWhBCiGQ0nr4RC4Ti/Zg0NUmtrq0wmG+le/KazsxPzFg1SZ2fnkJbXtLCyWKyoqKhLly5pGAeNB7W1tdTtPkecmZlZcXGxp6fnSHcEjQ4PHjwwMzMb/PIESZLPrjcIITQO4RgrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjRDAsrQgjR7P8AMkvbEViUPT4AAAAASUVORK5CYII=" alt="" />
readelf -h 查看elf文件头部信息可以看到Type值有三种:REL,EXEC,DYN。
REL文件是只被编译没有被链接过的文件,其格式属于左边一种,elf header+section1,2,3...+section header table,每个section对应一个section header table entry,section header table为各个section提供索引。没有被链接过的文件没有program header,不能被加载到内存中运行,readelf -l会提示”There are no program headers in this file”。
EXEC和DYN文件属于被链接过的文件,其格式属于右边一种,elf header+program header table+segment1,2,3...+section header table。每个segment对应一个program header table entry,program header table为各个segment提供索引。EXEC和DYN文件有program headers,可以被加载到内存中运行,readelf -l可以看到一个segment是由一个或多个section构成,Type为LOAD的segment可以被加载到内存中运行,其他类型的segment提供辅助信息。
2.实例分析
(1)创建文件
创建文件common.c
int val = ; int func(void)
{
return (val+);
}
创建文件test.c
extern int val;
extern int func(void); int main()
{
val = ;
func();
return ;
}
(2)编译
编译两个.c文件
gcc -c test.c
gcc -c common.c
生成的test.o和common.o属于REL类型
来分析一下编译后生成的REL文件
(2.1)先看看test.o:
readelf -s test.o查看test.o的符号表
[thm@tanghuimin static_link]$ readelf -s test.o Symbol table '.symtab' contains entries:
Num: Value Size Type Bind Vis Ndx Name
: NOTYPE LOCAL DEFAULT UND
: FILE LOCAL DEFAULT ABS test.c
: SECTION LOCAL DEFAULT
: SECTION LOCAL DEFAULT
: SECTION LOCAL DEFAULT
: SECTION LOCAL DEFAULT
: SECTION LOCAL DEFAULT
: SECTION LOCAL DEFAULT
: FUNC GLOBAL DEFAULT main
: NOTYPE GLOBAL DEFAULT UND val
: NOTYPE GLOBAL DEFAULT UND func
因为val和func不是在test.c中定义的,所以这两个符号的Ndx(符号所在section的index)为UND。为了能让程序顺利执行,我们希望在未来链接的过程中可以从其他文件中找到val和func这两个符号,并确定这两个符号的地址,确定未定义符号的地址的过程即是“重定位”(relocation)。
readelf -S test.o可以看到test.o的section header table
[thm@tanghuimin static_link]$ readelf test.o -S
There are section headers, starting at offset 0x128: Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ ] NULL [ ] .text PROGBITS
000000000000001a AX
[ ] .rela.text RELA [ ] .data PROGBITS 0000005c
WA
[ ] .bss NOBITS 0000005c
WA
[ ] .comment PROGBITS 0000005c
000000000000002d MS
[ ] .note.GNU-stack PROGBITS [ ] .eh_frame PROGBITS
A
[ ] .rela.eh_frame RELA [ ] .shstrtab STRTAB 000000c8 [] .symtab SYMTAB [] .strtab STRTAB Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
我们重点关注rela section。
可以看到rela.text entry的描述中,link=10,info=1,link表示被重定位的符号所在的符号表的section index,info表示需要被重定位的section的index,通俗点讲就是,将来有朝一日我知道了该符号的地址,我该把这个地址写到哪个section里面去,这里是.text。
readelf -r test.o可以看到rel section里的详细信息。
[thm@tanghuimin static_link]$ readelf test.o -r Relocation section '.rela.text' at offset 0x548 contains entries:
Offset Info Type Sym. Value Sym. Name + Addend
R_X86_64_PC32 val -
00000000000f 000a00000002 R_X86_64_PC32 func - Relocation section '.rela.eh_frame' at offset 0x578 contains entries:
Offset Info Type Sym. Value Sym. Name + Addend
R_X86_64_PC32 .text +
offset表示该符号在被重定位的section中的偏移,info的高4个字节表示该符号在.symtab中的index,低4字节表示重定位的类型,不同的类型计算目标地址的方法不一样。
综上所述,我们可以得出符号val和func的种种信息:
val的重定位地址是在.text的偏移为6处,将来的链接过程中,连接器要将val的地址写到这个位置上来,val在.symtab中的index为9。
func的重定位地址是在.text的偏移为f处,将来的链接过程中,连接器要将func的地址写到这个位置上来,func在.symtab中的为a。
关于重定位的类型,《ELF V1.2》的第57和93页有详细说明。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvMAAAC6CAIAAACsr1UNAAAAA3NCSVQICAjb4U/gAAAAGXRFWHRTb2Z0d2FyZQBnbm9tZS1zY3JlZW5zaG907wO/PgAAIABJREFUeJzt3WlcE1cbKPATICACgrLFIFtEQKgCGpYimxYBxWpdUbRqLItirVZtK/iC+rrg0qrVXpa6Ky0WLVarr20tIJsCghFZRBFZokBZZCcQSOZ+OL/OzWUJQdHI+Pw/zXLOzDNnhuTJmTMDjSAI1I+Ojo60tLT+1gIAAAAAvGsUJKzr7OzMycl5a6EAAAAAALwmmoQ+GwAAAACA4UVO1gEAAAAAAAwZyGwAAAAAQB2Q2QAAAACAOiCzAQAAAAB1QGYDAAAAAOqAzAYAAAAA1AGZDQAAAACoQ9Kb+hBCxcXF9fX1fa7S1tYeP358fn5+a2vrqFGjLCws3kB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AAAB1QGYDAAAAAOqA//X9Prp8+fL+/ftlHQUYGk1NTa2trXp6erIOhOJqa2vl5eXHjBkj60CGscePH5uYmMjLy8s6EPBaTp48aW1tLesoJIHMBgAAAADUAXejAAAAAEAdkNkAAAAAgDogswEAAAAAdUBmAwAAAADq+L/DAi/XromowAAAAABJRU5ErkJggg==" alt="" />
这里两个符号的类型 R_X86_64_PC32,重定位地址的计算方法为S+A-P,即符号地址和下条指令间的偏移量。
objdump -S test.o查看汇编文件
[thm@tanghuimin static_link]$ objdump -S test.o test.o: file format elf64-x86- Disassembly of section .text: <main>:
: push %rbp
: e5 mov %rsp,%rbp
: c7 0a movl $0xa,0x0(%rip) # e <main+0xe>
b:
e: e8 callq <main+0x13>
: b8 mov $0x0,%eax
: c9 leaveq
: c3 retq
可以看到.text中偏移6处四个字节(val的地址)为全0,偏移f处四个字节(func的地址)为全0。
(2.2)再来看看common.o:
readelf -s查看common.o的符号表
......
: OBJECT GLOBAL DEFAULT val
: FUNC GLOBAL DEFAULT func
可以看到val定义在index为3的.data里,func定义在index为1的.text里,这两个符号都是在common.c文件内部定义的。
readelf -S查看common.o的section header table
......
[ ] .rela.text RELA ......
readelf -r查看common.o的重定位详细信息
Relocation section '.rela.text' at offset 0x528 contains entries:
Offset Info Type Sym. Value Sym. Name + Addend
R_X86_64_PC32 val –
......
以上信息可以得出,需要被重定位的符号是val,它在.symtab中的index为8,需要被重定位的地址是在.text中偏移为6处,重定位类型为 R_X86_64_PC32,即.text偏移为6处的地址是val地址和下一条指令间的偏移。
Objdump -S查看common.o的汇编文件:
......
<func>:
: push %rbp
: e5 mov %rsp,%rbp
: 8b mov 0x0(%rip),%eax # a <func+0xa>
a: c0 0a add $0xa,%eax
d: c9 leaveq
e: c3 retq
可以看到偏移为6处的四个字节(val的地址)全为0,需要在链接的时候写入val的地址。
(3)链接
将两个.o文件链接,
gcc -o test test.o common.o
生成的test为EXEC类型
静态链接的过程引用《程序员的自我修养》第101页的概述:
第一步:空间与地址分配
扫描所有的输入目标文件,获得它们的各个段的长度、属性和位置,并且将输入目标文件中的符号表中所有的符号定义和符号引用收集起来,统一放到一个全局符号表。这一步中,连接器将能获得所有输入目标文件的段长度,并且将它们合并,计算出输出文件中各个段合并后的长度与位置,并建立映射关系。
第二步:符号解析与重定位
使用上面第一步中收集到的所有信息,读取输入文件中段的数据、重定位信息,并且进行符号解析与重定位、调整代码中的地址等。事实上第二步是链接过程的核心,特别是重定位的过程。
提取关键字可以是:合并段,全局符号表,重定位
来看看重定位之后的test文件
readelf -l查看test进程在内存中的映像分布:
......
LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000
0x0000000000000664 0x0000000000000664 R E
LOAD 0x0000000000000668 0x0000000000600668 0x0000000000600668
0x00000000000001e8 0x00000000000001f8 RW
......
可以看到text segment被映射到虚拟地址0x400000处,data segment被映射到虚拟地址0x600668处。
readelf test -s查看test的符号表
......
: 000000000060084c OBJECT GLOBAL DEFAULT val
......
: FUNC GLOBAL DEFAULT func
......
: FUNC GLOBAL DEFAULT main
......
反汇编
objdump -S test > test.S
......
<main>:
: push %rbp
: e5 mov %rsp,%rbp
: c7 ca 0a movl $0xa,0x2003ca(%rip) # 60084c <val>
40047f:
: e8 callq <func>
: b8 mov $0x0,%eax
40048c: c9 leaveq
40048d: c3 retq
40048e: nop
40048f: nop <func>:
: push %rbp
: e5 mov %rsp,%rbp
: 8b b2 mov 0x2003b2(%rip),%eax # 60084c <val>
40049a: c0 0a add $0xa,%eax
40049d: c9 leaveq
40049e: c3 retq
40049f: nop
......
main函数中
地址0x400478处:
400478: c7 05 ca 03 20 00 0a movl $0xa,0x2003ca(%rip) # 60084c <val>
%rip+0x2003ca=0x400482+0x2003ca=0x60084c=val的地址
地址0x400482处:
118 400482: e8 09 00 00 00 callq 400490 <func>
该条指令的下一条指令地址为0x400487,0x400487+0x09=0x400490=func的地址
func中
地址0x 400494处:
128 400494: 8b 05 b2 03 20 00 mov 0x2003b2(%rip),%eax # 60084c <val>
%rip+ 0x2003b2= 0x40049a+0x2003b2=0x60084c=val的地址
由此可见这三处重定位的地址都为符号地址与下条指令间的偏移,符合上面分析的重定位类型。
实例分析ELF文件静态链接的更多相关文章
- 实例分析ELF文件动态链接
参考文献: <ELF V1.2> <程序员的自我修养---链接.装载与库>第6章 可执行文件的装载与进程 第7章 动态链接 <Linux GOT与PLT> 开发平台 ...
- 使用Python分析ELF文件优化Flash和Sram空间的案例
1. 背景 Zephyr项目Flash和Ram空间比较紧张,有着非常强烈的优化需求. 优化的前提是量化标的,那么如何量化Flash和Ram的使用量呢? 在量化之后,首先要对量化结果进行分析,然后采取措 ...
- ELF 文件 动态链接 - 地址无关代码(GOT)
Linux 系统中,ELF动态链接文件被称为 动态共享对象(DSO,Dynamic Shared Object),简称共享对象 文件拓展名为".so" 动态链接下 一个程序可以被分 ...
- 从实例分析ELF格式的.gnu.hash区与glibc的符号查找
前言 ELF格式的.gnu.hash节在设计上比较复杂,直接从glibc源码进行分析的难度也比较大.今天静下心来看了这篇精彩的文章,终于将布隆滤波器.算数运算转为位运算等一系列细节搞懂了(值得一提的是 ...
- linux下动态链接库.so文件 静态链接库.a文件创建及使用
转摘网址为:http://www.cnblogs.com/fengyv/archive/2012/08/10/2631313.html Linux下文件的类型是不依赖于其后缀名的,但一般来讲: ...
- linux内核分析ELF文件分析实践报告
- ELF文件的加载过程(load_elf_binary函数详解)--Linux进程的管理与调度(十三)
加载和动态链接 从编译/链接和运行的角度看,应用程序和库程序的连接有两种方式. 一种是固定的.静态的连接,就是把需要用到的库函数的目标代码(二进制)代码从程序库中抽取出来,链接进应用软件的目标映像中: ...
- ARM 之一 ELF文件、镜像(Image)文件、可执行文件、对象文件 详解
[转]https://blog.csdn.net/ZCShouCSDN/article/details/100048461 ELF 文件规范 ELF(Executable and Linking ...
- GCC编译器原理(二)------编译原理一:ELF文件(2)
四. ELF 文件格式分析 ELF文件(目标文件)格式主要四种: 可重定向文件: 文件保存着代码和适当的数据,用来和其他的目标文件一起来创建一个可执行文件或者是一个共享目标文件.(目标文件或者静态库文 ...
随机推荐
- jquery点击改变class并toggle;jquery点击改变图片src源码并toggle;jquery显示隐藏toggle
<html><head><meta charset="utf-8"><title></title><script ...
- rails 配置使用mysql
1 在gemfile中要添加 gem 'mysql2' 2 在mysql数据库中创建三个数据库 dept_dev dept_test dept_pro 3 配置文件 default: &def ...
- Tomcat下部署多个项目
转载地址:http://blog.csdn.net/philosophyatmath/article/details/30246631 同一端口号的多个项目部署 添加: <Context ...
- C++学习8 构造函数的参数初始化表
构造函数是一种特殊的成员函数,在创建对象时自动执行,主要用来进行初始化工作,例如对 private 属性的成员变量赋值. 对成员变量的初始化,除了在构造函数的函数体中一一赋值,还可以采用参数初始化表. ...
- [ActionScript 3.0] AS3.0 对象在一定范围随机显示不重叠
import flash.geom.Rectangle; import flash.display.MovieClip; import flash.display.Sprite; var arr:Ar ...
- 如何使weblogic11g类似weblogic923一样统一使用一个boot.properties文件
如何使weblogic11g类似weblogic923一样 统一使用一个boot.properties文件 1.在weblogic域下创建文件boot.properties输入用户密码例如:usern ...
- [SQL]SQL删除数据的各种方式总结
SQL删除数据的各种方式总结 一.使用DELETE从表中删除目标行.记录每次删除操作.如: USE pubs DELETE FROM authors WHERE au_lname = 'McBadde ...
- [SQL]不知道1
表结构,companyid是公司名,productid是产品号,说明每个公司生产多少种产品. companyid productid A A B B B C D D D 要求:取出所有生产的产品包含公 ...
- SQL(Oracle)
http://blog.csdn.net/winter13292/article/details/7011377 SQL 对大小写不敏感! 在 SQL 中增加 HAVING 子句原因是,WHERE ...
- 动手学servlet(二) servlet基础
1.我们来试着向一个servlet提交一个表单,现在webcontent下新建一个login.html页面,其中action对应servelt类名,代码如下: <!DOCTYPE HTML PU ...