read big endian

npat@pink.priv.inaccessnetworks.com npat@pink.priv.inaccessnetworks.com
Tue May 6 02:26:00 GMT 2003


On Mon, May 05, 2003 at 12:43:36PM -0700, M B wrote:
>    I know that -mb flag is supposed to produce an 
> executable targeted for big endian systems.

For the targets that are based on architectures that can operate in
either big or little endian mode, the "-mb" switch (or some other
equivalent, like "-mbig-endian") can be used to select the endianess
of the resulting object files. This means if you are targeting, for
instance, the ARM architecture "-mbig-endian" will make the compiler
produce big-endian object files (binaries). These can run *only* on
systems where the ARM processor is configured to operate in big-endian
mode (on a little endian ARM-based system they would look like a pile
of illegal instructions, if not worse).

> My question is can i generate an executable running on little endian
> system (Linux ofcorse)

Linux is neither big nor little endian. The processor where it runs
may be either.

> while 
> reading big endian files(generated from AIX and
> Solaris).
>  If not, is there a workaround around this besides
> having to convert the files? 

Obviously the question has no meaning

/npat

-- 
Morality is always the product of terror; its chains and
strait-waistcoats are fashioned by those who dare not trust others,
because they dare not trust themselves, to walk in liberty.
  -- Aldous Huxley 



More information about the Gcc-help mailing list