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

    <tr>
        <th>Summary</th>
        <td>
            [BOLT] "_end" symbol is relocated incorrectly
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          ARG-NK
      </td>
    </tr>
</table>

<pre>
    BOLT relocates the linker script symbol "_end" to a new area, thus __bss_start and _end does not represent the actual bss section size anymore. 

example: 
Output ( readelf -S -W --dyn-sym lib.so) 
 
 Bss section size = **0x2480d0**
 [27] .bss              NOBITS 00000000011f89c0 11f89c0 **2480d0** 00  WA  0   0 16
 
   379: **00000000025cd690     0 NOTYPE  GLOBAL DEFAULT  ABS _end**
   440: 0000000001440a90     0 NOTYPE  GLOBAL DEFAULT   27 __end__
   465: 00000000011f89c0     0 NOTYPE  GLOBAL DEFAULT   27 __bss_start__
   492: 0000000001440a90     0 NOTYPE  GLOBAL DEFAULT   27 _bss_end__
   565: **00000000011f89c0     0 NOTYPE  GLOBAL DEFAULT   27 __bss_start**
   644: 0000000001440a90     0 NOTYPE  GLOBAL DEFAULT   27 __bss_end__
   
 Bss section size =  _end - __bss_start  = 0x25cd690 - 0x11f89c0 = 0x13D 4CD0 (Incorrect size)
   Bss section size = _bss_end__ - __bss_start = 0x1440a90 - 0x11f89c0 = 0x24 80D0 (correct size)

(Note: this change was introduced in this commit:
https://github.com/llvm/llvm-project/commit/3a0d894fafddace75f03fa7df25022cadbe2dffc)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclFGP4jYQxz-N8zIKciYxSR7yEI7jdOpqqbpbnfqEHNsBtyZGtnO39NNXCQm7cKe2t0bECmb-_5_H4-He632nVEXYirB1xPtwsK6qf_sUP_4SNVaeq9X24RmcMlbwoDyEgwKju7-UAy-cPgXw52NjDRDEneokQYRggUOnvgF3ihP8AOHQe9jtGu93PnAXgHcShn-DtMpDZwM4dXLKqy6MDlyEnhtovAevRNC2A6__VsC789E6tQBC14TWl6d64ceTUSStp5-3fTj1AQgW4BSXyrQQP0H8BeJYnrvYn49gdLPwlmA5hczT6t6RpGsgWBOs6QtmBZX08jaHsRXmhK1hMbDejMft6vPzE9B5JElblILCPF903moCpQBfagAKwzdZ3rIBpHk57vLCMw9kQi5LOppSeNw-__HrR4BPD9tV_QDrj5v694dngHr1BJcDeoMPkGV0kHylzDLK_1MMMIfdoLbbvSot2a3StM__o3StjLd6Jb6XbJC7hWMXuLvMvQvxLoHLLHt3Ar_n_LcyvNyY-OYijQv0ZS6BGOjLtb7GlSRdQ_ZhPZRb8bkT1jklwqhJsLza_tDvFe_OdFKeNvq9J2ZQ0IvlDw2nJxaPNozXNhy0B3Hg3V7BN-5Bd8FZ2QslQXfTqj0edSDpFHwI4eSHN9wQ3Ox1OPTNQtgjwY0xX-cpPjn7pxKB4GaKx03KqSzKrOWtlFyonLU0bXkuW2QUUXDZKJRtK660kaxSWaYlj1SV5MiKnLEsjQ6VkoXMWszKMmFUCpa0mCecpy0rirxBGukKKWa0HD4MMV3QvF22DXJR8qZM8pJkVB25NosBdmHdPtLe96pKaF6kNDK8UcbPvdlV45aafu9JRo32wb_GBR3M2MWHdj30ozfteGrQ2l_b-JDW6WTMOeqdqX46nyOoJ7iZWL9W-E8AAAD__9JcxzQ">