<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 --- - PowerPC unimplemented relocation assertion"
   href="https://llvm.org/bugs/show_bug.cgi?id=24686">24686</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>PowerPC unimplemented relocation assertion
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Backend: PowerPC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anton@samba.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>I hit this when cutting down a testcase for another issue:

# cat test.s

_stext:
ld %r5, p_end - _stext(%r5)

# clang -c tt.s

Unimplemented
UNREACHABLE executed at
/home/anton/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp:79!

(gdb) backtrace 
#0  __GI_abort () at abort.c:51
#1  0x000000001201e64c in llvm::llvm_unreachable_internal (
    msg=0x153d3330 "Unimplemented", 
    file=0x153d32d0
"/home/anton/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp",
line=79) at /home/anton/llvm/lib/Support/ErrorHandling.cpp:117
#2  0x000000001103c228 in (anonymous
namespace)::PPCELFObjectWriter::GetRelocType (this=0x16bb3260, Target=...,
Fixup=..., IsPCRel=true)
    at
/home/anton/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp:79
#3  0x0000000011ccf2bc in (anonymous namespace)::ELFObjectWriter::GetRelocType
    (this=0x16bb3280, Target=..., Fixup=..., IsPCRel=true)
    at /home/anton/llvm/lib/MC/ELFObjectWriter.cpp:131
#4  0x0000000011cd0ffc in (anonymous
namespace)::ELFObjectWriter::recordRelocation (this=0x16bb3280, Asm=...,
Layout=..., Fragment=0x16bb7660, Fixup=..., 
    Target=..., IsPCRel=@0x3fffffffc79f: true, FixedValue=@0x3fffffffc7a0: 0)
    at /home/anton/llvm/lib/MC/ELFObjectWriter.cpp:677
#5  0x0000000011d01558 in llvm::MCAssembler::handleFixup (this=0x16bb3440, 
    Layout=..., F=..., Fixup=...)
    at /home/anton/llvm/lib/MC/MCAssembler.cpp:849
#6  0x0000000011d01c58 in llvm::MCAssembler::layout (this=0x16bb3440, 
    Layout=...) at /home/anton/llvm/lib/MC/MCAssembler.cpp:922
#7  0x0000000011d01dc8 in llvm::MCAssembler::Finish (this=0x16bb3440)
    at /home/anton/llvm/lib/MC/MCAssembler.cpp:933
#8  0x0000000011d59c80 in llvm::MCObjectStreamer::FinishImpl (this=0x16bb30c0)
    at /home/anton/llvm/lib/MC/MCObjectStreamer.cpp:460
#9  0x0000000011d3a5b8 in llvm::MCELFStreamer::FinishImpl (this=0x16bb30c0)
    at /home/anton/llvm/lib/MC/MCELFStreamer.cpp:658
#10 0x0000000011d65ba4 in llvm::MCStreamer::Finish (this=0x16bb30c0)
    at /home/anton/llvm/lib/MC/MCStreamer.cpp:595
#11 0x0000000011d8b2fc in (anonymous namespace)::AsmParser::Run (
    this=0x16bb49f0, NoInitialTextSection=false, NoFinalize=false)
    at /home/anton/llvm/lib/MC/MCParser/AsmParser.cpp:705
#12 0x0000000010e63b88 in ExecuteAssembler (Opts=..., Diags=...)
    at /home/anton/llvm/tools/clang/tools/driver/cc1as_main.cpp:406
#13 0x0000000010e643c0 in cc1as_main (Argv=..., 
    Argv0=0x3ffffffff66f "/home/anton/llvm.install/bin/clang-3.8", 
    MainAddr=0x10e41440 <GetExecutablePath[abi:cxx11](char const*, bool)>)
    at /home/anton/llvm/tools/clang/tools/driver/cc1as_main.cpp:491
#14 0x0000000010e432a0 in ExecuteCC1Tool (argv=..., Tool=...)
    at /home/anton/llvm/tools/clang/tools/driver/driver.cpp:382
#15 0x0000000010e43910 in main (argc_=19, argv_=0x3ffffffff348)
    at /home/anton/llvm/tools/clang/tools/driver/driver.cpp:443

Looks the relocation is PPC::fixup_ppc_half16ds. This should fail, but it would
be nice if it failed with an error message instead of a compiler ICE.</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>