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

    <tr>
        <th>Summary</th>
        <td>
            gtk-4.8.1 fails to create `gtkresources_blob2.o` with llvm-objcopy
        </td>
    </tr>

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

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

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

<pre>
    When trying to build gtk-4.8.1 on a `x86_64-pc-linux-musl` host with the LLVM toolchain I get the following error:
```
[260/1774] /usr/bin/x86_64-pc-linux-musl-ld -z noexecstack -r -b binary gtk/gtk.gresource -o gtk/gtkresources_blob.o
[261/1774] /usr/bin/x86_64-pc-linux-musl-objcopy --strip-all --rename-section .data=.gresource.gtk --add-symbol _gtk_resource_data=.gresource.gtk:0 gtk/gtkresources_blob.o gtk/gtkresources_blob2.o
FAILED: gtk/gtkresources_blob2.o 
/usr/bin/x86_64-pc-linux-musl-objcopy --strip-all --rename-section .data=.gresource.gtk --add-symbol _gtk_resource_data=.gresource.gtk:0 gtk/gtkresources_blob.o gtk/gtkresources_blob2.o
/usr/bin/x86_64-pc-linux-musl-objcopy: error: 'gtk/gtkresources_blob.o': Symbol table has link index of 5 which is not a valid index
```

I tried using `ld.bfd` + `llvm-objcopy` (on a glibc system though) and that failed as well
`ld.bfd` + `objcopy.binutils` works
`lld` + `objcopy.binutils` also works 

I would appreciate if someone could enlighten me what's going wrong here and where/how to fix this
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdVN9vmzAQ_mvg5QQCQwJ54KFVVqlS9zRpe4xsOMCNwZFtSrK_fmeSNp2WburrpMg53y9_33F3Qjen6kePIzhzkmMHToOYpGqgc_soj8s4BT0Ch2CdHMv1bp1HhzpScpyO0TBZRWrotXUwS9eD6xGenr5_pSxa1T2XIzxCh24xtFopPfs30BhtguwuSLZBckcpLr_zdXXPSGYPaVHkwWoLJE7W0CnkSOctFBHhjX7CqPGItXW83kNkIBJAIdycPBeKpDPuDFo9mRoh0lf1q9LuhNIi1u-QpJ9EosVzrQ8niCLrjDxEXCmSDY58wMhi7SSVM26440G2vcKJCQX58aaJ7GkQWsGONLtX8-5mAJUw-ZjERxb2yu_h7vHpy5aS_MUTLqX4v5h_go4vz2u_UgMUH_cMK7zLtzMHx4VC6LkFSrkHOTZ4BN3CCuZe1j1IS93qaK5euJLN2X57HJbzkcZTYgOT9fNDRtXEom389AXsflGol-EN86Iul7ntlBQ12JN1ONAY6qnrA7YBPjZ04w5aLhUlJqAzKvUG4Y_8l9QxVWxyUllvmrXZ22uI-pc_V1afg-B3crOeaIL54WCwltwhyBasHlCPCPViw1HJrne0pwakEnJH5bbQaV-O2Wg6ezS40Jq9RN-o17PfZq08ElNpQ6zS9TpnZZ6mLGyqrNlkGx466RRW12Xn62F9XG3QIyHcN_vI0_cr733dw8moqnfuYP1yYw--UchnEnGtB7p438tfdDD6mWaCrtLaCS0JqzJJN2FfbViyapOiEKvVpk2TMkGRl4hZkmCZJ4RZcYHKVrSfAsZGnGFJQTItqVBWLGEs2bAizZIyY3ErWJo166YoMK8LwYM8wYFYxh5HrE0XmmqBJKbOklFJ6-zVyK2V3Yi4PEf5-URdZKqBm5dwebdacP8CnNUOGA">