<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 - invalid x86_64 Reference Kind"
   href="https://bugs.llvm.org/show_bug.cgi?id=32254">32254</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>invalid x86_64 Reference Kind
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>MachO
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>superjoe30@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18088" name="attach_18088" title="hello.ll">attachment 18088</a> <a href="attachment.cgi?id=18088&action=edit" title="hello.ll">[details]</a></span>
hello.ll

This is LLD 4.0.0 / clang 4.0.0:

The attached llvm IR code, when converted to an .o file and linked with the
following command, results in the following failure:

andy@Andrews-MacBook-Air:~/dev/zig/build$ ~/local/bin/clang -c hello.ll
andy@Andrews-MacBook-Air:~/dev/zig/build$ ~/local/bin/lld -flavor darwin
-demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -pie -o hello
hello.o -lSystem
warning: -sdk_version is required when emitting min version load command. 
Setting sdk version to match provided min version
invalid x86_64 Reference Kind
UNREACHABLE executed at
/Users/andy/Downloads/lld-4.0.0rc4.src/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp:620!
0  lld                      0x000000010acc4d4c
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1  lld                      0x000000010acc52b9
PrintStackTraceSignalHandler(void*) + 25
2  lld                      0x000000010acc0ee9 llvm::sys::RunSignalHandlers() +
425
3  lld                      0x000000010acc5812 SignalHandler(int) + 354
4  libsystem_platform.dylib 0x00007fffbebeebba _sigtramp + 26
5  libsystem_platform.dylib 0x000000011db25291 _sigtramp + 1593009905
6  libsystem_c.dylib        0x00007fffbea75420 abort + 129
7  lld                      0x000000010abf43f0 void*
llvm::object_creator<llvm::sys::SmartMutex<false> >() + 0
8  lld                      0x000000010b293c8e
lld::mach_o::ArchHandler_x86_64::applyFixupFinal(lld::Reference const&,
unsigned char*, unsigned long long, unsigned long long, unsigned long long,
unsigned long long, std::__1::function<unsigned long long (lld::Atom const&)>)
+ 1470
9  lld                      0x000000010b29312f
lld::mach_o::ArchHandler_x86_64::generateAtomContent(lld::DefinedAtom const&,
bool, std::__1::function<unsigned long long (lld::Atom const&)>,
std::__1::function<unsigned long long (lld::Atom const&)>, unsigned long long,
llvm::MutableArrayRef<unsigned char>) + 943
10 lld                      0x000000010b3101b0 (anonymous
namespace)::Util::copySectionContent(lld::mach_o::normalized::NormalizedFile&)
+ 1904
11 lld                      0x000000010b306fa5
lld::mach_o::normalized::normalizedFromAtoms(lld::File const&,
lld::MachOLinkingContext const&) + 2053
12 lld                      0x000000010b38c5ab
lld::mach_o::MachOWriter::writeFile(lld::File const&, llvm::StringRef) + 107
13 lld                      0x000000010b3d80e0
lld::LinkingContext::writeFile(lld::File const&) const + 112
14 lld                      0x000000010acd5e08
lld::mach_o::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&) + 3704
15 lld                      0x000000010ab742a2 main + 482
16 libdyld.dylib            0x00007fffbe9e1255 start + 1
Stack dump:
0.      Program arguments: /Users/andy/local/bin/lld -flavor darwin -demangle
-dynamic -arch x86_64 -macosx_version_min 10.10.0 -pie -o hello hello.o
-lSystem
Abort trap: 6</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>