This is the mail archive of the binutils@sourceware.cygnus.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]

Re: Default architecture according --target=...configury?


Stan Shebs wrote:
> 
>    Date: Thu, 19 Aug 1999 10:12:31 +1000
>    From: Andrew Cagney <ac131313@cygnus.com>
> 
>    >    PS: Why?  I'd like GDB to make a better guess at a default
>    >    architecture.  bfd_default_arch_struct just isn't very interesting.
>    >
>    > If you explain further what you mean by this, perhaps we can think of
>    > some way to make it work for you.  When does gdb want to know the
>    > default architecture?  What is it going to do with the information?
> 
>    Consider a GDB which has been built to support several different ISA's
>    (a mips4111, mips4300, ...).  What architecture should GDB select by
>    default when it goes to talk to a remote target?
> 
> I don't think it should be BFD's place to choose GDB's default target
> architecture.  BFD is just an object file reader.  GDB should assume
> an architecture compatible with the executable it is handed, and it
> should try to get it from the remote target if possible.  If neither
> is helpful or available, the default should be defined in GDB's
> configury somewhere.

When GDB is handed an executable it analyzes it (using BFD) and sets its
architecture accordingly.  For a remote target it should auto-detect the
architecture and again, for a few cases, it does that two.

The problem arises when there is no additional information available. 
As you suggest, one possibly is for GDB to configure a default arch
internally.  It just seems strange to me that GAS, BFD and GDB are all
doing it their own special way.

As an aside, GAS (well opcodes) uses BFD's config.bfd to determine
architecture information.  GDB has its own special configure.tgt.

	enjoy,
		Andrew

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