<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 - [x86 asm] Assertion failed: (Type == RT32_32), function getRelocType32, file llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp, line 260."
   href="https://bugs.llvm.org/show_bug.cgi?id=47348">47348</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86 asm] Assertion failed: (Type == RT32_32), function getRelocType32, file llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp, line 260.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>new bugs
          </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>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Building the FreeBSD port graphics/vulkan-loader [1] results in an assertion:

Assertion failed: (Type == RT32_32), function getRelocType32, file
/usr/src/contrib/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp,
line 260.
PLEASE submit a bug report to <a href="https://bugs.freebsd.org/submit/">https://bugs.freebsd.org/submit/</a> and include the
crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -cc1as -triple i386-unknown-freebsd13.0
-filetype obj -main-file-name unknown_ext_chain_gas.s -target-cpu i686
-mrelocation-model static unknown_ext_chain_gas.s

This is caused by a @GOT relocation in the .s file [2]; minimized test case:

# clang -cc1as -triple i386-- -filetype obj unknown_ext_chain_gas-min.s
.intel_syntax noprefix
push offset termin_error_string@GOT

I could not find any version of clang that was able to compile this without
asserting! GNU as has no problems, obviously:

% as -v unknown_ext_chain_gas-min.s -o unknown_ext_chain_gas-min.o
GNU assembler version 2.33.1 (i386-portbld-freebsd13.0) using BFD version (GNU
Binutils) 2.33.1

% objdump -d -r unknown_ext_chain_gas-min.o

unknown_ext_chain_gas-min.o:     file format elf32-i386-freebsd


Disassembly of section .text:

00000000 <.text>:
   0:   68 00 00 00 00          push   $0x0
                        1: R_386_GOT32  termin_error_string

[1] <a href="https://github.com/KhronosGroup/Vulkan-Loader">https://github.com/KhronosGroup/Vulkan-Loader</a>
[2]
<a href="https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/unknown_ext_chain_gas.S#L103">https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/unknown_ext_chain_gas.S#L103</a></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>