Subject: howto create executable > 32MB ?
To: None <port-macppc@netbsd.org>
From: Christian Groessler <cpg@aladdin.de>
List: port-macppc
Date: 06/13/2004 21:59:05
Hi!

After trying to compile a recent MAME version I noticed that I
cannot create an executable > ~32 MB.


Consider this program:

------------------
#include <stdio.h>

int main(int argc, char **argv)
{
  printf("bla bla..\n");
  if (z()) return 1;
  return 0;
}

void x(void)
{
  /*__asm__(".ds.b   31 * 1024 * 1024      \n\t");*/
  __asm__(".ds.b   32 * 1024 * 1024      \n\t");
}

int z(void)
{
  return 0;
}
------------------

I get

/usr/lib/crt0.o(.text+0xbc): In function `_start':
: relocation truncated to fit: R_PPC_PLTREL24 atexit
/usr/lib/crt0.o(.text+0xd4): In function `_start':
: relocation truncated to fit: R_PPC_PLTREL24 exit
/usr/lib/crt0.o(.text+0x194): In function `_rtld_setup':
: relocation truncated to fit: R_PPC_PLTREL24 __syscall
/usr/lib/crt0.o(.text+0x1a8): In function `_rtld_setup':
: relocation truncated to fit: R_PPC_PLTREL24 __syscall
/usr/lib/crt0.o(.text+0x1d0): In function `_rtld_setup':
: relocation truncated to fit: R_PPC_PLTREL24 __syscall
/usr/lib/crt0.o(.text+0x1e4): In function `_rtld_setup':
: relocation truncated to fit: R_PPC_PLTREL24 __syscall
/usr/lib/crt0.o(.text+0x1ec): In function `_rtld_setup':
: relocation truncated to fit: R_PPC_PLTREL24 atexit
/usr/lib/crtbegin.o(.fini+0x0): relocation truncated to fit: R_PPC_LOCAL24PC .text+1e4
/var/tmp//ccHlW6Lg.o(.text+0x28): In function `main':
: relocation truncated to fit: R_PPC_REL24 printf
/var/tmp//ccHlW6Lg.o(.text+0x2c): In function `main':
: relocation truncated to fit: R_PPC_REL24 z

AFAIK the ppc subroutine call instruction uses a 24 bit displacement,
so my question is not why this happens, but whether there is a way to
create such a big program.

regards,
chris