Hello colleagues,

I have an application that performs
like objdump. I mean: it takes the 32bits
of each ppc instruction and then generates
the string of assembled instruction.

On branch-conditional (bc) instructions the
generated objdump string shows diferent
branch hint for the same opcode.

Example:

objdump output:

...
10000480:       40 9e 00 5c     bne-    cr7,0x100004dc
...
100004b4:       40 9e ff e4     bne+    cr7,0x10000498
...

However, I hace compiled the following
assembly code to check the error:

bne- cr7,.
bne+ cr7,.

and the objdump output is:

0:   40 9e 00 00     bne-    cr7,0x0
4:   40 be 00 00     bne+    cr7,0x4

Now its, at least, the opcode it's different.

If we analyse the BO field (following the PowerPC 2.01
architecture description) of the instruction, it does
not correspond to the documentation.

opcode:

40 9e 00 5c --> BO: 4 documentation: no hint Objdump hint: no taken
40 9e ff e4 --> BO: 4 documentation: no hint Objdump hint: taken
40 9e 00 00 --> BO: 4 documentation: no hint Objdump hint: no taken
40 be 00 00 --> BO: 5 documentation: reserved Objdump hint: taken

In addition, I tried to compile with gcc4.0.2 the following
assembly:

bc 4,2,.
bc 6,2,.
bc 7,2,.

Following the documentation, the instructions shoud be:

bne $address
bne- $address
bne+ $address

However it does not compile. The second and third instruction are
not recognized.

In conclusion, I guess I'm missing something. Do gcc and objdump
follow the architecture documentation? (which version?)

If they really have to
follow the documentation, there is a bug on binutils (objdump
and as).

Well, sorry for the large explanation and thanks in advance.

Salut!

Ramon.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to