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

    <tr>
        <th>Summary</th>
        <td>
            BOLT --update-debug-sections causes infinite loop when processing binaries generated with dwarf5 and compressed debug section
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            BOLT
      </td>
    </tr>

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

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

<pre>
    The binary is generated with -fdebug-default-version=5 and --compress-debug-sections=zstd.

The reproduce cmdline is: llvm-bolt libart.so -o=libart_bolt.so --data libart.bolt --reorder-blocks=ext-tsp --reorder-functions=cdsort --split-functions --split-strategy=profile2 --update-debug-sections --dyno-stats

The output is:
BOLT-ERROR: could not extract string from .debug_line_strBOLT-ERROR: could not extract strin'g from .debug_line_strBOLT-ERROR: could not extract string from .debug_line_strBOLT-ERROR: could not extract string from .debug_line_strBOLT-ERROR: could not extract string from .debug_line_strBOLT-ERROR: could not extract string from .debug_line_str

The libart.so can be constructed by the following cmds:
unzip libart_part1.zip
unzip libart_part2.zip
unzip libart_part3.zip
dd if=libart.so.part1 of=libart.so bs=28347826 count=1
dd if=libart.so.part2 of=libart.so bs=28347826 count=1 seek=1
dd if=libart.so.part3 of=libart.so bs=56695652 count=1 seek=1`

[libart_part1.zip](https://github.com/user-attachments/files/17104898/libart_part1.zip)
[libart_part2.zip](https://github.com/user-attachments/files/17104900/libart_part2.zip)
[libart_part3.zip](https://github.com/user-attachments/files/17104903/libart_part3.zip)
[libart_bolt.zip](https://github.com/user-attachments/files/17104905/libart_bolt.zip)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzclc1u4zgMx59GuQgybNmO7YMPU2RzWmCAYu6FPuhYO4pkSFQ76dMv5LTN9HMLbE9ziRBR_P9EiiZFjObgAEbSXpF2txEJZx_Gk5DGqY30-jT-mIFK40Q4URPpARwEgaDpncGZskmDTAemYRLJIruFEI13pN61VDhNGVP-uASIkZ0PRlBovIuk3t1H1AUpd6T8dv7NpABL8DopoOqorXFATST1N2rt7ZFJb5FaI0XAInrKPKl357832bTuMS1QPB5aHRgL4IOGwKT16mdGwy9kGJffTFNyTxdTOvqQ_eJiDV5MTzsRcwoOJ1LvluAnY4FTxtKiBcKLOPOFTs6ziALjy2B9wiXhOcLz7tX3v3-wv66vv1_noJVPVlPnkcIvDEIhjRiMO9Ap-CMtVtJNTtJNxPApV8K7_-H9h7i-fIZLRSnhqASqvIsYksplLk8UZ6CTt9bfZUV11Jf3Su7eLA8CN4sIWBX3ZnnHxj-w1Reb1tRMT5VdRF-swtQ_26Qylyrv66br-TYnwCGpd9VHGvyTGjQC_PwvsfpNsXa7Hdpty98S25a_Z560V6_y1u4I72fEZc0w3xO-PxickyyUPxK-TxECE4hCzUdwGAnf568vr1VXlU0_9ITvX8ny4S0k_xLkUJbPkfwDZP1FyPo5sn4HuTbFryG2F-KT6iNwo8daD_UgNjBWHe8q3m-HZjOPg4Sp5J2chC612nZD16uBS6mhG5Qum40ZecmbcuA1r9q-aooaJi0n2beaN6VqFGlKOApji9z_Cx8OGxNjgrEqh47XGysk2LgOL85zRyCc5zEWxvO8SIdImtKaiPGigAYtjPn0u01biRQhUuMm4wwCtd4v9G4GR5fgFcSYG8E6FA28mon6ToTpPP4ehx9ouhLoA2GTgh0_eI9814eFLcH_AwoJ36-hr29yjv525P8GAAD__9vklGE">