6.99 KB
lib_pic_clang.o vs.
lib_pie_clang.o
872 B
readelf --wide --file-header {}
Offset 6, 15 lines modifiedOffset 6, 15 lines modified
6 ··​OS/​ABI:​····························​UNIX·​-​·​FreeBSD6 ··​OS/​ABI:​····························​UNIX·​-​·​FreeBSD
7 ··​ABI·​Version:​·······················​07 ··​ABI·​Version:​·······················​0
8 ··​Type:​······························​REL·​(Relocatable·​file)​8 ··​Type:​······························​REL·​(Relocatable·​file)​
9 ··​Machine:​···························​Advanced·​Micro·​Devices·​X86-​649 ··​Machine:​···························​Advanced·​Micro·​Devices·​X86-​64
10 ··​Version:​···························​0x110 ··​Version:​···························​0x1
11 ··​Entry·​point·​address:​···············​0x011 ··​Entry·​point·​address:​···············​0x0
12 ··​Start·​of·​program·​headers:​··········​0·​(bytes·​into·​file)​12 ··​Start·​of·​program·​headers:​··········​0·​(bytes·​into·​file)​
13 ··​Start·​of·​section·​headers:​··········​648·​(bytes·​into·​file)​13 ··​Start·​of·​section·​headers:​··········​624·​(bytes·​into·​file)​
14 ··​Flags:​·····························​0x014 ··​Flags:​·····························​0x0
15 ··​Size·​of·​this·​header:​···············​64·​(bytes)​15 ··​Size·​of·​this·​header:​···············​64·​(bytes)​
16 ··​Size·​of·​program·​headers:​···········​0·​(bytes)​16 ··​Size·​of·​program·​headers:​···········​0·​(bytes)​
17 ··​Number·​of·​program·​headers:​·········​017 ··​Number·​of·​program·​headers:​·········​0
18 ··​Size·​of·​section·​headers:​···········​64·​(bytes)​18 ··​Size·​of·​section·​headers:​···········​64·​(bytes)​
19 ··​Number·​of·​section·​headers:​·········​919 ··​Number·​of·​section·​headers:​·········​9
20 ··​Section·​header·​string·​table·​index:​·​120 ··​Section·​header·​string·​table·​index:​·​1
1.6 KB
readelf --wide --sections {}
Offset 1, 18 lines modifiedOffset 1, 18 lines modified
1 There·​are·​9·​section·​headers,​·​starting·​at·​offset·​0x288:​1 There·​are·​9·​section·​headers,​·​starting·​at·​offset·​0x270:​
  
