<div dir="ltr"><div dir="ltr">Hi Jan,<div><br></div><div>Thanks for looking into this! I think I can also provide further strange differences compared to clang. If the code above is compiled by gcc to an object file, disassembling the file will yield a secrel attribute with a value of .tls$, while disassembling a clang compiled object file will yield the attribute with the local symbol:</div><div><br></div><div>Compiled by gcc (Meaning it was assembled by as):</div><div>0000000000000000 <sectionrelative>:<br>   0: b8 00 00 00 00               mov    eax,0x0<br>                      1: IMAGE_REL_AMD64_SECREL       .tls$<br>   5:  c3                     ret<br></div><div><br></div><div>Compiled by clang (Meaning it was assembled by the clang integrated assembler):</div><div>0000000000000000 <sectionrelative>:<br>   0:   b8 00 00 00 00               mov    eax,0x0<br>                      1: IMAGE_REL_AMD64_SECREL       local<br>   5:  c3                     ret<br>   6:    66 2e 0f 1f 84 00 00    cs nop WORD PTR [rax+rax*1+0x0]<br>   d:        00 00 00 <br></div><div><br></div><div>The IMAGE_REL_AMD64_SECREL entries are different in the 2 disassembly snippets above (cs nop WORD PTR in clang can probably be ignored). However this difference seems to not be the reason that the linked programs produce different results, as assembling with as and then linking with clang still gives the correct result of 8</div><div><br></div><div>Thanks for your patience!</div><div><br></div><div>best regards,</div><div>Julian</div></div>
</div>