Sun Microdevil Pte Ltd<p>Anyone here familiar with SPARC binutils internals? I'm having a rather odd case where the same instruction (and same binary sequence) gets interpreted differently depending on who compiles it :cirnothinking: </p><p>Say, I have this `decode.s` file containing the following line:<br>decode: addxccc %g0, %g0, %g0</p><p>One VIS3 instruction, very simple. Then assemble it with both gcc and clang:<br>gcc -mcpu=niagara4 -c decode.s -o decode-gcc.o<br>clang -mcpu=niagara4 -c decode.s -o decode-clang.o</p><p>And now, if I run objdump on the files, the results are different:<br>decode-clang.o: file format elf64-sparc</p><p>Disassembly of section .text:</p><p>0000000000000000 <decode>:<br> 0: 81 b0 02 60 unknown</p><p>Compare with GCC's:<br>decode-gcc.o: file format elf64-sparc</p><p>Disassembly of section .text:</p><p>0000000000000000 <decode>:<br> 0: 81 b0 02 60 addxccc %g0, %g0, %g0</p><p>In both cases the binary stream is the same, but why does objdump decodes it as "unknown" with the clang-built file?</p><p>Edit: found it, seems like GCC sets something in the attribute section:</p><p>Attribute Section: gnu<br>File Attributes<br> Tag_GNU_Sparc_HWCAPS: vis3</p><p>Though as far as I can tell other than odd objump output it doesn't seem to affect binary execution, etc.</p><p><a href="https://uwu.social/tags/AskFedi" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AskFedi</span></a> <a href="https://uwu.social/tags/Binutils" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Binutils</span></a> <a href="https://uwu.social/tags/GCC" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GCC</span></a> <a href="https://uwu.social/tags/SPARC" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SPARC</span></a></p>