Subject: Re: Changes to libexec/ld.aout_so/arch/sparc/md.c
To: Bill Studenmund <>
From: Aymeric Vincent <>
List: tech-toolchain
Date: 01/19/2000 00:08:32
[ removed port-sparc from recipients list ]

Bill Studenmund <> writes:

> I'm trying to make cross compiling tools so that we can cross compile
> platforms which used ld.old (gas.old seems to cross compile quite well).
> Check out the .PATH directives in gnu/usr.bin/ld/ld/Makefile and in
> gnu/usr.bin/ld/ (I think that's the one).
> AFAIK CROSS_LINKER won't be defined in ld.aout_so's compilation, so it
> will be unchanged.

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:

 - 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

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...


COPYING:21-26: error: redefinition of concept `free'