bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PowerPC objdump


From: Ramon Bertran Monfort
Subject: PowerPC objdump
Date: Thu, 03 Aug 2006 12:36:28 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]