From dd066c3ac6e293bbaed225800b90f89854a89d0a Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Wed, 6 Jul 2005 04:31:18 +0000 Subject: [PATCH] added devkitPSP and rearranged scripts in directories by toolchain --- README.TXT | 41 +- build-devkit.sh | 64 +- dkarm/crtls/Makefile | 11 + dkarm/crtls/ds_arm7.ld | 172 +++ dkarm/crtls/ds_arm7.specs | 8 + dkarm/crtls/ds_arm7_crt0.s | 94 ++ dkarm/crtls/ds_arm9.ld | 228 ++++ dkarm/crtls/ds_arm9.specs | 8 + dkarm/crtls/ds_arm9_crt0.s | 258 ++++ dkarm/crtls/ds_cart.ld | 197 +++ dkarm/crtls/ds_cart.specs | 8 + dkarm/crtls/ds_cart_crt0.s | 161 +++ dkarm/crtls/er_crt0.s | 56 + dkarm/crtls/gba.specs | 8 + dkarm/crtls/gba_cart.ld | 298 +++++ dkarm/crtls/gba_crt0.s | 248 ++++ dkarm/crtls/gba_er.ld | 50 + dkarm/crtls/gba_er.specs | 8 + dkarm/crtls/gba_mb.ld | 284 ++++ dkarm/crtls/gba_mb.specs | 8 + dkarm/crtls/gp32.ld | 152 +++ dkarm/crtls/gp32.specs | 8 + dkarm/crtls/gp32_crt0.s | 74 ++ dkarm/crtls/gp32_gpsdk.ld | 197 +++ dkarm/crtls/gp32_gpsdk.specs | 8 + dkarm/crtls/gp32_gpsdk_crt0.s | 246 ++++ dkarm/rules/base_rules | 58 + dkarm/rules/ds_rules | 23 + dkarm/rules/gba_rules | 19 + dkarm/rules/gp32_rules | 18 + dkarm/scripts/build-crtls.sh | 37 + dkarm/scripts/build-gcc.sh | 95 ++ dkarm/scripts/build-tools.sh | 16 + dkppc/crtls/gcn.ld | 302 +++++ dkppc/crtls/gcn_crt0.s | 483 +++++++ dkppc/crtls/ogc.ld | 348 +++++ dkppc/crtls/specs | 355 +++++ dkppc/rules/base_rules | 55 + dkppc/rules/gamecube_rules | 10 + dkppc/scripts/build-crtls.sh | 26 + dkppc/scripts/build-gcc.sh | 93 ++ dkpsp/scripts/build-crtls.sh | 15 + dkpsp/scripts/build-gcc.sh | 94 ++ patches/devkit-binutils-2.16.1.patch | 1782 +++++++++++++++++++++++++- patches/devkit-gcc-3.4.4.patch | 504 +++++--- patches/devkit-newlib-1.13.0.patch | 128 +- patches/pspsdk-1.0+beta.patch | 42 + 47 files changed, 7152 insertions(+), 246 deletions(-) create mode 100644 dkarm/crtls/Makefile create mode 100644 dkarm/crtls/ds_arm7.ld create mode 100644 dkarm/crtls/ds_arm7.specs create mode 100644 dkarm/crtls/ds_arm7_crt0.s create mode 100644 dkarm/crtls/ds_arm9.ld create mode 100644 dkarm/crtls/ds_arm9.specs create mode 100644 dkarm/crtls/ds_arm9_crt0.s create mode 100644 dkarm/crtls/ds_cart.ld create mode 100644 dkarm/crtls/ds_cart.specs create mode 100644 dkarm/crtls/ds_cart_crt0.s create mode 100644 dkarm/crtls/er_crt0.s create mode 100644 dkarm/crtls/gba.specs create mode 100644 dkarm/crtls/gba_cart.ld create mode 100644 dkarm/crtls/gba_crt0.s create mode 100644 dkarm/crtls/gba_er.ld create mode 100644 dkarm/crtls/gba_er.specs create mode 100644 dkarm/crtls/gba_mb.ld create mode 100644 dkarm/crtls/gba_mb.specs create mode 100644 dkarm/crtls/gp32.ld create mode 100644 dkarm/crtls/gp32.specs create mode 100644 dkarm/crtls/gp32_crt0.s create mode 100644 dkarm/crtls/gp32_gpsdk.ld create mode 100644 dkarm/crtls/gp32_gpsdk.specs create mode 100644 dkarm/crtls/gp32_gpsdk_crt0.s create mode 100644 dkarm/rules/base_rules create mode 100644 dkarm/rules/ds_rules create mode 100644 dkarm/rules/gba_rules create mode 100644 dkarm/rules/gp32_rules create mode 100644 dkarm/scripts/build-crtls.sh create mode 100644 dkarm/scripts/build-gcc.sh create mode 100644 dkarm/scripts/build-tools.sh create mode 100644 dkppc/crtls/gcn.ld create mode 100644 dkppc/crtls/gcn_crt0.s create mode 100644 dkppc/crtls/ogc.ld create mode 100644 dkppc/crtls/specs create mode 100644 dkppc/rules/base_rules create mode 100644 dkppc/rules/gamecube_rules create mode 100644 dkppc/scripts/build-crtls.sh create mode 100644 dkppc/scripts/build-gcc.sh create mode 100644 dkpsp/scripts/build-crtls.sh create mode 100644 dkpsp/scripts/build-gcc.sh create mode 100644 patches/pspsdk-1.0+beta.patch diff --git a/README.TXT b/README.TXT index 926af50..8c81556 100644 --- a/README.TXT +++ b/README.TXT @@ -1,13 +1,13 @@ -Devkit r13 build scripts +DevkitPro build scripts -------------------------- -This readme will guide you through building devkitARM or devkitPPC from source using a set of scripts. +This readme will guide you through building devkitARM, devkitPPC or devkitPSP from source using a set of scripts. To use these scripts under minsys and MinGW you will need some additional packages over and above the base install. The minsys developer toolkit -http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download +http://prdownloads.sourceforge.net/mingw/msysDTK-1.0.1.exe?download Bison, Flex and Wget from the gnuwin32 project @@ -38,10 +38,14 @@ libogc, libgba and libnds can be found in the sourceforge project. http://sourceforge.net/projects/devkitpro -The top level shell script has now been unified and offers the option of devkitARM or devkitPPC. +the pspsdk can be found at -Building devkitARM ------------------- +http://ps2dev.org/files/pspsdk-1.0+beta.tar.gz + +The top level shell script has now been unified and offers the option of devkitARM, devkitPPC or devkitPSP. + +Building the devkits +-------------------- Simply run the "build-devkit.sh" script in the same directory as this text file as shown below, then follow the prompts; @@ -78,15 +82,6 @@ Getting started The best thing to do next is test the compiler, so go to http://www.devkit.tk and download "libgba" from the downloads section and also "PCXview" from the sample code section. -Building devkitPPC ------------------- - -Simply run the "build-devkit.sh" script in the same directory as this text file as shown below, then follow the prompts; - -./build-devkit.sh - -Once the script finds the source packages they will be decompressed and the build process will begin. When its finished you have the option to delete all temporary files, sources and their source packages. - Using devkitPPC --------------- @@ -144,7 +139,7 @@ planned for release 14 * newest libogc ------------------------------------------------------------------------------------- -18th February 2005 - release 11 beta 2 +18th February 2005 - devkitPPC release 11 beta 2 ------------------------------------------------------------------------------------- * patch for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9571 * updated to latest libogc @@ -171,7 +166,7 @@ planned for release 14 * updated specs file with -mogc switch for linking ------------------------------------------------------------------------------------- -12th June 2004 - release 6a +12th June 2004 - devkitARM release 6a ------------------------------------------------------------------------------------- * long calls patch added * -save-temps fixed (again) @@ -180,13 +175,13 @@ planned for release 14 * specs file and crt0 for gamepark gp32 libraries ------------------------------------------------------------------------------------- -8th May 2004 - release 6 +8th May 2004 - devkitARM release 6 ------------------------------------------------------------------------------------- * updated to gcc 3.4.0 * reverted to binutils 2.14.0 ------------------------------------------------------------------------------------- -12th April 2004 - release 5. +12th April 2004 - devkitARM release 5. ------------------------------------------------------------------------------------- * built in crt0 and linkscript for gp32 added. Use -specs=gp32.specs when linking * Mr Spiv's b2fxec included @@ -194,14 +189,14 @@ planned for release 14 * linux build available for download ------------------------------------------------------------------------------------- -15th March 2004 - Release 4 +15th March 2004 - devkitARM Release 4 ------------------------------------------------------------------------------------- * updated to binutils 2.15.90 * more msdev error output conversion * -save-temps fixed ------------------------------------------------------------------------------------- -26th February 2004 - Release 3a +26th February 2004 - devkitARM Release 3a ------------------------------------------------------------------------------------- * updated to newlib 1.12.0 * crt0, linkscript and runtime library support added to DevkitARM @@ -212,14 +207,14 @@ planned for release 14 * updated to gcc 3.3.3 ------------------------------------------------------------------------------------- -14th February 2004 - Release 2 +14th February 2004 - devkitARM Release 2 ------------------------------------------------------------------------------------- * crt0, linkscript and runtime library support added to DevkitPPC * adjusted error output for msdev * Fixed minor problem with include paths ------------------------------------------------------------------------------------- -16th January 2004 - release 1 +16th January 2004 - devkitARM release 1 ------------------------------------------------------------------------------------- * Initial build supporting arm target * Required link script and crt0 diff --git a/build-devkit.sh b/build-devkit.sh index a621acb..5d1fbab 100644 --- a/build-devkit.sh +++ b/build-devkit.sh @@ -1,6 +1,6 @@ #!/bin/sh #--------------------------------------------------------------------------------- -# Build scripts for devkitARM/devkitPPC release 12 +# Build scripts for devkitARM/devkitPPC/devkitPSP #--------------------------------------------------------------------------------- #--------------------------------------------------------------------------------- @@ -12,6 +12,7 @@ NEWLIB_VER=1.13.0 LIBOGC_VER=20050521 LIBGBA_VER=20050615 LIBNDS_VER=20050615 +PSPSDK_VER=1.0+beta BINUTILS="binutils-$BINUTILS_VER.tar.bz2" GCC_CORE="gcc-core-$GCC_VER.tar.bz2" @@ -20,6 +21,7 @@ NEWLIB="newlib-$NEWLIB_VER.tar.gz" LIBOGC="libogc-src-$LIBOGC_VER.tar.bz2" LIBGBA="libgba-src-$LIBGBA_VER.tar.bz2" LIBNDS="libnds-src-$LIBNDS_VER.tar.bz2" +PSPSDK="pspsdk-$PSPSDK_VER.tar.gz" BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/$BINUTILS" GCC_CORE_URL="http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/$GCC_CORE" @@ -28,7 +30,7 @@ LIBOGC_URL="http://osdn.dl.sourceforge.net/sourceforge/devkitpro/$LIBOGC" LIBGBA_URL="http://osdn.dl.sourceforge.net/sourceforge/devkitpro/$LIBGBA" LIBNDS_URL="http://osdn.dl.sourceforge.net/sourceforge/devkitpro/$LIBNDS" NEWLIB_URL="ftp://sources.redhat.com/pub/newlib/$NEWLIB" - +PSPSDK_URL="http://ps2dev.org/files/$PSPSDK" #--------------------------------------------------------------------------------- # Ask whether to download the source packages or not #--------------------------------------------------------------------------------- @@ -42,9 +44,10 @@ do echo echo "1: build devkitARM (gba gp32 ds)" echo "2: build devkitPPC (gamecube)" + echo "3: build devkitPSP (PSP)" read VERSION - if [ "$VERSION" -ne 1 -a "$VERSION" -ne 2 ] + if [ "$VERSION" -ne 1 -a "$VERSION" -ne 2 -a "$VERSION" -ne 3 ] then VERSION=0 fi @@ -52,19 +55,32 @@ done if [ $VERSION -eq 1 ] then - scriptdir='./dka-scripts' + scriptdir='./dkarm/scripts' package=devkitARM builddir=arm-elf target=arm-elf toolchain=DEVKITARM -else - scriptdir='./dkp-scripts' +fi + +if [ $VERSION -eq 2 ] +then + scriptdir='./dkppc/scripts' package=devkitPPC builddir=powerpc-gekko target=powerpc-gekko toolchain=DEVKITPPC fi +if [ $VERSION -eq 3 ] +then + scriptdir='./dkpsp/scripts' + package=devkitPSP + builddir=psp + target=psp + toolchain=DEVKITPSP +fi + + DOWNLOAD=0 while [ $DOWNLOAD -eq 0 ] @@ -167,6 +183,17 @@ then fi + if [ $VERSION -eq 3 ] + then + if [ ! -f $SRCDIR/$PSPSDK ] + then + echo "Error: $PSPSDK not found in $SRCDIR" + exit + else + FOUND=1 + fi + + fi done else @@ -209,6 +236,16 @@ else fi fi + if [ $VERSION -eq 3 ] + then + wget -c $PSPSDK_URL + if [ ! -f $PSPSDK ] + then + echo "Error: Failed to download "$PSPSDK + exit + fi + fi + if [ $VERSION -eq 1 ] then wget -c $LIBNDS_URL @@ -233,6 +270,7 @@ NEWLIB_SRCDIR="newlib-$NEWLIB_VER" LIBOGC_SRCDIR="libogc-$LIBOGC_VER" LIBGBA_SRCDIR="libgba-$LIBGBA_VER" LIBNDS_SRCDIR="libnds-$LIBNDS_VER" +PSPSDK_SRCDIR="pspsdk-$PSPSDK_VER" #--------------------------------------------------------------------------------- # Add installed devkit to the path, adjusting path on minsys @@ -289,6 +327,12 @@ then bzip2 -cd $SRCDIR/$LIBOGC | tar -xv -C $LIBOGC_SRCDIR fi +if [ $VERSION -eq 3 ] +then + echo "Extracting $PSPSDK" + tar -xzvf $SRCDIR/$PSPSDK +fi + if [ $VERSION -eq 1 ] then echo "Extracting $LIBNDS" @@ -307,6 +351,12 @@ patch -p1 -d $BINUTILS_SRCDIR -i $(pwd)/patches/devkit-binutils-$BINUTILS_VER.pa patch -p1 -d $GCC_SRCDIR -i $(pwd)/patches/devkit-gcc-$GCC_VER.patch patch -p1 -d $NEWLIB_SRCDIR -i $(pwd)/patches/devkit-newlib-$NEWLIB_VER.patch +if [ $VERSION -eq 3 ] +then + echo + patch -p1 -d $PSPSDK_SRCDIR -i $(pwd)/patches/pspsdk-$PSPSDK_VER.patch +fi + #--------------------------------------------------------------------------------- # only necessary when Darwin gcc is 3.1 or earlier, to add a check for this here @@ -348,7 +398,7 @@ rm -fr $target rm -fr $BINUTILS_SRCDIR rm -fr $NEWLIB_SRCDIR rm -fr $GCC_SRCDIR -rm -fr $LIBOGC_SRCDIR $LIBGBA_SRCDIR $LIBNDS_SRCDIR +rm -fr $LIBOGC_SRCDIR $LIBGBA_SRCDIR $LIBNDS_SRCDIR PSPSDK_SRCDIR echo echo "Would you like to delete the source packages? [y/N]" diff --git a/dkarm/crtls/Makefile b/dkarm/crtls/Makefile new file mode 100644 index 0000000..56a5081 --- /dev/null +++ b/dkarm/crtls/Makefile @@ -0,0 +1,11 @@ +PREFIX := arm-elf- +export CC := $(PREFIX)gcc +export CXX := $(PREFIX)g++ +export AR := $(PREFIX)ar +export OBJCOPY := $(PREFIX)objcopy + +all: + $(CC) -x assembler-with-cpp -marm -c $(CRT)_crt0.s -o$(CRT)_crt0.o + $(CC) -x assembler-with-cpp -marm -mthumb-interwork -c $(CRT)_crt0.s -o interwork/$(CRT)_crt0.o + $(CC) -x assembler-with-cpp -mthumb -c $(CRT)_crt0.s -o thumb/$(CRT)_crt0.o + $(CC) -x assembler-with-cpp -mthumb -mthumb-interwork -c $(CRT)_crt0.s -o thumb/interwork/$(CRT)_crt0.o diff --git a/dkarm/crtls/ds_arm7.ld b/dkarm/crtls/ds_arm7.ld new file mode 100644 index 0000000..8981ecb --- /dev/null +++ b/dkarm/crtls/ds_arm7.ld @@ -0,0 +1,172 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY { + + rom : ORIGIN = 0x08000000, LENGTH = 32M + iwram : ORIGIN = 0x03800000, LENGTH = 64K + ewram : ORIGIN = 0x02040000, LENGTH = 4M +} +__iwram_start = 0x03800000; +__iwram_end = 0x03810000; + +__sp_irq = __iwram_end - 0x60; +__sp_svc = __sp_irq - 0x100; +__sp_usr = __sp_svc - 0x100; + +SECTIONS +{ + .init : + { + __text_start = . ; + KEEP (*(.init)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + .plt : { *(.plt) } >iwram = 0xff + + .text : /* ALIGN (4): */ + { + + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + .fini : + { + KEEP (*(.fini)) + } >iwram =0xff + + __text_end = . ; + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + .jcr : { KEEP (*(.jcr)) } >iwram = 0 + .got : { *(.got.plt) *(.got) } >iwram = 0 + + + .iwram ALIGN(4) : + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + __iwram_end = . ; + + .data ALIGN(4) : { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); + } >iwram = 0xff + + __data_end = . ; + + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram + + __bss_end = . ; + __bss_end__ = . ; + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/ds_arm7.specs b/dkarm/crtls/ds_arm7.specs new file mode 100644 index 0000000..eb605fd --- /dev/null +++ b/dkarm/crtls/ds_arm7.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T ds_arm7.ld%s + +*startfile: +ds_arm7_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/ds_arm7_crt0.s b/dkarm/crtls/ds_arm7_crt0.s new file mode 100644 index 0000000..239729a --- /dev/null +++ b/dkarm/crtls/ds_arm7_crt0.s @@ -0,0 +1,94 @@ +@--------------------------------------------------------------------------------- + .section ".init" + .global _start +@--------------------------------------------------------------------------------- + .align 4 + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + mov r0, #0x04000000 @ IME = 0; + add r0, r0, #0x208 + strh r0, [r0] + + mov r0, #0x12 @ Switch to IRQ Mode + msr cpsr, r0 + ldr sp, =__sp_irq @ Set IRQ stack + + mov r0, #0x13 @ Switch to SVC Mode + msr cpsr, r0 + ldr sp, =__sp_svc @ Set SVC stack + + mov r0, #0x1F @ Switch to System Mode + msr cpsr, r0 + ldr sp, =__sp_usr @ Set user stack + + ldr r0, =__bss_start @ Clear BSS section to 0x00 + ldr r1, =__bss_end + sub r1, r1, r0 + bl ClearMem + + ldr r3, =_init @ global constructors + bl _call_via_r3 + + mov r0, #0 @ int argc + mov r1, #0 @ char *argv[] + ldr r3, =main + bl _call_via_r3 @ jump to user code + + @ If the user ever returns, return to flash cartridge + mov r0, #0x08000000 + bx r0 + +@--------------------------------------------------------------------------------- +@ Clear memory to 0x00 if length != 0 +@ r0 = Start Address +@ r1 = Length +@--------------------------------------------------------------------------------- +ClearMem: +@--------------------------------------------------------------------------------- + mov r2, #3 @ Round down to nearest word boundary + add r1, r1, r2 @ Shouldn't be needed + bics r1, r1, r2 @ Clear 2 LSB (and set Z) + bxeq lr @ Quit if copy size is 0 + + mov r2, #0 +ClrLoop: + stmia r0!, {r2} + subs r1, r1, #4 + bne ClrLoop + bx lr + +@--------------------------------------------------------------------------------- +@ Copy memory if length != 0 +@ r1 = Source Address +@ r2 = Dest Address +@ r4 = Dest Address + Length +@--------------------------------------------------------------------------------- +CopyMemCheck: +@--------------------------------------------------------------------------------- + sub r3, r4, r2 @ Is there any data to copy? +@--------------------------------------------------------------------------------- +@ Copy memory +@ r1 = Source Address +@ r2 = Dest Address +@ r3 = Length +@--------------------------------------------------------------------------------- +CopyMem: +@--------------------------------------------------------------------------------- + mov r0, #3 @ These commands are used in cases where + add r3, r3, r0 @ the length is not a multiple of 4, + bics r3, r3, r0 @ even though it should be. + bxeq lr @ Length is zero, so exit +CIDLoop: + ldmia r1!, {r0} + stmia r2!, {r0} + subs r3, r3, #4 + bne CIDLoop + bx lr + +@--------------------------------------------------------------------------------- + .align + .pool + .end +@--------------------------------------------------------------------------------- diff --git a/dkarm/crtls/ds_arm9.ld b/dkarm/crtls/ds_arm9.ld new file mode 100644 index 0000000..716168f --- /dev/null +++ b/dkarm/crtls/ds_arm9.ld @@ -0,0 +1,228 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY { + + rom : ORIGIN = 0x08000000, LENGTH = 32M + iwram : ORIGIN = 0x037f8000, LENGTH = 32K + ewram : ORIGIN = 0x02000000, LENGTH = 4M - 4k + dtcm : ORIGIN = 0x00800000, LENGTH = 16K + itcm : ORIGIN = 0x00000000, LENGTH = 32K +} + +__itcm_start = 0x00000000; +__iwram_start = 0x037f8000; +__iwram_end = 0x03800000; +__ewram_end = 0x02400000; +__eheap_end = 0x023ff000; +__dtcm_start = 0x00800000; +__dtcm_end = 0x00804000; + +__sp_svc = __dtcm_end - 0x100; +__sp_irq = __sp_svc - 0x100; +__sp_usr = __sp_irq - 0x100; + +SECTIONS +{ + .init : + { + __text_start = . ; + KEEP (*(.init)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + .plt : { *(.plt) } >ewram = 0xff + + .text : /* ALIGN (4): */ + { + + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .fini : + { + KEEP (*(.fini)) + } >ewram =0xff + + __text_end = . ; + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + .jcr : { KEEP (*(.jcr)) } >ewram = 0 + .got : { *(.got.plt) *(.got) } >ewram = 0 + + .ewram ALIGN(4) : + { + __ewram_start = ABSOLUTE(.) ; + *(.ewram) + *ewram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + __iwram_lma = . ; + + .iwram __iwram_start : AT (__iwram_lma) + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + __iwram_end = . ; + + __dtcm_lma = __iwram_lma + SIZEOF(.iwram); + + .dtcm __dtcm_start : AT (__dtcm_lma) + { + __dtcm_start = ABSOLUTE(.); + *(.dtcm) + *(.dtcm.*) + . = ALIGN(4); + } >dtcm = 0xff + __dtcm_end = . ; + + __data_lma = __dtcm_lma + SIZEOF(.dtcm) ; + + .data ALIGN(4) : AT (__data_lma) + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); + } >dtcm = 0xff + + __data_end = . ; + + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >dtcm + + __bss_end = . ; + __bss_end__ = . ; + + __itcm_lma = __data_lma + SIZEOF(.data); + + .itcm __itcm_start : AT (__itcm_lma) + { + __itcm_start = ABSOLUTE(.); + *(.itcm) + *(.itcm.*) + . = ALIGN(4); + } >itcm = 0xff + __itcm_end = . ; + + + __sbss_lma = __itcm_lma + SIZEOF(.itcm) ; + __appended_data = __itcm_lma + SIZEOF(.itcm) ; + + .sbss __sbss_lma : AT (__sbss_lma) + { + __sbss_start = ABSOLUTE(.); + *(.sbss) + . = ALIGN(4); + } >ewram + __sbss_end = . ; + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/ds_arm9.specs b/dkarm/crtls/ds_arm9.specs new file mode 100644 index 0000000..016f977 --- /dev/null +++ b/dkarm/crtls/ds_arm9.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T ds_arm9.ld%s + +*startfile: +ds_arm9_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/ds_arm9_crt0.s b/dkarm/crtls/ds_arm9_crt0.s new file mode 100644 index 0000000..59ae989 --- /dev/null +++ b/dkarm/crtls/ds_arm9_crt0.s @@ -0,0 +1,258 @@ +#define PAGE_4K (0b01011 << 1) +#define PAGE_8K (0b01100 << 1) +#define PAGE_16K (0b01101 << 1) +#define PAGE_32K (0b01110 << 1) +#define PAGE_64K (0b00111 << 1) +#define PAGE_128K (0b10000 << 1) +#define PAGE_256K (0b10001 << 1) +#define PAGE_512K (0b10010 << 1) +#define PAGE_1M (0b10011 << 1) +#define PAGE_2M (0b10100 << 1) +#define PAGE_4M (0b10101 << 1) +#define PAGE_8M (0b10110 << 1) +#define PAGE_16M (0b10111 << 1) +#define PAGE_32M (0b11000 << 1) +#define PAGE_64M (0b11001 << 1) +#define PAGE_128M (0b11010 << 1) +#define PAGE_256M (0b11011 << 1) +#define PAGE_512M (0b11100 << 1) +#define PAGE_1G (0b11101 << 1) +#define PAGE_2G (0b11110 << 1) +#define PAGE_4G (0b11111 << 1) + +@--------------------------------------------------------------------------------- + .section ".init" + .global _start +@--------------------------------------------------------------------------------- + .align 4 + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + mov r0, #0x04000000 @ IME = 0; + add r0, r0, #0x208 + strh r0, [r0] + + mov r1,#0 @ enable arm9 iwram + strb r1,[r0, #(0x247 - 0x208)] + + ldr r1, =0x00002078 @ disable DTCM and protection unit + mcr p15, 0, r1, c1, c0 + +@--------------------------------------------------------------------------------- +@ Protection Unit Setup added by Sasq +@--------------------------------------------------------------------------------- + @ Disable cache + mov r0, #0 + mcr p15, 0, r0, c7, c5, 0 @ Instruction cache + mcr p15, 0, r0, c7, c6, 0 @ Data cache + + @ Wait for write buffer to empty + mcr p15, 0, r0, c7, c10, 4 + + ldr r0, =0x0080000A + mcr p15, 0, r0, c9, c1 @ TCM base = 0x00800*4096, size = 16 KB +@--------------------------------------------------------------------------------- +@ Setup memory regions similar to Release Version +@ this code currently breaks dualis +@--------------------------------------------------------------------------------- + + @------------------------------------------------------------------------- + @ Region 0 - IO registers + @------------------------------------------------------------------------- + ldr r0,=( PAGE_64M | 0x04000000 | 1) + mcr p15, 0, r0, c6, c0, 0 + + @------------------------------------------------------------------------- + @ Region 1 - Main Memory + @------------------------------------------------------------------------- + ldr r0,=( PAGE_4M | 0x02000000 | 1) + mcr p15, 0, r0, c6, c1, 0 + + @------------------------------------------------------------------------- + @ Region 2 - iwram + @------------------------------------------------------------------------- + ldr r0,=( PAGE_32K | 0x037F8000 | 1) + mcr p15, 0, r0, c6, c2, 0 + + @------------------------------------------------------------------------- + @ Region 3 - DS Accessory (GBA Cart) + @------------------------------------------------------------------------- + ldr r0,=( PAGE_128M | 0x08000000 | 1) + mcr p15, 0, r0, c6, c3, 0 + + @------------------------------------------------------------------------- + @ Region 4 - DTCM + @------------------------------------------------------------------------- + @ldr r0,=( PAGE_16K | 0x027C0000 | 1) + ldr r0,=( PAGE_16K | 0x00800000 | 1) + mcr p15, 0, r0, c6, c4, 0 + + @------------------------------------------------------------------------- + @ Region 5 - ITCM + @------------------------------------------------------------------------- + ldr r0,=( PAGE_32K | 0x00000000 | 1) + mcr p15, 0, r0, c6, c5, 0 + + @------------------------------------------------------------------------- + @ Region 6 - System ROM + @------------------------------------------------------------------------- + ldr r0,=( PAGE_32K | 0xFFFF0000 | 1) + mcr p15, 0, r0, c6, c6, 0 + + @------------------------------------------------------------------------- + @ Region 7 - IPC + @------------------------------------------------------------------------- + ldr r0,=( PAGE_4K | 0x027FF000 | 1) + mcr p15, 0, r0, c6, c7, 0 + + @------------------------------------------------------------------------- + @ Write buffer enable + @------------------------------------------------------------------------- + ldr r0,=0b00000110 + mcr p15, 0, r0, c3, c0, 0 + + @------------------------------------------------------------------------- + @ DCache & ICache enable + @------------------------------------------------------------------------- + ldr r0,=0b01000110 + ldr r0,=0x42 + mcr p15, 0, r0, c2, c0, 0 + mcr p15, 0, r0, c2, c0, 1 + + @------------------------------------------------------------------------- + @ IAccess + @------------------------------------------------------------------------- + ldr r0,=0x06606333 + mcr p15, 0, r0, c5, c0, 3 + + @------------------------------------------------------------------------- + @ DAccess + @------------------------------------------------------------------------- + ldr r0,=0x36033333 + mcr p15, 0, r0, c5, c0, 2 + + @------------------------------------------------------------------------- + @ Enable ICache, DCache, ITCM & DTCM + @------------------------------------------------------------------------- + mrc p15, 0, r0, c1, c0, 0 + ldr r1,=0x55005 + orr r0,r0,r1 + mcr p15, 0, r0, c1, c0, 0 + + mov r0, #0x12 @ Switch to IRQ Mode + msr cpsr, r0 + ldr sp, =__sp_irq @ Set IRQ stack + + mov r0, #0x13 @ Switch to SVC Mode + msr cpsr, r0 + ldr sp, =__sp_svc @ Set SVC stack + + mov r0, #0x1F @ Switch to System Mode + msr cpsr, r0 + ldr sp, =__sp_usr @ Set user stack + + ldr r1, =__data_lma @ Copy initialized data (data section) from LMA to VMA (ROM to RAM) + ldr r2, =__data_start + ldr r4, =__data_end + bl CopyMemCheck + + ldr r1, =__iwram_lma @ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) + ldr r2, =__iwram_start + ldr r4, =__iwram_end + bl CopyMemCheck + + ldr r1, =__itcm_lma @ Copy instruction tightly coupled memory (itcm section) from LMA to VMA (ROM to RAM) + ldr r2, =__itcm_start + ldr r4, =__itcm_end + bl CopyMemCheck + + ldr r1, =__dtcm_lma @ Copy data tightly coupled memory (dtcm section) from LMA to VMA (ROM to RAM) + ldr r2, =__dtcm_start + ldr r4, =__dtcm_end + bl CopyMemCheck + + ldr r0, =__bss_start @ Clear BSS section + ldr r1, =__bss_end + sub r1, r1, r0 + bl ClearMem + + ldr r0, =__sbss_start @ Clear SBSS section + ldr r1, =__sbss_end + sub r1, r1, r0 + bl ClearMem + + ldr r1, =fake_heap_end @ set heap end + ldr r0, =__eheap_end + str r0, [r1] + + ldr r3, =_init @ global constructors + bl _call_via_r3 + + mov r0, #0 @ int argc + mov r1, #0 @ char *argv[] + ldr r3, =main + bl _call_via_r3 @ jump to user code + + @ If the user ever returns, go to an infinte loop + ldr r0, =ILoop + ldr r0, [r0] + ldr r1, =0x027FFE78 + str r0, [r1] + bx r1 +ILoop: + b ILoop + +@--------------------------------------------------------------------------------- +@ Clear memory to 0x00 if length != 0 +@ r0 = Start Address +@ r1 = Length +@--------------------------------------------------------------------------------- +ClearMem: +@--------------------------------------------------------------------------------- + mov r2, #3 @ Round down to nearest word boundary + add r1, r1, r2 @ Shouldn't be needed + bics r1, r1, r2 @ Clear 2 LSB (and set Z) + bxeq lr @ Quit if copy size is 0 + + mov r2, #0 +ClrLoop: + stmia r0!, {r2} + subs r1, r1, #4 + bne ClrLoop + + bx lr + +@--------------------------------------------------------------------------------- +@ Copy memory if length != 0 +@ r1 = Source Address +@ r2 = Dest Address +@ r4 = Dest Address + Length +@--------------------------------------------------------------------------------- +CopyMemCheck: +@--------------------------------------------------------------------------------- + sub r3, r4, r2 @ Is there any data to copy? +@--------------------------------------------------------------------------------- +@ Copy memory +@ r1 = Source Address +@ r2 = Dest Address +@ r3 = Length +@--------------------------------------------------------------------------------- +CopyMem: +@--------------------------------------------------------------------------------- + mov r0, #3 @ These commands are used in cases where + add r3, r3, r0 @ the length is not a multiple of 4, + bics r3, r3, r0 @ even though it should be. + bxeq lr @ Length is zero, so exit +CIDLoop: + ldmia r1!, {r0} + stmia r2!, {r0} + subs r3, r3, #4 + bne CIDLoop + + bx lr +@--------------------------------------------------------------------------------- + .align + .pool + .end +@--------------------------------------------------------------------------------- diff --git a/dkarm/crtls/ds_cart.ld b/dkarm/crtls/ds_cart.ld new file mode 100644 index 0000000..98cbee2 --- /dev/null +++ b/dkarm/crtls/ds_cart.ld @@ -0,0 +1,197 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY { + + rom : ORIGIN = 0x08000000, LENGTH = 32M + iwram : ORIGIN = 0x03800000, LENGTH = 64K + ewram : ORIGIN = 0x02000000, LENGTH = 4M +} +__iwram_start = 0x03800000; + +__ewram_start = 0x02000000; +__eheap_end = 0x02040000; +__sp_irq = 0x03810000 - 0x60; +__sp_svc = __sp_irq - 0x100; +__sp_usr = __sp_svc - 0x100; + +SECTIONS +{ + .init : + { + __text_start = . ; + KEEP (*(.init)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + .plt : { *(.plt) } >rom = 0xff + + .text : /* ALIGN (4): */ + { + + *(EXCLUDE_FILE (*text.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + .fini : + { + KEEP (*(.fini)) + } >rom =0xff + + __text_end = . ; + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + .jcr : { KEEP (*(.jcr)) } >rom = 0 + .got : { *(.got.plt) *(.got) } >rom = 0 + + __ewram_lma = . ; + + .ewram __ewram_start : AT (__ewram_lma) + { + __ewram_start = ABSOLUTE(.) ; + *(.ewram) + *ewram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .sbss ALIGN(4): + { + __sbss_start = ABSOLUTE(.); + *(.sbss) + . = ALIGN(4); + } >ewram + __sbss_end = . ; + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + __iwram_lma = __ewram_lma + SIZEOF(.ewram) + SIZEOF(.sbss); + + .iwram __iwram_start : AT (__iwram_lma) + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + __iwram_end = . ; + __data_lma = __iwram_lma + SIZEOF(.iwram) ; + + + .data ALIGN(4) : AT (__data_lma) + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); + } >iwram = 0xff + + __data_end = . ; + __appended_data = __data_lma + SIZEOF(.data) ; + + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram + + __bss_end = . ; + __bss_end__ = . ; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/ds_cart.specs b/dkarm/crtls/ds_cart.specs new file mode 100644 index 0000000..f3a6ff4 --- /dev/null +++ b/dkarm/crtls/ds_cart.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T ds_cart.ld%s + +*startfile: +ds_cart_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/ds_cart_crt0.s b/dkarm/crtls/ds_cart_crt0.s new file mode 100644 index 0000000..fa9997a --- /dev/null +++ b/dkarm/crtls/ds_cart_crt0.s @@ -0,0 +1,161 @@ +@--------------------------------------------------------------------------------- + .section ".init" + .global _start + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b rom_header_end + +@--------------------------------------------------------------------------------- + .fill 156,1,0 @ Nintendo Logo Character Data (8000004h) + .fill 16,1,0 @ Game Title + .byte 0x30,0x31 @ Maker Code (80000B0h) + .byte 0x96 @ Fixed Value (80000B2h) + .byte 0x00 @ Main Unit Code (80000B3h) + .byte 0x00 @ Device Type (80000B4h) + .fill 7,1,0 @ unused + .byte 0x00 @ Software Version No (80000BCh) + .byte 0xf0 @ Complement Check (80000BDh) + .byte 0x00,0x00 @ Checksum (80000BEh) + +rom_header_end: + b start_vector @ This branch must be here for proper + @ positioning of the following header. + + .GLOBAL __boot_method, __slave_number +__boot_method: + .byte 0 @ boot method (0=ROM boot, 3=Multiplay boot) +__slave_number: + .byte 0 @ slave # (1=slave#1, 2=slave#2, 3=slave#3) + + .byte 0 @ reserved + .byte 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved +@--------------------------------------------------------------------------------- + .align 4 + .arm +@--------------------------------------------------------------------------------- +start_vector: +@--------------------------------------------------------------------------------- + mov r0, #0x04000000 @ IME = 0; + add r0, r0, #0x208 + strh r0, [r0] + + mov r0, #0x12 @ Switch to IRQ Mode + msr cpsr, r0 + ldr sp, =__sp_irq @ Set IRQ stack + + mov r0, #0x13 @ Switch to SVC Mode + msr cpsr, r0 + ldr sp, =__sp_svc @ Set SVC stack + + + mov r0, #0x1F @ Switch to System Mode + msr cpsr, r0 + ldr sp, =__sp_usr @ Set user stack + + mov r1, #0x42 + strb r1, [r7], #1 + mov r1, #0x35 + strb r1, [r7], #1 + mov r1, #0x2B + strb r1, [r7], #1 + mov r1, #0x2B + strb r1, [r7], #1 + + ldr r1, =__data_lma @ Copy initialized data (data section) from LMA to VMA (ROM to RAM) + ldr r2, =__data_start + ldr r4, =__data_end + bl CopyMemChk + + ldr r1, =__iwram_lma @ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) + ldr r2, =__iwram_start + ldr r4, =__iwram_end + bl CopyMemChk + + ldr r0, =__bss_start @ Clear BSS section to 0x00 + ldr r1, =__bss_end + sub r1, r1, r0 + bl ClearMem + + ldr r0, =__sbss_start @ Clear SBSS section to 0x00 + ldr r1, =__sbss_end + sub r1, r1, r0 + bl ClearMem + + ldr r1, =fake_heap_end @ set heap end + ldr r0, =__eheap_end + str r0, [r1] + + ldr r3, =_init @ global constructors + bl _call_via_r3 + + mov r0, #0 @ int argc + mov r1, #0 @ char *argv[] + ldr r3, =main + bl _call_via_r3 @ jump to user code + + +@--------------------------------------------------------------------------------- +@ Clear memory to 0x00 if length != 0 +@ r0 = Start Address +@ r1 = Length +@--------------------------------------------------------------------------------- +ClearMem: + mov r2, #3 @ Round down to nearest word boundary + add r1, r1, r2 @ Shouldn't be needed + bics r1, r1, r2 @ Clear 2 LSB (and set Z) + bxeq lr @ Quit if copy size is 0 + + mov r2, #0 +@--------------------------------------------------------------------------------- +ClrLoop: +@--------------------------------------------------------------------------------- + stmia r0!, {r2} + subs r1, r1, #4 + bne ClrLoop + bx lr + +@--------------------------------------------------------------------------------- +@ Copy memory if length != 0 +@ r1 = Source Address +@ r2 = Dest Address +@ r4 = Dest Address + Length +@--------------------------------------------------------------------------------- +CopyMemChk: +@--------------------------------------------------------------------------------- + sub r3, r4, r2 @ Is there any data to copy? +@--------------------------------------------------------------------------------- +@ Copy memory +@ r1 = Source Address +@ r2 = Dest Address +@ r3 = Length +@--------------------------------------------------------------------------------- +CopyMem: +@--------------------------------------------------------------------------------- + mov r0, #3 @ These commands are used in cases where + add r3, r3, r0 @ the length is not a multiple of 4, + bics r3, r3, r0 @ even though it should be. + bxeq lr @ Length is zero so exit + +@--------------------------------------------------------------------------------- +CIDLoop: +@--------------------------------------------------------------------------------- + ldmia r1!, {r0} + stmia r2!, {r0} + subs r3, r3, #4 + bne CIDLoop + bx lr +@--------------------------------------------------------------------------------- + .align + .pool +@--------------------------------------------------------------------------------- + .end +@--------------------------------------------------------------------------------- + diff --git a/dkarm/crtls/er_crt0.s b/dkarm/crtls/er_crt0.s new file mode 100644 index 0000000..801ffa3 --- /dev/null +++ b/dkarm/crtls/er_crt0.s @@ -0,0 +1,56 @@ +@--------------------------------------------------------------------------------- +@ nintendo e-reader startup code +@--------------------------------------------------------------------------------- +@ author : tim schuerewegen +@ version : 1.0 +@--------------------------------------------------------------------------------- + .section ".init" + .global _start + .align + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b start_vector + .long 0 + .long 0x02000000 + +start_vector: + @ enter thumb mode + adr r0, _start_thumb + 1 + bx r0 + + .thumb + +_start_thumb: + + @ save return address (rom) + mov r3, lr + + @ clear bss section + ldr r0, =__bss_start + ldr r1, =__bss_end + mov r2, #0 +_loop_bss_clear: + strb r2, [r0] + add r0, #1 + cmp r0, r1 + blt _loop_bss_clear + + @ set return address (rom) + mov lr, r3 + + @ jump to main + ldr r3, =main + bx r3 + + .align + + .pool + + .end + + .align + .pool + .end + diff --git a/dkarm/crtls/gba.specs b/dkarm/crtls/gba.specs new file mode 100644 index 0000000..8d99583 --- /dev/null +++ b/dkarm/crtls/gba.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T gba_cart.ld%s + +*startfile: +gba_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/gba_cart.ld b/dkarm/crtls/gba_cart.ld new file mode 100644 index 0000000..e1e8926 --- /dev/null +++ b/dkarm/crtls/gba_cart.ld @@ -0,0 +1,298 @@ +/* Linker Script Original v1.3 by Jeff Frohwein */ +/* v1.0 - Original release */ +/* v1.1 - Added proper .data section support */ +/* v1.2 - Added support for c++ & iwram overlays */ +/* - Major contributions by Jason Wilkins. */ +/* v1.3 - .ewram section now can be used when */ +/* compiling for MULTIBOOT mode. This fixes */ +/* malloc() in DevKitAdvance which depends */ +/* on __eheap_start instead of end to define*/ +/* the starting location of heap space. */ +/* External global variable __gba_iwram_heap*/ +/* support added to allow labels end, _end, */ +/* & __end__ to point to end of iwram or */ +/* the end of ewram. */ +/* Additions by WinterMute */ +/* v1.4 - .sbss section added for unitialised */ +/* data in ewram */ +/* v1.5 - padding section added to stop EZF */ +/* stripping important data */ + +/* This file is released into the public domain */ +/* for commercial or non-commercial use with no */ +/* restrictions placed upon it. */ + +/* NOTE!!!: This linker script defines the RAM & */ +/* ROM start addresses. In order for it to work */ +/* properly, remove -Ttext and -Tbss linker */ +/* options from your makefile if they are */ +/* present. */ + +/* You can use the following to view section */ +/* addresses in your .elf file: */ +/* objdump -h file.elf */ +/* Please note that empty sections may incorrectly*/ +/* list the lma address as the vma address for */ +/* some versions of objdump. */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +/* SEARCH_DIR(/bin/arm); */ + +/* The linker script function "var1 += var2;" sometimes */ +/* reports incorrect values in the *.map file but the */ +/* actual value it calculates is usually, if not always, */ +/* correct. If you leave out the ". = ALIGN(4);" at the */ +/* end of each section then the return value of SIZEOF() */ +/* is sometimes incorrect and "var1 += var2;" appears to */ +/* not work as well. "var1 += var2" style functions are */ +/* avoided below as a result. */ + +MEMORY { + + rom : ORIGIN = 0x08000000, LENGTH = 32M + iwram : ORIGIN = 0x03000000, LENGTH = 32K + ewram : ORIGIN = 0x02000000, LENGTH = 256K +} + +__text_start = 0x8000000; +__eheap_end = 0x2040000; +__iwram_start = 0x3000000; +__iwram_end = 0x3008000; + +__sp_irq = __iwram_end - 0x100; +__sp_usr = __sp_irq - 0x100; + +SECTIONS +{ + . = __text_start; + .init : + { + KEEP (*(.init)) + . = ALIGN(4); + } >rom =0xff + + .plt : + { + *(.plt) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom + + .text : /* ALIGN (4): */ + { + *(EXCLUDE_FILE (*.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + __text_end = .; + .fini : + { + KEEP (*(.fini)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom =0 + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0 + + .jcr : { KEEP (*(.jcr)) } >rom + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >rom = 0 + + __iwram_lma = .; + + .iwram __iwram_start : AT (__iwram_lma) + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + __data_lma = __iwram_lma + SIZEOF(.iwram) ; + __iwram_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram + + __bss_end = . ; + __bss_end__ = . ; + + .data ALIGN(4) : AT (__data_lma) + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); + } >iwram = 0xff + + __iwram_overlay_lma = __data_lma + SIZEOF(.data); + + __data_end = .; + __iwram_overlay_start = . ; + + OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma) + { + .iwram0 { *(.iwram0) . = ALIGN(4);} + .iwram1 { *(.iwram1) . = ALIGN(4);} + .iwram2 { *(.iwram2) . = ALIGN(4);} + .iwram3 { *(.iwram3) . = ALIGN(4);} + .iwram4 { *(.iwram4) . = ALIGN(4);} + .iwram5 { *(.iwram5) . = ALIGN(4);} + .iwram6 { *(.iwram6) . = ALIGN(4);} + .iwram7 { *(.iwram7) . = ALIGN(4);} + .iwram8 { *(.iwram8) . = ALIGN(4);} + .iwram9 { *(.iwram9) . = ALIGN(4);} + }>iwram = 0xff + + __ewram_lma = LOADADDR(.iwram0) + SIZEOF(.iwram0)+SIZEOF(.iwram1)+SIZEOF(.iwram2)+SIZEOF(.iwram3)+SIZEOF(.iwram4)+SIZEOF(.iwram5)+SIZEOF(.iwram6)+SIZEOF(.iwram7)+SIZEOF(.iwram8)+SIZEOF(.iwram9); + + __iwram_overlay_end = . ; + __iheap_start = . ; + + __ewram_start = 0x2000000; + .ewram __ewram_start : AT (__ewram_lma) + { + *(.ewram) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + }>ewram = 0xff + + __ewram_overlay_lma = __ewram_lma + SIZEOF(.ewram); + + .sbss ALIGN(4): + { + __sbss_start = ABSOLUTE(.); + *(.sbss) + . = ALIGN(4); + } >ewram + + __sbss_end = .; + + __ewram_end = . ; + __ewram_overlay_start = . ; + + OVERLAY ALIGN(4): NOCROSSREFS AT (__ewram_overlay_lma) + { + .ewram0 { *(.ewram0) . = ALIGN(4);} + .ewram1 { *(.ewram1) . = ALIGN(4);} + .ewram2 { *(.ewram2) . = ALIGN(4);} + .ewram3 { *(.ewram3) . = ALIGN(4);} + .ewram4 { *(.ewram4) . = ALIGN(4);} + .ewram5 { *(.ewram5) . = ALIGN(4);} + .ewram6 { *(.ewram6) . = ALIGN(4);} + .ewram7 { *(.ewram7) . = ALIGN(4);} + .ewram8 { *(.ewram8) . = ALIGN(4);} + .ewram9 { *(.ewram9) . = ALIGN(4);} + }>ewram = 0xff + + __pad_lma = LOADADDR(.ewram0) + SIZEOF(.ewram0)+SIZEOF(.ewram1)+SIZEOF(.ewram2)+SIZEOF(.ewram3)+SIZEOF(.ewram4)+SIZEOF(.ewram5)+SIZEOF(.ewram6)+SIZEOF(.ewram7)+SIZEOF(.ewram8)+SIZEOF(.ewram9); + + /* EZF Advance strips trailing 0xff bytes, add a pad section so nothing important is removed */ + .pad ALIGN(4) : AT (__pad_lma) + { + LONG(0x52416b64) + LONG(0x4d) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } = 0xff + + __ewram_overlay_end = . ; + __eheap_start = . ; + + _end = .; + __end__ = _end ; /* v1.3 */ + PROVIDE (end = _end); /* v1.3 */ + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/gba_crt0.s b/dkarm/crtls/gba_crt0.s new file mode 100644 index 0000000..2849a41 --- /dev/null +++ b/dkarm/crtls/gba_crt0.s @@ -0,0 +1,248 @@ + .section ".init" + .global _start + .align + .arm +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b rom_header_end + + .fill 156,1,0 @ Nintendo Logo Character Data (8000004h) + .fill 16,1,0 @ Game Title + .byte 0x30,0x31 @ Maker Code (80000B0h) + .byte 0x96 @ Fixed Value (80000B2h) + .byte 0x00 @ Main Unit Code (80000B3h) + .byte 0x00 @ Device Type (80000B4h) + .fill 7,1,0 @ unused + .byte 0x00 @ Software Version No (80000BCh) + .byte 0xf0 @ Complement Check (80000BDh) + .byte 0x00,0x00 @ Checksum (80000BEh) + +@--------------------------------------------------------------------------------- +rom_header_end: +@--------------------------------------------------------------------------------- + b start_vector @ This branch must be here for proper + @ positioning of the following header. + + .GLOBAL __boot_method, __slave_number +@--------------------------------------------------------------------------------- +__boot_method: +@--------------------------------------------------------------------------------- + .byte 0 @ boot method (0=ROM boot, 3=Multiplay boot) +@--------------------------------------------------------------------------------- +__slave_number: +@--------------------------------------------------------------------------------- + .byte 0 @ slave # (1=slave#1, 2=slave#2, 3=slave#3) + + .byte 0 @ reserved + .byte 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + .word 0 @ reserved + + .global start_vector + .align +@--------------------------------------------------------------------------------- +start_vector: +@--------------------------------------------------------------------------------- + mov r0, #0x4000000 @ REG_BASE + add r0, r0, #0x208 @ REG_IME + strh r0, [r0] + + mov r0, #0x12 @ Switch to IRQ Mode + msr cpsr, r0 + ldr sp, =__sp_irq @ Set IRQ stack + mov r0, #0x1f @ Switch to System Mode + msr cpsr, r0 + ldr sp, =__sp_usr @ Set user stack + +@--------------------------------------------------------------------------------- +@ Enter Thumb mode +@--------------------------------------------------------------------------------- + add r0, pc, #1 + bx r0 + + .thumb + + ldr r0, =__text_start + lsl r0, #5 @ Was code compiled at 0x08000000 or higher? + bcs DoEWRAMClear @ yes, you can not run it in external WRAM + + mov r0, pc + lsl r0, #5 @ Are we running from ROM (0x8000000 or higher) ? + bcc SkipEWRAMClear @ No, so no need to do a copy. + +@--------------------------------------------------------------------------------- +@ We were started in ROM, silly emulators. :P +@ So we need to copy to ExWRAM. +@--------------------------------------------------------------------------------- + mov r3, #0x40 + lsl r3, #12 @ r3 = 0x40000 + lsl r2, r3, #7 @ r2 = 0x2000000 + mov r6, r2 @ r6 = 0x2000000 + lsl r1, r2, #2 @ r1 = 0x8000000 + + bl CopyMem + + bx r6 @ Jump to the code to execute + +@--------------------------------------------------------------------------------- +DoEWRAMClear: @ Clear External WRAM to 0x00 +@--------------------------------------------------------------------------------- + mov r1, #0x40 + lsl r1, #12 @ r1 = 0x40000 + lsl r0, r1, #7 @ r0 = 0x2000000 + bl ClearMem + +@--------------------------------------------------------------------------------- +SkipEWRAMClear: @ Clear Internal WRAM to 0x00 +@--------------------------------------------------------------------------------- + mov r0, #3 + lsl r0, #24 @ r0 = 0x3000000 + ldr r1, =__iwram_end + sub r1,r0 + bl ClearMem + +@--------------------------------------------------------------------------------- +@ Clear SBSS section to 0x00 +@--------------------------------------------------------------------------------- + ldr r0, =__sbss_start + ldr r1, =__sbss_end + sub r1, r0 + bl ClearMem + +@--------------------------------------------------------------------------------- +@ Copy initialized data (data section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r1, =__data_lma + ldr r2, =__data_start + ldr r4, =__data_end + bl CopyMemChk + +@--------------------------------------------------------------------------------- +@ Copy internal work ram (iwram section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r1,= __iwram_lma + ldr r2,= __iwram_start + ldr r4,= __iwram_end + bl CopyMemChk + +@--------------------------------------------------------------------------------- +@ Copy internal work ram overlay 0 (iwram0 section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r2,= __load_stop_iwram0 + ldr r1,= __load_start_iwram0 + sub r3, r2, r1 @ Is there any data to copy? + beq CIW0Skip @ no + + ldr r2,= __iwram_overlay_start + bl CopyMem +@--------------------------------------------------------------------------------- +CIW0Skip: +@--------------------------------------------------------------------------------- +@ Copy external work ram (ewram section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r1, =__ewram_lma + ldr r2, =__ewram_start + ldr r4, =__ewram_end + bl CopyMemChk + +@--------------------------------------------------------------------------------- +@ Copy external work ram overlay 0 (ewram0 section) from LMA to VMA (ROM to RAM) +@--------------------------------------------------------------------------------- + ldr r2, =__load_stop_ewram0 + ldr r1, =__load_start_ewram0 + sub r3, r2, r1 @ Is there any data to copy? + beq CEW0Skip @ no + + ldr r2, =__ewram_overlay_start + bl CopyMem +@--------------------------------------------------------------------------------- +CEW0Skip: +@--------------------------------------------------------------------------------- +@ set heap end +@--------------------------------------------------------------------------------- + ldr r1, =fake_heap_end + ldr r0, =__eheap_end + str r0, [r1] +@--------------------------------------------------------------------------------- +@ global constructors +@--------------------------------------------------------------------------------- + ldr r3, =_init + bl _call_via_r3 +@--------------------------------------------------------------------------------- +@ Jump to user code +@--------------------------------------------------------------------------------- + mov r0, #0 @ int argc + mov r1, #0 @ char *argv[] + ldr r3, =main + bl _call_via_r3 +@--------------------------------------------------------------------------------- +@ Clear memory to 0x00 if length != 0 +@--------------------------------------------------------------------------------- +@ r0 = Start Address +@ r1 = Length +@--------------------------------------------------------------------------------- +ClearMem: +@--------------------------------------------------------------------------------- + mov r2,#3 @ These commands are used in cases where + add r1,r2 @ the length is not a multiple of 4, + bic r1,r2 @ even though it should be. + + beq ClearMX @ Length is zero so exit + + mov r2,#0 +@--------------------------------------------------------------------------------- +ClrLoop: +@--------------------------------------------------------------------------------- + stmia r0!, {r2} + sub r1,#4 + bne ClrLoop +@--------------------------------------------------------------------------------- +ClearMX: +@--------------------------------------------------------------------------------- + bx lr + +@--------------------------------------------------------------------------------- +@ Copy memory if length != 0 +@--------------------------------------------------------------------------------- +@ r1 = Source Address +@ r2 = Dest Address +@ r4 = Dest Address + Length +@--------------------------------------------------------------------------------- +CopyMemChk: +@--------------------------------------------------------------------------------- + sub r3, r4, r2 @ Is there any data to copy? +@--------------------------------------------------------------------------------- +@ Copy memory +@--------------------------------------------------------------------------------- +@ r1 = Source Address +@ r2 = Dest Address +@ r3 = Length +@--------------------------------------------------------------------------------- +CopyMem: +@--------------------------------------------------------------------------------- + mov r0, #3 @ These commands are used in cases where + add r3, r0 @ the length is not a multiple of 4, + bic r3, r0 @ even though it should be. + beq CIDExit @ Length is zero so exit + +@--------------------------------------------------------------------------------- +CIDLoop: +@--------------------------------------------------------------------------------- + ldmia r1!, {r0} + stmia r2!, {r0} + sub r3, #4 + bne CIDLoop +@--------------------------------------------------------------------------------- +CIDExit: +@--------------------------------------------------------------------------------- + bx lr + + .align + .pool + .end + diff --git a/dkarm/crtls/gba_er.ld b/dkarm/crtls/gba_er.ld new file mode 100644 index 0000000..4147ebe --- /dev/null +++ b/dkarm/crtls/gba_er.ld @@ -0,0 +1,50 @@ +/***********************************/ +/* NINTENDO E-READER LINKER SCRIPT */ +/***********************************/ +/* Author : Tim Schuerewegen */ +/* Version : 1.0 */ +/***********************************/ + +OUTPUT_FORMAT( "elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH( arm) +ENTRY( _start) + +SECTIONS +{ + . = 0x02000000; + + .init : + { + *(.init) + . = ALIGN(4); + } = 0xff + + .text : + { + *(.text) + . = ALIGN(4); + } = 0xff + + .rodata : + { + *(.rodata) + . = ALIGN(4); + } = 0xff + + .data : + { + *(.data) + . = ALIGN(4); + } = 0xff + + .bss : + { + __bss_start = .; + *(.bss) + . = ALIGN(4); + } + __bss_end = .; + + __end = .; +} + diff --git a/dkarm/crtls/gba_er.specs b/dkarm/crtls/gba_er.specs new file mode 100644 index 0000000..419b085 --- /dev/null +++ b/dkarm/crtls/gba_er.specs @@ -0,0 +1,8 @@ +%rename link old_link +%rename endfile old_endfile + +*link: +-T gba_er.ld%s %(old_link) + +*startfile: +er_crt0%O%s diff --git a/dkarm/crtls/gba_mb.ld b/dkarm/crtls/gba_mb.ld new file mode 100644 index 0000000..8159bc0 --- /dev/null +++ b/dkarm/crtls/gba_mb.ld @@ -0,0 +1,284 @@ +/* Linker Script Original v1.3 by Jeff Frohwein */ +/* v1.0 - Original release */ +/* v1.1 - Added proper .data section support */ +/* v1.2 - Added support for c++ & iwram overlays */ +/* - Major contributions by Jason Wilkins. */ +/* v1.3 - .ewram section now can be used when */ +/* compiling for MULTIBOOT mode. This fixes */ +/* malloc() in DevKitAdvance which depends */ +/* on __eheap_start instead of end to define*/ +/* the starting location of heap space. */ +/* External global variable __gba_iwram_heap*/ +/* support added to allow labels end, _end, */ +/* & __end__ to point to end of iwram or */ +/* the end of ewram. */ +/* Additions by WinterMute */ +/* v1.4 - .sbss section added for unitialised */ +/* data in ewram */ +/* v1.5 - padding section added to stop EZF */ +/* stripping important data */ +/* v1.6 - added memory sections */ + +/* This file is released into the public domain */ +/* for commercial or non-commercial use with no */ +/* restrictions placed upon it. */ + +/* NOTE!!!: This linker script defines the RAM & */ +/* ROM start addresses. In order for it to work */ +/* properly, remove -Ttext and -Tbss linker */ +/* options from your makefile if they are */ +/* present. */ + +/* You can use the following to view section */ +/* addresses in your .elf file: */ +/* objdump -h file.elf */ +/* Please note that empty sections may incorrectly*/ +/* list the lma address as the vma address for */ +/* some versions of objdump. */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY { + + rom : ORIGIN = 0x08000000, LENGTH = 32M + iwram : ORIGIN = 0x03000000, LENGTH = 32K + ewram : ORIGIN = 0x02000000, LENGTH = 256K +} + + + +__text_start = 0x2000000 ; +__eheap_end = 0x2040000; +__iwram_start = 0x3000000; +__iwram_end = 0x3008000; +__sp_irq = __iwram_end - 0x100; +__sp_usr = __sp_irq - 0x100; + +SECTIONS +{ + . = __text_start; + .init : + { + KEEP (*(.init)) + . = ALIGN(4); + } >ewram =0xff + + .plt : + { + *(.plt) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram + + .text ALIGN (4): + { + *(EXCLUDE_FILE (*.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + __text_end = .; + .fini : + { + KEEP (*(.fini)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram =0 + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0 + + .jcr : { KEEP (*(.jcr)) } >ewram + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0 + + __iwram_lma = .; + + .iwram __iwram_start : AT (__iwram_lma) + { + __iwram_start = ABSOLUTE(.) ; + *(.iwram) + *iwram.*(.text) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + __data_lma = __iwram_lma + SIZEOF(.iwram) ; + __iwram_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + __bss_start__ = ABSOLUTE(.); + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } + + __bss_end = . ; + __bss_end__ = . ; + + .data ALIGN(4) : AT (__data_lma) + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >iwram = 0xff + + __iwram_overlay_lma = __data_lma + SIZEOF(.data); + + __data_end = .; + PROVIDE (edata = .); + __iwram_overlay_start = . ; + + OVERLAY ALIGN(4) : NOCROSSREFS AT (__iwram_overlay_lma) + { + .iwram0 { *(.iwram0) . = ALIGN(4);} + .iwram1 { *(.iwram1) . = ALIGN(4);} + .iwram2 { *(.iwram2) . = ALIGN(4);} + .iwram3 { *(.iwram3) . = ALIGN(4);} + .iwram4 { *(.iwram4) . = ALIGN(4);} + .iwram5 { *(.iwram5) . = ALIGN(4);} + .iwram6 { *(.iwram6) . = ALIGN(4);} + .iwram7 { *(.iwram7) . = ALIGN(4);} + .iwram8 { *(.iwram8) . = ALIGN(4);} + .iwram9 { *(.iwram9) . = ALIGN(4);} + } >iwram = 0xff + + __ewram_lma = LOADADDR(.iwram0) + SIZEOF(.iwram0)+SIZEOF(.iwram1)+SIZEOF(.iwram2)+SIZEOF(.iwram3)+SIZEOF(.iwram4)+SIZEOF(.iwram5)+SIZEOF(.iwram6)+SIZEOF(.iwram7)+SIZEOF(.iwram8)+SIZEOF(.iwram9); + + __iwram_overlay_end = . ; + __iheap_start = . ; + + /* v1.3 */ + __ewram_start = __ewram_lma ; + + .ewram __ewram_start : AT (__ewram_lma) + { + *(.ewram) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ewram = 0xff + + __ewram_overlay_lma = __ewram_lma + SIZEOF(.ewram); + + .sbss ALIGN(4): + { + __sbss_start = ABSOLUTE(.); + *(.sbss) + . = ALIGN(4); + } + + __sbss_end = .; + + __ewram_end = . ; + __ewram_overlay_start = . ; + + OVERLAY ALIGN(4): NOCROSSREFS AT (__ewram_overlay_lma) + { + .ewram0 { *(.ewram0) . = ALIGN(4);} + .ewram1 { *(.ewram1) . = ALIGN(4);} + .ewram2 { *(.ewram2) . = ALIGN(4);} + .ewram3 { *(.ewram3) . = ALIGN(4);} + .ewram4 { *(.ewram4) . = ALIGN(4);} + .ewram5 { *(.ewram5) . = ALIGN(4);} + .ewram6 { *(.ewram6) . = ALIGN(4);} + .ewram7 { *(.ewram7) . = ALIGN(4);} + .ewram8 { *(.ewram8) . = ALIGN(4);} + .ewram9 { *(.ewram9) . = ALIGN(4);} + } >ewram = 0xff + + __ewram_overlay_end = . ; + + __eheap_start = . ; + + _end = .; + __end__ = _end ; /* v1.3 */ + PROVIDE (end = _end); /* v1.3 */ + + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/gba_mb.specs b/dkarm/crtls/gba_mb.specs new file mode 100644 index 0000000..cda74a5 --- /dev/null +++ b/dkarm/crtls/gba_mb.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +-T gba_mb.ld%s %(old_link) + +*startfile: +gba_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/gp32.ld b/dkarm/crtls/gp32.ld new file mode 100644 index 0000000..d044730 --- /dev/null +++ b/dkarm/crtls/gp32.ld @@ -0,0 +1,152 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY + { + ram : ORIGIN = 0xc000000, LENGTH = 8M + } + +SECTIONS +{ + .init : + { + __text_start = . ; + KEEP (*(.init)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + .plt : { *(.plt) } >ram = 0xff + + .text : /* ALIGN (4): */ + { + + *(EXCLUDE_FILE (*text.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + .fini : + { + KEEP (*(.fini)) + } >ram =0xff + + __text_end = . ; + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + .jcr : { KEEP (*(.jcr)) } >ram = 0 + .got : { *(.got.plt) *(.got) } >ram = 0 + __ro_end = . ; + + .data ALIGN(4) : + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + __data_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + /* __bss_start__ = ABSOLUTE(.); */ + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } > ram + __bss_end = . ; + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/gp32.specs b/dkarm/crtls/gp32.specs new file mode 100644 index 0000000..a15e5b0 --- /dev/null +++ b/dkarm/crtls/gp32.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T gp32.ld%s + +*startfile: +gp32_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/gp32_crt0.s b/dkarm/crtls/gp32_crt0.s new file mode 100644 index 0000000..838dfc2 --- /dev/null +++ b/dkarm/crtls/gp32_crt0.s @@ -0,0 +1,74 @@ + .section ".init" + .code 32 + .align + .global _start +@--------------------------------------------------------------------------------- +_start: +@--------------------------------------------------------------------------------- + b _start2 + +@--------------------------------------------------------------------------------- +@ AXF addresses +@--------------------------------------------------------------------------------- +_text_start: + .word __text_start +_ro_end: + .word __ro_end +_data_start: + .word __data_start + .word __bss_end +_bss_start: + .word __bss_start +_bss_end: + .word __bss_end + +@--------------------------------------------------------------------------------- +@ GamePark magic sequence +@--------------------------------------------------------------------------------- + .word 0x44450011 + .word 0x44450011 + .word 0x01234567 + .word 0x12345678 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + +@--------------------------------------------------------------------------------- +_start2: +@--------------------------------------------------------------------------------- + mrs r0, CPSR + orr r0, r0, #0xC0 + msr CPSR_ctl, r0 + + mrs r0, CPSR + bic r0, r0, #0xC0 + orr r0, r0, #0x40 + msr CPSR_ctl,r0 + +@--------------------------------------------------------------------------------- +@ global constructors +@--------------------------------------------------------------------------------- + ldr r3,=_call_main + mov lr,r3 + ldr r3,=_init + bx r3 +@--------------------------------------------------------------------------------- +@ Jump to user code +@--------------------------------------------------------------------------------- +_call_main: +@--------------------------------------------------------------------------------- + mov lr, #0 + ldr r3, =main + bx r3 + + .pool + .end diff --git a/dkarm/crtls/gp32_gpsdk.ld b/dkarm/crtls/gp32_gpsdk.ld new file mode 100644 index 0000000..4e2ed55 --- /dev/null +++ b/dkarm/crtls/gp32_gpsdk.ld @@ -0,0 +1,197 @@ +/* GP32 Linker Script v1.2 by Jeff F */ +/* v1.0 - Original release */ +/* v1.1 - Cleaned up and added MEMORY command */ +/* v1.2 - DJWillis - Added propper .init and */ +/* .fini for GCC 3.3.2 and above */ +/* */ +/* This file is released into the public domain */ +/* for commercial or non-commercial use with no */ +/* restrictions placed upon it. */ +/* */ +/* NOTE!!!: This linker script defines the RAM */ +/* start addresses. In order for it to work */ +/* properly, remove -Ttext and -Tbss linker */ +/* options from your makefile if they are */ +/* present. */ +/* */ +/* You can use the following to view section */ +/* addresses in your .elf file: */ +/* objdump -h file.elf */ +/* */ +/* Please note that empty sections may incorrectly*/ +/* list the lma address as the vma address for */ +/* some versions of objdump. */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +/* SEARCH_DIR(/bin/arm); */ + +/* Then use it like this: IWRAMHEAP */ +/* The linker script function "var1 += var2;" sometimes */ +/* reports incorrect values in the *.map file but the */ +/* actual value it calculates is usually, if not always, */ +/* correct. If you leave out the ". = ALIGN(4);" at the */ +/* end of each section then the return value of SIZEOF() */ +/* is sometimes incorrect and "var1 += var2;" appears to */ +/* not work as well. "var1 += var2" style functions are */ +/* avoided below as a result. */ + +/* The linker script MEMORY directive is not used here due */ +/* to the fact that __text_start is not always a fixed value. */ + +MEMORY + { + ram : ORIGIN = 0xc000000, LENGTH = 8M + } + +SECTIONS +{ + .text : /* ALIGN (4): */ + { + __text_start = . ; + + *(EXCLUDE_FILE (*text.iwram*) .text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + __text_end = . ; + + + .init : + { + *(.init) + } > ram = 0xff + + .jcr : + { + *(.jcr) + } > ram = 0xff + + .fini : + { + *(.fini) + } > ram = 0xff + + .rodata : + { + *(.rodata) + *all.rodata*(*) + *(.roda) + *(.rodata.*) + *(.gnu.linkonce.r*) + SORT(CONSTRUCTORS) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + .ctors : + { + /* gcc uses crtbegin.o to find the start of the constructors, so + we make sure it is first. Because this is a wildcard, it + doesn't matter if the user does not actually link against + crtbegin.o; the linker won't look for a file to match a + wildcard. The wildcard also means that it doesn't matter which + directory crtbegin.o is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .eh_frame : + { + KEEP (*(.eh_frame)) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + + .gcc_except_table : + { + *(.gcc_except_table) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0 + __ro_end = . ; + + .data ALIGN(4) : + { + __data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } >ram = 0xff + + __data_end = . ; + + .bss ALIGN(4) : + { + __bss_start = ABSOLUTE(.); + /* __bss_start__ = ABSOLUTE(.); */ + *(.dynbss) + *(.gnu.linkonce.b*) + *(COMMON) + . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ + } > ram + __bss_end = . ; + + __eheap_start = . ; /* Needed by DevKitAdvance. Start of malloc() heap for DKA. */ + + _end = . ; + __end__ = . ; + PROVIDE (end = _end); + + __eheap_end = . ; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .stack 0x80000 : { _stack = .; *(.stack) } + /* These must appear regardless of . */ +} diff --git a/dkarm/crtls/gp32_gpsdk.specs b/dkarm/crtls/gp32_gpsdk.specs new file mode 100644 index 0000000..014c55e --- /dev/null +++ b/dkarm/crtls/gp32_gpsdk.specs @@ -0,0 +1,8 @@ +%rename link old_link + +*link: +%(old_link) -T gp32_gpsdk.ld%s + +*startfile: +gp32_gpsdk_crt0%O%s crti%O%s crtbegin%O%s + diff --git a/dkarm/crtls/gp32_gpsdk_crt0.s b/dkarm/crtls/gp32_gpsdk_crt0.s new file mode 100644 index 0000000..99770ce --- /dev/null +++ b/dkarm/crtls/gp32_gpsdk_crt0.s @@ -0,0 +1,246 @@ +@**************************************************** +@* gp32 crt0.S v1.0 by Jeff F * +@**************************************************** + +@ v1.0 - Original release +@ +@ This file is released into the public domain for commercial +@ or non-commercial usage with no restrictions placed upon it. + + .TEXT + +@ Note: Normally it is the job of crt0.S to clear the BSS +@ (Zero Initialized) section to 0x00, but in the case of +@ the gp32 we do not have to do this because it is done +@ by the gp32 bios after it loads the app. + +@ The official sdt dev kit uses 'Main ()' as the entry +@ point. If you would rather use 'main ()' instead then +@ comment out the next line. +@ +@ You have to use 'main ()' at some point in your program +@ if you want to do c++ code. GCC will do a call to constructor +@ setup before executing 'main ()'. Using 'main ()' also increases +@ your program size by ~5500 bytes. + +@ .equ __OfficialEntry, 1 + +@ The official sdt dev kit initializes various things in init.o +@ Crt0.S performs similar tasks for compatibility. If you don't +@ wish to use the official libs, or those that are compatible, +@ then you need to comment out the next line to prevent link errors. + + .equ __OfficialInits, 1 + + + .GLOBAL _start +_start: + .ALIGN + .CODE 32 + + @ Start Vector + + b _GpInit + + .word __text_start @ Start of text (Read Only) section +_roe: .word __ro_end @ End " +_rws: .word __data_start @ Start of data (Read/Write) section + .word __bss_end @ End of bss (this is the way sdt does it for some reason) +_zis: .word __bss_start @ Start of bss (Zero Initialized) section +_zie: .word __bss_end @ End " + + .word 0x44450011 + .word 0x44450011 + + .word 0x01234567 + .word 0x12345678 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + .word 0x23456789 + .word 0x34567890 + .word 0x45678901 + .word 0x56789012 + +_GpInit: + mrs r0,CPSR + orr r0,r0,#0xc0 + msr CPSR_fsxc,r0 + +.ifdef __OfficialInits + +@ Call function in user_init.s +@ bl asm_user_entry + +@ Get pointer to GpSurfaceSet routine + mov r0,#0 + swi 0xb + ldr r1,=GpSurfaceSet + ldr r2,=GpSurfaceFlip + str r0,[r1] + str r0,[r2] + +@ Get time passed + mov r0,#6 + swi 0xb + ldr r1,=_timepassed + str r0,[r1] + +@ Get button stuff + mov r0,#0 + swi 0x10 + ldr r2,=_reg_io_key_a + ldr r3,=_reg_io_key_b + str r0,[r2] + str r1,[r3] + +@ Set heap start location + ldr r0,_zie + ldr r1,=HEAPSTART + str r0,[r1] + +@ Set heap end location + mov r0,#5 + swi 0xb + ldr r1,=HEAPEND + sub r0,r0,#255 + bic r0,r0,#3 + str r0,[r1] + +@ Set App Argument + swi 0x15 + + mov r10,r0 + mov r11,r1 @ possibly not needed but left in anyway + + mrs r0,CPSR + bic r0,r0,#192 + orr r0,r0,#64 + msr CPSR_fsxc,r0 + + mov r0,r10 + mov r1,r11 @ possibly not needed but left in anyway +.endif + +@ Jump to Main () + +.ifdef __OfficialEntry + ldr r3,=Main +.else + ldr r3,=main +.endif + bx r3 @ Init.o uses 'mov pc,r3' but + @ 'bx r3' is used here instead. This way + @ the main function can be ARM or Thumb. + +.ifdef __OfficialInits + + swi 0x12 + orr r1,r1,r2 + and r1,r1,r3 + eor r1,r1,r4 + mov r5,r1,lsr #4 + add r1,r1,r7 + sub r7,r7,r1 + mov r8,#0 + mov pc,r8 + b . + b . + b . + b . + b . + b . + b . + b . + b . + b . + b . + b . + nop + nop + nop + nop + nop + nop + + .GLOBAL _fw_init_for_dbg +_fw_init_for_dbg: + stmdb sp!,{r0-r12} + + mov r10,lr + mov r11,sp + + bic r0,r0,#31 @ 0x1f + orr r1,r0,#17 @ 0x11 + orr r2,r0,#19 @ 0x13 + msr cpsr_cxsf,r1 + mov r12,#4 + add r12,r12,pc + msr cpsr_cxsf,r2 + swi 0x1ff + +@ bl asm_user_entry_path + + mov r0,r11 + mov r1,r10 + add r0,r0,#52 + ldr r2,[r0] + mov lr,r1 + stmdb sp!,{r2} + stmdb sp!,{r0-r12,lr} + +@ Copy RW Base - ZI Base + ldr r0,=_roe @ |Image$$RO$$Limit| + ldr r3,=_zis @ |Image$$ZI$$Base| + ldr r2,=_rws @ |Image$$RW$$Base| + sub r3,r3,r2 +CopyRWData: + cmp r3,#36 + blt CopyRWData2 + ldmia r0!,{r4-r12} + stmia r2!,{r4-r12} + sub r3,r3,#36 + b CopyRWData +CopyRWData2: + cmp r3,#0 + ble CopyRWData3 + ldr r4,[r0],#4 + str r4,[r2],#4 + sub r3,r3,#4 + b CopyRWData2 +CopyRWData3: + +@ Clear ZI section + ldr r1,=_zie @ |Image$$ZI$$Limit| + ldr r0,=_zis @ |Image$$ZI$$Base| + mov r2,#0 + mov r3,r2 + mov r4,r2 + mov r5,r2 + mov r6,r2 + mov r7,r2 + mov r8,r2 + mov r9,r2 + mov r10,r2 + mov r11,r2 + mov r12,r2 +CopyZIData: + stmia r0!,{r2-r12} + cmp r0,r1 + blt CopyZIData + + ldmia sp!,{r0-r12,pc} + +.endif + + .ALIGN + .POOL + + + .END + diff --git a/dkarm/rules/base_rules b/dkarm/rules/base_rules new file mode 100644 index 0000000..3b6b4a0 --- /dev/null +++ b/dkarm/rules/base_rules @@ -0,0 +1,58 @@ +#--------------------------------------------------------------------------------- +# path to tools - this can be deleted if you set the path in windows +#--------------------------------------------------------------------------------- +export PATH := $(DEVKITARM)/bin:$(PATH) + +#--------------------------------------------------------------------------------- +# the prefix on the compiler executables +#--------------------------------------------------------------------------------- +PREFIX := arm-elf- + +export CC := $(PREFIX)gcc +export CXX := $(PREFIX)g++ +export AR := $(PREFIX)ar +export OBJCOPY := $(PREFIX)objcopy + + +#--------------------------------------------------------------------------------- +%.a: +#--------------------------------------------------------------------------------- + @echo $(notdir $@) + @$(AR) -rc $@ $^ + +#--------------------------------------------------------------------------------- +%.o: %.cpp + @echo $(notdir $<) + @$(CXX) -MMD -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o: %.c + @echo $(notdir $<) + @$(CC) -MMD -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o: %.s + @echo $(notdir $<) + @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o: %.S + @echo $(notdir $<) + @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +# canned command sequence for binary data +#--------------------------------------------------------------------------------- +define bin2o + padbin 4 $(<) + $(OBJCOPY) -I binary -O elf32-littlearm -B arm \ + --rename-section .data=.rodata,readonly,data,contents,alloc \ + --redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_start=`(echo $( `(echo $(> `(echo $(> `(echo $(&1 | tee $BUILDSCRIPTDIR/binutils_configure.log + + +$MAKE 2>&1 | tee binutils_make.log +$MAKE install 2>&1 | tee $BUILDSCRIPTDIR/binutils_install.log + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/binutils +rm -fr $BINUTILS_SRCDIR + +#--------------------------------------------------------------------------------- +# build and install just the c compiler +#--------------------------------------------------------------------------------- +mkdir -p $target/gcc +cd $target/gcc + + +../../$GCC_SRCDIR/configure \ + --enable-languages=c,c++ \ + --with-cpu=arm7tdmi\ + --enable-interwork --enable-multilib\ + --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ + --disable-shared --disable-threads --disable-win32-registry --disable-nls\ + --target=$target \ + --with-newlib \ + --prefix=$prefix -v\ + 2>&1 | tee $BUILDSCRIPTDIR/gcc_configure.log + +$MAKE all-gcc 2>&1| tee $BUILDSCRIPTDIR/gcc_make.log +$MAKE install-gcc 2>&1 | tee $BUILDSCRIPTDIR/gcc_install.log + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# build and install newlib +#--------------------------------------------------------------------------------- +mkdir -p $target/newlib +cd $target/newlib + +$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure \ + --enable-serial-configure \ + --target=$target \ + --prefix=$prefix \ + --enable-newlib-mb \ + | tee $BUILDSCRIPTDIR/newlib_configure.log + +mkdir -p etc + +$MAKE | tee $BUILDSCRIPTDIR/newlib_make.log +$MAKE install | tee $BUILDSCRIPTDIR/newlib_install.log + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/newlib +rm -fr $NEWLIB_SRCDIR + +#--------------------------------------------------------------------------------- +# build and install the final compiler +#--------------------------------------------------------------------------------- + +cd $BUILDSCRIPTDIR +cd $target/gcc + +$MAKE | tee $BUILDSCRIPTDIR/gcc_final_make.log 2>&1 +$MAKE install | tee $BUILDSCRIPTDIR/gcc_final_install.log 2>&1 + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/gcc +rm -fr $GCC_SRCDIR diff --git a/dkarm/scripts/build-tools.sh b/dkarm/scripts/build-tools.sh new file mode 100644 index 0000000..dfa4d86 --- /dev/null +++ b/dkarm/scripts/build-tools.sh @@ -0,0 +1,16 @@ +#!/bin/sh + + +export DEVKITARM=$TOOLPATH/devkitARM +export DEVKITPRO=$TOOLPATH + +$MAKE -C tools/gba +$MAKE -C tools/gba install PREFIX=$DEVKITARM/bin + +$MAKE -C tools/gp32 +$MAKE -C tools/gp32 install PREFIX=$DEVKITARM/bin + +$MAKE -C tools/nds/ +$MAKE -C tools/nds/ install PREFIX=$DEVKITARM/bin + +$MAKE -C tools clean diff --git a/dkppc/crtls/gcn.ld b/dkppc/crtls/gcn.ld new file mode 100644 index 0000000..cd671b4 --- /dev/null +++ b/dkppc/crtls/gcn.ld @@ -0,0 +1,302 @@ +/* Default linker script, for normal executables */ +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", + "elf32-powerpc") +OUTPUT_ARCH(powerpc:common) +ENTRY(_start) +SEARCH_DIR("/powerpc/powerpc-eabi-elf/lib"); +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +PROVIDE (__stack = 0x817F0000); +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = 0x80003100; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } + .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } + .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } + .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } + .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } + .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } + .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } + .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } + .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } + .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } + .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } + .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + + /* DOL header (from TITANIK's GC docs) + */ + file_start = 0x80003000; + . = file_start; + + .header : + { + /* 0000-001B Text[0..6] sections File Positions */ + LONG(text_file_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 001C-0047 Data[0..10] sections File Positions */ + LONG(data_file_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0048-0063 Text[0..6] sections Mem Address */ + LONG(text_mem_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0064-008F Data[0..10] sections Mem Address */ + LONG(data_mem_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0090-00AB Text[0..6] sections Sizes */ + LONG(text_mem_size); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 00AC-00D7 Data[0..10] sections Sizes */ + LONG(data_mem_size); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 00D8 BSS Mem address + * 00DC BSS Size */ + LONG(bss_mem_start); + LONG(bss_mem_size); + + /* 00E0 Entry Point */ + LONG(ABSOLUTE(_start)); + } + + +. = 0x80003100; + text_mem_start = .; + + .init : + { + KEEP (*(.init)) + } =0 + .text : + { + *(.text .stub .text.* .gnu.linkonce.t.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + } =0 + .fini : + { + KEEP (*(.fini)) + } =0 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + . = ALIGN(32); + text_mem_size = . - text_mem_start; + data_mem_start = .; + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + . = ALIGN(32); + /* Ensure the __preinit_array_start label is properly aligned. We + could instead move the label definition inside the section, but + the linker would then create the section even if it turns out to + be empty, which isn't pretty. */ + . = ALIGN(32 / 8); + PROVIDE (__preinit_array_start = .); + .preinit_array : { *(.preinit_array) } + PROVIDE (__preinit_array_end = .); + PROVIDE (__init_array_start = .); + .init_array : { *(.init_array) } + PROVIDE (__init_array_end = .); + PROVIDE (__fini_array_start = .); + .fini_array : { *(.fini_array) } + PROVIDE (__fini_array_end = .); + .data : + { + *(.data .data.* .gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } + .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } + .dynamic : { *(.dynamic) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin*.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin*.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .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 .sdata.* .gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + +data_mem_size = . - data_mem_start; + bss_mem_start = .; + + __bss_start = .; + .sbss : + { + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + } + .plt : { *(.plt) } + .bss : + { + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + bss_mem_size = . - bss_mem_start; +text_file_start = text_mem_start - file_start; +data_file_start = data_mem_start - file_start; + + + _end = .; + __end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} diff --git a/dkppc/crtls/gcn_crt0.s b/dkppc/crtls/gcn_crt0.s new file mode 100644 index 0000000..4324e02 --- /dev/null +++ b/dkppc/crtls/gcn_crt0.s @@ -0,0 +1,483 @@ +#--------------------------------------------------------------------------------- +# crt0.s file for the GameCube V1.0 by Costis (costis@gbaemu.com)! +# +# some little modifications by Groepaz/Hitmen and WinterMute +# +# This is start-up code for initializing the GameCube system and hardware +# before executing the actual user program code. It clears the GPR's, +# initializes the FPR's, initializes the Data, Code, and L2 caches, clears +# and initializes SPR's, and disables exceptions (interrupts). +# +# Have fun!!! Please e-mail any suggestions or bugs to costis@gbaemu.com. +#--------------------------------------------------------------------------------- + + .section ".init" + + .globl _start + .extern __bss_start, _end + .extern __init, __fini + .extern main + +_start: + +#--------------------------------------------------------------------------------- +# Initialize the General Purpose Registers +#--------------------------------------------------------------------------------- + bl InitGPRS +#--------------------------------------------------------------------------------- +# Initialize the GameCube Hardware (Floating Point Registers, Caches, etc.) +#--------------------------------------------------------------------------------- + bl InitHardware +#--------------------------------------------------------------------------------- +# Initialize more cache aspects, clear a few SPR's, and disable interrupts. +#--------------------------------------------------------------------------------- + bl SystemInit + +#--------------------------------------------------------------------------------- +# clear the bss section +#--------------------------------------------------------------------------------- + lis 3, __bss_start@h + ori 3, 3, __bss_start@l + li 4, 0 + lis 5, _end@h + ori 5, 5, _end@l + sub 5, 5, 3 + #subi 3, 3, 4 + mtctr 5 +BSSCLoop: + #stwu 4, 4(3) + stbu 4,0(3) + bdnz BSSCLoop + +#--------------------------------------------------------------------------------- +# push args for main() and generate first stackframe +#--------------------------------------------------------------------------------- + addi 1,1,-4 + lis 0,0 + stw 0,0(1) + stwu 1,-64(1) + +#--------------------------------------------------------------------------------- +# Initialise global constructors! +#--------------------------------------------------------------------------------- + bl __init +#--------------------------------------------------------------------------------- +# Branch to the user code! +#--------------------------------------------------------------------------------- + bl main +#--------------------------------------------------------------------------------- +# global destructors! +#--------------------------------------------------------------------------------- + bl __fini + + +# call functions registered by atexit() +# .globl _exit +# bl exit +#_exit: + +#--------------------------------------------------------------------------------- +# if the main function returns, reset the gc +# +# notice that restarting the program may fail since the +# .data section may have been changed by previous run. +#--------------------------------------------------------------------------------- +# disable irqs +#--------------------------------------------------------------------------------- + mfmsr 3 + rlwinm 4,3,0,17,15 + mtmsr 4 + extrwi 3,3,1,16 +#--------------------------------------------------------------------------------- +eloop: +#--------------------------------------------------------------------------------- +# hot reset +#--------------------------------------------------------------------------------- + lis 9,0xcc00 + li 0,0x00 + ori 9,9,0x3024 + stw 0,0x00(9) + + b eloop # try again if we really come here :=P + +#--------------------------------------------------------------------------------- +# General Purpose Register init +#--------------------------------------------------------------------------------- +InitGPRS: +#--------------------------------------------------------------------------------- +# Clear all of the GPR's to 0 +#--------------------------------------------------------------------------------- + li 0,0 + li 3,0 + li 4,0 + li 5,0 + li 6,0 + li 7,0 + li 8,0 + li 9,0 + li 10,0 + li 11,0 + li 12,0 + li 14,0 + li 15,0 + li 16,0 + li 17,0 + li 18,0 + li 19,0 + li 20,0 + li 21,0 + li 22,0 + li 23,0 + li 24,0 + li 25,0 + li 26,0 + li 27,0 + li 28,0 + li 29,0 + li 30,0 + li 31,0 + +#--------------------------------------------------------------------------------- +# Set the Stack Pointer - set in linkscript +#--------------------------------------------------------------------------------- + lis 1,__stack@h + ori 1,1,__stack@l + +#--------------------------------------------------------------------------------- +# Set the Small Data 2 (Read Only) base register. +#--------------------------------------------------------------------------------- + lis 2,_SDA2_BASE_@h + ori 2,2,_SDA2_BASE_@l + +#--------------------------------------------------------------------------------- +# Set the Small Data (Read\Write) base register. +#--------------------------------------------------------------------------------- + lis 13,_SDA_BASE_@h + ori 13,13,_SDA_BASE_@l + + blr + +#--------------------------------------------------------------------------------- +# Hardware Init +#--------------------------------------------------------------------------------- +InitHardware: +#--------------------------------------------------------------------------------- + mflr 31 # Store the link register in r31 + + bl PSInit # Initialize Paired Singles + bl FPRInit # Initialize the FPR's + bl CacheInit # Initialize the system caches + + mtlr 31 # Retreive the link register from r31 + blr + +#--------------------------------------------------------------------------------- +PSInit: +#--------------------------------------------------------------------------------- + mfspr 3, 920 # (HID2) + oris 3, 3, 0xA000 + mtspr 920, 3 # (HID2) + +#--------------------------------------------------------------------------------- + # Set the Instruction Cache invalidation bit in HID0 +#--------------------------------------------------------------------------------- + mfspr 3,1008 + ori 3,3,0x0800 + mtspr 1008,3 + + sync + +#--------------------------------------------------------------------------------- + # Clear various Special Purpose Registers +#--------------------------------------------------------------------------------- + li 3,0 + mtspr 912,3 + mtspr 913,3 + mtspr 914,3 + mtspr 915,3 + mtspr 916,3 + mtspr 917,3 + mtspr 918,3 + mtspr 919,3 + +#--------------------------------------------------------------------------------- + # Return +#--------------------------------------------------------------------------------- + blr + +#--------------------------------------------------------------------------------- +FPRInit: +#--------------------------------------------------------------------------------- + # Enable the Floating Point Registers +#--------------------------------------------------------------------------------- + mfmsr 3 + ori 3,3,0x2000 + mtmsr 3 + +#--------------------------------------------------------------------------------- + # Clear all of the FPR's to 0 +#--------------------------------------------------------------------------------- + lis 3, zfloat@h + ori 3, 3, zfloat@l + lfd 0, 0(3) + fmr 1,0 + fmr 2,0 + fmr 3,0 + fmr 4,0 + fmr 5,0 + fmr 6,0 + fmr 7,0 + fmr 8,0 + fmr 9,0 + fmr 10,0 + fmr 11,0 + fmr 12,0 + fmr 13,0 + fmr 14,0 + fmr 15,0 + fmr 16,0 + fmr 17,0 + fmr 18,0 + fmr 19,0 + fmr 20,0 + fmr 21,0 + fmr 22,0 + fmr 23,0 + fmr 24,0 + fmr 25,0 + fmr 26,0 + fmr 27,0 + fmr 28,0 + fmr 29,0 + fmr 30,0 + fmr 31,0 + mtfsf 255,0 + + + blr + +#--------------------------------------------------------------------------------- +CacheInit: +#--------------------------------------------------------------------------------- + mflr 0 + stw 0, 4(1) + stwu 1, -16(1) + stw 31, 12(1) + stw 30, 8(1) + +#--------------------------------------------------------------------------------- +# Check if the Instruction Cache has been enabled. +#--------------------------------------------------------------------------------- + mfspr 3,1008 # (HID0) + rlwinm 0, 3, 0, 16, 16 + cmplwi 0, 0x0000 + bne ICEnabled + + isync + mfspr 3, 1008 + ori 3, 3, 0x8000 + mtspr 1008, 3 + +#--------------------------------------------------------------------------------- +ICEnabled: +#--------------------------------------------------------------------------------- + mfspr 3, 1008 # bl PPCMfhid0 + rlwinm 0, 3, 0, 17, 17 + cmplwi 0, 0x0000 # Check if the Data Cache has been enabled or not. + bne DCEnabled + + # If not, then enable it. + sync + mfspr 3, 1008 + ori 3, 3, 0x4000 + mtspr 1008, 3 + +#--------------------------------------------------------------------------------- +DCEnabled: +#--------------------------------------------------------------------------------- + + mfspr 3, 1017 # (L2CR) + clrrwi 0, 3, 31 # Clear all of the bits except 31 + cmplwi 0, 0x0000 + bne L2GISkip # Skip the L2 Global Cache Invalidation process + # if it has already been done before. + +#--------------------------------------------------------------------------------- +# Store the current state of the MSR in r30 +#--------------------------------------------------------------------------------- + mfmsr 3 + mr 30,3 + + sync + +#--------------------------------------------------------------------------------- +# Enable Instruction and Data Address Translation +#--------------------------------------------------------------------------------- + li 3, 48 + mtmsr 3 + + sync + sync + +#--------------------------------------------------------------------------------- +# Disable the L2 Global Cache. +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # (L2CR + clrlwi 3, 3, 1 + mtspr 1017, 3 # (L2CR) + sync + +#--------------------------------------------------------------------------------- +# Invalidate the L2 Global Cache. +#--------------------------------------------------------------------------------- + bl L2GlobalInvalidate + +#--------------------------------------------------------------------------------- +# Restore the previous state of the MSR from r30 +#--------------------------------------------------------------------------------- + mr 3, 30 + mtmsr 3 + +#--------------------------------------------------------------------------------- +# Enable the L2 Global Cache +# disable the L2 Data Only bit and the L2 Global Invalidate Bit. +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # (L2CR) + oris 0, 3, 0x8000 + rlwinm 3, 0, 0, 11, 9 + mtspr 1017, 3 # (L2CR) + + +#--------------------------------------------------------------------------------- +L2GISkip: +#--------------------------------------------------------------------------------- +# Restore the non-volatile registers to their previous values and return. +#--------------------------------------------------------------------------------- + lwz 0, 20(1) + lwz 31, 12(1) + lwz 30, 8(1) + addi 1, 1, 16 + mtlr 0 + blr + +#--------------------------------------------------------------------------------- +L2GlobalInvalidate: +#--------------------------------------------------------------------------------- + mflr 0 + stw 0, 4(1) + stwu 1, -16(1) + stw 31, 12(1) + sync + +#--------------------------------------------------------------------------------- +# Disable the L2 Cache. +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # bl PPCMf1017 + clrlwi 3, 3, 1 + mtspr 1017, 3 # bl PPCMt1017 + + sync + +#--------------------------------------------------------------------------------- +# Initiate the L2 Cache Global Invalidation process. +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # (L2CR) + oris 3, 3, 0x0020 + mtspr 1017, 3 # (L2CR) + +#--------------------------------------------------------------------------------- +# Wait until the L2 Cache Global Invalidation has been completed. +#--------------------------------------------------------------------------------- +L2GICheckComplete: +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # (L2CR) + clrlwi 0, 3, 31 + cmplwi 0, 0x0000 + bne L2GICheckComplete + +#--------------------------------------------------------------------------------- +# Clear the L2 Data Only bit and the L2 Global Invalidate Bit. +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # (L2CR) + rlwinm 3, 3, 0, 11, 9 + mtspr 1017, 3 # (L2CR) + +#--------------------------------------------------------------------------------- +# Wait until the L2 Cache Global Invalidation status bit signifies that it is ready. +#--------------------------------------------------------------------------------- +L2GDICheckComplete: +#--------------------------------------------------------------------------------- + mfspr 3, 1017 # (L2CR) + clrlwi 0, 3, 31 + cmplwi 0, 0x0000 + bne L2GDICheckComplete + +#--------------------------------------------------------------------------------- +# Restore the non-volatile registers to their previous values and return. +#--------------------------------------------------------------------------------- + lwz 0, 20(1) + lwz 31, 12(1) + addi 1, 1, 16 + mtlr 0 + blr + +#--------------------------------------------------------------------------------- +SystemInit: +#--------------------------------------------------------------------------------- + mflr 0 + stw 0, 4(1) + stwu 1, -0x18(1) + stw 31, 0x14(1) + stw 30, 0x10(1) + stw 29, 0xC(1) + +#--------------------------------------------------------------------------------- + # Disable interrupts! +#--------------------------------------------------------------------------------- + mfmsr 3 + rlwinm 4,3,0,17,15 + mtmsr 4 + +#--------------------------------------------------------------------------------- +# Clear various SPR's +#--------------------------------------------------------------------------------- + li 3,0 + mtspr 952, 3 + mtspr 956, 3 + mtspr 953, 3 + mtspr 954, 3 + mtspr 957, 3 + mtspr 958, 3 + +#--------------------------------------------------------------------------------- +# Disable Speculative Bus Accesses to non-guarded space from both caches. +#--------------------------------------------------------------------------------- + mfspr 3, 1008 # (HID0) + ori 3, 3, 0x0200 + mtspr 1008, 3 + +#--------------------------------------------------------------------------------- +# Set the Non-IEEE mode in the FPSCR +#--------------------------------------------------------------------------------- + mtfsb1 29 + + mfspr 3,920 # (HID2) + rlwinm 3, 3, 0, 2, 0 + mtspr 920,3 # (HID2) + +#--------------------------------------------------------------------------------- +# Restore the non-volatile registers to their previous values and return. +#--------------------------------------------------------------------------------- + lwz 0, 0x1C(1) + lwz 31, 0x14(1) + lwz 30, 0x10(1) + lwz 29, 0xC(1) + addi 1, 1, 0x18 + mtlr 0 + blr + +#--------------------------------------------------------------------------------- +zfloat: +#--------------------------------------------------------------------------------- + .float 0 + .align 4 diff --git a/dkppc/crtls/ogc.ld b/dkppc/crtls/ogc.ld new file mode 100644 index 0000000..8dd70dd --- /dev/null +++ b/dkppc/crtls/ogc.ld @@ -0,0 +1,348 @@ +/* + * Linkscript for GC, automatically sets up DOL structures, + * generate ELF file and use objdump, or generate binary + * directly. + * + * PSUL doesn't seem to handle separate text and data sections correctly, + * that is why the text and data sections are merged in the header. + * + * If you want to experiment, it should be quite obvious how to + * change the header to list the data separately. + */ + +OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc"); +OUTPUT_ARCH(powerpc:common); +EXTERN(_start); +ENTRY(_start); + + +SECTIONS +{ + + /* DOL header (from TITANIK's GC docs) + */ + file_start = 0x80003000; + . = file_start; + + .header : + { + /* 0000-001B Text[0..6] sections File Positions */ + LONG(text_file_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 001C-0047 Data[0..10] sections File Positions */ + LONG(data_file_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0048-0063 Text[0..6] sections Mem Address */ + LONG(text_mem_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0064-008F Data[0..10] sections Mem Address */ + LONG(data_mem_start); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 0090-00AB Text[0..6] sections Sizes */ + LONG(text_mem_size); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 00AC-00D7 Data[0..10] sections Sizes */ + LONG(data_mem_size); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + LONG(0); + + /* 00D8 BSS Mem address + * 00DC BSS Size */ + LONG(bss_mem_start); + LONG(bss_mem_size); + + /* 00E0 Entry Point */ + LONG(ABSOLUTE(_start)); + } + + /* Program + */ + . = 0x80003100; + text_mem_start = .; + + .init : + { + KEEP (*crt0.o(*.init)) + KEEP (*(.init)) + } = 0 + .plt : { *(.plt) } + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } + .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } + .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } + .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rela.got1 : { *(.rela.got1) } + .rela.got2 : { *(.rela.got2) } + .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } + .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } + .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } + .rela.sbss : { *(.rela.sbss .rela.sbss.* .rel.gnu.linkonce.sb.*) } + .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } + .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } + .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } + .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } + .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } = 0 + .fini : + { + KEEP (*(.fini)) + } = 0 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + text_mem_size = . - text_mem_start; + data_mem_start = .; + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + /* Ensure the __preinit_array_start label is properly aligned. We + could instead move the label definition inside the section, but + the linker would then create the section even if it turns out to + be empty, which isn't pretty. */ + . = ALIGN(32 / 8); + PROVIDE (__preinit_array_start = .); + .preinit_array : { *(.preinit_array) } + PROVIDE (__preinit_array_end = .); + PROVIDE (__init_array_start = .); + .init_array : { *(.init_array) } + PROVIDE (__init_array_end = .); + PROVIDE (__fini_array_start = .); + .fini_array : { *(.fini_array) } + PROVIDE (__fini_array_end = .); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } + .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } + .dynamic : { *(.dynamic) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .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) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + data_mem_size = . - data_mem_start; + + bss_mem_start = .; + .sbss : + { + __sbss_start = .; + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + __sbss_end = .; + } + .bss : + { + __bss_start = .; + PROVIDE (__bss_start = .); + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + PROVIDE (__bss_end = .); + __bss_end = .; + } + . = ALIGN(32 / 8); + bss_mem_size = . - bss_mem_start; + + /* calculate file addresses */ + text_file_start = text_mem_start - file_start; + data_file_start = data_mem_start - file_start; + + _end = .; + PROVIDE(end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} + +__stack_addr = (__bss_start + SIZEOF(.bss) + 0x2000 + 7) & (-8); +__stack_end = (__bss_start + SIZEOF(.bss)); +__intrstack_addr = (__stack_addr + 0x2000); +__intrstack_end = (__stack_addr); +__ArenaLo = (__intrstack_addr + 31) & (-32); +__ArenaHi = (0x81700000); +__gxregs = (__ArenaHi + 31) & (-32); + +/* for backward compatibility with old crt0 */ +__stack = (0x81700000); + +PROVIDE (text_mem_start = text_mem_start); +PROVIDE (data_mem_start = data_mem_start); +PROVIDE (bss_mem_start = bss_mem_start); +PROVIDE(__stack_addr = __stack_addr); +PROVIDE(__stack_end = __stack_end); +PROVIDE(__intrstack_addr = __intrstack_addr); +PROVIDE(__intrstack_end = __intrstack_end); +PROVIDE(__ArenaLo = __ArenaLo); +PROVIDE(__ArenaHi = __ArenaHi); +PROVIDE(__gxregs = __gxregs); diff --git a/dkppc/crtls/specs b/dkppc/crtls/specs new file mode 100644 index 0000000..1e0dd2c --- /dev/null +++ b/dkppc/crtls/specs @@ -0,0 +1,355 @@ +*asm: +--traditional-format %(asm_cpu) %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} %{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} %{memb|msdata|msdata=eabi: -memb} %{mlittle|mlittle-endian:-mlittle; mbig|mbig-endian :-mbig; mcall-aixdesc | mcall-freebsd | mcall-netbsd | mcall-openbsd | mcall-linux | mcall-gnu :-mbig; mcall-i960-old :-mlittle} + +*asm_debug: +%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}} + +*asm_final: + + +*asm_options: +%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O} + +*invoke_as: +%{!S:-o %|.s | + as %(asm_options) %|.s %A } + +*cpp: +%{posix: -D_POSIX_SOURCE} %{mads : %(cpp_os_ads) ; myellowknife : %(cpp_os_yellowknife) ; mmvme : %(cpp_os_mvme) ; msim : %(cpp_os_sim) ; mwindiss : %(cpp_os_windiss) ; mcall-freebsd: %(cpp_os_freebsd) ; mcall-linux : %(cpp_os_linux) ; mcall-gnu : %(cpp_os_gnu) ; mcall-netbsd : %(cpp_os_netbsd) ; mcall-openbsd: %(cpp_os_openbsd) ; : %(cpp_os_default) } + +*cpp_options: +%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} + +*cpp_debug_options: +%{d*} + +*cpp_unique_options: +%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}} + +*trad_capable_cpp: +cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp} + +*cc1: +%{G*} %{mlittle|mlittle-endian: %(cc1_endian_little); mbig |mbig-endian : %(cc1_endian_big); mcall-aixdesc | mcall-freebsd | mcall-netbsd | mcall-openbsd | mcall-linux | mcall-gnu : -mbig %(cc1_endian_big); mcall-i960-old : -mlittle %(cc1_endian_little); : %(cc1_endian_default)} %{mno-sdata: -msdata=none } %{meabi: %{!mcall-*: -mcall-sysv }} %{!meabi: %{!mno-eabi: %{mrelocatable: -meabi } %{mcall-freebsd: -mno-eabi } %{mcall-i960-old: -meabi } %{mcall-linux: -mno-eabi } %{mcall-gnu: -mno-eabi } %{mcall-netbsd: -mno-eabi } %{mcall-openbsd: -mno-eabi }}} %{msdata: -msdata=default} %{mno-sdata: -msdata=none} %{profile: -p} + +*cc1_options: +%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} + +*cc1plus: + + +*link_gcc_c_sequence: +%G %L %G + +*endfile: +%{mgcn : crtsavres.o%s %(endfile_gcn); mogc : crtsavres.o%s %(endfile_gcn); myellowknife : crtsavres.o%s %(endfile_yellowknife) ; mmvme : crtsavres.o%s %(endfile_mvme) ; msim : crtsavres.o%s %(endfile_sim) ; mwindiss : %(endfile_windiss) ; mcall-freebsd: crtsavres.o%s %(endfile_freebsd) ; mcall-linux : crtsavres.o%s %(endfile_linux) ; mcall-gnu : crtsavres.o%s %(endfile_gnu) ; mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; mcall-openbsd: crtsavres.o%s %(endfile_openbsd) ; : %(crtsavres_default) %(endfile_default) } + +*link: +%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} %{YP,*} %{R*} %{Qy:} %{!Qn:-Qy} %(link_shlib) %{!Wl,-T*: %{!T*: %(link_start) }} %(link_target) %(link_os) + +*lib: +%{mgcn : %(lib_gcn); mogc : %(lib_ogc); myellowknife : %(lib_yellowknife) ; mmvme : %(lib_mvme) ; msim : %(lib_sim) ; mwindiss : %(lib_windiss) ; mcall-freebsd: %(lib_freebsd) ; mcall-linux : %(lib_linux) ; mcall-gnu : %(lib_gnu) ; mcall-netbsd : %(lib_netbsd) ; mcall-openbsd: %(lib_openbsd) ; : %(lib_default) } + +*libgcc: +-lgcc + +*startfile: +%{mgcn : %(startfile_gcn) ; mogc : %(startfile_ogc) ; myellowknife : %(startfile_yellowknife) ; mmvme : %(startfile_mvme) ; msim : %(startfile_sim) ; mwindiss : %(startfile_windiss) ; mcall-freebsd: %(startfile_freebsd) ; mcall-linux : %(startfile_linux) ; mcall-gnu : %(startfile_gnu) ; mcall-netbsd : %(startfile_netbsd) ; mcall-openbsd: %(startfile_openbsd) ; : %(startfile_default) } + +*switches_need_spaces: + + +*cross_compile: +1 + +*version: +3.4.3 + +*multilib: +. ; + +*multilib_defaults: +mbig mcall-sysv + +*multilib_extra: + + +*multilib_matches: + + +*multilib_exclusions: + + +*multilib_options: + + +*linker: +collect2 + +*link_libgcc: +%D + +*md_exec_prefix: + + +*md_startfile_prefix: + + +*md_startfile_prefix_1: + + +*startfile_prefix_spec: + + +*sysroot_suffix_spec: + + +*sysroot_hdrs_suffix_spec: + + +*cpp_default: + + +*asm_cpu: +%{!mcpu*: %{mpower: %{!mpower2: -mpwr}} %{mpower2: -mpwrx} %{mpowerpc*: -mppc} %{mno-power: %{!mpowerpc*: -mcom}} %{!mno-power: %{!mpower2: %(asm_default)}}} %{mcpu=common: -mcom} %{mcpu=power: -mpwr} %{mcpu=power2: -mpwrx} %{mcpu=power3: -m604} %{mcpu=power4: -mpower4} %{mcpu=powerpc: -mppc} %{mcpu=rios: -mpwr} %{mcpu=rios1: -mpwr} %{mcpu=rios2: -mpwrx} %{mcpu=rsc: -mpwr} %{mcpu=rsc1: -mpwr} %{mcpu=401: -mppc} %{mcpu=403: -m403} %{mcpu=405: -m405} %{mcpu=405fp: -m405} %{mcpu=440: -m440} %{mcpu=440fp: -m440} %{mcpu=505: -mppc} %{mcpu=601: -m601} %{mcpu=602: -mppc} %{mcpu=603: -mppc} %{mcpu=603e: -mppc} %{mcpu=ec603e: -mppc} %{mcpu=604: -mppc} %{mcpu=604e: -mppc} %{mcpu=620: -mppc} %{mcpu=630: -m604} %{mcpu=740: -mppc} %{mcpu=7400: -mppc} %{mcpu=7450: -mppc} %{mcpu=G4: -mppc} %{mcpu=750: -mppc} %{mcpu=G3: -mppc} %{mcpu=801: -mppc} %{mcpu=821: -mppc} %{mcpu=823: -mppc} %{mcpu=860: -mppc} %{mcpu=970: -mpower4} %{mcpu=G5: -mpower4} %{mcpu=8540: -me500} %{maltivec: -maltivec} + +*asm_default: +-mppc + +*crtsavres_default: +crtsavres.o%s + +*lib_ogc: +--start-group -logcsys -lc --end-group -logc + +*lib_gcn: +--start-group -lads -lc -lstubs --end-group + +*lib_yellowknife: +--start-group -lyk -lc --end-group + +*lib_mvme: +--start-group -lmvme -lc --end-group + +*lib_sim: +--start-group -lsim -lc --end-group + +*lib_freebsd: + %{!shared: %{!pg: %{!pthread:-lc} %{pthread:-lc_r}} %{pg: %{!pthread:-lc_p} %{pthread:-lc_r_p}} } + +*lib_gnu: +%{mnewlib: --start-group -lgnu -lc --end-group } %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } %{profile:-lc_p} %{!profile:-lc}}} + +*lib_linux: +%{mnewlib: --start-group -llinux -lc --end-group } %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} %{!shared: %{profile:-lc_p} %{!profile:-lc}}} + +*lib_netbsd: +%{profile:-lgmon -lc_p} %{!profile:-lc} + +*lib_openbsd: +%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}} + +*lib_windiss: +--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group + +*lib_default: + + +*startfile_gcn: +gcn_crt0.o%s ecrti.o%s crtbegin.o%s + +*startfile_ogc: +ecrti.o%s crtbegin.o%s + +*startfile_yellowknife: +ecrti.o%s crt0.o%s crtbegin.o%s + +*startfile_mvme: +ecrti.o%s crt0.o%s crtbegin.o%s + +*startfile_sim: +ecrti.o%s sim-crt0.o%s crtbegin.o%s + +*startfile_freebsd: +%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:%{profile:gcrt1.o%s} %{!profile:crt1.o%s}}}} crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_gnu: +%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_linux: +%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} %{mnewlib:ecrti.o%s;:crti.o%s} %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} + +*startfile_netbsd: +ncrti.o%s crt0.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_openbsd: +%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*startfile_windiss: +crt0.o%s crtbegin.o%s + +*startfile_default: + + +*endfile_gcn: +crtend.o%s ecrtn.o%s + +*endfile_yellowknife: +crtend.o%s ecrtn.o%s + +*endfile_mvme: +crtend.o%s ecrtn.o%s + +*endfile_sim: +crtend.o%s ecrtn.o%s + +*endfile_freebsd: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s + +*endfile_gnu: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s} + +*endfile_linux: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s} + +*endfile_netbsd: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} ncrtn.o%s + +*endfile_openbsd: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} + +*endfile_windiss: +crtend.o%s + +*endfile_default: + + +*link_path: + + +*link_shlib: +%{mshlib: %(link_path) } %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} %{static: } %{shared:-G -dy -z text %(link_path) } %{symbolic:-Bsymbolic -G -dy -z text %(link_path) } + +*link_target: +%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: %{mcall-i960-old: --oformat elf32-powerpcle} }}}} + +*link_start: +%{mgcn : %(link_start_gcn); mogc : %(link_start_gcn); myellowknife : %(link_start_yellowknife) ; mmvme : %(link_start_mvme) ; msim : %(link_start_sim) ; mwindiss : %(link_start_windiss) ; mcall-freebsd: %(link_start_freebsd) ; mcall-linux : %(link_start_linux) ; mcall-gnu : %(link_start_gnu) ; mcall-netbsd : %(link_start_netbsd) ; mcall-openbsd: %(link_start_openbsd) ; : %(link_start_default) } + +*link_start_gcn: + -T ogc.ld%s + +*link_start_yellowknife: +-T yellowknife.ld%s + +*link_start_mvme: +-Ttext 0x40000 + +*link_start_sim: + + +*link_start_freebsd: + + +*link_start_gnu: + + +*link_start_linux: + + +*link_start_netbsd: + + +*link_start_openbsd: +-Ttext 0x400074 + +*link_start_windiss: + + +*link_start_default: + + +*link_os: +%{mads : %(link_os_ads) ; myellowknife : %(link_os_yellowknife) ; mmvme : %(link_os_mvme) ; msim : %(link_os_sim) ; mwindiss : %(link_os_windiss) ; mcall-freebsd: %(link_os_freebsd) ; mcall-linux : %(link_os_linux) ; mcall-gnu : %(link_os_gnu) ; mcall-netbsd : %(link_os_netbsd) ; mcall-openbsd: %(link_os_openbsd) ; : %(link_os_default) } + +*link_os_ads: + + +*link_os_yellowknife: + + +*link_os_mvme: + + +*link_os_sim: +-m elf32ppcsim + +*link_os_freebsd: + %{p:%e`-p' not supported; use `-pg' and gprof(1)} %{Wl,*:%*} %{v:-V} %{assert*} %{R*} %{rpath*} %{defsym*} %{shared:-Bshareable %{h*} %{soname*}} %{!shared: %{!static: %{rdynamic: -export-dynamic} %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} %{static:-Bstatic}} %{symbolic:-Bsymbolic} + +*link_os_linux: +-m elf32ppclinux %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}} + +*link_os_gnu: +-m elf32ppclinux %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}} + +*link_os_netbsd: +%{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}} + +*link_os_openbsd: + + +*link_os_windiss: + + +*link_os_default: + + +*cc1_endian_big: + + +*cc1_endian_little: +%{!mstrict-align: %{!mno-strict-align: %{!mcall-i960-old: -mstrict-align } }} + +*cc1_endian_default: +%(cc1_endian_big) + +*cpp_os_ads: + + +*cpp_os_yellowknife: + + +*cpp_os_mvme: + + +*cpp_os_sim: + + +*cpp_os_freebsd: + -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ -Acpu=powerpc -Amachine=powerpc + +*cpp_os_gnu: +-D__unix__ -D__gnu_hurd__ -D__GNU__ %{!undef: %{!ansi: -Dunix -D__unix}} -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT} + +*cpp_os_linux: +-D__unix__ -D__gnu_linux__ -D__linux__ %{!undef: %{!ansi: %{!std=*:-Dunix -D__unix -Dlinux -D__linux} %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} -Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT} + +*cpp_os_netbsd: +-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ + +*cpp_os_openbsd: +%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS} + +*cpp_os_windiss: +-D__rtasim -D__EABI__ -D__ppc %{!msoft-float: -D__hardfp} + +*cpp_os_default: + + +*fbsd_dynamic_linker: +/usr/libexec/ld-elf.so.1 + +*link_command: +%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}} + diff --git a/dkppc/rules/base_rules b/dkppc/rules/base_rules new file mode 100644 index 0000000..ec0653e --- /dev/null +++ b/dkppc/rules/base_rules @@ -0,0 +1,55 @@ +#--------------------------------------------------------------------------------- +# the prefix on the compiler executables +#--------------------------------------------------------------------------------- +PREFIX := powerpc-gekko- + +export CC := $(PREFIX)gcc +export CXX := $(PREFIX)g++ +export AR := $(PREFIX)ar +export OBJCOPY := $(PREFIX)objcopy + + +#--------------------------------------------------------------------------------- +%.a: +#--------------------------------------------------------------------------------- + @echo $(notdir $@) + @$(AR) -rc $@ $^ + +#--------------------------------------------------------------------------------- +%.o: %.cpp + @echo $(notdir $<) + @$(CXX) -MMD -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o: %.c + @echo $(notdir $<) + @$(CC) -MMD -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o: %.s + @echo $(notdir $<) + @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o: %.S + @echo $(notdir $<) + @$(CC) -MMD -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ + +#--------------------------------------------------------------------------------- +# canned command sequence for binary data +#--------------------------------------------------------------------------------- +define bin2o + cp $(<) $(*).tmp + alignbin $(*).tmp + $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc \ + --rename-section .data=.rodata,readonly,data,contents,alloc \ + --redefine-sym _binary_`(echo $(*) | tr . _)`_tmp_start=`(echo $(*) | tr . _)`\ + --redefine-sym _binary_`(echo $(*) | tr . _)`_tmp_end=`(echo $(*) | tr . _)`_end\ + --redefine-sym _binary_`(echo $(*) | tr . _)`_tmp_size=`(echo $(*) | tr . _)`_size\ + $(*).tmp $(@) + echo "extern const u32" `(echo $(*) | tr . _)`"_end[];" >> $(*).h + echo "extern const u8" `(echo $(*) | tr . _)`"[];" >> $(*).h + echo "extern const u32" `(echo $(*) | tr . _)`_size[]";" >> $(*).h + rm $(*).tmp +endef + diff --git a/dkppc/rules/gamecube_rules b/dkppc/rules/gamecube_rules new file mode 100644 index 0000000..0bf2199 --- /dev/null +++ b/dkppc/rules/gamecube_rules @@ -0,0 +1,10 @@ +-include $(DEVKITPPC)/base_rules + +%.dol: %.elf + @echo output ... $(notdir $@) + @$(OBJCOPY) -O binary $< $@ + +#--------------------------------------------------------------------------------- +%.elf: + @echo linking ... $(notdir $@) + @$(LD) $^ $(LDFLAGS) $(LIBPATHS) $(LIBS) -o $@ diff --git a/dkppc/scripts/build-crtls.sh b/dkppc/scripts/build-crtls.sh new file mode 100644 index 0000000..23f9ebe --- /dev/null +++ b/dkppc/scripts/build-crtls.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +DEVKITPPC=$INSTALLDIR/devkitPPC + +#--------------------------------------------------------------------------------- +# Install and build the gamecube crt and libogc +#--------------------------------------------------------------------------------- + +echo "installing specs ..." +cp `pwd`/dkppc/crtls/gcn* $DEVKITPPC/$target/lib/ +cp `pwd`/dkpppc/crtls/ogc.ld $DEVKITPPC/$target/lib/ +cp `pwd`/dkppc/crtls/specs $DEVKITPPC/lib/gcc/$target/$GCC_VER/specs + +echo "building libogc ..." +cd $LIBOGC_SRCDIR +$MAKE +echo "installing libogc ..." +$MAKE install + +#--------------------------------------------------------------------------------- +# copy base rulesets +#--------------------------------------------------------------------------------- +cd $BUILDSCRIPTDIR +cp dkp-rules/* $DEVKITPPC + + diff --git a/dkppc/scripts/build-gcc.sh b/dkppc/scripts/build-gcc.sh new file mode 100644 index 0000000..63cf690 --- /dev/null +++ b/dkppc/scripts/build-gcc.sh @@ -0,0 +1,93 @@ +#!/bin/sh +#--------------------------------------------------------------------------------- +# Check Parameters +#--------------------------------------------------------------------------------- + +prefix=$INSTALLDIR/devkitPPC + +#--------------------------------------------------------------------------------- +# build and install binutils +#--------------------------------------------------------------------------------- + +mkdir -p $target/binutils +cd $target/binutils + +../../$BINUTILS_SRCDIR/configure \ + --prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \ + --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \ + 2>&1 | tee binutils_configure.log + + +$MAKE | tee binutils_make.log 2>&1 +$MAKE install | tee binutils_install.log 2>&1 + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/binutils +rm -fr $BINUTILS_SRCDIR + +#--------------------------------------------------------------------------------- +# build and install just the c compiler +#--------------------------------------------------------------------------------- +mkdir -p $target/gcc +cd $target/gcc + + +../../$GCC_SRCDIR/configure \ + --enable-languages=c,c++ \ + --with-cpu=750\ + --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ + --with-included-gettext --without-headers\ + --disable-nls --disable-shared --enable-threads --disable-multilib\ + --disable-win32-registry\ + --target=$target \ + --with-newlib \ + --prefix=$prefix -v\ + 2>&1 | tee gcc_configure.log + +$MAKE all-gcc | tee gcc_make.log 2>&1 +$MAKE install-gcc | tee gcc_install.log 2>&1 + +#--------------------------------------------------------------------------------- +# build and install newlib +#--------------------------------------------------------------------------------- +cd $BUILDSCRIPTDIR +mkdir -p $target/newlib +cd $target/newlib +mkdir -p etc + +$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure --target=$target \ + --prefix=$prefix \ + --enable-serial-configure \ + | tee newlib_configure.log 2>&1 + +$MAKE all | tee newlib_make.log +$MAKE install | tee newlib_install.log + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/newlib +rm -fr $NEWLIB_SRCDIR + +#--------------------------------------------------------------------------------- +# build and install the final compiler +#--------------------------------------------------------------------------------- + +cd $target/gcc + +$MAKE | tee gcc_final_make.log 2>&1 +$MAKE install | tee gcc_final_install.log 2>&1 + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/gcc +rm -fr $GCC_SRCDIR diff --git a/dkpsp/scripts/build-crtls.sh b/dkpsp/scripts/build-crtls.sh new file mode 100644 index 0000000..b3aab13 --- /dev/null +++ b/dkpsp/scripts/build-crtls.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +#--------------------------------------------------------------------------------- +# Install and build the pspsdk +#--------------------------------------------------------------------------------- + +echo "building pspsdk ..." +cd $PSPSDK_SRCDIR +$MAKE +echo "installing pspsdk ..." +$MAKE install + +cd $BUILDSCRIPTDIR + + diff --git a/dkpsp/scripts/build-gcc.sh b/dkpsp/scripts/build-gcc.sh new file mode 100644 index 0000000..158b6d9 --- /dev/null +++ b/dkpsp/scripts/build-gcc.sh @@ -0,0 +1,94 @@ +#!/bin/sh +#--------------------------------------------------------------------------------- +# Check Parameters +#--------------------------------------------------------------------------------- + +prefix=$INSTALLDIR/devkitPSP + +#--------------------------------------------------------------------------------- +# build and install binutils +#--------------------------------------------------------------------------------- + +#mkdir -p $target/binutils +#cd $target/binutils + +../../$BINUTILS_SRCDIR/configure \ + --prefix=$prefix --target=$target --disable-nls --disable-shared --disable-debug \ + --disable-threads --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \ + 2>&1 | tee $BUILDSCRIPTDIR/binutils_configure.log + + +$MAKE 2>&1 | tee binutils_make.log +$MAKE install 2>&1 | tee $BUILDSCRIPTDIR/binutils_install.log + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/binutils +rm -fr $BINUTILS_SRCDIR + +#--------------------------------------------------------------------------------- +# build and install just the c compiler +#--------------------------------------------------------------------------------- +mkdir -p $target/gcc +cd $target/gcc + + +../../$GCC_SRCDIR/configure \ + --enable-languages=c,c++ \ + --disable-multilib\ + --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \ + --disable-shared --disable-threads --disable-win32-registry --disable-nls\ + --enable-cxx-flags="-G0" \ + --target=$target \ + --with-newlib \ + --prefix=$prefix \ + 2>&1 | tee $BUILDSCRIPTDIR/gcc_configure.log + +$MAKE all-gcc 2>&1| tee $BUILDSCRIPTDIR/gcc_make.log +$MAKE install-gcc 2>&1 | tee $BUILDSCRIPTDIR/gcc_install.log + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# build and install newlib +#--------------------------------------------------------------------------------- +mkdir -p $target/newlib +cd $target/newlib + +$BUILDSCRIPTDIR/$NEWLIB_SRCDIR/configure \ + --enable-serial-configure \ + --target=$target \ + --prefix=$prefix \ + | tee $BUILDSCRIPTDIR/newlib_configure.log + +mkdir -p etc + +$MAKE +$MAKE install + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/newlib +rm -fr $NEWLIB_SRCDIR + +#--------------------------------------------------------------------------------- +# build and install the final compiler +#--------------------------------------------------------------------------------- + +cd $BUILDSCRIPTDIR +cd $target/gcc + +$MAKE | tee $BUILDSCRIPTDIR/gcc_final_make.log 2>&1 +$MAKE install | tee $BUILDSCRIPTDIR/gcc_final_install.log 2>&1 + +cd $BUILDSCRIPTDIR + +#--------------------------------------------------------------------------------- +# remove temp stuff to conserve disc space +#--------------------------------------------------------------------------------- +rm -fr $target/gcc +rm -fr $GCC_SRCDIR diff --git a/patches/devkit-binutils-2.16.1.patch b/patches/devkit-binutils-2.16.1.patch index 77248cb..549dbc3 100644 --- a/patches/devkit-binutils-2.16.1.patch +++ b/patches/devkit-binutils-2.16.1.patch @@ -1,6 +1,49 @@ -diff -Nbaur --exclude=*.info* binutils-2.16.1/bfd/doc/chew.c binutils-2.16.1-new/bfd/doc/chew.c +diff -Nbaur binutils-2.16.1/bfd/archures.c binutils-2.16.1-new/bfd/archures.c +--- binutils-2.16.1/bfd/archures.c Mon Jan 17 14:08:03 2005 ++++ binutils-2.16.1-new/bfd/archures.c Wed Jul 6 01:56:40 2005 +@@ -155,6 +155,7 @@ + .#define bfd_mach_mips16 16 + .#define bfd_mach_mips5 5 + .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} ++.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31 *} + .#define bfd_mach_mipsisa32 32 + .#define bfd_mach_mipsisa32r2 33 + .#define bfd_mach_mipsisa64 64 +diff -Nbaur binutils-2.16.1/bfd/bfd-in2.h binutils-2.16.1-new/bfd/bfd-in2.h +--- binutils-2.16.1/bfd/bfd-in2.h Wed Mar 2 21:23:20 2005 ++++ binutils-2.16.1-new/bfd/bfd-in2.h Wed Jul 6 01:56:40 2005 +@@ -1600,6 +1600,7 @@ + #define bfd_mach_mips16 16 + #define bfd_mach_mips5 5 + #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ ++#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31 */ + #define bfd_mach_mipsisa32 32 + #define bfd_mach_mipsisa32r2 33 + #define bfd_mach_mipsisa64 64 +diff -Nbaur binutils-2.16.1/bfd/cpu-mips.c binutils-2.16.1-new/bfd/cpu-mips.c +--- binutils-2.16.1/bfd/cpu-mips.c Thu Mar 3 11:40:58 2005 ++++ binutils-2.16.1-new/bfd/cpu-mips.c Wed Jul 6 01:56:40 2005 +@@ -86,6 +86,7 @@ + I_mipsisa64, + I_mipsisa64r2, + I_sb1, ++ I_allegrex, + }; + + #define NN(index) (&arch_info_struct[(index) + 1]) +@@ -118,7 +119,8 @@ + N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)), + N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)), + N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)), +- N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, 0), ++ N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)), ++ N (32, 32, bfd_mach_mips_allegrex, "mips:allegrex", FALSE, 0), + }; + + /* The default architecture is mips:3000, but with a machine number of +diff -Nbaur binutils-2.16.1/bfd/doc/chew.c binutils-2.16.1-new/bfd/doc/chew.c --- binutils-2.16.1/bfd/doc/chew.c Thu Mar 3 11:41:02 2005 -+++ binutils-2.16.1-new/bfd/doc/chew.c Mon Jun 20 00:14:07 2005 ++++ binutils-2.16.1-new/bfd/doc/chew.c Wed Jul 6 01:56:24 2005 @@ -91,6 +91,12 @@ #define DEF_SIZE 5000 #define STACK 50 @@ -14,9 +57,52 @@ diff -Nbaur --exclude=*.info* binutils-2.16.1/bfd/doc/chew.c binutils-2.16.1-new int internal_wanted; int internal_mode; -diff -Nbaur --exclude=*.info* binutils-2.16.1/config.sub binutils-2.16.1-new/config.sub +diff -Nbaur binutils-2.16.1/bfd/elfxx-mips.c binutils-2.16.1-new/bfd/elfxx-mips.c +--- binutils-2.16.1/bfd/elfxx-mips.c Sat May 28 22:58:29 2005 ++++ binutils-2.16.1-new/bfd/elfxx-mips.c Wed Jul 6 01:56:40 2005 +@@ -4669,6 +4669,9 @@ + case E_MIPS_MACH_SB1: + return bfd_mach_mips_sb1; + ++ case E_MIPS_MACH_ALLEGREX: ++ return bfd_mach_mips_allegrex; ++ + default: + switch (flags & EF_MIPS_ARCH) + { +@@ -7941,6 +7944,10 @@ + val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; + break; + ++ case bfd_mach_mips_allegrex: ++ val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX; ++ break; ++ + case bfd_mach_mipsisa32: + val = E_MIPS_ARCH_32; + break; +@@ -9641,6 +9648,7 @@ + /* MIPS II extensions. */ + { bfd_mach_mips4000, bfd_mach_mips6000 }, + { bfd_mach_mipsisa32, bfd_mach_mips6000 }, ++ { bfd_mach_mips_allegrex, bfd_mach_mips6000 }, + + /* MIPS I extensions. */ + { bfd_mach_mips6000, bfd_mach_mips3000 }, +diff -Nbaur binutils-2.16.1/binutils/readelf.c binutils-2.16.1-new/binutils/readelf.c +--- binutils-2.16.1/binutils/readelf.c Wed Apr 20 19:43:36 2005 ++++ binutils-2.16.1-new/binutils/readelf.c Wed Jul 6 01:56:41 2005 +@@ -2043,6 +2043,7 @@ + case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break; + case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break; + case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break; ++ case E_MIPS_MACH_ALLEGREX: strcat (buf, ", allegrex"); break; + case 0: + /* We simply ignore the field in this case to avoid confusion: + MIPS ELF does not specify EF_MIPS_MACH, it is a GNU +diff -Nbaur binutils-2.16.1/config.sub binutils-2.16.1-new/config.sub --- binutils-2.16.1/config.sub Wed Jan 19 00:34:56 2005 -+++ binutils-2.16.1-new/config.sub Mon Jun 20 00:14:07 2005 ++++ binutils-2.16.1-new/config.sub Wed Jul 6 01:56:41 2005 @@ -219,6 +219,10 @@ basic_machine=m68k-atari os=-mint @@ -28,9 +114,36 @@ diff -Nbaur --exclude=*.info* binutils-2.16.1/config.sub binutils-2.16.1-new/con esac # Decode aliases for certain CPU-COMPANY combinations. -diff -Nbaur --exclude=*.info* binutils-2.16.1/configure.in binutils-2.16.1-new/configure.in +@@ -253,6 +257,7 @@ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ ++ | mipsallegrex | mipsallegrexel \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ +@@ -326,6 +331,7 @@ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ ++ | mipsallegrex-* | mipsallegrexel-* \ + | mmix-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ +@@ -664,6 +670,10 @@ + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint ++ ;; ++ psp) ++ basic_machine=mipsallegrexel-psp ++ os=-elf + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +diff -Nbaur binutils-2.16.1/configure.in binutils-2.16.1-new/configure.in --- binutils-2.16.1/configure.in Sun Jun 12 20:33:06 2005 -+++ binutils-2.16.1-new/configure.in Mon Jun 20 00:53:42 2005 ++++ binutils-2.16.1-new/configure.in Wed Jul 6 01:56:24 2005 @@ -242,7 +242,7 @@ # Some tools are only suitable for building in a "native" situation. @@ -40,9 +153,77 @@ diff -Nbaur --exclude=*.info* binutils-2.16.1/configure.in binutils-2.16.1-new/c # Similarly, some are only suitable for cross toolchains. # Remove these if host=target. -diff -Nbaur --exclude=*.info* binutils-2.16.1/gas/config/tc-ppc.c binutils-2.16.1-new/gas/config/tc-ppc.c +diff -Nbaur binutils-2.16.1/gas/config/tc-mips.c binutils-2.16.1-new/gas/config/tc-mips.c +--- binutils-2.16.1/gas/config/tc-mips.c Sun Jun 12 19:07:03 2005 ++++ binutils-2.16.1-new/gas/config/tc-mips.c Wed Jul 6 01:56:41 2005 +@@ -365,11 +365,15 @@ + #define CPU_HAS_MDMX(cpu) (FALSE \ + ) + ++/* True if the given CPU belongs to the Allegrex family. */ ++#define CPU_IS_ALLEGREX(CPU) ((CPU) == CPU_ALLEGREX \ ++ ) ++ + /* True if CPU has a dror instruction. */ + #define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500) + + /* True if CPU has a ror instruction. */ +-#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) ++#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) || CPU_IS_ALLEGREX (CPU) + + /* True if mflo and mfhi can be immediately followed by instructions + which write to the HI and LO registers. +@@ -7817,6 +7821,30 @@ + case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break; + case '[': break; + case ']': break; ++ case '?': ++ /* MRB TODO: Fix this for the VFPU extensions. */ ++ switch (c = *p++) ++ { ++ case 'f': ++ /* MRB HACK: Skip the next character. */ ++ p++; ++ break; ++ case 'd': ++ case 'm': ++ case 'n': ++ case 's': ++ case 't': ++ case 'v': ++ case 'x': ++ /* MRB HACK: Skip the next two characters. */ ++ p++; ++ p++; ++ break; ++ default: break; ++ } ++ /* MRB HACK: Set all used bits. */ ++ used_bits = 0xffffffff; ++ break; + default: + as_bad (_("internal: bad mips opcode (unknown operand type `%c'): %s %s"), + c, opc->name, opc->args); +@@ -8485,6 +8513,7 @@ + + if ((regno & 1) != 0 + && HAVE_32BIT_FPRS ++ && ! CPU_IS_ALLEGREX (mips_opts.arch) + && ! (strcmp (str, "mtc1") == 0 + || strcmp (str, "mfc1") == 0 + || strcmp (str, "lwc1") == 0 +@@ -13743,6 +13772,8 @@ + + /* MIPS II */ + { "r6000", 0, ISA_MIPS2, CPU_R6000 }, ++ /* Sony PSP "Allegrex" CPU core */ ++ { "allegrex", 0, ISA_MIPS2, CPU_ALLEGREX }, + + /* MIPS III */ + { "r4000", 0, ISA_MIPS3, CPU_R4000 }, +diff -Nbaur binutils-2.16.1/gas/config/tc-ppc.c binutils-2.16.1-new/gas/config/tc-ppc.c --- binutils-2.16.1/gas/config/tc-ppc.c Wed Mar 2 13:24:01 2005 -+++ binutils-2.16.1-new/gas/config/tc-ppc.c Mon Jun 20 00:14:07 2005 ++++ binutils-2.16.1-new/gas/config/tc-ppc.c Wed Jul 6 01:56:24 2005 @@ -310,6 +310,7 @@ sdr1 has the value 25 srr0 has the value 26 @@ -133,9 +314,105 @@ diff -Nbaur --exclude=*.info* binutils-2.16.1/gas/config/tc-ppc.c binutils-2.16. if (*str != '\0') ++str; } -diff -Nbaur --exclude=*.info* binutils-2.16.1/include/opcode/ppc.h binutils-2.16.1-new/include/opcode/ppc.h +diff -Nbaur binutils-2.16.1/gas/configure binutils-2.16.1-new/gas/configure +--- binutils-2.16.1/gas/configure Tue Mar 1 00:43:51 2005 ++++ binutils-2.16.1-new/gas/configure Wed Jul 6 01:56:41 2005 +@@ -4537,6 +4537,9 @@ + mips64vr | mips64vrel) + mips_cpu=vr4100 + ;; ++ mipsallegrex | mipsallegrexel) ++ mips_cpu=allegrex ++ ;; + mipsisa32r2* | mipsisa64r2*) + mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` + ;; +diff -Nbaur binutils-2.16.1/gas/configure.in binutils-2.16.1-new/gas/configure.in +--- binutils-2.16.1/gas/configure.in Tue Mar 1 00:43:57 2005 ++++ binutils-2.16.1-new/gas/configure.in Wed Jul 6 01:56:41 2005 +@@ -222,6 +222,9 @@ + mips64vr | mips64vrel) + mips_cpu=vr4100 + ;; ++ mipsallegrex | mipsallegrexel) ++ mips_cpu=allegrex ++ ;; + mipsisa32r2* | mipsisa64r2*) + changequote(,)dnl + mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` +diff -Nbaur binutils-2.16.1/include/elf/common.h binutils-2.16.1-new/include/elf/common.h +--- binutils-2.16.1/include/elf/common.h Fri Oct 8 14:55:08 2004 ++++ binutils-2.16.1-new/include/elf/common.h Wed Jul 6 01:56:41 2005 +@@ -93,6 +93,7 @@ + #define ET_HIOS 0xFEFF /* Operating system-specific */ + #define ET_LOPROC 0xFF00 /* Processor-specific */ + #define ET_HIPROC 0xFFFF /* Processor-specific */ ++#define ET_PSPEXEC 0xFFA0 /* Sony PSP executable file */ + + /* Values for e_machine, which identifies the architecture. These numbers + are officially assigned by registry@caldera.com. See below for a list of +diff -Nbaur binutils-2.16.1/include/elf/mips.h binutils-2.16.1-new/include/elf/mips.h +--- binutils-2.16.1/include/elf/mips.h Thu Mar 3 11:58:06 2005 ++++ binutils-2.16.1-new/include/elf/mips.h Wed Jul 6 01:56:41 2005 +@@ -212,6 +212,7 @@ + #define E_MIPS_MACH_5400 0x00910000 + #define E_MIPS_MACH_5500 0x00980000 + #define E_MIPS_MACH_9000 0x00990000 ++#define E_MIPS_MACH_ALLEGREX 0x00A20000 + + /* Processor specific section indices. These sections do not actually + exist. Symbols with a st_shndx field corresponding to one of these +diff -Nbaur binutils-2.16.1/include/opcode/mips.h binutils-2.16.1-new/include/opcode/mips.h +--- binutils-2.16.1/include/opcode/mips.h Thu Mar 3 11:58:10 2005 ++++ binutils-2.16.1-new/include/opcode/mips.h Wed Jul 6 01:56:41 2005 +@@ -148,6 +148,19 @@ + #define OP_MASK_EXTMSBD 0x1f /* "ext" MSBD. */ + #define OP_SH_EXTMSBD 11 + ++#define OP_SH_VFPU_DELTA 0 ++#define OP_MASK_VFPU_DELTA 0xfffc ++#define OP_SH_VFPU_IMM3 16 ++#define OP_MASK_VFPU_IMM3 0x7 ++#define OP_SH_VFPU_IMM5 16 ++#define OP_MASK_VFPU_IMM5 0x1f ++#define OP_SH_VFPU_IMM8 16 ++#define OP_MASK_VFPU_IMM8 0xff ++#define OP_SH_VFPU_CC 18 ++#define OP_MASK_VFPU_CC 0x7 ++#define OP_SH_VFPU_CONST 16 ++#define OP_MASK_VFPU_CONST 0x1f ++ + #define OP_OP_COP0 0x10 + #define OP_OP_COP1 0x11 + #define OP_OP_COP2 0x12 +@@ -442,6 +455,8 @@ + #define INSN_5400 0x01000000 + /* NEC VR5500 instruction. */ + #define INSN_5500 0x02000000 ++/* Sony Allegrex instruction. */ ++#define INSN_ALLEGREX 0x10000000 + + /* MIPS ISA defines, use instead of hardcoding ISA level. */ + +@@ -489,6 +504,7 @@ + #define CPU_MIPS64 64 + #define CPU_MIPS64R2 65 + #define CPU_SB1 12310201 /* octal 'SB', 01. */ ++#define CPU_ALLEGREX 10111431 /* octal 'AL', 31. */ + + /* Test for membership in an ISA including chip specific ISAs. INSN + is pointer to an element of the opcode table; ISA is the specified +@@ -510,6 +526,7 @@ + || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \ + || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \ + || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \ ++ || (cpu == CPU_ALLEGREX && ((insn)->membership & INSN_ALLEGREX) != 0) \ + || 0) /* Please keep this term for easier source merging. */ + + /* This is a list of macro expanded instructions. +diff -Nbaur binutils-2.16.1/include/opcode/ppc.h binutils-2.16.1-new/include/opcode/ppc.h --- binutils-2.16.1/include/opcode/ppc.h Thu Sep 9 13:42:37 2004 -+++ binutils-2.16.1-new/include/opcode/ppc.h Mon Jun 20 00:14:07 2005 ++++ binutils-2.16.1-new/include/opcode/ppc.h Wed Jul 6 01:56:24 2005 @@ -134,6 +134,9 @@ /* Opcode is supported by machine check APU. */ #define PPC_OPCODE_RFMCI 0x800000 @@ -157,9 +434,1486 @@ diff -Nbaur --exclude=*.info* binutils-2.16.1/include/opcode/ppc.h binutils-2.16 /* The POWER and PowerPC assemblers use a few macros. We keep them with the operands table for simplicity. The macro table is an array of struct powerpc_macro. */ -diff -Nbaur --exclude=*.info* binutils-2.16.1/opcodes/ppc-dis.c binutils-2.16.1-new/opcodes/ppc-dis.c +diff -Nbaur binutils-2.16.1/ld/Makefile.am binutils-2.16.1-new/ld/Makefile.am +--- binutils-2.16.1/ld/Makefile.am Thu Jan 20 19:37:49 2005 ++++ binutils-2.16.1-new/ld/Makefile.am Wed Jul 6 01:56:41 2005 +@@ -190,6 +190,7 @@ + eelf_i386_chaos.o \ + eelf_i386_fbsd.o \ + eelf_i386_ldso.o \ ++ eelf_mipsallegrexel_psp.o \ + eelf_s390.o \ + egld960.o \ + egld960coff.o \ +@@ -864,6 +865,9 @@ + eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)" ++eelf_mipsallegrexel_psp.c: $(srcdir)/emulparams/elf_mipsallegrexel_psp.sh \ ++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_psp.sc ${GEN_DEPENDS} ++ ${GENSCRIPTS} elf_mipsallegrexel_psp "$(tdir_elf_mipsallegrexel_psp)" + eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" +diff -Nbaur binutils-2.16.1/ld/Makefile.in binutils-2.16.1-new/ld/Makefile.in +--- binutils-2.16.1/ld/Makefile.in Sun Jan 23 05:36:37 2005 ++++ binutils-2.16.1-new/ld/Makefile.in Wed Jul 6 01:56:41 2005 +@@ -315,6 +315,7 @@ + eelf_i386_chaos.o \ + eelf_i386_fbsd.o \ + eelf_i386_ldso.o \ ++ eelf_mipsallegrexel_psp.o \ + eelf_s390.o \ + egld960.o \ + egld960coff.o \ +@@ -1601,6 +1602,9 @@ + eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)" ++eelf_mipsallegrexel_psp.c: $(srcdir)/emulparams/elf_mipsallegrexel_psp.sh \ ++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_psp.sc ${GEN_DEPENDS} ++ ${GENSCRIPTS} elf_mipsallegrexel_psp "$(tdir_elf_mipsallegrexel_psp)" + eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)" +diff -Nbaur binutils-2.16.1/ld/configure.tgt binutils-2.16.1-new/ld/configure.tgt +--- binutils-2.16.1/ld/configure.tgt Tue Feb 8 19:54:27 2005 ++++ binutils-2.16.1-new/ld/configure.tgt Wed Jul 6 01:56:41 2005 +@@ -428,6 +428,8 @@ + mips*vr4100-*-elf*) targ_emul=elf32b4300 ;; + mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;; + mips*vr5000-*-elf*) targ_emul=elf32b4300 ;; ++mips*allegrexel-psp-elf*) targ_emul=elf_mipsallegrexel_psp ++ targ_extra_emuls="elf32elmip" ;; + mips*el-*-elf*) targ_emul=elf32elmip ;; + mips*-*-elf*) targ_emul=elf32ebmip ;; + mips*el-*-rtems*) targ_emul=elf32elmip ;; +diff -Nbaur binutils-2.16.1/ld/emulparams/elf_mipsallegrexel_psp.sh binutils-2.16.1-new/ld/emulparams/elf_mipsallegrexel_psp.sh +--- binutils-2.16.1/ld/emulparams/elf_mipsallegrexel_psp.sh Thu Jan 1 00:00:00 1970 ++++ binutils-2.16.1-new/ld/emulparams/elf_mipsallegrexel_psp.sh Wed Jul 6 01:56:41 2005 +@@ -0,0 +1,19 @@ ++# Based off of the default elf32 MIPS target. However, we use a seperate ++# script template because the PSP architecture defines sections that normally ++# cannot be overriden here and would normally get absorbed (i.e. ++# .rodata.sceModuleInfo would be absorbed into .rodata). ++ ++EMBEDDED=yes ++. ${srcdir}/emulparams/elf32lmip.sh ++unset NONPAGED_TEXT_START_ADDR ++unset SHLIB_TEXT_START_ADDR ++unset COMMONPAGESIZE ++ ++SCRIPT_NAME=elf_psp ++TEXT_START_ADDR=0x08900000 ++MAXPAGESIZE=256 ++ARCH="mips:allegrex" ++MACHINE= ++TEMPLATE_NAME=elf32 ++GENERATE_SHLIB_SCRIPT=yes ++DYNAMIC_LINK=FALSE +diff -Nbaur binutils-2.16.1/ld/scripttempl/elf_psp.sc binutils-2.16.1-new/ld/scripttempl/elf_psp.sc +--- binutils-2.16.1/ld/scripttempl/elf_psp.sc Thu Jan 1 00:00:00 1970 ++++ binutils-2.16.1-new/ld/scripttempl/elf_psp.sc Wed Jul 6 01:56:42 2005 +@@ -0,0 +1,496 @@ ++# ++# Unusual variables checked by this code: ++# NOP - four byte opcode for no-op (defaults to 0) ++# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not ++# empty. ++# SMALL_DATA_CTOR - .ctors contains small data. ++# SMALL_DATA_DTOR - .dtors contains small data. ++# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start ++# INITIAL_READONLY_SECTIONS - at start of text segment ++# OTHER_READONLY_SECTIONS - other than .text .init .rodata ... ++# (e.g., .PARISC.milli) ++# OTHER_TEXT_SECTIONS - these get put in .text when relocating ++# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... ++# (e.g., .PARISC.global) ++# OTHER_RELRO_SECTIONS - other than .data.rel.ro ... ++# (e.g. PPC32 .fixup, .got[12]) ++# OTHER_BSS_SECTIONS - other than .bss .sbss ... ++# OTHER_SECTIONS - at the end ++# EXECUTABLE_SYMBOLS - symbols that must be defined for an ++# executable (e.g., _DYNAMIC_LINK) ++# TEXT_START_ADDR - the first byte of the text segment, after any ++# headers. ++# TEXT_BASE_ADDRESS - the first byte of the text segment. ++# TEXT_START_SYMBOLS - symbols that appear at the start of the ++# .text section. ++# DATA_START_SYMBOLS - symbols that appear at the start of the ++# .data section. ++# OTHER_GOT_SYMBOLS - symbols defined just before .got. ++# OTHER_GOT_SECTIONS - sections just after .got. ++# OTHER_SDATA_SECTIONS - sections just after .sdata. ++# OTHER_BSS_SYMBOLS - symbols that appear at the start of the ++# .bss section besides __bss_start. ++# DATA_PLT - .plt should be in data segment, not text segment. ++# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement. ++# BSS_PLT - .plt should be in bss segment ++# TEXT_DYNAMIC - .dynamic in text segment, not data segment. ++# EMBEDDED - whether this is for an embedded system. ++# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set ++# start address of shared library. ++# INPUT_FILES - INPUT command of files to always include ++# WRITABLE_RODATA - if set, the .rodata section should be writable ++# INIT_START, INIT_END - statements just before and just after ++# combination of .init sections. ++# FINI_START, FINI_END - statements just before and just after ++# combination of .fini sections. ++# STACK_ADDR - start of a .stack section. ++# OTHER_END_SYMBOLS - symbols to place right at the end of the script. ++# SEPARATE_GOTPLT - if set, .got.plt should be separate output section, ++# so that .got can be in the RELRO area. It should be set to ++# the number of bytes in the beginning of .got.plt which can be ++# in the RELRO area as well. ++# ++# When adding sections, do note that the names of some sections are used ++# when specifying the start address of the next. ++# ++ ++# Many sections come in three flavours. There is the 'real' section, ++# like ".data". Then there are the per-procedure or per-variable ++# sections, generated by -ffunction-sections and -fdata-sections in GCC, ++# and useful for --gc-sections, which for a variable "foo" might be ++# ".data.foo". Then there are the linkonce sections, for which the linker ++# eliminates duplicates, which are named like ".gnu.linkonce.d.foo". ++# The exact correspondences are: ++# ++# Section Linkonce section ++# .text .gnu.linkonce.t.foo ++# .rodata .gnu.linkonce.r.foo ++# .data .gnu.linkonce.d.foo ++# .bss .gnu.linkonce.b.foo ++# .sdata .gnu.linkonce.s.foo ++# .sbss .gnu.linkonce.sb.foo ++# .sdata2 .gnu.linkonce.s2.foo ++# .sbss2 .gnu.linkonce.sb2.foo ++# .debug_info .gnu.linkonce.wi.foo ++# .tdata .gnu.linkonce.td.foo ++# .tbss .gnu.linkonce.tb.foo ++# ++# Each of these can also have corresponding .rel.* and .rela.* sections. ++ ++test -z "$ENTRY" && ENTRY=_start ++test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} ++test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} ++if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi ++test -z "${ELFSIZE}" && ELFSIZE=32 ++test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" ++test "$LD_FLAG" = "N" && DATA_ADDR=. ++test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE="" ++test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE="" ++test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT ++DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" ++DATA_SEGMENT_RELRO_END="" ++DATA_SEGMENT_RELRO_GOTPLT_END="" ++DATA_SEGMENT_END="" ++if test -n "${COMMONPAGESIZE}"; then ++ DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})" ++ DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);" ++ if test -n "${SEPARATE_GOTPLT}"; then ++ DATA_SEGMENT_RELRO_GOTPLT_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT}, .);" ++ else ++ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (0, .);" ++ fi ++fi ++INTERP=".interp ${RELOCATING-0} : { *(.interp) }" ++PLT=".plt ${RELOCATING-0} : { *(.plt) }" ++if test -z "$GOT"; then ++ if test -z "$SEPARATE_GOTPLT"; then ++ GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }" ++ else ++ GOT=".got ${RELOCATING-0} : { *(.got) }" ++ GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}} ++ .got.plt ${RELOCATING-0} : { *(.got.plt) }" ++ fi ++fi ++DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }" ++RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" ++DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }" ++STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }" ++if test -z "${NO_SMALL_DATA}"; then ++ SBSS=".sbss ${RELOCATING-0} : ++ { ++ ${RELOCATING+PROVIDE (__sbss_start = .);} ++ ${RELOCATING+PROVIDE (___sbss_start = .);} ++ ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)} ++ *(.dynsbss) ++ *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) ++ *(.scommon) ++ ${RELOCATING+PROVIDE (__sbss_end = .);} ++ ${RELOCATING+PROVIDE (___sbss_end = .);} ++ }" ++ SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }" ++ SDATA="/* 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 ${RELOCATING-0} : ++ { ++ ${RELOCATING+${SDATA_START_SYMBOLS}} ++ ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} ++ *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) ++ }" ++ SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }" ++ REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) } ++ .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }" ++ REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) } ++ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }" ++ REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) } ++ .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }" ++ REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) } ++ .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }" ++else ++ NO_SMALL_DATA=" " ++fi ++test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " ++CTOR=".ctors ${CONSTRUCTING-0} : ++ { ++ ${CONSTRUCTING+${CTOR_START}} ++ /* gcc uses crtbegin.o to find the start of ++ the constructors, so we make sure it is ++ first. Because this is a wildcard, it ++ doesn't matter if the user does not ++ actually link against crtbegin.o; the ++ linker won't look for a file to match a ++ wildcard. The wildcard also means that it ++ doesn't matter which directory crtbegin.o ++ is in. */ ++ ++ KEEP (*crtbegin*.o(.ctors)) ++ ++ /* We don't want to include the .ctor section from ++ from the crtend.o file until after the sorted ctors. ++ The .ctor section from the crtend file contains the ++ end of ctors marker and it must be last */ ++ ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors)) ++ KEEP (*(SORT(.ctors.*))) ++ KEEP (*(.ctors)) ++ ${CONSTRUCTING+${CTOR_END}} ++ }" ++DTOR=".dtors ${CONSTRUCTING-0} : ++ { ++ ${CONSTRUCTING+${DTOR_START}} ++ KEEP (*crtbegin*.o(.dtors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors)) ++ KEEP (*(SORT(.dtors.*))) ++ KEEP (*(.dtors)) ++ ${CONSTRUCTING+${DTOR_END}} ++ }" ++STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : ++ { ++ ${RELOCATING+_stack = .;} ++ *(.stack) ++ }" ++ ++# if this is for an embedded system, don't add SIZEOF_HEADERS. ++if [ -z "$EMBEDDED" ]; then ++ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS" ++else ++ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}" ++fi ++ ++cat <fprintf_func) (info->stream, "$v%d", + (l >> OP_SH_FT) & OP_MASK_FT); ++ break; ++ ++ case '?': ++ /* VFPU extensions. */ ++ d++; ++ switch (*d) ++ { ++ case '\0': ++ /* xgettext:c-format */ ++ (*info->fprintf_func) (info->stream, ++ _("# internal error, incomplete extension sequence (?)")); ++ return; ++ ++ case 'o': ++ delta = (l >> OP_SH_VFPU_DELTA) & OP_MASK_VFPU_DELTA; ++ if (delta & 0x8000) ++ delta |= ~0xffff; ++ (*info->fprintf_func) (info->stream, "%d", ++ delta); ++ break; ++ ++ case '0': ++ case '1': ++ case '2': ++ case '3': ++ break; ++ ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ break; ++ ++ case 'a': ++ { ++ unsigned int c = (l >> OP_SH_VFPU_CONST) & OP_MASK_VFPU_CONST; ++ if (c < vfpu_num_constants) ++ { ++ (*info->fprintf_func) (info->stream, "%s", ++ vfpu_const_names[c]); ++ } ++ break; ++ } ++ ++ case 'b': ++ /* 5-bit immediate value. */ ++ (*info->fprintf_func) (info->stream, "%d", ++ (l >> OP_SH_VFPU_IMM5) & OP_MASK_VFPU_IMM5); ++ break; ++ ++ case 'c': ++ /* VFPU condition code. */ ++ (*info->fprintf_func) (info->stream, "%d", ++ (l >> OP_SH_VFPU_CC) & OP_MASK_VFPU_CC); ++ break; ++ ++ case 'e': ++ /* 3-bit immediate value. */ ++ (*info->fprintf_func) (info->stream, "%d", ++ (l >> OP_SH_VFPU_IMM3) & OP_MASK_VFPU_IMM3); ++ break; ++ ++ case 'f': ++ /* Conditional compare. */ ++ (*info->fprintf_func) (info->stream, "%s", ++ vfpu_cond_names[l & 0x0f]); ++ /* Apparently this specifier is unused. */ ++ d++; ++ break; ++ ++ case 'i': ++ /* 8-bit immediate value. */ ++ (*info->fprintf_func) (info->stream, "0x%02x", ++ (l >> OP_SH_VFPU_IMM8) & OP_MASK_VFPU_IMM8); ++ break; ++ ++ case 'q': ++ /* VFPU control register (vmtvc). */ ++ (*info->fprintf_func) (info->stream, "$%d", ++ l & 0xff); ++ break; ++ ++ case 'r': ++ /* VFPU control register (vmfvc). */ ++ (*info->fprintf_func) (info->stream, "$%d", ++ (l >> 8) & 0xff); ++ break; ++ ++ case 'u': ++ break; ++ ++ case 'w': ++ break; ++ ++ case 'd': ++ case 'm': ++ case 'n': ++ case 's': ++ case 't': ++ case 'v': ++ case 'x': ++ break; ++ ++ case 'z': ++ (*info->fprintf_func) (info->stream, "%s", ++ vfpu_rwb_names[(l >> 1) & 0x1]); ++ break; ++ ++ default: ++ /* xgettext:c-format */ ++ (*info->fprintf_func) (info->stream, ++ _("# internal error, undefined extension sequence (?%c)"), ++ *d); ++ return; ++ } + break; + + default: +diff -Nbaur binutils-2.16.1/opcodes/mips-opc.c binutils-2.16.1-new/opcodes/mips-opc.c +--- binutils-2.16.1/opcodes/mips-opc.c Thu Mar 3 11:49:50 2005 ++++ binutils-2.16.1-new/opcodes/mips-opc.c Wed Jul 6 01:56:42 2005 +@@ -109,6 +109,7 @@ + #define N5 (INSN_5400 | INSN_5500) + #define N54 INSN_5400 + #define N55 INSN_5500 ++#define AL INSN_ALLEGREX + + #define G1 (T3 \ + ) +@@ -271,6 +272,7 @@ + {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 }, + {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 }, + {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 }, ++{"break", "B", 0x0000000d, 0xfc00003f, TRAP, 0, I32|AL }, + {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 }, + {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 }, + {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 }, +@@ -432,7 +434,7 @@ + {"cabs.un.d", "M,S,T", 0x46200071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D }, + {"cabs.un.ps", "M,S,T", 0x46c00071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D }, + {"cabs.un.s", "M,S,T", 0x46000071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D }, +-{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3}, ++{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3|AL}, + {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 }, + {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 }, + {"ceil.w.d", "D,S", 0x4620000e, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 }, +@@ -443,7 +445,9 @@ + /* cfc2 is at the bottom of the table. */ + {"cfc3", "t,G", 0x4c400000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I1 }, + {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, ++{"clo", "d,s", 0x00000017, 0xfc1f07ff, WR_d|RD_s, 0, AL }, + {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 }, ++{"clz", "d,s", 0x00000016, 0xfc1f07ff, WR_d|RD_s, 0, AL }, + {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 }, + {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, + {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 }, +@@ -465,10 +469,12 @@ + {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5 }, + {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D }, + {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 }, ++{"max", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL }, + {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 }, + {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, 0, I3 }, + {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, 0, I3 }, + {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, 0, I3 }, ++{"min", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL }, + {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 }, + {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3 }, + {"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5 }, +@@ -595,8 +601,8 @@ + {"dsubu", "d,v,I", 0, (int) M_DSUBU_I, INSN_MACRO, 0, I3 }, + {"ei", "", 0x41606020, 0xffffffff, WR_t|WR_C0, 0, I33 }, + {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 }, +-{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32 }, +-{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33 }, ++{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32|AL }, ++{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33|AL }, + {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 }, + {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 }, + {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 }, +@@ -605,7 +611,7 @@ + {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 }, + {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 }, + {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 }, +-{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 }, ++{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33|AL }, + {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, + {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, 0, I33 }, + {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr */ +@@ -639,18 +645,11 @@ + {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, 0, I3 }, + {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, 0, I1 }, + {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1 }, +-{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, +-{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, +-{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, +-{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, +-{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ +-{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, +-{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, +-{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, +-{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, ++/* ldc1 is at the bottom of the table. */ ++/* ldc2 is at the bottom of the table. */ + {"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, + {"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 }, +-{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, ++{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3|AL }, + {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 }, + {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 }, + {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 }, +@@ -680,8 +679,7 @@ + {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 }, + {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */ + {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 }, +-{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, +-{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, ++/* lwc2 is at the bottom of the table. */ + {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, + {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 }, + {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 }, +@@ -713,10 +711,12 @@ + {"madd.s", "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4 }, + {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5 }, + {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, ++{"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, + {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55}, + {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, + {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 }, + {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, ++{"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, + {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55}, + {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, + {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 }, +@@ -756,7 +756,7 @@ + {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, + {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 }, + {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5 }, +-{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 }, ++{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL }, + {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, + {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 }, + {"movn.l", "D,S,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 }, +@@ -769,7 +769,7 @@ + {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 }, + {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 }, + {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5 }, +-{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 }, ++{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL }, + {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 }, + {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 }, + {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 }, +@@ -786,8 +786,10 @@ + {"msub.s", "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4 }, + {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5 }, + {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, ++{"msub", "s,t", 0x0000002e, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, + {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, + {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, ++{"msubu", "s,t", 0x0000002f, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL }, + {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, + {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 }, + {"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 }, +@@ -936,13 +938,13 @@ + {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 }, + {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 }, + {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 }, +-{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33 }, +-{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33 }, +-{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33 }, +-{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33 }, +-{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33 }, +-{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33 }, +-{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33 }, ++{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|AL }, ++{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|AL }, ++{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|AL }, ++{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|AL }, ++{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|AL }, ++{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|AL }, ++{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|AL }, + {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 }, + {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 }, + {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 }, +@@ -974,24 +976,18 @@ + {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 }, + {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 }, + {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 }, +-{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, +-{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, +-{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, +-{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, +-{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, +-{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, ++/* sdc1 is at the bottom of the table. */ ++/* sdc2 is at the bottom of the table. */ + {"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 }, + {"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 }, +-{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, +-{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, +-{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, +-{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 }, ++/* s.d (sdc1 is at the bottom of the table. */ ++{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3|AL }, + {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, 0, I3 }, + {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 }, + {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, 0, I3 }, + {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b, 0, I4 }, +-{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33 }, +-{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33 }, ++{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, ++{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, + {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, + {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 }, + {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, 0, I1 }, +@@ -1083,8 +1079,7 @@ + {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 }, + {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */ + {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 }, +-{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, +-{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, ++/* swc2 is at the bottom of the table. */ + {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 }, + {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 }, + {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 }, +@@ -1169,7 +1164,8 @@ + {"waiti", "", 0x42000020, 0xffffffff, TRAP, 0, L1 }, + {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 }, + {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 }, +-{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33 }, ++{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33|AL }, ++{"wsbw", "d,t", 0x7c0000e0, 0xffe007ff, WR_d|RD_t, 0, AL }, + {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 }, + {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 }, + {"xor.ob", "X,Y,Q", 0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 }, +@@ -1179,6 +1175,320 @@ + {"xor.qh", "X,Y,Q", 0x7820000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX }, + {"xori", "t,r,i", 0x38000000, 0xfc000000, WR_t|RD_s, 0, I1 }, + ++/* Sony Allegrex CPU core. */ ++{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0, AL }, ++ ++/* Sony Allegrex VFPU instructions. */ ++/* MRB: I don't know all of the instructions that should be using WR_C2/RD_C2 (they're just synonyms ++ for INSN_COP). It's not that important and more for reference, but someone should fill them in later. */ ++/* MRB: I don't know the real macro names either, so they are assumed from the opcode's name. */ ++{"bvf", "?c,p", 0x49000000, 0xffe30000, CBD|RD_CC, 0, AL }, ++{"bvfl", "?c,p", 0x49020000, 0xffe30000, CBL|RD_CC, 0, AL }, ++{"bvt", "?c,p", 0x49010000, 0xffe30000, CBD|RD_CC, 0, AL }, ++{"bvtl", "?c,p", 0x49030000, 0xffe30000, CBL|RD_CC, 0, AL }, ++{"lv.s", "?m0x,?o(b)", 0xc8000000, 0xfc000000, CLD|RD_s|WR_CC, 0, AL }, ++{"lv.s", "?m0x,A(b)", 0 , 0x00000073, INSN_MACRO, 0, AL }, ++{"ulv.s", "?m0x,o(b)", 0 , 0x000000da, INSN_MACRO, 0, AL }, ++{"lv.q", "?n3x,?o(b)", 0xd8000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, ++{"lv.q", "?n3x,A(b)", 0 , 0x00000074, INSN_MACRO, 0, AL }, ++{"ulv.q", "?n3x,?o(b)", 0 , 0x000000dc, INSN_MACRO, 0, AL }, ++{"ulv.q", "?n3x,A(b)", 0 , 0x000000dd, INSN_MACRO, 0, AL }, ++{"lvi.s", "?t0x,l?y0", 0 , 0x00000062, INSN_MACRO, 0, AL }, ++{"lvi.p", "?t1x,?[l?y0,l?y1?]", 0 , 0x00000063, INSN_MACRO, 0, AL }, ++{"lvi.t", "?t2x,?[l?y0,l?y1,l?y2?]", 0 , 0x00000064, INSN_MACRO, 0, AL }, ++{"lvi.q", "?t3x,?[l?y0,l?y1,l?y2,l?y3?]", 0 , 0x00000065, INSN_MACRO, 0, AL }, ++{"lvhi.s", "?t0x,?[?u?y0,?u?y1?]", 0 , 0x00000060, INSN_MACRO, 0, AL }, ++{"lvhi.p", "?t1x,?[?u?y0,?u?y1,?u?y2,?u?y3?]", 0 , 0x00000061, INSN_MACRO, 0, AL }, ++{"sv.s", "?m0x,?o(b)", 0xe8000000, 0xfc000000, SM|RD_s|RD_C0, 0, AL }, ++{"sv.s", "?m0x,A(b)", 0 , 0x000000bf, INSN_MACRO, 0, AL }, ++{"usv.s", "?m0x,o(b)", 0 , 0x000000e4, INSN_MACRO, 0, AL }, ++{"sv.q", "?n3x,?o(b)", 0xf8000000, 0xfc000002, SM|RD_s|RD_C0, 0, AL }, ++{"sv.q", "?n3x,?o(b),?z", 0xf8000000, 0xfc000000, SM|RD_s|RD_C0, 0, AL }, ++{"sv.q", "?n3x,A(b)", 0 , 0x000000c0, INSN_MACRO, 0, AL }, ++{"sv.q", "?n3x,A(b),?z", 0 , 0x000000c0, INSN_MACRO, 0, AL }, ++{"sv.q", "?n3x,A,?z", 0 , 0x000000c0, INSN_MACRO, 0, AL }, ++{"usv.q", "?n3x,?o(b)", 0 , 0x000000e6, INSN_MACRO, 0, AL }, ++{"usv.q", "?n3x,A(b)", 0 , 0x000000e7, INSN_MACRO, 0, AL }, ++{"vwb.q", "?n3x,?o(b)", 0xf8000002, 0xfc000002, SM|RD_s|RD_C0, 0, AL }, ++{"lvl.q", "?n3x,?o(b)", 0xd4000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, ++{"lvl.q", "?n3x,A(b)", 0 , 0x00000075, INSN_MACRO, 0, AL }, ++{"lvr.q", "?n3x,?o(b)", 0xd4000002, 0xfc000002, CLD|RD_s|WR_CC, 0, AL }, ++{"lvr.q", "?n3x,A(b)", 0 , 0x00000076, INSN_MACRO, 0, AL }, ++{"svl.q", "?n3x,?o(b)", 0xf4000000, 0xfc000002, SM|RD_s|RD_C0, 0, AL }, ++{"svl.q", "?n3x,A(b)", 0 , 0x000000c1, INSN_MACRO, 0, AL }, ++{"svr.q", "?n3x,?o(b)", 0xf4000002, 0xfc000002, SM|RD_s|RD_C0, 0, AL }, ++{"svr.q", "?n3x,A(b)", 0 , 0x000000c2, INSN_MACRO, 0, AL }, ++{"mtv", "t,?d0z", 0x48e00000, 0xffe0ff80, LCD|WR_t|RD_C0, 0, AL }, ++{"mfv", "t,?d0z", 0x48600000, 0xffe0ff80, COD|RD_t|WR_CC|RD_C0, 0, AL }, ++{"mtvc", "t,?q", 0x48e00000, 0xffe0ff00, LCD|WR_t|RD_C0, 0, AL }, ++{"mfvc", "t,?q", 0x48600000, 0xffe0ff00, COD|RD_t|WR_CC|RD_C0, 0, AL }, ++{"vmtvc", "?q,?s0y", 0xd0510000, 0xffff8000, RD_C0, 0, AL }, ++{"vmfvc", "?d0z,?r", 0xd0500000, 0xffff0080, RD_C0, 0, AL }, ++{"vadd.q", "?d3d,?s3s,?t3t", 0x60008080, 0xff808080, RD_C0, 0, AL }, ++{"vsub.q", "?d3d,?s3s,?t3t", 0x60808080, 0xff808080, RD_C0, 0, AL }, ++{"vdiv.q", "?x3z,?s3y,?t3x", 0x63808080, 0xff808080, RD_C0, 0, AL }, ++{"vmul.q", "?d3d,?s3s,?t3t", 0x64008080, 0xff808080, RD_C0, 0, AL }, ++{"vdot.q", "?d0d,?s3s,?t3t", 0x64808080, 0xff808080, RD_C0, 0, AL }, ++{"vscl.q", "?d3d,?s3s,?t0x", 0x65008080, 0xff808080, RD_C0, 0, AL }, ++{"vhdp.q", "?d0d,?s3y,?t3t", 0x66008080, 0xff808080, RD_C0, 0, AL }, ++{"vcmp.q", "?f2,?s3s,?t3t", 0x6c008080, 0xff8080f0, RD_C0, 0, AL }, ++{"vcmp.q", "?f1,?s3s", 0x6c008080, 0xffff80f0, RD_C0, 0, AL }, ++{"vcmp.q", "?f0", 0x6c008080, 0xfffffff0, RD_C0, 0, AL }, ++{"vmin.q", "?d3d,?s3s,?t3t", 0x6d008080, 0xff808080, RD_C0, 0, AL }, ++{"vmax.q", "?d3d,?s3s,?t3t", 0x6d808080, 0xff808080, RD_C0, 0, AL }, ++{"vsgn.q", "?d3d,?s3s", 0xd04a8080, 0xffff8080, RD_C0, 0, AL }, ++{"vcst.q", "?d3d,?a", 0xd0608080, 0xffe0ff80, RD_C0, 0, AL }, ++{"vscmp.q", "?d3d,?s3s,?t3t", 0x6e808080, 0xff808080, RD_C0, 0, AL }, ++{"vsge.q", "?d3d,?s3s,?t3t", 0x6f008080, 0xff808080, RD_C0, 0, AL }, ++{"vslt.q", "?d3d,?s3s,?t3t", 0x6f808080, 0xff808080, RD_C0, 0, AL }, ++{"vi2uc.q", "?d0m,?s3w", 0xd03c8080, 0xffff8080, RD_C0, 0, AL }, ++{"vi2c.q", "?d0m,?s3w", 0xd03d8080, 0xffff8080, RD_C0, 0, AL }, ++{"vi2us.q", "?d1m,?s3w", 0xd03e8080, 0xffff8080, RD_C0, 0, AL }, ++{"vi2s.q", "?d1m,?s3w", 0xd03f8080, 0xffff8080, RD_C0, 0, AL }, ++{"vmov.q", "?d3d,?s3s", 0xd0008080, 0xffff8080, RD_C0, 0, AL }, ++{"vabs.q", "?d3d,?s3w", 0xd0018080, 0xffff8080, RD_C0, 0, AL }, ++{"vneg.q", "?d3d,?s3w", 0xd0028080, 0xffff8080, RD_C0, 0, AL }, ++{"vidt.q", "?d3d", 0xd0038080, 0xffffff80, RD_C0, 0, AL }, ++{"vsat0.q", "?d3z,?s3s", 0xd0048080, 0xffff8080, RD_C0, 0, AL }, ++{"vsat1.q", "?d3z,?s3s", 0xd0058080, 0xffff8080, RD_C0, 0, AL }, ++{"vzero.q", "?d3d", 0xd0068080, 0xffffff80, RD_C0, 0, AL }, ++{"vone.q", "?d3d", 0xd0078080, 0xffffff80, RD_C0, 0, AL }, ++{"vrcp.q", "?x3z,?s3y", 0xd0108080, 0xffff8080, RD_C0, 0, AL }, ++{"vrsq.q", "?x3z,?s3y", 0xd0118080, 0xffff8080, RD_C0, 0, AL }, ++{"vsin.q", "?x3z,?s3y", 0xd0128080, 0xffff8080, RD_C0, 0, AL }, ++{"vcos.q", "?x3z,?s3y", 0xd0138080, 0xffff8080, RD_C0, 0, AL }, ++{"vexp2.q", "?x3z,?s3y", 0xd0148080, 0xffff8080, RD_C0, 0, AL }, ++{"vlog2.q", "?x3z,?s3y", 0xd0158080, 0xffff8080, RD_C0, 0, AL }, ++{"vsqrt.q", "?x3z,?s3y", 0xd0168080, 0xffff8080, RD_C0, 0, AL }, ++{"vasin.q", "?x3z,?s3y", 0xd0178080, 0xffff8080, RD_C0, 0, AL }, ++{"vnrcp.q", "?x3z,?s3y", 0xd0188080, 0xffff8080, RD_C0, 0, AL }, ++{"vnsin.q", "?x3z,?s3y", 0xd01a8080, 0xffff8080, RD_C0, 0, AL }, ++{"vrexp2.q", "?x3z,?s3y", 0xd01c8080, 0xffff8080, RD_C0, 0, AL }, ++{"vrndi.q", "?d3z", 0xd0218080, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf1.q", "?d3z", 0xd0228080, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf2.q", "?d3z", 0xd0238080, 0xffffff80, RD_C0, 0, AL }, ++{"vf2h.q", "?d1m,?s3s", 0xd0328080, 0xffff8080, RD_C0, 0, AL }, ++{"vsrt1.q", "?d3d,?s3s", 0xd0408080, 0xffff8080, RD_C0, 0, AL }, ++{"vsrt2.q", "?d3d,?s3s", 0xd0418080, 0xffff8080, RD_C0, 0, AL }, ++{"vsrt3.q", "?d3d,?s3s", 0xd0488080, 0xffff8080, RD_C0, 0, AL }, ++{"vsrt4.q", "?d3d,?s3s", 0xd0498080, 0xffff8080, RD_C0, 0, AL }, ++{"vbfy1.q", "?d3d,?s3s", 0xd0428080, 0xffff8080, RD_C0, 0, AL }, ++{"vbfy2.q", "?d3d,?s3s", 0xd0438080, 0xffff8080, RD_C0, 0, AL }, ++{"vocp.q", "?d3d,?s3y", 0xd0448080, 0xffff8080, RD_C0, 0, AL }, ++{"vfad.q", "?d0d,?s3s", 0xd0468080, 0xffff8080, RD_C0, 0, AL }, ++{"vavg.q", "?d0d,?s3s", 0xd0478080, 0xffff8080, RD_C0, 0, AL }, ++{"vf2in.q", "?d3m,?s3s,?b", 0xd2008080, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iz.q", "?d3m,?s3s,?b", 0xd2208080, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iu.q", "?d3m,?s3s,?b", 0xd2408080, 0xffe08080, RD_C0, 0, AL }, ++{"vf2id.q", "?d3m,?s3s,?b", 0xd2608080, 0xffe08080, RD_C0, 0, AL }, ++{"vi2f.q", "?d3d,?s3w,?b", 0xd2808080, 0xffe08080, RD_C0, 0, AL }, ++{"vcmov.q", "?d3d,?s3s,?e", 0 , 0x000000e9, INSN_MACRO, 0, AL }, ++{"vcmovt.q", "?d3d,?s3s,?e", 0xd2a08080, 0xfff88080, RD_C0, 0, AL }, ++{"vcmovf.q", "?d3d,?s3s,?e", 0xd2a88080, 0xfff88080, RD_C0, 0, AL }, ++{"vmmul.q", "?v7z,?s7y,?t7x", 0xf0008080, 0xff808080, RD_C0, 0, AL }, ++{"vtfm4.q", "?v3z,?s7y,?t3x", 0xf1808080, 0xff808080, RD_C0, 0, AL }, ++{"vhtfm4.q", "?v3z,?s7y,?t3x", 0xf1808000, 0xff808080, RD_C0, 0, AL }, ++{"vmscl.q", "?x7z,?s7y,?t0x", 0xf2008080, 0xff808080, RD_C0, 0, AL }, ++{"vqmul.q", "?v3z,?s3y,?t3x", 0xf2808080, 0xff808080, RD_C0, 0, AL }, ++{"vmmov.q", "?x7z,?s7y", 0xf3808080, 0xffff8080, RD_C0, 0, AL }, ++{"vmidt.q", "?d7z", 0xf3838080, 0xffffff80, RD_C0, 0, AL }, ++{"vmzero.q", "?d7z", 0xf3868080, 0xffffff80, RD_C0, 0, AL }, ++{"vmone.q", "?d7z", 0xf3878080, 0xffffff80, RD_C0, 0, AL }, ++{"vrot.q", "?x3z,?s0y,?w", 0xf3a08080, 0xffe08080, RD_C0, 0, AL }, ++{"vt4444.q", "?d1z,?s3w", 0xd0598080, 0xffff8080, RD_C0, 0, AL }, ++{"vt5551.q", "?d1z,?s3w", 0xd05a8080, 0xffff8080, RD_C0, 0, AL }, ++{"vt5650.q", "?d1z,?s3w", 0xd05b8080, 0xffff8080, RD_C0, 0, AL }, ++{"vadd.t", "?d2d,?s2s,?t2t", 0x60008000, 0xff808080, RD_C0, 0, AL }, ++{"vsub.t", "?d2d,?s2s,?t2t", 0x60808000, 0xff808080, RD_C0, 0, AL }, ++{"vdiv.t", "?x2z,?s2y,?t2x", 0x63808000, 0xff808080, RD_C0, 0, AL }, ++{"vmul.t", "?d2d,?s2s,?t2t", 0x64008000, 0xff808080, RD_C0, 0, AL }, ++{"vdot.t", "?d0d,?s2s,?t2t", 0x64808000, 0xff808080, RD_C0, 0, AL }, ++{"vscl.t", "?d2d,?s2s,?t0x", 0x65008000, 0xff808080, RD_C0, 0, AL }, ++{"vhdp.t", "?d0d,?s2y,?t2t", 0x66008000, 0xff808080, RD_C0, 0, AL }, ++{"vcrs.t", "?d2d,?s2y,?t2x", 0x66808000, 0xff808080, RD_C0, 0, AL }, ++{"vcmp.t", "?f2,?s2s,?t2t", 0x6c008000, 0xff8080f0, RD_C0, 0, AL }, ++{"vcmp.t", "?f1,?s2s", 0x6c008000, 0xffff80f0, RD_C0, 0, AL }, ++{"vcmp.t", "?f0", 0x6c008000, 0xfffffff0, RD_C0, 0, AL }, ++{"vmin.t", "?d2d,?s2s,?t2t", 0x6d008000, 0xff808080, RD_C0, 0, AL }, ++{"vmax.t", "?d2d,?s2s,?t2t", 0x6d808000, 0xff808080, RD_C0, 0, AL }, ++{"vsgn.t", "?d2d,?s2s", 0xd04a8000, 0xffff8080, RD_C0, 0, AL }, ++{"vcst.t", "?d2d,?a", 0xd0608000, 0xffe0ff80, RD_C0, 0, AL }, ++{"vscmp.t", "?d2d,?s2s,?t2t", 0x6e808000, 0xff808080, RD_C0, 0, AL }, ++{"vsge.t", "?d2d,?s2s,?t2t", 0x6f008000, 0xff808080, RD_C0, 0, AL }, ++{"vslt.t", "?d2d,?s2s,?t2t", 0x6f808000, 0xff808080, RD_C0, 0, AL }, ++{"vmov.t", "?d2d,?s2s", 0xd0008000, 0xffff8080, RD_C0, 0, AL }, ++{"vabs.t", "?d2d,?s2w", 0xd0018000, 0xffff8080, RD_C0, 0, AL }, ++{"vneg.t", "?d2d,?s2w", 0xd0028000, 0xffff8080, RD_C0, 0, AL }, ++{"vsat0.t", "?d2z,?s2s", 0xd0048000, 0xffff8080, RD_C0, 0, AL }, ++{"vsat1.t", "?d2z,?s2s", 0xd0058000, 0xffff8080, RD_C0, 0, AL }, ++{"vzero.t", "?d2d", 0xd0068000, 0xffffff80, RD_C0, 0, AL }, ++{"vone.t", "?d2d", 0xd0078000, 0xffffff80, RD_C0, 0, AL }, ++{"vrcp.t", "?x2z,?s2y", 0xd0108000, 0xffff8080, RD_C0, 0, AL }, ++{"vrsq.t", "?x2z,?s2y", 0xd0118000, 0xffff8080, RD_C0, 0, AL }, ++{"vsin.t", "?x2z,?s2y", 0xd0128000, 0xffff8080, RD_C0, 0, AL }, ++{"vcos.t", "?x2z,?s2y", 0xd0138000, 0xffff8080, RD_C0, 0, AL }, ++{"vexp2.t", "?x2z,?s2y", 0xd0148000, 0xffff8080, RD_C0, 0, AL }, ++{"vlog2.t", "?x2z,?s2y", 0xd0158000, 0xffff8080, RD_C0, 0, AL }, ++{"vsqrt.t", "?x2z,?s2y", 0xd0168000, 0xffff8080, RD_C0, 0, AL }, ++{"vasin.t", "?x2z,?s2y", 0xd0178000, 0xffff8080, RD_C0, 0, AL }, ++{"vnrcp.t", "?x2z,?s2y", 0xd0188000, 0xffff8080, RD_C0, 0, AL }, ++{"vnsin.t", "?x2z,?s2y", 0xd01a8000, 0xffff8080, RD_C0, 0, AL }, ++{"vrexp2.t", "?x2z,?s2y", 0xd01c8000, 0xffff8080, RD_C0, 0, AL }, ++{"vrndi.t", "?d2z", 0xd0218000, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf1.t", "?d2z", 0xd0228000, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf2.t", "?d2z", 0xd0238000, 0xffffff80, RD_C0, 0, AL }, ++{"vocp.t", "?d2d,?s2y", 0xd0448000, 0xffff8080, RD_C0, 0, AL }, ++{"vfad.t", "?d0d,?s2s", 0xd0468000, 0xffff8080, RD_C0, 0, AL }, ++{"vavg.t", "?d0d,?s2s", 0xd0478000, 0xffff8080, RD_C0, 0, AL }, ++{"vf2in.t", "?d2m,?s2s,?b", 0xd2008000, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iz.t", "?d2m,?s2s,?b", 0xd2208000, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iu.t", "?d2m,?s2s,?b", 0xd2408000, 0xffe08080, RD_C0, 0, AL }, ++{"vf2id.t", "?d2m,?s2s,?b", 0xd2608000, 0xffe08080, RD_C0, 0, AL }, ++{"vi2f.t", "?d2d,?s2w,?b", 0xd2808000, 0xffe08080, RD_C0, 0, AL }, ++{"vcmov.t", "?d2d,?s2s,?e", 0 , 0x000000eb, INSN_MACRO, 0, AL }, ++{"vcmovt.t", "?d2d,?s2s,?e", 0xd2a08000, 0xfff88080, RD_C0, 0, AL }, ++{"vcmovf.t", "?d2d,?s2s,?e", 0xd2a88000, 0xfff88080, RD_C0, 0, AL }, ++{"vmmul.t", "?v6z,?s6y,?t6x", 0xf0008000, 0xff808080, RD_C0, 0, AL }, ++{"vtfm3.t", "?v2z,?s6y,?t2x", 0xf1008000, 0xff808080, RD_C0, 0, AL }, ++{"vhtfm3.t", "?v2z,?s6y,?t2x", 0xf1000080, 0xff808080, RD_C0, 0, AL }, ++{"vmscl.t", "?x6z,?s6y,?t0x", 0xf2008000, 0xff808080, RD_C0, 0, AL }, ++{"vmmov.t", "?x6z,?s6y", 0xf3808000, 0xffff8080, RD_C0, 0, AL }, ++{"vmidt.t", "?d6z", 0xf3838000, 0xffffff80, RD_C0, 0, AL }, ++{"vmzero.t", "?d6z", 0xf3868000, 0xffffff80, RD_C0, 0, AL }, ++{"vmone.t", "?d6z", 0xf3878000, 0xffffff80, RD_C0, 0, AL }, ++{"vrot.t", "?x2z,?s0y,?w", 0xf3a08000, 0xffe08080, RD_C0, 0, AL }, ++{"vcrsp.t", "?d2z,?s2y,?t2x", 0xf2808000, 0xff808080, RD_C0, 0, AL }, ++{"vadd.p", "?d1d,?s1s,?t1t", 0x60000080, 0xff808080, RD_C0, 0, AL }, ++{"vsub.p", "?d1d,?s1s,?t1t", 0x60800080, 0xff808080, RD_C0, 0, AL }, ++{"vdiv.p", "?x1z,?s1y,?t1x", 0x63800080, 0xff808080, RD_C0, 0, AL }, ++{"vmul.p", "?d1d,?s1s,?t1t", 0x64000080, 0xff808080, RD_C0, 0, AL }, ++{"vdot.p", "?d0d,?s1s,?t1t", 0x64800080, 0xff808080, RD_C0, 0, AL }, ++{"vscl.p", "?d1d,?s1s,?t0x", 0x65000080, 0xff808080, RD_C0, 0, AL }, ++{"vhdp.p", "?d0d,?s1y,?t1t", 0x66000080, 0xff808080, RD_C0, 0, AL }, ++{"vdet.p", "?d0d,?s1s,?t1x", 0x67000080, 0xff808080, RD_C0, 0, AL }, ++{"vcmp.p", "?f2,?s1s,?t1t", 0x6c000080, 0xff8080f0, RD_C0, 0, AL }, ++{"vcmp.p", "?f1,?s1s", 0x6c000080, 0xffff80f0, RD_C0, 0, AL }, ++{"vcmp.p", "?f0", 0x6c000080, 0xfffffff0, RD_C0, 0, AL }, ++{"vmin.p", "?d1d,?s1s,?t1t", 0x6d000080, 0xff808080, RD_C0, 0, AL }, ++{"vmax.p", "?d1d,?s1s,?t1t", 0x6d800080, 0xff808080, RD_C0, 0, AL }, ++{"vsgn.p", "?d1d,?s1s", 0xd04a0080, 0xffff8080, RD_C0, 0, AL }, ++{"vcst.p", "?d1d,?a", 0xd0600080, 0xffe0ff80, RD_C0, 0, AL }, ++{"vscmp.p", "?d1d,?s1s,?t1t", 0x6e800080, 0xff808080, RD_C0, 0, AL }, ++{"vsge.p", "?d1d,?s1s,?t1t", 0x6f000080, 0xff808080, RD_C0, 0, AL }, ++{"vslt.p", "?d1d,?s1s,?t1t", 0x6f800080, 0xff808080, RD_C0, 0, AL }, ++{"vus2i.p", "?d3m,?s1y", 0xd03a0080, 0xffff8080, RD_C0, 0, AL }, ++{"vs2i.p", "?d3m,?s1y", 0xd03b0080, 0xffff8080, RD_C0, 0, AL }, ++{"vi2us.p", "?d0m,?s1w", 0xd03e0080, 0xffff8080, RD_C0, 0, AL }, ++{"vi2s.p", "?d0m,?s1w", 0xd03f0080, 0xffff8080, RD_C0, 0, AL }, ++{"vmov.p", "?d1d,?s1s", 0xd0000080, 0xffff8080, RD_C0, 0, AL }, ++{"vabs.p", "?d1d,?s1w", 0xd0010080, 0xffff8080, RD_C0, 0, AL }, ++{"vneg.p", "?d1d,?s1w", 0xd0020080, 0xffff8080, RD_C0, 0, AL }, ++{"vidt.p", "?d1d", 0xd0030080, 0xffffff80, RD_C0, 0, AL }, ++{"vsat0.p", "?d1z,?s1s", 0xd0040080, 0xffff8080, RD_C0, 0, AL }, ++{"vsat1.p", "?d1z,?s1s", 0xd0050080, 0xffff8080, RD_C0, 0, AL }, ++{"vzero.p", "?d1d", 0xd0060080, 0xffffff80, RD_C0, 0, AL }, ++{"vone.p", "?d1d", 0xd0070080, 0xffffff80, RD_C0, 0, AL }, ++{"vrcp.p", "?x1z,?s1y", 0xd0100080, 0xffff8080, RD_C0, 0, AL }, ++{"vrsq.p", "?x1z,?s1y", 0xd0110080, 0xffff8080, RD_C0, 0, AL }, ++{"vsin.p", "?x1z,?s1y", 0xd0120080, 0xffff8080, RD_C0, 0, AL }, ++{"vcos.p", "?x1z,?s1y", 0xd0130080, 0xffff8080, RD_C0, 0, AL }, ++{"vexp2.p", "?x1z,?s1y", 0xd0140080, 0xffff8080, RD_C0, 0, AL }, ++{"vlog2.p", "?x1z,?s1y", 0xd0150080, 0xffff8080, RD_C0, 0, AL }, ++{"vsqrt.p", "?x1z,?s1y", 0xd0160080, 0xffff8080, RD_C0, 0, AL }, ++{"vasin.p", "?x1z,?s1y", 0xd0170080, 0xffff8080, RD_C0, 0, AL }, ++{"vnrcp.p", "?x1z,?s1y", 0xd0180080, 0xffff8080, RD_C0, 0, AL }, ++{"vnsin.p", "?x1z,?s1y", 0xd01a0080, 0xffff8080, RD_C0, 0, AL }, ++{"vrexp2.p", "?x1z,?s1y", 0xd01c0080, 0xffff8080, RD_C0, 0, AL }, ++{"vrndi.p", "?d1z", 0xd0210080, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf1.p", "?d1z", 0xd0220080, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf2.p", "?d1z", 0xd0230080, 0xffffff80, RD_C0, 0, AL }, ++{"vf2h.p", "?d0m,?s1s", 0xd0320080, 0xffff8080, RD_C0, 0, AL }, ++{"vh2f.p", "?d3d,?s1y", 0xd0330080, 0xffff8080, RD_C0, 0, AL }, ++{"vbfy1.p", "?d1d,?s1s", 0xd0420080, 0xffff8080, RD_C0, 0, AL }, ++{"vocp.p", "?d1d,?s1y", 0xd0440080, 0xffff8080, RD_C0, 0, AL }, ++{"vsocp.p", "?d3z,?s1y", 0xd0450080, 0xffff8080, RD_C0, 0, AL }, ++{"vfad.p", "?d0d,?s1s", 0xd0460080, 0xffff8080, RD_C0, 0, AL }, ++{"vavg.p", "?d0d,?s1s", 0xd0470080, 0xffff8080, RD_C0, 0, AL }, ++{"vf2in.p", "?d1m,?s1s,?b", 0xd2000080, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iz.p", "?d1m,?s1s,?b", 0xd2200080, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iu.p", "?d1m,?s1s,?b", 0xd2400080, 0xffe08080, RD_C0, 0, AL }, ++{"vf2id.p", "?d1m,?s1s,?b", 0xd2600080, 0xffe08080, RD_C0, 0, AL }, ++{"vi2f.p", "?d1d,?s1w,?b", 0xd2800080, 0xffe08080, RD_C0, 0, AL }, ++{"vcmov.p", "?d1d,?s1s,?e", 0 , 0x000000e8, INSN_MACRO, 0, AL }, ++{"vcmovt.p", "?d1d,?s1s,?e", 0xd2a00080, 0xfff88080, RD_C0, 0, AL }, ++{"vcmovf.p", "?d1d,?s1s,?e", 0xd2a80080, 0xfff88080, RD_C0, 0, AL }, ++{"vmmul.p", "?v5z,?s5y,?t5x", 0xf0000080, 0xff808080, RD_C0, 0, AL }, ++{"vtfm2.p", "?v1z,?s5y,?t1x", 0xf0800080, 0xff808080, RD_C0, 0, AL }, ++{"vhtfm2.p", "?v1z,?s5y,?t1x", 0xf0800000, 0xff808080, RD_C0, 0, AL }, ++{"vmscl.p", "?x5z,?s5y,?t0x", 0xf2000080, 0xff808080, RD_C0, 0, AL }, ++{"vmmov.p", "?x5z,?s5y", 0xf3800080, 0xffff8080, RD_C0, 0, AL }, ++{"vmidt.p", "?d5z", 0xf3830080, 0xffffff80, RD_C0, 0, AL }, ++{"vmzero.p", "?d5z", 0xf3860080, 0xffffff80, RD_C0, 0, AL }, ++{"vmone.p", "?d5z", 0xf3870080, 0xffffff80, RD_C0, 0, AL }, ++{"vrot.p", "?x1z,?s0y,?w", 0xf3a00080, 0xffe08080, RD_C0, 0, AL }, ++{"vadd.s", "?d0d,?s0s,?t0t", 0x60000000, 0xff808080, RD_C0, 0, AL }, ++{"vsub.s", "?d0d,?s0s,?t0t", 0x60800000, 0xff808080, RD_C0, 0, AL }, ++{"vdiv.s", "?x0d,?s0s,?t0t", 0x63800000, 0xff808080, RD_C0, 0, AL }, ++{"vmul.s", "?d0d,?s0s,?t0t", 0x64000000, 0xff808080, RD_C0, 0, AL }, ++{"vcmp.s", "?f2,?s0s,?t0t", 0x6c000000, 0xff8080f0, RD_C0, 0, AL }, ++{"vcmp.s", "?f1,?s0s", 0x6c000000, 0xffff80f0, RD_C0, 0, AL }, ++{"vcmp.s", "?f0", 0x6c000000, 0xfffffff0, RD_C0, 0, AL }, ++{"vmin.s", "?d0d,?s0s,?t0t", 0x6d000000, 0xff808080, RD_C0, 0, AL }, ++{"vmax.s", "?d0d,?s0s,?t0t", 0x6d800000, 0xff808080, RD_C0, 0, AL }, ++{"vsgn.s", "?d0d,?s0s", 0xd04a0000, 0xffff8080, RD_C0, 0, AL }, ++{"vcst.s", "?d0d,?a", 0xd0600000, 0xffe0ff80, RD_C0, 0, AL }, ++{"vscmp.s", "?d0d,?s0s,?t0t", 0x6e800000, 0xff808080, RD_C0, 0, AL }, ++{"vsge.s", "?d0d,?s0s,?t0t", 0x6f000000, 0xff808080, RD_C0, 0, AL }, ++{"vslt.s", "?d0d,?s0s,?t0t", 0x6f800000, 0xff808080, RD_C0, 0, AL }, ++{"vus2i.s", "?d1m,?s0y", 0xd03a0000, 0xffff8080, RD_C0, 0, AL }, ++{"vs2i.s", "?d1m,?s0y", 0xd03b0000, 0xffff8080, RD_C0, 0, AL }, ++{"vmov.s", "?d0d,?s0s", 0xd0000000, 0xffff8080, RD_C0, 0, AL }, ++{"vabs.s", "?d0d,?s0w", 0xd0010000, 0xffff8080, RD_C0, 0, AL }, ++{"vneg.s", "?d0d,?s0w", 0xd0020000, 0xffff8080, RD_C0, 0, AL }, ++{"vsat0.s", "?d0z,?s0s", 0xd0040000, 0xffff8080, RD_C0, 0, AL }, ++{"vsat1.s", "?d0z,?s0s", 0xd0050000, 0xffff8080, RD_C0, 0, AL }, ++{"vzero.s", "?d0d", 0xd0060000, 0xffffff80, RD_C0, 0, AL }, ++{"vone.s", "?d0d", 0xd0070000, 0xffffff80, RD_C0, 0, AL }, ++{"vrcp.s", "?x0d,?s0s", 0xd0100000, 0xffff8080, RD_C0, 0, AL }, ++{"vrsq.s", "?x0d,?s0s", 0xd0110000, 0xffff8080, RD_C0, 0, AL }, ++{"vsin.s", "?x0d,?s0s", 0xd0120000, 0xffff8080, RD_C0, 0, AL }, ++{"vcos.s", "?x0d,?s0s", 0xd0130000, 0xffff8080, RD_C0, 0, AL }, ++{"vexp2.s", "?x0d,?s0s", 0xd0140000, 0xffff8080, RD_C0, 0, AL }, ++{"vlog2.s", "?x0d,?s0s", 0xd0150000, 0xffff8080, RD_C0, 0, AL }, ++{"vsqrt.s", "?x0d,?s0s", 0xd0160000, 0xffff8080, RD_C0, 0, AL }, ++{"vasin.s", "?x0d,?s0s", 0xd0170000, 0xffff8080, RD_C0, 0, AL }, ++{"vnrcp.s", "?x0d,?s0y", 0xd0180000, 0xffff8080, RD_C0, 0, AL }, ++{"vnsin.s", "?x0d,?s0y", 0xd01a0000, 0xffff8080, RD_C0, 0, AL }, ++{"vrexp2.s", "?x0d,?s0y", 0xd01c0000, 0xffff8080, RD_C0, 0, AL }, ++{"vrnds.s", "?s0y", 0xd0200000, 0xffff80ff, RD_C0, 0, AL }, ++{"vrndi.s", "?d0d", 0xd0210000, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf1.s", "?d0d", 0xd0220000, 0xffffff80, RD_C0, 0, AL }, ++{"vrndf2.s", "?d0d", 0xd0230000, 0xffffff80, RD_C0, 0, AL }, ++{"vh2f.s", "?d1d,?s0y", 0xd0330000, 0xffff8080, RD_C0, 0, AL }, ++{"vsbz.s", "?d0d,?s0s", 0xd0360000, 0xffff8080, RD_C0, 0, AL }, ++{"vsbn.s", "?d0d,?s0s,?t0t", 0x61000000, 0xff808080, RD_C0, 0, AL }, ++{"vlgb.s", "?d0d,?s0s", 0xd0370000, 0xffff8080, RD_C0, 0, AL }, ++{"vocp.s", "?d0d,?s0y", 0xd0440000, 0xffff8080, RD_C0, 0, AL }, ++{"vsocp.s", "?d1z,?s0y", 0xd0450000, 0xffff8080, RD_C0, 0, AL }, ++{"vf2in.s", "?d0m,?s0s,?b", 0xd2000000, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iz.s", "?d0m,?s0s,?b", 0xd2200000, 0xffe08080, RD_C0, 0, AL }, ++{"vf2iu.s", "?d0m,?s0s,?b", 0xd2400000, 0xffe08080, RD_C0, 0, AL }, ++{"vf2id.s", "?d0m,?s0s,?b", 0xd2600000, 0xffe08080, RD_C0, 0, AL }, ++{"vi2f.s", "?d0d,?s0w,?b", 0xd2800000, 0xffe08080, RD_C0, 0, AL }, ++{"vcmov.s", "?d0d,?s0s,?e", 0 , 0x000000ea, INSN_MACRO, 0, AL }, ++{"vcmovt.s", "?d0d,?s0s,?e", 0xd2a00000, 0xfff88080, RD_C0, 0, AL }, ++{"vcmovf.s", "?d0d,?s0s,?e", 0xd2a80000, 0xfff88080, RD_C0, 0, AL }, ++{"vwbn.s", "?d0d,?s0s,?i", 0xd3000000, 0xff008080, RD_C0, 0, AL }, ++{"vpfxs", "?0,?1,?2,?3", 0xdc000000, 0xff000000, RD_C0, 0, AL }, ++{"vpfxt", "?0,?1,?2,?3", 0xdd000000, 0xff000000, RD_C0, 0, AL }, ++{"vpfxd", "?4,?5,?6,?7", 0xde000000, 0xff000000, RD_C0, 0, AL }, ++{"viim.s", "?t0d,j", 0xdf000000, 0xff800000, RD_C0, 0, AL }, ++{"vfim.s", "?t0d,?u", 0xdf800000, 0xff800000, RD_C0, 0, AL }, ++{"vnop", "", 0xffff0000, 0xffffffff, RD_C0, 0, AL }, ++{"vflush", "", 0xffff040d, 0xffffffff, RD_C0, 0, AL }, ++{"vsync", "", 0xffff0320, 0xffffffff, RD_C0, 0, AL }, ++{"vsync", "i", 0xffff0000, 0xffff0000, RD_C0, 0, AL }, ++ + /* Coprocessor 2 move/branch operations overlap with VR5400 .ob format + instructions so they are here for the latters to take precedence. */ + {"bc2f", "p", 0x49000000, 0xffff0000, CBD|RD_CC, 0, I1 }, +@@ -1197,6 +1507,32 @@ + {"mtc2", "t,G", 0x48800000, 0xffe007ff, COD|RD_t|WR_C2|WR_CC, 0, I1 }, + {"mtc2", "t,G,H", 0x48800000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I32 }, + {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33 }, ++ ++/* Coprocessor 2 load/store operations overlap with the Allegrex VFPU ++ instructions so they are here for the latters to take precedence. */ ++/* Coprocessor 1 ldc1 and sdc1 also overlap with the VFPU. */ ++{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, ++{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, ++{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, ++{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 }, ++{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */ ++{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 }, ++{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 }, ++{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 }, ++{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 }, ++{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 }, ++{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 }, ++{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, ++{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, ++{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, ++{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 }, ++{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 }, ++{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 }, ++{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 }, ++{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 }, ++{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 }, ++{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 }, ++{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 }, + + /* No hazard protection on coprocessor instructions--they shouldn't + change the state of the processor and if they do it's up to the +diff -Nbaur binutils-2.16.1/opcodes/ppc-dis.c binutils-2.16.1-new/opcodes/ppc-dis.c --- binutils-2.16.1/opcodes/ppc-dis.c Tue Mar 22 15:31:19 2005 -+++ binutils-2.16.1-new/opcodes/ppc-dis.c Mon Jun 20 00:14:07 2005 ++++ binutils-2.16.1-new/opcodes/ppc-dis.c Wed Jul 6 01:56:25 2005 @@ -64,6 +64,13 @@ && strstr (info->disassembler_options, "efs") != NULL) dialect |= PPC_OPCODE_EFS; @@ -189,9 +1943,9 @@ diff -Nbaur --exclude=*.info* binutils-2.16.1/opcodes/ppc-dis.c binutils-2.16.1- fprintf (stream, " 64 Allow disassembly of 64-bit instructions\n"); + fprintf (stream, " gekko Disassemble the Gamecube Gekko instructions\n"); } -diff -Nbaur --exclude=*.info* binutils-2.16.1/opcodes/ppc-opc.c binutils-2.16.1-new/opcodes/ppc-opc.c +diff -Nbaur binutils-2.16.1/opcodes/ppc-opc.c binutils-2.16.1-new/opcodes/ppc-opc.c --- binutils-2.16.1/opcodes/ppc-opc.c Tue Apr 19 18:09:56 2005 -+++ binutils-2.16.1-new/opcodes/ppc-opc.c Mon Jun 20 00:14:07 2005 ++++ binutils-2.16.1-new/opcodes/ppc-opc.c Wed Jul 6 01:56:25 2005 @@ -93,6 +93,13 @@ static unsigned long insert_ev8 (unsigned long, long, int, const char **); static long extract_ev8 (unsigned long, int, int *); diff --git a/patches/devkit-gcc-3.4.4.patch b/patches/devkit-gcc-3.4.4.patch index 6ffa590..6c64323 100644 --- a/patches/devkit-gcc-3.4.4.patch +++ b/patches/devkit-gcc-3.4.4.patch @@ -1,6 +1,6 @@ -diff -NBaur gcc-3.4.4/config.sub gcc-3.4.4-new/config.sub +diff -Nbaur gcc-3.4.4/config.sub gcc-3.4.4-new/config.sub --- gcc-3.4.4/config.sub Sun Feb 22 14:44:23 2004 -+++ gcc-3.4.4-new/config.sub Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/config.sub Wed Jul 6 01:52:28 2005 @@ -219,6 +219,10 @@ basic_machine=m68k-atari os=-mint @@ -12,9 +12,36 @@ diff -NBaur gcc-3.4.4/config.sub gcc-3.4.4-new/config.sub esac # Decode aliases for certain CPU-COMPANY combinations. -diff -NBaur gcc-3.4.4/gcc/Makefile.in gcc-3.4.4-new/gcc/Makefile.in +@@ -253,6 +257,7 @@ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ ++ | mipsallegrex | mipsallegrexel \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ +@@ -326,6 +331,7 @@ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ ++ | mipsallegrex-* | mipsallegrexel-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ +@@ -648,6 +654,10 @@ + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint ++ ;; ++ psp) ++ basic_machine=mipsallegrexel-psp ++ os=-elf + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +diff -Nbaur gcc-3.4.4/gcc/Makefile.in gcc-3.4.4-new/gcc/Makefile.in --- gcc-3.4.4/gcc/Makefile.in Thu Feb 24 09:26:57 2005 -+++ gcc-3.4.4-new/gcc/Makefile.in Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/gcc/Makefile.in Wed Jul 6 01:50:35 2005 @@ -138,7 +138,7 @@ # TCFLAGS is used for compilations with the GCC just built. XCFLAGS = @@ -32,9 +59,9 @@ diff -NBaur gcc-3.4.4/gcc/Makefile.in gcc-3.4.4-new/gcc/Makefile.in includedir = $(prefix)/include # where the info files go infodir = @infodir@ -diff -NBaur gcc-3.4.4/gcc/c-format.c gcc-3.4.4-new/gcc/c-format.c +diff -Nbaur gcc-3.4.4/gcc/c-format.c gcc-3.4.4-new/gcc/c-format.c --- gcc-3.4.4/gcc/c-format.c Sun May 1 11:38:56 2005 -+++ gcc-3.4.4-new/gcc/c-format.c Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/gcc/c-format.c Wed Jul 6 01:50:35 2005 @@ -31,6 +31,7 @@ #include "diagnostic.h" #include "langhooks.h" @@ -138,9 +165,9 @@ diff -NBaur gcc-3.4.4/gcc/c-format.c gcc-3.4.4-new/gcc/c-format.c length_chars = fli->name; length_chars_val = fli->index; length_chars_std = fli->std; -diff -NBaur gcc-3.4.4/gcc/collect2.c gcc-3.4.4-new/gcc/collect2.c +diff -Nbaur gcc-3.4.4/gcc/collect2.c gcc-3.4.4-new/gcc/collect2.c --- gcc-3.4.4/gcc/collect2.c Mon Jan 10 15:25:23 2005 -+++ gcc-3.4.4-new/gcc/collect2.c Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/gcc/collect2.c Wed Jul 6 01:50:36 2005 @@ -30,24 +30,13 @@ #include "system.h" #include "coretypes.h" @@ -694,9 +721,9 @@ diff -NBaur gcc-3.4.4/gcc/collect2.c gcc-3.4.4-new/gcc/collect2.c #endif /* OBJECT_FORMAT_NONE */ -diff -NBaur gcc-3.4.4/gcc/config/arm/arm.md gcc-3.4.4-new/gcc/config/arm/arm.md +diff -Nbaur gcc-3.4.4/gcc/config/arm/arm.md gcc-3.4.4-new/gcc/config/arm/arm.md --- gcc-3.4.4/gcc/config/arm/arm.md Tue Jan 25 12:50:34 2005 -+++ gcc-3.4.4-new/gcc/config/arm/arm.md Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/gcc/config/arm/arm.md Wed Jul 6 01:50:36 2005 @@ -7205,6 +7205,12 @@ { if (TARGET_CALLER_INTERWORKING) @@ -723,9 +750,9 @@ diff -NBaur gcc-3.4.4/gcc/config/arm/arm.md gcc-3.4.4-new/gcc/config/arm/arm.md else return \"bl\\t%__call_via_%1\"; }" -diff -NBaur gcc-3.4.4/gcc/config/arm/t-arm-elf gcc-3.4.4-new/gcc/config/arm/t-arm-elf +diff -Nbaur gcc-3.4.4/gcc/config/arm/t-arm-elf gcc-3.4.4-new/gcc/config/arm/t-arm-elf --- gcc-3.4.4/gcc/config/arm/t-arm-elf Tue Sep 30 11:21:41 2003 -+++ gcc-3.4.4-new/gcc/config/arm/t-arm-elf Tue Jun 14 03:44:21 2005 ++++ gcc-3.4.4-new/gcc/config/arm/t-arm-elf Wed Jul 6 02:17:23 2005 @@ -26,16 +26,16 @@ # MULTILIB_DIRNAMES += 32bit 26bit # MULTILIB_EXCEPTIONS += *mthumb/*mapcs-26* @@ -743,9 +770,9 @@ diff -NBaur gcc-3.4.4/gcc/config/arm/t-arm-elf gcc-3.4.4-new/gcc/config/arm/t-ar -# MULTILIB_OPTIONS += mcpu=arm7 -# MULTILIB_DIRNAMES += nofmult -# MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=arm7* -+MULTILIB_OPTIONS += mcpu=arm7 -+MULTILIB_DIRNAMES += nofmult -+MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=arm7* ++#MULTILIB_OPTIONS += mcpu=arm7 ++#MULTILIB_DIRNAMES += nofmult ++#MULTILIB_EXCEPTIONS += *mthumb*/*mcpu=arm7* # # Note: the multilib_exceptions matches both -mthumb and # # -mthumb-interwork # # @@ -786,9 +813,9 @@ diff -NBaur gcc-3.4.4/gcc/config/arm/t-arm-elf gcc-3.4.4-new/gcc/config/arm/t-ar EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o -diff -NBaur gcc-3.4.4/gcc/config/i386/cygming.h gcc-3.4.4-new/gcc/config/i386/cygming.h +diff -Nbaur gcc-3.4.4/gcc/config/i386/cygming.h gcc-3.4.4-new/gcc/config/i386/cygming.h --- gcc-3.4.4/gcc/config/i386/cygming.h Tue Jun 8 07:30:13 2004 -+++ gcc-3.4.4-new/gcc/config/i386/cygming.h Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/gcc/config/i386/cygming.h Wed Jul 6 01:50:36 2005 @@ -251,7 +251,7 @@ unit may not be bound to undefined symbols in another translation unit without user intervention. For instance, under Microsoft Windows @@ -807,9 +834,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/cygming.h gcc-3.4.4-new/gcc/config/i386/cy /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C -diff -NBaur gcc-3.4.4/gcc/config/i386/i386.c gcc-3.4.4-new/gcc/config/i386/i386.c +diff -Nbaur gcc-3.4.4/gcc/config/i386/i386.c gcc-3.4.4-new/gcc/config/i386/i386.c --- gcc-3.4.4/gcc/config/i386/i386.c Wed Mar 16 15:23:40 2005 -+++ gcc-3.4.4-new/gcc/config/i386/i386.c Tue Jun 14 03:43:49 2005 ++++ gcc-3.4.4-new/gcc/config/i386/i386.c Wed Jul 6 01:50:36 2005 @@ -5284,7 +5284,7 @@ GEN_INT (-allocate), -1); else @@ -819,9 +846,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/i386.c gcc-3.4.4-new/gcc/config/i386/i386. rtx eax = gen_rtx_REG (SImode, 0); bool eax_live = ix86_eax_live_at_start_p (); -diff -NBaur gcc-3.4.4/gcc/config/i386/mingw32-1.c gcc-3.4.4-new/gcc/config/i386/mingw32-1.c +diff -Nbaur gcc-3.4.4/gcc/config/i386/mingw32-1.c gcc-3.4.4-new/gcc/config/i386/mingw32-1.c --- gcc-3.4.4/gcc/config/i386/mingw32-1.c Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/gcc/config/i386/mingw32-1.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/mingw32-1.c Wed Jul 6 01:50:36 2005 @@ -0,0 +1,41 @@ +/* This replaces the use of stat and struct stat.st_ino to determine if + files are different in gcc.c (do_spec_1) handling of --save-temps @@ -864,9 +891,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/mingw32-1.c gcc-3.4.4-new/gcc/config/i386/ + GetFullPathName (dst, MAX_PATH, fullpath_dst, &pfilename); + return (lstrcmpi (fullpath_src, fullpath_dst)); +} -diff -NBaur gcc-3.4.4/gcc/config/i386/mingw32.h gcc-3.4.4-new/gcc/config/i386/mingw32.h +diff -Nbaur gcc-3.4.4/gcc/config/i386/mingw32.h gcc-3.4.4-new/gcc/config/i386/mingw32.h --- gcc-3.4.4/gcc/config/i386/mingw32.h Fri Sep 26 04:46:06 2003 -+++ gcc-3.4.4-new/gcc/config/i386/mingw32.h Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/mingw32.h Wed Jul 6 01:50:36 2005 @@ -67,7 +67,11 @@ #undef STARTFILE_SPEC @@ -880,9 +907,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/mingw32.h gcc-3.4.4-new/gcc/config/i386/mi /* An additional prefix to try after the standard prefixes. */ #undef MD_STARTFILE_PREFIX -diff -NBaur gcc-3.4.4/gcc/config/i386/t-cygming gcc-3.4.4-new/gcc/config/i386/t-cygming +diff -Nbaur gcc-3.4.4/gcc/config/i386/t-cygming gcc-3.4.4-new/gcc/config/i386/t-cygming --- gcc-3.4.4/gcc/config/i386/t-cygming Tue Sep 23 19:55:59 2003 -+++ gcc-3.4.4-new/gcc/config/i386/t-cygming Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/t-cygming Wed Jul 6 01:50:36 2005 @@ -10,6 +10,8 @@ # first. LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include @@ -892,9 +919,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/t-cygming gcc-3.4.4-new/gcc/config/i386/t- winnt.o: $(srcdir)/config/i386/winnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) -diff -NBaur gcc-3.4.4/gcc/config/i386/t-mingw32 gcc-3.4.4-new/gcc/config/i386/t-mingw32 +diff -Nbaur gcc-3.4.4/gcc/config/i386/t-mingw32 gcc-3.4.4-new/gcc/config/i386/t-mingw32 --- gcc-3.4.4/gcc/config/i386/t-mingw32 Tue Jun 11 06:25:44 2002 -+++ gcc-3.4.4-new/gcc/config/i386/t-mingw32 Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/t-mingw32 Wed Jul 6 01:50:36 2005 @@ -1,7 +1,8 @@ # # collect2 doesn't work for i386-mingw32* yet. @@ -906,9 +933,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/t-mingw32 gcc-3.4.4-new/gcc/config/i386/t- -LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c +LIB2FUNCS_EXTRA += $(srcdir)/config/i386/gthr-win32.c + -diff -NBaur gcc-3.4.4/gcc/config/i386/w32-shared-ptr.c gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.c +diff -Nbaur gcc-3.4.4/gcc/config/i386/w32-shared-ptr.c gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.c --- gcc-3.4.4/gcc/config/i386/w32-shared-ptr.c Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.c Wed Jul 6 01:50:36 2005 @@ -0,0 +1,244 @@ +/* + * w32-shared-ptr.c @@ -1154,9 +1181,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/w32-shared-ptr.c gcc-3.4.4-new/gcc/config/ + abort (); +} +#endif -diff -NBaur gcc-3.4.4/gcc/config/i386/w32-shared-ptr.h gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.h +diff -Nbaur gcc-3.4.4/gcc/config/i386/w32-shared-ptr.h gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.h --- gcc-3.4.4/gcc/config/i386/w32-shared-ptr.h Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.h Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/w32-shared-ptr.h Wed Jul 6 01:50:36 2005 @@ -0,0 +1,65 @@ +/* + * w32-shared-ptr.h @@ -1223,9 +1250,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/w32-shared-ptr.h gcc-3.4.4-new/gcc/config/ +#endif + +#endif -diff -NBaur gcc-3.4.4/gcc/config/i386/winnt.c gcc-3.4.4-new/gcc/config/i386/winnt.c +diff -Nbaur gcc-3.4.4/gcc/config/i386/winnt.c gcc-3.4.4-new/gcc/config/i386/winnt.c --- gcc-3.4.4/gcc/config/i386/winnt.c Tue Mar 23 23:18:31 2004 -+++ gcc-3.4.4-new/gcc/config/i386/winnt.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/winnt.c Wed Jul 6 01:50:37 2005 @@ -262,7 +262,8 @@ } @@ -1292,9 +1319,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/winnt.c gcc-3.4.4-new/gcc/config/i386/winn for (p = extern_head; p != NULL; p = p->next) { tree decl; -diff -NBaur gcc-3.4.4/gcc/config/i386/x-mingw32 gcc-3.4.4-new/gcc/config/i386/x-mingw32 +diff -Nbaur gcc-3.4.4/gcc/config/i386/x-mingw32 gcc-3.4.4-new/gcc/config/i386/x-mingw32 --- gcc-3.4.4/gcc/config/i386/x-mingw32 Wed May 28 22:06:23 2003 -+++ gcc-3.4.4-new/gcc/config/i386/x-mingw32 Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/x-mingw32 Wed Jul 6 01:50:37 2005 @@ -2,3 +2,26 @@ # Make local_includedir relative to EXEC_PREFIX # @@ -1322,9 +1349,9 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/x-mingw32 gcc-3.4.4-new/gcc/config/i386/x- + $(srcdir)/config/i386/xm-mingw32.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/mingw32-1.c -diff -NBaur gcc-3.4.4/gcc/config/i386/xm-mingw32.h gcc-3.4.4-new/gcc/config/i386/xm-mingw32.h +diff -Nbaur gcc-3.4.4/gcc/config/i386/xm-mingw32.h gcc-3.4.4-new/gcc/config/i386/xm-mingw32.h --- gcc-3.4.4/gcc/config/i386/xm-mingw32.h Sat Jan 31 06:18:23 2004 -+++ gcc-3.4.4-new/gcc/config/i386/xm-mingw32.h Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/i386/xm-mingw32.h Wed Jul 6 01:50:37 2005 @@ -27,3 +27,18 @@ /* This is the name of the null device on windows. */ @@ -1344,9 +1371,144 @@ diff -NBaur gcc-3.4.4/gcc/config/i386/xm-mingw32.h gcc-3.4.4-new/gcc/config/i386 +extern int +w32_file_id_cmp (const char *, const char *); +#define HOST_FILE_ID_CMP(SRC,DST) w32_file_id_cmp (SRC, DST) -diff -NBaur gcc-3.4.4/gcc/config/rs6000/sysv4.h gcc-3.4.4-new/gcc/config/rs6000/sysv4.h +diff -Nbaur gcc-3.4.4/gcc/config/mips/mips.c gcc-3.4.4-new/gcc/config/mips/mips.c +--- gcc-3.4.4/gcc/config/mips/mips.c Sun May 8 13:06:23 2005 ++++ gcc-3.4.4-new/gcc/config/mips/mips.c Wed Jul 6 01:50:54 2005 +@@ -693,6 +693,7 @@ + + /* MIPS II */ + { "r6000", PROCESSOR_R6000, 2 }, ++ { "allegrex", PROCESSOR_ALLEGREX, 2 }, + + /* MIPS III */ + { "r4000", PROCESSOR_R4000, 3 }, +diff -Nbaur gcc-3.4.4/gcc/config/mips/mips.h gcc-3.4.4-new/gcc/config/mips/mips.h +--- gcc-3.4.4/gcc/config/mips/mips.h Thu Jul 15 01:42:47 2004 ++++ gcc-3.4.4-new/gcc/config/mips/mips.h Wed Jul 6 01:53:59 2005 +@@ -67,7 +67,8 @@ + PROCESSOR_R8000, + PROCESSOR_R9000, + PROCESSOR_SB1, +- PROCESSOR_SR71000 ++ PROCESSOR_SR71000, ++ PROCESSOR_ALLEGREX + }; + + /* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32), +@@ -333,6 +334,7 @@ + #define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000) + #define TARGET_SB1 (mips_arch == PROCESSOR_SB1) + #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000) ++#define TARGET_ALLEGREX (mips_arch == PROCESSOR_ALLEGREX) + + /* Scheduling target defines. */ + #define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000) +@@ -345,6 +347,7 @@ + #define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000) + #define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000) + #define TUNE_SB1 (mips_tune == PROCESSOR_SB1) ++#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX) + #define TUNE_SR71K (mips_tune == PROCESSOR_SR71000) + + #define TARGET_NEWABI (mips_abi == ABI_N32 || mips_abi == ABI_64) +@@ -847,7 +850,8 @@ + + /* ISA has conditional trap instructions. */ + #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ +- && !TARGET_MIPS16) ++ && !TARGET_MIPS16 \ ++ && !TARGET_ALLEGREX) + + /* ISA has integer multiply-accumulate instructions, madd and msub. */ + #define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \ +@@ -865,6 +869,7 @@ + #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ + || ISA_MIPS32R2 \ + || ISA_MIPS64 \ ++ || TARGET_ALLEGREX \ + ) && !TARGET_MIPS16) + + /* ISA has double-word count leading zeroes/ones instruction (not +@@ -906,6 +911,7 @@ + || TARGET_MIPS5400 \ + || TARGET_MIPS5500 \ + || TARGET_SR71K \ ++ || TARGET_ALLEGREX \ + )) + + /* ISA has 64-bit rotate right instruction. */ +@@ -939,6 +945,7 @@ + /* ISA includes the MIPS32r2 seb and seh instructions. */ + #define ISA_HAS_SEB_SEH (!TARGET_MIPS16 \ + && (ISA_MIPS32R2 \ ++ || TARGET_ALLEGREX \ + )) + + /* True if the result of a load is not available to the next instruction. +diff -Nbaur gcc-3.4.4/gcc/config/mips/psp.h gcc-3.4.4-new/gcc/config/mips/psp.h +--- gcc-3.4.4/gcc/config/mips/psp.h Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.4-new/gcc/config/mips/psp.h Wed Jul 6 01:50:54 2005 +@@ -0,0 +1,24 @@ ++/* Support for Sony's Playstation Portable (PSP). ++ Copyright (C) 2005 Free Software Foundation, Inc. ++ Contributed by Marcus R. Brown ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++/* Override the startfile spec to include crt0.o. */ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s" +diff -Nbaur gcc-3.4.4/gcc/config/mips/t-allegrex gcc-3.4.4-new/gcc/config/mips/t-allegrex +--- gcc-3.4.4/gcc/config/mips/t-allegrex Thu Jan 1 00:00:00 1970 ++++ gcc-3.4.4-new/gcc/config/mips/t-allegrex Wed Jul 6 01:50:54 2005 +@@ -0,0 +1,29 @@ ++# Suppress building libgcc1.a, since the MIPS compiler port is complete ++# and does not need anything from libgcc1.a. ++LIBGCC1 = ++CROSS_LIBGCC1 = ++ ++EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o ++# Don't let CTOR_LIST end up in sdata section. ++CRTSTUFF_T_CFLAGS = -G 0 ++ ++# Assemble startup files. ++$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES) ++ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ ++ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm ++ ++$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES) ++ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ ++ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm ++ ++# We must build libgcc2.a with -G 0, in case the user wants to link ++# without the $gp register. ++TARGET_LIBGCC2_CFLAGS = -G 0 ++ ++# Build the libraries for both hard and soft floating point ++ ++MULTILIB_OPTIONS = ++MULTILIB_DIRNAMES = ++ ++LIBGCC = stmp-multilib ++INSTALL_LIBGCC = install-multilib +diff -Nbaur gcc-3.4.4/gcc/config/rs6000/sysv4.h gcc-3.4.4-new/gcc/config/rs6000/sysv4.h --- gcc-3.4.4/gcc/config/rs6000/sysv4.h Fri Feb 11 21:06:45 2005 -+++ gcc-3.4.4-new/gcc/config/rs6000/sysv4.h Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config/rs6000/sysv4.h Wed Jul 6 01:50:37 2005 @@ -444,7 +444,7 @@ (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX) \ ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") @@ -1356,9 +1518,9 @@ diff -NBaur gcc-3.4.4/gcc/config/rs6000/sysv4.h gcc-3.4.4-new/gcc/config/rs6000/ #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits" -diff -NBaur gcc-3.4.4/gcc/config.gcc gcc-3.4.4-new/gcc/config.gcc +diff -Nbaur gcc-3.4.4/gcc/config.gcc gcc-3.4.4-new/gcc/config.gcc --- gcc-3.4.4/gcc/config.gcc Mon Apr 25 05:47:59 2005 -+++ gcc-3.4.4-new/gcc/config.gcc Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config.gcc Wed Jul 6 01:55:49 2005 @@ -1173,6 +1173,8 @@ xm_file=i386/xm-mingw32.h tmake_file="i386/t-cygming i386/t-mingw32" @@ -1368,8 +1530,22 @@ diff -NBaur gcc-3.4.4/gcc/config.gcc gcc-3.4.4-new/gcc/config.gcc if test x$enable_threads = xyes; then thread_file='win32' fi -@@ -1661,6 +1663,15 @@ +@@ -1659,8 +1661,29 @@ + tmake_file=mips/t-r3900 + use_fixproto=yes ;; ++mipsallegrex-*-elf* | mipsallegrexel-*-elf*) ++ tm_file="elfos.h ${tm_file} mips/elf.h" ++ tmake_file=mips/t-allegrex ++ target_cpu_default="MASK_SINGLE_FLOAT" ++ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI" ++ case ${target} in ++ mipsallegrex*-psp-elf*) ++ tm_file="${tm_file} mips/psp.h" ++ ;; ++ esac ++ use_fixproto=yes ++ ;; mmix-knuth-mmixware) need_64bit_hwint=yes + ;; @@ -1384,9 +1560,9 @@ diff -NBaur gcc-3.4.4/gcc/config.gcc gcc-3.4.4-new/gcc/config.gcc ;; mn10300-*-*) tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" -diff -NBaur gcc-3.4.4/gcc/config.host gcc-3.4.4-new/gcc/config.host +diff -Nbaur gcc-3.4.4/gcc/config.host gcc-3.4.4-new/gcc/config.host --- gcc-3.4.4/gcc/config.host Tue Oct 14 04:41:41 2003 -+++ gcc-3.4.4-new/gcc/config.host Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/config.host Wed Jul 6 01:50:37 2005 @@ -135,6 +135,8 @@ host_xm_file=i386/xm-mingw32.h host_xmake_file=i386/x-mingw32 @@ -1396,9 +1572,9 @@ diff -NBaur gcc-3.4.4/gcc/config.host gcc-3.4.4-new/gcc/config.host ;; i[34567]86-*-uwin*) echo "*** UWIN may not be used as a host platform because" -diff -NBaur gcc-3.4.4/gcc/cp/decl2.c gcc-3.4.4-new/gcc/cp/decl2.c +diff -Nbaur gcc-3.4.4/gcc/cp/decl2.c gcc-3.4.4-new/gcc/cp/decl2.c --- gcc-3.4.4/gcc/cp/decl2.c Mon Oct 11 15:42:36 2004 -+++ gcc-3.4.4-new/gcc/cp/decl2.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/cp/decl2.c Wed Jul 6 01:50:37 2005 @@ -1476,6 +1476,11 @@ { TREE_PUBLIC (decl) = 1; @@ -1411,9 +1587,9 @@ diff -NBaur gcc-3.4.4/gcc/cp/decl2.c gcc-3.4.4-new/gcc/cp/decl2.c } } } -diff -NBaur gcc-3.4.4/gcc/cp/parser.c gcc-3.4.4-new/gcc/cp/parser.c +diff -Nbaur gcc-3.4.4/gcc/cp/parser.c gcc-3.4.4-new/gcc/cp/parser.c --- gcc-3.4.4/gcc/cp/parser.c Tue Apr 5 00:43:47 2005 -+++ gcc-3.4.4-new/gcc/cp/parser.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/cp/parser.c Wed Jul 6 01:50:37 2005 @@ -9320,7 +9320,7 @@ declaration context. */ @@ -1423,9 +1599,9 @@ diff -NBaur gcc-3.4.4/gcc/cp/parser.c gcc-3.4.4-new/gcc/cp/parser.c warning ("type attributes are honored only at type definition"); type = xref_tag (tag_type, identifier, -diff -NBaur gcc-3.4.4/gcc/cp/repo.c gcc-3.4.4-new/gcc/cp/repo.c +diff -Nbaur gcc-3.4.4/gcc/cp/repo.c gcc-3.4.4-new/gcc/cp/repo.c --- gcc-3.4.4/gcc/cp/repo.c Fri Dec 19 23:28:09 2003 -+++ gcc-3.4.4-new/gcc/cp/repo.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/cp/repo.c Wed Jul 6 01:50:37 2005 @@ -1,5 +1,5 @@ /* Code to maintain a C++ template repository. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 @@ -1453,9 +1629,9 @@ diff -NBaur gcc-3.4.4/gcc/cp/repo.c gcc-3.4.4-new/gcc/cp/repo.c inside = !inside; else obstack_1grow (&temporary_obstack, c); -diff -NBaur gcc-3.4.4/gcc/crtstuff.c gcc-3.4.4-new/gcc/crtstuff.c +diff -Nbaur gcc-3.4.4/gcc/crtstuff.c gcc-3.4.4-new/gcc/crtstuff.c --- gcc-3.4.4/gcc/crtstuff.c Thu Oct 14 00:29:04 2004 -+++ gcc-3.4.4-new/gcc/crtstuff.c Tue Jun 14 03:43:50 2005 ++++ gcc-3.4.4-new/gcc/crtstuff.c Wed Jul 6 01:50:37 2005 @@ -134,6 +134,8 @@ /* Likewise for _Jv_RegisterClasses. */ extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK; @@ -1574,9 +1750,9 @@ diff -NBaur gcc-3.4.4/gcc/crtstuff.c gcc-3.4.4-new/gcc/crtstuff.c +#endif + +#endif /* __MINGW32__ || __CYGWIN__ */ -diff -NBaur gcc-3.4.4/gcc/doc/extend.texi gcc-3.4.4-new/gcc/doc/extend.texi +diff -Nbaur gcc-3.4.4/gcc/doc/extend.texi gcc-3.4.4-new/gcc/doc/extend.texi --- gcc-3.4.4/gcc/doc/extend.texi Sat Feb 26 22:17:26 2005 -+++ gcc-3.4.4-new/gcc/doc/extend.texi Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/doc/extend.texi Wed Jul 6 01:50:37 2005 @@ -3385,7 +3385,7 @@ @item dllimport The @code{dllimport} attribute is described in @xref{Function Attributes}. @@ -1586,9 +1762,9 @@ diff -NBaur gcc-3.4.4/gcc/doc/extend.texi gcc-3.4.4-new/gcc/doc/extend.texi The @code{dllexport} attribute is described in @xref{Function Attributes}. @end table -diff -NBaur gcc-3.4.4/gcc/doc/hostconfig.texi gcc-3.4.4-new/gcc/doc/hostconfig.texi +diff -Nbaur gcc-3.4.4/gcc/doc/hostconfig.texi gcc-3.4.4-new/gcc/doc/hostconfig.texi --- gcc-3.4.4/gcc/doc/hostconfig.texi Wed Jul 30 00:36:47 2003 -+++ gcc-3.4.4-new/gcc/doc/hostconfig.texi Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/doc/hostconfig.texi Wed Jul 6 01:50:37 2005 @@ -196,7 +196,15 @@ Define this macro if the host system has a small limit on the total size of an argument vector. This causes the driver to take more care @@ -1605,9 +1781,9 @@ diff -NBaur gcc-3.4.4/gcc/doc/hostconfig.texi gcc-3.4.4-new/gcc/doc/hostconfig.t In addition, if @command{configure} generates an incorrect definition of any of the macros in @file{auto-host.h}, you can override that -diff -NBaur gcc-3.4.4/gcc/doc/invoke.texi gcc-3.4.4-new/gcc/doc/invoke.texi +diff -Nbaur gcc-3.4.4/gcc/doc/invoke.texi gcc-3.4.4-new/gcc/doc/invoke.texi --- gcc-3.4.4/gcc/doc/invoke.texi Fri Apr 22 07:49:59 2005 -+++ gcc-3.4.4-new/gcc/doc/invoke.texi Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/doc/invoke.texi Wed Jul 6 01:50:37 2005 @@ -497,7 +497,7 @@ -m96bit-long-double -mregparm=@var{num} -momit-leaf-frame-pointer @gol -mno-red-zone -mno-tls-direct-seg-refs @gol @@ -1648,9 +1824,9 @@ diff -NBaur gcc-3.4.4/gcc/doc/invoke.texi gcc-3.4.4-new/gcc/doc/invoke.texi @end table @node HPPA Options -diff -NBaur gcc-3.4.4/gcc/gcc.c gcc-3.4.4-new/gcc/gcc.c +diff -Nbaur gcc-3.4.4/gcc/gcc.c gcc-3.4.4-new/gcc/gcc.c --- gcc-3.4.4/gcc/gcc.c Sun May 1 11:33:14 2005 -+++ gcc-3.4.4-new/gcc/gcc.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/gcc.c Wed Jul 6 01:50:37 2005 @@ -88,7 +88,7 @@ #ifdef HAVE_SYS_RESOURCE_H #include @@ -1737,9 +1913,9 @@ diff -NBaur gcc-3.4.4/gcc/gcc.c gcc-3.4.4-new/gcc/gcc.c { temp_filename = save_string (temp_filename, temp_filename_length + 1); -diff -NBaur gcc-3.4.4/gcc/ggc.h gcc-3.4.4-new/gcc/ggc.h +diff -Nbaur gcc-3.4.4/gcc/ggc.h gcc-3.4.4-new/gcc/ggc.h --- gcc-3.4.4/gcc/ggc.h Sun Dec 21 14:08:33 2003 -+++ gcc-3.4.4-new/gcc/ggc.h Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/ggc.h Wed Jul 6 01:50:37 2005 @@ -287,4 +287,8 @@ extern int ggc_min_heapsize_heuristic (void); extern void init_ggc_heuristics (void); @@ -1749,9 +1925,9 @@ diff -NBaur gcc-3.4.4/gcc/ggc.h gcc-3.4.4-new/gcc/ggc.h +#endif + #endif -diff -NBaur gcc-3.4.4/gcc/ginclude/stdarg.h gcc-3.4.4-new/gcc/ginclude/stdarg.h +diff -Nbaur gcc-3.4.4/gcc/ginclude/stdarg.h gcc-3.4.4-new/gcc/ginclude/stdarg.h --- gcc-3.4.4/gcc/ginclude/stdarg.h Thu Mar 13 02:58:40 2003 -+++ gcc-3.4.4-new/gcc/ginclude/stdarg.h Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/ginclude/stdarg.h Wed Jul 6 01:50:37 2005 @@ -30,6 +30,7 @@ #ifndef _STDARG_H @@ -1767,9 +1943,9 @@ diff -NBaur gcc-3.4.4/gcc/ginclude/stdarg.h gcc-3.4.4-new/gcc/ginclude/stdarg.h +#endif /* not RC_INVOKED */ #endif /* not _ANSI_STDARG_H_ */ #endif /* not _STDARG_H */ -diff -NBaur gcc-3.4.4/gcc/hwint.h gcc-3.4.4-new/gcc/hwint.h +diff -Nbaur gcc-3.4.4/gcc/hwint.h gcc-3.4.4-new/gcc/hwint.h --- gcc-3.4.4/gcc/hwint.h Wed Jun 25 20:33:08 2003 -+++ gcc-3.4.4-new/gcc/hwint.h Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/hwint.h Wed Jul 6 01:50:38 2005 @@ -15,6 +15,12 @@ #define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT) #define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG) @@ -1813,9 +1989,9 @@ diff -NBaur gcc-3.4.4/gcc/hwint.h gcc-3.4.4-new/gcc/hwint.h #endif #endif /* ! GCC_HWINT_H */ -diff -NBaur gcc-3.4.4/gcc/libgcc2.c gcc-3.4.4-new/gcc/libgcc2.c +diff -Nbaur gcc-3.4.4/gcc/libgcc2.c gcc-3.4.4-new/gcc/libgcc2.c --- gcc-3.4.4/gcc/libgcc2.c Wed Dec 15 12:34:24 2004 -+++ gcc-3.4.4-new/gcc/libgcc2.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/libgcc2.c Wed Jul 6 01:50:38 2005 @@ -1573,7 +1573,7 @@ /* Jump to a trampoline, loading the static chain address. */ @@ -1825,9 +2001,9 @@ diff -NBaur gcc-3.4.4/gcc/libgcc2.c gcc-3.4.4-new/gcc/libgcc2.c long getpagesize (void) -diff -NBaur gcc-3.4.4/gcc/mklibgcc.in gcc-3.4.4-new/gcc/mklibgcc.in +diff -Nbaur gcc-3.4.4/gcc/mklibgcc.in gcc-3.4.4-new/gcc/mklibgcc.in --- gcc-3.4.4/gcc/mklibgcc.in Thu Feb 24 09:26:57 2005 -+++ gcc-3.4.4-new/gcc/mklibgcc.in Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/mklibgcc.in Wed Jul 6 01:50:38 2005 @@ -46,6 +46,7 @@ echo 'srcdir = @srcdir@' echo 'VPATH = @srcdir@' @@ -1836,9 +2012,9 @@ diff -NBaur gcc-3.4.4/gcc/mklibgcc.in gcc-3.4.4-new/gcc/mklibgcc.in echo echo 'force:' echo -diff -NBaur gcc-3.4.4/gcc/mklibgcc.in.patch gcc-3.4.4-new/gcc/mklibgcc.in.patch +diff -Nbaur gcc-3.4.4/gcc/mklibgcc.in.patch gcc-3.4.4-new/gcc/mklibgcc.in.patch --- gcc-3.4.4/gcc/mklibgcc.in.patch Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/gcc/mklibgcc.in.patch Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/mklibgcc.in.patch Wed Jul 6 01:50:38 2005 @@ -0,0 +1,10 @@ +--- mklibgcc.in.orig Sat May 15 18:33:35 2004 ++++ mklibgcc.in Tue May 11 12:54:15 2004 @@ -1850,9 +2026,9 @@ diff -NBaur gcc-3.4.4/gcc/mklibgcc.in.patch gcc-3.4.4-new/gcc/mklibgcc.in.patch + echo + echo 'force:' + echo -diff -NBaur gcc-3.4.4/gcc/stor-layout.c gcc-3.4.4-new/gcc/stor-layout.c +diff -Nbaur gcc-3.4.4/gcc/stor-layout.c gcc-3.4.4-new/gcc/stor-layout.c --- gcc-3.4.4/gcc/stor-layout.c Sat May 29 00:16:00 2004 -+++ gcc-3.4.4-new/gcc/stor-layout.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/stor-layout.c Wed Jul 6 01:50:38 2005 @@ -1,6 +1,6 @@ /* C-compiler utilities for types and variables storage layout Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1996, 1998, @@ -1861,9 +2037,9 @@ diff -NBaur gcc-3.4.4/gcc/stor-layout.c gcc-3.4.4-new/gcc/stor-layout.c This file is part of GCC. -diff -NBaur gcc-3.4.4/gcc/system.h gcc-3.4.4-new/gcc/system.h +diff -Nbaur gcc-3.4.4/gcc/system.h gcc-3.4.4-new/gcc/system.h --- gcc-3.4.4/gcc/system.h Mon Mar 15 23:22:47 2004 -+++ gcc-3.4.4-new/gcc/system.h Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/system.h Wed Jul 6 01:50:38 2005 @@ -486,6 +486,19 @@ #define HOST_BIT_BUCKET "/dev/null" #endif @@ -1884,9 +2060,9 @@ diff -NBaur gcc-3.4.4/gcc/system.h gcc-3.4.4-new/gcc/system.h /* Be conservative and only use enum bitfields with GCC. FIXME: provide a complete autoconf test for buggy enum bitfields. */ -diff -NBaur gcc-3.4.4/gcc/tlink.c gcc-3.4.4-new/gcc/tlink.c +diff -Nbaur gcc-3.4.4/gcc/tlink.c gcc-3.4.4-new/gcc/tlink.c --- gcc-3.4.4/gcc/tlink.c Sat Jul 19 15:47:14 2003 -+++ gcc-3.4.4-new/gcc/tlink.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/tlink.c Wed Jul 6 01:50:38 2005 @@ -463,11 +463,20 @@ } fclose (stream); @@ -1910,9 +2086,9 @@ diff -NBaur gcc-3.4.4/gcc/tlink.c gcc-3.4.4-new/gcc/tlink.c obstack_grow (&temporary_obstack, c_file_name, strlen (c_file_name)); obstack_1grow (&temporary_obstack, ' '); obstack_grow (&temporary_obstack, f->args, strlen (f->args)); -diff -NBaur gcc-3.4.4/gcc/unwind-dw2-fde.c gcc-3.4.4-new/gcc/unwind-dw2-fde.c +diff -Nbaur gcc-3.4.4/gcc/unwind-dw2-fde.c gcc-3.4.4-new/gcc/unwind-dw2-fde.c --- gcc-3.4.4/gcc/unwind-dw2-fde.c Fri Oct 31 20:46:26 2003 -+++ gcc-3.4.4-new/gcc/unwind-dw2-fde.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/unwind-dw2-fde.c Wed Jul 6 01:50:38 2005 @@ -41,18 +41,32 @@ #include "gthr.h" #endif @@ -1988,9 +2164,9 @@ diff -NBaur gcc-3.4.4/gcc/unwind-dw2-fde.c gcc-3.4.4-new/gcc/unwind-dw2-fde.c } #define SWAP(x,y) do { const fde * tmp = x; x = y; y = tmp; } while (0) -diff -NBaur gcc-3.4.4/gcc/unwind-sjlj.c gcc-3.4.4-new/gcc/unwind-sjlj.c +diff -Nbaur gcc-3.4.4/gcc/unwind-sjlj.c gcc-3.4.4-new/gcc/unwind-sjlj.c --- gcc-3.4.4/gcc/unwind-sjlj.c Sun Nov 2 00:00:08 2003 -+++ gcc-3.4.4-new/gcc/unwind-sjlj.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/unwind-sjlj.c Wed Jul 6 01:50:38 2005 @@ -35,6 +35,10 @@ #include "unwind.h" #include "gthr.h" @@ -2073,9 +2249,9 @@ diff -NBaur gcc-3.4.4/gcc/unwind-sjlj.c gcc-3.4.4-new/gcc/unwind-sjlj.c #if __GTHREADS if (use_fc_key < 0) fc_key_init_once (); -diff -NBaur gcc-3.4.4/gcc/varasm.c gcc-3.4.4-new/gcc/varasm.c +diff -Nbaur gcc-3.4.4/gcc/varasm.c gcc-3.4.4-new/gcc/varasm.c --- gcc-3.4.4/gcc/varasm.c Wed Mar 2 20:57:48 2005 -+++ gcc-3.4.4-new/gcc/varasm.c Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/gcc/varasm.c Wed Jul 6 01:50:38 2005 @@ -4975,6 +4975,7 @@ default_elf_select_section_1 (tree decl, int reloc, unsigned HOST_WIDE_INT align, int shlib) @@ -2162,27 +2338,18 @@ diff -NBaur gcc-3.4.4/gcc/varasm.c gcc-3.4.4-new/gcc/varasm.c } /* Construct a unique section name based on the decl name and the -diff -NBaur gcc-3.4.4/gcc/version.c gcc-3.4.4-new/gcc/version.c +diff -Nbaur gcc-3.4.4/gcc/version.c gcc-3.4.4-new/gcc/version.c --- gcc-3.4.4/gcc/version.c Thu May 19 08:51:53 2005 -+++ gcc-3.4.4-new/gcc/version.c Tue Jun 14 03:43:51 2005 -@@ -5,7 +5,7 @@ - please modify this string to indicate that, e.g. by putting your - organization's name in parentheses at the end of the string. */ - --const char version_string[] = "3.4.4"; -+const char version_string[] = "3.4.4"; - - /* This is the location of the online document giving instructions for - reporting bugs. If you distribute a modified version of GCC, ++++ gcc-3.4.4-new/gcc/version.c Wed Jul 6 01:50:38 2005 @@ -14,4 +14,4 @@ forward us bugs reported to you, if you determine that they are not bugs in your modifications.) */ -const char bug_report_url[] = ""; +const char bug_report_url[] = ""; -diff -NBaur gcc-3.4.4/include/libiberty.h gcc-3.4.4-new/include/libiberty.h +diff -Nbaur gcc-3.4.4/include/libiberty.h gcc-3.4.4-new/include/libiberty.h --- gcc-3.4.4/include/libiberty.h Thu May 15 20:02:12 2003 -+++ gcc-3.4.4-new/include/libiberty.h Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/include/libiberty.h Wed Jul 6 01:50:38 2005 @@ -1,6 +1,6 @@ /* Function declarations for libiberty. @@ -2218,9 +2385,9 @@ diff -NBaur gcc-3.4.4/include/libiberty.h gcc-3.4.4-new/include/libiberty.h extern int pwait PARAMS ((int, int *, int)); -diff -NBaur gcc-3.4.4/include/pex-read.h gcc-3.4.4-new/include/pex-read.h +diff -Nbaur gcc-3.4.4/include/pex-read.h gcc-3.4.4-new/include/pex-read.h --- gcc-3.4.4/include/pex-read.h Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/include/pex-read.h Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/include/pex-read.h Wed Jul 6 01:50:38 2005 @@ -0,0 +1,41 @@ +/* Declarations of the pex-read functions for libiberty. + Copyright 2004 Free Software Foundation, Inc. @@ -2263,9 +2430,9 @@ diff -NBaur gcc-3.4.4/include/pex-read.h gcc-3.4.4-new/include/pex-read.h +#endif + +#endif /* PEX_READ_H */ -diff -NBaur gcc-3.4.4/libiberty/ChangeLog gcc-3.4.4-new/libiberty/ChangeLog +diff -Nbaur gcc-3.4.4/libiberty/ChangeLog gcc-3.4.4-new/libiberty/ChangeLog --- gcc-3.4.4/libiberty/ChangeLog Thu May 19 08:50:22 2005 -+++ gcc-3.4.4-new/libiberty/ChangeLog Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/libiberty/ChangeLog Wed Jul 6 01:50:38 2005 @@ -23,11 +23,33 @@ * GCC 3.4.0 released. @@ -2342,9 +2509,9 @@ diff -NBaur gcc-3.4.4/libiberty/ChangeLog gcc-3.4.4-new/libiberty/ChangeLog 2004-01-15 Kazu Hirata -diff -NBaur gcc-3.4.4/libiberty/Makefile.in gcc-3.4.4-new/libiberty/Makefile.in +diff -Nbaur gcc-3.4.4/libiberty/Makefile.in gcc-3.4.4-new/libiberty/Makefile.in --- gcc-3.4.4/libiberty/Makefile.in Wed Jan 14 21:27:28 2004 -+++ gcc-3.4.4-new/libiberty/Makefile.in Tue Jun 14 03:43:51 2005 ++++ gcc-3.4.4-new/libiberty/Makefile.in Wed Jul 6 01:50:38 2005 @@ -28,7 +28,6 @@ libiberty_topdir = @libiberty_topdir@ @@ -3248,9 +3415,9 @@ diff -NBaur gcc-3.4.4/libiberty/Makefile.in gcc-3.4.4-new/libiberty/Makefile.in + else true; fi + $(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION) + -diff -NBaur gcc-3.4.4/libiberty/config.in gcc-3.4.4-new/libiberty/config.in +diff -Nbaur gcc-3.4.4/libiberty/config.in gcc-3.4.4-new/libiberty/config.in --- gcc-3.4.4/libiberty/config.in Sat Jan 10 02:17:41 2004 -+++ gcc-3.4.4-new/libiberty/config.in Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/config.in Wed Jul 6 01:50:38 2005 @@ -1,7 +1,4 @@ /* config.in. Generated from configure.ac by autoheader. */ -/* Define to `unsigned long' if doesn't define. */ @@ -3273,9 +3440,9 @@ diff -NBaur gcc-3.4.4/libiberty/config.in gcc-3.4.4-new/libiberty/config.in /* Define to `int' if does not define. */ #undef pid_t -diff -NBaur gcc-3.4.4/libiberty/configure gcc-3.4.4-new/libiberty/configure +diff -Nbaur gcc-3.4.4/libiberty/configure gcc-3.4.4-new/libiberty/configure --- gcc-3.4.4/libiberty/configure Wed Oct 1 18:11:29 2003 -+++ gcc-3.4.4-new/libiberty/configure Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/configure Wed Jul 6 01:50:39 2005 @@ -1,9 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. @@ -3840,7 +4007,7 @@ diff -NBaur gcc-3.4.4/libiberty/configure gcc-3.4.4-new/libiberty/configure { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 -@@ -3077,7 +3188,7 @@ +@@ -3077,21 +3188,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi @@ -3849,8 +4016,6 @@ diff -NBaur gcc-3.4.4/libiberty/configure gcc-3.4.4-new/libiberty/configure done fi -@@ -3083,15 +3194,19 @@ - fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 + @@ -5462,9 +5627,9 @@ diff -NBaur gcc-3.4.4/libiberty/configure gcc-3.4.4-new/libiberty/configure { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -diff -NBaur gcc-3.4.4/libiberty/configure.ac gcc-3.4.4-new/libiberty/configure.ac +diff -Nbaur gcc-3.4.4/libiberty/configure.ac gcc-3.4.4-new/libiberty/configure.ac --- gcc-3.4.4/libiberty/configure.ac Sat Jan 10 02:17:41 2004 -+++ gcc-3.4.4-new/libiberty/configure.ac Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/configure.ac Wed Jul 6 01:50:39 2005 @@ -1,7 +1,8 @@ dnl Process this file with autoconf to produce a configure script @@ -5563,9 +5728,9 @@ diff -NBaur gcc-3.4.4/libiberty/configure.ac gcc-3.4.4-new/libiberty/configure.a -) +]]) +AC_OUTPUT -diff -NBaur gcc-3.4.4/libiberty/dyn-string.c gcc-3.4.4-new/libiberty/dyn-string.c +diff -Nbaur gcc-3.4.4/libiberty/dyn-string.c gcc-3.4.4-new/libiberty/dyn-string.c --- gcc-3.4.4/libiberty/dyn-string.c Mon Apr 1 22:55:12 2002 -+++ gcc-3.4.4-new/libiberty/dyn-string.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/dyn-string.c Wed Jul 6 01:50:39 2005 @@ -1,5 +1,5 @@ /* An abstract string datatype. - Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. @@ -5589,9 +5754,9 @@ diff -NBaur gcc-3.4.4/libiberty/dyn-string.c gcc-3.4.4-new/libiberty/dyn-string. /* Performs in-place initialization of a dyn_string struct. This function can be used with a dyn_string struct on the stack or -diff -NBaur gcc-3.4.4/libiberty/getpwd.c gcc-3.4.4-new/libiberty/getpwd.c +diff -Nbaur gcc-3.4.4/libiberty/getpwd.c gcc-3.4.4-new/libiberty/getpwd.c --- gcc-3.4.4/libiberty/getpwd.c Sun Oct 7 22:53:31 2001 -+++ gcc-3.4.4-new/libiberty/getpwd.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/getpwd.c Wed Jul 6 01:50:39 2005 @@ -35,6 +35,9 @@ #if HAVE_SYS_STAT_H #include @@ -5602,9 +5767,9 @@ diff -NBaur gcc-3.4.4/libiberty/getpwd.c gcc-3.4.4-new/libiberty/getpwd.c /* Prototype these in case the system headers don't provide them. */ extern char *getpwd (); -diff -NBaur gcc-3.4.4/libiberty/maint-tool gcc-3.4.4-new/libiberty/maint-tool +diff -Nbaur gcc-3.4.4/libiberty/maint-tool gcc-3.4.4-new/libiberty/maint-tool --- gcc-3.4.4/libiberty/maint-tool Tue Apr 15 20:21:38 2003 -+++ gcc-3.4.4-new/libiberty/maint-tool Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/maint-tool Wed Jul 6 01:50:39 2005 @@ -213,6 +213,12 @@ sub deps { @@ -5645,9 +5810,9 @@ diff -NBaur gcc-3.4.4/libiberty/maint-tool gcc-3.4.4-new/libiberty/maint-tool } } closedir(S); -diff -NBaur gcc-3.4.4/libiberty/pex-common.h gcc-3.4.4-new/libiberty/pex-common.h +diff -Nbaur gcc-3.4.4/libiberty/pex-common.h gcc-3.4.4-new/libiberty/pex-common.h --- gcc-3.4.4/libiberty/pex-common.h Fri Jan 24 20:02:11 2003 -+++ gcc-3.4.4-new/libiberty/pex-common.h Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/pex-common.h Wed Jul 6 01:50:39 2005 @@ -1,6 +1,6 @@ /* Utilities to execute a program in a subprocess (possibly linked by pipes with other subprocesses), and wait for it. Shared logic. @@ -5666,9 +5831,9 @@ diff -NBaur gcc-3.4.4/libiberty/pex-common.h gcc-3.4.4-new/libiberty/pex-common. /* value of `pipe': port index for reading. */ #define READ_PORT 0 -diff -NBaur gcc-3.4.4/libiberty/pex-unix.c gcc-3.4.4-new/libiberty/pex-unix.c +diff -Nbaur gcc-3.4.4/libiberty/pex-unix.c gcc-3.4.4-new/libiberty/pex-unix.c --- gcc-3.4.4/libiberty/pex-unix.c Fri Jan 24 20:02:11 2003 -+++ gcc-3.4.4-new/libiberty/pex-unix.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/pex-unix.c Wed Jul 6 01:50:39 2005 @@ -1,7 +1,7 @@ /* Utilities to execute a program in a subprocess (possibly linked by pipes with other subprocesses), and wait for it. Generic Unix version @@ -5784,16 +5949,15 @@ diff -NBaur gcc-3.4.4/libiberty/pex-unix.c gcc-3.4.4-new/libiberty/pex-unix.c /* Exec the program. */ - (*func) (program, argv); -- -- fprintf (stderr, "%s: ", this_pname); -- fprintf (stderr, install_error_msg, program); -- fprintf (stderr, ": %s\n", xstrerror (errno)); -- exit (-1); + if (flags & PEXECUTE_SEARCH) + execvp (program, argv); + else + execv (program, argv); -+ + +- fprintf (stderr, "%s: ", this_pname); +- fprintf (stderr, install_error_msg, program); +- fprintf (stderr, ": %s\n", xstrerror (errno)); +- exit (-1); + /* We don't want to call fprintf after vfork. */ +#define writeerr(s) write (STDERR_FILE_NO, s, strlen (s)) + writeerr (this_pname); @@ -5807,9 +5971,9 @@ diff -NBaur gcc-3.4.4/libiberty/pex-unix.c gcc-3.4.4-new/libiberty/pex-unix.c /* NOTREACHED */ return 0; -diff -NBaur gcc-3.4.4/libiberty/pexecute.txh gcc-3.4.4-new/libiberty/pexecute.txh +diff -Nbaur gcc-3.4.4/libiberty/pexecute.txh gcc-3.4.4-new/libiberty/pexecute.txh --- gcc-3.4.4/libiberty/pexecute.txh Fri Jan 24 20:02:11 2003 -+++ gcc-3.4.4-new/libiberty/pexecute.txh Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/pexecute.txh Wed Jul 6 01:50:39 2005 @@ -1,4 +1,4 @@ -@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags) +@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags}) @@ -5856,9 +6020,9 @@ diff -NBaur gcc-3.4.4/libiberty/pexecute.txh gcc-3.4.4-new/libiberty/pexecute.tx +subprocess. + +@end deftypefn -diff -NBaur gcc-3.4.4/libiberty/pexrd-generic.c gcc-3.4.4-new/libiberty/pexrd-generic.c +diff -Nbaur gcc-3.4.4/libiberty/pexrd-generic.c gcc-3.4.4-new/libiberty/pexrd-generic.c --- gcc-3.4.4/libiberty/pexrd-generic.c Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/libiberty/pexrd-generic.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/pexrd-generic.c Wed Jul 6 01:50:39 2005 @@ -0,0 +1,72 @@ +/* Execute a program and read stdout. Generic version. + Copyright (C) 2004 Free Software Foundation, Inc. @@ -5932,9 +6096,9 @@ diff -NBaur gcc-3.4.4/libiberty/pexrd-generic.c gcc-3.4.4-new/libiberty/pexrd-ge + *status = pclose (file); + return 0; +} -diff -NBaur gcc-3.4.4/libiberty/pexrd-unix.c gcc-3.4.4-new/libiberty/pexrd-unix.c +diff -Nbaur gcc-3.4.4/libiberty/pexrd-unix.c gcc-3.4.4-new/libiberty/pexrd-unix.c --- gcc-3.4.4/libiberty/pexrd-unix.c Thu Jan 1 00:00:00 1970 -+++ gcc-3.4.4-new/libiberty/pexrd-unix.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/pexrd-unix.c Wed Jul 6 01:50:39 2005 @@ -0,0 +1,164 @@ +/* Execute a program and read stdout. Generic Unix version. + Copyright (C) 2004 Free Software Foundation, Inc. @@ -6100,9 +6264,9 @@ diff -NBaur gcc-3.4.4/libiberty/pexrd-unix.c gcc-3.4.4-new/libiberty/pexrd-unix. + fclose (file); + return waitpid (pid, status, 0); +} -diff -NBaur gcc-3.4.4/libiberty/regex.c gcc-3.4.4-new/libiberty/regex.c +diff -Nbaur gcc-3.4.4/libiberty/regex.c gcc-3.4.4-new/libiberty/regex.c --- gcc-3.4.4/libiberty/regex.c Tue Apr 15 15:24:26 2003 -+++ gcc-3.4.4-new/libiberty/regex.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/regex.c Wed Jul 6 01:50:39 2005 @@ -36,6 +36,8 @@ # include #endif @@ -6130,9 +6294,9 @@ diff -NBaur gcc-3.4.4/libiberty/regex.c gcc-3.4.4-new/libiberty/regex.c char *errbuf; size_t errbuf_size; { -diff -NBaur gcc-3.4.4/libiberty/strerror.c gcc-3.4.4-new/libiberty/strerror.c +diff -Nbaur gcc-3.4.4/libiberty/strerror.c gcc-3.4.4-new/libiberty/strerror.c --- gcc-3.4.4/libiberty/strerror.c Thu Oct 2 20:06:29 2003 -+++ gcc-3.4.4-new/libiberty/strerror.c Tue Jun 14 03:43:52 2005 ++++ gcc-3.4.4-new/libiberty/strerror.c Wed Jul 6 01:50:39 2005 @@ -2,9 +2,6 @@ Written by Fred Fish. fnf@cygnus.com This file is in the public domain. --Per Bothner. */ @@ -6164,9 +6328,9 @@ diff -NBaur gcc-3.4.4/libiberty/strerror.c gcc-3.4.4-new/libiberty/strerror.c #endif -diff -NBaur gcc-3.4.4/libiberty/testsuite/test-demangle.c gcc-3.4.4-new/libiberty/testsuite/test-demangle.c +diff -Nbaur gcc-3.4.4/libiberty/testsuite/test-demangle.c gcc-3.4.4-new/libiberty/testsuite/test-demangle.c --- gcc-3.4.4/libiberty/testsuite/test-demangle.c Fri Jan 2 20:33:55 2004 -+++ gcc-3.4.4-new/libiberty/testsuite/test-demangle.c Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libiberty/testsuite/test-demangle.c Wed Jul 6 01:50:39 2005 @@ -26,6 +26,12 @@ #include #include "libiberty.h" @@ -6189,9 +6353,9 @@ diff -NBaur gcc-3.4.4/libiberty/testsuite/test-demangle.c gcc-3.4.4-new/libibert int no_params; int is_v3_ctor; int is_v3_dtor; -diff -NBaur gcc-3.4.4/libstdc++-v3/config/os/mingw32/os_defines.h gcc-3.4.4-new/libstdc++-v3/config/os/mingw32/os_defines.h +diff -Nbaur gcc-3.4.4/libstdc++-v3/config/os/mingw32/os_defines.h gcc-3.4.4-new/libstdc++-v3/config/os/mingw32/os_defines.h --- gcc-3.4.4/libstdc++-v3/config/os/mingw32/os_defines.h Sat Jul 5 05:05:32 2003 -+++ gcc-3.4.4-new/libstdc++-v3/config/os/mingw32/os_defines.h Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/config/os/mingw32/os_defines.h Wed Jul 6 01:50:39 2005 @@ -45,4 +45,11 @@ #undef NOMINMAX #define NOMINMAX 1 @@ -6204,9 +6368,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/config/os/mingw32/os_defines.h gcc-3.4.4-new/ +#define _GLIBCXX_NO_LONG_DOUBLE_IO 1 + #endif -diff -NBaur gcc-3.4.4/libstdc++-v3/configure.host gcc-3.4.4-new/libstdc++-v3/configure.host +diff -Nbaur gcc-3.4.4/libstdc++-v3/configure.host gcc-3.4.4-new/libstdc++-v3/configure.host --- gcc-3.4.4/libstdc++-v3/configure.host Tue Oct 5 17:32:49 2004 -+++ gcc-3.4.4-new/libstdc++-v3/configure.host Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/configure.host Wed Jul 6 01:50:39 2005 @@ -180,6 +180,7 @@ ;; mingw32*) @@ -6215,9 +6379,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/configure.host gcc-3.4.4-new/libstdc++-v3/con ;; netbsd*) os_include_dir="os/bsd/netbsd" -diff -NBaur gcc-3.4.4/libstdc++-v3/include/bits/char_traits.h gcc-3.4.4-new/libstdc++-v3/include/bits/char_traits.h +diff -Nbaur gcc-3.4.4/libstdc++-v3/include/bits/char_traits.h gcc-3.4.4-new/libstdc++-v3/include/bits/char_traits.h --- gcc-3.4.4/libstdc++-v3/include/bits/char_traits.h Thu Mar 18 17:36:47 2004 -+++ gcc-3.4.4-new/libstdc++-v3/include/bits/char_traits.h Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/include/bits/char_traits.h Wed Jul 6 01:50:39 2005 @@ -296,7 +296,7 @@ }; @@ -6238,9 +6402,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/include/bits/char_traits.h gcc-3.4.4-new/libs static void assign(char_type& __c1, const char_type& __c2) -diff -NBaur gcc-3.4.4/libstdc++-v3/include/bits/locale_facets.tcc gcc-3.4.4-new/libstdc++-v3/include/bits/locale_facets.tcc +diff -Nbaur gcc-3.4.4/libstdc++-v3/include/bits/locale_facets.tcc gcc-3.4.4-new/libstdc++-v3/include/bits/locale_facets.tcc --- gcc-3.4.4/libstdc++-v3/include/bits/locale_facets.tcc Thu Nov 18 10:50:19 2004 -+++ gcc-3.4.4-new/libstdc++-v3/include/bits/locale_facets.tcc Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/include/bits/locale_facets.tcc Wed Jul 6 01:50:39 2005 @@ -765,7 +765,13 @@ string __xtrc; __xtrc.reserve(32); @@ -6326,9 +6490,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/include/bits/locale_facets.tcc gcc-3.4.4-new/ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __cs_size)); __ctype.widen(__cs, __cs + __len, __ws); -diff -NBaur gcc-3.4.4/libstdc++-v3/include/bits/stringfwd.h gcc-3.4.4-new/libstdc++-v3/include/bits/stringfwd.h +diff -Nbaur gcc-3.4.4/libstdc++-v3/include/bits/stringfwd.h gcc-3.4.4-new/libstdc++-v3/include/bits/stringfwd.h --- gcc-3.4.4/libstdc++-v3/include/bits/stringfwd.h Thu Mar 18 17:37:03 2004 -+++ gcc-3.4.4-new/libstdc++-v3/include/bits/stringfwd.h Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/include/bits/stringfwd.h Wed Jul 6 01:50:39 2005 @@ -59,7 +59,7 @@ typedef basic_string string; @@ -6338,9 +6502,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/include/bits/stringfwd.h gcc-3.4.4-new/libstd template<> struct char_traits; typedef basic_string wstring; -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/Makefile.in gcc-3.4.4-new/libstdc++-v3/libsupc++/Makefile.in +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/Makefile.in gcc-3.4.4-new/libstdc++-v3/libsupc++/Makefile.in --- gcc-3.4.4/libstdc++-v3/libsupc++/Makefile.in Thu Mar 18 17:37:08 2004 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/Makefile.in Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/Makefile.in Wed Jul 6 01:50:39 2005 @@ -210,7 +210,7 @@ # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. @@ -6350,9 +6514,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/Makefile.in gcc-3.4.4-new/libstdc++ WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_globals.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_globals.cc +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_globals.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_globals.cc --- gcc-3.4.4/libstdc++-v3/libsupc++/eh_globals.cc Mon Nov 8 17:41:19 2004 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_globals.cc Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_globals.cc Wed Jul 6 01:50:40 2005 @@ -32,6 +32,9 @@ #include #include "unwind-cxx.h" @@ -6363,9 +6527,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_globals.cc gcc-3.4.4-new/libstdc #include "bits/gthr.h" using namespace __cxxabiv1; -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_term_handler.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_term_handler.cc +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_term_handler.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_term_handler.cc --- gcc-3.4.4/libstdc++-v3/libsupc++/eh_term_handler.cc Tue Sep 2 19:46:54 2003 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_term_handler.cc Tue Jun 14 03:43:53 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_term_handler.cc Wed Jul 6 01:50:40 2005 @@ -41,6 +41,7 @@ # include #endif @@ -6379,9 +6543,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_term_handler.cc gcc-3.4.4-new/li #endif +#endif -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_terminate.cc +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_terminate.cc --- gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc Sat May 24 17:22:03 2003 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_terminate.cc Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_terminate.cc Wed Jul 6 01:50:40 2005 @@ -50,6 +50,11 @@ void std::terminate () @@ -6406,9 +6570,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_terminate.cc gcc-3.4.4-new/libst __unexpected (__unexpected_handler); } -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_unex_handler.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_unex_handler.cc +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_unex_handler.cc gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_unex_handler.cc --- gcc-3.4.4/libstdc++-v3/libsupc++/eh_unex_handler.cc Sat May 24 17:22:03 2003 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_unex_handler.cc Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/eh_unex_handler.cc Wed Jul 6 01:50:40 2005 @@ -29,6 +29,7 @@ #include "unwind-cxx.h" @@ -6418,9 +6582,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/eh_unex_handler.cc gcc-3.4.4-new/li std::unexpected_handler __cxxabiv1::__unexpected_handler = std::terminate; - +#endif -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/typeinfo gcc-3.4.4-new/libstdc++-v3/libsupc++/typeinfo +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/typeinfo gcc-3.4.4-new/libstdc++-v3/libsupc++/typeinfo --- gcc-3.4.4/libstdc++-v3/libsupc++/typeinfo Sat Jul 5 05:05:40 2003 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/typeinfo Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/typeinfo Wed Jul 6 01:50:40 2005 @@ -44,7 +44,7 @@ class __class_type_info; } // namespace __cxxabiv1 @@ -6430,9 +6594,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/typeinfo gcc-3.4.4-new/libstdc++-v3 // If weak symbols are not supported, typeinfo names are not merged. #define __GXX_MERGED_TYPEINFO_NAMES 0 #else -diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/unwind-cxx.h gcc-3.4.4-new/libstdc++-v3/libsupc++/unwind-cxx.h +diff -Nbaur gcc-3.4.4/libstdc++-v3/libsupc++/unwind-cxx.h gcc-3.4.4-new/libstdc++-v3/libsupc++/unwind-cxx.h --- gcc-3.4.4/libstdc++-v3/libsupc++/unwind-cxx.h Sat Jul 5 05:05:41 2003 -+++ gcc-3.4.4-new/libstdc++-v3/libsupc++/unwind-cxx.h Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/libstdc++-v3/libsupc++/unwind-cxx.h Wed Jul 6 01:50:40 2005 @@ -125,9 +125,16 @@ extern void __terminate(std::terminate_handler) __attribute__((noreturn)); extern void __unexpected(std::unexpected_handler) __attribute__((noreturn)); @@ -6451,9 +6615,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/libsupc++/unwind-cxx.h gcc-3.4.4-new/libstdc+ // These are explicitly GNU C++ specific. -diff -NBaur gcc-3.4.4/libstdc++-v3/src/Makefile.in gcc-3.4.4-new/libstdc++-v3/src/Makefile.in +diff -Nbaur gcc-3.4.4/libstdc++-v3/src/Makefile.in gcc-3.4.4-new/libstdc++-v3/src/Makefile.in --- gcc-3.4.4/libstdc++-v3/src/Makefile.in Fri Apr 16 20:08:35 2004 -+++ gcc-3.4.4-new/libstdc++-v3/src/Makefile.in Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/libstdc++-v3/src/Makefile.in Wed Jul 6 01:50:40 2005 @@ -211,7 +211,7 @@ # These bits are all figured out from configure. Look in acinclude.m4 # or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS. @@ -6463,9 +6627,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/src/Makefile.in gcc-3.4.4-new/libstdc++-v3/sr WARN_CXXFLAGS = \ $(WARN_FLAGS) $(WERROR) -fdiagnostics-show-location=once -diff -NBaur gcc-3.4.4/libstdc++-v3/src/globals_io.cc gcc-3.4.4-new/libstdc++-v3/src/globals_io.cc +diff -Nbaur gcc-3.4.4/libstdc++-v3/src/globals_io.cc gcc-3.4.4-new/libstdc++-v3/src/globals_io.cc --- gcc-3.4.4/libstdc++-v3/src/globals_io.cc Thu Mar 18 17:37:13 2004 -+++ gcc-3.4.4-new/libstdc++-v3/src/globals_io.cc Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/libstdc++-v3/src/globals_io.cc Wed Jul 6 01:50:40 2005 @@ -26,6 +26,9 @@ // the GNU General Public License. @@ -6476,9 +6640,9 @@ diff -NBaur gcc-3.4.4/libstdc++-v3/src/globals_io.cc gcc-3.4.4-new/libstdc++-v3/ #include "bits/gthr.h" #include #include -diff -NBaur gcc-3.4.4/ltcf-c.sh gcc-3.4.4-new/ltcf-c.sh +diff -Nbaur gcc-3.4.4/ltcf-c.sh gcc-3.4.4-new/ltcf-c.sh --- gcc-3.4.4/ltcf-c.sh Wed Nov 19 05:29:32 2003 -+++ gcc-3.4.4-new/ltcf-c.sh Tue Jun 14 03:43:54 2005 ++++ gcc-3.4.4-new/ltcf-c.sh Wed Jul 6 01:50:40 2005 @@ -38,17 +38,17 @@ lt_simple_link_test_code='main(){return(0);}' diff --git a/patches/devkit-newlib-1.13.0.patch b/patches/devkit-newlib-1.13.0.patch index 3260fa5..1861084 100644 --- a/patches/devkit-newlib-1.13.0.patch +++ b/patches/devkit-newlib-1.13.0.patch @@ -1,6 +1,6 @@ -diff -NBaur newlib-1.13.0/config.sub newlib-1.13.0-new/config.sub +diff -Nbaur newlib-1.13.0/config.sub newlib-1.13.0-new/config.sub --- newlib-1.13.0/config.sub Tue Nov 16 01:18:39 2004 -+++ newlib-1.13.0-new/config.sub Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/config.sub Mon Jul 4 23:31:59 2005 @@ -219,6 +219,9 @@ basic_machine=m68k-atari os=-mint @@ -11,9 +11,62 @@ diff -NBaur newlib-1.13.0/config.sub newlib-1.13.0-new/config.sub esac # Decode aliases for certain CPU-COMPANY combinations. -diff -NBaur newlib-1.13.0/newlib/configure.host newlib-1.13.0-new/newlib/configure.host +@@ -253,6 +256,7 @@ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ ++ | mipsallegrex | mipsallegrexel \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ +@@ -326,6 +330,7 @@ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ ++ | mipsallegrex-* | mipsallegrexel-* \ + | mmix-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ +@@ -664,6 +669,10 @@ + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint ++ ;; ++ psp) ++ basic_machine=mipsallegrexel-psp ++ os=-elf + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +diff -Nbaur newlib-1.13.0/configure newlib-1.13.0-new/configure +--- newlib-1.13.0/configure Thu Dec 16 19:51:28 2004 ++++ newlib-1.13.0-new/configure Mon Jul 4 23:31:59 2005 +@@ -1507,6 +1507,9 @@ + mips*-*-linux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ mipsallegrex*-*-*) ++ noconfigdirs="$noconfigdirs target-libgloss" ++ ;; + mips*-*-*) + noconfigdirs="$noconfigdirs gprof ${libgcj}" + ;; +diff -Nbaur newlib-1.13.0/configure.in newlib-1.13.0-new/configure.in +--- newlib-1.13.0/configure.in Thu Dec 16 19:51:28 2004 ++++ newlib-1.13.0-new/configure.in Mon Jul 4 23:31:59 2005 +@@ -716,6 +716,9 @@ + mips*-*-linux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ mipsallegrex*-*-*) ++ noconfigdirs="$noconfigdirs target-libgloss" ++ ;; + mips*-*-*) + noconfigdirs="$noconfigdirs gprof ${libgcj}" + ;; +diff -Nbaur newlib-1.13.0/newlib/configure.host newlib-1.13.0-new/newlib/configure.host --- newlib-1.13.0/newlib/configure.host Tue Oct 5 20:44:24 2004 -+++ newlib-1.13.0-new/newlib/configure.host Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/configure.host Mon Jul 4 23:31:59 2005 @@ -389,6 +389,9 @@ powerpcle-*-pe) posix_dir=posix @@ -24,9 +77,20 @@ diff -NBaur newlib-1.13.0/newlib/configure.host newlib-1.13.0-new/newlib/configu sh*-*) sys_dir=sh ;; -diff -NBaur newlib-1.13.0/newlib/libc/sys/arm/Makefile.in newlib-1.13.0-new/newlib/libc/sys/arm/Makefile.in +@@ -569,6 +572,10 @@ + newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" + ;; + mips*-*-elf*) ++ case "${host}" in ++ mipsallegrex*) ++ newlib_cflags="${newlib_cflags} -G0 -DPREFER_SIZE_OVER_SPEED -DCOMPACT_CTYPE" ;; ++ esac + default_newlib_io_long_long="yes" + newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" + ;; +diff -Nbaur newlib-1.13.0/newlib/libc/sys/arm/Makefile.in newlib-1.13.0-new/newlib/libc/sys/arm/Makefile.in --- newlib-1.13.0/newlib/libc/sys/arm/Makefile.in Wed Jun 9 20:05:09 2004 -+++ newlib-1.13.0-new/newlib/libc/sys/arm/Makefile.in Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/arm/Makefile.in Mon Jul 4 23:30:01 2005 @@ -88,7 +88,7 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) @@ -36,15 +100,15 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/arm/Makefile.in newlib-1.13.0-new/newl @MAY_SUPPLY_SYSCALLS_FALSE@extra_objs = lib_a_SOURCES = libcfunc.c trap.S -diff -NBaur newlib-1.13.0/newlib/libc/sys/arm/malloc_vars.c newlib-1.13.0-new/newlib/libc/sys/arm/malloc_vars.c +diff -Nbaur newlib-1.13.0/newlib/libc/sys/arm/malloc_vars.c newlib-1.13.0-new/newlib/libc/sys/arm/malloc_vars.c --- newlib-1.13.0/newlib/libc/sys/arm/malloc_vars.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/arm/malloc_vars.c Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/arm/malloc_vars.c Mon Jul 4 23:30:01 2005 @@ -0,0 +1,2 @@ +char *fake_heap_end = (char*)0; +char *fake_heap_start = (char*)0; -diff -NBaur newlib-1.13.0/newlib/libc/sys/arm/syscalls.c newlib-1.13.0-new/newlib/libc/sys/arm/syscalls.c +diff -Nbaur newlib-1.13.0/newlib/libc/sys/arm/syscalls.c newlib-1.13.0-new/newlib/libc/sys/arm/syscalls.c --- newlib-1.13.0/newlib/libc/sys/arm/syscalls.c Tue Jan 6 19:27:21 2004 -+++ newlib-1.13.0-new/newlib/libc/sys/arm/syscalls.c Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/arm/syscalls.c Mon Jul 4 23:30:01 2005 @@ -474,19 +474,41 @@ n = n; } @@ -88,9 +152,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/arm/syscalls.c newlib-1.13.0-new/newli { /* Some of the libstdc++-v3 tests rely upon detecting out of memory errors, so do not abort here. */ -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.am newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.am +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.am newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.am --- newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.am Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.am Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.am Mon Jul 4 23:30:01 2005 @@ -0,0 +1,19 @@ +## Process this file with automake to generate Makefile.in + @@ -111,9 +175,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.am newlib-1.13.0-new + +ACLOCAL_AMFLAGS = -I ../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.in newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.in +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.in newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.in --- newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.in Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.in Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/Makefile.in Mon Jul 4 23:30:01 2005 @@ -0,0 +1,341 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + @@ -456,9 +520,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/Makefile.in newlib-1.13.0-new +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/aclocal.m4 newlib-1.13.0-new/newlib/libc/sys/ppcgekko/aclocal.m4 +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/aclocal.m4 newlib-1.13.0-new/newlib/libc/sys/ppcgekko/aclocal.m4 --- newlib-1.13.0/newlib/libc/sys/ppcgekko/aclocal.m4 Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/aclocal.m4 Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/aclocal.m4 Mon Jul 4 23:30:01 2005 @@ -0,0 +1,382 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p6 + @@ -842,9 +906,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/aclocal.m4 newlib-1.13.0-new/ +] +) + -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/configure newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/configure newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure --- newlib-1.13.0/newlib/libc/sys/ppcgekko/configure Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure Mon Jul 4 23:30:01 2005 @@ -0,0 +1,1906 @@ +#! /bin/sh + @@ -2752,9 +2816,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/configure newlib-1.13.0-new/n +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/configure.in newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure.in +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/configure.in newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure.in --- newlib-1.13.0/newlib/libc/sys/ppcgekko/configure.in Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure.in Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/configure.in Mon Jul 4 23:30:01 2005 @@ -0,0 +1,12 @@ +dnl This is the newlib/libc/sys/ppcgekko configure.in file. +dnl Process this file with autoconf to produce a configure script. @@ -2768,23 +2832,23 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/configure.in newlib-1.13.0-ne +NEWLIB_CONFIGURE(../../..) + +AC_OUTPUT(Makefile) -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/crt0.c newlib-1.13.0-new/newlib/libc/sys/ppcgekko/crt0.c +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/crt0.c newlib-1.13.0-new/newlib/libc/sys/ppcgekko/crt0.c --- newlib-1.13.0/newlib/libc/sys/ppcgekko/crt0.c Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/crt0.c Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/crt0.c Mon Jul 4 23:30:01 2005 @@ -0,0 +1,4 @@ +/* I have a copy of something that would serve as a NetWare crt0.o, + but it is copyright by Novell. */ + +int _dummy_crt0 = 1; -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/include/newlib.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/include/newlib.h +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/include/newlib.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/include/newlib.h --- newlib-1.13.0/newlib/libc/sys/ppcgekko/include/newlib.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/include/newlib.h Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/include/newlib.h Mon Jul 4 23:30:01 2005 @@ -0,0 +1,2 @@ +/* dummy file for external tools to use. Real file is created by + newlib configuration. */ -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/malloc.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/malloc.h +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/malloc.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/malloc.h --- newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/malloc.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/malloc.h Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/malloc.h Mon Jul 4 23:30:01 2005 @@ -0,0 +1,8 @@ +#ifndef _MACHMALLOC_H_ +#define _MACHMALLOC_H_ @@ -2794,9 +2858,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/malloc.h newlib-1.13. +#endif /* _MACHMALLOC_H_ */ + + -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/stdlib.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/stdlib.h +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/stdlib.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/stdlib.h --- newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/stdlib.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/stdlib.h Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/machine/stdlib.h Mon Jul 4 23:30:01 2005 @@ -0,0 +1,8 @@ +#ifndef _MACHSTDLIB_H_ +#define _MACHSTDLIB_H_ @@ -2806,9 +2870,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/machine/stdlib.h newlib-1.13. +#endif /* _MACHSTDLIB_H_ */ + + -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/lock.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/lock.h +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/lock.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/lock.h --- newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/lock.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/lock.h Thu Apr 14 09:04:31 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/lock.h Mon Jul 4 23:30:01 2005 @@ -0,0 +1,53 @@ +#ifndef __SYS_LOCK_H__ +#define __SYS_LOCK_H__ @@ -2863,9 +2927,9 @@ diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/lock.h newlib-1.13.0-new/ +extern int __libc_lock_release(int*); + +#endif /* __SYS_LOCK_H__ */ -diff -NBaur newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/stdio.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/stdio.h +diff -Nbaur newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/stdio.h newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/stdio.h --- newlib-1.13.0/newlib/libc/sys/ppcgekko/sys/stdio.h Thu Jan 1 00:00:00 1970 -+++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/stdio.h Sun Feb 27 12:17:44 2005 ++++ newlib-1.13.0-new/newlib/libc/sys/ppcgekko/sys/stdio.h Mon Jul 4 23:30:02 2005 @@ -0,0 +1,25 @@ +#ifndef _NEWLIB_STDIO_H +#define _NEWLIB_STDIO_H diff --git a/patches/pspsdk-1.0+beta.patch b/patches/pspsdk-1.0+beta.patch new file mode 100644 index 0000000..b85f7b7 --- /dev/null +++ b/patches/pspsdk-1.0+beta.patch @@ -0,0 +1,42 @@ +diff -NBaur pspsdk-1.0+beta/tools/psp-config.c pspsdk-1.0+beta-new/tools/psp-config.c +--- pspsdk-1.0+beta/tools/psp-config.c Mon Jun 27 06:31:22 2005 ++++ pspsdk-1.0+beta-new/tools/psp-config.c Tue Jul 5 04:54:45 2005 +@@ -17,8 +19,17 @@ + #define PATH_SEP ":" + #define DIR_SEP '/' + #define DIR_SEP_STR "/" ++ ++#ifdef __MINGW32__ ++ ++/* The suffix to the path to strip off, if this is not there then we have an error */ ++#define PSPDEV_PATH_SUFFIX "/bin/psp-config.exe" ++#else ++ + /* The suffix to the path to strip off, if this is not there then we have an error */ + #define PSPDEV_PATH_SUFFIX "/bin/psp-config" ++ ++#endif + /************************/ + + /* Speficies that the current usage is to the print the pspsdk path */ +@@ -70,6 +81,20 @@ + int found = 0; + + /* Check if name is an absolute path, if so out job is done */ ++#ifdef __MINGW32__ ++ ++ char *ptr = name; ++ ++ char temp = name[0]; ++ *(ptr++) = '/'; ++ *(ptr++) = temp; ++ while (*(ptr)) { ++ temp = *(ptr); ++ if (temp == '\\') *(ptr) = '/'; ++ ptr++; ++ } ++ ++#endif + if(name[0] == DIR_SEP) + { + /* Absolute path */