lkml.org 
[lkml]   [2015]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] perf tools: don't adjust symbols in vDSO
On Mon, Jun 29, 2015 at 02:23:51PM +0100, Adrian Hunter wrote:
> On 29/06/15 15:30, Adrian Hunter wrote:
> > On 29/06/15 12:02, Adrian Hunter wrote:
> >> On 27/06/15 12:10, Will Deacon wrote:
> >>> @@ -824,6 +823,14 @@ int dso__load_sym(struct dso *dso, struct map *map,
> >>> sec = syms_ss->symtab;
> >>> shdr = syms_ss->symshdr;
> >>>
> >>> + /*
> >>> + * Older x86 kernels prelink the vDSO at a high address, so
> >>> + * we need to reflect that in map->pgoff in order to talk to
> >>> + * objdump.
> >>> + */
> >>> + if (dso__is_vdso(dso))
> >>> + map->pgoff = shdr.sh_addr - shdr.sh_offset;
> >>
> >> In the case of perf tools, maps map memory addresses to file offsets.
> >> That is used to read from the object file, so you can't change the map.
> >
> > So what about just this instead:
> >
> > if (dso__is_vdso(dso))
> > map->reloc = shdr.sh_addr - shdr.sh_offset;
> >
>
> No that's no good either :-(

Yeah... we're fighting against symbol lookup wanting ->map_ip to give the
address of the ELF symbol but unwinding wanting ->map_ip to give a relative
offset for file reads.

Also, the reloc is a bit weird and I think needs to be the other way around
(i.e. we convert from a map-relative address to an objdump address by
*subtracting* the reloc). Even with that change, I run into problems with
annotate comparing ELF symbol addresses with map addresses. Urgh.

Will


\
 
 \ /
  Last update: 2015-06-29 16:01    [W:0.072 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site