pkarashchenko commented on code in PR #9737: URL: https://github.com/apache/nuttx/pull/9737#discussion_r1255912958
########## build-globals.sh: ########## @@ -80,70 +93,100 @@ EP=(${EPS}) # # Generate the modlib_xxxx_globals.S file # - GLOBALS="libs/libc/modlib/modlib_${arch}_globals.S" cat >${GLOBALS} <<__EOF__ +#ifdef __CYGWIN__ +# define SYMBOL(s) _##s +# define WEAK .weak +# define GLOBAL .global +# define SECTION .data + .macro GLOBAL ep + .global SYMBOL(\ep) + .type SYMBOL(\ep), "object" + .endm + .macro SIZE ep + .endm +#elif defined(__ELF__) +# define SYMBOL(s) s +# define WEAK .weak +# define SECTION .data + .macro GLOBAL ep + .global SYMBOL(\ep) + .type SYMBOL(\ep), "object" + .endm + .macro SIZE ep + .size SYMBOL(\ep), . - SYMBOL(\ep) + .endm +#else +# define SYMBOL(s) _##s +# define WEAK .weak_definition +# define SECTION .section __DATA,__data + .macro GLOBAL ep + .private_extern SYMBOL(\ep) + .globl SYMBOL(\ep) + .endm + .macro SIZE ep + .endm +#endif + #if __SIZEOF_POINTER__ == 8 .macro globalEntry index, ep - .weak \p - .quad .L\index - .quad \ep + WEAK SYMBOL(\ep) + .quad .l\index + .quad \ep .endm # define ALIGN 8 #else .macro globalEntry index, ep - .weak \ep - .long .L\index - .long \ep + WEAK SYMBOL(\ep) + .long .l\index + .long \ep .endm # define ALIGN 4 #endif #ifdef __ARM_ARCH_ISA_THUMB2 # ifdef __ARM_ARCH_7M__ - .arch armv7e-m + .arch armv7e-m # elif defined ___ARM_ARCH 8 .arch armv8-m.base #endif #ifdef __ARM_ASM_SYNTAX_UNIFIED__ - .syntax unified + .syntax unified #endif - .thumb + .thumb #endif - .data - .align ALIGN - .global globalNames + .data + .align ALIGN + GLOBAL globalNames -globalNames: +SYMBOL(globalNames): __EOF__ for ((i = 0; i < ${#EP[@]}; i++)) do - echo ".L${i}: .string \"${EP[$i]}\"" >>${GLOBALS} + echo ".l${i}: .string \"${EP[$i]}\"" >>${GLOBALS} done cat >>${GLOBALS} <<__EOF__ - .size globalNames, . - globalNames + SIZE globalNames Review Comment: ```suggestion SIZE globalNames ``` ########## build-globals.sh: ########## @@ -80,70 +93,100 @@ EP=(${EPS}) # # Generate the modlib_xxxx_globals.S file # - GLOBALS="libs/libc/modlib/modlib_${arch}_globals.S" cat >${GLOBALS} <<__EOF__ +#ifdef __CYGWIN__ +# define SYMBOL(s) _##s +# define WEAK .weak +# define GLOBAL .global +# define SECTION .data + .macro GLOBAL ep + .global SYMBOL(\ep) + .type SYMBOL(\ep), "object" + .endm + .macro SIZE ep + .endm +#elif defined(__ELF__) +# define SYMBOL(s) s +# define WEAK .weak +# define SECTION .data + .macro GLOBAL ep + .global SYMBOL(\ep) + .type SYMBOL(\ep), "object" + .endm + .macro SIZE ep + .size SYMBOL(\ep), . - SYMBOL(\ep) + .endm +#else +# define SYMBOL(s) _##s +# define WEAK .weak_definition +# define SECTION .section __DATA,__data + .macro GLOBAL ep + .private_extern SYMBOL(\ep) + .globl SYMBOL(\ep) + .endm + .macro SIZE ep + .endm +#endif + #if __SIZEOF_POINTER__ == 8 .macro globalEntry index, ep - .weak \p - .quad .L\index - .quad \ep + WEAK SYMBOL(\ep) + .quad .l\index + .quad \ep .endm # define ALIGN 8 #else .macro globalEntry index, ep - .weak \ep - .long .L\index - .long \ep + WEAK SYMBOL(\ep) + .long .l\index + .long \ep .endm # define ALIGN 4 #endif #ifdef __ARM_ARCH_ISA_THUMB2 # ifdef __ARM_ARCH_7M__ - .arch armv7e-m + .arch armv7e-m # elif defined ___ARM_ARCH 8 .arch armv8-m.base #endif #ifdef __ARM_ASM_SYNTAX_UNIFIED__ - .syntax unified + .syntax unified #endif - .thumb + .thumb #endif - .data - .align ALIGN - .global globalNames + .data + .align ALIGN + GLOBAL globalNames Review Comment: ```suggestion GLOBAL globalNames ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org