5d7f2fdf16
* build-globals.sh - Only look in the nuttx for external symbols used when loading dynamic shared objects * include/elf64.h - Correct the type of fields in the Elf64_Phdr structure * libs/libc/dlfcn/lib_dlclose.c - Distinguish between ET_DYN and other objects as the former has both text and data in a single allocation to reserve GOT offsets * libs/libc/dlfcn/lib_dlopen.c - Code formatting * libs/libc/modlib/modlib_bind.c - Distinguish between relocation entry sizes by section type - Handle RELA style relocations * libs/libc/modlib/modlib_globals.S - Formatting fixes - Symbols should not be weak - they exist or they don't * include/nuttx/lib/modlib.h - Add an inidcator to module_s to distinguish between ET_DYN and other * libs/libc/modlib/modlib_load.c - ET_DYN objects need to keep the relative displacement between the text and data sections due to GOT references from the former to the latter. This also implies that linking may require modification from the default for the shared objects being produced. For example, default alignment may mean nearly 64K of wasted space. * libs/libc/modlib/modlib_unload.c sched/module/mod_rmmod.c - Distingusih between freeing of ET_DYN storage and other as the former is a single allocation. * libs/libc/modlib/mod_insmod.c - Cater for ET_DYN objects having init and preinit sections
73 lines
1.2 KiB
ArmAsm
73 lines
1.2 KiB
ArmAsm
#ifdef __CYGWIN__
|
|
# define SYMBOL(s) _##s
|
|
# 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 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 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
|
|
.quad .l\index
|
|
.quad \ep
|
|
.endm
|
|
# define ALIGN 8
|
|
#else
|
|
.macro globalEntry index, ep
|
|
.long .l\index
|
|
.long \ep
|
|
.endm
|
|
# define ALIGN 4
|
|
#endif
|
|
#ifdef __ARM_ARCH_ISA_THUMB2
|
|
# ifdef __ARM_ARCH_7M__
|
|
.arch armv7e-m
|
|
# elif defined ___ARM_ARCH 8
|
|
.arch armv8-m.base
|
|
#endif
|
|
#ifdef __ARM_ASM_SYNTAX_UNIFIED__
|
|
.syntax unified
|
|
#endif
|
|
.thumb
|
|
#endif
|
|
.data
|
|
.align ALIGN
|
|
GLOBAL globalNames
|
|
|
|
SYMBOL(globalNames):
|
|
SIZE globalNames
|
|
|
|
.align ALIGN
|
|
GLOBAL nglobals
|
|
SYMBOL(nglobals):
|
|
.word 0
|
|
SIZE nglobals
|
|
|
|
.align ALIGN
|
|
GLOBAL global_table
|
|
SYMBOL(global_table):
|
|
SIZE global_table
|