summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2020-02-13 16:08:57 -0500
committerGitHub <noreply@github.com>2020-02-13 16:08:57 -0500
commit5dc85a079d9b18d95e655ebf5709530be41797f9 (patch)
tree2a6c50b6fbb20d074cc6d526cb904b251166de7b
parentd067f0e6717908f4cb6d0c0ac9ba4fea8eb2cebe (diff)
parentaeebfee838222b9054da0632f2a65d2f934f7e23 (diff)
Merge pull request #742 from PikalaxALT/modern_gcc
Modern gcc
-rw-r--r--.travis.yml1
-rw-r--r--INSTALL.md142
-rw-r--r--Makefile76
-rw-r--r--config.mk8
-rw-r--r--data/battle_scripts_1.s1
-rw-r--r--include/battle_anim.h7
-rw-r--r--include/berry_blender.h1
-rw-r--r--include/data2.h1
-rw-r--r--include/decoration.h2
-rw-r--r--include/gba/defines.h1
-rw-r--r--include/global.h1
-rw-r--r--include/graphics.h7
-rw-r--r--include/new_game.h4
-rw-r--r--include/overworld.h1
-rw-r--r--include/pokemon_menu.h1
-rw-r--r--include/shop.h1
-rw-r--r--ld_script.txt1571
-rw-r--r--ld_script_modern.txt79
-rw-r--r--src/battle/anim/fire_2.c1
-rw-r--r--src/battle/anim/ghost.c3
-rw-r--r--src/battle/anim/heal_bell.c2
-rw-r--r--src/battle/anim/musical.c2
-rw-r--r--src/battle/anim/roots.c8
-rw-r--r--src/battle_controller_link_opponent.c6
-rw-r--r--src/battle_controller_link_partner.c16
-rw-r--r--src/battle_controller_opponent.c8
-rw-r--r--src/battle_controller_player.c1
-rw-r--r--src/battle_controller_safari.c2
-rw-r--r--src/battle_controller_wally.c4
-rw-r--r--src/battle_gfx_sfx_util.c2
-rw-r--r--src/battle_interface.c2
-rw-r--r--src/berry_blender.c16
-rw-r--r--src/daycare.c10
-rw-r--r--src/debug/sound_check_menu.c4
-rw-r--r--src/egg_hatch.c3
-rw-r--r--src/evolution_scene.c26
-rw-r--r--src/field_fadetransition.c9
-rw-r--r--src/field_weather_effects.c2
-rw-r--r--src/item_menu.c34
-rw-r--r--src/libs/m4a.c1
-rw-r--r--src/main.c20
-rw-r--r--src/main_menu.c7
-rw-r--r--src/pokenav_before.c2
-rw-r--r--src/reset_rtc_screen.c2
-rw-r--r--src/roulette_gfx.c10
-rw-r--r--src/save.c8
-rw-r--r--src/trade.c2
-rw-r--r--tools/gbafix/elf.h3147
-rw-r--r--tools/gbafix/gbafix.c500
49 files changed, 4542 insertions, 1223 deletions
diff --git a/.travis.yml b/.travis.yml
index 25918795a..a476f9a61 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,6 +37,7 @@ matrix:
- make -j2 compare_sapphire
- make -j2 compare_sapphire_rev1
- make -j2 compare_sapphire_rev2
+ - make -j2 modern
- os: linux
addons:
apt:
diff --git a/INSTALL.md b/INSTALL.md
index ad3262007..9b8003726 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,127 +1,125 @@
-# Linux
+# Prerequisites
-Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM).
+| Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, and 1703)
+| ----- | ----- | ------------------------- | ------------------ | ---------------------------------------------------------
+| none | [Xcode Command Line Tools package][xcode] | [Windows Subsystem for Linux 2][wsl2] | [Windows Subsystem for Linux][wsl] | MSYS2 (see below)
-Then run the following commands.
+[xcode]: https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-DOWNLOADING_COMMAND_LINE_TOOLS_IS_NOT_AVAILABLE_IN_XCODE_FOR_MACOS_10_9__HOW_CAN_I_INSTALL_THEM_ON_MY_MACHINE_
+[wsl2]: https://docs.microsoft.com/windows/wsl/wsl2-install
+[wsl]: https://docs.microsoft.com/windows/wsl/install-win10
- export DEVKITPRO=/opt/devkitPro
+The [prerelease version of the Linux subsystem](https://docs.microsoft.com/windows/wsl/install-legacy) available in the 1607 and 1703 releases of Windows 10 is obsolete so consider uninstalling it.
+
+Make sure that the `build-essential`, `git`, and `libpng-dev` packages are installed. The `build-essential` package includes the `make`, `gcc-core`, and `g++` packages so they do not have to be obtained separately. MSYS2 does not include `libpng-dev` so it must be built from source.
+
+On Linux and Mac OS X, using `(dkp-)pacman`, install `gba-dev`. This will give you devkitARM and all its extensions.
+
+Install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and add its environment variables. For Windows versions without the Linux subsystem, the devkitPro [graphical installer](https://github.com/devkitPro/installer/releases) includes a preconfigured MSYS2 environment, thus the steps below are not required.
+
+ export DEVKITPRO=/opt/devkitpro
echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc
export DEVKITARM=$DEVKITPRO/devkitARM
echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc
+### Platform-specific notes
+#### Mac OS X
+It is highly recommended that you use the [Homebrew](https://brew.sh) package manager. Suggested packages include `gcc`, `libpng`, `coreutils`, `git`, `make`, and `md5sha1sum`. Note that `make` will be aliased as `gmake` in Terminal, and `gcc` as `gcc-${VM}` where `${VM}` is the GCC major version (currently 9).
+
+# Installation
+
+To set up the repository:
+
git clone https://github.com/pret/pokeruby
git clone https://github.com/pret/agbcc
- cd agbcc
+ cd ./agbcc
./build.sh
./install.sh ../pokeruby
cd ../pokeruby
-To build **pokeruby.gba**:
+To build **pokeruby.gba** and confirm it matches the official ROM image:
- make -j4
+ make
+To build Pokémon Sapphire:
-# Mac
+ make sapphire
-Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM).
+The above two commands will build the English v1.0 version of the respective title. To build the 1.1 and 1.2 revisions, use the appropriate `_rev` target. For example, to build Ruby 1.2, run:
-Then in **Terminal**, run the following commands.
+ make ruby_rev2
- xcode-select --install
+## Notes
- export DEVKITPRO=${HOME}/devkitPro
- echo "export DEVKITPRO=${DEVKITPRO}" >> ~/.bashrc
- export DEVKITARM=${DEVKITPRO}/devkitARM
- echo "export DEVKITARM=${DEVKITARM}" >> ~/.bashrc
+* If the base tools are not found on macOS in new Terminal sessions after the first successful build, run `echo "if [ -f ~/.bashrc ]; then . ~/.bashrc; fi" >> ~/.bash_profile` once to prevent the issue from occurring again. Verify that the `devkitarm-rules` package is installed as well; if not, install it by running `sudo dkp-pacman -S devkitarm-rules`.
- git clone https://github.com/pret/pokeruby
- git clone https://github.com/pret/agbcc
+* If the repository was previously set up using Cygwin, delete the `.exe` files in the subfolders of the `tools` folder except for `agbcc` and try building again. [Learn the differences between MSYS2 and Cygwin.](https://github.com/msys2/msys2/wiki/How-does-MSYS2-differ-from-Cygwin)
- cd agbcc
- ./build.sh
- ./install.sh ../pokeruby
+## Notes about the German language ROMs
+This repository also supports the German versions of Ruby and Sapphire. However, due to major differences in scripts, text, and graphics, a special configuration needs to be set up before compilation and torn down after.
- cd ../pokeruby
+To set up the repository:
-To build **pokeruby.gba**:
+ make clean
+ sh de_before.sh
- make -j4
+To compile the German ROMs:
+ make ruby_de
+ make sapphire_de
-# Windows
+To compile the leaked Debug ROM (German):
-Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM) to the default directory (C:/devkitpro).
+ make ruby_de_debug
-Then download [**Cygwin**](http://cygwin.com/install.html): **setup-x86_64.exe** for 64-bit Windows, **setup-x86.exe** for 32-bit.
+To restore the repository (**MUST BE DONE BEFORE ATTEMPTING TO BUILD ANY ENGLISH LANGUAGE ROM**):
-Run the Cygwin setup and leave the default settings. At "Select Packages", set the view to "Full" and choose to install the following:
+ make clean
+ sh de_after.sh
-- `make`
-- `git`
-- `gcc-core`
-- `gcc-g++`
-- `libpng-devel`
+# Guidance
-In the **Cygwin terminal**, enter these commands:
+To build **pokeruby.gba** with your changes:
- export DEVKITPRO=/cygdrive/c/devkitpro
- echo export DEVKITPRO=$DEVKITPRO >> ~/.bashrc
- export DEVKITARM=$DEVKITPRO/devkitARM
- echo export DEVKITARM=$DEVKITARM >> ~/.bashrc
+ make COMPARE=0
- git clone https://github.com/pret/pokeruby
- git clone https://github.com/pret/agbcc
+## Parallel builds
- cd agbcc
- ./build.sh
- ./install.sh ../pokeruby
+See [the GNU docs](https://www.gnu.org/software/make/manual/html_node/Parallel.html) and [this Stack Exchange thread](https://unix.stackexchange.com/questions/208568) for more information.
- cd ../pokeruby
+To speed up building, run:
-To build **pokeruby.gba**:
+ make -j$(nproc)
- make -j4
+`nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)).
+## Building without dependency scanning
-# Compiling Sapphire and later revisions
+If only `.c` or `.s` files were changed, turn off the dependency scanning temporarily. Changes to any other files will be ignored and the build will either fail or not reflect those changes.
-When you simply enter `make` and don't specify a target, then Pokémon Ruby 1.0 will be built. However, Sapphire can also be built, along with revisions 1 and 2 of both Ruby and Sapphire. Here is a listing of each ROM that can be made, along with the command to make the ROM.
-
-Version | Command
--------------|---------------------
-Ruby 1.0 | `make ruby`
-Ruby 1.1 | `make ruby_rev1`
-Ruby 1.2 | `make ruby_rev2`
-Sapphire 1.0 | `make sapphire`
-Sapphire 1.1 | `make sapphire_rev1`
-Sapphire 1.2 | `make sapphire_rev2`
-
-
-# Faster builds
+ make NODEP=1
-After the first build, subsequent builds are faster. You can further speed up the build:
+## Building with devkitARM's C compiler
-## Parallel build
+This project supports the `arm-none-eabi-gcc` compiler included with devkitARM. To build this target, simply run:
-This significantly speeds up the build on modern machines.
+ make modern
-By default `make` only runs a single thread. You can tell `make` to run on multiple threads with `make -j`. See the manfile for usage (`man make`).
+## Building with other toolchains
-The optimal value for `-j` is the number of logical cores on your machine. You can run `nproc` to see the exact number.
+To build using a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain, which must contain the subdirectory `bin`.
- $ nproc
- 8
+ make TOOLCHAIN="/path/to/toolchain/here"
-If you have 8 cores, run:
+The following is an example:
- make -j8
+ make TOOLCHAIN="/usr/local/arm-none-eabi"
-`-j` on its own will spawn a new thread for each job. A clean build will have thousands of jobs, which will be slower than not using -j at all.
+To compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present.
-## Disable the dependency scanning
+## Building with debug info
-If you've only changed `.c` or `.s` files, you can turn off the dependency scanning temporarily. Changes to any other files will be ignored, and the build will either fail or not reflect those changes.
+To build **pokeruby.elf** with enhanced debug info, use the `DINFO` variable.
- make NODEP=1
+ make DINFO=1
diff --git a/Makefile b/Makefile
index 58e7416bf..70eb57508 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,12 @@
+TOOLCHAIN ?= $(DEVKITARM)
+ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(DEVKITARM)/base_tools
+else
+PREFIX := $(TOOLCHAIN)/bin/arm-none-eabi-
+OBJCOPY := $(PREFIX)objcopy
+CC := $(PREFIX)gcc
+AS := $(PREFIX)as
+endif
include config.mk
ifeq ($(OS),Windows_NT)
@@ -10,8 +18,11 @@ endif
#### Tools ####
SHELL := /bin/bash -o pipefail
-AS := $(PREFIX)as
+ifeq ($(MODERN),0)
CC1 := tools/agbcc/bin/agbcc$(EXE)
+else
+CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet
+endif
CPP := $(PREFIX)cpp
LD := $(PREFIX)ld
OBJCOPY := $(PREFIX)objcopy
@@ -27,9 +38,19 @@ GBAFIX := tools/gbafix/gbafix$(EXE)
MAPJSON := tools/mapjson/mapjson$(EXE)
JSONPROC := tools/jsonproc/jsonproc$(EXE)
-ASFLAGS := -mcpu=arm7tdmi -I include --defsym $(GAME_VERSION)=1 --defsym REVISION=$(GAME_REVISION) --defsym DEBUG_TRANSLATE=$(DEBUG_TRANSLATE) --defsym $(GAME_LANGUAGE)=1 --defsym DEBUG=$(DEBUG)
+ASFLAGS := -mcpu=arm7tdmi -I include --defsym $(GAME_VERSION)=1 --defsym REVISION=$(GAME_REVISION) --defsym DEBUG_TRANSLATE=$(DEBUG_TRANSLATE) --defsym $(GAME_LANGUAGE)=1 --defsym DEBUG=$(DEBUG) --defsym MODERN=$(MODERN)
+CPPFLAGS := -iquote include -Werror -Wno-trigraphs -D $(GAME_VERSION) -D REVISION=$(GAME_REVISION) -D $(GAME_LANGUAGE) -DDEBUG_TRANSLATE=$(DEBUG_TRANSLATE) -D DEBUG=$(DEBUG) -D MODERN=$(MODERN)
+ifeq ($(MODERN),0)
+CPPFLAGS += -I tools/agbcc/include -nostdinc -undef
CC1FLAGS := -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
-CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef -Werror -Wno-trigraphs -D $(GAME_VERSION) -D REVISION=$(GAME_REVISION) -D $(GAME_LANGUAGE) -DDEBUG_TRANSLATE=$(DEBUG_TRANSLATE) -D DEBUG=$(DEBUG)
+else
+CC1FLAGS := -mthumb -mthumb-interwork -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -O2 -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast
+endif
+
+ifneq (,$(DINFO))
+CC1FLAGS += -g
+endif
+
ifneq (,$(NONMATCHING))
CPPFLAGS += -DNONMATCHING
ASFLAGS += --defsym NONMATCHING=1
@@ -48,17 +69,30 @@ ASM_SOURCES := $(wildcard src/*.s src/*/*.s asm/*.s data/*.s sound/*.s sound/*/
C_OBJECTS := $(addprefix $(BUILD_DIR)/, $(C_SOURCES:%.c=%.o))
ASM_OBJECTS := $(addprefix $(BUILD_DIR)/, $(ASM_SOURCES:%.s=%.o))
ALL_OBJECTS := $(C_OBJECTS) $(ASM_OBJECTS)
+OBJS_REL := $(ALL_OBJECTS:$(BUILD_DIR)/%=%)
SUBDIRS := $(sort $(dir $(ALL_OBJECTS)))
DATA_SRC_SUBDIR = src/data
-LIBC := tools/agbcc/lib/libc.a
-LIBGCC := tools/agbcc/lib/libgcc.a
-LDFLAGS := -L ../../tools/agbcc/lib -lgcc -lc
+GCC_VER = $(shell $(CC) -dumpversion)
+
+ifeq ($(MODERN),0)
+LIBDIRS := ../../tools/agbcc/lib
+else
+LIBDIRS := \
+ $(TOOLCHAIN)/lib/gcc/arm-none-eabi/$(GCC_VER)/thumb \
+ $(TOOLCHAIN)/arm-none-eabi/lib/thumb
+endif
+LDFLAGS := $(LIBDIRS:%=-L %) -lgcc -lc
+ifeq ($(MODERN),0)
LD_SCRIPT := $(BUILD_DIR)/ld_script.ld
+else
+LD_SCRIPT := $(BUILD_DIR)/ld_script_modern.ld
+endif
# Special configurations required for lib files
+ifeq ($(MODERN),0)
%src/libs/siirtc.o: CC1FLAGS := -mthumb-interwork
%src/libs/agb_flash.o: CC1FLAGS := -O1 -mthumb-interwork
%src/libs/agb_flash_1m.o: CC1FLAGS := -O1 -mthumb-interwork
@@ -66,14 +100,17 @@ LD_SCRIPT := $(BUILD_DIR)/ld_script.ld
%src/libs/m4a.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE)
%src/libs/libisagbprn.o: CC1 := tools/agbcc/bin/old_agbcc$(EXE)
%src/libs/libisagbprn.o: CC1FLAGS := -mthumb-interwork
+endif
#### Main Rules ####
+ALL_BUILDS := ruby ruby_rev1 ruby_rev2 sapphire sapphire_rev1 sapphire_rev2 ruby_de sapphire_de ruby_de_debug
ALL_BUILDS := ruby ruby_rev1 ruby_rev2 sapphire sapphire_rev1 sapphire_rev2 ruby_de sapphire_de ruby_de_debug ruby_en_debug
+MODERN_BUILDS := $(ALL_BUILDS:%=%_modern)
# Available targets
-.PHONY: all clean tidy tools $(ALL_BUILDS)
+.PHONY: all clean mostlyclean tidy tools $(ALL_BUILDS)
infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
@@ -115,7 +152,7 @@ endif
compare: ; @$(MAKE) COMPARE=1
-clean: tidy
+mostlyclean: tidy
find sound/direct_sound_samples \( -iname '*.bin' \) -exec rm {} +
$(RM) $(ALL_OBJECTS)
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' \) -exec rm {} +
@@ -123,6 +160,8 @@ clean: tidy
rm -f data/maps/connections.inc data/maps/events.inc data/maps/groups.inc data/maps/headers.inc
find data/maps \( -iname 'connections.inc' -o -iname 'events.inc' -o -iname 'header.inc' \) -exec rm {} +
rm -f $(AUTO_GEN_TARGETS)
+
+clean: mostlyclean
$(MAKE) clean -C tools/gbagfx
$(MAKE) clean -C tools/scaninc
$(MAKE) clean -C tools/preproc
@@ -149,17 +188,18 @@ tools:
tidy:
$(RM) $(ALL_BUILDS:%=poke%{.gba,.elf,.map})
+ $(RM) $(MODERN_BUILDS:%=poke%{.gba,.elf,.map})
$(RM) -r build
$(ROM): %.gba: %.elf
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@
- $(GBAFIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent
%.elf: $(LD_SCRIPT) $(ALL_OBJECTS)
- cd $(BUILD_DIR) && $(LD) -T ld_script.ld -Map ../../$(MAP) -o ../../$@ $(LDFLAGS)
+ cd $(BUILD_DIR) && $(LD) -T $(LD_SCRIPT:$(BUILD_DIR)/%=%) -Map ../../$(MAP) -o ../../$@ $(OBJS_REL) $(LDFLAGS)
+ $(GBAFIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent
-$(LD_SCRIPT): ld_script.txt $(BUILD_DIR)/sym_common.ld $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_bss.ld
- cd $(BUILD_DIR) && sed -e "s#tools/#../../tools/#g" ../../ld_script.txt >ld_script.ld
+$(LD_SCRIPT): $(LD_SCRIPT:$(BUILD_DIR)/%.ld=%.txt) $(BUILD_DIR)/sym_common.ld $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_bss.ld
+ sed -e "s#tools/#../../tools/#g" $< >$@
$(BUILD_DIR)/sym_%.ld: sym_%.txt
$(CPP) -P $(CPPFLAGS) $< | sed -e "s#tools/#../../tools/#g" > $@
@@ -186,6 +226,18 @@ sapphire_rev2: ; @$(MAKE) GAME_VERSION=SAPPHIRE GAME_REVISION=2
ruby_de: ; @$(MAKE) GAME_VERSION=RUBY GAME_LANGUAGE=GERMAN
sapphire_de: ; @$(MAKE) GAME_VERSION=SAPPHIRE GAME_LANGUAGE=GERMAN
ruby_de_debug: ; @$(MAKE) GAME_VERSION=RUBY GAME_LANGUAGE=GERMAN DEBUG=1
+
+modern: ; @$(MAKE) GAME_VERSION=RUBY MODERN=1
+ruby_modern: ; @$(MAKE) GAME_VERSION=RUBY MODERN=1
+ruby_rev1_modern: ; @$(MAKE) GAME_VERSION=RUBY GAME_REVISION=1 MODERN=1
+ruby_rev2_modern: ; @$(MAKE) GAME_VERSION=RUBY GAME_REVISION=2 MODERN=1
+sapphire_modern: ; @$(MAKE) GAME_VERSION=SAPPHIRE MODERN=1
+sapphire_rev1_modern: ; @$(MAKE) GAME_VERSION=SAPPHIRE GAME_REVISION=1 MODERN=1
+sapphire_rev2_modern: ; @$(MAKE) GAME_VERSION=SAPPHIRE GAME_REVISION=2 MODERN=1
+ruby_de_modern: ; @$(MAKE) GAME_VERSION=RUBY GAME_LANGUAGE=GERMAN MODERN=1
+sapphire_de_modern: ; @$(MAKE) GAME_VERSION=SAPPHIRE GAME_LANGUAGE=GERMAN MODERN=1
+ruby_de_debug_modern: ; @$(MAKE) GAME_VERSION=RUBY GAME_LANGUAGE=GERMAN DEBUG=1 MODERN=1
+
ruby_en_debug: ; @$(MAKE) GAME_VERSION=RUBY DEBUG=1 DEBUG_TRANSLATE=1
compare_ruby: ; @$(MAKE) GAME_VERSION=RUBY COMPARE=1
diff --git a/config.mk b/config.mk
index 3c48f7b13..303af6233 100644
--- a/config.mk
+++ b/config.mk
@@ -5,6 +5,7 @@ GAME_VERSION ?= RUBY
GAME_REVISION ?= 0
GAME_LANGUAGE ?= ENGLISH
DEBUG ?= 0
+MODERN ?= 0
DEBUG_TRANSLATE ?= 0
COMPARE ?= 0
@@ -67,7 +68,12 @@ ifeq ($(GAME_LANGUAGE), ENGLISH)
COMPARE := 0
DEBUG_TRANSLATE := 1
endif
-
endif
+# Modern GCC
+ifeq ($(MODERN), 0)
+ BUILD_NAME := $(BUILD_NAME)
+else
+ BUILD_NAME := $(BUILD_NAME)_modern
+endif
diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s
index ed286c3b2..00f0fd97b 100644
--- a/data/battle_scripts_1.s
+++ b/data/battle_scripts_1.s
@@ -9,6 +9,7 @@
.section script_data, "aw", %progbits
+ .align 2
gBattleScriptsForMoveEffects:: @ 81D6BBC
.4byte BattleScript_EffectHit
.4byte BattleScript_EffectSleep
diff --git a/include/battle_anim.h b/include/battle_anim.h
index 4f79dfc93..71a61f175 100644
--- a/include/battle_anim.h
+++ b/include/battle_anim.h
@@ -31,13 +31,6 @@ enum
BATTLER_COORD_ATTR_RAW_BOTTOM,
};
-struct BattleAnimBackground
-{
- void *image;
- void *palette;
- void *tilemap;
-};
-
struct UnknownStruct1
{
u8 unk0;
diff --git a/include/berry_blender.h b/include/berry_blender.h
index 8aaf934e5..d03dff728 100644
--- a/include/berry_blender.h
+++ b/include/berry_blender.h
@@ -2,5 +2,6 @@
#define GUARD_BERRY_BLENDER_H
void debug_sub_80524BC(void);
+void sub_804E990(void);
#endif //GUARD_BERRY_BLENDER_H
diff --git a/include/data2.h b/include/data2.h
index 593d04480..ed23a10ce 100644
--- a/include/data2.h
+++ b/include/data2.h
@@ -2,6 +2,7 @@
#define GUARD_DATA2_H
#include "sprite.h"
+#include "battle.h"
struct ScanlineEffectParams;
diff --git a/include/decoration.h b/include/decoration.h
index 9f78bc491..cebb49598 100644
--- a/include/decoration.h
+++ b/include/decoration.h
@@ -2,6 +2,8 @@
#define GUARD_DECORATION_H
#include "task.h"
+#include "menu.h"
+#include "menu_helpers.h"
enum DecorPerm {
/*
diff --git a/include/gba/defines.h b/include/gba/defines.h
index e53ccfccf..71de1275c 100644
--- a/include/gba/defines.h
+++ b/include/gba/defines.h
@@ -6,6 +6,7 @@
#define TRUE 1
#define FALSE 0
+#define BSS_DATA __attribute__((section(".bss")))
#define IWRAM_DATA __attribute__((section("iwram_data")))
#define EWRAM_DATA __attribute__((section("ewram_data")))
#define UNUSED __attribute__((unused))
diff --git a/include/global.h b/include/global.h
index 5e71bd821..0ddc2d7bb 100644
--- a/include/global.h
+++ b/include/global.h
@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
+#include <limits.h>
#include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.
#include "gba/gba.h"
diff --git a/include/graphics.h b/include/graphics.h
index 1912a2399..e14aa72d5 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -1,6 +1,13 @@
#ifndef GUARD_GRAPHICS_H
#define GUARD_GRAPHICS_H
+struct BattleAnimBackground
+{
+ void *image;
+ void *palette;
+ void *tilemap;
+};
+
// data/graphics.s
extern const u8 gInterfaceGfx_PokeBall[];
extern const u8 gInterfacePal_PokeBall[];
diff --git a/include/new_game.h b/include/new_game.h
index e50fc2c80..993150928 100644
--- a/include/new_game.h
+++ b/include/new_game.h
@@ -16,4 +16,8 @@ void sub_8052E4C(void);
void NewGameInitData(void);
void debug_sub_8057508(bool32 arg0);
+#if DEBUG
+void debug_sub_8052E04();
+#endif
+
#endif // GUARD_NEW_GAME_H
diff --git a/include/overworld.h b/include/overworld.h
index 833c0aea0..f444a8405 100644
--- a/include/overworld.h
+++ b/include/overworld.h
@@ -211,5 +211,6 @@ void sub_805465C(void);
void CB2_InitTestMenu(void);
void debug_sub_8058C00(void);
+void sub_80546B8(void);
#endif // GUARD_ROM4_H
diff --git a/include/pokemon_menu.h b/include/pokemon_menu.h
index 099c3a3bc..e5c0b2110 100644
--- a/include/pokemon_menu.h
+++ b/include/pokemon_menu.h
@@ -48,5 +48,6 @@ void sub_808B0C0(u8 taskID);
void sub_808B508(u8);
void sub_808B564(void);
void debug_sub_80986AC(void);
+void sub_808A3F8(void);
#endif // GUARD_POKEMON_MENU_H
diff --git a/include/shop.h b/include/shop.h
index 849b1bef2..c5e8f2011 100644
--- a/include/shop.h
+++ b/include/shop.h
@@ -41,5 +41,6 @@ void Shop_CreatePokemartMenu(u16 *);
void Shop_CreateDecorationShop1Menu(u16 *);
void Shop_CreateDecorationShop2Menu(u16 *);
void Shop_RunExitSellMenuTask(u8 taskId);
+void Shop_FadeReturnToMartMenu(void);
#endif // GUARD_SHOP_H
diff --git a/ld_script.txt b/ld_script.txt
index e5451f9eb..34e0ebc3a 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -384,7 +384,6 @@ SECTIONS {
{
data/event_scripts.o(script_data);
data/battle_anim_scripts.o(script_data);
- . = ALIGN(4);
data/battle_scripts_1.o(script_data);
data/field_effect_scripts.o(script_data);
data/battle_scripts_2.o(script_data);
@@ -404,801 +403,829 @@ SECTIONS {
src/libs/agb_flash_mx.o(.text);
src/libs/siirtc.o(.text);
src/libs/libagbsyscall.o(.text);
- *libgcc.a:_call_via_rX.o(.text);
- *libgcc.a:_divsi3.o(.text);
- *libgcc.a:_dvmd_tls.o(.text);
- *libgcc.a:_fixunsdfsi.o(.text);
- *libgcc.a:_fixunssfsi.o(.text);
- *libgcc.a:_modsi3.o(.text);
- *libgcc.a:_muldi3.o(.text);
- *libgcc.a:_udivdi3.o(.text);
- *libgcc.a:_udivsi3.o(.text);
- *libgcc.a:_umodsi3.o(.text);
- *libgcc.a:dp-bit.o(.text);
- *libgcc.a:fp-bit.o(.text);
- *libgcc.a:_lshrdi3.o(.text);
- *libgcc.a:_negdi2.o(.text);
- *libc.a:memcpy.o(.text);
- *libc.a:memset.o(.text);
- *libc.a:strcmp.o(.text);
- *libc.a:vfprintf.o(.text);
- *libc.a:vsprintf.o(.text);
- *libc.a:fvwrite.o(.text);
- *libc.a:locale.o(.text);
- *libc.a:findfp.o(.text);
- *libc.a:fflush.o(.text);
- *libc.a:wsetup.o(.text);
- *libc.a:mbtowc_r.o(.text);
- *libc.a:s_isinf.o(.text);
- *libc.a:s_isnan.o(.text);
- *libc.a:memchr.o(.text);
- *libc.a:strlen.o(.text);
- *libc.a:dtoa.o(.text);
- *libc.a:memmove.o(.text);
- *libc.a:stdio.o(.text);
- *libc.a:mprec.o(.text);
- *libc.a:mallocr.o(.text);
- *libc.a:fwalk.o(.text);
- *libc.a:freer.o(.text);
- *libc.a:makebuf.o(.text);
- *libc.a:readr.o(.text);
- *libc.a:writer.o(.text);
- *libc.a:lseekr.o(.text);
- *libc.a:closer.o(.text);
- *libc.a:callocr.o(.text);
- *libc.a:sbrkr.o(.text);
- *libc.a:mlock.o(.text);
- *libc.a:fstatr.o(.text);
- *libc.a:libcfunc.o(.text);
- *libc.a:syscalls.o(.text);
- *libc.a:errno.o(.text);
+ *libgcc.a:*_call_via_rX*.o(.text*);
+ *libgcc.a:*_divsi3*.o(.text*);
+ *libgcc.a:*_dvmd_tls*.o(.text*);
+ *libgcc.a:*_fixunsdfsi*.o(.text*);
+ *libgcc.a:*_fixunssfsi*.o(.text*);
+ *libgcc.a:*_modsi3*.o(.text*);
+ *libgcc.a:*_muldi3*.o(.text*);
+ *libgcc.a:*_udivdi3*.o(.text*);
+ *libgcc.a:*_udivsi3*.o(.text*);
+ *libgcc.a:*_umodsi3*.o(.text*);
+ *libgcc.a:*dp-bit*.o(.text);
+ *libgcc.a:*fp-bit*.o(.text);
+ *libgcc.a:*_lshrdi3*.o(.text*);
+ *libgcc.a:*_negdi2*.o(.text*);
+ *libgcc.a:*_arm_addsubdf3.o*(.text*);
+ *libgcc.a:*_arm_addsubsf3.o*(.text*);
+ *libgcc.a:*_arm_cmpsf2.o*(.text*);
+ *libgcc.a:*_arm_fixsfsi.o*(.text*);
+ *libgcc.a:*_arm_muldivdf3.o*(.text*);
+ *libgcc.a:*_arm_muldivsf3.o*(.text*);
+ *libgcc.a:*_arm_truncdfsf2.o*(.text*);
+ *libgcc.a:*_clzdi2.o*(.text*);
+ *libgcc.a:*_clzsi2.o*(.text*);
+ *libc.a:*memcpy*.o(.text*);
+ *libc.a:*memset*.o(.text*);
+ *libc.a:*strcmp*.o(.text*);
+ *libc.a:*vfprintf*.o(.text*);
+ *libc.a:*vsprintf*.o(.text*);
+ *libc.a:*fvwrite*.o(.text*);
+ *libc.a:*locale*.o(.text*);
+ *libc.a:*findfp*.o(.text*);
+ *libc.a:*fflush*.o(.text*);
+ *libc.a:*wsetup*.o(.text*);
+ *libc.a:*mbtowc_r*.o(.text*);
+ *libc.a:*s_isinf*.o(.text*);
+ *libc.a:*s_isnan*.o(.text*);
+ *libc.a:*memchr*.o(.text*);
+ *libc.a:*strlen*.o(.text*);
+ *libc.a:*dtoa*.o(.text*);
+ *libc.a:*memmove*.o(.text*);
+ *libc.a:*stdio*.o(.text*);
+ *libc.a:*mprec*.o(.text*);
+ *libc.a:*mallocr*.o(.text*);
+ *libc.a:*fwalk*.o(.text*);
+ *libc.a:*freer*.o(.text*);
+ *libc.a:*makebuf*.o(.text*);
+ *libc.a:*readr*.o(.text*);
+ *libc.a:*writer*.o(.text*);
+ *libc.a:*lseekr*.o(.text*);
+ *libc.a:*closer*.o(.text*);
+ *libc.a:*callocr*.o(.text*);
+ *libc.a:*sbrkr*.o(.text*);
+ *libc.a:*mlock*.o(.text*);
+ *libc.a:*fstatr*.o(.text*);
+ *libc.a:*libcfunc*.o(.text*);
+ *libc.a:*syscalls*.o(.text*);
+ *libc.a:*errno*.o(.text*);
src/libs/libisagbprn.o(.text);
} =0
.rodata :
ALIGN(4)
{
- src/main.o(.rodata);
- src/sprite.o(.rodata);
+ src/main.o(.rodata*);
+ src/sprite.o(.rodata*);
. += 0x8; /* Why the gap? */
- src/text.o(.rodata);
- src/string_util.o(.rodata);
- src/link.o(.rodata);
- src/rtc.o(.rodata);
- src/main_menu.o(.rodata);
- data/mon_attrs.o(.rodata);
- src/battle/battle_1.o(.rodata);
- src/battle_bg.o(.rodata);
- data/btl_attrs.o(.rodata);
- src/battle_script_commands.o(.rodata);
- src/battle_controller_player.o(.rodata);
- data/smokescreen.o(.rodata); /* why is smokescreen rodata way up here and not in the correct location? */
- data/battle_7.o(.rodata);
- src/battle_controller_opponent.o(.rodata);
- src/battle_controller_link_opponent.o(.rodata);
- src/data/battle_moves.o(.rodata);
- src/battle_util.o(.rodata);
- src/pokemon_1.o(.rodata);
+ src/text.o(.rodata*);
+ src/string_util.o(.rodata*);
+ src/link.o(.rodata*);
+ src/rtc.o(.rodata*);
+ src/main_menu.o(.rodata*);
+ src/battle_controllers.o(.rodata*);
+ data/mon_attrs.o(.rodata*);
+ src/battle/battle_1.o(.rodata*);
+ src/battle_bg.o(.rodata*);
+ data/btl_attrs.o(.rodata*);
+ src/battle_script_commands.o(.rodata*);
+ src/battle_controller_player.o(.rodata*);
+ data/smokescreen.o(.rodata*); /* why is smokescreen rodata way up here and not in the correct location? */
+ data/battle_7.o(.rodata*);
+ src/battle_controller_opponent.o(.rodata*);
+ src/battle_ai_switch_items.o(.rodata*);
+ src/battle_controller_link_opponent.o(.rodata*);
+ src/data/battle_moves.o(.rodata*);
+ src/battle_main.o(.rodata*);
+ src/battle_util.o(.rodata*);
+ src/pokemon_1.o(.rodata*);
src/pokemon_1.o(.data); /* gEvolutionTable needs to be non-const to match */
- src/calculate_base_damage.o(.rodata);
- src/pokemon_2.o(.rodata);
- src/pokemon_item_effect.o(.rodata);
- src/pokemon_3.o(.rodata);
+ src/calculate_base_damage.o(.rodata*);
+ src/pokemon_2.o(.rodata*);
+ src/pokemon_item_effect.o(.rodata*);
+ src/pokemon_3.o(.rodata*);
. = ALIGN(4);
- src/trig.o(.rodata);
- src/util.o(.rodata);
- src/daycare.o(.rodata);
- src/egg_hatch.o(.rodata);
- src/battle_gfx_sfx_util.o(.rodata);
- src/battle_interface.o(.rodata);
- src/pokeball.o(.rodata);
- src/trade.o(.rodata);
- src/berry_blender.o(.rodata);
- src/new_game.o(.rodata);
- src/overworld.o(.rodata);
- data/tilesets.o(.rodata);
- data/maps.o(.rodata);
- src/fieldmap.o(.rodata);
- src/metatile_behavior.o(.rodata);
- src/field_door.o(.rodata);
- src/field_player_avatar.o(.rodata);
- src/event_object_movement.o(.rodata);
- src/text_window.o(.rodata);
- src/script.o(.rodata);
- src/scrcmd.o(.rodata);
- src/coord_event_weather.o(.rodata);
- src/field_tasks.o(.rodata);
- src/reset_rtc_screen.o(.rodata);
- src/party_menu.o(.rodata);
- src/start_menu.o(.rodata);
+ src/trig.o(.rodata*);
+ src/util.o(.rodata*);
+ src/daycare.o(.rodata*);
+ src/egg_hatch.o(.rodata*);
+ src/battle_gfx_sfx_util.o(.rodata*);
+ src/battle_interface.o(.rodata*);
+ src/pokeball.o(.rodata*);
+ src/trade.o(.rodata*);
+ src/berry_blender.o(.rodata*);
+ src/new_game.o(.rodata*);
+ src/overworld.o(.rodata*);
+ data/tilesets.o(.rodata*);
+ data/maps.o(.rodata*);
+ src/fieldmap.o(.rodata*);
+ src/metatile_behavior.o(.rodata*);
+ src/field_door.o(.rodata*);
+ src/field_player_avatar.o(.rodata*);
+ src/event_object_movement.o(.rodata*);
+ src/text_window.o(.rodata*);
+ src/script.o(.rodata*);
+ src/scrcmd.o(.rodata*);
+ src/field_control_avatar.o(.rodata*);
+ src/coord_event_weather.o(.rodata*);
+ src/field_tasks.o(.rodata*);
+ src/reset_rtc_screen.o(.rodata*);
+ src/party_menu.o(.rodata*);
+ src/start_menu.o(.rodata*);
src/debug/start_menu_debug.o(.data);
- src/debug/start_menu_debug.o(.rodata);
- src/menu.o(.rodata);
- src/tileset_anim.o(.rodata);
- src/palette.o(.rodata);
- src/sound.o(.rodata);
- src/battle_anim.o(.rodata);
- src/rom_8077ABC.o(.rodata);
- data/map_events.o(.rodata);
- data/unused_orb.o(.rodata); /* these files are clearly the rodata for latter part of rom_8077ABC, but the linker linked map_events before these objects for some reason. perhaps it was compiling and linking 2 folders at the same time? */
- data/gray_sun.o(.rodata);
- data/sparkle.o(.rodata);
- data/unused_paw.o(.rodata);
- data/unused_hit.o(.rodata);
- data/unused_orb2.o(.rodata);
- src/task.o(.rodata);
- src/battle_anim_status_effects.o(.rodata);
- src/title_screen.o(.rodata);
- src/field_weather.o(.rodata);
- src/field_weather_effects.o(.rodata);
- src/field_screen_effect.o(.rodata);
- src/battle_setup.o(.rodata);
- src/cable_club.o(.rodata);
- src/debug/tomomichi_debug_menu.o(.rodata);
- src/debug/nohara_debug_menu.o(.rodata);
- src/debug/mori_debug_menu.o(.rodata);
- src/debug/taya_debug_window.o(.rodata);
- src/trainer_see.o(.rodata);
- src/wild_encounter.o(.rodata);
- src/field_effect.o(.rodata);
- src/pokemon_menu.o(.rodata);
- src/option_menu.o(.rodata);
- src/pokedex.o(.rodata);
- src/trainer_card.o(.rodata);
- src/battle_party_menu.o(.rodata);
- src/pokemon_storage_system.o(.rodata);
- src/pokemon_storage_system_2.o(.rodata);
- src/pokemon_storage_system_3.o(.rodata);
- src/pokemon_storage_system_4.o(.rodata);
- data/pokemon_storage_system.o(.rodata);
- src/pokemon_icon.o(.rodata);
- src/pokemon_summary_screen.o(.rodata);
- src/fldeff_cut.o(.rodata);
- src/debug/kagaya_debug_menu.o(.rodata);
- src/item_menu.o(.rodata);
- src/battle_anim_mon_movement.o(.rodata);
- src/item.o(.rodata);
- src/debug/matsuda_debug_menu.o(.rodata);
- data/contest.o(.rodata);
- src/shop.o(.rodata);
- src/fldeff_escalator.o(.rodata);
- src/berry.o(.rodata);
- src/debug/watanabe_debug_menu.o(.rodata);
+ src/debug/start_menu_debug.o(.rodata*);
+ src/menu.o(.rodata*);
+ src/tileset_anim.o(.rodata*);
+ src/palette.o(.rodata*);
+ src/sound.o(.rodata*);
+ src/battle_anim.o(.rodata*);
+ src/rom_8077ABC.o(.rodata*);
+ data/map_events.o(.rodata*);
+ data/unused_orb.o(.rodata*); /* these files are clearly the rodata for latter part of rom_8077ABC, but the linker linked map_events before these objects for some reason. perhaps it was compiling and linking 2 folders at the same time? */
+ data/gray_sun.o(.rodata*);
+ data/sparkle.o(.rodata*);
+ data/unused_paw.o(.rodata*);
+ data/unused_hit.o(.rodata*);
+ data/unused_orb2.o(.rodata*);
+ src/task.o(.rodata*);
+ src/reshow_battle_screen.o(.rodata*);
+ src/battle_anim_status_effects.o(.rodata*);
+ src/title_screen.o(.rodata*);
+ src/field_weather.o(.rodata*);
+ src/field_weather_effects.o(.rodata*);
+ src/field_fadetransition.o(.rodata*);
+ src/field_screen_effect.o(.rodata*);
+ src/battle_setup.o(.rodata*);
+ src/cable_club.o(.rodata*);
+ src/debug/tomomichi_debug_menu.o(.rodata*);
+ src/debug/nohara_debug_menu.o(.rodata*);
+ src/debug/mori_debug_menu.o(.rodata*);
+ src/debug/taya_debug_window.o(.rodata*);
+ src/trainer_see.o(.rodata*);
+ src/wild_encounter.o(.rodata*);
+ src/field_effect.o(.rodata*);
+ src/scanline_effect.o(.rodata*);
+ src/pokemon_menu.o(.rodata*);
+ src/option_menu.o(.rodata*);
+ src/pokedex.o(.rodata*);
+ src/trainer_card.o(.rodata*);
+ src/battle_party_menu.o(.rodata*);
+ src/pokemon_storage_system.o(.rodata*);
+ src/pokemon_storage_system_2.o(.rodata*);
+ src/pokemon_storage_system_3.o(.rodata*);
+ src/pokemon_storage_system_4.o(.rodata*);
+ data/pokemon_storage_system.o(.rodata*);
+ src/pokemon_icon.o(.rodata*);
+ src/pokemon_summary_screen.o(.rodata*);
+ src/fldeff_cut.o(.rodata*);
+ src/debug/kagaya_debug_menu.o(.rodata*);
+ src/item_menu.o(.rodata*);
+ src/battle_anim_mon_movement.o(.rodata*);
+ src/item.o(.rodata*);
+ src/debug/matsuda_debug_menu.o(.rodata*);
+ src/contest.o(.rodata*);
+ data/contest.o(.rodata*);
+ src/shop.o(.rodata*);
+ src/fldeff_escalator.o(.rodata*);
+ src/berry.o(.rodata*);
+ src/debug/watanabe_debug_menu.o(.rodata*);
src/debug/watanabe_debug_menu.o(.data);
- src/script_menu.o(.rodata);
- src/naming_screen.o(.rodata);
- src/money.o(.rodata);
- src/contest_effect.o(.rodata);
+ src/script_menu.o(.rodata*);
+ src/naming_screen.o(.rodata*);
+ src/money.o(.rodata*);
+ src/contest_effect.o(.rodata*);
src/record_mixing.o(.data);
- src/record_mixing.o(.rodata);
- src/debug/sound_check_menu.o(.rodata);
- src/secret_base.o(.rodata);
- src/tv.o(.rodata);
- src/contest_link_80C2020.o(.rodata);
- src/pokemon_size_record.o(.rodata);
- src/pc_screen_effect.o(.rodata);
+ src/record_mixing.o(.rodata*);
+ src/debug/sound_check_menu.o(.rodata*);
+ src/secret_base.o(.rodata*);
+ src/tv.o(.rodata*);
+ src/contest_link_80C2020.o(.rodata*);
+ src/script_pokemon_util_80C4BF0.o(.rodata*);
+ src/pokemon_size_record.o(.rodata*);
+ src/pc_screen_effect.o(.rodata*);
src/pc_screen_effect.o(.data);
- src/fldeff_secretpower.o(.rodata);
- src/fldeff_decoration.o(.rodata);
- src/fldeff_recordmixing.o(.rodata);
- src/field_special_scene.o(.rodata);
- src/rotating_gate.o(.rodata);
- src/item_use.o(.rodata);
- src/battle/anim/powder.o(.rodata);
- src/battle/anim/orbs.o(.rodata);
- src/battle/anim/seed.o(.rodata);
- src/battle/anim/orbit.o(.rodata);
- src/battle/anim/leaf.o(.rodata);
- src/battle/anim/tendrils.o(.rodata);
- src/battle/anim/copy_orb.o(.rodata);
- src/battle/anim/roots.o(.rodata);
- src/battle/anim/osmose.o(.rodata);
- src/battle/anim/hop.o(.rodata);
- src/battle/anim/heal.o(.rodata);
- src/battle/anim/hop_2.o(.rodata);
- src/battle/anim/switch.o(.rodata);
- src/battle/anim/flying_path.o(.rodata);
- src/battle/anim/flying_petals.o(.rodata);
- src/battle/anim/shimmer.o(.rodata);
- src/battle/anim/homing.o(.rodata);
- src/battle/anim/whip.o(.rodata);
- src/battle/anim/unused_1.o(.rodata);
- src/battle/anim/slice.o(.rodata);
- src/battle/anim/unused_2.o(.rodata);
- src/battle/anim/shield.o(.rodata);
- src/battle/anim/bottle.o(.rodata);
- src/battle/anim/glitter.o(.rodata);
- src/battle/anim/unused_3.o(.rodata);
- src/battle/anim/sleep.o(.rodata);
- src/battle/anim/scan.o(.rodata);
- src/battle/anim/lunge.o(.rodata);
- src/battle/anim/slash.o(.rodata);
- src/battle/anim/brace.o(.rodata);
- src/battle/anim/cube.o(.rodata);
- src/battle/anim/tile.o(.rodata);
- src/battle/anim/moon.o(.rodata);
- src/battle/anim/twinkle.o(.rodata);
- src/battle/anim/strike.o(.rodata);
- src/battle/anim/fang.o(.rodata);
- src/battle/anim/musical.o(.rodata);
- src/battle/anim/thought.o(.rodata);
- src/battle/anim/finger.o(.rodata);
- src/battle/anim/unused_5.o(.rodata);
- src/battle/anim/unused_6.o(.rodata);
- src/battle/anim/unused_7.o(.rodata);
- src/battle/anim/unused_8.o(.rodata);
- src/battle/anim/alert.o(.rodata);
- src/battle/anim/sword.o(.rodata);
- src/battle/anim/sonic.o(.rodata);
- src/battle/anim/egg.o(.rodata);
- src/battle/anim/unused_9.o(.rodata);
- src/battle/anim/money.o(.rodata);
- src/battle/anim/bullet.o(.rodata);
- src/battle/anim/cyclone.o(.rodata);
- src/battle/anim/grip.o(.rodata);
- src/battle/anim/guillotine.o(.rodata);
- src/battle/anim/splash.o(.rodata);
- src/battle/anim/grow.o(.rodata);
- src/battle/anim/breath.o(.rodata);
- src/battle/anim/anger.o(.rodata);
- src/battle/anim/thrashing.o(.rodata);
- src/battle/anim/draw.o(.rodata);
- src/battle/anim/ring.o(.rodata);
- src/battle/anim/espeed.o(.rodata);
- src/battle/anim/heal_bell.o(.rodata);
- src/battle/anim/heart_1.o(.rodata);
- src/battle/anim/startle.o(.rodata);
- src/battle/anim/blow_kiss.o(.rodata);
- src/battle/anim/kiss_fountain.o(.rodata);
- src/battle/anim/flying_hearts.o(.rodata);
- src/battle/anim/hidden_power_orbit.o(.rodata);
- src/battle/anim/spit.o(.rodata);
- src/battle/anim/perceive.o(.rodata);
- src/battle/anim/angel.o(.rodata);
- src/battle/anim/angel_kiss.o(.rodata);
- src/battle/anim/devil.o(.rodata);
- src/battle/anim/swipe.o(.rodata);
- src/battle/anim/struggle.o(.rodata);
- src/battle/anim/uproar.o(.rodata);
- src/battle/anim/noise.o(.rodata);
- src/battle/anim/note_spin.o(.rodata);
- src/battle/anim/guard.o(.rodata);
- src/battle/anim/rain.o(.rodata);
- src/battle/anim/bubble.o(.rodata);
- src/battle/anim/aurora.o(.rodata);
- src/battle/anim/energy_wave.o(.rodata);
- src/battle/anim/water.o(.rodata);
- src/battle/anim/fire.o(.rodata);
- src/battle/anim/sunlight.o(.rodata);
- src/battle/anim/fire_2.o(.rodata);
- src/battle/anim/wisp_orb.o(.rodata);
- src/battle/anim/wisp_fire.o(.rodata);
- src/battle/anim/thunder.o(.rodata);
- src/battle/anim/beta_beat_up.o(.rodata);
- src/battle/anim/shock.o(.rodata);
- src/battle/anim/current.o(.rodata);
- src/battle/anim/ice.o(.rodata);
- src/battle/anim/fight.o(.rodata);
- src/battle/anim/poison.o(.rodata);
- src/battle/anim/flying.o(.rodata);
- src/battle/anim/psychic.o(.rodata);
- src/battle/anim/bug.o(.rodata);
- src/battle/anim/rock.o(.rodata);
- src/battle/anim/ghost.o(.rodata);
- src/battle/anim/dragon.o(.rodata);
- src/battle/anim/dark.o(.rodata);
- src/battle/anim/ground.o(.rodata);
- src/battle/anim/normal.o(.rodata);
- src/battle/anim/battle_intro.o(.rodata);
- src/bike.o(.rodata);
- src/easy_chat_1.o(.rodata);
- src/easy_chat_2.o(.rodata);
+ src/fldeff_secretpower.o(.rodata*);
+ src/fldeff_secret_base_pc.o(.rodata*);
+ src/fldeff_decoration.o(.rodata*);
+ src/fldeff_recordmixing.o(.rodata*);
+ src/field_special_scene.o(.rodata*);
+ src/rotating_gate.o(.rodata*);
+ src/contest_link_80C857C.o(.rodata*);
+ src/item_use.o(.rodata*);
+ src/battle/anim/powder.o(.rodata*);
+ src/battle/anim/orbs.o(.rodata*);
+ src/battle/anim/seed.o(.rodata*);
+ src/battle/anim/orbit.o(.rodata*);
+ src/battle/anim/leaf.o(.rodata*);
+ src/battle/anim/tendrils.o(.rodata*);
+ src/battle/anim/copy_orb.o(.rodata*);
+ src/battle/anim/roots.o(.rodata*);
+ src/battle/anim/osmose.o(.rodata*);
+ src/battle/anim/hop.o(.rodata*);
+ src/battle/anim/heal.o(.rodata*);
+ src/battle/anim/hop_2.o(.rodata*);
+ src/battle/anim/switch.o(.rodata*);
+ src/battle/anim/flying_path.o(.rodata*);
+ src/battle/anim/flying_petals.o(.rodata*);
+ src/battle/anim/shimmer.o(.rodata*);
+ src/battle/anim/homing.o(.rodata*);
+ src/battle/anim/whip.o(.rodata*);
+ src/battle/anim/unused_1.o(.rodata*);
+ src/battle/anim/slice.o(.rodata*);
+ src/battle/anim/unused_2.o(.rodata*);
+ src/battle/anim/shield.o(.rodata*);
+ src/battle/anim/bottle.o(.rodata*);
+ src/battle/anim/glitter.o(.rodata*);
+ src/battle/anim/unused_3.o(.rodata*);
+ src/battle/anim/sleep.o(.rodata*);
+ src/battle/anim/scan.o(.rodata*);
+ src/battle/anim/lunge.o(.rodata*);
+ src/battle/anim/slash.o(.rodata*);
+ src/battle/anim/brace.o(.rodata*);
+ src/battle/anim/cube.o(.rodata*);
+ src/battle/anim/tile.o(.rodata*);
+ src/battle/anim/moon.o(.rodata*);
+ src/battle/anim/twinkle.o(.rodata*);
+ src/battle/anim/strike.o(.rodata*);
+ src/battle/anim/fang.o(.rodata*);
+ src/battle/anim/musical.o(.rodata*);
+ src/battle/anim/thought.o(.rodata*);
+ src/battle/anim/finger.o(.rodata*);
+ src/battle/anim/unused_5.o(.rodata*);
+ src/battle/anim/unused_6.o(.rodata*);
+ src/battle/anim/unused_7.o(.rodata*);
+ src/battle/anim/unused_8.o(.rodata*);
+ src/battle/anim/alert.o(.rodata*);
+ src/battle/anim/sword.o(.rodata*);
+ src/battle/anim/sonic.o(.rodata*);
+ src/battle/anim/egg.o(.rodata*);
+ src/battle/anim/unused_9.o(.rodata*);
+ src/battle/anim/money.o(.rodata*);
+ src/battle/anim/bullet.o(.rodata*);
+ src/battle/anim/cyclone.o(.rodata*);
+ src/battle/anim/grip.o(.rodata*);
+ src/battle/anim/guillotine.o(.rodata*);
+ src/battle/anim/shadow_minimize.o(.rodata*);
+ src/battle/anim/splash.o(.rodata*);
+ src/battle/anim/grow.o(.rodata*);
+ src/battle/anim/breath.o(.rodata*);
+ src/battle/anim/anger.o(.rodata*);
+ src/battle/anim/thrashing.o(.rodata*);
+ src/battle/anim/draw.o(.rodata*);
+ src/battle/anim/ring.o(.rodata*);
+ src/battle/anim/espeed.o(.rodata*);
+ src/battle/anim/heal_bell.o(.rodata*);
+ src/battle/anim/heart_1.o(.rodata*);
+ src/battle/anim/startle.o(.rodata*);
+ src/battle/anim/blow_kiss.o(.rodata*);
+ src/battle/anim/kiss_fountain.o(.rodata*);
+ src/battle/anim/flying_hearts.o(.rodata*);
+ src/battle/anim/love_bg.o(.rodata*);
+ src/battle/anim/scary_face.o(.rodata*);
+ src/battle/anim/hidden_power_orbit.o(.rodata*);
+ src/battle/anim/spit.o(.rodata*);
+ src/battle/anim/perceive.o(.rodata*);
+ src/battle/anim/angel.o(.rodata*);
+ src/battle/anim/angel_kiss.o(.rodata*);
+ src/battle/anim/devil.o(.rodata*);
+ src/battle/anim/swipe.o(.rodata*);
+ src/battle/anim/struggle.o(.rodata*);
+ src/battle/anim/uproar.o(.rodata*);
+ src/battle/anim/noise.o(.rodata*);
+ src/battle/anim/note_spin.o(.rodata*);
+ src/battle/anim/guard.o(.rodata*);
+ src/battle/anim/rain.o(.rodata*);
+ src/battle/anim/bubble.o(.rodata*);
+ src/battle/anim/aurora.o(.rodata*);
+ src/battle/anim/energy_wave.o(.rodata*);
+ src/battle/anim/water.o(.rodata*);
+ src/battle/anim/fire.o(.rodata*);
+ src/battle/anim/sunlight.o(.rodata*);
+ src/battle/anim/fire_2.o(.rodata*);
+ src/battle/anim/wisp_orb.o(.rodata*);
+ src/battle/anim/wisp_fire.o(.rodata*);
+ src/battle/anim/thunder.o(.rodata*);
+ src/battle/anim/beta_beat_up.o(.rodata*);
+ src/battle/anim/shock.o(.rodata*);
+ src/battle/anim/current.o(.rodata*);
+ src/battle/anim/ice.o(.rodata*);
+ src/battle/anim/fight.o(.rodata*);
+ src/battle/anim/poison.o(.rodata*);
+ src/battle/anim/flying.o(.rodata*);
+ src/battle/anim/psychic.o(.rodata*);
+ src/battle/anim/bug.o(.rodata*);
+ src/battle/anim/rock.o(.rodata*);
+ src/battle/anim/ghost.o(.rodata*);
+ src/battle/anim/dragon.o(.rodata*);
+ src/battle/anim/dark.o(.rodata*);
+ src/battle/anim/ground.o(.rodata*);
+ src/battle/anim/normal.o(.rodata*);
+ src/battle/anim/battle_intro.o(.rodata*);
+ src/bike.o(.rodata*);
+ src/easy_chat_1.o(.rodata*);
+ src/easy_chat_2.o(.rodata*);
src/easy_chat_2.o(.data);
- src/pokenav_before.o(.rodata);
- src/pokenav.o(.rodata);
- src/trainers_eye.o(.rodata);
- src/mon_markings.o(.rodata);
- src/mauville_man.o(.rodata);
- src/mail.o(.rodata);
- src/menu_helpers.o(.rodata);
- src/heal_location.o(.rodata);
- src/region_map.o(.rodata);
- data/contest_painting_effects.o(.rodata);
- src/decoration.o(.rodata);
- src/slot_machine.o(.rodata);
- src/contest_painting.o(.rodata);
- src/battle_ai_script_commands.o(.rodata);
- src/trader.o(.rodata);
- src/starter_choose.o(.rodata);
- src/wallclock.o(.rodata);
- src/pokeblock.o(.rodata);
- src/fldeff_flash.o(.rodata);
- src/time_events.o(.rodata);
- src/field_specials.o(.rodata);
- src/battle_records.o(.rodata);
- src/pokedex_area_screen.o(.rodata);
- src/evolution_scene.o(.rodata);
- src/roulette.o(.rodata);
- src/roulette_gfx.o(.rodata);
- src/pokedex_cry_screen.o(.rodata);
+ src/pokenav_before.o(.rodata*);
+ src/pokenav.o(.rodata*);
+ src/trainers_eye.o(.rodata*);
+ src/mon_markings.o(.rodata*);
+ src/mauville_man.o(.rodata*);
+ src/mail.o(.rodata*);
+ src/menu_helpers.o(.rodata*);
+ src/script_pokemon_util_80F99CC.o(.rodata*);
+ src/heal_location.o(.rodata*);
+ src/region_map.o(.rodata*);
+ src/contest_painting_effects.o(.rodata*);
+ data/contest_painting_effects.o(.rodata*);
+ src/decoration.o(.rodata*);
+ src/slot_machine.o(.rodata*);
+ src/contest_painting.o(.rodata*);
+ src/battle_ai_script_commands.o(.rodata*);
+ src/trader.o(.rodata*);
+ src/starter_choose.o(.rodata*);
+ src/wallclock.o(.rodata*);
+ src/pokeblock.o(.rodata*);
+ src/fldeff_flash.o(.rodata*);
+ src/time_events.o(.rodata*);
+ src/field_specials.o(.rodata*);
+ src/battle_records.o(.rodata*);
+ src/pokedex_area_screen.o(.rodata*);
+ src/evolution_scene.o(.rodata*);
+ src/roulette.o(.rodata*);
+ src/roulette_gfx.o(.rodata*);
+ src/pokedex_cry_screen.o(.rodata*);
src/pokedex_cry_screen.o(.data);
- src/landmark.o(.rodata);
- src/battle_transition.o(.rodata);
- src/battle_controller_link_partner.o(.rodata);
- src/battle_message.o(.rodata);
- src/choose_party.o(.rodata);
- src/cable_car.o(.rodata);
- src/save.o(.rodata);
- src/debug/ereader_debug_menu.o(.rodata);
- src/field_effect_helpers.o(.rodata);
- src/contest_ai.o(.rodata);
- src/battle_controller_safari.o(.rodata);
- src/battle_anim_effects_3.o(.rodata);
- src/move_tutor_menu.o(.rodata);
- src/decoration_inventory.o(.rodata);
- src/roamer.o(.rodata);
- src/battle_tower.o(.rodata);
- src/use_pokeblock.o(.rodata);
- src/battle_controller_wally.o(.rodata);
- src/player_pc.o(.rodata);
- src/intro.o(.rodata);
- src/battle_anim_special.o(.rodata);
- src/hall_of_fame.o(.rodata);
- src/credits.o(.rodata);
- src/lottery_corner.o(.rodata);
- src/diploma.o(.rodata);
- src/strings.o(.rodata);
- src/berry_tag_screen.o(.rodata);
- src/mystery_event_menu.o(.rodata);
- src/save_failed_screen.o(.rodata);
- src/pokeblock_feed.o(.rodata);
- src/debug/nakamura_debug_menu.o(.rodata);
- src/intro_credits_graphics.o(.rodata);
- src/evolution_graphics.o(.rodata);
- src/bard_music.o(.rodata);
- src/debug/unknown_debug_menu.o(.rodata);
- data/strings2.o(.rodata);
- src/menu_cursor.o(.rodata);
- src/mystery_event_msg.o(.rodata);
- data/debug_mystery_event_scripts.o(.rodata);
- src/libs/m4a_tables.o(.rodata);
- data/sound_data.o(.rodata);
+ src/landmark.o(.rodata*);
+ src/battle_transition.o(.rodata*);
+ src/battle_controller_link_partner.o(.rodata*);
+ src/battle_message.o(.rodata*);
+ src/choose_party.o(.rodata*);
+ src/cable_car.o(.rodata*);
+ src/save.o(.rodata*);
+ src/debug/ereader_debug_menu.o(.rodata*);
+ src/field_effect_helpers.o(.rodata*);
+ src/contest_ai.o(.rodata*);
+ src/battle_controller_safari.o(.rodata*);
+ src/battle_anim_effects_3.o(.rodata*);
+ src/move_tutor_menu.o(.rodata*);
+ src/decoration_inventory.o(.rodata*);
+ src/roamer.o(.rodata*);
+ src/battle_tower.o(.rodata*);
+ src/use_pokeblock.o(.rodata*);
+ src/battle_controller_wally.o(.rodata*);
+ src/player_pc.o(.rodata*);
+ src/intro.o(.rodata*);
+ src/field_region_map.o(.rodata*);
+ src/battle_anim_special.o(.rodata*);
+ src/hall_of_fame.o(.rodata*);
+ src/credits.o(.rodata*);
+ src/lottery_corner.o(.rodata*);
+ src/diploma.o(.rodata*);
+ src/strings.o(.rodata*);
+ src/berry_tag_screen.o(.rodata*);
+ src/mystery_event_menu.o(.rodata*);
+ src/save_failed_screen.o(.rodata*);
+ src/braille_puzzles.o(.rodata*);
+ src/pokeblock_feed.o(.rodata*);
+ src/debug/nakamura_debug_menu.o(.rodata*);
+ src/intro_credits_graphics.o(.rodata*);
+ src/evolution_graphics.o(.rodata*);
+ src/bard_music.o(.rodata*);
+ src/debug/unknown_debug_menu.o(.rodata*);
+ data/strings2.o(.rodata*);
+ src/menu_cursor.o(.rodata*);
+ src/mystery_event_msg.o(.rodata*);
+ data/debug_mystery_event_scripts.o(.rodata*);
+ src/libs/m4a_tables.o(.rodata*);
+ data/sound_data.o(.rodata*);
} =0
song_data :
ALIGN(4)
{
- sound/songs/se_stop.o(.rodata);
- sound/songs/se_kaifuku.o(.rodata);
- sound/songs/se_pc_logon.o(.rodata);
- sound/songs/se_pc_off.o(.rodata);
- sound/songs/se_pc_on.o(.rodata);
- sound/songs/se_select.o(.rodata);
- sound/songs/se_win_open.o(.rodata);
- sound/songs/se_wall_hit.o(.rodata);
- sound/songs/se_door.o(.rodata);
- sound/songs/se_kaidan.o(.rodata);
- sound/songs/se_dansa.o(.rodata);
- sound/songs/se_jitensya.o(.rodata);
- sound/songs/se_kouka_l.o(.rodata);
- sound/songs/se_kouka_m.o(.rodata);
- sound/songs/se_kouka_h.o(.rodata);
- sound/songs/se_bowa2.o(.rodata);
- sound/songs/se_poke_dead.o(.rodata);
- sound/songs/se_nigeru.o(.rodata);
- sound/songs/se_jido_doa.o(.rodata);
- sound/songs/se_naminori.o(.rodata);
- sound/songs/se_ban.o(.rodata);
- sound/songs/se_pin.o(.rodata);
- sound/songs/se_boo.o(.rodata);
- sound/songs/se_bowa.o(.rodata);
- sound/songs/se_jyuni.o(.rodata);
- sound/songs/se_a.o(.rodata);
- sound/songs/se_i.o(.rodata);
- sound/songs/se_u.o(.rodata);
- sound/songs/se_e.o(.rodata);
- sound/songs/se_o.o(.rodata);
- sound/songs/se_n.o(.rodata);
- sound/songs/se_seikai.o(.rodata);
- sound/songs/se_hazure.o(.rodata);
- sound/songs/se_exp.o(.rodata);
- sound/songs/se_jite_pyoko.o(.rodata);
- sound/songs/se_mu_pachi.o(.rodata);
- sound/songs/se_tk_kasya.o(.rodata);
- sound/songs/se_fu_zaku.o(.rodata);
- sound/songs/se_fu_zaku2.o(.rodata);
- sound/songs/se_fu_zuzuzu.o(.rodata);
- sound/songs/se_ru_gashin.o(.rodata);
- sound/songs/se_ru_gasyan.o(.rodata);
- sound/songs/se_ru_bari.o(.rodata);
- sound/songs/se_ru_hyuu.o(.rodata);
- sound/songs/se_ki_gasyan.o(.rodata);
- sound/songs/se_tk_warpin.o(.rodata);
- sound/songs/se_tk_warpout.o(.rodata);
- sound/songs/se_tu_saa.o(.rodata);
- sound/songs/se_hi_turun.o(.rodata);
- sound/songs/se_track_move.o(.rodata);
- sound/songs/se_track_stop.o(.rodata);
- sound/songs/se_track_haik.o(.rodata);
- sound/songs/se_track_door.o(.rodata);
- sound/songs/se_moter.o(.rodata);
- sound/songs/se_card.o(.rodata);
- sound/songs/se_save.o(.rodata);
- sound/songs/se_kon.o(.rodata);
- sound/songs/se_kon2.o(.rodata);
- sound/songs/se_kon3.o(.rodata);
- sound/songs/se_kon4.o(.rodata);
- sound/songs/se_suikomu.o(.rodata);
- sound/songs/se_nageru.o(.rodata);
- sound/songs/se_toy_c.o(.rodata);
- sound/songs/se_toy_d.o(.rodata);
- sound/songs/se_toy_e.o(.rodata);
- sound/songs/se_toy_f.o(.rodata);
- sound/songs/se_toy_g.o(.rodata);
- sound/songs/se_toy_a.o(.rodata);
- sound/songs/se_toy_b.o(.rodata);
- sound/songs/se_toy_c1.o(.rodata);
- sound/songs/se_mizu.o(.rodata);
- sound/songs/se_hashi.o(.rodata);
- sound/songs/se_daugi.o(.rodata);
- sound/songs/se_pinpon.o(.rodata);
- sound/songs/se_fuusen1.o(.rodata);
- sound/songs/se_fuusen2.o(.rodata);
- sound/songs/se_fuusen3.o(.rodata);
- sound/songs/se_toy_kabe.o(.rodata);
- sound/songs/se_toy_dango.o(.rodata);
- sound/songs/se_doku.o(.rodata);
- sound/songs/se_esuka.o(.rodata);
- sound/songs/se_t_ame.o(.rodata);
- sound/songs/se_t_ame_e.o(.rodata);
- sound/songs/se_t_ooame.o(.rodata);
- sound/songs/se_t_ooame_e.o(.rodata);
- sound/songs/se_t_koame.o(.rodata);
- sound/songs/se_t_koame_e.o(.rodata);
- sound/songs/se_t_kami.o(.rodata);
- sound/songs/se_t_kami2.o(.rodata);
- sound/songs/se_elebeta.o(.rodata);
- sound/songs/se_hinsi.o(.rodata);
- sound/songs/se_expmax.o(.rodata);
- sound/songs/se_tamakoro.o(.rodata);
- sound/songs/se_tamakoro_e.o(.rodata);
- sound/songs/se_basabasa.o(.rodata);
- sound/songs/se_regi.o(.rodata);
- sound/songs/se_c_gaji.o(.rodata);
- sound/songs/se_c_maku_u.o(.rodata);
- sound/songs/se_c_maku_d.o(.rodata);
- sound/songs/se_c_pasi.o(.rodata);
- sound/songs/se_c_syu.o(.rodata);
- sound/songs/se_c_pikon.o(.rodata);
- sound/songs/se_reapoke.o(.rodata);
- sound/songs/se_op_basyu.o(.rodata);
- sound/songs/se_bt_start.o(.rodata);
- sound/songs/se_dendou.o(.rodata);
- sound/songs/se_jihanki.o(.rodata);
- sound/songs/se_tama.o(.rodata);
- sound/songs/se_z_scroll.o(.rodata);
- sound/songs/se_z_page.o(.rodata);
- sound/songs/se_pn_on.o(.rodata);
- sound/songs/se_pn_off.o(.rodata);
- sound/songs/se_z_search.o(.rodata);
- sound/songs/se_tamago.o(.rodata);
- sound/songs/se_tb_start.o(.rodata);
- sound/songs/se_tb_kon.o(.rodata);
- sound/songs/se_tb_kara.o(.rodata);
- sound/songs/se_bidoro.o(.rodata);
- sound/songs/se_w085.o(.rodata);
- sound/songs/se_w085b.o(.rodata);
- sound/songs/se_w231.o(.rodata);
- sound/songs/se_w171.o(.rodata);
- sound/songs/se_w233.o(.rodata);
- sound/songs/se_w233b.o(.rodata);
- sound/songs/se_w145.o(.rodata);
- sound/songs/se_w145b.o(.rodata);
- sound/songs/se_w145c.o(.rodata);
- sound/songs/se_w240.o(.rodata);
- sound/songs/se_w015.o(.rodata);
- sound/songs/se_w081.o(.rodata);
- sound/songs/se_w081b.o(.rodata);
- sound/songs/se_w088.o(.rodata);
- sound/songs/se_w016.o(.rodata);
- sound/songs/se_w016b.o(.rodata);
- sound/songs/se_w003.o(.rodata);
- sound/songs/se_w104.o(.rodata);
- sound/songs/se_w013.o(.rodata);
- sound/songs/se_w196.o(.rodata);
- sound/songs/se_w086.o(.rodata);
- sound/songs/se_w004.o(.rodata);
- sound/songs/se_w025.o(.rodata);
- sound/songs/se_w025b.o(.rodata);
- sound/songs/se_w152.o(.rodata);
- sound/songs/se_w026.o(.rodata);
- sound/songs/se_w172.o(.rodata);
- sound/songs/se_w172b.o(.rodata);
- sound/songs/se_w053.o(.rodata);
- sound/songs/se_w007.o(.rodata);
- sound/songs/se_w092.o(.rodata);
- sound/songs/se_w221.o(.rodata);
- sound/songs/se_w221b.o(.rodata);
- sound/songs/se_w052.o(.rodata);
- sound/songs/se_w036.o(.rodata);
- sound/songs/se_w059.o(.rodata);
- sound/songs/se_w059b.o(.rodata);
- sound/songs/se_w010.o(.rodata);
- sound/songs/se_w011.o(.rodata);
- sound/songs/se_w017.o(.rodata);
- sound/songs/se_w019.o(.rodata);
- sound/songs/se_w028.o(.rodata);
- sound/songs/se_w013b.o(.rodata);
- sound/songs/se_w044.o(.rodata);
- sound/songs/se_w029.o(.rodata);
- sound/songs/se_w057.o(.rodata);
- sound/songs/se_w056.o(.rodata);
- sound/songs/se_w250.o(.rodata);
- sound/songs/se_w030.o(.rodata);
- sound/songs/se_w039.o(.rodata);
- sound/songs/se_w054.o(.rodata);
- sound/songs/se_w077.o(.rodata);
- sound/songs/se_w020.o(.rodata);
- sound/songs/se_w082.o(.rodata);
- sound/songs/se_w047.o(.rodata);
- sound/songs/se_w195.o(.rodata);
- sound/songs/se_w006.o(.rodata);
- sound/songs/se_w091.o(.rodata);
- sound/songs/se_w146.o(.rodata);
- sound/songs/se_w120.o(.rodata);
- sound/songs/se_w153.o(.rodata);
- sound/songs/se_w071b.o(.rodata);
- sound/songs/se_w071.o(.rodata);
- sound/songs/se_w103.o(.rodata);
- sound/songs/se_w062.o(.rodata);
- sound/songs/se_w062b.o(.rodata);
- sound/songs/se_w048.o(.rodata);
- sound/songs/se_w187.o(.rodata);
- sound/songs/se_w118.o(.rodata);
- sound/songs/se_w155.o(.rodata);
- sound/songs/se_w122.o(.rodata);
- sound/songs/se_w060.o(.rodata);
- sound/songs/se_w185.o(.rodata);
- sound/songs/se_w014.o(.rodata);
- sound/songs/se_w043.o(.rodata);
- sound/songs/se_w207.o(.rodata);
- sound/songs/se_w207b.o(.rodata);
- sound/songs/se_w215.o(.rodata);
- sound/songs/se_w109.o(.rodata);
- sound/songs/se_w173.o(.rodata);
- sound/songs/se_w280.o(.rodata);
- sound/songs/se_w202.o(.rodata);
- sound/songs/se_w060b.o(.rodata);
- sound/songs/se_w076.o(.rodata);
- sound/songs/se_w080.o(.rodata);
- sound/songs/se_w100.o(.rodata);
- sound/songs/se_w107.o(.rodata);
- sound/songs/se_w166.o(.rodata);
- sound/songs/se_w129.o(.rodata);
- sound/songs/se_w115.o(.rodata);
- sound/songs/se_w112.o(.rodata);
- sound/songs/se_w197.o(.rodata);
- sound/songs/se_w199.o(.rodata);
- sound/songs/se_w236.o(.rodata);
- sound/songs/se_w204.o(.rodata);
- sound/songs/se_w268.o(.rodata);
- sound/songs/se_w070.o(.rodata);
- sound/songs/se_w063.o(.rodata);
- sound/songs/se_w127.o(.rodata);
- sound/songs/se_w179.o(.rodata);
- sound/songs/se_w151.o(.rodata);
- sound/songs/se_w201.o(.rodata);
- sound/songs/se_w161.o(.rodata);
- sound/songs/se_w161b.o(.rodata);
- sound/songs/se_w227.o(.rodata);
- sound/songs/se_w227b.o(.rodata);
- sound/songs/se_w226.o(.rodata);
- sound/songs/se_w208.o(.rodata);
- sound/songs/se_w213.o(.rodata);
- sound/songs/se_w213b.o(.rodata);
- sound/songs/se_w234.o(.rodata);
- sound/songs/se_w260.o(.rodata);
- sound/songs/se_w328.o(.rodata);
- sound/songs/se_w320.o(.rodata);
- sound/songs/se_w255.o(.rodata);
- sound/songs/se_w291.o(.rodata);
- sound/songs/se_w089.o(.rodata);
- sound/songs/se_w239.o(.rodata);
- sound/songs/se_w230.o(.rodata);
- sound/songs/se_w281.o(.rodata);
- sound/songs/se_w327.o(.rodata);
- sound/songs/se_w287.o(.rodata);
- sound/songs/se_w257.o(.rodata);
- sound/songs/se_w253.o(.rodata);
- sound/songs/se_w258.o(.rodata);
- sound/songs/se_w322.o(.rodata);
- sound/songs/se_w298.o(.rodata);
- sound/songs/se_w287b.o(.rodata);
- sound/songs/se_w114.o(.rodata);
- sound/songs/se_w063b.o(.rodata);
- sound/songs/song_248.o(.rodata);
- sound/songs/song_249.o(.rodata);
- sound/songs/song_250.o(.rodata);
- sound/songs/song_251.o(.rodata);
- sound/songs/song_252.o(.rodata);
- sound/songs/song_253.o(.rodata);
- sound/songs/song_254.o(.rodata);
- sound/songs/song_255.o(.rodata);
- sound/songs/song_256.o(.rodata);
- sound/songs/song_257.o(.rodata);
- sound/songs/song_258.o(.rodata);
- sound/songs/song_259.o(.rodata);
- sound/songs/song_260.o(.rodata);
- sound/songs/song_261.o(.rodata);
- sound/songs/song_262.o(.rodata);
- sound/songs/song_263.o(.rodata);
- sound/songs/song_264.o(.rodata);
- sound/songs/song_265.o(.rodata);
- sound/songs/song_266.o(.rodata);
- sound/songs/song_267.o(.rodata);
- sound/songs/song_268.o(.rodata);
- sound/songs/song_269.o(.rodata);
- sound/songs/song_270.o(.rodata);
- sound/songs/song_271.o(.rodata);
- sound/songs/song_272.o(.rodata);
- sound/songs/song_273.o(.rodata);
- sound/songs/song_274.o(.rodata);
- sound/songs/song_275.o(.rodata);
- sound/songs/song_276.o(.rodata);
- sound/songs/song_277.o(.rodata);
- sound/songs/song_278.o(.rodata);
- sound/songs/song_279.o(.rodata);
- sound/songs/song_280.o(.rodata);
- sound/songs/song_281.o(.rodata);
- sound/songs/song_282.o(.rodata);
- sound/songs/song_283.o(.rodata);
- sound/songs/song_284.o(.rodata);
- sound/songs/song_285.o(.rodata);
- sound/songs/song_286.o(.rodata);
- sound/songs/song_287.o(.rodata);
- sound/songs/song_288.o(.rodata);
- sound/songs/song_289.o(.rodata);
- sound/songs/song_290.o(.rodata);
- sound/songs/song_291.o(.rodata);
- sound/songs/song_292.o(.rodata);
- sound/songs/song_293.o(.rodata);
- sound/songs/song_294.o(.rodata);
- sound/songs/song_295.o(.rodata);
- sound/songs/song_296.o(.rodata);
- sound/songs/song_297.o(.rodata);
- sound/songs/song_298.o(.rodata);
- sound/songs/bgm_tetsuji.o(.rodata);
- sound/songs/bgm_field13.o(.rodata);
- sound/songs/bgm_kachi22.o(.rodata);
- sound/songs/bgm_kachi2.o(.rodata);
- sound/songs/bgm_kachi3.o(.rodata);
- sound/songs/bgm_kachi5.o(.rodata);
- sound/songs/bgm_pcc.o(.rodata);
- sound/songs/bgm_nibi.o(.rodata);
- sound/songs/bgm_suikun.o(.rodata);
- sound/songs/bgm_dooro1.o(.rodata);
- sound/songs/bgm_dooro_x1.o(.rodata);
- sound/songs/bgm_dooro_x3.o(.rodata);
- sound/songs/bgm_machi_s2.o(.rodata);
- sound/songs/bgm_machi_s4.o(.rodata);
- sound/songs/bgm_gim.o(.rodata);
- sound/songs/bgm_naminori.o(.rodata);
- sound/songs/bgm_dan01.o(.rodata);
- sound/songs/bgm_fanfa1.o(.rodata);
- sound/songs/bgm_me_asa.o(.rodata);
- sound/songs/bgm_me_bachi.o(.rodata);
- sound/songs/bgm_fanfa4.o(.rodata);
- sound/songs/bgm_fanfa5.o(.rodata);
- sound/songs/bgm_me_waza.o(.rodata);
- sound/songs/bgm_bijyutu.o(.rodata);
- sound/songs/bgm_dooro_x4.o(.rodata);
- sound/songs/bgm_fune_kan.o(.rodata);
- sound/songs/bgm_me_shinka.o(.rodata);
- sound/songs/bgm_shinka.o(.rodata);
- sound/songs/bgm_me_wasure.o(.rodata);
- sound/songs/bgm_syoujoeye.o(.rodata);
- sound/songs/bgm_boyeye.o(.rodata);
- sound/songs/bgm_dan02.o(.rodata);
- sound/songs/bgm_machi_s3.o(.rodata);
- sound/songs/bgm_odamaki.o(.rodata);
- sound/songs/bgm_b_tower.o(.rodata);
- sound/songs/bgm_swimeye.o(.rodata);
- sound/songs/bgm_dan03.o(.rodata);
- sound/songs/bgm_me_kinomi.o(.rodata);
- sound/songs/bgm_me_tama.o(.rodata);
- sound/songs/bgm_me_b_big.o(.rodata);
- sound/songs/bgm_me_b_small.o(.rodata);
- sound/songs/bgm_me_zannen.o(.rodata);
- sound/songs/bgm_bd_time.o(.rodata);
- sound/songs/bgm_test1.o(.rodata);
- sound/songs/bgm_test2.o(.rodata);
- sound/songs/bgm_test3.o(.rodata);
- sound/songs/bgm_test4.o(.rodata);
- sound/songs/bgm_test.o(.rodata);
- sound/songs/bgm_gomachi0.o(.rodata);
- sound/songs/bgm_gotown.o(.rodata);
- sound/songs/bgm_pokecen.o(.rodata);
- sound/songs/bgm_nextroad.o(.rodata);
- sound/songs/bgm_granroad.o(.rodata);
- sound/songs/bgm_cycling.o(.rodata);
- sound/songs/bgm_friendly.o(.rodata);
- sound/songs/bgm_mishiro.o(.rodata);
- sound/songs/bgm_tozan.o(.rodata);
- sound/songs/bgm_girleye.o(.rodata);
- sound/songs/bgm_minamo.o(.rodata);
- sound/songs/bgm_ashroad.o(.rodata);
- sound/songs/bgm_event0.o(.rodata);
- sound/songs/bgm_deepdeep.o(.rodata);
- sound/songs/bgm_kachi1.o(.rodata);
- sound/songs/bgm_title3.o(.rodata);
- sound/songs/bgm_demo1.o(.rodata);
- sound/songs/bgm_girl_sup.o(.rodata);
- sound/songs/bgm_hageshii.o(.rodata);
- sound/songs/bgm_kakkoii.o(.rodata);
- sound/songs/bgm_kazanbai.o(.rodata);
- sound/songs/bgm_aqa_0.o(.rodata);
- sound/songs/bgm_tsuretek.o(.rodata);
- sound/songs/bgm_boy_sup.o(.rodata);
- sound/songs/bgm_rainbow.o(.rodata);
- sound/songs/bgm_ayasii.o(.rodata);
- sound/songs/bgm_kachi4.o(.rodata);
- sound/songs/bgm_ropeway.o(.rodata);
- sound/songs/bgm_casino.o(.rodata);
- sound/songs/bgm_hightown.o(.rodata);
- sound/songs/bgm_safari.o(.rodata);
- sound/songs/bgm_c_road.o(.rodata);
- sound/songs/bgm_ajito.o(.rodata);
- sound/songs/bgm_m_boat.o(.rodata);
- sound/songs/bgm_m_dungon.o(.rodata);
- sound/songs/bgm_finecity.o(.rodata);
- sound/songs/bgm_machupi.o(.rodata);
- sound/songs/bgm_p_school.o(.rodata);
- sound/songs/bgm_dendou.o(.rodata);
- sound/songs/bgm_tonekusa.o(.rodata);
- sound/songs/bgm_maborosi.o(.rodata);
- sound/songs/bgm_con_fan.o(.rodata);
- sound/songs/bgm_contest0.o(.rodata);
- sound/songs/bgm_mgm0.o(.rodata);
- sound/songs/bgm_t_battle.o(.rodata);
- sound/songs/bgm_ooame.o(.rodata);
- sound/songs/bgm_hideri.o(.rodata);
- sound/songs/bgm_runecity.o(.rodata);
- sound/songs/bgm_con_k.o(.rodata);
- sound/songs/bgm_eikou_r.o(.rodata);
- sound/songs/bgm_karakuri.o(.rodata);
- sound/songs/bgm_hutago.o(.rodata);
- sound/songs/bgm_sitennou.o(.rodata);
- sound/songs/bgm_yama_eye.o(.rodata);
- sound/songs/bgm_conlobby.o(.rodata);
- sound/songs/bgm_inter_v.o(.rodata);
- sound/songs/bgm_daigo.o(.rodata);
- sound/songs/bgm_thankfor.o(.rodata);
- sound/songs/bgm_end.o(.rodata);
- sound/songs/bgm_battle27.o(.rodata);
- sound/songs/bgm_battle31.o(.rodata);
- sound/songs/bgm_battle20.o(.rodata);
- sound/songs/bgm_battle32.o(.rodata);
- sound/songs/bgm_battle33.o(.rodata);
- sound/songs/bgm_battle36.o(.rodata);
- sound/songs/bgm_battle34.o(.rodata);
- sound/songs/bgm_battle35.o(.rodata);
- sound/songs/bgm_battle38.o(.rodata);
- sound/songs/bgm_battle30.o(.rodata);
- sound/songs/bgm_radio_tower_occupied.o(.rodata);
+ sound/songs/se_stop.o(.rodata*);
+ sound/songs/se_kaifuku.o(.rodata*);
+ sound/songs/se_pc_logon.o(.rodata*);
+ sound/songs/se_pc_off.o(.rodata*);
+ sound/songs/se_pc_on.o(.rodata*);
+ sound/songs/se_select.o(.rodata*);
+ sound/songs/se_win_open.o(.rodata*);
+ sound/songs/se_wall_hit.o(.rodata*);
+ sound/songs/se_door.o(.rodata*);
+ sound/songs/se_kaidan.o(.rodata*);
+ sound/songs/se_dansa.o(.rodata*);
+ sound/songs/se_jitensya.o(.rodata*);
+ sound/songs/se_kouka_l.o(.rodata*);
+ sound/songs/se_kouka_m.o(.rodata*);
+ sound/songs/se_kouka_h.o(.rodata*);
+ sound/songs/se_bowa2.o(.rodata*);
+ sound/songs/se_poke_dead.o(.rodata*);
+ sound/songs/se_nigeru.o(.rodata*);
+ sound/songs/se_jido_doa.o(.rodata*);
+ sound/songs/se_naminori.o(.rodata*);
+ sound/songs/se_ban.o(.rodata*);
+ sound/songs/se_pin.o(.rodata*);
+ sound/songs/se_boo.o(.rodata*);
+ sound/songs/se_bowa.o(.rodata*);
+ sound/songs/se_jyuni.o(.rodata*);
+ sound/songs/se_a.o(.rodata*);
+ sound/songs/se_i.o(.rodata*);
+ sound/songs/se_u.o(.rodata*);
+ sound/songs/se_e.o(.rodata*);
+ sound/songs/se_o.o(.rodata*);
+ sound/songs/se_n.o(.rodata*);
+ sound/songs/se_seikai.o(.rodata*);
+ sound/songs/se_hazure.o(.rodata*);
+ sound/songs/se_exp.o(.rodata*);
+ sound/songs/se_jite_pyoko.o(.rodata*);
+ sound/songs/se_mu_pachi.o(.rodata*);
+ sound/songs/se_tk_kasya.o(.rodata*);
+ sound/songs/se_fu_zaku.o(.rodata*);
+ sound/songs/se_fu_zaku2.o(.rodata*);
+ sound/songs/se_fu_zuzuzu.o(.rodata*);
+ sound/songs/se_ru_gashin.o(.rodata*);
+ sound/songs/se_ru_gasyan.o(.rodata*);
+ sound/songs/se_ru_bari.o(.rodata*);
+ sound/songs/se_ru_hyuu.o(.rodata*);
+ sound/songs/se_ki_gasyan.o(.rodata*);
+ sound/songs/se_tk_warpin.o(.rodata*);
+ sound/songs/se_tk_warpout.o(.rodata*);
+ sound/songs/se_tu_saa.o(.rodata*);
+ sound/songs/se_hi_turun.o(.rodata*);
+ sound/songs/se_track_move.o(.rodata*);
+ sound/songs/se_track_stop.o(.rodata*);
+ sound/songs/se_track_haik.o(.rodata*);
+ sound/songs/se_track_door.o(.rodata*);
+ sound/songs/se_moter.o(.rodata*);
+ sound/songs/se_card.o(.rodata*);
+ sound/songs/se_save.o(.rodata*);
+ sound/songs/se_kon.o(.rodata*);
+ sound/songs/se_kon2.o(.rodata*);
+ sound/songs/se_kon3.o(.rodata*);
+ sound/songs/se_kon4.o(.rodata*);
+ sound/songs/se_suikomu.o(.rodata*);
+ sound/songs/se_nageru.o(.rodata*);
+ sound/songs/se_toy_c.o(.rodata*);
+ sound/songs/se_toy_d.o(.rodata*);
+ sound/songs/se_toy_e.o(.rodata*);
+ sound/songs/se_toy_f.o(.rodata*);
+ sound/songs/se_toy_g.o(.rodata*);
+ sound/songs/se_toy_a.o(.rodata*);
+ sound/songs/se_toy_b.o(.rodata*);
+ sound/songs/se_toy_c1.o(.rodata*);
+ sound/songs/se_mizu.o(.rodata*);
+ sound/songs/se_hashi.o(.rodata*);
+ sound/songs/se_daugi.o(.rodata*);
+ sound/songs/se_pinpon.o(.rodata*);
+ sound/songs/se_fuusen1.o(.rodata*);
+ sound/songs/se_fuusen2.o(.rodata*);
+ sound/songs/se_fuusen3.o(.rodata*);
+ sound/songs/se_toy_kabe.o(.rodata*);
+ sound/songs/se_toy_dango.o(.rodata*);
+ sound/songs/se_doku.o(.rodata*);
+ sound/songs/se_esuka.o(.rodata*);
+ sound/songs/se_t_ame.o(.rodata*);
+ sound/songs/se_t_ame_e.o(.rodata*);
+ sound/songs/se_t_ooame.o(.rodata*);
+ sound/songs/se_t_ooame_e.o(.rodata*);
+ sound/songs/se_t_koame.o(.rodata*);
+ sound/songs/se_t_koame_e.o(.rodata*);
+ sound/songs/se_t_kami.o(.rodata*);
+ sound/songs/se_t_kami2.o(.rodata*);
+ sound/songs/se_elebeta.o(.rodata*);
+ sound/songs/se_hinsi.o(.rodata*);
+ sound/songs/se_expmax.o(.rodata*);
+ sound/songs/se_tamakoro.o(.rodata*);
+ sound/songs/se_tamakoro_e.o(.rodata*);
+ sound/songs/se_basabasa.o(.rodata*);
+ sound/songs/se_regi.o(.rodata*);
+ sound/songs/se_c_gaji.o(.rodata*);
+ sound/songs/se_c_maku_u.o(.rodata*);
+ sound/songs/se_c_maku_d.o(.rodata*);
+ sound/songs/se_c_pasi.o(.rodata*);
+ sound/songs/se_c_syu.o(.rodata*);
+ sound/songs/se_c_pikon.o(.rodata*);
+ sound/songs/se_reapoke.o(.rodata*);
+ sound/songs/se_op_basyu.o(.rodata*);
+ sound/songs/se_bt_start.o(.rodata*);
+ sound/songs/se_dendou.o(.rodata*);
+ sound/songs/se_jihanki.o(.rodata*);
+ sound/songs/se_tama.o(.rodata*);
+ sound/songs/se_z_scroll.o(.rodata*);
+ sound/songs/se_z_page.o(.rodata*);
+ sound/songs/se_pn_on.o(.rodata*);
+ sound/songs/se_pn_off.o(.rodata*);
+ sound/songs/se_z_search.o(.rodata*);
+ sound/songs/se_tamago.o(.rodata*);
+ sound/songs/se_tb_start.o(.rodata*);
+ sound/songs/se_tb_kon.o(.rodata*);
+ sound/songs/se_tb_kara.o(.rodata*);
+ sound/songs/se_bidoro.o(.rodata*);
+ sound/songs/se_w085.o(.rodata*);
+ sound/songs/se_w085b.o(.rodata*);
+ sound/songs/se_w231.o(.rodata*);
+ sound/songs/se_w171.o(.rodata*);
+ sound/songs/se_w233.o(.rodata*);
+ sound/songs/se_w233b.o(.rodata*);
+ sound/songs/se_w145.o(.rodata*);
+ sound/songs/se_w145b.o(.rodata*);
+ sound/songs/se_w145c.o(.rodata*);
+ sound/songs/se_w240.o(.rodata*);
+ sound/songs/se_w015.o(.rodata*);
+ sound/songs/se_w081.o(.rodata*);
+ sound/songs/se_w081b.o(.rodata*);
+ sound/songs/se_w088.o(.rodata*);
+ sound/songs/se_w016.o(.rodata*);
+ sound/songs/se_w016b.o(.rodata*);
+ sound/songs/se_w003.o(.rodata*);
+ sound/songs/se_w104.o(.rodata*);
+ sound/songs/se_w013.o(.rodata*);
+ sound/songs/se_w196.o(.rodata*);
+ sound/songs/se_w086.o(.rodata*);
+ sound/songs/se_w004.o(.rodata*);
+ sound/songs/se_w025.o(.rodata*);
+ sound/songs/se_w025b.o(.rodata*);
+ sound/songs/se_w152.o(.rodata*);
+ sound/songs/se_w026.o(.rodata*);
+ sound/songs/se_w172.o(.rodata*);
+ sound/songs/se_w172b.o(.rodata*);
+ sound/songs/se_w053.o(.rodata*);
+ sound/songs/se_w007.o(.rodata*);
+ sound/songs/se_w092.o(.rodata*);
+ sound/songs/se_w221.o(.rodata*);
+ sound/songs/se_w221b.o(.rodata*);
+ sound/songs/se_w052.o(.rodata*);
+ sound/songs/se_w036.o(.rodata*);
+ sound/songs/se_w059.o(.rodata*);
+ sound/songs/se_w059b.o(.rodata*);
+ sound/songs/se_w010.o(.rodata*);
+ sound/songs/se_w011.o(.rodata*);
+ sound/songs/se_w017.o(.rodata*);
+ sound/songs/se_w019.o(.rodata*);
+ sound/songs/se_w028.o(.rodata*);
+ sound/songs/se_w013b.o(.rodata*);
+ sound/songs/se_w044.o(.rodata*);
+ sound/songs/se_w029.o(.rodata*);
+ sound/songs/se_w057.o(.rodata*);
+ sound/songs/se_w056.o(.rodata*);
+ sound/songs/se_w250.o(.rodata*);
+ sound/songs/se_w030.o(.rodata*);
+ sound/songs/se_w039.o(.rodata*);
+ sound/songs/se_w054.o(.rodata*);
+ sound/songs/se_w077.o(.rodata*);
+ sound/songs/se_w020.o(.rodata*);
+ sound/songs/se_w082.o(.rodata*);
+ sound/songs/se_w047.o(.rodata*);
+ sound/songs/se_w195.o(.rodata*);
+ sound/songs/se_w006.o(.rodata*);
+ sound/songs/se_w091.o(.rodata*);
+ sound/songs/se_w146.o(.rodata*);
+ sound/songs/se_w120.o(.rodata*);
+ sound/songs/se_w153.o(.rodata*);
+ sound/songs/se_w071b.o(.rodata*);
+ sound/songs/se_w071.o(.rodata*);
+ sound/songs/se_w103.o(.rodata*);
+ sound/songs/se_w062.o(.rodata*);
+ sound/songs/se_w062b.o(.rodata*);
+ sound/songs/se_w048.o(.rodata*);
+ sound/songs/se_w187.o(.rodata*);
+ sound/songs/se_w118.o(.rodata*);
+ sound/songs/se_w155.o(.rodata*);
+ sound/songs/se_w122.o(.rodata*);
+ sound/songs/se_w060.o(.rodata*);
+ sound/songs/se_w185.o(.rodata*);
+ sound/songs/se_w014.o(.rodata*);
+ sound/songs/se_w043.o(.rodata*);
+ sound/songs/se_w207.o(.rodata*);
+ sound/songs/se_w207b.o(.rodata*);
+ sound/songs/se_w215.o(.rodata*);
+ sound/songs/se_w109.o(.rodata*);
+ sound/songs/se_w173.o(.rodata*);
+ sound/songs/se_w280.o(.rodata*);
+ sound/songs/se_w202.o(.rodata*);
+ sound/songs/se_w060b.o(.rodata*);
+ sound/songs/se_w076.o(.rodata*);
+ sound/songs/se_w080.o(.rodata*);
+ sound/songs/se_w100.o(.rodata*);
+ sound/songs/se_w107.o(.rodata*);
+ sound/songs/se_w166.o(.rodata*);
+ sound/songs/se_w129.o(.rodata*);
+ sound/songs/se_w115.o(.rodata*);
+ sound/songs/se_w112.o(.rodata*);
+ sound/songs/se_w197.o(.rodata*);
+ sound/songs/se_w199.o(.rodata*);
+ sound/songs/se_w236.o(.rodata*);
+ sound/songs/se_w204.o(.rodata*);
+ sound/songs/se_w268.o(.rodata*);
+ sound/songs/se_w070.o(.rodata*);
+ sound/songs/se_w063.o(.rodata*);
+ sound/songs/se_w127.o(.rodata*);
+ sound/songs/se_w179.o(.rodata*);
+ sound/songs/se_w151.o(.rodata*);
+ sound/songs/se_w201.o(.rodata*);
+ sound/songs/se_w161.o(.rodata*);
+ sound/songs/se_w161b.o(.rodata*);
+ sound/songs/se_w227.o(.rodata*);
+ sound/songs/se_w227b.o(.rodata*);
+ sound/songs/se_w226.o(.rodata*);
+ sound/songs/se_w208.o(.rodata*);
+ sound/songs/se_w213.o(.rodata*);
+ sound/songs/se_w213b.o(.rodata*);
+ sound/songs/se_w234.o(.rodata*);
+ sound/songs/se_w260.o(.rodata*);
+ sound/songs/se_w328.o(.rodata*);
+ sound/songs/se_w320.o(.rodata*);
+ sound/songs/se_w255.o(.rodata*);
+ sound/songs/se_w291.o(.rodata*);
+ sound/songs/se_w089.o(.rodata*);
+ sound/songs/se_w239.o(.rodata*);
+ sound/songs/se_w230.o(.rodata*);
+ sound/songs/se_w281.o(.rodata*);
+ sound/songs/se_w327.o(.rodata*);
+ sound/songs/se_w287.o(.rodata*);
+ sound/songs/se_w257.o(.rodata*);
+ sound/songs/se_w253.o(.rodata*);
+ sound/songs/se_w258.o(.rodata*);
+ sound/songs/se_w322.o(.rodata*);
+ sound/songs/se_w298.o(.rodata*);
+ sound/songs/se_w287b.o(.rodata*);
+ sound/songs/se_w114.o(.rodata*);
+ sound/songs/se_w063b.o(.rodata*);
+ sound/songs/song_248.o(.rodata*);
+ sound/songs/song_249.o(.rodata*);
+ sound/songs/song_250.o(.rodata*);
+ sound/songs/song_251.o(.rodata*);
+ sound/songs/song_252.o(.rodata*);
+ sound/songs/song_253.o(.rodata*);
+ sound/songs/song_254.o(.rodata*);
+ sound/songs/song_255.o(.rodata*);
+ sound/songs/song_256.o(.rodata*);
+ sound/songs/song_257.o(.rodata*);
+ sound/songs/song_258.o(.rodata*);
+ sound/songs/song_259.o(.rodata*);
+ sound/songs/song_260.o(.rodata*);
+ sound/songs/song_261.o(.rodata*);
+ sound/songs/song_262.o(.rodata*);
+ sound/songs/song_263.o(.rodata*);
+ sound/songs/song_264.o(.rodata*);
+ sound/songs/song_265.o(.rodata*);
+ sound/songs/song_266.o(.rodata*);
+ sound/songs/song_267.o(.rodata*);
+ sound/songs/song_268.o(.rodata*);
+ sound/songs/song_269.o(.rodata*);
+ sound/songs/song_270.o(.rodata*);
+ sound/songs/song_271.o(.rodata*);
+ sound/songs/song_272.o(.rodata*);
+ sound/songs/song_273.o(.rodata*);
+ sound/songs/song_274.o(.rodata*);
+ sound/songs/song_275.o(.rodata*);
+ sound/songs/song_276.o(.rodata*);
+ sound/songs/song_277.o(.rodata*);
+ sound/songs/song_278.o(.rodata*);
+ sound/songs/song_279.o(.rodata*);
+ sound/songs/song_280.o(.rodata*);
+ sound/songs/song_281.o(.rodata*);
+ sound/songs/song_282.o(.rodata*);
+ sound/songs/song_283.o(.rodata*);
+ sound/songs/song_284.o(.rodata*);
+ sound/songs/song_285.o(.rodata*);
+ sound/songs/song_286.o(.rodata*);
+ sound/songs/song_287.o(.rodata*);
+ sound/songs/song_288.o(.rodata*);
+ sound/songs/song_289.o(.rodata*);
+ sound/songs/song_290.o(.rodata*);
+ sound/songs/song_291.o(.rodata*);
+ sound/songs/song_292.o(.rodata*);
+ sound/songs/song_293.o(.rodata*);
+ sound/songs/song_294.o(.rodata*);
+ sound/songs/song_295.o(.rodata*);
+ sound/songs/song_296.o(.rodata*);
+ sound/songs/song_297.o(.rodata*);
+ sound/songs/song_298.o(.rodata*);
+ sound/songs/bgm_tetsuji.o(.rodata*);
+ sound/songs/bgm_field13.o(.rodata*);
+ sound/songs/bgm_kachi22.o(.rodata*);
+ sound/songs/bgm_kachi2.o(.rodata*);
+ sound/songs/bgm_kachi3.o(.rodata*);
+ sound/songs/bgm_kachi5.o(.rodata*);
+ sound/songs/bgm_pcc.o(.rodata*);
+ sound/songs/bgm_nibi.o(.rodata*);
+ sound/songs/bgm_suikun.o(.rodata*);
+ sound/songs/bgm_dooro1.o(.rodata*);
+ sound/songs/bgm_dooro_x1.o(.rodata*);
+ sound/songs/bgm_dooro_x3.o(.rodata*);
+ sound/songs/bgm_machi_s2.o(.rodata*);
+ sound/songs/bgm_machi_s4.o(.rodata*);
+ sound/songs/bgm_gim.o(.rodata*);
+ sound/songs/bgm_naminori.o(.rodata*);
+ sound/songs/bgm_dan01.o(.rodata*);
+ sound/songs/bgm_fanfa1.o(.rodata*);
+ sound/songs/bgm_me_asa.o(.rodata*);
+ sound/songs/bgm_me_bachi.o(.rodata*);
+ sound/songs/bgm_fanfa4.o(.rodata*);
+ sound/songs/bgm_fanfa5.o(.rodata*);
+ sound/songs/bgm_me_waza.o(.rodata*);
+ sound/songs/bgm_bijyutu.o(.rodata*);
+ sound/songs/bgm_dooro_x4.o(.rodata*);
+ sound/songs/bgm_fune_kan.o(.rodata*);
+ sound/songs/bgm_me_shinka.o(.rodata*);
+ sound/songs/bgm_shinka.o(.rodata*);
+ sound/songs/bgm_me_wasure.o(.rodata*);
+ sound/songs/bgm_syoujoeye.o(.rodata*);
+ sound/songs/bgm_boyeye.o(.rodata*);
+ sound/songs/bgm_dan02.o(.rodata*);
+ sound/songs/bgm_machi_s3.o(.rodata*);
+ sound/songs/bgm_odamaki.o(.rodata*);
+ sound/songs/bgm_b_tower.o(.rodata*);
+ sound/songs/bgm_swimeye.o(.rodata*);
+ sound/songs/bgm_dan03.o(.rodata*);
+ sound/songs/bgm_me_kinomi.o(.rodata*);
+ sound/songs/bgm_me_tama.o(.rodata*);
+ sound/songs/bgm_me_b_big.o(.rodata*);
+ sound/songs/bgm_me_b_small.o(.rodata*);
+ sound/songs/bgm_me_zannen.o(.rodata*);
+ sound/songs/bgm_bd_time.o(.rodata*);
+ sound/songs/bgm_test1.o(.rodata*);
+ sound/songs/bgm_test2.o(.rodata*);
+ sound/songs/bgm_test3.o(.rodata*);
+ sound/songs/bgm_test4.o(.rodata*);
+ sound/songs/bgm_test.o(.rodata*);
+ sound/songs/bgm_gomachi0.o(.rodata*);
+ sound/songs/bgm_gotown.o(.rodata*);
+ sound/songs/bgm_pokecen.o(.rodata*);
+ sound/songs/bgm_nextroad.o(.rodata*);
+ sound/songs/bgm_granroad.o(.rodata*);
+ sound/songs/bgm_cycling.o(.rodata*);
+ sound/songs/bgm_friendly.o(.rodata*);
+ sound/songs/bgm_mishiro.o(.rodata*);
+ sound/songs/bgm_tozan.o(.rodata*);
+ sound/songs/bgm_girleye.o(.rodata*);
+ sound/songs/bgm_minamo.o(.rodata*);
+ sound/songs/bgm_ashroad.o(.rodata*);
+ sound/songs/bgm_event0.o(.rodata*);
+ sound/songs/bgm_deepdeep.o(.rodata*);
+ sound/songs/bgm_kachi1.o(.rodata*);
+ sound/songs/bgm_title3.o(.rodata*);
+ sound/songs/bgm_demo1.o(.rodata*);
+ sound/songs/bgm_girl_sup.o(.rodata*);
+ sound/songs/bgm_hageshii.o(.rodata*);
+ sound/songs/bgm_kakkoii.o(.rodata*);
+ sound/songs/bgm_kazanbai.o(.rodata*);
+ sound/songs/bgm_aqa_0.o(.rodata*);
+ sound/songs/bgm_tsuretek.o(.rodata*);
+ sound/songs/bgm_boy_sup.o(.rodata*);
+ sound/songs/bgm_rainbow.o(.rodata*);
+ sound/songs/bgm_ayasii.o(.rodata*);
+ sound/songs/bgm_kachi4.o(.rodata*);
+ sound/songs/bgm_ropeway.o(.rodata*);
+ sound/songs/bgm_casino.o(.rodata*);
+ sound/songs/bgm_hightown.o(.rodata*);
+ sound/songs/bgm_safari.o(.rodata*);
+ sound/songs/bgm_c_road.o(.rodata*);
+ sound/songs/bgm_ajito.o(.rodata*);
+ sound/songs/bgm_m_boat.o(.rodata*);
+ sound/songs/bgm_m_dungon.o(.rodata*);
+ sound/songs/bgm_finecity.o(.rodata*);
+ sound/songs/bgm_machupi.o(.rodata*);
+ sound/songs/bgm_p_school.o(.rodata*);
+ sound/songs/bgm_dendou.o(.rodata*);
+ sound/songs/bgm_tonekusa.o(.rodata*);
+ sound/songs/bgm_maborosi.o(.rodata*);
+ sound/songs/bgm_con_fan.o(.rodata*);
+ sound/songs/bgm_contest0.o(.rodata*);
+ sound/songs/bgm_mgm0.o(.rodata*);
+ sound/songs/bgm_t_battle.o(.rodata*);
+ sound/songs/bgm_ooame.o(.rodata*);
+ sound/songs/bgm_hideri.o(.rodata*);
+ sound/songs/bgm_runecity.o(.rodata*);
+ sound/songs/bgm_con_k.o(.rodata*);
+ sound/songs/bgm_eikou_r.o(.rodata*);
+ sound/songs/bgm_karakuri.o(.rodata*);
+ sound/songs/bgm_hutago.o(.rodata*);
+ sound/songs/bgm_sitennou.o(.rodata*);
+ sound/songs/bgm_yama_eye.o(.rodata*);
+ sound/songs/bgm_conlobby.o(.rodata*);
+ sound/songs/bgm_inter_v.o(.rodata*);
+ sound/songs/bgm_daigo.o(.rodata*);
+ sound/songs/bgm_thankfor.o(.rodata*);
+ sound/songs/bgm_end.o(.rodata*);
+ sound/songs/bgm_battle27.o(.rodata*);
+ sound/songs/bgm_battle31.o(.rodata*);
+ sound/songs/bgm_battle20.o(.rodata*);
+ sound/songs/bgm_battle32.o(.rodata*);
+ sound/songs/bgm_battle33.o(.rodata*);
+ sound/songs/bgm_battle36.o(.rodata*);
+ sound/songs/bgm_battle34.o(.rodata*);
+ sound/songs/bgm_battle35.o(.rodata*);
+ sound/songs/bgm_battle38.o(.rodata*);
+ sound/songs/bgm_battle30.o(.rodata*);
+ sound/songs/bgm_radio_tower_occupied.o(.rodata*);
} =0
lib_rodata :
ALIGN(4)
{
- src/libs/agb_flash.o(.rodata);
- src/libs/agb_flash_1m.o(.rodata);
- src/libs/agb_flash_mx.o(.rodata);
- src/libs/agb_flash_le.o(.rodata);
- src/libs/siirtc.o(.rodata);
- *libgcc.a:_udivdi3.o(.rodata);
- *libc.a(.rodata);
- *libc.a(.data);
- src/libs/libisagbprn.o(.rodata);
+ src/libs/m4a.o(.rodata*);
+ src/libs/agb_flash.o(.rodata*);
+ src/libs/agb_flash_1m.o(.rodata*);
+ src/libs/agb_flash_mx.o(.rodata*);
+ src/libs/agb_flash_le.o(.rodata*);
+ src/libs/siirtc.o(.rodata*);
+ *libgcc.a:_udivdi3.o(.rodata*);
+ *libc.a(.rodata*);
+ *libc.a(.data*);
+ src/libs/libisagbprn.o(.rodata*);
} =0
. = 0x8D00000;
@@ -1206,7 +1233,7 @@ SECTIONS {
gfx_data :
ALIGN(4)
{
- src/data/graphics.o(.rodata);
+ src/data/graphics.o(.rodata*);
} =0
/* DWARF 2 sections */
diff --git a/ld_script_modern.txt b/ld_script_modern.txt
new file mode 100644
index 000000000..09f5060ff
--- /dev/null
+++ b/ld_script_modern.txt
@@ -0,0 +1,79 @@
+ENTRY(Start)
+
+gNumMusicPlayers = 4;
+gMaxLines = 60;
+
+SECTIONS {
+ . = 0x2000000;
+
+ ewram (NOLOAD) :
+ ALIGN(4)
+ {
+ INCLUDE "sym_ewram.ld"
+ *(ewram_data);
+
+ . = 0x40000;
+ }
+
+ . = 0x3000000;
+
+ iwram (NOLOAD) :
+ ALIGN(4)
+ {
+ /* .bss starts at 0x3000000 */
+ *(.bss);
+
+ /* .bss.code starts at 0x3000F60 */
+ src/libs/m4a.o(.bss.code);
+
+ /* COMMON starts at 0x3001760 */
+ INCLUDE "sym_common.ld"
+ *(COMMON);
+ end = .;
+ . = 0x8000;
+ }
+
+ . = 0x8000000;
+
+ .text :
+ ALIGN(4)
+ {
+ src/crt0.o(.text);
+ *(.text*);
+ } =0
+
+ script_data :
+ ALIGN(4)
+ {
+ *(script_data);
+ } =0
+
+ .data :
+ ALIGN(4)
+ {
+ *(.data*);
+ } =0
+
+ .rodata :
+ ALIGN(4)
+ {
+ *(.rodata*);
+ } =0
+
+ /* DWARF 2 sections */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .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) }
+
+ /* Discard everything not specifically mentioned above. */
+ /DISCARD/ :
+ {
+ *(*);
+ }
+}
diff --git a/src/battle/anim/fire_2.c b/src/battle/anim/fire_2.c
index 7ebd7dd87..1d69b2c1c 100644
--- a/src/battle/anim/fire_2.c
+++ b/src/battle/anim/fire_2.c
@@ -467,6 +467,7 @@ static void sub_80D54E0(u8 taskId) // animate Move_ERUPTION?
break;
default:
+ break;
}
}
diff --git a/src/battle/anim/ghost.c b/src/battle/anim/ghost.c
index 2b7ff8d95..4dea1ed1d 100644
--- a/src/battle/anim/ghost.c
+++ b/src/battle/anim/ghost.c
@@ -1145,7 +1145,8 @@ static void sub_80DF0B8(struct Sprite *sprite)
if (++coeffB > 16)
coeffB = 16;
- if (--(s16)coeffA < 0)
+ --coeffA;
+ if ((s16)coeffA < 0)
coeffA = 0;
REG_BLDALPHA = (coeffB << 8) | coeffA;
diff --git a/src/battle/anim/heal_bell.c b/src/battle/anim/heal_bell.c
index e191460ea..94bf490c2 100644
--- a/src/battle/anim/heal_bell.c
+++ b/src/battle/anim/heal_bell.c
@@ -76,7 +76,7 @@ void sub_80D1ADC(u8 taskId)
{
int i;
u8 sp[8];
- void* src;
+ const void* src;
void* dest;
void* what;
sp[0] = IndexOfSpritePaletteTag(0x27DE);
diff --git a/src/battle/anim/musical.c b/src/battle/anim/musical.c
index 1e559d975..1a58c4daf 100644
--- a/src/battle/anim/musical.c
+++ b/src/battle/anim/musical.c
@@ -291,7 +291,7 @@ void sub_80CECE8(struct Sprite* sprite)
if (GetBattlerSide(gBattleAnimAttacker) == 1)
{
a = gBattleAnimArgs[1];
- (u16)gBattleAnimArgs[1] = -a;
+ *(u16*)&gBattleAnimArgs[1] = -a;
}
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[1];
diff --git a/src/battle/anim/roots.c b/src/battle/anim/roots.c
index e0cc441aa..245f201dd 100644
--- a/src/battle/anim/roots.c
+++ b/src/battle/anim/roots.c
@@ -7,10 +7,10 @@ extern s16 gBattleAnimArgs[];
extern u8 gBattleAnimAttacker;
extern u8 gBattleAnimTarget;
-IWRAM_DATA u32 filler_03000724;
-IWRAM_DATA u16 gUnknown_03000728[4];
-IWRAM_DATA u16 gUnknown_03000730[6];
-IWRAM_DATA u32 filler_0300073c;
+BSS_DATA u32 filler_03000724;
+BSS_DATA u16 gUnknown_03000728[4];
+BSS_DATA u16 gUnknown_03000730[6];
+BSS_DATA u32 filler_0300073c;
void sub_80CB59C(struct Sprite* sprite);
void sub_80CB620(struct Sprite *sprite);
diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c
index a1d07eb50..445c6eac5 100644
--- a/src/battle_controller_link_opponent.c
+++ b/src/battle_controller_link_opponent.c
@@ -55,7 +55,6 @@ extern MainCallback gPreBattleCallback1;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u8 sub_8077F68();
-extern u8 GetBattlerSubpriority();
extern u8 GetBattlerPosition(u8);
extern void BattleLoadOpponentMonSprite(struct Pokemon *, u8);
extern void sub_8037A74(void);
@@ -64,7 +63,6 @@ extern void sub_8037E30(void);
extern void sub_80312F0(struct Sprite *);
extern u8 StartSendOutMonAnimation();
extern void sub_8032A08();
-extern void sub_8043DB0();
extern void sub_8037BBC(void);
extern s32 sub_803FC34(u16);
extern void sub_8031A6C(u16, u8);
@@ -78,15 +76,12 @@ extern void sub_8010384(struct Sprite *);
extern void sub_8037B78(void);
extern u8 IsMoveWithoutAnimation();
extern bool8 mplay_80342A4(u8);
-extern void DoMoveAnim();
extern void sub_80326EC();
extern void sub_8031F24(void);
extern void sub_80324BC();
extern void BufferStringBattle();
extern void sub_8037C2C(void);
-extern void sub_8043D84();
extern void sub_8037B24(void);
-extern void sub_8045A5C();
extern void sub_8037FAC(void);
extern void move_anim_start_t2_for_situation();
extern void dp01t_0F_4_move_anim(void);
@@ -99,7 +94,6 @@ extern void nullsub_47(void);
extern bool8 IsDoubleBattle(void);
extern void sub_8037840(void);
extern void sub_8031B74();
-extern u8 IsBankSpritePresent();
extern u8 move_anim_start_t3();
extern void sub_8037FD8(void);
extern void sub_8037F34(void);
diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c
index 3ea5bd624..acc35e2d2 100644
--- a/src/battle_controller_link_partner.c
+++ b/src/battle_controller_link_partner.c
@@ -58,17 +58,14 @@ extern u8 gAnimScriptActive;
extern void (*gAnimScriptCallback)(void);
extern u8 move_anim_start_t3();
-extern u8 IsBankSpritePresent();
extern void sub_8044CA0(u8);
extern void sub_8030E38(struct Sprite *);
extern void StartBattleIntroAnim();
extern void sub_8047858();
extern void move_anim_start_t2_for_situation();
-extern void sub_8043D84();
extern void BufferStringBattle();
extern void sub_8031F24(void);
extern void sub_80326EC();
-extern void DoMoveAnim();
extern void sub_80324BC();
extern u8 IsMoveWithoutAnimation();
extern u8 mplay_80342A4();
@@ -83,21 +80,10 @@ extern u8 StartSendOutMonAnimation();
extern void sub_80312F0(struct Sprite *);
extern u8 CreateInvisibleSpriteWithCallback();
extern void BattleLoadPlayerMonSprite();
-extern u8 GetBattlerSpriteCoord();
extern u8 sub_8077F68();
-extern u8 GetBattlerSubpriority();
extern void nullsub_10();
-extern void sub_8045A5C();
-extern void sub_804777C();
-extern void sub_8043DFC();
-//extern s16 sub_8045C78();
-extern void sub_80440EC();
-extern void HandleLowHpMusicChange();
extern void nullsub_9(u16);
-extern void sub_8043DB0();
-extern void move_anim_start_t4();
extern void c3_0802FDF4(u8);
-extern void sub_8031F88();
extern void c2_8011A1C(void);
// this file's functions
@@ -327,7 +313,7 @@ void sub_811DCA0(void)
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
sub_804777C(gActiveBattler);
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
- (s8)ewram17810[4].unk9 &= ~1;
+ ewram17810[4].unk9 = (s8)ewram17810[4].unk9 & ~1;
gBattlerControllerFuncs[gActiveBattler] = sub_811DBC0;
}
}
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c
index da11c3aa9..9fe69811e 100644
--- a/src/battle_controller_opponent.c
+++ b/src/battle_controller_opponent.c
@@ -61,15 +61,12 @@ extern bool8 gDoingBattleAnim;
extern u16 gUnknown_02024DE8;
extern u8 gUnknown_02024E68[];
extern MainCallback gPreBattleCallback1;
-extern void (*const gOpponentBufferCommands[])(void);
extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u32 gBattleControllerExecFlags;
-extern u8 GetBattlerSpriteCoord();
extern u8 sub_8077F68();
-extern u8 GetBattlerSubpriority();
extern void sub_8033018(void);
extern void BattleLoadOpponentMonSprite();
extern u8 GetBattlerPosition(u8);
@@ -78,7 +75,6 @@ extern void sub_80333D4(void);
extern void sub_80312F0(struct Sprite *);
extern u8 StartSendOutMonAnimation();
extern void sub_8032A08();
-extern void sub_8043DB0();
extern void sub_8033160(void);
extern u8 get_trainer_class_pic_index(void);
extern void sub_80313A0(struct Sprite *);
@@ -93,7 +89,6 @@ extern void sub_803311C(void);
extern void sub_8010384(struct Sprite *);
extern bool8 mplay_80342A4(u8);
extern u8 IsMoveWithoutAnimation();
-extern void DoMoveAnim();
extern void sub_80326EC();
extern void sub_8031F24(void);
extern void sub_80324BC();
@@ -102,8 +97,6 @@ extern void sub_80331D0(void);
extern void AI_TrySwitchOrUseItem(void);
extern u8 GetBattlerAtPosition(u8);
extern void sub_80330C8(void);
-extern void sub_8043D84();
-extern void sub_8045A5C();
void sub_8033494(void);
extern void move_anim_start_t2_for_situation();
extern void bx_blink_t7(void);
@@ -115,7 +108,6 @@ extern void nullsub_45(void);
extern void sub_8031B74();
extern bool8 IsDoubleBattle(void);
extern void sub_8032E2C(void);
-extern u8 IsBankSpritePresent();
extern u8 move_anim_start_t3();
extern void sub_80334C0(void);
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c
index 361eb8ef8..9a48f4e16 100644
--- a/src/battle_controller_player.c
+++ b/src/battle_controller_player.c
@@ -106,7 +106,6 @@ extern void sub_802E460(void);
extern void b_link_standby_message(void);
extern void sub_802D18C(void);
extern void sub_802DF18(void);
-extern void BufferStringBattle();
extern void sub_80326EC();
extern void sub_8031F24(void);
extern void sub_80324BC();
diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c
index 5cf06796f..c015cb4cf 100644
--- a/src/battle_controller_safari.c
+++ b/src/battle_controller_safari.c
@@ -45,10 +45,8 @@ extern void LoadPlayerTrainerBankSprite();
extern u8 GetBattlerSubpriority();
extern void sub_80313A0(struct Sprite *);
extern void sub_810BADC(void);
-extern void sub_8045A5C();
extern void StartBattleIntroAnim();
extern void sub_804777C();
-extern void sub_8043DFC();
extern bool8 move_anim_start_t3();
#if ENGLISH
diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c
index ac71aabaf..50ede7c7d 100644
--- a/src/battle_controller_wally.c
+++ b/src/battle_controller_wally.c
@@ -63,9 +63,7 @@ extern void BtlController_EmitOneReturnValue(u8, u16);
extern void nullsub_14(void);
extern void PrepareBagForWallyTutorial(void);
-extern void sub_8045A5C();
extern void sub_804777C();
-extern void sub_8043DFC();
extern bool8 IsDoubleBattle(void);
extern void c3_0802FDF4(u8);
extern void PlayerHandlecmd1(void);
@@ -74,11 +72,9 @@ extern u8 GetBattlerPosition(u8);
extern void sub_80313A0(struct Sprite *);
extern u8 GetBattlerAtPosition(u8);
extern u8 IsMoveWithoutAnimation();
-extern void DoMoveAnim();
extern void sub_80326EC();
extern void sub_8031F24(void);
extern void sub_80324BC();
-extern void BufferStringBattle();
extern u8 GetBattlerSide(u8);
extern void sub_80304A8(void);
extern void sub_8047858();
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index ee4b4b100..a2a48dd38 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -94,9 +94,7 @@ const struct SpritePalette gUnknown_0820A4D4[] =
};
extern void c3_0802FDF4(u8);
-extern void sub_80440EC();
extern void sub_804777C();
-extern u8 GetBattlerSpriteCoord();
extern u8 IsBankSpritePresent(u8);
extern u8 sub_8077F68(u8);
extern u8 sub_8077F7C(u8);
diff --git a/src/battle_interface.c b/src/battle_interface.c
index 7ab3580f0..149e409cb 100644
--- a/src/battle_interface.c
+++ b/src/battle_interface.c
@@ -2942,7 +2942,7 @@ s32 sub_8045C78(u8 a, u8 unused1, u8 c, u8 unused2)
static void sub_8045D58(u8 a, u8 b)
{
- u8 sp8[7];
+ u8 sp8[8];
u8 r0;
u8 r8;
u8 i;
diff --git a/src/berry_blender.c b/src/berry_blender.c
index e55a391f5..a0300ed1f 100644
--- a/src/berry_blender.c
+++ b/src/berry_blender.c
@@ -214,14 +214,14 @@ u16 gUnknown_03004840[10];
struct BerryBlenderData* gBerryBlenderData;
// iwram bss
-IWRAM_DATA s16 gUnknown_03000510[8];
-IWRAM_DATA s16 gUnknown_03000520[6];
-IWRAM_DATA s16 gUnknown_0300052C;
-IWRAM_DATA s16 gUnknown_0300052E;
-IWRAM_DATA s32 gUnknown_03000530[6];
-IWRAM_DATA s32 gUnknown_03000548[5];
-IWRAM_DATA u32 gUnknown_0300055C;
-IWRAM_DATA struct BlenderDebug sBlenderDebug;
+static s16 gUnknown_03000510[8];
+static s16 gUnknown_03000520[6];
+static s16 gUnknown_0300052C;
+static s16 gUnknown_0300052E;
+static s32 gUnknown_03000530[6];
+static s32 gUnknown_03000548[5];
+static u32 gUnknown_0300055C;
+static struct BlenderDebug sBlenderDebug;
// this file's functions
void Blender_SetBankBerryData(u8 bank, u16 itemID);
diff --git a/src/daycare.c b/src/daycare.c
index 1bc2d9ef1..616b1dd22 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -23,11 +23,11 @@
#include "trade.h"
// RAM buffers used to assist with BuildEggMoveset()
-IWRAM_DATA u16 gHatchedEggLevelUpMoves[52];
-IWRAM_DATA u16 gHatchedEggFatherMoves[4];
-IWRAM_DATA u16 gHatchedEggFinalMoves[4];
-IWRAM_DATA u16 gHatchedEggEggMoves[12];
-IWRAM_DATA u16 gHatchedEggMotherMoves[4];
+static u16 gHatchedEggLevelUpMoves[52];
+static u16 gHatchedEggFatherMoves[4];
+static u16 gHatchedEggFinalMoves[4];
+static u16 gHatchedEggEggMoves[12];
+static u16 gHatchedEggMotherMoves[4];
extern u16 gMoveToLearn;
diff --git a/src/debug/sound_check_menu.c b/src/debug/sound_check_menu.c
index 95e71fad5..dec9b4371 100644
--- a/src/debug/sound_check_menu.c
+++ b/src/debug/sound_check_menu.c
@@ -184,8 +184,8 @@ void Task_InitSoundCheckMenu(u8 taskId)
// ideally this should be a multi Coords8 struct, but it wont match when its treated like a struct.
static const u8 gUnknown_083D0300[] = { 1, 1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 11, 1, 13, 1, 15, 1, 17 };
-extern const u8 *const gBGMNames[];
-extern const u8 *const gSENames[];
+static const u8 *const gBGMNames[];
+static const u8 *const gSENames[];
void sub_80BA384(u8 taskId) // Task_HandleDrawingSoundCheckMenuText
{
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index 876034d2a..0c115ddfe 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -44,9 +44,6 @@ struct EggHatchData* gEggHatchData;
extern const u32 gBattleTextboxTiles[];
extern const u32 gBattleTextboxTilemap[];
extern const u16 gBattleTextboxPalette[]; //palette
-extern const struct SpriteSheet sUnknown_0820A3B0;
-extern const struct SpriteSheet sUnknown_0820A3B8;
-extern const struct SpritePalette sUnknown_0820A3C0;
bool8 GetSetPokedexFlag(u16 nationalNum, u8 caseID);
u8 sav1_map_get_name(void);
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index 041fd292c..ba136d1cc 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -113,8 +113,8 @@ static void CB2_BeginEvolutionScene(void)
}
#define tState data[0]
-#define tMonPtrHI data[1]
-#define tMonPtrLO data[2]
+#define tMonPtrLo data[1]
+#define tMonPtrHi data[2]
#define tPreEvoSpecies data[3]
#define tPostEvoSpecies data[4]
#define tCanStop data[5] // in first fast data[5] only checks that
@@ -145,7 +145,11 @@ static void Task_BeginEvolutionScene(u8 taskID)
bool8 canStopEvo;
u8 partyID;
- mon = (struct Pokemon*)(gTasks[taskID].tMonPtrHI | (gTasks[taskID].tMonPtrLO << 0x10));
+#if MODERN
+ mon = (struct Pokemon*)((u16)gTasks[taskID].tMonPtrLo | (gTasks[taskID].tMonPtrHi << 0x10));
+#else
+ mon = (struct Pokemon*)(gTasks[taskID].tMonPtrLo | (gTasks[taskID].tMonPtrHi << 0x10));
+#endif
speciesToEvolve = gTasks[taskID].tPostEvoSpecies;
canStopEvo = gTasks[taskID].tCanStop;
partyID = gTasks[taskID].tPartyID;
@@ -161,8 +165,8 @@ void BeginEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStop
{
u8 taskID = CreateTask(Task_BeginEvolutionScene, 0);
gTasks[taskID].tState = 0;
- gTasks[taskID].tMonPtrHI = (u32)(mon);
- gTasks[taskID].tMonPtrLO = (u32)(mon) >> 0x10;
+ gTasks[taskID].tMonPtrLo = (u32)(mon);
+ gTasks[taskID].tMonPtrHi = (u32)(mon) >> 0x10;
gTasks[taskID].tPostEvoSpecies = speciesToEvolve;
gTasks[taskID].tCanStop = canStopEvo;
gTasks[taskID].tPartyID = partyID;
@@ -258,8 +262,8 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
gTasks[ID].tState = 0;
gTasks[ID].tPreEvoSpecies = currSpecies;
gTasks[ID].tPostEvoSpecies = speciesToEvolve;
- gTasks[ID].tMonPtrHI = (u32)(mon);
- gTasks[ID].tMonPtrLO = (u32)(mon) >> 0x10;
+ gTasks[ID].tMonPtrLo = (u32)(mon);
+ gTasks[ID].tMonPtrHi = (u32)(mon) >> 0x10;
gTasks[ID].tCanStop = canStopEvo;
gTasks[ID].tLearnsFirstMove = TRUE;
gTasks[ID].tEvoWasStopped = FALSE;
@@ -459,8 +463,8 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpri
gTasks[ID].tState = 0;
gTasks[ID].tPreEvoSpecies = currSpecies;
gTasks[ID].tPostEvoSpecies = speciesToEvolve;
- gTasks[ID].tMonPtrHI = (u32)(mon);
- gTasks[ID].tMonPtrLO = (u32)(mon) >> 0x10;
+ gTasks[ID].tMonPtrLo = (u32)(mon);
+ gTasks[ID].tMonPtrHi = (u32)(mon) >> 0x10;
gTasks[ID].tLearnsFirstMove = TRUE;
gTasks[ID].tEvoWasStopped = FALSE;
gTasks[ID].tPartyID = partyID;
@@ -525,7 +529,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
static void Task_EvolutionScene(u8 taskID)
{
u32 var;
- struct Pokemon* mon = (struct Pokemon*)(gTasks[taskID].tMonPtrHI | (gTasks[taskID].tMonPtrLO << 0x10));
+ struct Pokemon* mon = (struct Pokemon*)(gTasks[taskID].tMonPtrLo | (gTasks[taskID].tMonPtrHi << 0x10));
// check if B Button was held, so the evolution gets stopped
if (gMain.heldKeys == B_BUTTON && gTasks[taskID].tState == 8 && gTasks[taskID].tBits & TASK_BIT_CAN_STOP)
@@ -881,7 +885,7 @@ static void Task_EvolutionScene(u8 taskID)
static void Task_TradeEvolutionScene(u8 taskID)
{
u32 var;
- struct Pokemon* mon = (struct Pokemon*)(gTasks[taskID].tMonPtrHI | (gTasks[taskID].tMonPtrLO << 0x10));
+ struct Pokemon* mon = (struct Pokemon*)(gTasks[taskID].tMonPtrLo | (gTasks[taskID].tMonPtrHi << 0x10));
switch (gTasks[taskID].tState)
{
diff --git a/src/field_fadetransition.c b/src/field_fadetransition.c
index 2fbda69e3..ee1b334a8 100644
--- a/src/field_fadetransition.c
+++ b/src/field_fadetransition.c
@@ -19,6 +19,7 @@
#include "sound.h"
#include "start_menu.h"
#include "task.h"
+#include "new_game.h"
#include "constants/event_object_movement.h"
#include "constants/songs.h"
@@ -511,16 +512,18 @@ void sub_80810DC(void)
#if DEBUG
-NAKED
void debug_sub_80888D8()
{
- asm("\
+ debug_sub_8052E04();
+ sub_8080E88();
+ ScriptContext2_Enable();
+/* asm("\
PUSH {LR}\n\
BL debug_sub_8052E04\n\
BL sub_8080E88\n\
BL ScriptContext2_Enable\n\
POP {R0}\n\
- BX R0");
+ BX R0");*/
}
#endif
diff --git a/src/field_weather_effects.c b/src/field_weather_effects.c
index da3314aa1..db67be4de 100644
--- a/src/field_weather_effects.c
+++ b/src/field_weather_effects.c
@@ -544,7 +544,7 @@ void sub_807E6F0(struct Sprite *sprite, u16 b)
}
}
-extern const struct SpriteSheet sRainSpriteSheet; // defined below
+static const struct SpriteSheet sRainSpriteSheet; // defined below
void LoadRainSpriteSheet(void)
{
diff --git a/src/item_menu.c b/src/item_menu.c
index f782bafef..23e07ef02 100644
--- a/src/item_menu.c
+++ b/src/item_menu.c
@@ -36,24 +36,12 @@
#include "scanline_effect.h"
#include "menu_helpers.h"
#include "ewram.h"
-
-// External stuff
-extern void FreeAndReserveObjectSpritePalettes(void);
-extern void SetVerticalScrollIndicatorPriority();
-extern void sub_809D104(u16 *, u16, u16, const u8 *, u16, u16, u16, u16);
-extern void PauseVerticalScrollIndicator();
-extern u8 sub_80F9284(void);
-extern void sub_808B5B4();
-extern u8 sub_80F92F4();
-extern void pal_fill_black(void);
-extern bool8 IsWeatherNotFadingIn(void);
-extern u8 sub_80F931C();
-extern void sub_808A3F8(u8);
-extern void Shop_FadeReturnToMartMenu(void);
-extern void sub_80546B8(u8);
-extern void sub_804E990(u8);
-extern void sub_802E424(u8);
-extern void ScriptUnfreezeObjectEvents(void);
+#include "berry_blender.h"
+#include "field_fadetransition.h"
+#include "shop.h"
+#include "field_weather.h"
+#include "pokemon_storage_system.h"
+#include "event_object_lock.h"
struct UnknownStruct2
{
@@ -762,7 +750,7 @@ static void sub_80A39B8(u16 *a, u8 b)
{
u8 var = b * 2;
- sub_809D104(a, 4, 10, gBagScreenLabels_Tilemap, 0, var, 8, 2);
+ sub_809D104((void *)a, 4, 10, gBagScreenLabels_Tilemap, 0, var, 8, 2);
}
static void sub_80A39E4(u16 *a, u8 b, u8 c, s8 d)
@@ -776,8 +764,8 @@ static void sub_80A39E4(u16 *a, u8 b, u8 c, s8 d)
if (b == 5)
r7 = 2;
- sub_809D104(a, 4, 10, gBagScreenLabels_Tilemap, 8 - c, r2, c, 2);
- sub_809D104(a, c + 4, 10, gBagScreenLabels_Tilemap, 0, r7, 8 - c, 2);
+ sub_809D104((void *)a, 4, 10, gBagScreenLabels_Tilemap, 8 - c, r2, c, 2);
+ sub_809D104((void *)a, c + 4, 10, gBagScreenLabels_Tilemap, 0, r7, 8 - c, 2);
}
else if (d == 1)
{
@@ -785,8 +773,8 @@ static void sub_80A39E4(u16 *a, u8 b, u8 c, s8 d)
if (b == 1)
r7 = 10;
- sub_809D104(a, 4, 10, gBagScreenLabels_Tilemap, c, r7, 8 - c, 2);
- sub_809D104(a, 12 - c, 10, gBagScreenLabels_Tilemap, 0, r2, c, 2);
+ sub_809D104((void *)a, 4, 10, gBagScreenLabels_Tilemap, c, r7, 8 - c, 2);
+ sub_809D104((void *)a, 12 - c, 10, gBagScreenLabels_Tilemap, 0, r2, c, 2);
}
}
diff --git a/src/libs/m4a.c b/src/libs/m4a.c
index 7b4441ca4..267a72657 100644
--- a/src/libs/m4a.c
+++ b/src/libs/m4a.c
@@ -1,3 +1,4 @@
+#include <string.h>
#include "gba/m4a_internal.h"
extern const u8 gCgb3Vol[];
diff --git a/src/main.c b/src/main.c
index 972c8486f..b778631f3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -91,7 +91,27 @@ static void WaitForVBlank(void);
void AgbMain()
{
+#if MODERN
+ // Modern compilers are liberal with the stack on entry to this function,
+ // so RegisterRamReset may crash if it resets IWRAM.
+ RegisterRamReset(RESET_ALL & ~RESET_IWRAM);
+ asm("mov\tr1, #0xC0\n"
+ "\tlsl\tr1, r1, #0x12\n"
+ "\tmov r2, #0xFC\n"
+ "\tlsl r2, r2, #0x7\n"
+ "\tadd\tr2, r1, r2\n"
+ "\tmov\tr0, #0\n"
+ "\tmov\tr3, r0\n"
+ "\tmov\tr4, r0\n"
+ "\tmov\tr5, r0\n"
+ ".LCU0:\n"
+ "\tstmia r1!, {r0, r3, r4, r5}\n"
+ "\tcmp\tr1, r2\n"
+ "\tbcc\t.LCU0\n"
+ );
+#else
RegisterRamReset(RESET_ALL);
+#endif //MODERN
REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3;
InitKeys();
InitIntrHandlers();
diff --git a/src/main_menu.c b/src/main_menu.c
index 13fdf9f7f..33bffcb93 100644
--- a/src/main_menu.c
+++ b/src/main_menu.c
@@ -40,13 +40,6 @@ extern u8 gBirchSpeech_AhOkayYouArePlayer[];
extern u8 gBirchSpeech_AreYouReady[];
extern struct SpriteTemplate gUnknown_02024E8C;
-extern const struct MenuAction gUnknown_081E79B0[];
-extern const struct MenuAction gMalePresetNames[];
-extern const struct MenuAction gFemalePresetNames[];
-
-extern const u8 gUnknown_081E7834[];
-
-extern const union AffineAnimCmd *const gSpriteAffineAnimTable_81E79AC[];
//Menu layouts
enum
diff --git a/src/pokenav_before.c b/src/pokenav_before.c
index c9390a070..2ff282458 100644
--- a/src/pokenav_before.c
+++ b/src/pokenav_before.c
@@ -99,7 +99,7 @@ struct PokenavRibbonIconGfx {
u8 paletteNum;
};
-IWRAM_DATA void (*gUnknown_03000744)(void);
+static void (*gUnknown_03000744)(void);
struct UnkPokenavStruct *const gPokenavStructPtr = (struct UnkPokenavStruct *)gSharedMem;
diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c
index c87a5ed72..e33caed82 100644
--- a/src/reset_rtc_screen.c
+++ b/src/reset_rtc_screen.c
@@ -118,7 +118,7 @@ const union AnimCmd gSpriteAnim_83764C4[] =
const union AnimCmd gSpriteAnim_83764CC[] =
{
- ANIMCMD_FRAME(0, 158, .vFlip = TRUE),
+ ANIMCMD_FRAME(0, 30, .vFlip = TRUE),
ANIMCMD_JUMP(0),
};
diff --git a/src/roulette_gfx.c b/src/roulette_gfx.c
index afcb94df6..83e5fb149 100644
--- a/src/roulette_gfx.c
+++ b/src/roulette_gfx.c
@@ -1502,7 +1502,7 @@ void sub_8118F8C(struct Sprite *sprite)
const struct StructgUnknown_083F8DF4 *p;
eRoulette->var90 = 0.0f;
p = gUnknown_083F8DF4;
- eRoulette->var8C -= ((float)p[eRoulette->var04_0].var03)
+ eRoulette->var8C -= ((float)(p[eRoulette->var04_0].var03))
/ ((float)(s16)(p[eRoulette->var04_0].var04 + 1));
sprite->data[1] = 4;
#if DEBUG
@@ -1532,8 +1532,8 @@ void sub_8119088(struct Sprite *sprite)
sub_8118724(sprite);
if (!(eRoulette->var94 > 40.f))
{
- eRoulette->var98 = - ( 4.0f / (float)(u16)eRoulette->var86);
- eRoulette->var90 = - (eRoulette->var8C / (float)(u16)eRoulette->var86);
+ eRoulette->var98 = - ( 4.0f / (float)((u16)eRoulette->var86));
+ eRoulette->var90 = - (eRoulette->var8C / (float)((u16)eRoulette->var86));
sprite->animNum = 2;
sprite->animBeginning = TRUE;
sprite->animEnded = FALSE;
@@ -1548,8 +1548,8 @@ void sub_8119134(struct Sprite *sprite)
if (!(eRoulette->var94 > 60.0f))
{
m4aSongNumStartOrChange(SE_TAMAKORO_E);
- eRoulette->var98 = - ( 20.0f / (float)(u16)eRoulette->var84);
- eRoulette->var90 = ((1.0f - eRoulette->var8C) / (float)(u16)eRoulette->var84);
+ eRoulette->var98 = - ( 20.0f / (float)((u16)eRoulette->var84));
+ eRoulette->var90 = ((1.0f - eRoulette->var8C) / (float)((u16)eRoulette->var84));
sprite->animNum = 1;
sprite->animBeginning = TRUE;
sprite->animEnded = FALSE;
diff --git a/src/save.c b/src/save.c
index 0df83200a..3eeea88de 100644
--- a/src/save.c
+++ b/src/save.c
@@ -658,7 +658,10 @@ static u16 CalculateChecksum(void *data, u16 size)
u32 checksum = 0;
for (i = 0; i < (size / 4); i++)
- checksum += *((u32 *)data)++;
+ {
+ checksum += *((u32 *)data);
+ data += sizeof(u32);
+ }
return ((checksum >> 16) + checksum);
}
@@ -929,4 +932,5 @@ u8 unref_sub_8126080(u8 sector, u8 *data)
}
asm(".section .rodata\n"
- "\t.align 2");
+ "\t.align 2\n"
+ "\t.text");
diff --git a/src/trade.c b/src/trade.c
index 5422a6ace..424a503bf 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -128,7 +128,7 @@ struct TradeEwramSubstruct {
struct TradeEwramSubstruct2 *gUnknown_03004828;
-IWRAM_DATA u8 gUnknown_03000508[8];
+static u8 gUnknown_03000508[8];
struct UnkStructF {
u8 filler_0000[9];
diff --git a/tools/gbafix/elf.h b/tools/gbafix/elf.h
new file mode 100644
index 000000000..79d3b974b
--- /dev/null
+++ b/tools/gbafix/elf.h
@@ -0,0 +1,3147 @@
+/*
+From musl include/elf.h
+
+Copyright © 2005-2014 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef _ELF_H
+#define _ELF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
+
+typedef uint32_t Elf32_Word;
+typedef int32_t Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedef int32_t Elf64_Sword;
+
+typedef uint64_t Elf32_Xword;
+typedef int64_t Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedef int64_t Elf64_Sxword;
+
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
+
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
+
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+#define EI_NIDENT (16)
+
+typedef struct {
+ unsigned char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry;
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct {
+ unsigned char e_ident[EI_NIDENT];
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry;
+ Elf64_Off e_phoff;
+ Elf64_Off e_shoff;
+ Elf64_Word e_flags;
+ Elf64_Half e_ehsize;
+ Elf64_Half e_phentsize;
+ Elf64_Half e_phnum;
+ Elf64_Half e_shentsize;
+ Elf64_Half e_shnum;
+ Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+#define EI_MAG0 0
+#define ELFMAG0 0x7f
+
+#define EI_MAG1 1
+#define ELFMAG1 'E'
+
+#define EI_MAG2 2
+#define ELFMAG2 'L'
+
+#define EI_MAG3 3
+#define ELFMAG3 'F'
+
+
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define EI_CLASS 4
+#define ELFCLASSNONE 0
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM 3
+
+#define EI_DATA 5
+#define ELFDATANONE 0
+#define ELFDATA2LSB 1
+#define ELFDATA2MSB 2
+#define ELFDATANUM 3
+
+#define EI_VERSION 6
+
+
+#define EI_OSABI 7
+#define ELFOSABI_NONE 0
+#define ELFOSABI_SYSV 0
+#define ELFOSABI_HPUX 1
+#define ELFOSABI_NETBSD 2
+#define ELFOSABI_LINUX 3
+#define ELFOSABI_GNU 3
+#define ELFOSABI_SOLARIS 6
+#define ELFOSABI_AIX 7
+#define ELFOSABI_IRIX 8
+#define ELFOSABI_FREEBSD 9
+#define ELFOSABI_TRU64 10
+#define ELFOSABI_MODESTO 11
+#define ELFOSABI_OPENBSD 12
+#define ELFOSABI_ARM 97
+#define ELFOSABI_STANDALONE 255
+
+#define EI_ABIVERSION 8
+
+#define EI_PAD 9
+
+
+
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_NUM 5
+#define ET_LOOS 0xfe00
+#define ET_HIOS 0xfeff
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+
+
+
+#define EM_NONE 0
+#define EM_M32 1
+#define EM_SPARC 2
+#define EM_386 3
+#define EM_68K 4
+#define EM_88K 5
+#define EM_860 7
+#define EM_MIPS 8
+#define EM_S370 9
+#define EM_MIPS_RS3_LE 10
+
+#define EM_PARISC 15
+#define EM_VPP500 17
+#define EM_SPARC32PLUS 18
+#define EM_960 19
+#define EM_PPC 20
+#define EM_PPC64 21
+#define EM_S390 22
+
+#define EM_V800 36
+#define EM_FR20 37
+#define EM_RH32 38
+#define EM_RCE 39
+#define EM_ARM 40
+#define EM_FAKE_ALPHA 41
+#define EM_SH 42
+#define EM_SPARCV9 43
+#define EM_TRICORE 44
+#define EM_ARC 45
+#define EM_H8_300 46
+#define EM_H8_300H 47
+#define EM_H8S 48
+#define EM_H8_500 49
+#define EM_IA_64 50
+#define EM_MIPS_X 51
+#define EM_COLDFIRE 52
+#define EM_68HC12 53
+#define EM_MMA 54
+#define EM_PCP 55
+#define EM_NCPU 56
+#define EM_NDR1 57
+#define EM_STARCORE 58
+#define EM_ME16 59
+#define EM_ST100 60
+#define EM_TINYJ 61
+#define EM_X86_64 62
+#define EM_PDSP 63
+
+#define EM_FX66 66
+#define EM_ST9PLUS 67
+#define EM_ST7 68
+#define EM_68HC16 69
+#define EM_68HC11 70
+#define EM_68HC08 71
+#define EM_68HC05 72
+#define EM_SVX 73
+#define EM_ST19 74
+#define EM_VAX 75
+#define EM_CRIS 76
+#define EM_JAVELIN 77
+#define EM_FIREPATH 78
+#define EM_ZSP 79
+#define EM_MMIX 80
+#define EM_HUANY 81
+#define EM_PRISM 82
+#define EM_AVR 83
+#define EM_FR30 84
+#define EM_D10V 85
+#define EM_D30V 86
+#define EM_V850 87
+#define EM_M32R 88
+#define EM_MN10300 89
+#define EM_MN10200 90
+#define EM_PJ 91
+#define EM_OR1K 92
+#define EM_OPENRISC 92
+#define EM_ARC_A5 93
+#define EM_ARC_COMPACT 93
+#define EM_XTENSA 94
+#define EM_VIDEOCORE 95
+#define EM_TMM_GPP 96
+#define EM_NS32K 97
+#define EM_TPC 98
+#define EM_SNP1K 99
+#define EM_ST200 100
+#define EM_IP2K 101
+#define EM_MAX 102
+#define EM_CR 103
+#define EM_F2MC16 104
+#define EM_MSP430 105
+#define EM_BLACKFIN 106
+#define EM_SE_C33 107
+#define EM_SEP 108
+#define EM_ARCA 109
+#define EM_UNICORE 110
+#define EM_EXCESS 111
+#define EM_DXP 112
+#define EM_ALTERA_NIOS2 113
+#define EM_CRX 114
+#define EM_XGATE 115
+#define EM_C166 116
+#define EM_M16C 117
+#define EM_DSPIC30F 118
+#define EM_CE 119
+#define EM_M32C 120
+#define EM_TSK3000 131
+#define EM_RS08 132
+#define EM_SHARC 133
+#define EM_ECOG2 134
+#define EM_SCORE7 135
+#define EM_DSP24 136
+#define EM_VIDEOCORE3 137
+#define EM_LATTICEMICO32 138
+#define EM_SE_C17 139
+#define EM_TI_C6000 140
+#define EM_TI_C2000 141
+#define EM_TI_C5500 142
+#define EM_TI_ARP32 143
+#define EM_TI_PRU 144
+#define EM_MMDSP_PLUS 160
+#define EM_CYPRESS_M8C 161
+#define EM_R32C 162
+#define EM_TRIMEDIA 163
+#define EM_QDSP6 164
+#define EM_8051 165
+#define EM_STXP7X 166
+#define EM_NDS32 167
+#define EM_ECOG1X 168
+#define EM_MAXQ30 169
+#define EM_XIMO16 170
+#define EM_MANIK 171
+#define EM_CRAYNV2 172
+#define EM_RX 173
+#define EM_METAG 174
+#define EM_MCST_ELBRUS 175
+#define EM_ECOG16 176
+#define EM_CR16 177
+#define EM_ETPU 178
+#define EM_SLE9X 179
+#define EM_L10M 180
+#define EM_K10M 181
+#define EM_AARCH64 183
+#define EM_AVR32 185
+#define EM_STM8 186
+#define EM_TILE64 187
+#define EM_TILEPRO 188
+#define EM_MICROBLAZE 189
+#define EM_CUDA 190
+#define EM_TILEGX 191
+#define EM_CLOUDSHIELD 192
+#define EM_COREA_1ST 193
+#define EM_COREA_2ND 194
+#define EM_ARC_COMPACT2 195
+#define EM_OPEN8 196
+#define EM_RL78 197
+#define EM_VIDEOCORE5 198
+#define EM_78KOR 199
+#define EM_56800EX 200
+#define EM_BA1 201
+#define EM_BA2 202
+#define EM_XCORE 203
+#define EM_MCHP_PIC 204
+#define EM_KM32 210
+#define EM_KMX32 211
+#define EM_EMX16 212
+#define EM_EMX8 213
+#define EM_KVARC 214
+#define EM_CDP 215
+#define EM_COGE 216
+#define EM_COOL 217
+#define EM_NORC 218
+#define EM_CSR_KALIMBA 219
+#define EM_Z80 220
+#define EM_VISIUM 221
+#define EM_FT32 222
+#define EM_MOXIE 223
+#define EM_AMDGPU 224
+#define EM_RISCV 243
+#define EM_BPF 247
+#define EM_NUM 248
+
+#define EM_ALPHA 0x9026
+
+#define EV_NONE 0
+#define EV_CURRENT 1
+#define EV_NUM 2
+
+typedef struct {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+typedef struct {
+ Elf64_Word sh_name;
+ Elf64_Word sh_type;
+ Elf64_Xword sh_flags;
+ Elf64_Addr sh_addr;
+ Elf64_Off sh_offset;
+ Elf64_Xword sh_size;
+ Elf64_Word sh_link;
+ Elf64_Word sh_info;
+ Elf64_Xword sh_addralign;
+ Elf64_Xword sh_entsize;
+} Elf64_Shdr;
+
+
+
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_BEFORE 0xff00
+
+#define SHN_AFTER 0xff01
+
+#define SHN_HIPROC 0xff1f
+#define SHN_LOOS 0xff20
+#define SHN_HIOS 0xff3f
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_XINDEX 0xffff
+#define SHN_HIRESERVE 0xffff
+
+
+
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_INIT_ARRAY 14
+#define SHT_FINI_ARRAY 15
+#define SHT_PREINIT_ARRAY 16
+#define SHT_GROUP 17
+#define SHT_SYMTAB_SHNDX 18
+#define SHT_NUM 19
+#define SHT_LOOS 0x60000000
+#define SHT_GNU_ATTRIBUTES 0x6ffffff5
+#define SHT_GNU_HASH 0x6ffffff6
+#define SHT_GNU_LIBLIST 0x6ffffff7
+#define SHT_CHECKSUM 0x6ffffff8
+#define SHT_LOSUNW 0x6ffffffa
+#define SHT_SUNW_move 0x6ffffffa
+#define SHT_SUNW_COMDAT 0x6ffffffb
+#define SHT_SUNW_syminfo 0x6ffffffc
+#define SHT_GNU_verdef 0x6ffffffd
+#define SHT_GNU_verneed 0x6ffffffe
+#define SHT_GNU_versym 0x6fffffff
+#define SHT_HISUNW 0x6fffffff
+#define SHT_HIOS 0x6fffffff
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0x8fffffff
+
+#define SHF_WRITE (1 << 0)
+#define SHF_ALLOC (1 << 1)
+#define SHF_EXECINSTR (1 << 2)
+#define SHF_MERGE (1 << 4)
+#define SHF_STRINGS (1 << 5)
+#define SHF_INFO_LINK (1 << 6)
+#define SHF_LINK_ORDER (1 << 7)
+#define SHF_OS_NONCONFORMING (1 << 8)
+
+#define SHF_GROUP (1 << 9)
+#define SHF_TLS (1 << 10)
+#define SHF_COMPRESSED (1 << 11)
+#define SHF_MASKOS 0x0ff00000
+#define SHF_MASKPROC 0xf0000000
+#define SHF_ORDERED (1 << 30)
+#define SHF_EXCLUDE (1U << 31)
+
+typedef struct {
+ Elf32_Word ch_type;
+ Elf32_Word ch_size;
+ Elf32_Word ch_addralign;
+} Elf32_Chdr;
+
+typedef struct {
+ Elf64_Word ch_type;
+ Elf64_Word ch_reserved;
+ Elf64_Xword ch_size;
+ Elf64_Xword ch_addralign;
+} Elf64_Chdr;
+
+#define ELFCOMPRESS_ZLIB 1
+#define ELFCOMPRESS_LOOS 0x60000000
+#define ELFCOMPRESS_HIOS 0x6fffffff
+#define ELFCOMPRESS_LOPROC 0x70000000
+#define ELFCOMPRESS_HIPROC 0x7fffffff
+
+
+#define GRP_COMDAT 0x1
+
+typedef struct {
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf32_Section st_shndx;
+} Elf32_Sym;
+
+typedef struct {
+ Elf64_Word st_name;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf64_Section st_shndx;
+ Elf64_Addr st_value;
+ Elf64_Xword st_size;
+} Elf64_Sym;
+
+typedef struct {
+ Elf32_Half si_boundto;
+ Elf32_Half si_flags;
+} Elf32_Syminfo;
+
+typedef struct {
+ Elf64_Half si_boundto;
+ Elf64_Half si_flags;
+} Elf64_Syminfo;
+
+#define SYMINFO_BT_SELF 0xffff
+#define SYMINFO_BT_PARENT 0xfffe
+#define SYMINFO_BT_LOWRESERVE 0xff00
+
+#define SYMINFO_FLG_DIRECT 0x0001
+#define SYMINFO_FLG_PASSTHRU 0x0002
+#define SYMINFO_FLG_COPY 0x0004
+#define SYMINFO_FLG_LAZYLOAD 0x0008
+
+#define SYMINFO_NONE 0
+#define SYMINFO_CURRENT 1
+#define SYMINFO_NUM 2
+
+#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
+#define ELF32_ST_TYPE(val) ((val) & 0xf)
+#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
+#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
+#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
+
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+#define STB_NUM 3
+#define STB_LOOS 10
+#define STB_GNU_UNIQUE 10
+#define STB_HIOS 12
+#define STB_LOPROC 13
+#define STB_HIPROC 15
+
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_COMMON 5
+#define STT_TLS 6
+#define STT_NUM 7
+#define STT_LOOS 10
+#define STT_GNU_IFUNC 10
+#define STT_HIOS 12
+#define STT_LOPROC 13
+#define STT_HIPROC 15
+
+#define STN_UNDEF 0
+
+#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
+#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
+
+#define STV_DEFAULT 0
+#define STV_INTERNAL 1
+#define STV_HIDDEN 2
+#define STV_PROTECTED 3
+
+
+
+
+typedef struct {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+} Elf64_Rel;
+
+
+
+typedef struct {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+ Elf32_Sword r_addend;
+} Elf32_Rela;
+
+typedef struct {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+ Elf64_Sxword r_addend;
+} Elf64_Rela;
+
+
+
+#define ELF32_R_SYM(val) ((val) >> 8)
+#define ELF32_R_TYPE(val) ((val) & 0xff)
+#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
+
+
+
+typedef struct {
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+
+typedef struct {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset;
+ Elf64_Addr p_vaddr;
+ Elf64_Addr p_paddr;
+ Elf64_Xword p_filesz;
+ Elf64_Xword p_memsz;
+ Elf64_Xword p_align;
+} Elf64_Phdr;
+
+
+
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_TLS 7
+#define PT_NUM 8
+#define PT_LOOS 0x60000000
+#define PT_GNU_EH_FRAME 0x6474e550
+#define PT_GNU_STACK 0x6474e551
+#define PT_GNU_RELRO 0x6474e552
+#define PT_LOSUNW 0x6ffffffa
+#define PT_SUNWBSS 0x6ffffffa
+#define PT_SUNWSTACK 0x6ffffffb
+#define PT_HISUNW 0x6fffffff
+#define PT_HIOS 0x6fffffff
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+
+
+#define PN_XNUM 0xffff
+
+
+#define PF_X (1 << 0)
+#define PF_W (1 << 1)
+#define PF_R (1 << 2)
+#define PF_MASKOS 0x0ff00000
+#define PF_MASKPROC 0xf0000000
+
+
+
+#define NT_PRSTATUS 1
+#define NT_FPREGSET 2
+#define NT_PRPSINFO 3
+#define NT_PRXREG 4
+#define NT_TASKSTRUCT 4
+#define NT_PLATFORM 5
+#define NT_AUXV 6
+#define NT_GWINDOWS 7
+#define NT_ASRS 8
+#define NT_PSTATUS 10
+#define NT_PSINFO 13
+#define NT_PRCRED 14
+#define NT_UTSNAME 15
+#define NT_LWPSTATUS 16
+#define NT_LWPSINFO 17
+#define NT_PRFPXREG 20
+#define NT_SIGINFO 0x53494749
+#define NT_FILE 0x46494c45
+#define NT_PRXFPREG 0x46e62b7f
+#define NT_PPC_VMX 0x100
+#define NT_PPC_SPE 0x101
+#define NT_PPC_VSX 0x102
+#define NT_386_TLS 0x200
+#define NT_386_IOPERM 0x201
+#define NT_X86_XSTATE 0x202
+#define NT_S390_HIGH_GPRS 0x300
+#define NT_S390_TIMER 0x301
+#define NT_S390_TODCMP 0x302
+#define NT_S390_TODPREG 0x303
+#define NT_S390_CTRS 0x304
+#define NT_S390_PREFIX 0x305
+#define NT_S390_LAST_BREAK 0x306
+#define NT_S390_SYSTEM_CALL 0x307
+#define NT_S390_TDB 0x308
+#define NT_ARM_VFP 0x400
+#define NT_ARM_TLS 0x401
+#define NT_ARM_HW_BREAK 0x402
+#define NT_ARM_HW_WATCH 0x403
+#define NT_ARM_SYSTEM_CALL 0x404
+#define NT_ARM_SVE 0x405
+#define NT_METAG_CBUF 0x500
+#define NT_METAG_RPIPE 0x501
+#define NT_METAG_TLS 0x502
+#define NT_VERSION 1
+
+
+
+
+typedef struct {
+ Elf32_Sword d_tag;
+ union {
+ Elf32_Word d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct {
+ Elf64_Sxword d_tag;
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+
+
+
+#define DT_NULL 0
+#define DT_NEEDED 1
+#define DT_PLTRELSZ 2
+#define DT_PLTGOT 3
+#define DT_HASH 4
+#define DT_STRTAB 5
+#define DT_SYMTAB 6
+#define DT_RELA 7
+#define DT_RELASZ 8
+#define DT_RELAENT 9
+#define DT_STRSZ 10
+#define DT_SYMENT 11
+#define DT_INIT 12
+#define DT_FINI 13
+#define DT_SONAME 14
+#define DT_RPATH 15
+#define DT_SYMBOLIC 16
+#define DT_REL 17
+#define DT_RELSZ 18
+#define DT_RELENT 19
+#define DT_PLTREL 20
+#define DT_DEBUG 21
+#define DT_TEXTREL 22
+#define DT_JMPREL 23
+#define DT_BIND_NOW 24
+#define DT_INIT_ARRAY 25
+#define DT_FINI_ARRAY 26
+#define DT_INIT_ARRAYSZ 27
+#define DT_FINI_ARRAYSZ 28
+#define DT_RUNPATH 29
+#define DT_FLAGS 30
+#define DT_ENCODING 32
+#define DT_PREINIT_ARRAY 32
+#define DT_PREINIT_ARRAYSZ 33
+#define DT_NUM 34
+#define DT_LOOS 0x6000000d
+#define DT_HIOS 0x6ffff000
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
+#define DT_PROCNUM DT_MIPS_NUM
+
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_GNU_PRELINKED 0x6ffffdf5
+#define DT_GNU_CONFLICTSZ 0x6ffffdf6
+#define DT_GNU_LIBLISTSZ 0x6ffffdf7
+#define DT_CHECKSUM 0x6ffffdf8
+#define DT_PLTPADSZ 0x6ffffdf9
+#define DT_MOVEENT 0x6ffffdfa
+#define DT_MOVESZ 0x6ffffdfb
+#define DT_FEATURE_1 0x6ffffdfc
+#define DT_POSFLAG_1 0x6ffffdfd
+
+#define DT_SYMINSZ 0x6ffffdfe
+#define DT_SYMINENT 0x6ffffdff
+#define DT_VALRNGHI 0x6ffffdff
+#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
+#define DT_VALNUM 12
+
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_GNU_HASH 0x6ffffef5
+#define DT_TLSDESC_PLT 0x6ffffef6
+#define DT_TLSDESC_GOT 0x6ffffef7
+#define DT_GNU_CONFLICT 0x6ffffef8
+#define DT_GNU_LIBLIST 0x6ffffef9
+#define DT_CONFIG 0x6ffffefa
+#define DT_DEPAUDIT 0x6ffffefb
+#define DT_AUDIT 0x6ffffefc
+#define DT_PLTPAD 0x6ffffefd
+#define DT_MOVETAB 0x6ffffefe
+#define DT_SYMINFO 0x6ffffeff
+#define DT_ADDRRNGHI 0x6ffffeff
+#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
+#define DT_ADDRNUM 11
+
+
+
+#define DT_VERSYM 0x6ffffff0
+
+#define DT_RELACOUNT 0x6ffffff9
+#define DT_RELCOUNT 0x6ffffffa
+
+
+#define DT_FLAGS_1 0x6ffffffb
+#define DT_VERDEF 0x6ffffffc
+
+#define DT_VERDEFNUM 0x6ffffffd
+#define DT_VERNEED 0x6ffffffe
+
+#define DT_VERNEEDNUM 0x6fffffff
+#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
+#define DT_VERSIONTAGNUM 16
+
+
+
+#define DT_AUXILIARY 0x7ffffffd
+#define DT_FILTER 0x7fffffff
+#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
+#define DT_EXTRANUM 3
+
+
+#define DF_ORIGIN 0x00000001
+#define DF_SYMBOLIC 0x00000002
+#define DF_TEXTREL 0x00000004
+#define DF_BIND_NOW 0x00000008
+#define DF_STATIC_TLS 0x00000010
+
+
+
+#define DF_1_NOW 0x00000001
+#define DF_1_GLOBAL 0x00000002
+#define DF_1_GROUP 0x00000004
+#define DF_1_NODELETE 0x00000008
+#define DF_1_LOADFLTR 0x00000010
+#define DF_1_INITFIRST 0x00000020
+#define DF_1_NOOPEN 0x00000040
+#define DF_1_ORIGIN 0x00000080
+#define DF_1_DIRECT 0x00000100
+#define DF_1_TRANS 0x00000200
+#define DF_1_INTERPOSE 0x00000400
+#define DF_1_NODEFLIB 0x00000800
+#define DF_1_NODUMP 0x00001000
+#define DF_1_CONFALT 0x00002000
+#define DF_1_ENDFILTEE 0x00004000
+#define DF_1_DISPRELDNE 0x00008000
+#define DF_1_DISPRELPND 0x00010000
+#define DF_1_NODIRECT 0x00020000
+#define DF_1_IGNMULDEF 0x00040000
+#define DF_1_NOKSYMS 0x00080000
+#define DF_1_NOHDR 0x00100000
+#define DF_1_EDITED 0x00200000
+#define DF_1_NORELOC 0x00400000
+#define DF_1_SYMINTPOSE 0x00800000
+#define DF_1_GLOBAUDIT 0x01000000
+#define DF_1_SINGLETON 0x02000000
+
+#define DTF_1_PARINIT 0x00000001
+#define DTF_1_CONFEXP 0x00000002
+
+
+#define DF_P1_LAZYLOAD 0x00000001
+#define DF_P1_GROUPPERM 0x00000002
+
+
+
+
+typedef struct {
+ Elf32_Half vd_version;
+ Elf32_Half vd_flags;
+ Elf32_Half vd_ndx;
+ Elf32_Half vd_cnt;
+ Elf32_Word vd_hash;
+ Elf32_Word vd_aux;
+ Elf32_Word vd_next;
+} Elf32_Verdef;
+
+typedef struct {
+ Elf64_Half vd_version;
+ Elf64_Half vd_flags;
+ Elf64_Half vd_ndx;
+ Elf64_Half vd_cnt;
+ Elf64_Word vd_hash;
+ Elf64_Word vd_aux;
+ Elf64_Word vd_next;
+} Elf64_Verdef;
+
+
+
+#define VER_DEF_NONE 0
+#define VER_DEF_CURRENT 1
+#define VER_DEF_NUM 2
+
+
+#define VER_FLG_BASE 0x1
+#define VER_FLG_WEAK 0x2
+
+
+#define VER_NDX_LOCAL 0
+#define VER_NDX_GLOBAL 1
+#define VER_NDX_LORESERVE 0xff00
+#define VER_NDX_ELIMINATE 0xff01
+
+
+
+typedef struct {
+ Elf32_Word vda_name;
+ Elf32_Word vda_next;
+} Elf32_Verdaux;
+
+typedef struct {
+ Elf64_Word vda_name;
+ Elf64_Word vda_next;
+} Elf64_Verdaux;
+
+
+
+
+typedef struct {
+ Elf32_Half vn_version;
+ Elf32_Half vn_cnt;
+ Elf32_Word vn_file;
+ Elf32_Word vn_aux;
+ Elf32_Word vn_next;
+} Elf32_Verneed;
+
+typedef struct {
+ Elf64_Half vn_version;
+ Elf64_Half vn_cnt;
+ Elf64_Word vn_file;
+ Elf64_Word vn_aux;
+ Elf64_Word vn_next;
+} Elf64_Verneed;
+
+
+
+#define VER_NEED_NONE 0
+#define VER_NEED_CURRENT 1
+#define VER_NEED_NUM 2
+
+
+
+typedef struct {
+ Elf32_Word vna_hash;
+ Elf32_Half vna_flags;
+ Elf32_Half vna_other;
+ Elf32_Word vna_name;
+ Elf32_Word vna_next;
+} Elf32_Vernaux;
+
+typedef struct {
+ Elf64_Word vna_hash;
+ Elf64_Half vna_flags;
+ Elf64_Half vna_other;
+ Elf64_Word vna_name;
+ Elf64_Word vna_next;
+} Elf64_Vernaux;
+
+
+
+#define VER_FLG_WEAK 0x2
+
+
+
+typedef struct {
+ uint32_t a_type;
+ union {
+ uint32_t a_val;
+ } a_un;
+} Elf32_auxv_t;
+
+typedef struct {
+ uint64_t a_type;
+ union {
+ uint64_t a_val;
+ } a_un;
+} Elf64_auxv_t;
+
+
+
+#define AT_NULL 0
+#define AT_IGNORE 1
+#define AT_EXECFD 2
+#define AT_PHDR 3
+#define AT_PHENT 4
+#define AT_PHNUM 5
+#define AT_PAGESZ 6
+#define AT_BASE 7
+#define AT_FLAGS 8
+#define AT_ENTRY 9
+#define AT_NOTELF 10
+#define AT_UID 11
+#define AT_EUID 12
+#define AT_GID 13
+#define AT_EGID 14
+#define AT_CLKTCK 17
+
+
+#define AT_PLATFORM 15
+#define AT_HWCAP 16
+
+
+
+
+#define AT_FPUCW 18
+
+
+#define AT_DCACHEBSIZE 19
+#define AT_ICACHEBSIZE 20
+#define AT_UCACHEBSIZE 21
+
+
+
+#define AT_IGNOREPPC 22
+
+#define AT_SECURE 23
+
+#define AT_BASE_PLATFORM 24
+
+#define AT_RANDOM 25
+
+#define AT_HWCAP2 26
+
+#define AT_EXECFN 31
+
+
+
+#define AT_SYSINFO 32
+#define AT_SYSINFO_EHDR 33
+
+
+
+#define AT_L1I_CACHESHAPE 34
+#define AT_L1D_CACHESHAPE 35
+#define AT_L2_CACHESHAPE 36
+#define AT_L3_CACHESHAPE 37
+
+
+
+
+typedef struct {
+ Elf32_Word n_namesz;
+ Elf32_Word n_descsz;
+ Elf32_Word n_type;
+} Elf32_Nhdr;
+
+typedef struct {
+ Elf64_Word n_namesz;
+ Elf64_Word n_descsz;
+ Elf64_Word n_type;
+} Elf64_Nhdr;
+
+
+
+
+#define ELF_NOTE_SOLARIS "SUNW Solaris"
+
+
+#define ELF_NOTE_GNU "GNU"
+
+
+
+
+
+#define ELF_NOTE_PAGESIZE_HINT 1
+
+
+#define NT_GNU_ABI_TAG 1
+#define ELF_NOTE_ABI NT_GNU_ABI_TAG
+
+
+
+#define ELF_NOTE_OS_LINUX 0
+#define ELF_NOTE_OS_GNU 1
+#define ELF_NOTE_OS_SOLARIS2 2
+#define ELF_NOTE_OS_FREEBSD 3
+
+#define NT_GNU_BUILD_ID 3
+#define NT_GNU_GOLD_VERSION 4
+
+
+
+typedef struct {
+ Elf32_Xword m_value;
+ Elf32_Word m_info;
+ Elf32_Word m_poffset;
+ Elf32_Half m_repeat;
+ Elf32_Half m_stride;
+} Elf32_Move;
+
+typedef struct {
+ Elf64_Xword m_value;
+ Elf64_Xword m_info;
+ Elf64_Xword m_poffset;
+ Elf64_Half m_repeat;
+ Elf64_Half m_stride;
+} Elf64_Move;
+
+
+#define ELF32_M_SYM(info) ((info) >> 8)
+#define ELF32_M_SIZE(info) ((unsigned char) (info))
+#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
+
+#define ELF64_M_SYM(info) ELF32_M_SYM (info)
+#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
+#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
+
+#define EF_CPU32 0x00810000
+
+#define R_68K_NONE 0
+#define R_68K_32 1
+#define R_68K_16 2
+#define R_68K_8 3
+#define R_68K_PC32 4
+#define R_68K_PC16 5
+#define R_68K_PC8 6
+#define R_68K_GOT32 7
+#define R_68K_GOT16 8
+#define R_68K_GOT8 9
+#define R_68K_GOT32O 10
+#define R_68K_GOT16O 11
+#define R_68K_GOT8O 12
+#define R_68K_PLT32 13
+#define R_68K_PLT16 14
+#define R_68K_PLT8 15
+#define R_68K_PLT32O 16
+#define R_68K_PLT16O 17
+#define R_68K_PLT8O 18
+#define R_68K_COPY 19
+#define R_68K_GLOB_DAT 20
+#define R_68K_JMP_SLOT 21
+#define R_68K_RELATIVE 22
+#define R_68K_NUM 23
+
+#define R_386_NONE 0
+#define R_386_32 1
+#define R_386_PC32 2
+#define R_386_GOT32 3
+#define R_386_PLT32 4
+#define R_386_COPY 5
+#define R_386_GLOB_DAT 6
+#define R_386_JMP_SLOT 7
+#define R_386_RELATIVE 8
+#define R_386_GOTOFF 9
+#define R_386_GOTPC 10
+#define R_386_32PLT 11
+#define R_386_TLS_TPOFF 14
+#define R_386_TLS_IE 15
+#define R_386_TLS_GOTIE 16
+#define R_386_TLS_LE 17
+#define R_386_TLS_GD 18
+#define R_386_TLS_LDM 19
+#define R_386_16 20
+#define R_386_PC16 21
+#define R_386_8 22
+#define R_386_PC8 23
+#define R_386_TLS_GD_32 24
+#define R_386_TLS_GD_PUSH 25
+#define R_386_TLS_GD_CALL 26
+#define R_386_TLS_GD_POP 27
+#define R_386_TLS_LDM_32 28
+#define R_386_TLS_LDM_PUSH 29
+#define R_386_TLS_LDM_CALL 30
+#define R_386_TLS_LDM_POP 31
+#define R_386_TLS_LDO_32 32
+#define R_386_TLS_IE_32 33
+#define R_386_TLS_LE_32 34
+#define R_386_TLS_DTPMOD32 35
+#define R_386_TLS_DTPOFF32 36
+#define R_386_TLS_TPOFF32 37
+#define R_386_SIZE32 38
+#define R_386_TLS_GOTDESC 39
+#define R_386_TLS_DESC_CALL 40
+#define R_386_TLS_DESC 41
+#define R_386_IRELATIVE 42
+#define R_386_GOT32X 43
+#define R_386_NUM 44
+
+
+
+
+
+#define STT_SPARC_REGISTER 13
+
+
+
+#define EF_SPARCV9_MM 3
+#define EF_SPARCV9_TSO 0
+#define EF_SPARCV9_PSO 1
+#define EF_SPARCV9_RMO 2
+#define EF_SPARC_LEDATA 0x800000
+#define EF_SPARC_EXT_MASK 0xFFFF00
+#define EF_SPARC_32PLUS 0x000100
+#define EF_SPARC_SUN_US1 0x000200
+#define EF_SPARC_HAL_R1 0x000400
+#define EF_SPARC_SUN_US3 0x000800
+
+
+
+#define R_SPARC_NONE 0
+#define R_SPARC_8 1
+#define R_SPARC_16 2
+#define R_SPARC_32 3
+#define R_SPARC_DISP8 4
+#define R_SPARC_DISP16 5
+#define R_SPARC_DISP32 6
+#define R_SPARC_WDISP30 7
+#define R_SPARC_WDISP22 8
+#define R_SPARC_HI22 9
+#define R_SPARC_22 10
+#define R_SPARC_13 11
+#define R_SPARC_LO10 12
+#define R_SPARC_GOT10 13
+#define R_SPARC_GOT13 14
+#define R_SPARC_GOT22 15
+#define R_SPARC_PC10 16
+#define R_SPARC_PC22 17
+#define R_SPARC_WPLT30 18
+#define R_SPARC_COPY 19
+#define R_SPARC_GLOB_DAT 20
+#define R_SPARC_JMP_SLOT 21
+#define R_SPARC_RELATIVE 22
+#define R_SPARC_UA32 23
+
+
+
+#define R_SPARC_PLT32 24
+#define R_SPARC_HIPLT22 25
+#define R_SPARC_LOPLT10 26
+#define R_SPARC_PCPLT32 27
+#define R_SPARC_PCPLT22 28
+#define R_SPARC_PCPLT10 29
+#define R_SPARC_10 30
+#define R_SPARC_11 31
+#define R_SPARC_64 32
+#define R_SPARC_OLO10 33
+#define R_SPARC_HH22 34
+#define R_SPARC_HM10 35
+#define R_SPARC_LM22 36
+#define R_SPARC_PC_HH22 37
+#define R_SPARC_PC_HM10 38
+#define R_SPARC_PC_LM22 39
+#define R_SPARC_WDISP16 40
+#define R_SPARC_WDISP19 41
+#define R_SPARC_GLOB_JMP 42
+#define R_SPARC_7 43
+#define R_SPARC_5 44
+#define R_SPARC_6 45
+#define R_SPARC_DISP64 46
+#define R_SPARC_PLT64 47
+#define R_SPARC_HIX22 48
+#define R_SPARC_LOX10 49
+#define R_SPARC_H44 50
+#define R_SPARC_M44 51
+#define R_SPARC_L44 52
+#define R_SPARC_REGISTER 53
+#define R_SPARC_UA64 54
+#define R_SPARC_UA16 55
+#define R_SPARC_TLS_GD_HI22 56
+#define R_SPARC_TLS_GD_LO10 57
+#define R_SPARC_TLS_GD_ADD 58
+#define R_SPARC_TLS_GD_CALL 59
+#define R_SPARC_TLS_LDM_HI22 60
+#define R_SPARC_TLS_LDM_LO10 61
+#define R_SPARC_TLS_LDM_ADD 62
+#define R_SPARC_TLS_LDM_CALL 63
+#define R_SPARC_TLS_LDO_HIX22 64
+#define R_SPARC_TLS_LDO_LOX10 65
+#define R_SPARC_TLS_LDO_ADD 66
+#define R_SPARC_TLS_IE_HI22 67
+#define R_SPARC_TLS_IE_LO10 68
+#define R_SPARC_TLS_IE_LD 69
+#define R_SPARC_TLS_IE_LDX 70
+#define R_SPARC_TLS_IE_ADD 71
+#define R_SPARC_TLS_LE_HIX22 72
+#define R_SPARC_TLS_LE_LOX10 73
+#define R_SPARC_TLS_DTPMOD32 74
+#define R_SPARC_TLS_DTPMOD64 75
+#define R_SPARC_TLS_DTPOFF32 76
+#define R_SPARC_TLS_DTPOFF64 77
+#define R_SPARC_TLS_TPOFF32 78
+#define R_SPARC_TLS_TPOFF64 79
+#define R_SPARC_GOTDATA_HIX22 80
+#define R_SPARC_GOTDATA_LOX10 81
+#define R_SPARC_GOTDATA_OP_HIX22 82
+#define R_SPARC_GOTDATA_OP_LOX10 83
+#define R_SPARC_GOTDATA_OP 84
+#define R_SPARC_H34 85
+#define R_SPARC_SIZE32 86
+#define R_SPARC_SIZE64 87
+#define R_SPARC_GNU_VTINHERIT 250
+#define R_SPARC_GNU_VTENTRY 251
+#define R_SPARC_REV32 252
+
+#define R_SPARC_NUM 253
+
+
+
+#define DT_SPARC_REGISTER 0x70000001
+#define DT_SPARC_NUM 2
+
+
+#define EF_MIPS_NOREORDER 1
+#define EF_MIPS_PIC 2
+#define EF_MIPS_CPIC 4
+#define EF_MIPS_XGOT 8
+#define EF_MIPS_64BIT_WHIRL 16
+#define EF_MIPS_ABI2 32
+#define EF_MIPS_ABI_ON32 64
+#define EF_MIPS_FP64 512
+#define EF_MIPS_NAN2008 1024
+#define EF_MIPS_ARCH 0xf0000000
+
+
+
+#define EF_MIPS_ARCH_1 0x00000000
+#define EF_MIPS_ARCH_2 0x10000000
+#define EF_MIPS_ARCH_3 0x20000000
+#define EF_MIPS_ARCH_4 0x30000000
+#define EF_MIPS_ARCH_5 0x40000000
+#define EF_MIPS_ARCH_32 0x50000000
+#define EF_MIPS_ARCH_64 0x60000000
+#define EF_MIPS_ARCH_32R2 0x70000000
+#define EF_MIPS_ARCH_64R2 0x80000000
+
+
+#define E_MIPS_ARCH_1 0x00000000
+#define E_MIPS_ARCH_2 0x10000000
+#define E_MIPS_ARCH_3 0x20000000
+#define E_MIPS_ARCH_4 0x30000000
+#define E_MIPS_ARCH_5 0x40000000
+#define E_MIPS_ARCH_32 0x50000000
+#define E_MIPS_ARCH_64 0x60000000
+
+
+
+#define SHN_MIPS_ACOMMON 0xff00
+#define SHN_MIPS_TEXT 0xff01
+#define SHN_MIPS_DATA 0xff02
+#define SHN_MIPS_SCOMMON 0xff03
+#define SHN_MIPS_SUNDEFINED 0xff04
+
+
+
+#define SHT_MIPS_LIBLIST 0x70000000
+#define SHT_MIPS_MSYM 0x70000001
+#define SHT_MIPS_CONFLICT 0x70000002
+#define SHT_MIPS_GPTAB 0x70000003
+#define SHT_MIPS_UCODE 0x70000004
+#define SHT_MIPS_DEBUG 0x70000005
+#define SHT_MIPS_REGINFO 0x70000006
+#define SHT_MIPS_PACKAGE 0x70000007
+#define SHT_MIPS_PACKSYM 0x70000008
+#define SHT_MIPS_RELD 0x70000009
+#define SHT_MIPS_IFACE 0x7000000b
+#define SHT_MIPS_CONTENT 0x7000000c
+#define SHT_MIPS_OPTIONS 0x7000000d
+#define SHT_MIPS_SHDR 0x70000010
+#define SHT_MIPS_FDESC 0x70000011
+#define SHT_MIPS_EXTSYM 0x70000012
+#define SHT_MIPS_DENSE 0x70000013
+#define SHT_MIPS_PDESC 0x70000014
+#define SHT_MIPS_LOCSYM 0x70000015
+#define SHT_MIPS_AUXSYM 0x70000016
+#define SHT_MIPS_OPTSYM 0x70000017
+#define SHT_MIPS_LOCSTR 0x70000018
+#define SHT_MIPS_LINE 0x70000019
+#define SHT_MIPS_RFDESC 0x7000001a
+#define SHT_MIPS_DELTASYM 0x7000001b
+#define SHT_MIPS_DELTAINST 0x7000001c
+#define SHT_MIPS_DELTACLASS 0x7000001d
+#define SHT_MIPS_DWARF 0x7000001e
+#define SHT_MIPS_DELTADECL 0x7000001f
+#define SHT_MIPS_SYMBOL_LIB 0x70000020
+#define SHT_MIPS_EVENTS 0x70000021
+#define SHT_MIPS_TRANSLATE 0x70000022
+#define SHT_MIPS_PIXIE 0x70000023
+#define SHT_MIPS_XLATE 0x70000024
+#define SHT_MIPS_XLATE_DEBUG 0x70000025
+#define SHT_MIPS_WHIRL 0x70000026
+#define SHT_MIPS_EH_REGION 0x70000027
+#define SHT_MIPS_XLATE_OLD 0x70000028
+#define SHT_MIPS_PDR_EXCEPTION 0x70000029
+
+
+
+#define SHF_MIPS_GPREL 0x10000000
+#define SHF_MIPS_MERGE 0x20000000
+#define SHF_MIPS_ADDR 0x40000000
+#define SHF_MIPS_STRINGS 0x80000000
+#define SHF_MIPS_NOSTRIP 0x08000000
+#define SHF_MIPS_LOCAL 0x04000000
+#define SHF_MIPS_NAMES 0x02000000
+#define SHF_MIPS_NODUPE 0x01000000
+
+
+
+
+
+#define STO_MIPS_DEFAULT 0x0
+#define STO_MIPS_INTERNAL 0x1
+#define STO_MIPS_HIDDEN 0x2
+#define STO_MIPS_PROTECTED 0x3
+#define STO_MIPS_PLT 0x8
+#define STO_MIPS_SC_ALIGN_UNUSED 0xff
+
+
+#define STB_MIPS_SPLIT_COMMON 13
+
+
+
+typedef union {
+ struct {
+ Elf32_Word gt_current_g_value;
+ Elf32_Word gt_unused;
+ } gt_header;
+ struct {
+ Elf32_Word gt_g_value;
+ Elf32_Word gt_bytes;
+ } gt_entry;
+} Elf32_gptab;
+
+
+
+typedef struct {
+ Elf32_Word ri_gprmask;
+ Elf32_Word ri_cprmask[4];
+ Elf32_Sword ri_gp_value;
+} Elf32_RegInfo;
+
+
+
+typedef struct {
+ unsigned char kind;
+
+ unsigned char size;
+ Elf32_Section section;
+
+ Elf32_Word info;
+} Elf_Options;
+
+
+
+#define ODK_NULL 0
+#define ODK_REGINFO 1
+#define ODK_EXCEPTIONS 2
+#define ODK_PAD 3
+#define ODK_HWPATCH 4
+#define ODK_FILL 5
+#define ODK_TAGS 6
+#define ODK_HWAND 7
+#define ODK_HWOR 8
+
+
+
+#define OEX_FPU_MIN 0x1f
+#define OEX_FPU_MAX 0x1f00
+#define OEX_PAGE0 0x10000
+#define OEX_SMM 0x20000
+#define OEX_FPDBUG 0x40000
+#define OEX_PRECISEFP OEX_FPDBUG
+#define OEX_DISMISS 0x80000
+
+#define OEX_FPU_INVAL 0x10
+#define OEX_FPU_DIV0 0x08
+#define OEX_FPU_OFLO 0x04
+#define OEX_FPU_UFLO 0x02
+#define OEX_FPU_INEX 0x01
+
+
+
+#define OHW_R4KEOP 0x1
+#define OHW_R8KPFETCH 0x2
+#define OHW_R5KEOP 0x4
+#define OHW_R5KCVTL 0x8
+
+#define OPAD_PREFIX 0x1
+#define OPAD_POSTFIX 0x2
+#define OPAD_SYMBOL 0x4
+
+
+
+typedef struct {
+ Elf32_Word hwp_flags1;
+ Elf32_Word hwp_flags2;
+} Elf_Options_Hw;
+
+
+
+#define OHWA0_R4KEOP_CHECKED 0x00000001
+#define OHWA1_R4KEOP_CLEAN 0x00000002
+
+
+
+#define R_MIPS_NONE 0
+#define R_MIPS_16 1
+#define R_MIPS_32 2
+#define R_MIPS_REL32 3
+#define R_MIPS_26 4
+#define R_MIPS_HI16 5
+#define R_MIPS_LO16 6
+#define R_MIPS_GPREL16 7
+#define R_MIPS_LITERAL 8
+#define R_MIPS_GOT16 9
+#define R_MIPS_PC16 10
+#define R_MIPS_CALL16 11
+#define R_MIPS_GPREL32 12
+
+#define R_MIPS_SHIFT5 16
+#define R_MIPS_SHIFT6 17
+#define R_MIPS_64 18
+#define R_MIPS_GOT_DISP 19
+#define R_MIPS_GOT_PAGE 20
+#define R_MIPS_GOT_OFST 21
+#define R_MIPS_GOT_HI16 22
+#define R_MIPS_GOT_LO16 23
+#define R_MIPS_SUB 24
+#define R_MIPS_INSERT_A 25
+#define R_MIPS_INSERT_B 26
+#define R_MIPS_DELETE 27
+#define R_MIPS_HIGHER 28
+#define R_MIPS_HIGHEST 29
+#define R_MIPS_CALL_HI16 30
+#define R_MIPS_CALL_LO16 31
+#define R_MIPS_SCN_DISP 32
+#define R_MIPS_REL16 33
+#define R_MIPS_ADD_IMMEDIATE 34
+#define R_MIPS_PJUMP 35
+#define R_MIPS_RELGOT 36
+#define R_MIPS_JALR 37
+#define R_MIPS_TLS_DTPMOD32 38
+#define R_MIPS_TLS_DTPREL32 39
+#define R_MIPS_TLS_DTPMOD64 40
+#define R_MIPS_TLS_DTPREL64 41
+#define R_MIPS_TLS_GD 42
+#define R_MIPS_TLS_LDM 43
+#define R_MIPS_TLS_DTPREL_HI16 44
+#define R_MIPS_TLS_DTPREL_LO16 45
+#define R_MIPS_TLS_GOTTPREL 46
+#define R_MIPS_TLS_TPREL32 47
+#define R_MIPS_TLS_TPREL64 48
+#define R_MIPS_TLS_TPREL_HI16 49
+#define R_MIPS_TLS_TPREL_LO16 50
+#define R_MIPS_GLOB_DAT 51
+#define R_MIPS_COPY 126
+#define R_MIPS_JUMP_SLOT 127
+
+#define R_MIPS_NUM 128
+
+
+
+#define PT_MIPS_REGINFO 0x70000000
+#define PT_MIPS_RTPROC 0x70000001
+#define PT_MIPS_OPTIONS 0x70000002
+#define PT_MIPS_ABIFLAGS 0x70000003
+
+
+
+#define PF_MIPS_LOCAL 0x10000000
+
+
+
+#define DT_MIPS_RLD_VERSION 0x70000001
+#define DT_MIPS_TIME_STAMP 0x70000002
+#define DT_MIPS_ICHECKSUM 0x70000003
+#define DT_MIPS_IVERSION 0x70000004
+#define DT_MIPS_FLAGS 0x70000005
+#define DT_MIPS_BASE_ADDRESS 0x70000006
+#define DT_MIPS_MSYM 0x70000007
+#define DT_MIPS_CONFLICT 0x70000008
+#define DT_MIPS_LIBLIST 0x70000009
+#define DT_MIPS_LOCAL_GOTNO 0x7000000a
+#define DT_MIPS_CONFLICTNO 0x7000000b
+#define DT_MIPS_LIBLISTNO 0x70000010
+#define DT_MIPS_SYMTABNO 0x70000011
+#define DT_MIPS_UNREFEXTNO 0x70000012
+#define DT_MIPS_GOTSYM 0x70000013
+#define DT_MIPS_HIPAGENO 0x70000014
+#define DT_MIPS_RLD_MAP 0x70000016
+#define DT_MIPS_DELTA_CLASS 0x70000017
+#define DT_MIPS_DELTA_CLASS_NO 0x70000018
+
+#define DT_MIPS_DELTA_INSTANCE 0x70000019
+#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
+
+#define DT_MIPS_DELTA_RELOC 0x7000001b
+#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
+
+#define DT_MIPS_DELTA_SYM 0x7000001d
+
+#define DT_MIPS_DELTA_SYM_NO 0x7000001e
+
+#define DT_MIPS_DELTA_CLASSSYM 0x70000020
+
+#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
+
+#define DT_MIPS_CXX_FLAGS 0x70000022
+#define DT_MIPS_PIXIE_INIT 0x70000023
+#define DT_MIPS_SYMBOL_LIB 0x70000024
+#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
+#define DT_MIPS_LOCAL_GOTIDX 0x70000026
+#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
+#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
+#define DT_MIPS_OPTIONS 0x70000029
+#define DT_MIPS_INTERFACE 0x7000002a
+#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
+#define DT_MIPS_INTERFACE_SIZE 0x7000002c
+#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
+
+#define DT_MIPS_PERF_SUFFIX 0x7000002e
+
+#define DT_MIPS_COMPACT_SIZE 0x7000002f
+#define DT_MIPS_GP_VALUE 0x70000030
+#define DT_MIPS_AUX_DYNAMIC 0x70000031
+
+#define DT_MIPS_PLTGOT 0x70000032
+
+#define DT_MIPS_RWPLT 0x70000034
+#define DT_MIPS_RLD_MAP_REL 0x70000035
+#define DT_MIPS_NUM 0x36
+
+
+
+#define RHF_NONE 0
+#define RHF_QUICKSTART (1 << 0)
+#define RHF_NOTPOT (1 << 1)
+#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
+#define RHF_NO_MOVE (1 << 3)
+#define RHF_SGI_ONLY (1 << 4)
+#define RHF_GUARANTEE_INIT (1 << 5)
+#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
+#define RHF_GUARANTEE_START_INIT (1 << 7)
+#define RHF_PIXIE (1 << 8)
+#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
+#define RHF_REQUICKSTART (1 << 10)
+#define RHF_REQUICKSTARTED (1 << 11)
+#define RHF_CORD (1 << 12)
+#define RHF_NO_UNRES_UNDEF (1 << 13)
+#define RHF_RLD_ORDER_SAFE (1 << 14)
+
+
+
+typedef struct {
+ Elf32_Word l_name;
+ Elf32_Word l_time_stamp;
+ Elf32_Word l_checksum;
+ Elf32_Word l_version;
+ Elf32_Word l_flags;
+} Elf32_Lib;
+
+typedef struct {
+ Elf64_Word l_name;
+ Elf64_Word l_time_stamp;
+ Elf64_Word l_checksum;
+ Elf64_Word l_version;
+ Elf64_Word l_flags;
+} Elf64_Lib;
+
+
+
+
+#define LL_NONE 0
+#define LL_EXACT_MATCH (1 << 0)
+#define LL_IGNORE_INT_VER (1 << 1)
+#define LL_REQUIRE_MINOR (1 << 2)
+#define LL_EXPORTS (1 << 3)
+#define LL_DELAY_LOAD (1 << 4)
+#define LL_DELTA (1 << 5)
+
+
+
+typedef Elf32_Addr Elf32_Conflict;
+
+typedef struct {
+ Elf32_Half version;
+ unsigned char isa_level;
+ unsigned char isa_rev;
+ unsigned char gpr_size;
+ unsigned char cpr1_size;
+ unsigned char cpr2_size;
+ unsigned char fp_abi;
+ Elf32_Word isa_ext;
+ Elf32_Word ases;
+ Elf32_Word flags1;
+ Elf32_Word flags2;
+} Elf_MIPS_ABIFlags_v0;
+
+#define MIPS_AFL_REG_NONE 0x00
+#define MIPS_AFL_REG_32 0x01
+#define MIPS_AFL_REG_64 0x02
+#define MIPS_AFL_REG_128 0x03
+
+#define MIPS_AFL_ASE_DSP 0x00000001
+#define MIPS_AFL_ASE_DSPR2 0x00000002
+#define MIPS_AFL_ASE_EVA 0x00000004
+#define MIPS_AFL_ASE_MCU 0x00000008
+#define MIPS_AFL_ASE_MDMX 0x00000010
+#define MIPS_AFL_ASE_MIPS3D 0x00000020
+#define MIPS_AFL_ASE_MT 0x00000040
+#define MIPS_AFL_ASE_SMARTMIPS 0x00000080
+#define MIPS_AFL_ASE_VIRT 0x00000100
+#define MIPS_AFL_ASE_MSA 0x00000200
+#define MIPS_AFL_ASE_MIPS16 0x00000400
+#define MIPS_AFL_ASE_MICROMIPS 0x00000800
+#define MIPS_AFL_ASE_XPA 0x00001000
+#define MIPS_AFL_ASE_MASK 0x00001fff
+
+#define MIPS_AFL_EXT_XLR 1
+#define MIPS_AFL_EXT_OCTEON2 2
+#define MIPS_AFL_EXT_OCTEONP 3
+#define MIPS_AFL_EXT_LOONGSON_3A 4
+#define MIPS_AFL_EXT_OCTEON 5
+#define MIPS_AFL_EXT_5900 6
+#define MIPS_AFL_EXT_4650 7
+#define MIPS_AFL_EXT_4010 8
+#define MIPS_AFL_EXT_4100 9
+#define MIPS_AFL_EXT_3900 10
+#define MIPS_AFL_EXT_10000 11
+#define MIPS_AFL_EXT_SB1 12
+#define MIPS_AFL_EXT_4111 13
+#define MIPS_AFL_EXT_4120 14
+#define MIPS_AFL_EXT_5400 15
+#define MIPS_AFL_EXT_5500 16
+#define MIPS_AFL_EXT_LOONGSON_2E 17
+#define MIPS_AFL_EXT_LOONGSON_2F 18
+
+#define MIPS_AFL_FLAGS1_ODDSPREG 1
+
+enum
+{
+ Val_GNU_MIPS_ABI_FP_ANY = 0,
+ Val_GNU_MIPS_ABI_FP_DOUBLE = 1,
+ Val_GNU_MIPS_ABI_FP_SINGLE = 2,
+ Val_GNU_MIPS_ABI_FP_SOFT = 3,
+ Val_GNU_MIPS_ABI_FP_OLD_64 = 4,
+ Val_GNU_MIPS_ABI_FP_XX = 5,
+ Val_GNU_MIPS_ABI_FP_64 = 6,
+ Val_GNU_MIPS_ABI_FP_64A = 7,
+ Val_GNU_MIPS_ABI_FP_MAX = 7
+};
+
+
+
+
+#define EF_PARISC_TRAPNIL 0x00010000
+#define EF_PARISC_EXT 0x00020000
+#define EF_PARISC_LSB 0x00040000
+#define EF_PARISC_WIDE 0x00080000
+#define EF_PARISC_NO_KABP 0x00100000
+
+#define EF_PARISC_LAZYSWAP 0x00400000
+#define EF_PARISC_ARCH 0x0000ffff
+
+
+
+#define EFA_PARISC_1_0 0x020b
+#define EFA_PARISC_1_1 0x0210
+#define EFA_PARISC_2_0 0x0214
+
+
+
+#define SHN_PARISC_ANSI_COMMON 0xff00
+
+#define SHN_PARISC_HUGE_COMMON 0xff01
+
+
+
+#define SHT_PARISC_EXT 0x70000000
+#define SHT_PARISC_UNWIND 0x70000001
+#define SHT_PARISC_DOC 0x70000002
+
+
+
+#define SHF_PARISC_SHORT 0x20000000
+#define SHF_PARISC_HUGE 0x40000000
+#define SHF_PARISC_SBP 0x80000000
+
+
+
+#define STT_PARISC_MILLICODE 13
+
+#define STT_HP_OPAQUE (STT_LOOS + 0x1)
+#define STT_HP_STUB (STT_LOOS + 0x2)
+
+
+
+#define R_PARISC_NONE 0
+#define R_PARISC_DIR32 1
+#define R_PARISC_DIR21L 2
+#define R_PARISC_DIR17R 3
+#define R_PARISC_DIR17F 4
+#define R_PARISC_DIR14R 6
+#define R_PARISC_PCREL32 9
+#define R_PARISC_PCREL21L 10
+#define R_PARISC_PCREL17R 11
+#define R_PARISC_PCREL17F 12
+#define R_PARISC_PCREL14R 14
+#define R_PARISC_DPREL21L 18
+#define R_PARISC_DPREL14R 22
+#define R_PARISC_GPREL21L 26
+#define R_PARISC_GPREL14R 30
+#define R_PARISC_LTOFF21L 34
+#define R_PARISC_LTOFF14R 38
+#define R_PARISC_SECREL32 41
+#define R_PARISC_SEGBASE 48
+#define R_PARISC_SEGREL32 49
+#define R_PARISC_PLTOFF21L 50
+#define R_PARISC_PLTOFF14R 54
+#define R_PARISC_LTOFF_FPTR32 57
+#define R_PARISC_LTOFF_FPTR21L 58
+#define R_PARISC_LTOFF_FPTR14R 62
+#define R_PARISC_FPTR64 64
+#define R_PARISC_PLABEL32 65
+#define R_PARISC_PLABEL21L 66
+#define R_PARISC_PLABEL14R 70
+#define R_PARISC_PCREL64 72
+#define R_PARISC_PCREL22F 74
+#define R_PARISC_PCREL14WR 75
+#define R_PARISC_PCREL14DR 76
+#define R_PARISC_PCREL16F 77
+#define R_PARISC_PCREL16WF 78
+#define R_PARISC_PCREL16DF 79
+#define R_PARISC_DIR64 80
+#define R_PARISC_DIR14WR 83
+#define R_PARISC_DIR14DR 84
+#define R_PARISC_DIR16F 85
+#define R_PARISC_DIR16WF 86
+#define R_PARISC_DIR16DF 87
+#define R_PARISC_GPREL64 88
+#define R_PARISC_GPREL14WR 91
+#define R_PARISC_GPREL14DR 92
+#define R_PARISC_GPREL16F 93
+#define R_PARISC_GPREL16WF 94
+#define R_PARISC_GPREL16DF 95
+#define R_PARISC_LTOFF64 96
+#define R_PARISC_LTOFF14WR 99
+#define R_PARISC_LTOFF14DR 100
+#define R_PARISC_LTOFF16F 101
+#define R_PARISC_LTOFF16WF 102
+#define R_PARISC_LTOFF16DF 103
+#define R_PARISC_SECREL64 104
+#define R_PARISC_SEGREL64 112
+#define R_PARISC_PLTOFF14WR 115
+#define R_PARISC_PLTOFF14DR 116
+#define R_PARISC_PLTOFF16F 117
+#define R_PARISC_PLTOFF16WF 118
+#define R_PARISC_PLTOFF16DF 119
+#define R_PARISC_LTOFF_FPTR64 120
+#define R_PARISC_LTOFF_FPTR14WR 123
+#define R_PARISC_LTOFF_FPTR14DR 124
+#define R_PARISC_LTOFF_FPTR16F 125
+#define R_PARISC_LTOFF_FPTR16WF 126
+#define R_PARISC_LTOFF_FPTR16DF 127
+#define R_PARISC_LORESERVE 128
+#define R_PARISC_COPY 128
+#define R_PARISC_IPLT 129
+#define R_PARISC_EPLT 130
+#define R_PARISC_TPREL32 153
+#define R_PARISC_TPREL21L 154
+#define R_PARISC_TPREL14R 158
+#define R_PARISC_LTOFF_TP21L 162
+#define R_PARISC_LTOFF_TP14R 166
+#define R_PARISC_LTOFF_TP14F 167
+#define R_PARISC_TPREL64 216
+#define R_PARISC_TPREL14WR 219
+#define R_PARISC_TPREL14DR 220
+#define R_PARISC_TPREL16F 221
+#define R_PARISC_TPREL16WF 222
+#define R_PARISC_TPREL16DF 223
+#define R_PARISC_LTOFF_TP64 224
+#define R_PARISC_LTOFF_TP14WR 227
+#define R_PARISC_LTOFF_TP14DR 228
+#define R_PARISC_LTOFF_TP16F 229
+#define R_PARISC_LTOFF_TP16WF 230
+#define R_PARISC_LTOFF_TP16DF 231
+#define R_PARISC_GNU_VTENTRY 232
+#define R_PARISC_GNU_VTINHERIT 233
+#define R_PARISC_TLS_GD21L 234
+#define R_PARISC_TLS_GD14R 235
+#define R_PARISC_TLS_GDCALL 236
+#define R_PARISC_TLS_LDM21L 237
+#define R_PARISC_TLS_LDM14R 238
+#define R_PARISC_TLS_LDMCALL 239
+#define R_PARISC_TLS_LDO21L 240
+#define R_PARISC_TLS_LDO14R 241
+#define R_PARISC_TLS_DTPMOD32 242
+#define R_PARISC_TLS_DTPMOD64 243
+#define R_PARISC_TLS_DTPOFF32 244
+#define R_PARISC_TLS_DTPOFF64 245
+#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
+#define R_PARISC_HIRESERVE 255
+
+
+
+#define PT_HP_TLS (PT_LOOS + 0x0)
+#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
+#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
+#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
+#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
+#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
+#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
+#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
+#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
+#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
+#define PT_HP_PARALLEL (PT_LOOS + 0x10)
+#define PT_HP_FASTBIND (PT_LOOS + 0x11)
+#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
+#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
+#define PT_HP_STACK (PT_LOOS + 0x14)
+
+#define PT_PARISC_ARCHEXT 0x70000000
+#define PT_PARISC_UNWIND 0x70000001
+
+
+
+#define PF_PARISC_SBP 0x08000000
+
+#define PF_HP_PAGE_SIZE 0x00100000
+#define PF_HP_FAR_SHARED 0x00200000
+#define PF_HP_NEAR_SHARED 0x00400000
+#define PF_HP_CODE 0x01000000
+#define PF_HP_MODIFY 0x02000000
+#define PF_HP_LAZYSWAP 0x04000000
+#define PF_HP_SBP 0x08000000
+
+
+
+
+
+
+#define EF_ALPHA_32BIT 1
+#define EF_ALPHA_CANRELAX 2
+
+
+
+
+#define SHT_ALPHA_DEBUG 0x70000001
+#define SHT_ALPHA_REGINFO 0x70000002
+
+
+
+#define SHF_ALPHA_GPREL 0x10000000
+
+
+#define STO_ALPHA_NOPV 0x80
+#define STO_ALPHA_STD_GPLOAD 0x88
+
+
+
+#define R_ALPHA_NONE 0
+#define R_ALPHA_REFLONG 1
+#define R_ALPHA_REFQUAD 2
+#define R_ALPHA_GPREL32 3
+#define R_ALPHA_LITERAL 4
+#define R_ALPHA_LITUSE 5
+#define R_ALPHA_GPDISP 6
+#define R_ALPHA_BRADDR 7
+#define R_ALPHA_HINT 8
+#define R_ALPHA_SREL16 9
+#define R_ALPHA_SREL32 10
+#define R_ALPHA_SREL64 11
+#define R_ALPHA_GPRELHIGH 17
+#define R_ALPHA_GPRELLOW 18
+#define R_ALPHA_GPREL16 19
+#define R_ALPHA_COPY 24
+#define R_ALPHA_GLOB_DAT 25
+#define R_ALPHA_JMP_SLOT 26
+#define R_ALPHA_RELATIVE 27
+#define R_ALPHA_TLS_GD_HI 28
+#define R_ALPHA_TLSGD 29
+#define R_ALPHA_TLS_LDM 30
+#define R_ALPHA_DTPMOD64 31
+#define R_ALPHA_GOTDTPREL 32
+#define R_ALPHA_DTPREL64 33
+#define R_ALPHA_DTPRELHI 34
+#define R_ALPHA_DTPRELLO 35
+#define R_ALPHA_DTPREL16 36
+#define R_ALPHA_GOTTPREL 37
+#define R_ALPHA_TPREL64 38
+#define R_ALPHA_TPRELHI 39
+#define R_ALPHA_TPRELLO 40
+#define R_ALPHA_TPREL16 41
+
+#define R_ALPHA_NUM 46
+
+
+#define LITUSE_ALPHA_ADDR 0
+#define LITUSE_ALPHA_BASE 1
+#define LITUSE_ALPHA_BYTOFF 2
+#define LITUSE_ALPHA_JSR 3
+#define LITUSE_ALPHA_TLS_GD 4
+#define LITUSE_ALPHA_TLS_LDM 5
+
+
+#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
+#define DT_ALPHA_NUM 1
+
+
+
+
+#define EF_PPC_EMB 0x80000000
+
+
+#define EF_PPC_RELOCATABLE 0x00010000
+#define EF_PPC_RELOCATABLE_LIB 0x00008000
+
+
+
+#define R_PPC_NONE 0
+#define R_PPC_ADDR32 1
+#define R_PPC_ADDR24 2
+#define R_PPC_ADDR16 3
+#define R_PPC_ADDR16_LO 4
+#define R_PPC_ADDR16_HI 5
+#define R_PPC_ADDR16_HA 6
+#define R_PPC_ADDR14 7
+#define R_PPC_ADDR14_BRTAKEN 8
+#define R_PPC_ADDR14_BRNTAKEN 9
+#define R_PPC_REL24 10
+#define R_PPC_REL14 11
+#define R_PPC_REL14_BRTAKEN 12
+#define R_PPC_REL14_BRNTAKEN 13
+#define R_PPC_GOT16 14
+#define R_PPC_GOT16_LO 15
+#define R_PPC_GOT16_HI 16
+#define R_PPC_GOT16_HA 17
+#define R_PPC_PLTREL24 18
+#define R_PPC_COPY 19
+#define R_PPC_GLOB_DAT 20
+#define R_PPC_JMP_SLOT 21
+#define R_PPC_RELATIVE 22
+#define R_PPC_LOCAL24PC 23
+#define R_PPC_UADDR32 24
+#define R_PPC_UADDR16 25
+#define R_PPC_REL32 26
+#define R_PPC_PLT32 27
+#define R_PPC_PLTREL32 28
+#define R_PPC_PLT16_LO 29
+#define R_PPC_PLT16_HI 30
+#define R_PPC_PLT16_HA 31
+#define R_PPC_SDAREL16 32
+#define R_PPC_SECTOFF 33
+#define R_PPC_SECTOFF_LO 34
+#define R_PPC_SECTOFF_HI 35
+#define R_PPC_SECTOFF_HA 36
+
+
+#define R_PPC_TLS 67
+#define R_PPC_DTPMOD32 68
+#define R_PPC_TPREL16 69
+#define R_PPC_TPREL16_LO 70
+#define R_PPC_TPREL16_HI 71
+#define R_PPC_TPREL16_HA 72
+#define R_PPC_TPREL32 73
+#define R_PPC_DTPREL16 74
+#define R_PPC_DTPREL16_LO 75
+#define R_PPC_DTPREL16_HI 76
+#define R_PPC_DTPREL16_HA 77
+#define R_PPC_DTPREL32 78
+#define R_PPC_GOT_TLSGD16 79
+#define R_PPC_GOT_TLSGD16_LO 80
+#define R_PPC_GOT_TLSGD16_HI 81
+#define R_PPC_GOT_TLSGD16_HA 82
+#define R_PPC_GOT_TLSLD16 83
+#define R_PPC_GOT_TLSLD16_LO 84
+#define R_PPC_GOT_TLSLD16_HI 85
+#define R_PPC_GOT_TLSLD16_HA 86
+#define R_PPC_GOT_TPREL16 87
+#define R_PPC_GOT_TPREL16_LO 88
+#define R_PPC_GOT_TPREL16_HI 89
+#define R_PPC_GOT_TPREL16_HA 90
+#define R_PPC_GOT_DTPREL16 91
+#define R_PPC_GOT_DTPREL16_LO 92
+#define R_PPC_GOT_DTPREL16_HI 93
+#define R_PPC_GOT_DTPREL16_HA 94
+#define R_PPC_TLSGD 95
+#define R_PPC_TLSLD 96
+
+
+#define R_PPC_EMB_NADDR32 101
+#define R_PPC_EMB_NADDR16 102
+#define R_PPC_EMB_NADDR16_LO 103
+#define R_PPC_EMB_NADDR16_HI 104
+#define R_PPC_EMB_NADDR16_HA 105
+#define R_PPC_EMB_SDAI16 106
+#define R_PPC_EMB_SDA2I16 107
+#define R_PPC_EMB_SDA2REL 108
+#define R_PPC_EMB_SDA21 109
+#define R_PPC_EMB_MRKREF 110
+#define R_PPC_EMB_RELSEC16 111
+#define R_PPC_EMB_RELST_LO 112
+#define R_PPC_EMB_RELST_HI 113
+#define R_PPC_EMB_RELST_HA 114
+#define R_PPC_EMB_BIT_FLD 115
+#define R_PPC_EMB_RELSDA 116
+
+
+#define R_PPC_DIAB_SDA21_LO 180
+#define R_PPC_DIAB_SDA21_HI 181
+#define R_PPC_DIAB_SDA21_HA 182
+#define R_PPC_DIAB_RELSDA_LO 183
+#define R_PPC_DIAB_RELSDA_HI 184
+#define R_PPC_DIAB_RELSDA_HA 185
+
+
+#define R_PPC_IRELATIVE 248
+
+
+#define R_PPC_REL16 249
+#define R_PPC_REL16_LO 250
+#define R_PPC_REL16_HI 251
+#define R_PPC_REL16_HA 252
+
+
+
+#define R_PPC_TOC16 255
+
+
+#define DT_PPC_GOT (DT_LOPROC + 0)
+#define DT_PPC_OPT (DT_LOPROC + 1)
+#define DT_PPC_NUM 2
+
+#define PPC_OPT_TLS 1
+
+
+#define R_PPC64_NONE R_PPC_NONE
+#define R_PPC64_ADDR32 R_PPC_ADDR32
+#define R_PPC64_ADDR24 R_PPC_ADDR24
+#define R_PPC64_ADDR16 R_PPC_ADDR16
+#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
+#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
+#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
+#define R_PPC64_ADDR14 R_PPC_ADDR14
+#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
+#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
+#define R_PPC64_REL24 R_PPC_REL24
+#define R_PPC64_REL14 R_PPC_REL14
+#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
+#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
+#define R_PPC64_GOT16 R_PPC_GOT16
+#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
+#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
+#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
+
+#define R_PPC64_COPY R_PPC_COPY
+#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
+#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
+#define R_PPC64_RELATIVE R_PPC_RELATIVE
+
+#define R_PPC64_UADDR32 R_PPC_UADDR32
+#define R_PPC64_UADDR16 R_PPC_UADDR16
+#define R_PPC64_REL32 R_PPC_REL32
+#define R_PPC64_PLT32 R_PPC_PLT32
+#define R_PPC64_PLTREL32 R_PPC_PLTREL32
+#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
+#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
+#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
+
+#define R_PPC64_SECTOFF R_PPC_SECTOFF
+#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
+#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
+#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
+#define R_PPC64_ADDR30 37
+#define R_PPC64_ADDR64 38
+#define R_PPC64_ADDR16_HIGHER 39
+#define R_PPC64_ADDR16_HIGHERA 40
+#define R_PPC64_ADDR16_HIGHEST 41
+#define R_PPC64_ADDR16_HIGHESTA 42
+#define R_PPC64_UADDR64 43
+#define R_PPC64_REL64 44
+#define R_PPC64_PLT64 45
+#define R_PPC64_PLTREL64 46
+#define R_PPC64_TOC16 47
+#define R_PPC64_TOC16_LO 48
+#define R_PPC64_TOC16_HI 49
+#define R_PPC64_TOC16_HA 50
+#define R_PPC64_TOC 51
+#define R_PPC64_PLTGOT16 52
+#define R_PPC64_PLTGOT16_LO 53
+#define R_PPC64_PLTGOT16_HI 54
+#define R_PPC64_PLTGOT16_HA 55
+
+#define R_PPC64_ADDR16_DS 56
+#define R_PPC64_ADDR16_LO_DS 57
+#define R_PPC64_GOT16_DS 58
+#define R_PPC64_GOT16_LO_DS 59
+#define R_PPC64_PLT16_LO_DS 60
+#define R_PPC64_SECTOFF_DS 61
+#define R_PPC64_SECTOFF_LO_DS 62
+#define R_PPC64_TOC16_DS 63
+#define R_PPC64_TOC16_LO_DS 64
+#define R_PPC64_PLTGOT16_DS 65
+#define R_PPC64_PLTGOT16_LO_DS 66
+
+
+#define R_PPC64_TLS 67
+#define R_PPC64_DTPMOD64 68
+#define R_PPC64_TPREL16 69
+#define R_PPC64_TPREL16_LO 70
+#define R_PPC64_TPREL16_HI 71
+#define R_PPC64_TPREL16_HA 72
+#define R_PPC64_TPREL64 73
+#define R_PPC64_DTPREL16 74
+#define R_PPC64_DTPREL16_LO 75
+#define R_PPC64_DTPREL16_HI 76
+#define R_PPC64_DTPREL16_HA 77
+#define R_PPC64_DTPREL64 78
+#define R_PPC64_GOT_TLSGD16 79
+#define R_PPC64_GOT_TLSGD16_LO 80
+#define R_PPC64_GOT_TLSGD16_HI 81
+#define R_PPC64_GOT_TLSGD16_HA 82
+#define R_PPC64_GOT_TLSLD16 83
+#define R_PPC64_GOT_TLSLD16_LO 84
+#define R_PPC64_GOT_TLSLD16_HI 85
+#define R_PPC64_GOT_TLSLD16_HA 86
+#define R_PPC64_GOT_TPREL16_DS 87
+#define R_PPC64_GOT_TPREL16_LO_DS 88
+#define R_PPC64_GOT_TPREL16_HI 89
+#define R_PPC64_GOT_TPREL16_HA 90
+#define R_PPC64_GOT_DTPREL16_DS 91
+#define R_PPC64_GOT_DTPREL16_LO_DS 92
+#define R_PPC64_GOT_DTPREL16_HI 93
+#define R_PPC64_GOT_DTPREL16_HA 94
+#define R_PPC64_TPREL16_DS 95
+#define R_PPC64_TPREL16_LO_DS 96
+#define R_PPC64_TPREL16_HIGHER 97
+#define R_PPC64_TPREL16_HIGHERA 98
+#define R_PPC64_TPREL16_HIGHEST 99
+#define R_PPC64_TPREL16_HIGHESTA 100
+#define R_PPC64_DTPREL16_DS 101
+#define R_PPC64_DTPREL16_LO_DS 102
+#define R_PPC64_DTPREL16_HIGHER 103
+#define R_PPC64_DTPREL16_HIGHERA 104
+#define R_PPC64_DTPREL16_HIGHEST 105
+#define R_PPC64_DTPREL16_HIGHESTA 106
+#define R_PPC64_TLSGD 107
+#define R_PPC64_TLSLD 108
+#define R_PPC64_TOCSAVE 109
+#define R_PPC64_ADDR16_HIGH 110
+#define R_PPC64_ADDR16_HIGHA 111
+#define R_PPC64_TPREL16_HIGH 112
+#define R_PPC64_TPREL16_HIGHA 113
+#define R_PPC64_DTPREL16_HIGH 114
+#define R_PPC64_DTPREL16_HIGHA 115
+
+
+#define R_PPC64_JMP_IREL 247
+#define R_PPC64_IRELATIVE 248
+#define R_PPC64_REL16 249
+#define R_PPC64_REL16_LO 250
+#define R_PPC64_REL16_HI 251
+#define R_PPC64_REL16_HA 252
+
+#define EF_PPC64_ABI 3
+
+#define DT_PPC64_GLINK (DT_LOPROC + 0)
+#define DT_PPC64_OPD (DT_LOPROC + 1)
+#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
+#define DT_PPC64_OPT (DT_LOPROC + 3)
+#define DT_PPC64_NUM 4
+
+#define PPC64_OPT_TLS 1
+#define PPC64_OPT_MULTI_TOC 2
+
+#define STO_PPC64_LOCAL_BIT 5
+#define STO_PPC64_LOCAL_MASK 0xe0
+#define PPC64_LOCAL_ENTRY_OFFSET(x) (1 << (((x)&0xe0)>>5) & 0xfc)
+
+
+#define EF_ARM_RELEXEC 0x01
+#define EF_ARM_HASENTRY 0x02
+#define EF_ARM_INTERWORK 0x04
+#define EF_ARM_APCS_26 0x08
+#define EF_ARM_APCS_FLOAT 0x10
+#define EF_ARM_PIC 0x20
+#define EF_ARM_ALIGN8 0x40
+#define EF_ARM_NEW_ABI 0x80
+#define EF_ARM_OLD_ABI 0x100
+#define EF_ARM_SOFT_FLOAT 0x200
+#define EF_ARM_VFP_FLOAT 0x400
+#define EF_ARM_MAVERICK_FLOAT 0x800
+
+#define EF_ARM_ABI_FLOAT_SOFT 0x200
+#define EF_ARM_ABI_FLOAT_HARD 0x400
+
+
+#define EF_ARM_SYMSARESORTED 0x04
+#define EF_ARM_DYNSYMSUSESEGIDX 0x08
+#define EF_ARM_MAPSYMSFIRST 0x10
+#define EF_ARM_EABIMASK 0XFF000000
+
+
+#define EF_ARM_BE8 0x00800000
+#define EF_ARM_LE8 0x00400000
+
+#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
+#define EF_ARM_EABI_UNKNOWN 0x00000000
+#define EF_ARM_EABI_VER1 0x01000000
+#define EF_ARM_EABI_VER2 0x02000000
+#define EF_ARM_EABI_VER3 0x03000000
+#define EF_ARM_EABI_VER4 0x04000000
+#define EF_ARM_EABI_VER5 0x05000000
+
+
+#define STT_ARM_TFUNC STT_LOPROC
+#define STT_ARM_16BIT STT_HIPROC
+
+
+#define SHF_ARM_ENTRYSECT 0x10000000
+#define SHF_ARM_COMDEF 0x80000000
+
+
+
+#define PF_ARM_SB 0x10000000
+
+#define PF_ARM_PI 0x20000000
+#define PF_ARM_ABS 0x40000000
+
+
+#define PT_ARM_EXIDX (PT_LOPROC + 1)
+
+
+#define SHT_ARM_EXIDX (SHT_LOPROC + 1)
+#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
+#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
+
+#define R_AARCH64_NONE 0
+#define R_AARCH64_P32_ABS32 1
+#define R_AARCH64_P32_COPY 180
+#define R_AARCH64_P32_GLOB_DAT 181
+#define R_AARCH64_P32_JUMP_SLOT 182
+#define R_AARCH64_P32_RELATIVE 183
+#define R_AARCH64_P32_TLS_DTPMOD 184
+#define R_AARCH64_P32_TLS_DTPREL 185
+#define R_AARCH64_P32_TLS_TPREL 186
+#define R_AARCH64_P32_TLSDESC 187
+#define R_AARCH64_P32_IRELATIVE 188
+#define R_AARCH64_ABS64 257
+#define R_AARCH64_ABS32 258
+#define R_AARCH64_ABS16 259
+#define R_AARCH64_PREL64 260
+#define R_AARCH64_PREL32 261
+#define R_AARCH64_PREL16 262
+#define R_AARCH64_MOVW_UABS_G0 263
+#define R_AARCH64_MOVW_UABS_G0_NC 264
+#define R_AARCH64_MOVW_UABS_G1 265
+#define R_AARCH64_MOVW_UABS_G1_NC 266
+#define R_AARCH64_MOVW_UABS_G2 267
+#define R_AARCH64_MOVW_UABS_G2_NC 268
+#define R_AARCH64_MOVW_UABS_G3 269
+#define R_AARCH64_MOVW_SABS_G0 270
+#define R_AARCH64_MOVW_SABS_G1 271
+#define R_AARCH64_MOVW_SABS_G2 272
+#define R_AARCH64_LD_PREL_LO19 273
+#define R_AARCH64_ADR_PREL_LO21 274
+#define R_AARCH64_ADR_PREL_PG_HI21 275
+#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
+#define R_AARCH64_ADD_ABS_LO12_NC 277
+#define R_AARCH64_LDST8_ABS_LO12_NC 278
+#define R_AARCH64_TSTBR14 279
+#define R_AARCH64_CONDBR19 280
+#define R_AARCH64_JUMP26 282
+#define R_AARCH64_CALL26 283
+#define R_AARCH64_LDST16_ABS_LO12_NC 284
+#define R_AARCH64_LDST32_ABS_LO12_NC 285
+#define R_AARCH64_LDST64_ABS_LO12_NC 286
+#define R_AARCH64_MOVW_PREL_G0 287
+#define R_AARCH64_MOVW_PREL_G0_NC 288
+#define R_AARCH64_MOVW_PREL_G1 289
+#define R_AARCH64_MOVW_PREL_G1_NC 290
+#define R_AARCH64_MOVW_PREL_G2 291
+#define R_AARCH64_MOVW_PREL_G2_NC 292
+#define R_AARCH64_MOVW_PREL_G3 293
+#define R_AARCH64_LDST128_ABS_LO12_NC 299
+#define R_AARCH64_MOVW_GOTOFF_G0 300
+#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
+#define R_AARCH64_MOVW_GOTOFF_G1 302
+#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
+#define R_AARCH64_MOVW_GOTOFF_G2 304
+#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
+#define R_AARCH64_MOVW_GOTOFF_G3 306
+#define R_AARCH64_GOTREL64 307
+#define R_AARCH64_GOTREL32 308
+#define R_AARCH64_GOT_LD_PREL19 309
+#define R_AARCH64_LD64_GOTOFF_LO15 310
+#define R_AARCH64_ADR_GOT_PAGE 311
+#define R_AARCH64_LD64_GOT_LO12_NC 312
+#define R_AARCH64_LD64_GOTPAGE_LO15 313
+#define R_AARCH64_TLSGD_ADR_PREL21 512
+#define R_AARCH64_TLSGD_ADR_PAGE21 513
+#define R_AARCH64_TLSGD_ADD_LO12_NC 514
+#define R_AARCH64_TLSGD_MOVW_G1 515
+#define R_AARCH64_TLSGD_MOVW_G0_NC 516
+#define R_AARCH64_TLSLD_ADR_PREL21 517
+#define R_AARCH64_TLSLD_ADR_PAGE21 518
+#define R_AARCH64_TLSLD_ADD_LO12_NC 519
+#define R_AARCH64_TLSLD_MOVW_G1 520
+#define R_AARCH64_TLSLD_MOVW_G0_NC 521
+#define R_AARCH64_TLSLD_LD_PREL19 522
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
+#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
+#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
+#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
+#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
+#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
+#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
+#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
+#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
+#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
+#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
+#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
+#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
+#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
+#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
+#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
+#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
+#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
+#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
+#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
+#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
+#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
+#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
+#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
+#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
+#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
+#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
+#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
+#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
+#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
+#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
+#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
+#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
+#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
+#define R_AARCH64_TLSDESC_LD_PREL19 560
+#define R_AARCH64_TLSDESC_ADR_PREL21 561
+#define R_AARCH64_TLSDESC_ADR_PAGE21 562
+#define R_AARCH64_TLSDESC_LD64_LO12 563
+#define R_AARCH64_TLSDESC_ADD_LO12 564
+#define R_AARCH64_TLSDESC_OFF_G1 565
+#define R_AARCH64_TLSDESC_OFF_G0_NC 566
+#define R_AARCH64_TLSDESC_LDR 567
+#define R_AARCH64_TLSDESC_ADD 568
+#define R_AARCH64_TLSDESC_CALL 569
+#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
+#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
+#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
+#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
+#define R_AARCH64_COPY 1024
+#define R_AARCH64_GLOB_DAT 1025
+#define R_AARCH64_JUMP_SLOT 1026
+#define R_AARCH64_RELATIVE 1027
+#define R_AARCH64_TLS_DTPMOD 1028
+#define R_AARCH64_TLS_DTPMOD64 1028
+#define R_AARCH64_TLS_DTPREL 1029
+#define R_AARCH64_TLS_DTPREL64 1029
+#define R_AARCH64_TLS_TPREL 1030
+#define R_AARCH64_TLS_TPREL64 1030
+#define R_AARCH64_TLSDESC 1031
+
+
+#define R_ARM_NONE 0
+#define R_ARM_PC24 1
+#define R_ARM_ABS32 2
+#define R_ARM_REL32 3
+#define R_ARM_PC13 4
+#define R_ARM_ABS16 5
+#define R_ARM_ABS12 6
+#define R_ARM_THM_ABS5 7
+#define R_ARM_ABS8 8
+#define R_ARM_SBREL32 9
+#define R_ARM_THM_PC22 10
+#define R_ARM_THM_PC8 11
+#define R_ARM_AMP_VCALL9 12
+#define R_ARM_TLS_DESC 13
+#define R_ARM_THM_SWI8 14
+#define R_ARM_XPC25 15
+#define R_ARM_THM_XPC22 16
+#define R_ARM_TLS_DTPMOD32 17
+#define R_ARM_TLS_DTPOFF32 18
+#define R_ARM_TLS_TPOFF32 19
+#define R_ARM_COPY 20
+#define R_ARM_GLOB_DAT 21
+#define R_ARM_JUMP_SLOT 22
+#define R_ARM_RELATIVE 23
+#define R_ARM_GOTOFF 24
+#define R_ARM_GOTPC 25
+#define R_ARM_GOT32 26
+#define R_ARM_PLT32 27
+#define R_ARM_CALL 28
+#define R_ARM_JUMP24 29
+#define R_ARM_THM_JUMP24 30
+#define R_ARM_BASE_ABS 31
+#define R_ARM_ALU_PCREL_7_0 32
+#define R_ARM_ALU_PCREL_15_8 33
+#define R_ARM_ALU_PCREL_23_15 34
+#define R_ARM_LDR_SBREL_11_0 35
+#define R_ARM_ALU_SBREL_19_12 36
+#define R_ARM_ALU_SBREL_27_20 37
+#define R_ARM_TARGET1 38
+#define R_ARM_SBREL31 39
+#define R_ARM_V4BX 40
+#define R_ARM_TARGET2 41
+#define R_ARM_PREL31 42
+#define R_ARM_MOVW_ABS_NC 43
+#define R_ARM_MOVT_ABS 44
+#define R_ARM_MOVW_PREL_NC 45
+#define R_ARM_MOVT_PREL 46
+#define R_ARM_THM_MOVW_ABS_NC 47
+#define R_ARM_THM_MOVT_ABS 48
+#define R_ARM_THM_MOVW_PREL_NC 49
+#define R_ARM_THM_MOVT_PREL 50
+#define R_ARM_THM_JUMP19 51
+#define R_ARM_THM_JUMP6 52
+#define R_ARM_THM_ALU_PREL_11_0 53
+#define R_ARM_THM_PC12 54
+#define R_ARM_ABS32_NOI 55
+#define R_ARM_REL32_NOI 56
+#define R_ARM_ALU_PC_G0_NC 57
+#define R_ARM_ALU_PC_G0 58
+#define R_ARM_ALU_PC_G1_NC 59
+#define R_ARM_ALU_PC_G1 60
+#define R_ARM_ALU_PC_G2 61
+#define R_ARM_LDR_PC_G1 62
+#define R_ARM_LDR_PC_G2 63
+#define R_ARM_LDRS_PC_G0 64
+#define R_ARM_LDRS_PC_G1 65
+#define R_ARM_LDRS_PC_G2 66
+#define R_ARM_LDC_PC_G0 67
+#define R_ARM_LDC_PC_G1 68
+#define R_ARM_LDC_PC_G2 69
+#define R_ARM_ALU_SB_G0_NC 70
+#define R_ARM_ALU_SB_G0 71
+#define R_ARM_ALU_SB_G1_NC 72
+#define R_ARM_ALU_SB_G1 73
+#define R_ARM_ALU_SB_G2 74
+#define R_ARM_LDR_SB_G0 75
+#define R_ARM_LDR_SB_G1 76
+#define R_ARM_LDR_SB_G2 77
+#define R_ARM_LDRS_SB_G0 78
+#define R_ARM_LDRS_SB_G1 79
+#define R_ARM_LDRS_SB_G2 80
+#define R_ARM_LDC_SB_G0 81
+#define R_ARM_LDC_SB_G1 82
+#define R_ARM_LDC_SB_G2 83
+#define R_ARM_MOVW_BREL_NC 84
+#define R_ARM_MOVT_BREL 85
+#define R_ARM_MOVW_BREL 86
+#define R_ARM_THM_MOVW_BREL_NC 87
+#define R_ARM_THM_MOVT_BREL 88
+#define R_ARM_THM_MOVW_BREL 89
+#define R_ARM_TLS_GOTDESC 90
+#define R_ARM_TLS_CALL 91
+#define R_ARM_TLS_DESCSEQ 92
+#define R_ARM_THM_TLS_CALL 93
+#define R_ARM_PLT32_ABS 94
+#define R_ARM_GOT_ABS 95
+#define R_ARM_GOT_PREL 96
+#define R_ARM_GOT_BREL12 97
+#define R_ARM_GOTOFF12 98
+#define R_ARM_GOTRELAX 99
+#define R_ARM_GNU_VTENTRY 100
+#define R_ARM_GNU_VTINHERIT 101
+#define R_ARM_THM_PC11 102
+#define R_ARM_THM_PC9 103
+#define R_ARM_TLS_GD32 104
+
+#define R_ARM_TLS_LDM32 105
+
+#define R_ARM_TLS_LDO32 106
+
+#define R_ARM_TLS_IE32 107
+
+#define R_ARM_TLS_LE32 108
+#define R_ARM_TLS_LDO12 109
+#define R_ARM_TLS_LE12 110
+#define R_ARM_TLS_IE12GP 111
+#define R_ARM_ME_TOO 128
+#define R_ARM_THM_TLS_DESCSEQ 129
+#define R_ARM_THM_TLS_DESCSEQ16 129
+#define R_ARM_THM_TLS_DESCSEQ32 130
+#define R_ARM_THM_GOT_BREL12 131
+#define R_ARM_IRELATIVE 160
+#define R_ARM_RXPC25 249
+#define R_ARM_RSBREL32 250
+#define R_ARM_THM_RPC22 251
+#define R_ARM_RREL32 252
+#define R_ARM_RABS22 253
+#define R_ARM_RPC24 254
+#define R_ARM_RBASE 255
+
+#define R_ARM_NUM 256
+
+
+
+
+#define EF_IA_64_MASKOS 0x0000000f
+#define EF_IA_64_ABI64 0x00000010
+#define EF_IA_64_ARCH 0xff000000
+
+
+#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
+#define PT_IA_64_UNWIND (PT_LOPROC + 1)
+#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
+#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
+#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
+
+
+#define PF_IA_64_NORECOV 0x80000000
+
+
+#define SHT_IA_64_EXT (SHT_LOPROC + 0)
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
+
+
+#define SHF_IA_64_SHORT 0x10000000
+#define SHF_IA_64_NORECOV 0x20000000
+
+
+#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
+#define DT_IA_64_NUM 1
+
+
+#define R_IA64_NONE 0x00
+#define R_IA64_IMM14 0x21
+#define R_IA64_IMM22 0x22
+#define R_IA64_IMM64 0x23
+#define R_IA64_DIR32MSB 0x24
+#define R_IA64_DIR32LSB 0x25
+#define R_IA64_DIR64MSB 0x26
+#define R_IA64_DIR64LSB 0x27
+#define R_IA64_GPREL22 0x2a
+#define R_IA64_GPREL64I 0x2b
+#define R_IA64_GPREL32MSB 0x2c
+#define R_IA64_GPREL32LSB 0x2d
+#define R_IA64_GPREL64MSB 0x2e
+#define R_IA64_GPREL64LSB 0x2f
+#define R_IA64_LTOFF22 0x32
+#define R_IA64_LTOFF64I 0x33
+#define R_IA64_PLTOFF22 0x3a
+#define R_IA64_PLTOFF64I 0x3b
+#define R_IA64_PLTOFF64MSB 0x3e
+#define R_IA64_PLTOFF64LSB 0x3f
+#define R_IA64_FPTR64I 0x43
+#define R_IA64_FPTR32MSB 0x44
+#define R_IA64_FPTR32LSB 0x45
+#define R_IA64_FPTR64MSB 0x46
+#define R_IA64_FPTR64LSB 0x47
+#define R_IA64_PCREL60B 0x48
+#define R_IA64_PCREL21B 0x49
+#define R_IA64_PCREL21M 0x4a
+#define R_IA64_PCREL21F 0x4b
+#define R_IA64_PCREL32MSB 0x4c
+#define R_IA64_PCREL32LSB 0x4d
+#define R_IA64_PCREL64MSB 0x4e
+#define R_IA64_PCREL64LSB 0x4f
+#define R_IA64_LTOFF_FPTR22 0x52
+#define R_IA64_LTOFF_FPTR64I 0x53
+#define R_IA64_LTOFF_FPTR32MSB 0x54
+#define R_IA64_LTOFF_FPTR32LSB 0x55
+#define R_IA64_LTOFF_FPTR64MSB 0x56
+#define R_IA64_LTOFF_FPTR64LSB 0x57
+#define R_IA64_SEGREL32MSB 0x5c
+#define R_IA64_SEGREL32LSB 0x5d
+#define R_IA64_SEGREL64MSB 0x5e
+#define R_IA64_SEGREL64LSB 0x5f
+#define R_IA64_SECREL32MSB 0x64
+#define R_IA64_SECREL32LSB 0x65
+#define R_IA64_SECREL64MSB 0x66
+#define R_IA64_SECREL64LSB 0x67
+#define R_IA64_REL32MSB 0x6c
+#define R_IA64_REL32LSB 0x6d
+#define R_IA64_REL64MSB 0x6e
+#define R_IA64_REL64LSB 0x6f
+#define R_IA64_LTV32MSB 0x74
+#define R_IA64_LTV32LSB 0x75
+#define R_IA64_LTV64MSB 0x76
+#define R_IA64_LTV64LSB 0x77
+#define R_IA64_PCREL21BI 0x79
+#define R_IA64_PCREL22 0x7a
+#define R_IA64_PCREL64I 0x7b
+#define R_IA64_IPLTMSB 0x80
+#define R_IA64_IPLTLSB 0x81
+#define R_IA64_COPY 0x84
+#define R_IA64_SUB 0x85
+#define R_IA64_LTOFF22X 0x86
+#define R_IA64_LDXMOV 0x87
+#define R_IA64_TPREL14 0x91
+#define R_IA64_TPREL22 0x92
+#define R_IA64_TPREL64I 0x93
+#define R_IA64_TPREL64MSB 0x96
+#define R_IA64_TPREL64LSB 0x97
+#define R_IA64_LTOFF_TPREL22 0x9a
+#define R_IA64_DTPMOD64MSB 0xa6
+#define R_IA64_DTPMOD64LSB 0xa7
+#define R_IA64_LTOFF_DTPMOD22 0xaa
+#define R_IA64_DTPREL14 0xb1
+#define R_IA64_DTPREL22 0xb2
+#define R_IA64_DTPREL64I 0xb3
+#define R_IA64_DTPREL32MSB 0xb4
+#define R_IA64_DTPREL32LSB 0xb5
+#define R_IA64_DTPREL64MSB 0xb6
+#define R_IA64_DTPREL64LSB 0xb7
+#define R_IA64_LTOFF_DTPREL22 0xba
+
+
+#define EF_SH_MACH_MASK 0x1f
+#define EF_SH_UNKNOWN 0x0
+#define EF_SH1 0x1
+#define EF_SH2 0x2
+#define EF_SH3 0x3
+#define EF_SH_DSP 0x4
+#define EF_SH3_DSP 0x5
+#define EF_SH4AL_DSP 0x6
+#define EF_SH3E 0x8
+#define EF_SH4 0x9
+#define EF_SH2E 0xb
+#define EF_SH4A 0xc
+#define EF_SH2A 0xd
+#define EF_SH4_NOFPU 0x10
+#define EF_SH4A_NOFPU 0x11
+#define EF_SH4_NOMMU_NOFPU 0x12
+#define EF_SH2A_NOFPU 0x13
+#define EF_SH3_NOMMU 0x14
+#define EF_SH2A_SH4_NOFPU 0x15
+#define EF_SH2A_SH3_NOFPU 0x16
+#define EF_SH2A_SH4 0x17
+#define EF_SH2A_SH3E 0x18
+
+#define R_SH_NONE 0
+#define R_SH_DIR32 1
+#define R_SH_REL32 2
+#define R_SH_DIR8WPN 3
+#define R_SH_IND12W 4
+#define R_SH_DIR8WPL 5
+#define R_SH_DIR8WPZ 6
+#define R_SH_DIR8BP 7
+#define R_SH_DIR8W 8
+#define R_SH_DIR8L 9
+#define R_SH_SWITCH16 25
+#define R_SH_SWITCH32 26
+#define R_SH_USES 27
+#define R_SH_COUNT 28
+#define R_SH_ALIGN 29
+#define R_SH_CODE 30
+#define R_SH_DATA 31
+#define R_SH_LABEL 32
+#define R_SH_SWITCH8 33
+#define R_SH_GNU_VTINHERIT 34
+#define R_SH_GNU_VTENTRY 35
+#define R_SH_TLS_GD_32 144
+#define R_SH_TLS_LD_32 145
+#define R_SH_TLS_LDO_32 146
+#define R_SH_TLS_IE_32 147
+#define R_SH_TLS_LE_32 148
+#define R_SH_TLS_DTPMOD32 149
+#define R_SH_TLS_DTPOFF32 150
+#define R_SH_TLS_TPOFF32 151
+#define R_SH_GOT32 160
+#define R_SH_PLT32 161
+#define R_SH_COPY 162
+#define R_SH_GLOB_DAT 163
+#define R_SH_JMP_SLOT 164
+#define R_SH_RELATIVE 165
+#define R_SH_GOTOFF 166
+#define R_SH_GOTPC 167
+#define R_SH_GOT20 201
+#define R_SH_GOTOFF20 202
+#define R_SH_GOTFUNCDESC 203
+#define R_SH_GOTFUNCDEST20 204
+#define R_SH_GOTOFFFUNCDESC 205
+#define R_SH_GOTOFFFUNCDEST20 206
+#define R_SH_FUNCDESC 207
+#define R_SH_FUNCDESC_VALUE 208
+
+#define R_SH_NUM 256
+
+
+
+#define R_390_NONE 0
+#define R_390_8 1
+#define R_390_12 2
+#define R_390_16 3
+#define R_390_32 4
+#define R_390_PC32 5
+#define R_390_GOT12 6
+#define R_390_GOT32 7
+#define R_390_PLT32 8
+#define R_390_COPY 9
+#define R_390_GLOB_DAT 10
+#define R_390_JMP_SLOT 11
+#define R_390_RELATIVE 12
+#define R_390_GOTOFF32 13
+#define R_390_GOTPC 14
+#define R_390_GOT16 15
+#define R_390_PC16 16
+#define R_390_PC16DBL 17
+#define R_390_PLT16DBL 18
+#define R_390_PC32DBL 19
+#define R_390_PLT32DBL 20
+#define R_390_GOTPCDBL 21
+#define R_390_64 22
+#define R_390_PC64 23
+#define R_390_GOT64 24
+#define R_390_PLT64 25
+#define R_390_GOTENT 26
+#define R_390_GOTOFF16 27
+#define R_390_GOTOFF64 28
+#define R_390_GOTPLT12 29
+#define R_390_GOTPLT16 30
+#define R_390_GOTPLT32 31
+#define R_390_GOTPLT64 32
+#define R_390_GOTPLTENT 33
+#define R_390_PLTOFF16 34
+#define R_390_PLTOFF32 35
+#define R_390_PLTOFF64 36
+#define R_390_TLS_LOAD 37
+#define R_390_TLS_GDCALL 38
+
+#define R_390_TLS_LDCALL 39
+
+#define R_390_TLS_GD32 40
+
+#define R_390_TLS_GD64 41
+
+#define R_390_TLS_GOTIE12 42
+
+#define R_390_TLS_GOTIE32 43
+
+#define R_390_TLS_GOTIE64 44
+
+#define R_390_TLS_LDM32 45
+
+#define R_390_TLS_LDM64 46
+
+#define R_390_TLS_IE32 47
+
+#define R_390_TLS_IE64 48
+
+#define R_390_TLS_IEENT 49
+
+#define R_390_TLS_LE32 50
+
+#define R_390_TLS_LE64 51
+
+#define R_390_TLS_LDO32 52
+
+#define R_390_TLS_LDO64 53
+
+#define R_390_TLS_DTPMOD 54
+#define R_390_TLS_DTPOFF 55
+#define R_390_TLS_TPOFF 56
+
+#define R_390_20 57
+#define R_390_GOT20 58
+#define R_390_GOTPLT20 59
+#define R_390_TLS_GOTIE20 60
+
+
+#define R_390_NUM 61
+
+
+
+#define R_CRIS_NONE 0
+#define R_CRIS_8 1
+#define R_CRIS_16 2
+#define R_CRIS_32 3
+#define R_CRIS_8_PCREL 4
+#define R_CRIS_16_PCREL 5
+#define R_CRIS_32_PCREL 6
+#define R_CRIS_GNU_VTINHERIT 7
+#define R_CRIS_GNU_VTENTRY 8
+#define R_CRIS_COPY 9
+#define R_CRIS_GLOB_DAT 10
+#define R_CRIS_JUMP_SLOT 11
+#define R_CRIS_RELATIVE 12
+#define R_CRIS_16_GOT 13
+#define R_CRIS_32_GOT 14
+#define R_CRIS_16_GOTPLT 15
+#define R_CRIS_32_GOTPLT 16
+#define R_CRIS_32_GOTREL 17
+#define R_CRIS_32_PLT_GOTREL 18
+#define R_CRIS_32_PLT_PCREL 19
+
+#define R_CRIS_NUM 20
+
+
+
+#define R_X86_64_NONE 0
+#define R_X86_64_64 1
+#define R_X86_64_PC32 2
+#define R_X86_64_GOT32 3
+#define R_X86_64_PLT32 4
+#define R_X86_64_COPY 5
+#define R_X86_64_GLOB_DAT 6
+#define R_X86_64_JUMP_SLOT 7
+#define R_X86_64_RELATIVE 8
+#define R_X86_64_GOTPCREL 9
+
+#define R_X86_64_32 10
+#define R_X86_64_32S 11
+#define R_X86_64_16 12
+#define R_X86_64_PC16 13
+#define R_X86_64_8 14
+#define R_X86_64_PC8 15
+#define R_X86_64_DTPMOD64 16
+#define R_X86_64_DTPOFF64 17
+#define R_X86_64_TPOFF64 18
+#define R_X86_64_TLSGD 19
+
+#define R_X86_64_TLSLD 20
+
+#define R_X86_64_DTPOFF32 21
+#define R_X86_64_GOTTPOFF 22
+
+#define R_X86_64_TPOFF32 23
+#define R_X86_64_PC64 24
+#define R_X86_64_GOTOFF64 25
+#define R_X86_64_GOTPC32 26
+#define R_X86_64_GOT64 27
+#define R_X86_64_GOTPCREL64 28
+#define R_X86_64_GOTPC64 29
+#define R_X86_64_GOTPLT64 30
+#define R_X86_64_PLTOFF64 31
+#define R_X86_64_SIZE32 32
+#define R_X86_64_SIZE64 33
+
+#define R_X86_64_GOTPC32_TLSDESC 34
+#define R_X86_64_TLSDESC_CALL 35
+
+#define R_X86_64_TLSDESC 36
+#define R_X86_64_IRELATIVE 37
+#define R_X86_64_RELATIVE64 38
+#define R_X86_64_GOTPCRELX 41
+#define R_X86_64_REX_GOTPCRELX 42
+#define R_X86_64_NUM 43
+
+
+
+#define R_MN10300_NONE 0
+#define R_MN10300_32 1
+#define R_MN10300_16 2
+#define R_MN10300_8 3
+#define R_MN10300_PCREL32 4
+#define R_MN10300_PCREL16 5
+#define R_MN10300_PCREL8 6
+#define R_MN10300_GNU_VTINHERIT 7
+#define R_MN10300_GNU_VTENTRY 8
+#define R_MN10300_24 9
+#define R_MN10300_GOTPC32 10
+#define R_MN10300_GOTPC16 11
+#define R_MN10300_GOTOFF32 12
+#define R_MN10300_GOTOFF24 13
+#define R_MN10300_GOTOFF16 14
+#define R_MN10300_PLT32 15
+#define R_MN10300_PLT16 16
+#define R_MN10300_GOT32 17
+#define R_MN10300_GOT24 18
+#define R_MN10300_GOT16 19
+#define R_MN10300_COPY 20
+#define R_MN10300_GLOB_DAT 21
+#define R_MN10300_JMP_SLOT 22
+#define R_MN10300_RELATIVE 23
+
+#define R_MN10300_NUM 24
+
+
+
+#define R_M32R_NONE 0
+#define R_M32R_16 1
+#define R_M32R_32 2
+#define R_M32R_24 3
+#define R_M32R_10_PCREL 4
+#define R_M32R_18_PCREL 5
+#define R_M32R_26_PCREL 6
+#define R_M32R_HI16_ULO 7
+#define R_M32R_HI16_SLO 8
+#define R_M32R_LO16 9
+#define R_M32R_SDA16 10
+#define R_M32R_GNU_VTINHERIT 11
+#define R_M32R_GNU_VTENTRY 12
+
+#define R_M32R_16_RELA 33
+#define R_M32R_32_RELA 34
+#define R_M32R_24_RELA 35
+#define R_M32R_10_PCREL_RELA 36
+#define R_M32R_18_PCREL_RELA 37
+#define R_M32R_26_PCREL_RELA 38
+#define R_M32R_HI16_ULO_RELA 39
+#define R_M32R_HI16_SLO_RELA 40
+#define R_M32R_LO16_RELA 41
+#define R_M32R_SDA16_RELA 42
+#define R_M32R_RELA_GNU_VTINHERIT 43
+#define R_M32R_RELA_GNU_VTENTRY 44
+#define R_M32R_REL32 45
+
+#define R_M32R_GOT24 48
+#define R_M32R_26_PLTREL 49
+#define R_M32R_COPY 50
+#define R_M32R_GLOB_DAT 51
+#define R_M32R_JMP_SLOT 52
+#define R_M32R_RELATIVE 53
+#define R_M32R_GOTOFF 54
+#define R_M32R_GOTPC24 55
+#define R_M32R_GOT16_HI_ULO 56
+
+#define R_M32R_GOT16_HI_SLO 57
+
+#define R_M32R_GOT16_LO 58
+#define R_M32R_GOTPC_HI_ULO 59
+
+#define R_M32R_GOTPC_HI_SLO 60
+
+#define R_M32R_GOTPC_LO 61
+
+#define R_M32R_GOTOFF_HI_ULO 62
+
+#define R_M32R_GOTOFF_HI_SLO 63
+
+#define R_M32R_GOTOFF_LO 64
+#define R_M32R_NUM 256
+
+#define R_MICROBLAZE_NONE 0
+#define R_MICROBLAZE_32 1
+#define R_MICROBLAZE_32_PCREL 2
+#define R_MICROBLAZE_64_PCREL 3
+#define R_MICROBLAZE_32_PCREL_LO 4
+#define R_MICROBLAZE_64 5
+#define R_MICROBLAZE_32_LO 6
+#define R_MICROBLAZE_SRO32 7
+#define R_MICROBLAZE_SRW32 8
+#define R_MICROBLAZE_64_NONE 9
+#define R_MICROBLAZE_32_SYM_OP_SYM 10
+#define R_MICROBLAZE_GNU_VTINHERIT 11
+#define R_MICROBLAZE_GNU_VTENTRY 12
+#define R_MICROBLAZE_GOTPC_64 13
+#define R_MICROBLAZE_GOT_64 14
+#define R_MICROBLAZE_PLT_64 15
+#define R_MICROBLAZE_REL 16
+#define R_MICROBLAZE_JUMP_SLOT 17
+#define R_MICROBLAZE_GLOB_DAT 18
+#define R_MICROBLAZE_GOTOFF_64 19
+#define R_MICROBLAZE_GOTOFF_32 20
+#define R_MICROBLAZE_COPY 21
+#define R_MICROBLAZE_TLS 22
+#define R_MICROBLAZE_TLSGD 23
+#define R_MICROBLAZE_TLSLD 24
+#define R_MICROBLAZE_TLSDTPMOD32 25
+#define R_MICROBLAZE_TLSDTPREL32 26
+#define R_MICROBLAZE_TLSDTPREL64 27
+#define R_MICROBLAZE_TLSGOTTPREL32 28
+#define R_MICROBLAZE_TLSTPREL32 29
+
+#define DT_NIOS2_GP 0x70000002
+
+#define R_NIOS2_NONE 0
+#define R_NIOS2_S16 1
+#define R_NIOS2_U16 2
+#define R_NIOS2_PCREL16 3
+#define R_NIOS2_CALL26 4
+#define R_NIOS2_IMM5 5
+#define R_NIOS2_CACHE_OPX 6
+#define R_NIOS2_IMM6 7
+#define R_NIOS2_IMM8 8
+#define R_NIOS2_HI16 9
+#define R_NIOS2_LO16 10
+#define R_NIOS2_HIADJ16 11
+#define R_NIOS2_BFD_RELOC_32 12
+#define R_NIOS2_BFD_RELOC_16 13
+#define R_NIOS2_BFD_RELOC_8 14
+#define R_NIOS2_GPREL 15
+#define R_NIOS2_GNU_VTINHERIT 16
+#define R_NIOS2_GNU_VTENTRY 17
+#define R_NIOS2_UJMP 18
+#define R_NIOS2_CJMP 19
+#define R_NIOS2_CALLR 20
+#define R_NIOS2_ALIGN 21
+#define R_NIOS2_GOT16 22
+#define R_NIOS2_CALL16 23
+#define R_NIOS2_GOTOFF_LO 24
+#define R_NIOS2_GOTOFF_HA 25
+#define R_NIOS2_PCREL_LO 26
+#define R_NIOS2_PCREL_HA 27
+#define R_NIOS2_TLS_GD16 28
+#define R_NIOS2_TLS_LDM16 29
+#define R_NIOS2_TLS_LDO16 30
+#define R_NIOS2_TLS_IE16 31
+#define R_NIOS2_TLS_LE16 32
+#define R_NIOS2_TLS_DTPMOD 33
+#define R_NIOS2_TLS_DTPREL 34
+#define R_NIOS2_TLS_TPREL 35
+#define R_NIOS2_COPY 36
+#define R_NIOS2_GLOB_DAT 37
+#define R_NIOS2_JUMP_SLOT 38
+#define R_NIOS2_RELATIVE 39
+#define R_NIOS2_GOTOFF 40
+#define R_NIOS2_CALL26_NOAT 41
+#define R_NIOS2_GOT_LO 42
+#define R_NIOS2_GOT_HA 43
+#define R_NIOS2_CALL_LO 44
+#define R_NIOS2_CALL_HA 45
+
+#define R_OR1K_NONE 0
+#define R_OR1K_32 1
+#define R_OR1K_16 2
+#define R_OR1K_8 3
+#define R_OR1K_LO_16_IN_INSN 4
+#define R_OR1K_HI_16_IN_INSN 5
+#define R_OR1K_INSN_REL_26 6
+#define R_OR1K_GNU_VTENTRY 7
+#define R_OR1K_GNU_VTINHERIT 8
+#define R_OR1K_32_PCREL 9
+#define R_OR1K_16_PCREL 10
+#define R_OR1K_8_PCREL 11
+#define R_OR1K_GOTPC_HI16 12
+#define R_OR1K_GOTPC_LO16 13
+#define R_OR1K_GOT16 14
+#define R_OR1K_PLT26 15
+#define R_OR1K_GOTOFF_HI16 16
+#define R_OR1K_GOTOFF_LO16 17
+#define R_OR1K_COPY 18
+#define R_OR1K_GLOB_DAT 19
+#define R_OR1K_JMP_SLOT 20
+#define R_OR1K_RELATIVE 21
+#define R_OR1K_TLS_GD_HI16 22
+#define R_OR1K_TLS_GD_LO16 23
+#define R_OR1K_TLS_LDM_HI16 24
+#define R_OR1K_TLS_LDM_LO16 25
+#define R_OR1K_TLS_LDO_HI16 26
+#define R_OR1K_TLS_LDO_LO16 27
+#define R_OR1K_TLS_IE_HI16 28
+#define R_OR1K_TLS_IE_LO16 29
+#define R_OR1K_TLS_LE_HI16 30
+#define R_OR1K_TLS_LE_LO16 31
+#define R_OR1K_TLS_TPOFF 32
+#define R_OR1K_TLS_DTPOFF 33
+#define R_OR1K_TLS_DTPMOD 34
+
+#define R_BPF_NONE 0
+#define R_BPF_MAP_FD 1
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/tools/gbafix/gbafix.c b/tools/gbafix/gbafix.c
index d5e2f62ab..b4ad15a88 100644
--- a/tools/gbafix/gbafix.c
+++ b/tools/gbafix/gbafix.c
@@ -1,45 +1,45 @@
/*
- "$Id: gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
+ "$Id: gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
- DevkitPro GBA ROM fix utility
+ DevkitPro GBA ROM fix utility
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
- This library 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
- Library General Public License for more details.
+ This library 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
+ Library General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA.
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
- Please report all bugs and problems through the bug tracker at
- "http://sourceforge.net/tracker/?group_id=114505&atid=668551".
+ Please report all bugs and problems through the bug tracker at
+ "http://sourceforge.net/tracker/?group_id=114505&atid=668551".
- "$Header: /lvm/shared/ds/ds/cvs/devkitpro-cvsbackup/tools/gba/gbatools/gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
+ "$Header: /lvm/shared/ds/ds/cvs/devkitpro-cvsbackup/tools/gba/gbatools/gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $"
*/
//---------------------------------------------------------------------------------
// gbafix.c
//---------------------------------------------------------------------------------
/*
- Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome)
- Validates header of GBA roms.
-
- History
- -------
- v1.06 - added output silencing, (Diegoisawesome)
- v1.05 - added debug offset argument, (Diegoisawesome)
- v1.04 - converted to plain C, (WinterMute)
- v1.03 - header.fixed, header.device_type
- v1.02 - redefined the options (rgbfix style), checksum=0
- v1.01 - fix in parameters
- v1.00 - logo, complement
+ Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome)
+ Validates header of GBA roms.
+
+ History
+ -------
+ v1.06 - added output silencing, (Diegoisawesome)
+ v1.05 - added debug offset argument, (Diegoisawesome)
+ v1.04 - converted to plain C, (WinterMute)
+ v1.03 - header.fixed, header.device_type
+ v1.02 - redefined the options (rgbfix style), checksum=0
+ v1.01 - fix in parameters
+ v1.00 - logo, complement
*/
#pragma pack(1)
@@ -48,26 +48,27 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+#include "elf.h"
-#define VER "1.06"
-#define ARGV argv[arg]
-#define VALUE (ARGV+2)
-#define NUMBER strtoul(VALUE, NULL, 0)
+#define VER "1.06"
+#define ARGV argv[arg]
+#define VALUE (ARGV+2)
+#define NUMBER strtoul(VALUE, NULL, 0)
typedef struct
{
- uint32_t start_code; // B instruction
- uint8_t logo[0xA0-0x04]; // logo data
- uint8_t title[0xC]; // game title name
- uint32_t game_code; //
- uint16_t maker_code; //
- uint8_t fixed; // 0x96
- uint8_t unit_code; // 0x00
- uint8_t device_type; // 0x00
- uint8_t unused[7]; //
- uint8_t game_version; // 0x00
- uint8_t complement; // 800000A0..800000BC
- uint16_t checksum; // 0x0000
+ uint32_t start_code; // B instruction
+ uint8_t logo[0xA0-0x04]; // logo data
+ uint8_t title[0xC]; // game title name
+ uint32_t game_code; //
+ uint16_t maker_code; //
+ uint8_t fixed; // 0x96
+ uint8_t unit_code; // 0x00
+ uint8_t device_type; // 0x00
+ uint8_t unused[7]; //
+ uint8_t game_version; // 0x00
+ uint8_t complement; // 800000A0..800000BC
+ uint16_t checksum; // 0x0000
} Header;
@@ -77,55 +78,55 @@ unsigned short checksum_without_header = 0;
const Header good_header =
{
- // start_code
- 0xEA00002E,
- // logo
- { 0x24,0xFF,0xAE,0x51,0x69,0x9A,0xA2,0x21,0x3D,0x84,0x82,0x0A,0x84,0xE4,0x09,0xAD,
- 0x11,0x24,0x8B,0x98,0xC0,0x81,0x7F,0x21,0xA3,0x52,0xBE,0x19,0x93,0x09,0xCE,0x20,
- 0x10,0x46,0x4A,0x4A,0xF8,0x27,0x31,0xEC,0x58,0xC7,0xE8,0x33,0x82,0xE3,0xCE,0xBF,
- 0x85,0xF4,0xDF,0x94,0xCE,0x4B,0x09,0xC1,0x94,0x56,0x8A,0xC0,0x13,0x72,0xA7,0xFC,
- 0x9F,0x84,0x4D,0x73,0xA3,0xCA,0x9A,0x61,0x58,0x97,0xA3,0x27,0xFC,0x03,0x98,0x76,
- 0x23,0x1D,0xC7,0x61,0x03,0x04,0xAE,0x56,0xBF,0x38,0x84,0x00,0x40,0xA7,0x0E,0xFD,
- 0xFF,0x52,0xFE,0x03,0x6F,0x95,0x30,0xF1,0x97,0xFB,0xC0,0x85,0x60,0xD6,0x80,0x25,
- 0xA9,0x63,0xBE,0x03,0x01,0x4E,0x38,0xE2,0xF9,0xA2,0x34,0xFF,0xBB,0x3E,0x03,0x44,
- 0x78,0x00,0x90,0xCB,0x88,0x11,0x3A,0x94,0x65,0xC0,0x7C,0x63,0x87,0xF0,0x3C,0xAF,
- 0xD6,0x25,0xE4,0x8B,0x38,0x0A,0xAC,0x72,0x21,0xD4,0xF8,0x07 } ,
- // title
- { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
- // game code
- 0x00000000,
- // maker code
- 0x3130,
- // fixed
- 0x96,
- // unit_code
- 0x00,
- // device type
- 0x00,
- // unused
- { 0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
- // game version
- 0x00,
- // complement
- 0x00,
- // checksum
- 0x0000
+ // start_code
+ 0xEA00002E,
+ // logo
+ { 0x24,0xFF,0xAE,0x51,0x69,0x9A,0xA2,0x21,0x3D,0x84,0x82,0x0A,0x84,0xE4,0x09,0xAD,
+ 0x11,0x24,0x8B,0x98,0xC0,0x81,0x7F,0x21,0xA3,0x52,0xBE,0x19,0x93,0x09,0xCE,0x20,
+ 0x10,0x46,0x4A,0x4A,0xF8,0x27,0x31,0xEC,0x58,0xC7,0xE8,0x33,0x82,0xE3,0xCE,0xBF,
+ 0x85,0xF4,0xDF,0x94,0xCE,0x4B,0x09,0xC1,0x94,0x56,0x8A,0xC0,0x13,0x72,0xA7,0xFC,
+ 0x9F,0x84,0x4D,0x73,0xA3,0xCA,0x9A,0x61,0x58,0x97,0xA3,0x27,0xFC,0x03,0x98,0x76,
+ 0x23,0x1D,0xC7,0x61,0x03,0x04,0xAE,0x56,0xBF,0x38,0x84,0x00,0x40,0xA7,0x0E,0xFD,
+ 0xFF,0x52,0xFE,0x03,0x6F,0x95,0x30,0xF1,0x97,0xFB,0xC0,0x85,0x60,0xD6,0x80,0x25,
+ 0xA9,0x63,0xBE,0x03,0x01,0x4E,0x38,0xE2,0xF9,0xA2,0x34,0xFF,0xBB,0x3E,0x03,0x44,
+ 0x78,0x00,0x90,0xCB,0x88,0x11,0x3A,0x94,0x65,0xC0,0x7C,0x63,0x87,0xF0,0x3C,0xAF,
+ 0xD6,0x25,0xE4,0x8B,0x38,0x0A,0xAC,0x72,0x21,0xD4,0xF8,0x07 } ,
+ // title
+ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+ // game code
+ 0x00000000,
+ // maker code
+ 0x3130,
+ // fixed
+ 0x96,
+ // unit_code
+ 0x00,
+ // device type
+ 0x00,
+ // unused
+ { 0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
+ // game version
+ 0x00,
+ // complement
+ 0x00,
+ // checksum
+ 0x0000
};
//---------------------------------------------------------------------------------
char HeaderComplement()
/*---------------------------------------------------------------------------------
- Calculate Header complement check
+ Calculate Header complement check
---------------------------------------------------------------------------------*/
{
- int n;
- char c = 0;
- char *p = (char *)&header + 0xA0;
- for (n=0; n<0xBD-0xA0; n++)
- {
- c += *p++;
- }
- return -(0x19+c);
+ int n;
+ char c = 0;
+ char *p = (char *)&header + 0xA0;
+ for (n=0; n<0xBD-0xA0; n++)
+ {
+ c += *p++;
+ }
+ return -(0x19+c);
}
@@ -133,157 +134,176 @@ char HeaderComplement()
int main(int argc, char *argv[])
//---------------------------------------------------------------------------------
{
- int arg;
- char *argfile = 0;
- FILE *infile;
- int silent = 0;
-
- int size,bit;
-
- // show syntax
- if (argc <= 1)
- {
- printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n");
- printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n");
- printf("\n");
- printf("parameters:\n");
- printf(" -p Pad to next exact power of 2. No minimum size!\n");
- printf(" -t[<title>] Patch title. Stripped filename if none given.\n");
- printf(" -c<game_code> Patch game code (four characters)\n");
- printf(" -m<maker_code> Patch maker code (two characters)\n");
- printf(" -r<version> Patch game version (number)\n");
- printf(" -d<debug> Enable debugging handler and set debug entry point (0 or 1)\n");
- printf(" --silent Silence non-error output\n");
- return -1;
- }
-
- // get filename
- for (arg=1; arg<argc; arg++)
- {
- if ((ARGV[0] != '-')) { argfile=ARGV; }
- if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; }
- }
-
- // check filename
- if (!argfile)
- {
- fprintf(stderr, "Filename needed!\n");
- return -1;
- }
-
- // read file
- infile = fopen(argfile, "r+b");
- if (!infile) { fprintf(stderr, "Error opening input file!\n"); return -1; }
- fseek(infile, 0, SEEK_SET);
- fread(&header, sizeof(header), 1, infile);
-
- // fix some data
- memcpy(header.logo, good_header.logo, sizeof(header.logo));
- memcpy(&header.fixed, &good_header.fixed, sizeof(header.fixed));
- memcpy(&header.device_type, &good_header.device_type, sizeof(header.device_type));
-
- // parse command line
- for (arg=1; arg<argc; arg++)
- {
- if ((ARGV[0] == '-'))
- {
- switch (ARGV[1])
- {
- case 'p': // pad
- {
- fseek(infile, 0, SEEK_END);
- size = ftell(infile);
- for (bit=31; bit>=0; bit--) if (size & (1<<bit)) break;
- if (size != (1<<bit))
- {
- int todo = (1<<(bit+1)) - size;
- while (todo--) fputc(0xFF, infile);
- }
- fseek(infile, 0, SEEK_SET);
- break;
- }
-
- case 't': // title
- {
- char title[256];
- memset(title, 0, sizeof(title));
- if (VALUE[0])
- {
- strncpy(title, VALUE, sizeof(header.title));
- }
- else
- {
- // use filename
- char s[256], *begin=s, *t; strcpy(s, argfile);
- t = strrchr(s, '\\'); if (t) begin = t+1;
- t = strrchr(s, '/'); if (t) begin = t+1;
- t = strrchr(s, '.'); if (t) *t = 0;
- strncpy(title, begin, sizeof(header.title));
- if (!silent) printf("%s\n",begin);
- }
- memcpy(header.title, title, sizeof(header.title)); // copy
- break;
- }
-
- case 'c': // game code
- {
- //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
- //header.game_code = NUMBER;
- header.game_code = VALUE[0] | VALUE[1]<<8 | VALUE[2]<<16 | VALUE[3]<<24;
- break;
- }
-
- case 'm': // maker code
- {
- //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
- //header.maker_code = (unsigned short)NUMBER;
- header.maker_code = VALUE[0] | VALUE[1]<<8;
- break;
- }
-
- case 'v': // ignored, compatability with other gbafix
- {
- break;
- }
-
- case 'r': // version
- {
- if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
- header.game_version = (unsigned char)NUMBER;
- break;
- }
-
- case 'd': // debug
- {
- if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
- header.logo[0x9C-0x04] = 0xA5; // debug enable
- header.device_type = (unsigned char)((NUMBER & 1) << 7); // debug handler entry point
- break;
- }
- case '-': // long arguments
- {
- if (strncmp("silent", &ARGV[2], 6) == 0) { continue; }
- break;
- }
- default:
- {
- printf("Invalid option: %s\n", ARGV);
- }
- }
- }
- }
-
- // update complement check & total checksum
- header.complement = 0;
- header.checksum = 0; // must be 0
- header.complement = HeaderComplement();
- //header.checksum = checksum_without_header + HeaderChecksum();
-
- fseek(infile, 0, SEEK_SET);
- fwrite(&header, sizeof(header), 1, infile);
- fclose(infile);
-
- if (!silent) printf("ROM fixed!\n");
-
- return 0;
+ int arg;
+ char *argfile = 0;
+ FILE *infile;
+ int silent = 0;
+
+ int size,bit;
+
+ // show syntax
+ if (argc <= 1)
+ {
+ printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n");
+ printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n");
+ printf("\n");
+ printf("parameters:\n");
+ printf(" -p Pad to next exact power of 2. No minimum size!\n");
+ printf(" -t[<title>] Patch title. Stripped filename if none given.\n");
+ printf(" -c<game_code> Patch game code (four characters)\n");
+ printf(" -m<maker_code> Patch maker code (two characters)\n");
+ printf(" -r<version> Patch game version (number)\n");
+ printf(" -d<debug> Enable debugging handler and set debug entry point (0 or 1)\n");
+ printf(" --silent Silence non-error output\n");
+ return -1;
+ }
+
+ // get filename
+ for (arg=1; arg<argc; arg++)
+ {
+ if (ARGV[0] != '-') { argfile=ARGV; }
+ if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; }
+ }
+
+ // check filename
+ if (!argfile)
+ {
+ fprintf(stderr, "Filename needed!\n");
+ return -1;
+ }
+
+ // read file
+ infile = fopen(argfile, "r+b");
+ if (!infile) { fprintf(stderr, "Error opening input file!\n"); return -1; }
+ fseek(infile, 0, SEEK_SET);
+ fread(&header, sizeof(header), 1, infile);
+
+ // elf check
+ uint32_t sh_offset = 0;
+ if (memcmp(&header, ELFMAG, 4) == 0) {
+ Elf32_Ehdr *elfHeader = (Elf32_Ehdr *)&header;
+ fseek(infile, elfHeader->e_shoff, SEEK_SET);
+ int i;
+ for (i = 0; i < elfHeader->e_shnum; i++) {
+ Elf32_Shdr secHeader;
+ fread(&secHeader, sizeof(Elf32_Shdr), 1, infile);
+ if (secHeader.sh_type == SHT_PROGBITS && secHeader.sh_addr == elfHeader->e_entry) {
+ fseek(infile, secHeader.sh_offset, SEEK_SET);
+ sh_offset = secHeader.sh_offset;
+ break;
+ }
+ }
+ if (i == elfHeader->e_shnum) { fprintf(stderr, "Error finding entry point!\n"); return 1; }
+ fread(&header, sizeof(header), 1, infile);
+ }
+
+ // fix some data
+ memcpy(header.logo, good_header.logo, sizeof(header.logo));
+ memcpy(&header.fixed, &good_header.fixed, sizeof(header.fixed));
+ memcpy(&header.device_type, &good_header.device_type, sizeof(header.device_type));
+
+ // parse command line
+ for (arg=1; arg<argc; arg++)
+ {
+ if ((ARGV[0] == '-'))
+ {
+ switch (ARGV[1])
+ {
+ case 'p': // pad
+ {
+ fseek(infile, 0, SEEK_END);
+ size = ftell(infile);
+ for (bit=31; bit>=0; bit--) if (size & (1<<bit)) break;
+ if (size != (1<<bit))
+ {
+ int todo = (1<<(bit+1)) - size;
+ while (todo--) fputc(0xFF, infile);
+ }
+ fseek(infile, 0, SEEK_SET);
+ break;
+ }
+
+ case 't': // title
+ {
+ char title[256];
+ memset(title, 0, sizeof(title));
+ if (VALUE[0])
+ {
+ strncpy(title, VALUE, sizeof(header.title));
+ }
+ else
+ {
+ // use filename
+ char s[256], *begin=s, *t; strcpy(s, argfile);
+ t = strrchr(s, '\\'); if (t) begin = t+1;
+ t = strrchr(s, '/'); if (t) begin = t+1;
+ t = strrchr(s, '.'); if (t) *t = 0;
+ strncpy(title, begin, sizeof(header.title));
+ if (!silent) printf("%s\n",begin);
+ }
+ memcpy(header.title, title, sizeof(header.title)); // copy
+ break;
+ }
+
+ case 'c': // game code
+ {
+ //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
+ //header.game_code = NUMBER;
+ header.game_code = VALUE[0] | VALUE[1]<<8 | VALUE[2]<<16 | VALUE[3]<<24;
+ break;
+ }
+
+ case 'm': // maker code
+ {
+ //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
+ //header.maker_code = (unsigned short)NUMBER;
+ header.maker_code = VALUE[0] | VALUE[1]<<8;
+ break;
+ }
+
+ case 'v': // ignored, compatability with other gbafix
+ {
+ break;
+ }
+
+ case 'r': // version
+ {
+ if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
+ header.game_version = (unsigned char)NUMBER;
+ break;
+ }
+
+ case 'd': // debug
+ {
+ if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; }
+ header.logo[0x9C-0x04] = 0xA5; // debug enable
+ header.device_type = (unsigned char)((NUMBER & 1) << 7); // debug handler entry point
+ break;
+ }
+ case '-': // long arguments
+ {
+ if (strncmp("silent", &ARGV[2], 6) == 0) { continue; }
+ break;
+ }
+ default:
+ {
+ printf("Invalid option: %s\n", ARGV);
+ }
+ }
+ }
+ }
+
+ // update complement check & total checksum
+ header.complement = 0;
+ header.checksum = 0; // must be 0
+ header.complement = HeaderComplement();
+ //header.checksum = checksum_without_header + HeaderChecksum();
+
+ fseek(infile, sh_offset, SEEK_SET);
+ fwrite(&header, sizeof(header), 1, infile);
+ fclose(infile);
+
+ if (!silent) printf("ROM fixed!\n");
+
+ return 0;
}