Subject: Re: 4K vs. 8K pages in GAS
To: None <curt@portal.ca>
From: Gordon W. Ross <gwr@mc.com>
List: m68k
Date: 09/17/1996 11:17:24
> Date: Mon, 16 Sep 1996 23:34:09 -0700 (PDT)
> From: Curt Sampson <curt@portal.ca>
> 
> Just now I was attempting to bring up gas on my Sparc to cross-assemble
> for my Sun 3, and I discovered a little problem with the magic numbers.
> 
> It seems that we have different magic numbers for a.out files for
> m68k architectures wth 4K and 8K page sizes. This is a problem when
> compiling gas because unlike all of the other target include files,
> tc-m68k.h doesn't just define AOUT_MACHTYPE as a number, but defines
> it as MID_MACHINE, which is in turn taken from <machine/param.h>.
> This works fine for an assembler generated on the target machine,
> but not so well on my Sparc, which now would be using MID_SPARC,
> the Sparc a.out magic number, if it could find it.

My first suggestion is to just make gas (for m68k) always use
MID_M68K8K for its magic number.  In relocatable objects, it
does not matter if you use the 4k or 8k magic number, and the
most widely used one is m68k8k.

Then, make sure the loader (ld) can read both m68k4k and m68k8k,
and use its "output format" switch to control which it generates.

> So my first question here is, how different are m68k machines with
> 4K and 8K page sizes? Are they really not binary compatable? Why
> not? Or, if they are, why do we have separate magic numbers?

Machines with 4k page size can run either one.  Machines with 8k
page size can probably not run m68k4k executables, only m68k8k.

> If they aren't, perhaps we need to make real separate architectures
> for these two types of machines, rather than lumping them all under
> `m68k'. Or can someone think of a better way around this problem?

The gnu binutils supports multiple output formats.  That should help.

Gordon