[llvm-bugs] [Bug 39218] New: i686 mingw-w64 comdat functions use wrong .text section name

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 8 14:01:12 PDT 2018


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

            Bug ID: 39218
           Summary: i686 mingw-w64 comdat functions use wrong .text
                    section name
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org

If you simply build and run the example from the original mingw-w64 comdat ABI
compatibility bug
(https://github.com/Alexpux/MINGW-packages/issues/1677#issuecomment-394906508,
also below) for i686, it shows we don't use the right section names:

$ cat a.cpp
inline int foo(int a, int b) { return a + b; }
int bar(void);
int main() { return foo(1, 2) + bar(); }

$ cat b.cpp
inline int foo(int a, int b) { return a + b; }
int bar() { return foo(3, 4); }

$ gcc -m32 a.cpp -c -o a.o && clang --target=i686-w64-windows-gnu -c b.cpp -o
b.o 

$ dumpbin a.o | grep text
          34 .text
          10 .text$_Z3fooii

$ dumpbin b.o | grep text
          1F .text
          1F .text$__Z3fooii

Clang adds the extra '_' for Windows C symbol mangling, but GCC does not.

A user emailed me directly to report that they were getting linker errors, but
I have not been able to observe any problems caused by this mismatch.

-- 
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/20181008/24674cdd/attachment.html>


More information about the llvm-bugs mailing list