mips16 addresses

Clarke, Stephen stephen.clarke@superh.com
Fri Sep 13 11:23:00 GMT 2002


> From: Andrew Cagney [mailto:ac131313@ges.redhat.com] 
> Sent: Thursday, September 12, 2002 11:33 AM

> > When a mips cpu is supposed to run code in mips16 mode, the 
> lsb of the address 
> > is set.  However, DWARF linetables are not preserving this 
> bit and it is not 
> > clear they should.  Is there a way to determine if an 
> address should be run 
> > in mips16 mode or not?  I remember a discussion about bfd 
> needing a new 
> > function that would return architecture information given 
> an address.  Was 
> > that ever added?

I thought dwarf 3.0 added a mechanism for describing the
ISA of regions of code?  There was certainly a proposal for
this.  Sorry, don't know the details.
I doubt it's supported by binutils yet, but it could be
the way to go for dwarf linetables.

But (IMO) support in dwarf is not a complete solution, because
you still want disassembly even when the dwarf lineinfo is
not present.

> It's really a BINUTILS problem.  The ``objdump 
> --disassemble'', which is 
> independant of GDB, needs to know the architecture/mode of 
> every address 
> so that each instruction is correctly disassembled.
> 
> I think GDB just needs access to that, or a similar, 
> interface.   That 
> way it can do transformations like:
> 	address -> machine/mode
> 
> How does the SH5 handle this?

There's a "cranges" data structure that holds the ISA
of code regions.  It's proprietary though, so it doesn't
appear in generic bfd code.  It's not clear to me whether the
code to handle cranges is there because it makes things
easier, or whether it's there because it was contractually
required ... I'll let the authors comment on that ;-)

Steve.



More information about the Binutils mailing list