<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 - After r371957 (06bb7dfbd): error: output file too large: 18446744073707016932 bytes"
   href="https://bugs.llvm.org/show_bug.cgi?id=44715">44715</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r371957 (06bb7dfbd): error: output file too large: 18446744073707016932 bytes
          </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>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23071" name="attach_23071" title="Reproduction tarball for negative size problem">attachment 23071</a> <a href="attachment.cgi?id=23071&action=edit" title="Reproduction tarball for negative size problem">[details]</a></span>
Reproduction tarball for negative size problem

Trying to build one of FreeBSD's boot loader components with lld 10.0.0, we see
the following error appear:

$ ld.lld
--sysroot=/usr/obj/share/dim/src/freebsd/clang1000-import/amd64.amd64/tmp
--eh-frame-hdr -Bstatic -m elf_i386_fbsd -o loader_lua.sym
-L/usr/obj/share/dim/src/freebsd/clang1000-import/amd64.amd64/tmp/usr/lib
-Ttext 0x0 --gc-sections --no-rosegment
/usr/obj/share/dim/src/freebsd/clang1000-import/amd64.amd64/stand/i386/btx/lib/crt0.o
main.o conf.o vers.o chain.o boot.o commands.o console.o devopen.o interp.o
interp_backslash.o interp_parse.o ls.o misc.o module.o load_elf32.o
load_elf32_obj.o reloc_elf32.o load_elf64.o load_elf64_obj.o reloc_elf64.o
disk.o part.o vdisk.o dev_net.o bcache.o isapnp.o pnp.o interp_lua.o zfs_cmd.o
/usr/obj/share/dim/src/freebsd/clang1000-import/amd64.amd64/stand/liblua32/liblua.a
/usr/obj/share/dim/src/freebsd/clang1000-import/amd64.amd64/stand/i386/libi386/libi386.a
/usr/obj/share/dim/src/freebsd/clang1000-import/amd64.amd64/stand/libsa32/libsa32.a
ld: error: output file too large: 18446744073707016908 bytes

18446744073707016908 = 0xffffffffffd952cc, so it is pretty clear that lld is
somehow creating a negative size.

Bisecting shows that this was introduced with <a href="https://reviews.llvm.org/rL371957">https://reviews.llvm.org/rL371957</a>
("[ELF] Map the ELF header at imageBase").  It seems that this change has a bad
effect when both -Ttext 0x0 and --no-rosegment are used.</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>