I was looking at a report where pprof wouldn't symbolize the data collected for a Chrome binary using Linux perf (b/112303003). The mmap information is: start: 0000000002, limit: 0000000006, offset: 0000000002 The ELF file header: elf.FileHeader{Class:elf.ELFCLASS64, Data:elf.ELFDATA2LSB, Version:elf.EV_CURRENT, OSABI:elf.ELFOSABI_NONE, ABIVersion:0x0, ByteOrder:binary.LittleEndian, Type:elf.ET_EXEC, Machine:elf.EM_X86_64, Entry:0x272e000} The code segment: elf.ProgHeader{Type:elf.PT_LOAD, Flags:elf.PF_X+elf.PF_R, Off:0x252f000, Vaddr:0x272e000, Paddr:0x272e000, Filesz:0x43da610, Memsz:0x43da610, Align:0x1000} The dynamic loader here mapped 0x6b09000-0x272e000 = 0x43db000 bytes starting 0x252f000 file offset into 0x272e000 virtual address, exactly as instructed by the program header (so, no ASLR). Thus, the base adjustment should be zero. Yet, the current GetBase produced the base of 0x252f000 which is wrong. The reason for that is that the ET_EXEC branch of GetBase doesn't handle the general case of non-zero mmap file offset, but rather only supports a couple of special cases. This change makes handling the case of user-mode ET_EXEC more generic.
|
|
||
178 |
|
178 |
|
179 |
|
179 |
|
180 |
|
180 |
|
181 |
|
|
|
182 |
|
|
|
|
181 |
|
|
183 |
|
182 |
|
184 |
|
183 |
|
185 |
|
184 |
|
|
|
||
189 |
|
188 |
|
190 |
|
189 |
|
191 |
|
190 |
|
192 |
|
|
|
|
191 |
|
|
193 |
|
192 |
|
194 |
|
193 |
|
|
194 |
|
|
|
195 |
|
|
|
196 |
|
|
|
197 |
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
|
201 |
|
|
|
202 |
|
|
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
195 |
|
206 |
|
196 |
|
207 |
|
197 |
|
208 |
|
|
|
||
202 |
|
213 |
|
203 |
|
214 |
|
204 |
|
215 |
|
205 |
|
|
|
206 |
|
|
|
207 |
|
|
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
|
211 |
|
216 |
|
212 |
|
217 |
|
213 |
|
218 |
|
|
|
||
230 |
|
235 |
|
231 |
|
236 |
|
232 |
|
237 |
|
233 |
|
|
|
|
238 |
|
|
234 |
|
239 |
|
235 |
|
240 |
|
236 |
|
241 |
|
|
|
||
51 |
|
51 |
|
52 |
|
52 |
|
53 |
|
53 |
|
54 |
|
|
|
|
54 |
|
|
55 |
|
55 |
|
56 |
|
56 |
|
57 |
|
57 |
|
|
|
||
85 |
|
85 |
|
86 |
|
86 |
|
87 |
|
87 |
|
88 |
|
|
|
|
88 |
|
|
89 |
|
89 |
|
90 |
|
90 |
|
91 |
|
91 |
|