This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: v850-unknown-elf-objdump, can't disassemble for architectureunknown


Hi Torsten,

I downloaded libelf, looked up EM_V850, patched the ELF file, and now
v850-unknown-elf-objdump -h -S works as expected!

So i need to have a patched version of the ELF file to work on it with
binutils?

Yes - unless you use a patched version of binutils. See below.



> Daniel wrote.
I don't think the GNU tools have a v800 port.

It does not.


But maybe the GNU tools should accept EM_V800.

It should, and so I am checking in the attached patch. With this applied I am able to disassemble the binary that Torsten sent, without having to modify it in any way.


Torsten: Please note that this patch allows the binutils code to read binary files produced by the GreenHills toolchain. It does not make it produce binaries that are compatible with the GreenHills toolchain however. So if you use the GNU linker to create an executable it probably not be compatible with the GreenHills disassembler, debugger, etc. (I am assuming that GreenHills does not support the EM_V850 machine number).

Cheers
  Nick

bfd/ChangeLog
2005-06-15  Nick Clifton  <nickc@redhat.com>

	* elf32-v850.c (ELF_MACHINE_ALT2): Define so that binaries
	produced by the GreenHills toolchain can be assimilated.
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.55
diff -c -3 -p -r1.55 elf32-v850.c
*** bfd/elf32-v850.c	17 May 2005 10:22:40 -0000	1.55
--- bfd/elf32-v850.c	15 Jun 2005 08:13:50 -0000
*************** static struct bfd_elf_special_section co
*** 3217,3222 ****
--- 3217,3223 ----
  #define ELF_ARCH				bfd_arch_v850
  #define ELF_MACHINE_CODE			EM_V850
  #define ELF_MACHINE_ALT1			EM_CYGNUS_V850
+ #define ELF_MACHINE_ALT2			EM_V800 /* This is the value used by the GreenHills toolchain.  */
  #define ELF_MAXPAGESIZE				0x1000
  
  #define elf_info_to_howto			v850_elf_info_to_howto_rela

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]