<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59199>59199</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lld: Set OS/ABI version to ELFOSABI_GNU if object contains GNU symbols
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
marxin
</td>
</tr>
</table>
<pre>
This is a spin of #40541, this time for LLVM linker:
ifunc.c:
```c
static int implementation (void)
{
__builtin_printf ("'ere I am JH\n");
return 0;
}
static __typeof__ (implementation)* resolver (void)
{
return implementation;
}
extern int magic (void) __attribute__ ((ifunc ("resolver")));
int main ()
{
return magic () != 0;
}
```
```
$ clang ifunc.c -fuse-ld=lld && readelf -a a.out
$ readelf -a a.out | less
...
OS/ABI: UNIX - System V
...
34: 00000000000017b0 8 <OS specific>: 10 GLOBAL DEFAULT 15 magic
```
While `bfd` and `gold` does:
```
$ gcc-12 ifunc.c && readelf -a a.out | less
...
OS/ABI: UNIX - GNU
...
25: 000000000040115b 11 IFUNC GLOBAL DEFAULT 15 magic
```
@MaskRay
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVE1zmzAQ_TXismMGCTBw4ODYcZqOk8zUSdqbR8BiqxHIg0Ra__tK4DgfTXLolNnB7K727dOT1oWqDvntTmiwxkHvRQuqBsLCKIgjStgcjMsa0SDUqoPV6v4KpGgfsCPhjAQLEhzfou7b0i-fo9NgtHL0teFGlCBaA6LZS2ywdRHV2m7poxIVYdmxMjkbPwA2m6IX0oh2s-9spWOWEsYIS7BDuATewNcvJJ63QzAj4amyQ9N3LQSnEEkWL-ke6Ww25rBHVW82Dvo1MQfIZhZJK_mI3Wc8j93e1H_QGn8bdIutEg3fWhLPwJYPN6YTRW9wpORYOWWPO38ic9zvaKc-40EMuKIdKz7kemrt2hJGSbh4V62nY3zZ4m2QRVBK3m7heAlgUvcaJ7KyoFJWFn5qzXbmFcoaJhy4r3rzXP02AySZg0StxyW-7z-xv1kTtpydXdp7Bp88d9eXP2AC64M22MD9XzAAYeQgghcPTYpgKE6BhPObtR0HLEUt7J0-d2tpABerm7PZChbny9nd6tYupfEo5Cdifd8JiWCDRV3ZN_C2ct5WycGtFOo3o_SOvNuynFB20vcDQf-XbBfXd-8oxuLXikUBpXHhMpTC5fLuem4__0UhEgVXXD984wcPczqdZmEapCn1qjyssjDjnhFGYi7dfZrBGs1pO2BHQbv_EKPgfLW8WdvYxrK3QoEqfmJpoFR2HEWr3aZAH5pCSe31ncx3xuwH5dnS2laYXV_4pWqsI-Xj089k3ymHY12hdW_Pii3jjGaZt8uDumAU7RnUaY2sygIaZTxLWMopphFDT_ICpc5JfGbntcVfMEC42Y0XnshZwBilLLYWhdQv0ipLMEnTtIroFBMrC9pBlr7j4atu63X5QKnot9ompdBGPye51mLbIg7tLD7vzU51ecO736L1hs75wPwPzSqgeg">