Subject: Re: Changes to libexec/ld.aout_so/arch/sparc/md.c
To: Aymeric Vincent <Aymeric.Vincent@crans.ens-cachan.fr>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-toolchain
Date: 01/18/2000 15:21:26
On 19 Jan 2000, Aymeric Vincent wrote:

> Actually, I gave it a try yesterday until late... :-/ But the main
> problem is that host and target stuff are too much intermixed. I could
> get a cross-linker (from i386 to m68k, BTW), but here are the problems
> I encountered:

How exactly did you do this? A fair cunk of the machinery I'm using I
haven't released. :-)

>  - Executables produced had i386 midmag
>  - Endianness was messed up, so they appeared as PDP11 (and certainly
>    many other problems if they had had the right midmag anyway)
>  - Page size used was that of host (4k) instead of that of target (8k)
> 
> Basically, ld.old gives you two macros to play with: CROSS_LINKER and
> NEED_SWAP, the latter for md.h, in ld.aout_so. And you have to
> #undef __ELF__ at the right place in the source, too.
> 
> I think that if we want to make things nicely, we have to create a
> {config,arch,target,whatever} directory which will contain the
> possible definitions that pertain to the target wrt: page size,
> endianness, a.out format variant.
> 
> The challenge is to make this so that it's not redundant (or at least
> is synced up) with the various headers that define these things in
> /sys/arch/xxx/include/
> 
> We can't exactly use exec_aout.h as it stands because it uses
> {ntoh,hton}? stuff, which is host dependant and includes target
> dependant definitions without letting us a possibility to switch
> things in between... Oh yes, and {ntoh,hton}? are macros on the m68k,
> so we can't postpone the choice to the link phase...

??

I think this might be why there are size descriptions in the md copy code.
But using ntoh, etc is fine as they are defined correctly for the
architecture we are building on, which is the architecture we're running
on.

Take care,

Bill