This is the mail archive of the
mailing list for the binutils project.
Re: [committed, PATCH] x86: Properly check building shared library
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 14 Feb 2018 12:41:19 +1030
- Subject: Re: [committed, PATCH] x86: Properly check building shared library
- Authentication-results: sourceware.org; auth=none
- References: <20180213223129.GA30801@gmail.com>
On Tue, Feb 13, 2018 at 02:31:43PM -0800, H.J. Lu wrote:
> If a symbol is not defined in a regular file, and we are not generating
> a shared library, then set the symbol to its location in the .plt. This
> is required to make function pointers compare as equal between the normal
> executable and the shared library.
I'm curious as to why this is necessary, in case other targets need
the same treatment. Normally a PIE is built from position independent
code, and thus addresses of functions are loaded from the GOT. That
means there is no need to use any tricks to avoid dynamic text relocs.
Australia Development Lab, IBM