2 Section·​Headers:​2 Section·​Headers:​
3 ··​[Nr]·​Name··············​Type············​Address··········​Off····​Size···​ES·​Flg·​Lk·​Inf·​Al3 ··​[Nr]·​Name··············​Type············​Address··········​Off····​Size···​ES·​Flg·​Lk·​Inf·​Al
4 ··​[·​0]···················​NULL············​0000000000000000·​000000·​000000·​00······​0···​0··​04 ··​[·​0]···················​NULL············​0000000000000000·​000000·​000000·​00······​0···​0··​0
5 ··​[·​1]·​.​strtab···········​STRTAB··········​0000000000000000·​000210·​000076·​00······​0···​0··​15 ··​[·​1]·​.​strtab···········​STRTAB··········​0000000000000000·​0001f8·​000076·​00······​0···​0··​1
6 ··​[·​2]·​.​text·············​PROGBITS········​0000000000000000·​000040·​000039·​00··​AX··​0···​0·​166 ··​[·​2]·​.​text·············​PROGBITS········​0000000000000000·​000040·​000039·​00··​AX··​0···​0·​16
7 ··​[·​3]·​.​rela.​text········​RELA············​0000000000000000·​0001b0·​000030·​18······​8···​2··​87 ··​[·​3]·​.​rela.​text········​RELA············​0000000000000000·​0001b0·​000018·​18······​8···​2··​8
8 ··​[·​4]·​.​comment··········​PROGBITS········​0000000000000000·​000079·​000053·​01··​MS··​0···​0··​18 ··​[·​4]·​.​comment··········​PROGBITS········​0000000000000000·​000079·​000053·​01··​MS··​0···​0··​1
9 ··​[·​5]·​.​note.​GNU-​stack···​PROGBITS········​0000000000000000·​0000cc·​000000·​00······​0···​0··​19 ··​[·​5]·​.​note.​GNU-​stack···​PROGBITS········​0000000000000000·​0000cc·​000000·​00······​0···​0··​1
10 ··​[·​6]·​.​eh_frame·········​X86_64_UNWIND···​0000000000000000·​0000d0·​000050·​00···​A··​0···​0··​810 ··​[·​6]·​.​eh_frame·········​X86_64_UNWIND···​0000000000000000·​0000d0·​000050·​00···​A··​0···​0··​8
11 ··​[·​7]·​.​rela.​eh_frame····​RELA············​0000000000000000·​0001e0·​000030·​18······​8···​6··​811 ··​[·​7]·​.​rela.​eh_frame····​RELA············​0000000000000000·​0001c8·​000030·​18······​8···​6··​8
12 ··​[·​8]·​.​symtab···········​SYMTAB··········​0000000000000000·​000120·​000090·​18······​1···​3··​812 ··​[·​8]·​.​symtab···········​SYMTAB··········​0000000000000000·​000120·​000090·​18······​1···​3··​8
13 Key·​to·​Flags:​13 Key·​to·​Flags:​
14 ··​W·​(write)​,​·​A·​(alloc)​,​·​X·​(execute)​,​·​M·​(merge)​,​·​S·​(strings)​,​·​I·​(info)​,​14 ··​W·​(write)​,​·​A·​(alloc)​,​·​X·​(execute)​,​·​M·​(merge)​,​·​S·​(strings)​,​·​I·​(info)​,​
15 ··​L·​(link·​order)​,​·​O·​(extra·​OS·​processing·​required)​,​·​G·​(group)​,​·​T·​(TLS)​,​15 ··​L·​(link·​order)​,​·​O·​(extra·​OS·​processing·​required)​,​·​G·​(group)​,​·​T·​(TLS)​,​
16 ··​C·​(compressed)​,​·​x·​(unknown)​,​·​o·​(OS·​specific)​,​·​E·​(exclude)​,​16 ··​C·​(compressed)​,​·​x·​(unknown)​,​·​o·​(OS·​specific)​,​·​E·​(exclude)​,​
17 ··​l·​(large)​,​·​p·​(processor·​specific)​17 ··​l·​(large)​,​·​p·​(processor·​specific)​
667 B
readelf --wide --symbols {}
Offset 1, 9 lines modifiedOffset 1, 9 lines modified
  
