<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Larger ARM/COFF binaries linked by lld fail to load"
   href="https://llvm.org/bugs/show_bug.cgi?id=28722">28722</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Larger ARM/COFF binaries linked by lld fail to load
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>martin@martin.st
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When linking ARM/COFF binaries (for windows) with lld, the linked binaries fail
to load once the binary reaches a certain size.

In a very rough test, a produced exe starts failing when it reaches around 6.2
MB (although the symbol distances that cause the issue probably is less than
that).


When testing the linked binaries by running them in wine on ARM, the symptoms
can either be that the binary fails to even reach the main() function, e.g.
like this:

$ wine avconv.exe
wine: Unhandled page fault on write access to 0x00000000 at address 0x10241aa
(thread 004c), starting debugger...

Or it can fail randomly later:

$ wine avconv.exe
avconv version v12_dev0-3048-g100fb0d, Copyright (c) 2000-2016 the Libav
developers
  built on Jul 26 2016 22:33:38 with clang version 4.0.0
(<a href="http://llvm.org/git/clang">http://llvm.org/git/clang</a> d7ce71572703901a5d7368bc770be92680b24107)
(<a href="http://llvm.org/git/llvm">http://llvm.org/git/llvm</a> bda089c623a22b5cd6958d0fd82447b4000ee93a)
wine: Unhandled page fault on read access to 0x00000011 at address 0xc22d60
(thread 0048), starting debugger...

Or fail in an even more creative way:

$ wine avconv.exe
avconv version v12_dev0-3048-g100fb0d, Copyright (c) 2000-2016 the Libav
developers
  built on Jul 26 2016 22:33:38 with clang version 4.0.0
(<a href="http://llvm.org/git/clang">http://llvm.org/git/clang</a> d7ce71572703901a5d7368bc770be92680b24107)
(<a href="http://llvm.org/git/llvm">http://llvm.org/git/llvm</a> bda089c623a22b5cd6958d0fd82447b4000ee93a)
wine: Unhandled illegal instruction at address 0xc19f1c (thread 0044), starting
debugger...

The failure types can be varied by linking in more or less content into the
resulting exe. Needless to say, the corresponding binaries that are produced by
using MS link.exe instead of lld-link work flawlessly in the same test setup.


I'd be happy to help debugging the matter further if there are suggestions on
what I can look at and investigate, to provide more clues about what happens.</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>