[LLVMbugs] [Bug 18489] New: section attribute behaviour differs from gcc's

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 15 07:28:05 PST 2014


            Bug ID: 18489
           Summary: section attribute behaviour differs from gcc's
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: patrick at georgi-clan.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

coreboot uses an (admittedly hackish) trick to move variables to a special
section[0]. When trying to compile this with clang, such variables end up in
.bss which is a problem for us.

A reduced test case, showing the different behaviour:
$ cat test.c; echo "--- clang follows ---"; Source/llvm-build/Release/bin/clang
-S test.c; grep "section" test.s; echo "--- gcc follows ---"; gcc -S test.c;
grep "section" test.s

static int foo __attribute__((section(".my.foo,\"w\", at nobits#")));

void do_this(void) { foo++; }
--- clang follows ---
.section    ".my.foo,\"w\", at nobits#","aw", at progbits
.section    ".note.GNU-stack","", at progbits
--- gcc follows ---
.section    .my.foo,"w", at nobits#,"aw", at progbits
.section    .note.GNU-stack,"", at progbits

- it's used like "int foo CAR_GLOBAL".

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/20140115/5200da06/attachment.html>

More information about the llvm-bugs mailing list