Re: [PATCH 1/1] perf tools: Fix Symbol Address for ET_DYN

From: Tong Shen
Date: Mon Sep 29 2014 - 14:13:36 EST


On Sun, Sep 28, 2014 at 7:33 PM, Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> Hmm.. IIUC for normal dso (ET_DYN), shdr->offset == shdr->sh_addr for
> text section right? And we always adjust ET_EXEC and ET_REL.. What
> about always trying to adjust symbol address then? We may precalculate
> adjust offset and subtracting it from symbol values. And the offset of
> 0 effectively means no adjust. This way we can simplify the logic IMHO.

Yeah I'd like to do that too; but (shdr->offset == shdr->sh_addr for
normal ET_DYN && shdr->offset != shdr->sh_addr for non-relocatable
ET_DYN) is only true for .text section. It does not hold for .data
section.


I didn't dig deep into the code; if we only care about symbols in
.text section (function names), we can do what you said. Otherwise we
may want to keep it the way it is...

--
Best Regards, Tong Shen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/