This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How can I access ELF Header from FOO-dis.c
- From: Shekhar Divekar <shekhar at cradle dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 19 Jan 2004 21:26:04 +0530
- Subject: Re: How can I access ELF Header from FOO-dis.c
- Organization: Cradle Technologies
- References: <400B80B0.4@cradle.com> <m3ad4kvwyl.fsf@gossamer.airs.com>
- Reply-to: shekhar at cradle dot com
To explain my requirement more.
The target is a SoC supporting multiple ISAs. MACHs map to
ISAs x ArchRevision. So bfd_get_mach() can give me only the default
MACH for an ArchRevision. In CGEN_COMPUTE_MACH I depend on SECTION
name [which is diff for each ISA] and ArchRevision to select the MACH.
The ARCH + MACH scheme is insufficient to represent all variations
hence I have to e_flags to store ArchRevision info.
So pictorially we have
TARGET_ARCH [bfd_arch]
|
/ \
/ \
/ \
ARCH_REV1 ARCH_REV2___
| | | | | |
ISA1 ISA2 ISA3 ISA1 ISA2 ISA3 [bfd_mach]
I have all the needed info in e_flags but I can't pass it to
disassembler without breaking the current bfd/cgen scheme.
Can someone suggest a good solution.
Thanks
Shekhar
Ian Lance Taylor wrote:
Shekhar Divekar <shekhar@cradle.com> writes:
I am working on a port of binutils 2.14.90 to our target.
I want use CGEN_COMPUTE_MACH macro in print_insn
to decipher the mach for which I am disassembling.
Also we store the arch and mach info in e_flgas of
ELF header.
How can I access ELF header information from
FOO-dis.c ?
Normally a disassembler would get this information using
bfd_get_arch() and bfd_get_mach(). Other parts of BFD would arrange
to have the right information stored there.
Ian