[llvm-bugs] [Bug 42377] New: static linkage ignored with alias attribute

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 24 14:33:45 PDT 2019


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

            Bug ID: 42377
           Summary: static linkage ignored with alias attribute
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: equinox-llvm at diac24.net
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Hi,


when compiling this 2-liner:
$ cat > test.c

static int x;
static int y __attribute__((alias("x")));

$ clang-8 -c -o test.o test.c
$ objdump -t test.o

test.o:     file format elf64-x86-64

SYMBOL TABLE:
0000000000000000 l    df *ABS*  0000000000000000 test.c
0000000000000000 l     O .bss   0000000000000004 x
0000000000000000 g     O .bss   0000000000000004 y


The "y" symbol ends up global (g) instead of the expected static (l).

ELF visibility attributes don't seem to work either.

Behaviour is the same on
* clang version 8.0.0 (tags/RELEASE_800/final)
* clang version 7.0.1-8 (tags/RELEASE_701/final)

Cheers,

David

-- 
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/20190624/3920dfda/attachment.html>


More information about the llvm-bugs mailing list