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
Say, I have this `decode.s` file containing the following line:
decode: addxccc %g0, %g0, %g0
One VIS3 instruction, very simple. Then assemble it with both gcc and clang:
gcc -mcpu=niagara4 -c decode.s -o decode-gcc.o
clang -mcpu=niagara4 -c decode.s -o decode-clang.o
And now, if I run objdump on the files, the results are different:
decode-clang.o: file format elf64-sparc
Disassembly of section .text:
0000000000000000 <decode>:
0: 81 b0 02 60 unknown
Compare with GCC's:
decode-gcc.o: file format elf64-sparc
Disassembly of section .text:
0000000000000000 <decode>:
0: 81 b0 02 60 addxccc %g0, %g0, %g0
In both cases the binary stream is the same, but why does objdump decodes it as "unknown" with the clang-built file?
Edit: found it, seems like GCC sets something in the attribute section:
Attribute Section: gnu
File Attributes
Tag_GNU_Sparc_HWCAPS: vis3
Though as far as I can tell other than odd objump output it doesn't seem to affect binary execution, etc.