<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 --- - LTO linked llvm-tblgen crashes on startup"
   href="https://llvm.org/bugs/show_bug.cgi?id=27150">27150</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LTO linked llvm-tblgen crashes on startup
          </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>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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>davide@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>Output:
$ ./llvm-tblgen 
Could not open input file '': Bad address

It seems that static constructors aren't properly called.
I noticed the following difference between gold-plugin and lld:

gold-plugin:
$ readelf -SW ./llvm-tblgen |grep "init"
  [11] .init             PROGBITS        0000000000402e00 002e00 00001a 00  AX 
0   0  4
  [25] .init_array       INIT_ARRAY      00000000005a9990 1a8990 000048 00  WA 
0   0  8
$ readelf -SW ./llvm-tblgen |grep "ctors"

#############

lld:
$  readelf -SW ./llvm-tblgen |grep "init"
  [18] .init             PROGBITS        00000000001e4f78 1d4f78 00001a 00  AX 
0   0  4
  [24] .init_array       INIT_ARRAY      00000000001e6010 1d6010 000008 00  WA 
0   0  8

$  readelf -SW ./llvm-tblgen |grep "ctors"
  [25] .ctors            PROGBITS        00000000001e6018 1d6018 000040 00  WA 
0   0  8

Shouldn't we get only an .init_array of size 48 on lld as well?</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>