This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix the incorrect assembling for ppc wait mnemonic
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: Zavier Luo <zavier dot luo at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 20 Jun 2016 23:05:13 -0500
- Subject: Re: [PATCH] Fix the incorrect assembling for ppc wait mnemonic
- Authentication-results: sourceware.org; auth=none
- References: <1466409386-12860-1-git-send-email-zavier dot luo at gmail dot com> <d9e9c79e-c759-ed77-0cea-8c85f40e6411 at vnet dot ibm dot com> <CAJ2zpq6DK3zHy0BR1FKgqXpf4Rrf616tdOVnxVbLetrhEWN6Nw at mail dot gmail dot com>
On 6/20/16 10:30 PM, Zavier Luo wrote:
> Hello Peter,
>
> When the "wait" instruction is used for NXP ppce500mc targets, the
> toolchain is incorrectly assembling the wait mnemonic into 0x7c00003c
> which gdb disassembles as "waitasec", the right value is 0x7c007c. I
> found the reason is that wait and waitasec use the same opcode.
>
> I attached the source file, object files and hexdump files. Hope is is
> helpful for your understanding.
You did not include the options you passed to gas to assemble the
asm file or the objdump options you used to disassemble them.
My guess is you didn't assemble the file with the correct gas
options, since wait is correctly assembled for me:
[bergner@igoo idle_e500]$ cat wait.s
.text
_start:
wait
[bergner@igoo idle_e500]$ ../build/binutils-e500/gas/as-new -a32 -me500mc -o wait.o wait.s
[bergner@igoo idle_e500]$ ../build/binutils-e500/binutils/objdump -d -Me500mc wait.o
wait.o: file format elf32-powerpc
Disassembly of section .text:
00000000 <_start>:
0: 7c 00 00 7c wait
Maybe you aren't passing any -m<CPU> option to gas? If you don't,
you're going to get an implicit -m<CPU> option that defaults to the
latest server cpu, which isn't what you want.
Peter