1 Symbol·​table·​'.​symtab'·​contains·​6·​entries:​1 Symbol·​table·​'.​symtab'·​contains·​6·​entries:​
2 ···​Num:​····​Value··········​Size·​Type····​Bind···​Vis······​Ndx·​Name2 ···​Num:​····​Value··········​Size·​Type····​Bind···​Vis······​Ndx·​Name
3 ·····​0:​·​0000000000000000·····​0·​NOTYPE··​LOCAL··​DEFAULT··​UND·3 ·····​0:​·​0000000000000000·····​0·​NOTYPE··​LOCAL··​DEFAULT··​UND·
4 ·····​1:​·​0000000000000000·····​0·​FILE····​LOCAL··​DEFAULT··​ABS·​lib.​c4 ·····​1:​·​0000000000000000·····​0·​FILE····​LOCAL··​DEFAULT··​ABS·​lib.​c
5 ·····​2:​·​0000000000000000·····​0·​SECTION·​LOCAL··​DEFAULT····​2·5 ·····​2:​·​0000000000000000·····​0·​SECTION·​LOCAL··​DEFAULT····​2·
6 ·····​3:​·​0000000000000004·····​4·​OBJECT··​GLOBAL·​DEFAULT··​COM·​global_variable6 ·····​3:​·​0000000000000004·····​4·​OBJECT··​GLOBAL·​DEFAULT··​COM·​global_variable
7 ·····​4:​·​0000000000000000····​23·​FUNC····​GLOBAL·​DEFAULT····​2·​lib_function17 ·····​4:​·​0000000000000000····​20·​FUNC····​GLOBAL·​DEFAULT····​2·​lib_function1
8 ·····​5:​·​0000000000000020····​25·​FUNC····​GLOBAL·​DEFAULT····​2·​lib_function28 ·····​5:​·​0000000000000020····​25·​FUNC····​GLOBAL·​DEFAULT····​2·​lib_function2
1010 B
readelf --wide --relocs {}
Offset 1, 10 lines modifiedOffset 1, 9 lines modified
  
1 Relocation·​section·​'.​rela.​text'·​at·​offset·​0x1b0·​contains·2·​entries:​1 Relocation·​section·​'.​rela.​text'·​at·​offset·​0x1b0·​contains·1·​entry:​
2 ····​Offset·············​Info·············​Type···············​Symbol's·​Value··​Symbol's·​Name·​+·​Addend2 ····​Offset·············​Info·············​Type···············​Symbol's·​Value··​Symbol's·​Name·​+·​Addend
3 0000000000000007··​0000000300000009·​R_X86_64_GOTPCREL······​0000000000000004·​global_variable·​-​·​43 000000000000000c··​0000000300000002·​R_X86_64_PC32··········​0000000000000004·​global_variable·​-​·​4
4 000000000000002f··​0000000400000004·​R_X86_64_PLT32·········​0000000000000000·​lib_function1·​-​·​4 
  
5 Relocation·​section·​'.​rela.​eh_frame'·​at·​offset·​0x1e0·​contains·​2·​entries:​4 Relocation·​section·​'.​rela.​eh_frame'·​at·​offset·​0x1c8·​contains·​2·​entries:​
6 ····​Offset·············​Info·············​Type···············​Symbol's·​Value··​Symbol's·​Name·​+·​Addend5 ····​Offset·············​Info·············​Type···············​Symbol's·​Value··​Symbol's·​Name·​+·​Addend
7 0000000000000020··​0000000200000002·​R_X86_64_PC32··········​0000000000000000·​.​text·​+·​06 0000000000000020··​0000000200000002·​R_X86_64_PC32··········​0000000000000000·​.​text·​+·​0
8 000000000000003c··​0000000200000002·​R_X86_64_PC32··········​0000000000000000·​.​text·​+·​207 000000000000003c··​0000000200000002·​R_X86_64_PC32··········​0000000000000000·​.​text·​+·​20
654 B
readelf --wide --debug-dump=frames {}
Offset 9, 15 lines modifiedOffset 9, 15 lines modified
9 ··​Return·​address·​column:​·​169 ··​Return·​address·​column:​·​16
10 ··​Augmentation·​data:​·····​1b10 ··​Augmentation·​data:​·····​1b
11 ··​DW_CFA_def_cfa:​·​r7·​(rsp)​·​ofs·​811 ··​DW_CFA_def_cfa:​·​r7·​(rsp)​·​ofs·​8
12 ··​DW_CFA_offset:​·​r16·​(rip)​·​at·​cfa-​812 ··​DW_CFA_offset:​·​r16·​(rip)​·​at·​cfa-​8
13 ··​DW_CFA_nop13 ··​DW_CFA_nop
14 ··​DW_CFA_nop14 ··​DW_CFA_nop
  
