diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-09-04 12:38:14 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-09-04 12:38:14 -0400 |
commit | 43e94ce5920e4dc00ce78624104874cf9f1ac4a5 (patch) | |
tree | 581320eedd03f5c4d083aa52e4bcb15dd2101c0c | |
parent | 1499e9f8be9458bbf94cbc4dc6d1034f53606cd0 (diff) |
Refactor .exceptix, 1
31 files changed, 95 insertions, 275 deletions
diff --git a/arm9/Makefile b/arm9/Makefile index e3c573b7..ed96deee 100644 --- a/arm9/Makefile +++ b/arm9/Makefile @@ -220,7 +220,10 @@ $(CXX_OBJS): $(BUILD_DIR)/%.o: %.cpp $$(dep) $(S_OBJS) $(LIBS_OBJS): $(BUILD_DIR)/%.o: %.s $$(dep) $(AS) $(ASFLAGS) -o $@ $< -$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SPEC) $(LD_TEMPLATE) +$(BUILD_DIR)/$(LD_TEMPLATE): $(BUILD_DIR)/%: % + (echo "KEEP_SECTION\n{\n\t.exceptix\n}\n"; cat $<) > $@ + +$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SPEC) $(BUILD_DIR)/$(LD_TEMPLATE) $(MAKELCF) $(MAKELCF_FLAGS) $^ $@ $(ROM): $(BUILD_DIR)/$(LD_SCRIPT) $(O_FILES) $(STATIC_LIBS) diff --git a/arm9/asm/MSL_ARM_abort_exit.s b/arm9/asm/MSL_ARM_abort_exit.s index 2fb7796f..1128f4e8 100644 --- a/arm9/asm/MSL_ARM_abort_exit.s +++ b/arm9/asm/MSL_ARM_abort_exit.s @@ -155,14 +155,6 @@ _020DE2DC: .word __console_exit _020DE2E0: .word __atexit_funcs
arm_func_end __exit
- .section .exceptix,4
-
- .word abort
- .short 37
- .word 0x00100000
- .word exit
- .short 77
- .word 0x00100100
- .word __exit
- .short 297
- .word 0x00200300
+ exception abort, 37, 0x00100000
+ exception exit, 77, 0x00100100
+ exception __exit, 297, 0x00200300
diff --git a/arm9/asm/MSL_ARM_math.s b/arm9/asm/MSL_ARM_math.s index cb9bb034..6fad26bb 100644 --- a/arm9/asm/MSL_ARM_math.s +++ b/arm9/asm/MSL_ARM_math.s @@ -14,8 +14,4 @@ _020DE2F4: .word __float_nan _020DE2F8: .word _f2d
arm_func_end nan
- .section .exceptix,4
-
- .word nan
- .short 25
- .word 0x00000000
+ exception nan, 25, 0x00000000
diff --git a/arm9/asm/MSL_Common_ansi_files.s b/arm9/asm/MSL_Common_ansi_files.s index 70fdc293..a2e75c22 100644 --- a/arm9/asm/MSL_Common_ansi_files.s +++ b/arm9/asm/MSL_Common_ansi_files.s @@ -141,11 +141,5 @@ _020DE3DC: _020DE3EC: .word __files
arm_func_end __flush_all
- .section .exceptix,4
-
- .word __flush_line_buffered_output_files
- .short 141
- .word 0x00403F00
- .word __flush_all
- .short 105
- .word 0x00403F00
+ exception __flush_line_buffered_output_files, 141, 0x00403F00
+ exception __flush_all, 105, 0x00403F00
diff --git a/arm9/asm/MSL_Common_assert.s b/arm9/asm/MSL_Common_assert.s index ded4056d..db655417 100644 --- a/arm9/asm/MSL_Common_assert.s +++ b/arm9/asm/MSL_Common_assert.s @@ -30,8 +30,4 @@ __msl_assertion_failed: ; 0x020DE3FC _020DE434: .word __local_str__msl_assertion_failed
arm_func_end __msl_assertion_failed
- .section .exceptix,4
-
- .word __msl_assertion_failed
- .short 61
- .word 0x00200100
+ exception __msl_assertion_failed, 61, 0x00200100
diff --git a/arm9/asm/MSL_Common_buffer_io.s b/arm9/asm/MSL_Common_buffer_io.s index 7dbbcc45..a3791f4d 100644 --- a/arm9/asm/MSL_Common_buffer_io.s +++ b/arm9/asm/MSL_Common_buffer_io.s @@ -109,11 +109,5 @@ _020DE574: ldmia sp!, {r3-r5,pc}
arm_func_end __flush_buffer
- .section .exceptix,4
-
- .word __load_buffer
- .short 141
- .word 0x00200700
- .word __flush_buffer
- .short 137
- .word 0x00200300
+ exception __load_buffer, 141, 0x00200700
+ exception __flush_buffer, 137, 0x00200300
diff --git a/arm9/asm/MSL_Common_direct_io.s b/arm9/asm/MSL_Common_direct_io.s index d71f0bc4..bc803a3f 100644 --- a/arm9/asm/MSL_Common_direct_io.s +++ b/arm9/asm/MSL_Common_direct_io.s @@ -500,14 +500,6 @@ _020DEC5C: ldmia sp!, {r3-r11,pc}
arm_func_end __fwrite
- .section .exceptix,4
-
- .word fread
- .short 269
- .word 0x00407F00
- .word __fread
- .short 841
- .word 0x00507F00
- .word __fwrite
- .short 689
- .word 0x0060FF00
\ No newline at end of file + exception fread, 269, 0x00407F00
+ exception __fread, 841, 0x00507F00
+ exception __fwrite, 689, 0x0060FF00
\ No newline at end of file diff --git a/arm9/asm/MSL_Common_file_io.s b/arm9/asm/MSL_Common_file_io.s index f8a76bba..dfc9db53 100644 --- a/arm9/asm/MSL_Common_file_io.s +++ b/arm9/asm/MSL_Common_file_io.s @@ -103,11 +103,5 @@ _020DEDCC: ldmia sp!, {r4,pc}
arm_func_end fflush
- .section .exceptix,4
-
- .word fclose
- .short 117
- .word 0x00200300
- .word fflush
- .short 233
- .word 0x00100100
+ exception fclose, 117, 0x00200300
+ exception fflush, 233, 0x00100100
diff --git a/arm9/asm/MSL_Common_file_pos.s b/arm9/asm/MSL_Common_file_pos.s index f5a122aa..d416f9ad 100644 --- a/arm9/asm/MSL_Common_file_pos.s +++ b/arm9/asm/MSL_Common_file_pos.s @@ -356,17 +356,7 @@ rewind: ; 0x020DF290 ldmia sp!, {r4,pc}
arm_func_end rewind
- .section .exceptix,4
-
- .word ftell
- .short 285
- .word 0x00300F00
- .word _fseek
- .short 489
- .word 0x00400320
- .word fseek
- .short 301
- .word 0x00403F00
- .word rewind
- .short 37
- .word 0x00100100
+ exception ftell, 285, 0x00300F00
+ exception _fseek, 489, 0x00400320
+ exception fseek, 301, 0x00403F00
+ exception rewind, 37, 0x00100100
diff --git a/arm9/asm/MSL_Common_mbstring.s b/arm9/asm/MSL_Common_mbstring.s index e7bf6947..b22396f5 100644 --- a/arm9/asm/MSL_Common_mbstring.s +++ b/arm9/asm/MSL_Common_mbstring.s @@ -231,17 +231,7 @@ _020DF430: ldmia sp!, {r3-r9,pc}
arm_func_end wcstombs
- .section .exceptix,4
-
- .word mbtowc
- .short 29
- .word 0x00100000
- .word wctomb
- .short 29
- .word 0x00100000
- .word mbstowcs
- .short 137
- .word 0x00301F00
- .word wcstombs
- .short 121
- .word 0x00403F00
+ exception mbtowc, 29, 0x00100000
+ exception wctomb, 29, 0x00100000
+ exception mbstowcs, 137, 0x00301F00
+ exception wcstombs, 121, 0x00403F00
diff --git a/arm9/asm/MSL_Common_mem.s b/arm9/asm/MSL_Common_mem.s index d6449dde..dfb7fd07 100644 --- a/arm9/asm/MSL_Common_mem.s +++ b/arm9/asm/MSL_Common_mem.s @@ -108,8 +108,4 @@ _020DF548: bx lr
arm_func_end memcmp
- .section .exceptix,4
-
- .word memset
- .short 21
- .word 0x00100100
+ exception memset, 21, 0x00100100
diff --git a/arm9/asm/MSL_Common_printf.s b/arm9/asm/MSL_Common_printf.s index b9879afe..1dfef8fd 100644 --- a/arm9/asm/MSL_Common_printf.s +++ b/arm9/asm/MSL_Common_printf.s @@ -2564,41 +2564,17 @@ sprintf: ; 0x020E185C bx lr
arm_func_end sprintf
- .section .exceptix,4
-
- .word long2str
- .short 589
- .word 0x0090FF20
- .word longlong2str
- .short 737
- .word 0x00A0FF20
- .word double2hex
- .short 1245
- .word 0x00F07F20
- .word float2str
- .short 1893
- .word 0x00C0FF20
- .word __pformatter
- .short 2084
- .word UNK_020EC710
- .word __FileWrite
- .short 45
- .word 0x00200300
- .word __StringWrite
- .short 69
- .word 0x00200300
- .word printf
- .short 281
- .word 0x00300120
- .word vsnprintf
- .short 105
- .word 0x00300300
- .word snprintf
- .short 41
- .word 0x00300020
- .word sprintf
- .short 45
- .word 0x00300020
+ exception long2str, 589, 0x0090FF20
+ exception longlong2str, 737, 0x00A0FF20
+ exception double2hex, 1245, 0x00F07F20
+ exception float2str, 1893, 0x00C0FF20
+ exception __pformatter, 2084, UNK_020EC710
+ exception __FileWrite, 45, 0x00200300
+ exception __StringWrite, 69, 0x00200300
+ exception printf, 281, 0x00300120
+ exception vsnprintf, 105, 0x00300300
+ exception snprintf, 41, 0x00300020
+ exception sprintf, 45, 0x00300020
.section .exception,8
diff --git a/arm9/asm/MSL_Common_qsort.s b/arm9/asm/MSL_Common_qsort.s index edfc142b..1e07aab6 100644 --- a/arm9/asm/MSL_Common_qsort.s +++ b/arm9/asm/MSL_Common_qsort.s @@ -105,8 +105,4 @@ _020E19D8: ldmia sp!, {r3-r11,pc}
arm_func_end qsort
- .section .exceptix,4
-
- .word qsort
- .short 357
- .word 0x0070FF00
+ exception qsort, 357, 0x0070FF00
diff --git a/arm9/asm/MSL_Common_scanf.s b/arm9/asm/MSL_Common_scanf.s index 8d9a8fe3..eb3fbb9a 100644 --- a/arm9/asm/MSL_Common_scanf.s +++ b/arm9/asm/MSL_Common_scanf.s @@ -1447,17 +1447,9 @@ sscanf: ; 0x020E2D54 bx lr
arm_func_end sscanf
- .section .exceptix,4
-
- .word __sformatter
- .short 3412
- .word UNK_020EC718
- .word vsscanf
- .short 85
- .word 0x00200000
- .word sscanf
- .short 41
- .word 0x00300020
+ exception __sformatter, 3412, UNK_020EC718
+ exception vsscanf, 85, 0x00200000
+ exception sscanf, 41, 0x00300020
.section .exception,8
diff --git a/arm9/asm/MSL_Common_signal.s b/arm9/asm/MSL_Common_signal.s index 8fd03917..3a68bbac 100644 --- a/arm9/asm/MSL_Common_signal.s +++ b/arm9/asm/MSL_Common_signal.s @@ -100,8 +100,4 @@ _020E2EA4: .word __cs_ref _020E2EA8: .word signal_funcs
arm_func_end raise
- .section .exceptix,4
-
- .word raise
- .short 305
- .word 0x00200300
+ exception raise, 305, 0x00200300
diff --git a/arm9/asm/MSL_Common_strtold.s b/arm9/asm/MSL_Common_strtold.s index 424c3a19..2cb0918b 100644 --- a/arm9/asm/MSL_Common_strtold.s +++ b/arm9/asm/MSL_Common_strtold.s @@ -1417,17 +1417,9 @@ atod: ; 0x020E463C _020E4648: .word strtold
arm_func_end atod
- .section .exceptix,4
-
- .word __strtold
- .short 4684
- .word UNK_020EC720
- .word strtold
- .short 225
- .word 0x00500F00
- .word atod
- .short 17
- .word 0x00000000
+ exception __strtold, 4684, UNK_020EC720
+ exception strtold, 225, 0x00500F00
+ exception atod, 17, 0x00000000
.section .exception,8
diff --git a/arm9/asm/MSL_Common_strtoul.s b/arm9/asm/MSL_Common_strtoul.s index ab4a1bbf..c49a7468 100644 --- a/arm9/asm/MSL_Common_strtoul.s +++ b/arm9/asm/MSL_Common_strtoul.s @@ -724,20 +724,8 @@ atol: ; 0x020E4FE0 _020E4FF0: .word strtol
arm_func_end atol
- .section .exceptix,4
-
- .word __strtoul
- .short 1001
- .word 0x0060FF00
- .word __strtoull
- .short 1101
- .word 0x0080FF00
- .word strtoul
- .short 153
- .word 0x00600300
- .word strtol
- .short 201
- .word 0x00600300
- .word atol
- .short 21
- .word 0x00000000
+ exception __strtoul, 1001, 0x0060FF00
+ exception __strtoull, 1101, 0x0080FF00
+ exception strtoul, 153, 0x00600300
+ exception strtol, 201, 0x00600300
+ exception atol, 21, 0x00000000
diff --git a/arm9/asm/MSL_Common_wmem.s b/arm9/asm/MSL_Common_wmem.s index 7c02c344..b09b5b66 100644 --- a/arm9/asm/MSL_Common_wmem.s +++ b/arm9/asm/MSL_Common_wmem.s @@ -28,8 +28,4 @@ _020E5098: bx lr
arm_func_end wmemchr
- .section .exceptix,4
-
- .word wmemcpy
- .short 17
- .word 0x00000000
+ exception wmemcpy, 17, 0x00000000
diff --git a/arm9/asm/MSL_Common_wprintf.s b/arm9/asm/MSL_Common_wprintf.s index 95d115e6..3c99e921 100644 --- a/arm9/asm/MSL_Common_wprintf.s +++ b/arm9/asm/MSL_Common_wprintf.s @@ -2327,32 +2327,14 @@ _020E7000: _020E7018: .word __wStringWrite
arm_func_end vswprintf
- .section .exceptix,4
-
- .word long2str__wide
- .short 593
- .word 0x0090FF20
- .word longlong2str__wide
- .short 741
- .word 0x00A0FF20
- .word double2hex__wide
- .short 921
- .word 0x00F07F20
- .word float2str__wide
- .short 1612
- .word UNK_020EC728
- .word __wpformatter
- .short 2288
- .word UNK_020EC730
- .word __wStringWrite
- .short 65
- .word 0x00200300
- .word swprintf
- .short 41
- .word 0x00300020
- .word vswprintf
- .short 113
- .word 0x00300300
+ exception long2str__wide, 593, 0x0090FF20
+ exception longlong2str__wide, 741, 0x00A0FF20
+ exception double2hex__wide, 921, 0x00F07F20
+ exception float2str__wide, 1612, UNK_020EC728
+ exception __wpformatter, 2288, UNK_020EC730
+ exception __wStringWrite, 65, 0x00200300
+ exception swprintf, 41, 0x00300020
+ exception vswprintf, 113, 0x00300300
.section .exception,8
diff --git a/arm9/asm/MSL_DPMath_e_pow.s b/arm9/asm/MSL_DPMath_e_pow.s index fedcbb10..132716e6 100644 --- a/arm9/asm/MSL_DPMath_e_pow.s +++ b/arm9/asm/MSL_DPMath_e_pow.s @@ -1180,10 +1180,7 @@ _020E81F0: bx lr
arm_func_end __ieee754_pow
- .section .exceptix,4
- .word __ieee754_pow
- .short 4488
- .word UNK_020EC738
+ exception __ieee754_pow, 4488, UNK_020EC738
.section .exception,8
diff --git a/arm9/asm/MSL_DPMath_s_frexp.s b/arm9/asm/MSL_DPMath_s_frexp.s index b0c22aac..b07ce1d6 100644 --- a/arm9/asm/MSL_DPMath_s_frexp.s +++ b/arm9/asm/MSL_DPMath_s_frexp.s @@ -58,8 +58,4 @@ _020E8310: .word 0x800FFFFF _020E8314: .word 0xFFFFFC02
arm_func_end frexp
- .section .exceptix,4
-
- .word frexp
- .short 189
- .word 0x00300120
+ exception frexp, 189, 0x00300120
diff --git a/arm9/asm/MSL_DPMath_s_ldexp.s b/arm9/asm/MSL_DPMath_s_ldexp.s index fc3a4713..131fe52f 100644 --- a/arm9/asm/MSL_DPMath_s_ldexp.s +++ b/arm9/asm/MSL_DPMath_s_ldexp.s @@ -163,8 +163,4 @@ _020E855C: .word 0x0000C350 _020E8560: .word 0x3C900000
arm_func_end ldexp
- .section .exceptix,4
-
- .word ldexp
- .short 589
- .word 0x00300120
+ exception ldexp, 589, 0x00300120
diff --git a/arm9/asm/MSL_DPMath_w_pow.s b/arm9/asm/MSL_DPMath_w_pow.s index 8a6625ad..c0f6346b 100644 --- a/arm9/asm/MSL_DPMath_w_pow.s +++ b/arm9/asm/MSL_DPMath_w_pow.s @@ -11,8 +11,4 @@ pow: ; 0x020E8564 _020E856C: .word __ieee754_pow
arm_func_end pow
- .section .exceptix,4
-
- .word pow
- .short 13
- .word 0x00000000
+ exception pow, 13, 0x00000000
diff --git a/arm9/asm/MSL_fp_ansi.s b/arm9/asm/MSL_fp_ansi.s index b10a364e..734e3090 100644 --- a/arm9/asm/MSL_fp_ansi.s +++ b/arm9/asm/MSL_fp_ansi.s @@ -1599,29 +1599,11 @@ UNK_020EC740: ; 0x020EC740 .byte 0x00, 0xFF, 0x05, 0x20
.balign 8
- .section .exceptix,4
-
- .word __rounddec
- .short 65
- .word 0x00200300
- .word __ull2dec
- .short 205
- .word 0x0050FF00
- .word __timesdec
- .short 389
- .word 0x00D0FF00
- .word __str2dec
- .short 157
- .word 0x00100000
- .word __two_exp
- .short 901
- .word 0x00B00300
- .word __num2dec_internal
- .short 385
- .word 0x00E01F00
- .word __num2dec_internal2
- .short 169
- .word 0x00200300
- .word __dec2num
- .short 1572
- .word UNK_020EC740
+ exception __rounddec, 65, 0x00200300
+ exception __ull2dec, 205, 0x0050FF00
+ exception __timesdec, 389, 0x00D0FF00
+ exception __str2dec, 157, 0x00100000
+ exception __two_exp, 901, 0x00B00300
+ exception __num2dec_internal, 385, 0x00E01F00
+ exception __num2dec_internal2, 169, 0x00200300
+ exception __dec2num, 1572, UNK_020EC740
diff --git a/arm9/asm/MSL_math.s b/arm9/asm/MSL_math.s index 260034e5..1278b024 100644 --- a/arm9/asm/MSL_math.s +++ b/arm9/asm/MSL_math.s @@ -104,7 +104,4 @@ scalbn: ; 0x020E9AA4 ldmia sp!, {r3-r4,pc}
arm_func_end scalbn
- .section .exceptix,4
- .word scalbn
- .short 45
- .word 0x00200100
+ exception scalbn, 45, 0x00200100
diff --git a/arm9/asm/RUNTIME_ARM_semihosted_console_io.s b/arm9/asm/RUNTIME_ARM_semihosted_console_io.s index 7bd44bdb..6e7ddf0b 100644 --- a/arm9/asm/RUNTIME_ARM_semihosted_console_io.s +++ b/arm9/asm/RUNTIME_ARM_semihosted_console_io.s @@ -74,11 +74,5 @@ __close_console: ; 0x020EC68C mov r0, #0x0
bx lr
- .section .exceptix,4
-
- .word __read_console
- .short 81
- .word 0x00300F00
- .word __write_console
- .short 53
- .word 0x00200700
\ No newline at end of file + exception __read_console, 81, 0x00300F00
+ exception __write_console, 53, 0x00200700
\ No newline at end of file diff --git a/arm9/asm/RUNTIME_CPLUS_StaticInitializers.s b/arm9/asm/RUNTIME_CPLUS_StaticInitializers.s index c1446521..1c0caeb8 100644 --- a/arm9/asm/RUNTIME_CPLUS_StaticInitializers.s +++ b/arm9/asm/RUNTIME_CPLUS_StaticInitializers.s @@ -50,11 +50,5 @@ _020EC6D8: .balign 4
_020EC700: .word __global_destructor_chain
- .section .exceptix,4
-
- .word __call_static_initializers
- .short 45
- .word 0x00100100
- .word __destroy_global_chain
- .short 69
- .word 0x00200300
+ exception __call_static_initializers, 45, 0x00100100
+ exception __destroy_global_chain, 69, 0x00200300
diff --git a/arm9/asm/RUNTIME_NITRO_eabi_init.s b/arm9/asm/RUNTIME_NITRO_eabi_init.s index 1bd26818..716c8bb1 100644 --- a/arm9/asm/RUNTIME_NITRO_eabi_init.s +++ b/arm9/asm/RUNTIME_NITRO_eabi_init.s @@ -10,8 +10,4 @@ _ExitProcess: ; 0x020EC704 .balign 4 _020EC70C: .word sys_exit - .section .exceptix,4 - - .word _ExitProcess - .short 13 - .word 0x00000000 + exception _ExitProcess, 13, 0x00000000 diff --git a/arm9/asm/macros.inc b/arm9/asm/macros.inc index 156b2b09..f8cf61e4 100644 --- a/arm9/asm/macros.inc +++ b/arm9/asm/macros.inc @@ -1 +1,2 @@ .include "asm/macros/function.inc" + .include "asm/macros/cw.inc" diff --git a/arm9/asm/macros/cw.inc b/arm9/asm/macros/cw.inc new file mode 100644 index 00000000..14841f11 --- /dev/null +++ b/arm9/asm/macros/cw.inc @@ -0,0 +1,12 @@ + .macro exception what, size, data
+ .section .exceptix,4,1,2
+ .balign 4, 0
+ .type ?exc$\what, @object
+ .global ?exc$\what
+ .size ?exc$\what, 12
+?exc$\what:
+ .word \what
+ .short \size
+ .word \data
+ .previous
+ .endm
diff --git a/arm9/asm/macros/function.inc b/arm9/asm/macros/function.inc index 3323f53e..9c3e5eb5 100644 --- a/arm9/asm/macros/function.inc +++ b/arm9/asm/macros/function.inc @@ -1,10 +1,12 @@ .macro arm_func_start name + .type \name,@function .balign 4, 0 .global \name .arm .endm .macro local_arm_func_start name + .type \name,@function .balign 4, 0 .arm .endm @@ -14,12 +16,14 @@ .endm .macro thumb_func_start name + .type \name,@function .balign 4, 0 .global \name .thumb .endm .macro non_word_aligned_thumb_func_start name + .type \name,@function .global \name .thumb .endm |