[llvm-dev] [RFC] Fail early on unimplementable append linkage uses

Rafael Espíndola via llvm-dev
Fri, 13 May 2016 12:56:19 -0000

On 13 May 2016 at 08:51, Renato Golin <renato.golin at linaro.org>
wrote:
> On 13 May 2016 at 13:43, Rafael Espíndola <llvm-dev at
lists.llvm.org> wrote:
>> That means that appending linkage can only be used with llvm special
>> symbols that never hit a real .o.
>
> So they should have been resolved by emission time, or it's a back-end
error.

Not resolved, translated. For example, llvm.ctors gets expanded to
whatever form the object file uses for processing static constructors.

> Do you have an idea of what could be affected if we start emitting an
> error, here? Test-Suite, other programs?

No. Clang only produces the well known ones. Anything producing a
appending linkage global that actually got written to the output would
hit a link error if it tried combining any two of those files (and can
get the same behaviour with an external linkage).

Cheers,
Rafale