bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong architecture with elf32-sh


From: Nick Clifton
Subject: Re: Wrong architecture with elf32-sh
Date: 11 Jul 2001 10:51:59 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Hi Dietmar,

> When I link an binary and write the output as elf32-sh, I get the 
> wrong architecture "sh4"!!!

Well to be accurate, your binaries do not have an architecture value
set, and so the toolchain is defaulting to assume SH4 architecture.

> * starting gdb fails with the message : sh4 unsupported architecture

This looks like a problem with your version of GDB.  I suspect that
you must have an old version of GDB, because the latest versions do
support the SH4 architecture.

> * I tried to set the output architecture to "sh" or "sh4" with
>   "ld -A"  and "OUTPUT_ARCH" but both failed

How did they fail ?

> When setting the architecture (e.g. with *_set_arch_*() ) arch/mach
> becomes inconsistent to e_flags!

Where is this happening ?  Any code that actually tries to change the
architecture/machine variants should also be updating the flags as
well.

> The second reason for the strange behavior is:
> 
> e_flags=0 signals an unknown architecture. sh_elf_set_match_from_flags
> maps this to "sh4". I'm not sure that this is a useful behaviour. I
> would prefer mapping it to "sh3". That is more consistent 
> to the macro EF_SH_MERGE_MACH in include/els/sh.h

No actually it is more consistent the way it is.  If the architecture
is unknown, then the only safe default is SH4, the highest common
denominator.  The EF_SH_MERGE_MACH macro shows this, and would only
select SH3 if the other architecture was SH3 or less.


Cheers
        Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]