[llvm-dev] Is extern_weak a legal linkage for function definitions?

Tom Stellard via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 7 13:04:08 PDT 2016


On Fri, Oct 07, 2016 at 01:47:12PM -0400, Rafael EspĂ­ndola wrote:
> I don't think it should be valid. What are the semantics you would
> expect an extern_weak definition to have?
> 

I'm not sure.  I just have a test case that uses extern_weak, which
crashes the backend, and I'm trying to figure out if the bug is in
the backend or in the test.

-Tom

> Cheers,
> Rafael
> 
> 
> On 7 October 2016 at 11:37, Tom Stellard via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Hi,
> >
> > The LLVM language reference doesn't say that extern_weak is illegal for
> > function definitions, but it seems this restriction is enforced in the
> > code in some places:
> >
> > https://github.com/llvm-mirror/llvm/blob/master/lib/AsmParser/LLParser.cpp#L4591
> > https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L327
> >
> >
> > However it is possible to create a bitcode file where a function
> > definition has extern_weak linkage.  Are these restrictions in
> > the code wrong, or do we just need to update the language reference?
> >
> > -Tom
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list