Subject: Re: howto create executable > 32MB ?
To: Christian Groessler <cpg@aladdin.de>
From: Bill Studenmund <wrstuden@netbsd.org>
List: port-macppc
Date: 06/15/2004 22:47:36
--f2QGlHpHGjS2mn6Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jun 13, 2004 at 09:59:05PM +0200, Christian Groessler wrote:
> Hi!
>=20
> After trying to compile a recent MAME version I noticed that I
> cannot create an executable > ~32 MB.

This problem is the same one that we encountered with LKMs on PowerPC
ports. Our PowerPC implementation has a number of different ways of
referencing symbols. By default, our assembler uses 24 bit relocations, as=
=20
they fit within one instruction and can represent +/- 32 MB. Unfortunately=
=20
you encountered a case where we need to be using the 32 bit relocations.=20
And by the time it's noticed, linking, it's too late.

Why does your program need 32 MB of BSS? malloc() is the way to go for=20
lots of memory.

There is one thing we should probably add to our linker to help with=20
programs over 32 MB big; a way to inject code that will make 32 bit jumps.=
=20
When we encounter a subroutine call (or jump, but that's unlikely to ever=
=20
happen), we add such code near the 24 bit relocation, point the 24 bit=20
relocation to the added code, and have the added code jump to the original=
=20
location.

Take care,

Bill

--f2QGlHpHGjS2mn6Y
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAz974Wz+3JHUci9cRAragAKCSwHcCBvB3DjMgZmra/D8aV135YQCff/xt
n059k8bHnIBwnbJPdcMyTuU=
=VeXn
-----END PGP SIGNATURE-----

--f2QGlHpHGjS2mn6Y--