* sh-coff-objdump cannot disassemble DSP instructions
@ 2002-01-11 9:25 Arati Dikey
2002-01-15 7:50 ` Nick Clifton
2002-06-14 9:11 ` Joern Rennecke
0 siblings, 2 replies; 4+ messages in thread
From: Arati Dikey @ 2002-01-11 9:25 UTC (permalink / raw)
To: binutils
hi !
The sh-coff-objdump cannot disassemble DSP instructions
while the sh-elf-objdump does so. It simply interprets them as data
(.word)
After digging thru' the source code, I think that
this is because the assembler (sh-coff-as)
stores the bfd architecture as 'sh' and not 'sh-dsp' (arch =
bfd_arch_sh , machine = 0).
The 'static int sh_dsp' in tc-sh.c is set when -dsp option is given to
assembler.
How do I store this value in the bfd info ?
I have read the BFD manual but am still not sure
how and where to make modifications in the bfd backend.
Any help/guidance on this will be greatly appreciated.
Regards,
Arati Dikey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download and free European support of GNU tool
chain (GNUSH v0101) for Hitachi's SH Series
Read more at http://www.kpit.com/products/support.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sh-coff-objdump cannot disassemble DSP instructions
2002-01-11 9:25 sh-coff-objdump cannot disassemble DSP instructions Arati Dikey
@ 2002-01-15 7:50 ` Nick Clifton
2002-06-14 9:11 ` Joern Rennecke
1 sibling, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2002-01-15 7:50 UTC (permalink / raw)
To: Arati Dikey; +Cc: binutils
Hi Arati,
> The sh-coff-objdump cannot disassemble DSP instructions
> while the sh-elf-objdump does so. It simply interprets them as data
> (.word)
Which version of binutils are you using ? The current sources do not
appear to exhibit this behaviour.
> The 'static int sh_dsp' in tc-sh.c is set when -dsp option is given
> to assembler. How do I store this value in the bfd info ?
By calling bfd_set_arch_mach(). For example you might do something
like this:
bfd_set_arch_mach (stdoutput, TARGET_ARCH,
sh_dsp ? bfd_mach_sh_dsp : bfd_mach_sh);
in gas/config/tc-sh.c:md_begin().
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sh-coff-objdump cannot disassemble DSP instructions
2002-01-11 9:25 sh-coff-objdump cannot disassemble DSP instructions Arati Dikey
2002-01-15 7:50 ` Nick Clifton
@ 2002-06-14 9:11 ` Joern Rennecke
1 sibling, 0 replies; 4+ messages in thread
From: Joern Rennecke @ 2002-06-14 9:11 UTC (permalink / raw)
To: Arati Dikey; +Cc: binutils
Arati Dikey wrote:
>
> hi !
>
> The sh-coff-objdump cannot disassemble DSP instructions
> while the sh-elf-objdump does so. It simply interprets them as data
> (.word)
sh-elf stores the 'mach'(ine) information in the elf flags. We have
no matching mechanism in place for sh-coff. Hence objdump has no
way to tell what SH variant the code is for. Note that sh-dsp
/ sh3-dsp use 0xfxxx opcodes for dsp instructions that are used by
the sh3e / sh4 or floating point, so there is no all-encompassing
instruction set that we could use. We'd have to implement a way
to store the mach value for sh-coff. That is, if we care about
not having to specify -msh_dsp to objdump when using coff for sh-dsp.
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: sh-coff-objdump cannot disassemble DSP instructions
@ 2002-01-15 23:31 Arati Dikey
0 siblings, 0 replies; 4+ messages in thread
From: Arati Dikey @ 2002-01-15 23:31 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
Thanks Nick.
I am using the latest binutils sources. (GNU objdump 020106 20020106).
My test program is as follows.
test.s
movs.w @-R4, A0
mov.b @r2,r3
sh-coff-as -dsp test.s -o test-coff.o
sh-coff-objdump -D test.coff.o -EB
the output is
start-coff-o: file format coff-shl
Disassembly of section .text:
00000000 <.text>:
0: f4 70 .word 0xf470
2: 63 20 mov.b @r2,r3
...
Disassembly of section .data:
Now my problem is as follows.
1. I am not sure whether it is the assembler or the objdump utility
which needs to be changed.
2. Thinking its the assembler, I made following changes.
1. tc-sh.h
extern int sh_dsp ;
#define TARGET_MACH_DSP (sh_dsp ? 1 : 0 )
2. In obj-coff.c,
in function write_object_file() I inserted the foll. code.
#ifdef TARGET_MACH_DSP
bfd_set_arch_mach (abfd, BFD_ARCH, bfd_mach_sh_dsp);
#else
bfd_set_arch_mach (abfd, BFD_ARCH, machine);
#endif
3. Removed the static qualifier to 'sh_dsp' in tc_sh.c
4. Then, thru' gdb I verified the value of abfd->arch_info just
before bfd_write()
and it displays everything correctly. (arch = bfd_arch_sh, mach =
45, arch_name = "sh",
printable_name = "sh_dsp')
5. Despite this, sh-coff-objdump produces the *same* wrong result.
6. Incidently, if you supply -msh_dsp to sh-coff-objdump, it works
fine. But -m is an optional argument. And it works properly in
sh-elf-objdump w/o the -m option.
I am not sure how to proceed. Please guide me.
Regards,
Arati
-----Original Message-----
From: Nick Clifton [mailto:nickc@cambridge.redhat.com]
Sent: Tuesday, January 15, 2002 8:36 PM
To: Arati Dikey
Cc: binutils@sources.redhat.com
Subject: Re: sh-coff-objdump cannot disassemble DSP instructions
Hi Arati,
> The sh-coff-objdump cannot disassemble DSP instructions
> while the sh-elf-objdump does so. It simply interprets them as data
> (.word)
Which version of binutils are you using ? The current sources do not
appear to exhibit this behaviour.
> The 'static int sh_dsp' in tc-sh.c is set when -dsp option is given
> to assembler. How do I store this value in the bfd info ?
By calling bfd_set_arch_mach(). For example you might do something
like this:
bfd_set_arch_mach (stdoutput, TARGET_ARCH,
sh_dsp ? bfd_mach_sh_dsp : bfd_mach_sh);
in gas/config/tc-sh.c:md_begin().
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-06-14 16:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-11 9:25 sh-coff-objdump cannot disassemble DSP instructions Arati Dikey
2002-01-15 7:50 ` Nick Clifton
2002-06-14 9:11 ` Joern Rennecke
2002-01-15 23:31 Arati Dikey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).