bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/15435] New: Gold rejects undefined weak hidden symbol


From: chris at smowton dot net
Subject: [Bug binutils/15435] New: Gold rejects undefined weak hidden symbol
Date: Mon, 06 May 2013 17:19:49 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=15435

             Bug #: 15435
           Summary: Gold rejects undefined weak hidden symbol
           Product: binutils
           Version: 2.24 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


If I try to link a file that contains a weak hidden undefined symbol, Gold
complains "hidden symbol 'foo' is not defined locally" (from
target-reloc.h:404, where weak symbols are disregarded but /any/ symbol with
non-default visibility, including weak ones, are required to be defined).

In the event this was produced by using the LLVMgold plugin, which has the
interesting behaviour that when processing an LLVM declaration like

declare extern_weak hidden void @_stdio_init() (example from uclibc)

the LLVM plugin actually disguises the fact that the extern is annotated hidden
and just describes it was weak-undef to Gold. However its subterfuge cannot
last, and it is discovered after LLVM lowers the LTO'd IR to a plain ELF binary
and Gold rereads, I guess to check if LLVM introduced calls (e.g. to memcpy).
At that stage it notices the extern is still declared hidden-weak-undef and
merges the symbol table entries.

One could argue this is a bug in LLVM (and I shall submit this report to their
tracker as well) and that the idea of hidden-undefined doesn't make sense. I
would argue a change is warranted in gold either way:

1. If you think hidden-weak-undef isn't sensible, report "illegal attributes
for symbol foo" rather than "not defined here"
2. If you think it is, disregard like any other weak-undef.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]