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

            Bug ID: 35733
           Summary: Missing leading underscore for 32-bit stdcall exports
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedb...@nondot.org
          Reporter: dma...@mozilla.com
                CC: llvm-bugs@lists.llvm.org, mar...@martin.st,
                    r...@google.com

This issue seems to be related to these comments:
https://github.com/llvm-mirror/lld/commit/8d204330ce9e409daa35122ab8f7f41ad21ec7a5#diff-eebfbebe9c16932e0adf459e31f5428fR44
https://github.com/llvm-mirror/llvm/blame/4604874612fa292ab4c49f96aedefdf8be1ff27e/lib/Object/COFFModuleDefinition.cpp#L76

This trips some fatal assertions in Firefox, where the sandbox code (taken from
Chromium) tries to do things like `GetProcAddress(...,
"_TargetNtMapViewOfSection@44")`.

---

E:\repro\mangle>type hi.cpp
extern "C" __declspec(dllexport) __stdcall void Test(int) { }
int main() { return 0; }

E:\repro\mangle>clang-cl -m32 -c hi.cpp
E:\repro\mangle>lld-link -nodefaultlib -entry:main hi.obj
E:\repro\mangle>llvm-readobj -coff-exports hi.exe | findstr Test
  Name: Test@4       <--- no underscore

E:\repro\mangle>link -nologo -nodefaultlib -entry:main hi.obj
   Creating library hi.lib and object hi.exp

E:\repro\mangle>llvm-readobj -coff-exports hi.exe | findstr Test
  Name: _Test@4     <--- with underscore

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to