This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: entries in PT_DYNAMIC section refer to the correct address at runtime?
- From: Alan Modra <amodra at gmail dot com>
- To: Yubin Ruan <ablacktshirt at gmail dot com>
- Cc: binutils at sourceware dot org, elfutils-devel at sourceware dot org
- Date: Fri, 15 Sep 2017 16:56:36 +0930
- Subject: Re: entries in PT_DYNAMIC section refer to the correct address at runtime?
- Authentication-results: sourceware.org; auth=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HJgJynn10KTJf6pdsirIXVBD7m590vtbutTLyqhI0QU=; b=UZy9lE4pOQOPORX8DViLDYzya1PTcElGAeDxyRe6YTWWwLbgFOh3mVvfPVN0DIDrzw lpNat0nKubXnCERY4jIfLI9xmYlO3NXH/bRufw9GhwPSMVwxn/QbfzTl7W+fdtcPntxj c2jVemPp2ZHGRA5e5s+iWGf0VdWlEztSjs0iXBB+zr9ORooM8Bm+ucRWQUY7BfM3pjar SRdJamGf2VlwgIdEr1qeUtSa306FDzJ0SeFtGYIR6yVMeReGLgG40TKmA6Rf9nr7tYR8 lyKiM1xjHLmpWz6+tQk0AU9mbu4j0htA1fMTz072/yyoglY2T5KsXphjvrCF1I39WNc7 X8gw==
- References: <CAJYFCiMKh3CwuoPHKBpcqUruJxEm_M4Cr17DD9ou5aMZq1hOZw@mail.gmail.com> <20170914102525.GJ3528@bubble.grove.modra.org> <CAJYFCiNUWhk9QS6h-k9fiG+rKz2ZUx_2YPfCy9su+OM63f0eAQ@mail.gmail.com>
On Fri, Sep 15, 2017 at 02:57:36PM +0800, Yubin Ruan wrote:
> 2017-09-14 18:25 GMT+08:00 Alan Modra <amodra@gmail.com>:
> > DT_ entries that specify addresses will need to be offset by the base
> > address.
>
> Will base address be automatically adjusted by the dynamic linker if
> it tries to loaded it at a different base address than that specified
> in the `p_vaddr'?
That might depend on the dynamic linker. glibc ld.so doesn't as far
as I know. Build yourself a testcase and inspect the .dynamic section
of a shared library or PIE under gdb.
--
Alan Modra
Australia Development Lab, IBM