<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 --- - lld segfault on relocatable link of test/ELF/Inputs/no-augmentation.o"
   href="https://llvm.org/bugs/show_bug.cgi?id=27878">27878</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld segfault on relocatable link of test/ELF/Inputs/no-augmentation.o
          </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>FreeBSD
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>emaste@freebsd.org
          </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>Discovered while creating the test added in r270706.

% build-nodebug/bin/lldb build-debug/bin/ld.lld -- -r
tools/lld/test/ELF/Inputs/no-augmentation.o
(lldb) target create "build-debug/bin/ld.lld"
Current executable set to 'build-debug/bin/ld.lld' (x86_64).
(lldb) settings set -- target.run-args  "-r"
"tools/lld/test/ELF/Inputs/no-augmentation.o"
(lldb) run
Process 60069 launching
Process 60069 launched: '/tank/emaste/src/llvm/build-debug/bin/ld.lld' (x86_64)
Process 60069 stopped
* thread #1: tid = 101148, 0x0000000000650bb2
ld.lld`lld::elf::SymbolTableSection<llvm::object::ELFType<(llvm::support::endianness)0,
true> >::writeLocalSymbols(this=0x0000000806858160, Buf=<no value available>) +
1090 at OutputSections.cpp:1332, stop reason = signal SIGSEGV: invalid address
(fault address: 0x8)
    frame #0: 0x0000000000650bb2
ld.lld`lld::elf::SymbolTableSection<llvm::object::ELFType<(llvm::support::endianness)0,
true> >::writeLocalSymbols(this=0x0000000806858160, Buf=<no value available>) +
1090 at OutputSections.cpp:1332
   1329         ESym->st_value = Body.Value;
   1330       } else {
   1331         const OutputSectionBase<ELFT> *OutSec = Section->OutSec;
-> 1332         ESym->st_shndx = OutSec->SectionIndex;
   1333         ESym->st_value = OutSec->getVA() + Section->getOffset(Body);
   1334       }
   1335       ESym->st_name = P.second;
(lldb) bt
* thread #1: tid = 101148, 0x0000000000650bb2
ld.lld`lld::elf::SymbolTableSection<llvm::object::ELFType<(llvm::support::endianness)0,
true> >::writeLocalSymbols(this=0x0000000806858160, Buf=<no value available>) +
1090 at OutputSections.cpp:1332, stop reason = signal SIGSEGV: invalid address
(fault address: 0x8)
  * frame #0: 0x0000000000650bb2
ld.lld`lld::elf::SymbolTableSection<llvm::object::ELFType<(llvm::support::endianness)0,
true> >::writeLocalSymbols(this=0x0000000806858160, Buf=<no value available>) +
1090 at OutputSections.cpp:1332
    frame #1: 0x0000000000650750
ld.lld`lld::elf::SymbolTableSection<llvm::object::ELFType<(llvm::support::endianness)0,
true> >::writeTo(this=0x0000000806858160, Buf="") + 96 at
OutputSections.cpp:1310
    frame #2: 0x0000000000778a51 ld.lld`(anonymous
namespace)::Writer<llvm::object::ELFType<(this=0x00007fffffffbfa0)0, true>
<span class="quote">>::writeSections() + 673 at Writer.cpp:1352</span >
    frame #3: 0x00000000007725ee ld.lld`(anonymous
namespace)::Writer<llvm::object::ELFType<(this=0x00007fffffffbfa0)0, true>
<span class="quote">>::run() + 318 at Writer.cpp:233</span >
    frame #4: 0x00000000007cd618 ld.lld`void
lld::elf::writeResult<llvm::object::ELFType<(llvm::support::endianness)0, true>
<span class="quote">>(Symtab=0x00007fffffffd680)0, true> >*) + 7208 at Writer.cpp:201</span >
    frame #5: 0x00000000005538b7 ld.lld`void
lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::support::endianness)0,
true> >(this=0x00007fffffffe168, Args=0x00007fffffffdc90) + 3175 at
Driver.cpp:521
    frame #6: 0x00000000005451ad
ld.lld`lld::elf::LinkerDriver::main(this=0x00007fffffffe168,
ArgsArr=ArrayRef<const char *> @ 0x00007fffffffdec8) + 1709 at Driver.cpp:281
    frame #7: 0x0000000000544a96 ld.lld`lld::elf::link(Args=ArrayRef<const char
*> @ 0x00007fffffffe3c0, Error=0x00000000048929e8) + 182 at Driver.cpp:49
    frame #8: 0x0000000000452077 ld.lld`main(Argc=3, Argv=0x00007fffffffe500) +
231 at lld.cpp:106
    frame #9: 0x0000000000451eaf ld.lld`_start(ap=<unavailable>,
cleanup=<unavailable>) + 367 at crt1.c:78 [opt]
(lldb)</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>