From: Tong Shen <endlessroad@google.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
linux-perf-users@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] perf tools: Fix Symbol Address for ET_DYN
Date: Mon, 29 Sep 2014 11:13:13 -0700 [thread overview]
Message-ID: <CAPp4yYxVSUMBBXdVPUETu=uM2K5P9GoeQjH0YgayVL2qco-gYg@mail.gmail.com> (raw)
In-Reply-To: <87ppefi29s.fsf@sejong.aot.lge.com>
On Sun, Sep 28, 2014 at 7:33 PM, Namhyung Kim <namhyung@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
prev parent reply other threads:[~2014-09-29 18:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 18:38 Fix Symbol Address for ET_DYN Tong Shen
2014-09-05 18:40 ` Tong Shen
2014-09-11 15:01 ` Arnaldo Carvalho de Melo
2014-09-11 18:21 ` Tong Shen
2014-09-11 20:38 ` [PATCH 1/1] perf tools: " Arnaldo Carvalho de Melo
2014-09-15 18:06 ` Tong Shen
2014-09-25 0:28 ` Tong Shen
2014-09-26 5:45 ` Namhyung Kim
2014-09-26 5:53 ` Tong Shen
2014-09-29 2:33 ` Namhyung Kim
2014-09-29 18:13 ` Tong Shen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPp4yYxVSUMBBXdVPUETu=uM2K5P9GoeQjH0YgayVL2qco-gYg@mail.gmail.com' \
--to=endlessroad@google.com \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).