This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: LLVM collaboration?
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Rafael Espíndola <rafael dot espindola at gmail dot com>, Renato Golin <renato dot golin at linaro dot org>, gcc <gcc at gcc dot gnu dot org>
- Date: Thu, 13 Feb 2014 10:06:34 +0100
- Subject: Re: Fwd: LLVM collaboration?
- Authentication-results: sourceware.org; auth=none
- References: <CAMSE1kdfpeLp6NEc+jnEWqi0KWV-+=Q701UsiLhgcn13X6fYcA at mail dot gmail dot com> <CAMSE1ke32x19T07uidRJWiOpYDs3eSnKEL3u_dDHxBHJQR84cg at mail dot gmail dot com> <20140211022910 dot GA31962 at atrey dot karlin dot mff dot cuni dot cz> <CAMSE1kdp5RQhsLTAYpshBvOrYVBY=9Y_hZDq6cNQk837a88cbA at mail dot gmail dot com> <CAMSE1kd=1dAv-ux9L6yTdNT03kAdEHGQo+L0-RwEWaEF3Nka4g at mail dot gmail dot com> <CAG3jReKSj7HL-Tpgyx5jyoEbu-p-Jh1g+k-ghVHZQet26w=cyQ at mail dot gmail dot com> <20140211212020 dot GB7400 at kam dot mff dot cuni dot cz> <CAFiYyc0ttm34x6poZPg5kiSH78iUbyjRrb6y+WrhpOGQjWHz9g at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1402121617330 dot 5339 at digraph dot polyomino dot org dot uk> <20140212162257 dot GD7151 at kam dot mff dot cuni dot cz>
On Wed, Feb 12, 2014 at 5:22 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> On Wed, 12 Feb 2014, Richard Biener wrote:
>>
>> > What about instead of our current odd way of identifying LTO objects
>> > simply add a special ELF note telling the linker the plugin to use?
>> >
>> > .note._linker_plugin '/...../libltoplugin.so'
>> >
>> > that way the linker should try 1) loading that plugin, 2) register the
>> > specific object with that plugin.
>>
>> Unless this is only allowed for a whitelist of known-good plugins in
>> known-good directories, it's a clear security hole for the linker to
>> execute code in arbitrary files named by linker input. The linker should
>> be safe to run on untrusted input files.
>
> Also I believe the flies should be independent of particular setup (that is not
> contain a path) and probably host OS (that is not having .so extension) at least.
> We need some versioning scheme for different versions of compilers.
> Finally we need a solution for non-ELF LTO objects (like LLVM)
>
> But yes, having an compiler independent way of declaring that plugin is needed
> and what plugin should be uses seems possible.
Yeah, naming the plugin (and searching it in a ld specific trusted configurable
path only) would work as well, of course.
That also means that we should try to make the GCC side lto-plugin work for
older GCC versions as well (we pick the lto-wrapper to call from the environment
which would have to change if we'd try to support using multiple GCC versions
at the same time).
Richard.
> Honza
>>
>> --
>> Joseph S. Myers
>> joseph@codesourcery.com