<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63069>63069</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [BOLT][X86] After optimizing with llvm-bolt, libc.so.6 encounters a runtime error. 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          llongint
      </td>
    </tr>
</table>

<pre>
    Error information:
```bash
./install/bin/llvm-bolt /data/rpm/new/test/lib64/libc.so.6 -o libc.so.6.bolt
```
![image](https://github.com/llvm/llvm-project/assets/28920187/5d37a65f-1bac-4f5d-bd6d-f9ae3167da39)

In the code logic, determine whether the relocation item belongs to `.rela.plt` or `.rela.dyn` by the following judgment.
```cpp
const bool IsJmpRel = IsJmpRelocation.contains(Rel.Type);
```
![image](https://github.com/llvm/llvm-project/assets/28920187/0aa0d274-62f9-473f-bacb-d96fb8a9ac7f)

Surprisingly, the .rela.dyn section also contains a relocation entry of R_X86_64_IRELATIV (relocating to the .data.rel.ro section), which caused the section to exceed its expected size when added to .rela.plt.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VE1vpDgQ_TXuSwlEm8aYA4dkepCyGmmlbLSaW-SPAjwyNrLN9vT8-pVJurPKbS8jIVAV5apXr8pPxGgmh9iT5pE054PY0uxDb613k3HpIL2-9l9D8AGMG31YRDLekfqBVGdSPRBWvT1SxPnNVRI6GBeTsJbQQRpH6GDtP0shvU1A6KBFEoQOYV0IHRxeCB0SxpTDjGSnt68qoy8ZFB7uRpkTfCr7btIjaR7NIiYkzZlQPqe0xgySDoQOk0nzJkvll3coN0Rr8D9Q5coiRkyR0IHyjlZH3hI6NLpuBWvG4iiFKk5jowupmS7GTmB9ZK0WdUdo9w5hfz85SDOC8hrB-skoQr-AxoRhMQ7hMmOaMewxAa1XO5lgEi4gMVMeIXkgrCoDWlGuNhFWgQ8fLn112SWve5LRW-svxk3wY9PTgi6VnwhS6_rmUd7FBNJ7C0_xj2V9RgukPt-NdzCl8i4J4yKh_Blt-XJdMTdZP_5G5ishKk3bU8Ho2BWnth4LKZQsdMdGyUUnVDt-Yv6vLazBROMme82kZ3bujEFEtTMtbPRw6xDEf4eALoUr-BGeX79z9spOr0_PX789vDz9DYTyW6Cb8oD25HmNc4Uy-Fv-jIl-gcts1AxKbBH1HnsrnzzgT4WowaQI-HNFlVBDNL_23XAgtM5HPNznXx50X-uu7sQB-yPjDWubmvLD3Isjb5mUlHb62Kqq5TWtecc1V41s2kYdTE8rWlesolVd8RMvkcq6a-sTtp3iLR_JqcJFGFvmkZQ-TAcT44Y9qyvWHayQaOOuC5Q6vMD-k1CaZSIrRL7S2xTJqbImpviRJZlkd0F5_PPbS16L5vE7Z6Q5w8OYMIBfk1nMr0zmxaQZ7uqQyfu4--iU31zCsE9qc8ksCJilqITDFmz_v3dt7yDv2t7hvwEAAP__hkCRIA">