Add #define for main exit code

This commit is contained in:
Alexander Heldt
2024-07-03 12:19:10 +02:00
parent 8c8a72df71
commit cc8380759b
6 changed files with 33 additions and 24 deletions

Binary file not shown.

View File

@@ -112,23 +112,23 @@ LOAD linker stubs
.debug_rnglists .debug_rnglists
0x00000013 0x19 build/startup.o 0x00000013 0x19 build/startup.o
.debug_macro 0x00000000 0x19f3 .debug_macro 0x00000000 0x19f9
.debug_macro 0x00000000 0xaaa build/main.o .debug_macro 0x00000000 0xab0 build/main.o
.debug_macro 0x00000aaa 0xafc build/startup.o .debug_macro 0x00000ab0 0xafc build/startup.o
.debug_macro 0x000015a6 0x22 build/startup.o .debug_macro 0x000015ac 0x22 build/startup.o
.debug_macro 0x000015c8 0x8e build/startup.o .debug_macro 0x000015ce 0x8e build/startup.o
.debug_macro 0x00001656 0x51 build/startup.o .debug_macro 0x0000165c 0x51 build/startup.o
.debug_macro 0x000016a7 0x103 build/startup.o .debug_macro 0x000016ad 0x103 build/startup.o
.debug_macro 0x000017aa 0x6a build/startup.o .debug_macro 0x000017b0 0x6a build/startup.o
.debug_macro 0x00001814 0x1df build/startup.o .debug_macro 0x0000181a 0x1df build/startup.o
.debug_line 0x00000000 0x120 .debug_line 0x00000000 0x120
.debug_line 0x00000000 0x4f build/main.o .debug_line 0x00000000 0x4f build/main.o
.debug_line 0x0000004f 0xd1 build/startup.o .debug_line 0x0000004f 0xd1 build/startup.o
.debug_str 0x00000000 0x3be8 .debug_str 0x00000000 0x3bf0
.debug_str 0x00000000 0x2da8 build/main.o .debug_str 0x00000000 0x2db0 build/main.o
.debug_str 0x00002da8 0xe40 build/startup.o .debug_str 0x00002db0 0xe40 build/startup.o
0x3d41 (size before relaxing) 0x3d41 (size before relaxing)
.comment 0x00000000 0x45 .comment 0x00000000 0x45

View File

