2023-07-07 01:15:59 +02:00
|
|
|
#ifdef __CYGWIN__
|
2023-09-04 02:37:48 +02:00
|
|
|
# define SYMBOL(s) _##s
|
2023-07-07 01:15:59 +02:00
|
|
|
# define GLOBAL .global
|
|
|
|
# define SECTION .data
|
|
|
|
.macro GLOBAL ep
|
2023-09-04 02:37:48 +02:00
|
|
|
.global SYMBOL(\ep)
|
|
|
|
.type SYMBOL(\ep), "object"
|
2023-07-07 01:15:59 +02:00
|
|
|
.endm
|
|
|
|
.macro SIZE ep
|
|
|
|
.endm
|
|
|
|
#elif defined(__ELF__)
|
|
|
|
# define SYMBOL(s) s
|
|
|
|
# define SECTION .data
|
|
|
|
.macro GLOBAL ep
|
2023-09-04 02:37:48 +02:00
|
|
|
.global SYMBOL(\ep)
|
|
|
|
.type SYMBOL(\ep), "object"
|
2023-07-07 01:15:59 +02:00
|
|
|
.endm
|
|
|
|
.macro SIZE ep
|
2024-08-01 15:36:03 +02:00
|
|
|
# if defined(__ghs__)
|
|
|
|
.size SYMBOL(ep), . - SYMBOL(ep)
|
|
|
|
# else
|
2023-09-04 02:37:48 +02:00
|
|
|
.size SYMBOL(\ep), . - SYMBOL(\ep)
|
2024-08-01 15:36:03 +02:00
|
|
|
# endif
|
2023-07-07 01:15:59 +02:00
|
|
|
.endm
|
|
|
|
#else
|
|
|
|
# define SYMBOL(s) _##s
|
|
|
|
# define SECTION .section __DATA,__data
|
|
|
|
.macro GLOBAL ep
|
|
|
|
.private_extern SYMBOL(\ep)
|
|
|
|
.globl SYMBOL(\ep)
|
|
|
|
.endm
|
|
|
|
.macro SIZE ep
|
|
|
|
.endm
|
|
|
|
#endif
|
|
|
|
|
2022-09-26 08:22:03 +02:00
|
|
|
#if __SIZEOF_POINTER__ == 8
|
|
|
|
.macro globalEntry index, ep
|
2023-07-07 01:15:59 +02:00
|
|
|
.quad .l\index
|
|
|
|
.quad \ep
|
2022-09-26 08:22:03 +02:00
|
|
|
.endm
|
|
|
|
# define ALIGN 8
|
|
|
|
#else
|
|
|
|
.macro globalEntry index, ep
|
2023-07-07 01:15:59 +02:00
|
|
|
.long .l\index
|
|
|
|
.long \ep
|
2022-09-26 08:22:03 +02:00
|
|
|
.endm
|
|
|
|
# define ALIGN 4
|
|
|
|
#endif
|
|
|
|
#ifdef __ARM_ARCH_ISA_THUMB2
|
|
|
|
# ifdef __ARM_ARCH_7M__
|
2023-07-07 01:15:59 +02:00
|
|
|
.arch armv7e-m
|
2022-09-26 08:22:03 +02:00
|
|
|
# elif defined ___ARM_ARCH 8
|
|
|
|
.arch armv8-m.base
|
|
|
|
#endif
|
2023-07-07 01:15:59 +02:00
|
|
|
#ifdef __ARM_ASM_SYNTAX_UNIFIED__
|
2023-09-04 02:37:48 +02:00
|
|
|
.syntax unified
|
2023-07-07 01:15:59 +02:00
|
|
|
#endif
|
|
|
|
.thumb
|
|
|
|
#endif
|
|
|
|
.data
|
|
|
|
.align ALIGN
|
2023-09-04 02:37:48 +02:00
|
|
|
GLOBAL globalNames
|
2022-09-26 08:22:03 +02:00
|
|
|
|
2023-07-07 01:15:59 +02:00
|
|
|
SYMBOL(globalNames):
|
2023-09-04 02:37:48 +02:00
|
|
|
SIZE globalNames
|
2022-09-26 08:22:03 +02:00
|
|
|
|
|
|
|
.align ALIGN
|
2023-07-09 00:16:11 +02:00
|
|
|
GLOBAL nglobals
|
2023-09-04 02:37:48 +02:00
|
|
|
SYMBOL(nglobals):
|
2023-07-07 01:15:59 +02:00
|
|
|
.word 0
|
2023-07-09 00:16:11 +02:00
|
|
|
SIZE nglobals
|
2022-09-26 08:22:03 +02:00
|
|
|
|
|
|
|
.align ALIGN
|
2023-07-09 00:16:11 +02:00
|
|
|
GLOBAL global_table
|
|
|
|
SYMBOL(global_table):
|
|
|
|
SIZE global_table
|