Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0ee3b46 authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo
Browse files

perf symbols: Fix annotation of vdso



Older kernels attempt to prelink vdso to its virtual address.  To permit
annotation using objdump, the map__rip_2objdump() calculation must
result in that same address which we can infer from the start and offset
of the text section.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Link: http://lkml.kernel.org/r/1439556606-11297-1-git-send-email-adrian.hunter@intel.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3d7245b0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -875,6 +875,17 @@ int dso__load_sym(struct dso *dso, struct map *map,
		}
	}

	/*
	 * Handle any relocation of vdso necessary because older kernels
	 * attempted to prelink vdso to its virtual address.
	 */
	if (dso__is_vdso(dso)) {
		GElf_Shdr tshdr;

		if (elf_section_by_name(elf, &ehdr, &tshdr, ".text", NULL))
			map->reloc = map->start - tshdr.sh_addr + tshdr.sh_offset;
	}

	dso->adjust_symbols = runtime_ss->adjust_symbols || ref_reloc(kmap);
	/*
	 * Initial kernel and module mappings do not map to the dso.  For