@@ -26,7 +26,7 @@
.type main, %function .type main, %function
main: main:
.LFB0: .LFB0:
.loc 1 1 16 .loc 1 3 16
.cfi_startproc .cfi_startproc
@ args = 0, pretend = 0, frame = 0 @ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0 @ frame_needed = 1, uses_anonymous_args = 0
@@ -36,9 +36,9 @@ main:
.cfi_offset 7, -4 .cfi_offset 7, -4
add r7, sp, #0 add r7, sp, #0
.cfi_def_cfa_register 7 .cfi_def_cfa_register 7
.loc 1 2 10 .loc 1 4 10
movs r3, #42 movs r3, #42
.loc 1 3 1 .loc 1 5 1
mov r0, r3 mov r0, r3
mov sp, r7 mov sp, r7
.cfi_def_cfa_register 13 .cfi_def_cfa_register 13
@@ -60,18 +60,18 @@ main:
.byte 0x4 .byte 0x4
.4byte .Ldebug_abbrev0 .4byte .Ldebug_abbrev0
.uleb128 0x1 .uleb128 0x1
.4byte .LASF453
.byte 0x1d
.4byte .LASF454 .4byte .LASF454
.byte 0x1d
.4byte .LASF455 .4byte .LASF455
.4byte .LASF456
.4byte .LLRL0 .4byte .LLRL0
.4byte 0 .4byte 0
.4byte .Ldebug_line0 .4byte .Ldebug_line0
.4byte .Ldebug_macro0 .4byte .Ldebug_macro0
.uleb128 0x2 .uleb128 0x2
.4byte .LASF456 .4byte .LASF457
.byte 0x1
.byte 0x1 .byte 0x1
.byte 0x3
.byte 0x5 .byte 0x5
.4byte 0x40 .4byte 0x40
.4byte .LFB0 .4byte .LFB0
@@ -1538,6 +1538,9 @@ main:
.byte 0x5 .byte 0x5
.uleb128 0 .uleb128 0
.4byte .LASF452 .4byte .LASF452
.byte 0x5
.uleb128 0x1
.4byte .LASF453
.byte 0x4 .byte 0x4
.byte 0 .byte 0
.section .debug_line,"",%progbits .section .debug_line,"",%progbits
@@ -1732,7 +1735,7 @@ main:
.ascii "__ARM_NEON\000" .ascii "__ARM_NEON\000"
.LASF400: .LASF400:
.ascii "__ARM_FEATURE_CMSE\000" .ascii "__ARM_FEATURE_CMSE\000"
.LASF455: .LASF456:
.ascii "/home/alex/code/own/c-compile-experiments\000" .ascii "/home/alex/code/own/c-compile-experiments\000"
.LASF229: .LASF229:
.ascii "__FLT64_IS_IEC_60559__ 2\000" .ascii "__FLT64_IS_IEC_60559__ 2\000"
@@ -2270,7 +2273,7 @@ main:
.ascii "__UINT64_C(c) c ## ULL\000" .ascii "__UINT64_C(c) c ## ULL\000"
.LASF310: .LASF310:
.ascii "__LACCUM_EPSILON__ 0x1P-31LK\000" .ascii "__LACCUM_EPSILON__ 0x1P-31LK\000"
.LASF456: .LASF457:
.ascii "main\000" .ascii "main\000"
.LASF250: .LASF250:
.ascii "__SFRACT_EPSILON__ 0x1P-7HR\000" .ascii "__SFRACT_EPSILON__ 0x1P-7HR\000"
@@ -2292,6 +2295,8 @@ main:
.ascii "__INTPTR_MAX__ 0x7fffffff\000" .ascii "__INTPTR_MAX__ 0x7fffffff\000"
.LASF385: .LASF385:
.ascii "__PRAGMA_REDEFINE_EXTNAME 1\000" .ascii "__PRAGMA_REDEFINE_EXTNAME 1\000"
.LASF453:
.ascii "exit 42\000"
.LASF224: .LASF224:
.ascii "__FLT64_EPSILON__ 2.2204460492503131e-16F64\000" .ascii "__FLT64_EPSILON__ 2.2204460492503131e-16F64\000"
.LASF40: .LASF40:
@@ -2334,7 +2339,7 @@ main:
.ascii "__SIZE_TYPE__ unsigned int\000" .ascii "__SIZE_TYPE__ unsigned int\000"
.LASF321: .LASF321:
.ascii "__ULLACCUM_FBIT__ 32\000" .ascii "__ULLACCUM_FBIT__ 32\000"
.LASF453: .LASF454:
.ascii "GNU C17 12.3.1 20230626 -mcpu=cortex-m4 -mthumb -mf" .ascii "GNU C17 12.3.1 20230626 -mcpu=cortex-m4 -mthumb -mf"
.ascii "loat-abi=hard -mfpu=fpv4-sp-d16 -march=armv7e-m+fp " .ascii "loat-abi=hard -mfpu=fpv4-sp-d16 -march=armv7e-m+fp "
.ascii "-g3 -ggdb -O0 -ffunction-sections -fdata-sections -" .ascii "-g3 -ggdb -O0 -ffunction-sections -fdata-sections -"
@@ -2378,7 +2383,7 @@ main:
.ascii "L)\000" .ascii "L)\000"
.LASF50: .LASF50:
.ascii "__UINT64_TYPE__ long long unsigned int\000" .ascii "__UINT64_TYPE__ long long unsigned int\000"
.LASF454: .LASF455:
.ascii "src/main.c\000" .ascii "src/main.c\000"
.LASF244: .LASF244:
.ascii "__FLT32X_HAS_QUIET_NAN__ 1\000" .ascii "__FLT32X_HAS_QUIET_NAN__ 1\000"

View File

@@ -907,6 +907,8 @@
# 0 "<command-line>" # 0 "<command-line>"
#define __USES_INITFINI__ 1 #define __USES_INITFINI__ 1
# 1 "src/main.c" # 1 "src/main.c"
#define exit 42
int main(void) { int main(void) {
return 42; return 42;
} }

Binary file not shown.

View File

@@ -1,3 +1,5 @@
#define exit 42
int main(void) { int main(void) {
return 42; return exit;
} }