This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PowerPC 403 cross


		Hello All....


	I have been working recently on compiling C programs using gcc 
(target: powerpc-elf32), and was interested if anyone had some 
information specific to the PPC403 when using gcc.  I am unsure as to 
which registers are used for what, and any compiler flags I need to use.  
Currently I use flags: -mcpu=403, -D_BIG_ENDIAN.  I have figured out that 
r1 appears to used as a stack pointer of sorts, but as far as which 
registers are used for scratch, how parameters are passed, etc. I am in 
the dark.  
	Pointing r1 to a location in high RAM allows me to run a *very* 
simple program (single loop, printing characters), but one using floating 
point bombs when the FP section is run.  Incidentally the programs sit in 
ROM, and I'm attaching my linker script.

Thanks!

Larry Battraw
(larry@cicdphx.com)


ROM is from 0-0x20000
RAM is from 0x70000000-0x70080000

------------------------Linker Script---------------------------------
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
	      "elf32-powerpc")
OUTPUT_ARCH(powerpc)
 SEARCH_DIR(/d4/cross/ppc/powerpc-elf32/lib);
/* Do we need any of these for elf?
   __DYNAMIC = 0;    */
SECTIONS
{
  /* Read-only sections, merged into text segment: 0x7ff01000*/
  . = 0x00001000 + SIZEOF_HEADERS;
  .interp     : { *(.interp) 	}
  .hash          : { *(.hash)		}
  .dynsym        : { *(.dynsym)		}
  .dynstr        : { *(.dynstr)		}
  .rel.text      : { *(.rel.text)		}
  .rela.text     : { *(.rela.text) 	}
  .rel.data      : { *(.rel.data)		}
  .rela.data     : { *(.rela.data) 	}
  .rel.rodata    : { *(.rel.rodata) 	}
  .rela.rodata   : { *(.rela.rodata) 	}
  .rel.got       : { *(.rel.got)		}
  .rela.got      : { *(.rela.got)		}
  .rel.got1      : { *(.rel.got1)		}
  .rela.got1     : { *(.rela.got1)	}
  .rel.got2      : { *(.rel.got2)		}
  .rela.got2     : { *(.rela.got2)	}
  .rel.ctors     : { *(.rel.ctors)	}
  .rela.ctors    : { *(.rela.ctors)	}
  .rel.dtors     : { *(.rel.dtors)	}
  .rela.dtors    : { *(.rela.dtors)	}
  .rel.init      : { *(.rel.init)	}
  .rela.init     : { *(.rela.init)	}
  .rel.fini      : { *(.rel.fini)	}
  .rela.fini     : { *(.rela.fini)	}
  .rel.bss       : { *(.rel.bss)		}
  .rela.bss      : { *(.rela.bss)		}
  .rel.plt       : { *(.rel.plt)		}
  .rela.plt      : { *(.rela.plt)		}
  .init          : { *(.init)	} =0
  .plt      : { *(.plt)	}
  .text      :
  {
    *(.text)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
  } =0
  _etext = .;
  PROVIDE (etext = .);
  .fini      : { *(.fini)    } =0
  .rodata    : { *(.rodata)  }
  .rodata1   : { *(.rodata1) }
  /* Read-write section, merged into data segment: */
  . = 0x70000000;
  .data    :
  {
    *(.data)
    CONSTRUCTORS
  }
  .data1   : { *(.data1) }
  _GOT1_START_ = .;
  .got1   :  { *(.got1) }
  _GOT1_END_ = .;
  .dynamic       : { *(.dynamic) }
  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
     get relocated with -mrelocatable. Also put in the .fixup pointers.  */
  _GOT2_START_ = .;
  .got2    :  { *(.got2) }
  __CTOR_LIST__ = .;
  .ctors   : { *(.ctors) }
  __CTOR_END__ = .;
  __DTOR_LIST__ = .;
  .dtors   : { *(.dtors) }
  __DTOR_END__ = .;
  _FIXUP_START_ = .;
  .fixup   : { *(.fixup) }
  _FIXUP_END_ = .;
  _GOT2_END_ = .;
  _GOT_START_ = .;
  _GLOBAL_OFFSET_TABLE_ = . + 32768;
  _SDA_BASE_ = . + 32768;
  .got           : { *(.got.plt) *(.got) }
  /* We want the small data sections together, so single-instruction offsets
     can access them all, and initialized data all before uninitialized, so
     we can shorten the on-disk segment size.  */
  .sdata     : { *(.sdata) }
  _edata  =  .;
  PROVIDE (edata = .);
  .sbss      :
  {
    __sbss_start = .;
    *(.sbss)
    *(.scommon)
    __sbss_end = .;
  }
  _GOT_END_ = .;
  .bss       :
  {
   __bss_start = .;
   *(.dynbss)
   *(.bss)
   *(COMMON)
  }
  _end = . ;
  PROVIDE (end = .);
  /* These are needed for ELF backends which have not yet been
     converted to the new style linker.  */
  .stab 0 : { *(.stab) }
  .stabstr 0 : { *(.stabstr) }
  /* These must appear regardless of  .  */
}