On Sun, Sep 28, 2014 at 7:33 PM, Namhyung Kim <namhy...@kernel.org> 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-perf-users" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html