[llvm-bugs] [Bug 48563] New: Clang/LLVM expose a weak symbol, preventing us linking.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 20 05:33:55 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48563

            Bug ID: 48563
           Summary: Clang/LLVM expose a weak symbol, preventing us
                    linking.
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: kalamatee at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

We use an ASM macro to create an Alias extensively in our operating system,
however under LLVM/Clang it does not work, preventing us using the LLVM
toolchain from compiling the Operating System (www.aros.org).

#define __AROS_GM_STACKALIAS(fname, alias) \
    void alias(void); \
    asm(".weak " __GM_STRINGIZE(alias) "\n" \
        "\t.set " __GM_STRINGIZE(alias) "," #fname \
    );

The following is a simplified testcase showing the behaviour -:

extern void foo(void);
void bar(void);

asm(".weak foo\n"
        "\t.set foo,bar");

void*functable[] =
{
    &foo,
    (void *)0
};

When this is compiled with GNU/GCC, we only have 2 symbols exposed - "bar", and
"functable", however with LLVM/Clang - there is also a weak reference for "foo"
exposed, which then is not resolved during linking.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201220/bf6c6f2f/attachment.html>


More information about the llvm-bugs mailing list