• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2018 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package symbol_inject
16
17import "debug/elf"
18
19/* Generated from: clang -o a.out test.c
20
21#include <unistd.h>
22
23char soong_build_number[128] = "PLACEHOLDER";
24
25int main() {
26  write(STDOUT_FILENO, soong_build_number, sizeof(soong_build_number));
27}
28*/
29
30var elfSymbolTable1 = &mockElfFile{
31	t: elf.ET_EXEC,
32	sections: []elf.SectionHeader{
33		elf.SectionHeader{Name: "", Type: elf.SHT_NULL, Flags: 0x0, Addr: 0x0, Offset: 0x0, Size: 0x0, Link: 0x0, Info: 0x0, Addralign: 0x0, Entsize: 0x0, FileSize: 0x0},
34		elf.SectionHeader{Name: ".interp", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC, Addr: 0x400238, Offset: 0x238, Size: 0x1c, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x1c},
35		elf.SectionHeader{Name: ".note.ABI-tag", Type: elf.SHT_NOTE, Flags: elf.SHF_ALLOC, Addr: 0x400254, Offset: 0x254, Size: 0x20, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x20},
36		elf.SectionHeader{Name: ".hash", Type: elf.SHT_HASH, Flags: elf.SHF_ALLOC, Addr: 0x400278, Offset: 0x278, Size: 0x24, Link: 0x4, Info: 0x0, Addralign: 0x8, Entsize: 0x4, FileSize: 0x24},
37		elf.SectionHeader{Name: ".dynsym", Type: elf.SHT_DYNSYM, Flags: elf.SHF_ALLOC, Addr: 0x4002a0, Offset: 0x2a0, Size: 0x60, Link: 0x5, Info: 0x1, Addralign: 0x8, Entsize: 0x18, FileSize: 0x60},
38		elf.SectionHeader{Name: ".dynstr", Type: elf.SHT_STRTAB, Flags: elf.SHF_ALLOC, Addr: 0x400300, Offset: 0x300, Size: 0x3e, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x3e},
39		elf.SectionHeader{Name: ".gnu.version", Type: elf.SHT_GNU_VERSYM, Flags: elf.SHF_ALLOC, Addr: 0x40033e, Offset: 0x33e, Size: 0x8, Link: 0x4, Info: 0x0, Addralign: 0x2, Entsize: 0x2, FileSize: 0x8},
40		elf.SectionHeader{Name: ".gnu.version_r", Type: elf.SHT_GNU_VERNEED, Flags: elf.SHF_ALLOC, Addr: 0x400348, Offset: 0x348, Size: 0x20, Link: 0x5, Info: 0x1, Addralign: 0x8, Entsize: 0x0, FileSize: 0x20},
41		elf.SectionHeader{Name: ".rela.dyn", Type: elf.SHT_RELA, Flags: elf.SHF_ALLOC, Addr: 0x400368, Offset: 0x368, Size: 0x30, Link: 0x4, Info: 0x0, Addralign: 0x8, Entsize: 0x18, FileSize: 0x30},
42		elf.SectionHeader{Name: ".rela.plt", Type: elf.SHT_RELA, Flags: elf.SHF_ALLOC + elf.SHF_INFO_LINK, Addr: 0x400398, Offset: 0x398, Size: 0x18, Link: 0x4, Info: 0x16, Addralign: 0x8, Entsize: 0x18, FileSize: 0x18},
43		elf.SectionHeader{Name: ".init", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4003b0, Offset: 0x3b0, Size: 0x17, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x17},
44		elf.SectionHeader{Name: ".plt", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4003d0, Offset: 0x3d0, Size: 0x20, Link: 0x0, Info: 0x0, Addralign: 0x10, Entsize: 0x10, FileSize: 0x20},
45		elf.SectionHeader{Name: ".text", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4003f0, Offset: 0x3f0, Size: 0x1b2, Link: 0x0, Info: 0x0, Addralign: 0x10, Entsize: 0x0, FileSize: 0x1b2},
46		elf.SectionHeader{Name: ".fini", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4005a4, Offset: 0x5a4, Size: 0x9, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x9},
47		elf.SectionHeader{Name: ".rodata", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_MERGE, Addr: 0x4005b0, Offset: 0x5b0, Size: 0x4, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x4, FileSize: 0x4},
48		elf.SectionHeader{Name: ".eh_frame_hdr", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC, Addr: 0x4005b4, Offset: 0x5b4, Size: 0x34, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x34},
49		elf.SectionHeader{Name: ".eh_frame", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC, Addr: 0x4005e8, Offset: 0x5e8, Size: 0xf0, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x0, FileSize: 0xf0},
50		elf.SectionHeader{Name: ".init_array", Type: elf.SHT_INIT_ARRAY, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e08, Offset: 0xe08, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x8},
51		elf.SectionHeader{Name: ".fini_array", Type: elf.SHT_FINI_ARRAY, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e10, Offset: 0xe10, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x8},
52		elf.SectionHeader{Name: ".jcr", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e18, Offset: 0xe18, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x0, FileSize: 0x8},
53		elf.SectionHeader{Name: ".dynamic", Type: elf.SHT_DYNAMIC, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e20, Offset: 0xe20, Size: 0x1d0, Link: 0x5, Info: 0x0, Addralign: 0x8, Entsize: 0x10, FileSize: 0x1d0},
54		elf.SectionHeader{Name: ".got", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600ff0, Offset: 0xff0, Size: 0x10, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x10},
55		elf.SectionHeader{Name: ".got.plt", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x601000, Offset: 0x1000, Size: 0x20, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x20},
56		elf.SectionHeader{Name: ".data", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x601020, Offset: 0x1020, Size: 0x90, Link: 0x0, Info: 0x0, Addralign: 0x10, Entsize: 0x0, FileSize: 0x90},
57		elf.SectionHeader{Name: ".bss", Type: elf.SHT_NOBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x6010b0, Offset: 0x10b0, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x8},
58		elf.SectionHeader{Name: ".comment", Type: elf.SHT_PROGBITS, Flags: elf.SHF_MERGE + elf.SHF_STRINGS, Addr: 0x0, Offset: 0x10b0, Size: 0x56, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x1, FileSize: 0x56},
59		elf.SectionHeader{Name: ".symtab", Type: elf.SHT_SYMTAB, Flags: 0x0, Addr: 0x0, Offset: 0x1108, Size: 0x5e8, Link: 0x1b, Info: 0x2d, Addralign: 0x8, Entsize: 0x18, FileSize: 0x5e8},
60		elf.SectionHeader{Name: ".strtab", Type: elf.SHT_STRTAB, Flags: 0x0, Addr: 0x0, Offset: 0x16f0, Size: 0x1dd, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x1dd},
61		elf.SectionHeader{Name: ".shstrtab", Type: elf.SHT_STRTAB, Flags: 0x0, Addr: 0x0, Offset: 0x18cd, Size: 0xf1, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0xf1},
62	},
63	symbols: []elf.Symbol{
64		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 1, Value: 0x400238, Size: 0x0},
65		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 2, Value: 0x400254, Size: 0x0},
66		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 3, Value: 0x400278, Size: 0x0},
67		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 4, Value: 0x4002a0, Size: 0x0},
68		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 5, Value: 0x400300, Size: 0x0},
69		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 6, Value: 0x40033e, Size: 0x0},
70		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 7, Value: 0x400348, Size: 0x0},
71		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 8, Value: 0x400368, Size: 0x0},
72		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 9, Value: 0x400398, Size: 0x0},
73		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 10, Value: 0x4003b0, Size: 0x0},
74		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 11, Value: 0x4003d0, Size: 0x0},
75		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4003f0, Size: 0x0},
76		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 13, Value: 0x4005a4, Size: 0x0},
77		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 14, Value: 0x4005b0, Size: 0x0},
78		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 15, Value: 0x4005b4, Size: 0x0},
79		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 16, Value: 0x4005e8, Size: 0x0},
80		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e08, Size: 0x0},
81		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 18, Value: 0x600e10, Size: 0x0},
82		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 19, Value: 0x600e18, Size: 0x0},
83		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 20, Value: 0x600e20, Size: 0x0},
84		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 21, Value: 0x600ff0, Size: 0x0},
85		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 22, Value: 0x601000, Size: 0x0},
86		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601020, Size: 0x0},
87		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x6010b0, Size: 0x0},
88		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 25, Value: 0x0, Size: 0x0},
89		elf.Symbol{Name: "crtstuff.c", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
90		elf.Symbol{Name: "__JCR_LIST__", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 19, Value: 0x600e18, Size: 0x0},
91		elf.Symbol{Name: "deregister_tm_clones", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x400420, Size: 0x0},
92		elf.Symbol{Name: "register_tm_clones", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x400460, Size: 0x0},
93		elf.Symbol{Name: "__do_global_dtors_aux", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4004a0, Size: 0x0},
94		elf.Symbol{Name: "completed.6963", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x6010b0, Size: 0x1},
95		elf.Symbol{Name: "__do_global_dtors_aux_fini_array_entry", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 18, Value: 0x600e10, Size: 0x0},
96		elf.Symbol{Name: "frame_dummy", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4004c0, Size: 0x0},
97		elf.Symbol{Name: "__frame_dummy_init_array_entry", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e08, Size: 0x0},
98		elf.Symbol{Name: "test.c", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
99		elf.Symbol{Name: "crtstuff.c", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
100		elf.Symbol{Name: "__FRAME_END__", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 16, Value: 0x4006d4, Size: 0x0},
101		elf.Symbol{Name: "__JCR_END__", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 19, Value: 0x600e18, Size: 0x0},
102		elf.Symbol{Name: "", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
103		elf.Symbol{Name: "__init_array_end", Info: 0x0, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e10, Size: 0x0},
104		elf.Symbol{Name: "_DYNAMIC", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 20, Value: 0x600e20, Size: 0x0},
105		elf.Symbol{Name: "__init_array_start", Info: 0x0, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e08, Size: 0x0},
106		elf.Symbol{Name: "__GNU_EH_FRAME_HDR", Info: 0x0, Other: 0x0, Section: elf.SHN_UNDEF + 15, Value: 0x4005b4, Size: 0x0},
107		elf.Symbol{Name: "_GLOBAL_OFFSET_TABLE_", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 22, Value: 0x601000, Size: 0x0},
108		elf.Symbol{Name: "__libc_csu_fini", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4005a0, Size: 0x2},
109		elf.Symbol{Name: "soong_build_number", Info: 0x11, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601030, Size: 0x80},
110		elf.Symbol{Name: "data_start", Info: 0x20, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601020, Size: 0x0},
111		elf.Symbol{Name: "write@@GLIBC_2.2.5", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF, Value: 0x0, Size: 0x0},
112		elf.Symbol{Name: "_edata", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x6010b0, Size: 0x0},
113		elf.Symbol{Name: "_fini", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 13, Value: 0x4005a4, Size: 0x0},
114		elf.Symbol{Name: "__libc_start_main@@GLIBC_2.2.5", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF, Value: 0x0, Size: 0x0},
115		elf.Symbol{Name: "__data_start", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601020, Size: 0x0},
116		elf.Symbol{Name: "__gmon_start__", Info: 0x20, Other: 0x0, Section: elf.SHN_UNDEF, Value: 0x0, Size: 0x0},
117		elf.Symbol{Name: "__dso_handle", Info: 0x11, Other: 0x2, Section: elf.SHN_UNDEF + 23, Value: 0x601028, Size: 0x0},
118		elf.Symbol{Name: "_IO_stdin_used", Info: 0x11, Other: 0x0, Section: elf.SHN_UNDEF + 14, Value: 0x4005b0, Size: 0x4},
119		elf.Symbol{Name: "__libc_csu_init", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x400530, Size: 0x65},
120		elf.Symbol{Name: "_end", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x6010b8, Size: 0x0},
121		elf.Symbol{Name: "_start", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4003f0, Size: 0x2b},
122		elf.Symbol{Name: "__bss_start", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x6010b0, Size: 0x0},
123		elf.Symbol{Name: "main", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4004f0, Size: 0x31},
124		elf.Symbol{Name: "__TMC_END__", Info: 0x11, Other: 0x2, Section: elf.SHN_UNDEF + 23, Value: 0x6010b0, Size: 0x0},
125		elf.Symbol{Name: "_init", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 10, Value: 0x4003b0, Size: 0x0},
126	},
127}
128
129/* Generated from: clang -o a.out test2.c
130
131#include <unistd.h>
132
133char symbol1[128] = "PLACEHOLDER1";
134char symbol2[128] = "PLACEHOLDER2";
135
136int main() {
137  write(STDOUT_FILENO, symbol1, sizeof(symbol1));
138  write(STDOUT_FILENO, symbol2, sizeof(symbol2));
139}
140
141*/
142
143var elfSymbolTable2 = &mockElfFile{
144	t: elf.ET_EXEC,
145	sections: []elf.SectionHeader{
146		elf.SectionHeader{Name: "", Type: elf.SHT_NULL, Flags: 0x0, Addr: 0x0, Offset: 0x0, Size: 0x0, Link: 0x0, Info: 0x0, Addralign: 0x0, Entsize: 0x0, FileSize: 0x0},
147		elf.SectionHeader{Name: ".interp", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC, Addr: 0x400238, Offset: 0x238, Size: 0x1c, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x1c},
148		elf.SectionHeader{Name: ".note.ABI-tag", Type: elf.SHT_NOTE, Flags: elf.SHF_ALLOC, Addr: 0x400254, Offset: 0x254, Size: 0x20, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x20},
149		elf.SectionHeader{Name: ".hash", Type: elf.SHT_HASH, Flags: elf.SHF_ALLOC, Addr: 0x400278, Offset: 0x278, Size: 0x24, Link: 0x4, Info: 0x0, Addralign: 0x8, Entsize: 0x4, FileSize: 0x24},
150		elf.SectionHeader{Name: ".dynsym", Type: elf.SHT_DYNSYM, Flags: elf.SHF_ALLOC, Addr: 0x4002a0, Offset: 0x2a0, Size: 0x60, Link: 0x5, Info: 0x1, Addralign: 0x8, Entsize: 0x18, FileSize: 0x60},
151		elf.SectionHeader{Name: ".dynstr", Type: elf.SHT_STRTAB, Flags: elf.SHF_ALLOC, Addr: 0x400300, Offset: 0x300, Size: 0x3e, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x3e},
152		elf.SectionHeader{Name: ".gnu.version", Type: elf.SHT_GNU_VERSYM, Flags: elf.SHF_ALLOC, Addr: 0x40033e, Offset: 0x33e, Size: 0x8, Link: 0x4, Info: 0x0, Addralign: 0x2, Entsize: 0x2, FileSize: 0x8},
153		elf.SectionHeader{Name: ".gnu.version_r", Type: elf.SHT_GNU_VERNEED, Flags: elf.SHF_ALLOC, Addr: 0x400348, Offset: 0x348, Size: 0x20, Link: 0x5, Info: 0x1, Addralign: 0x8, Entsize: 0x0, FileSize: 0x20},
154		elf.SectionHeader{Name: ".rela.dyn", Type: elf.SHT_RELA, Flags: elf.SHF_ALLOC, Addr: 0x400368, Offset: 0x368, Size: 0x30, Link: 0x4, Info: 0x0, Addralign: 0x8, Entsize: 0x18, FileSize: 0x30},
155		elf.SectionHeader{Name: ".rela.plt", Type: elf.SHT_RELA, Flags: elf.SHF_ALLOC + elf.SHF_INFO_LINK, Addr: 0x400398, Offset: 0x398, Size: 0x18, Link: 0x4, Info: 0x16, Addralign: 0x8, Entsize: 0x18, FileSize: 0x18},
156		elf.SectionHeader{Name: ".init", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4003b0, Offset: 0x3b0, Size: 0x17, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x17},
157		elf.SectionHeader{Name: ".plt", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4003d0, Offset: 0x3d0, Size: 0x20, Link: 0x0, Info: 0x0, Addralign: 0x10, Entsize: 0x10, FileSize: 0x20},
158		elf.SectionHeader{Name: ".text", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4003f0, Offset: 0x3f0, Size: 0x1c2, Link: 0x0, Info: 0x0, Addralign: 0x10, Entsize: 0x0, FileSize: 0x1c2},
159		elf.SectionHeader{Name: ".fini", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_EXECINSTR, Addr: 0x4005b4, Offset: 0x5b4, Size: 0x9, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x9},
160		elf.SectionHeader{Name: ".rodata", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC + elf.SHF_MERGE, Addr: 0x4005c0, Offset: 0x5c0, Size: 0x4, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x4, FileSize: 0x4},
161		elf.SectionHeader{Name: ".eh_frame_hdr", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC, Addr: 0x4005c4, Offset: 0x5c4, Size: 0x34, Link: 0x0, Info: 0x0, Addralign: 0x4, Entsize: 0x0, FileSize: 0x34},
162		elf.SectionHeader{Name: ".eh_frame", Type: elf.SHT_PROGBITS, Flags: elf.SHF_ALLOC, Addr: 0x4005f8, Offset: 0x5f8, Size: 0xf0, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x0, FileSize: 0xf0},
163		elf.SectionHeader{Name: ".init_array", Type: elf.SHT_INIT_ARRAY, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e08, Offset: 0xe08, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x8},
164		elf.SectionHeader{Name: ".fini_array", Type: elf.SHT_FINI_ARRAY, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e10, Offset: 0xe10, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x8},
165		elf.SectionHeader{Name: ".jcr", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e18, Offset: 0xe18, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x0, FileSize: 0x8},
166		elf.SectionHeader{Name: ".dynamic", Type: elf.SHT_DYNAMIC, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600e20, Offset: 0xe20, Size: 0x1d0, Link: 0x5, Info: 0x0, Addralign: 0x8, Entsize: 0x10, FileSize: 0x1d0},
167		elf.SectionHeader{Name: ".got", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x600ff0, Offset: 0xff0, Size: 0x10, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x10},
168		elf.SectionHeader{Name: ".got.plt", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x601000, Offset: 0x1000, Size: 0x20, Link: 0x0, Info: 0x0, Addralign: 0x8, Entsize: 0x8, FileSize: 0x20},
169		elf.SectionHeader{Name: ".data", Type: elf.SHT_PROGBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x601020, Offset: 0x1020, Size: 0x110, Link: 0x0, Info: 0x0, Addralign: 0x10, Entsize: 0x0, FileSize: 0x110},
170		elf.SectionHeader{Name: ".bss", Type: elf.SHT_NOBITS, Flags: elf.SHF_WRITE + elf.SHF_ALLOC, Addr: 0x601130, Offset: 0x1130, Size: 0x8, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x8},
171		elf.SectionHeader{Name: ".comment", Type: elf.SHT_PROGBITS, Flags: elf.SHF_MERGE + elf.SHF_STRINGS, Addr: 0x0, Offset: 0x1130, Size: 0x56, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x1, FileSize: 0x56},
172		elf.SectionHeader{Name: ".symtab", Type: elf.SHT_SYMTAB, Flags: 0x0, Addr: 0x0, Offset: 0x1188, Size: 0x600, Link: 0x1b, Info: 0x2d, Addralign: 0x8, Entsize: 0x18, FileSize: 0x600},
173		elf.SectionHeader{Name: ".strtab", Type: elf.SHT_STRTAB, Flags: 0x0, Addr: 0x0, Offset: 0x1788, Size: 0x1db, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0x1db},
174		elf.SectionHeader{Name: ".shstrtab", Type: elf.SHT_STRTAB, Flags: 0x0, Addr: 0x0, Offset: 0x1963, Size: 0xf1, Link: 0x0, Info: 0x0, Addralign: 0x1, Entsize: 0x0, FileSize: 0xf1},
175	},
176	symbols: []elf.Symbol{
177		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 1, Value: 0x400238, Size: 0x0},
178		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 2, Value: 0x400254, Size: 0x0},
179		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 3, Value: 0x400278, Size: 0x0},
180		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 4, Value: 0x4002a0, Size: 0x0},
181		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 5, Value: 0x400300, Size: 0x0},
182		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 6, Value: 0x40033e, Size: 0x0},
183		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 7, Value: 0x400348, Size: 0x0},
184		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 8, Value: 0x400368, Size: 0x0},
185		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 9, Value: 0x400398, Size: 0x0},
186		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 10, Value: 0x4003b0, Size: 0x0},
187		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 11, Value: 0x4003d0, Size: 0x0},
188		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4003f0, Size: 0x0},
189		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 13, Value: 0x4005b4, Size: 0x0},
190		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 14, Value: 0x4005c0, Size: 0x0},
191		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 15, Value: 0x4005c4, Size: 0x0},
192		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 16, Value: 0x4005f8, Size: 0x0},
193		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e08, Size: 0x0},
194		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 18, Value: 0x600e10, Size: 0x0},
195		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 19, Value: 0x600e18, Size: 0x0},
196		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 20, Value: 0x600e20, Size: 0x0},
197		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 21, Value: 0x600ff0, Size: 0x0},
198		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 22, Value: 0x601000, Size: 0x0},
199		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601020, Size: 0x0},
200		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x601130, Size: 0x0},
201		elf.Symbol{Name: "", Info: 0x3, Other: 0x0, Section: elf.SHN_UNDEF + 25, Value: 0x0, Size: 0x0},
202		elf.Symbol{Name: "crtstuff.c", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
203		elf.Symbol{Name: "__JCR_LIST__", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 19, Value: 0x600e18, Size: 0x0},
204		elf.Symbol{Name: "deregister_tm_clones", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x400420, Size: 0x0},
205		elf.Symbol{Name: "register_tm_clones", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x400460, Size: 0x0},
206		elf.Symbol{Name: "__do_global_dtors_aux", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4004a0, Size: 0x0},
207		elf.Symbol{Name: "completed.6963", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x601130, Size: 0x1},
208		elf.Symbol{Name: "__do_global_dtors_aux_fini_array_entry", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 18, Value: 0x600e10, Size: 0x0},
209		elf.Symbol{Name: "frame_dummy", Info: 0x2, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4004c0, Size: 0x0},
210		elf.Symbol{Name: "__frame_dummy_init_array_entry", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e08, Size: 0x0},
211		elf.Symbol{Name: "test2.c", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
212		elf.Symbol{Name: "crtstuff.c", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
213		elf.Symbol{Name: "__FRAME_END__", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 16, Value: 0x4006e4, Size: 0x0},
214		elf.Symbol{Name: "__JCR_END__", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 19, Value: 0x600e18, Size: 0x0},
215		elf.Symbol{Name: "", Info: 0x4, Other: 0x0, Section: elf.SHN_ABS, Value: 0x0, Size: 0x0},
216		elf.Symbol{Name: "__init_array_end", Info: 0x0, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e10, Size: 0x0},
217		elf.Symbol{Name: "_DYNAMIC", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 20, Value: 0x600e20, Size: 0x0},
218		elf.Symbol{Name: "__init_array_start", Info: 0x0, Other: 0x0, Section: elf.SHN_UNDEF + 17, Value: 0x600e08, Size: 0x0},
219		elf.Symbol{Name: "__GNU_EH_FRAME_HDR", Info: 0x0, Other: 0x0, Section: elf.SHN_UNDEF + 15, Value: 0x4005c4, Size: 0x0},
220		elf.Symbol{Name: "_GLOBAL_OFFSET_TABLE_", Info: 0x1, Other: 0x0, Section: elf.SHN_UNDEF + 22, Value: 0x601000, Size: 0x0},
221		elf.Symbol{Name: "__libc_csu_fini", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4005b0, Size: 0x2},
222		elf.Symbol{Name: "symbol1", Info: 0x11, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601030, Size: 0x80},
223		elf.Symbol{Name: "data_start", Info: 0x20, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601020, Size: 0x0},
224		elf.Symbol{Name: "write@@GLIBC_2.2.5", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF, Value: 0x0, Size: 0x0},
225		elf.Symbol{Name: "_edata", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601130, Size: 0x0},
226		elf.Symbol{Name: "_fini", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 13, Value: 0x4005b4, Size: 0x0},
227		elf.Symbol{Name: "__libc_start_main@@GLIBC_2.2.5", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF, Value: 0x0, Size: 0x0},
228		elf.Symbol{Name: "__data_start", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x601020, Size: 0x0},
229		elf.Symbol{Name: "__gmon_start__", Info: 0x20, Other: 0x0, Section: elf.SHN_UNDEF, Value: 0x0, Size: 0x0},
230		elf.Symbol{Name: "__dso_handle", Info: 0x11, Other: 0x2, Section: elf.SHN_UNDEF + 23, Value: 0x601028, Size: 0x0},
231		elf.Symbol{Name: "_IO_stdin_used", Info: 0x11, Other: 0x0, Section: elf.SHN_UNDEF + 14, Value: 0x4005c0, Size: 0x4},
232		elf.Symbol{Name: "symbol2", Info: 0x11, Other: 0x0, Section: elf.SHN_UNDEF + 23, Value: 0x6010b0, Size: 0x80},
233		elf.Symbol{Name: "__libc_csu_init", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x400540, Size: 0x65},
234		elf.Symbol{Name: "_end", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x601138, Size: 0x0},
235		elf.Symbol{Name: "_start", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4003f0, Size: 0x2b},
236		elf.Symbol{Name: "__bss_start", Info: 0x10, Other: 0x0, Section: elf.SHN_UNDEF + 24, Value: 0x601130, Size: 0x0},
237		elf.Symbol{Name: "main", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 12, Value: 0x4004f0, Size: 0x50},
238		elf.Symbol{Name: "__TMC_END__", Info: 0x11, Other: 0x2, Section: elf.SHN_UNDEF + 23, Value: 0x601130, Size: 0x0},
239		elf.Symbol{Name: "_init", Info: 0x12, Other: 0x0, Section: elf.SHN_UNDEF + 10, Value: 0x4003b0, Size: 0x0},
240	},
241}
242