<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Missing leading underscore for 32-bit stdcall exports"
   href="https://bugs.llvm.org/show_bug.cgi?id=35733">35733</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Missing leading underscore for 32-bit stdcall exports
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>COFF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dmajor@mozilla.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, martin@martin.st, ruiu@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This issue seems to be related to these comments:
<a href="https://github.com/llvm-mirror/lld/commit/8d204330ce9e409daa35122ab8f7f41ad21ec7a5#diff-eebfbebe9c16932e0adf459e31f5428fR44">https://github.com/llvm-mirror/lld/commit/8d204330ce9e409daa35122ab8f7f41ad21ec7a5#diff-eebfbebe9c16932e0adf459e31f5428fR44</a>
<a href="https://github.com/llvm-mirror/llvm/blame/4604874612fa292ab4c49f96aedefdf8be1ff27e/lib/Object/COFFModuleDefinition.cpp#L76">https://github.com/llvm-mirror/llvm/blame/4604874612fa292ab4c49f96aedefdf8be1ff27e/lib/Object/COFFModuleDefinition.cpp#L76</a>

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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>