mixing big-endian and little-endian: gas/as can do?

Kai Ruottu karuottu@freenet.hut.fi
Thu Dec 17 02:27:00 GMT 1998

> Does gas/as have any capability for specifying the endian-ness of generated
> code from within a single source file?

 Yes, with '-mlittle'. Please look with : 'as --help'
> With the linker allow mixed-endian object code to be linked together?

 Doesn't seem reasonable...

> These are pertinant questions for generating code for PPC processors.  To run
> in LE mode there must be BE startup code that actual makes the switch, then
> the rest of the code is LE.

 Linker needs the '-EL' option for little-endian. Check your specs file having
the '%{mlittle*:-EL} somewhere in the LINK_SPEC (in the row after '*link:') in
the 'specs' file (probably in the 'install' given by:
   gcc -b ppc-eabi -print-search-dirs
or how you use the 'ppc-eabi' target compiler (Scott had a common gcc-driver).

 The default for 'ld' is big-endian, so this 'if -mlittle used, add -EL to ld-
options' is needed for LINK_SPEC... This was lacking from the egcs-1.1.1 
sources I last used for ppc-eabi target under Linux...

 BTW, my last build for cygwin32-host and ppc-eabi target was for b19 with 
egcs-1.1. Compiling egcs-1.1.1 things to b20.1 host is however my aim... 
Unfortunately all the tcl/tk-based things must be converted to b20.x at the
same time, so all my GDB's will be b19 based for some time...

 Remember to use the '--with-gnu-as' when configuring. Leaving this away
produces only the default and the 'nof' libraries, no 'le' ones at all...
(perhaps the Scott's libs will be ok). And be sure to test newlib-1.8.1
thoroughly, if you try it. Sticking with newlib-1.8.0 seems still to be
best (perhaps I'm the only one having all kind of weirdnesses with 1.8.1).

 Cheers, Kai
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

More information about the crossgcc mailing list