15 00000018·​0000000000000018·​0000001c·​FDE·​cie=00000000·​pc=0000000000000000.​.​000000000000001715 00000018·​0000000000000018·​0000001c·​FDE·​cie=00000000·​pc=0000000000000000.​.​0000000000000014
16 ··​DW_CFA_advance_loc:​·​1·​to·​000000000000000116 ··​DW_CFA_advance_loc:​·​1·​to·​0000000000000001
17 ··​DW_CFA_def_cfa_offset​:​·​1617 ··​DW_CFA_def_cfa_offset​:​·​16
18 ··​DW_CFA_offset:​·​r6·​(rbp)​·​at·​cfa-​1618 ··​DW_CFA_offset:​·​r6·​(rbp)​·​at·​cfa-​16
19 ··​DW_CFA_advance_loc:​·​3·​to·​000000000000000419 ··​DW_CFA_advance_loc:​·​3·​to·​0000000000000004
20 ··​DW_CFA_def_cfa_regist​er:​·​r6·​(rbp)​20 ··​DW_CFA_def_cfa_regist​er:​·​r6·​(rbp)​
21 ··​DW_CFA_nop21 ··​DW_CFA_nop
22 ··​DW_CFA_nop22 ··​DW_CFA_nop
1.6 KB
objdump --line-numbers --disassemble --demangle --section=.text {}
Offset 3, 28 lines modifiedOffset 3, 27 lines modified
  
3 Disassembly·​of·​section·​.​text:​3 Disassembly·​of·​section·​.​text:​
  
4 0000000000000000·​<lib_function1>:​4 0000000000000000·​<lib_function1>:​
5 lib_function1()​:​5 lib_function1()​:​
6 ···​0:​»       ​55···················»       ​push···​%rbp6 ···​0:​»       ​55···················»       ​push···​%rbp
7 ···​1:​»       ​48·​89·​e5·············»       ​mov····​%rsp,​%rbp7 ···​1:​»       ​48·​89·​e5·············»       ​mov····​%rsp,​%rbp
8 ···​4:​»       ​48·8b·05·00·00·00·00·»       ​mov····0x0(%rip)​,​%rax········8 ···​4:​»       ​89·7d·fc·············»       ​mov····​%edi,​-​0x4(%rbp)​
9 ···b:​»       ​89·​7d·​fc·············»       ​mov····%edi,​-​0x4(%rbp)​9 ···7:​»       ​8b·​7d·​fc·············»       ​mov····​-​0x4(%rbp)​,​%edi
10 ···e:​»       ​8b·7d·fc·············»       ​mov····-​0x4(%rbp)​,​%edi10 ···a:​»       ​03·3d·00·00·00·00····»       ​add····​0x0(%rip)​,​%edi········
11 ··​11:​»       ​03·38················»       ​add····(%rax)​,​%edi11 ··​10:​»       ​89·f8················»       ​mov····​%edi,​%eax
12 ··​13:​»       ​89·f8················»       ​mov····%edi,​%eax12 ··​12:​»       ​5d···················»       ​pop····​%rbp
13 ··​15:​»       ​5d···················»       ​pop····%rbp13 ··​13:​»       ​c3···················»       ​retq···
14 ··​16:​»       ​c3···················»       ​retq···14 ··​14:​»       ​66·66·66·2e·0f·1f·84·»       ​data16·data16·nopw·%cs:​0x0(%rax,​%rax,​1)​
15 ··​17:​»       ​66·0f·​1f·​84·​00·​00·​00·»       ​nopw···​0x0(%rax,​%rax,​1)​15 ··​1b:​»       ​00·​00·​00·​00·​00·
16 ··​1e:​»       ​00·​00· 
  
