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

    <tr>
        <th>Summary</th>
        <td>
            MC: "error: A dwo section may not contain relocations" when building with fission + RISCV64
        </td>
    </tr>

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

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

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

<pre>
    When building with fission, the `DW_AT_high_pc` field in `.debug_info` which is redirected to `.debug_info.dwo` will contain a label difference.  The field is meant to be `DW_AT_low_pc` relative distance, so the difference is unavoidable.  Furthermore, with relaxation, the size of the function may change at link time, and thus needs to be resolved at link time.

It appears that gcc will emit the object file, duplicate it and then "extract the DWO sections" dropping the associated relocations resulting in the file showing no relocations.

```
// RUN: %clang_cc1 -triple riscv64-unknown-linux-gnu -debug-info-kind=constructor -emit-obj -o %t.o -split-dwarf-file %t.dwo -split-dwarf-output %t.dwo
int f(void) { return 32; }
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U8lu2zAQ_Rr5MpBgS_Kigw5OjAA5tAXSJUeDIkcSG5oUuFhJv75D2s0GFBAkUjN8896bYWfES_s4ooYuSCWkHmCWfoReOieNzspb8CNCtlkeHo_7H8dRDuNx4rSnFFQCpI7BQmAXhqPUvYmheZR8BOnAopAWuUcB3nxKLMR8SZZKATfaM8JioFiHCoTse7SoORYAP4jBtZqDEzLtI1r3jpYy85WVRcW8PCMhOM_ofJTgTFLxBhqBgmZnIwXrVKxxFyyl2JOx6UQyIWI9E9qbD07-QTB9WvdB8xiDE3sBPjI9IDAPSuon8PKUYJgm4WNwoBGFu7K26Iw6kyXvs4tseciW-8v73gObJmSWjoyUNXB-sQlP0qfipvtNtpIrKtURYVKSM0_C_LUotTQrS3z2lvHLmcPjN3CYODsKgbBmmmLHY5A5Z7hksVMk2_AkOzbQBeVjEjUnqaaK4EYzx3_avE_-IIF6cX0u2_KOHnj4-TWr9kRszRUZduR8Bbm3ciJQKx0_b-o86CdtZp2TNeE5H3SAPA1NHocmf5JaZNWB5sV5G7g3FvLoSk6OQG4itC8M5I4M8bmYme3zxDkFaOQ-hkzwU_CvwQtZSQPWZ-UujkdWNpBtb0inD1ZDVWbVDf04fFK5EG0lmqphCy-9wvbL7UVnidYaG9d7iMWv_qeZ0ca_zv07G2Nr5v_eSMK8gYf777e_NvUiWNWO3k-OClwcHig1dAU3J9oodf73ySdr4sTQlnACUpW79WZTl4ux7cVqVbPNZlexVV1is9sxXK2aHWsa1tV8vUhX0rXZ-oa4aZwhQdA6Wx8Wsi2XZbnclsvVdl1XTdFsd9sN49iVWFdsW2b1Ek9MqiLyKIwdFrZNlKinjoKKLqp7C9IgyoGuSypH-Cz40diWFE0arVik2m3i_hdRiZLm">