This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static
- From: Alan Modra <amodra at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 14 Jan 2014 20:09:08 +1030
- Subject: Re: PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static
- Authentication-results: sourceware.org; auth=none
- References: <20140110142001 dot GA6035 at intel dot com> <20140111001259 dot GE5390 at bubble dot grove dot modra dot org> <CAMe9rOo0UtpbdT69cnkK4fZD5pmzQnuX2wMCkBy3GuSLGcmcow at mail dot gmail dot com> <CAHACq4opdALo+T=dvM_PT2M36H+feAqpF6Gsf0sPZy-g=bg8SA at mail dot gmail dot com> <20140114003945 dot GM5390 at bubble dot grove dot modra dot org>
On Tue, Jan 14, 2014 at 11:09:45AM +1030, Alan Modra wrote:
> I see no reason why "-static -pie" should not work. "-static" does
> *not* specify the type of output directly. "-static" chooses input
> objects. "-pie" affects output. The two options are logically
> orthogonal. You ought to be able to build a PIE that doesn't use any
> shared libraries! If it doesn't work, then we have a bug elsewhere.
I guess I should qualify this comment a little. I was talking about
linker operation, not what might happen in practice when you use
"-static -pie". In practice, the archive libraries for -lc and so on
probably won't be compiled as PIC, and other toolchain and library
packaging issues may well prevent this working. My point is the
linker itself should be able to support "-static -pie".
--
Alan Modra
Australia Development Lab, IBM
- References:
- PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static
- Re: PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static
- Re: PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static
- Re: PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static
- Re: PATCH: PR ld/16428: Disallow -shared/-pie, -shared/-static, -pie/-static