17 0000000000000020·​<lib_function2>:​16 0000000000000020·​<lib_function2>:​
18 lib_function2()​:​17 lib_function2()​:​
19 ··​20:​»       ​55···················»       ​push···​%rbp18 ··​20:​»       ​55···················»       ​push···​%rbp
20 ··​21:​»       ​48·​89·​e5·············»       ​mov····​%rsp,​%rbp19 ··​21:​»       ​48·​89·​e5·············»       ​mov····​%rsp,​%rbp
21 ··​24:​»       ​48·​83·​ec·​10··········»       ​sub····​$0x10,​%rsp20 ··​24:​»       ​48·​83·​ec·​10··········»       ​sub····​$0x10,​%rsp
22 ··​28:​»       ​89·​7d·​fc·············»       ​mov····​%edi,​-​0x4(%rbp)​21 ··​28:​»       ​89·​7d·​fc·············»       ​mov····​%edi,​-​0x4(%rbp)​
23 ··​2b:​»       ​8b·​7d·​fc·············»       ​mov····​-​0x4(%rbp)​,​%edi22 ··​2b:​»       ​8b·​7d·​fc·············»       ​mov····​-​0x4(%rbp)​,​%edi
24 ··​2e:​»       ​e8·00·00·00·00·······»       ​callq··33·​<lib_function2+0x13>23 ··​2e:​»       ​e8·cd·ff·ff·ff·······»       ​callq··0·​<lib_function1>
25 ··​33:​»       ​48·​83·​c4·​10··········»       ​add····​$0x10,​%rsp24 ··​33:​»       ​48·​83·​c4·​10··········»       ​add····​$0x10,​%rsp
26 ··​37:​»       ​5d···················»       ​pop····​%rbp25 ··​37:​»       ​5d···················»       ​pop····​%rbp
27 ··​38:​»       ​c3···················»       ​retq···26 ··​38:​»       ​c3···················»       ​retq···
653 B
readelf --wide --decompress --hex-dump=.eh_frame {}
Offset 1, 9 lines modifiedOffset 1, 9 lines modified
  
1 Hex·​dump·​of·​section·​'.​eh_frame':​1 Hex·​dump·​of·​section·​'.​eh_frame':​
2 ·​NOTE:​·​This·​section·​has·​relocations·​against·​it,​·​but·​these·​have·​NOT·​been·​applied·​to·​this·​dump.​2 ·​NOTE:​·​This·​section·​has·​relocations·​against·​it,​·​but·​these·​have·​NOT·​been·​applied·​to·​this·​dump.​
3 ··​0x00000000·​14000000·​00000000·​017a5200·​01781001·​.​.​.​.​.​.​.​.​.​zR.​.​x.​.​3 ··​0x00000000·​14000000·​00000000·​017a5200·​01781001·​.​.​.​.​.​.​.​.​.​zR.​.​x.​.​
4 ··​0x00000010·​1b0c0708·​90010000·​18000000·​1c000000·​.​.​.​.​.​.​.​.​.​.​.​.​.​.​.​.​4 ··​0x00000010·​1b0c0708·​90010000·​18000000·​1c000000·​.​.​.​.​.​.​.​.​.​.​.​.​.​.​.​.​
5 ··​0x00000020·​00000000·​17000000·​00410e10·​8602430d·​.​.​.​.​.​.​.​.​.​A.​.​.​.​C.​5 ··​0x00000020·​00000000·​14000000·​00410e10·​8602430d·​.​.​.​.​.​.​.​.​.​A.​.​.​.​C.​
6 ··​0x00000030·​06000000·​18000000·​38000000·​00000000·​.​.​.​.​.​.​.​.​8.​.​.​.​.​.​.​6 ··​0x00000030·​06000000·​18000000·​38000000·​00000000·​.​.​.​.​.​.​.​.​8.​.​.​.​.​.​.​
7 ··​0x00000040·​19000000·​00410e10·​8602430d·​06000000·​.​.​.​.​.​A.​.​.​.​C.​.​.​.​.​7 ··​0x00000040·​19000000·​00410e10·​8602430d·​06000000·​.​.​.​.​.​A.​.​.​.​C.​.​.​.​.​