<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 --- - Removal of AArch64II::MO_CONSTPOOL breaks booting the FreeBSD kernel"
   href="https://llvm.org/bugs/show_bug.cgi?id=30848">30848</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Removal of AArch64II::MO_CONSTPOOL breaks booting the FreeBSD kernel
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.9
          </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>Backend: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>andrew@fubar.geek.nz
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dimitry@andric.com, emaste@freebsd.org, llvm-bugs@lists.llvm.org, rafael.espindola@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In r271311 AArch64II::MO_CONSTPOOL was removed as it produces the same
instruction sequence as with accessing via the got. There is a difference
between the two however within the FreeBSD kernel. This is built as a dynamic
ELF binary, but doesn't have a run time linker.

FreeBSD makes extensive use of linker set, where it may iterate over all
objects within a named section. For this it has an weak extern pointer to the
__start and __stop variables the linker generates. Moving from llvm 3.8 to 3.9
there is a change in behaviour with weak extern pointers where they now always
pass through the got, however there is no dynamic linker to perform the needed
relocation so these become a NULL pointer dereference.

I can work around this by returning AArch64II::MO_NO_FLAG from
AArch64Subtarget::ClassifyGlobalReference, however I don't know if this is a
correct fix.</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>