mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
Add support for the loading of ET_DYN objects
* libs/libc/machine/arm/armv7-m/arch_elf.c
- Fix cast of error message parameters
* build-globals.sh
- Build the modlib_globals.S file used to resolve symbols when dynamically loading
* libs/libc/modlib/Make.defs
- Build modlib_globals.S for all targets
* libs/libc/modlib/modlib_load.c
- Calculate sizes and text/data addresses based on program headers rather than section headers
- Handle objects with no program headers
* libs/libc/modlib/modlib_bind.c
- Call modlib_readsym with pointer to symbol table
- Add modlib_relocatedyn to manage relocation of symbols with shared object (ET_DYN)
- Differentiate between ET_REL and ET_DYN objects
- Use arch independent symbol ELF_R_SYM
- Cast sizes to avoid warnings
* libs/libc/modlib/modlib_load.c
- Cast sizes to avoid warnings
* include/elf.h
- Add definitions that may be found in shared objects
* include/nuttx/lib/modlib.h
- Add parameter to modlib_readsym prototype
- Add prototypes for:
- modlib_insertsymtab
- modlib_findglobal
- Define Elf_Dyn and Elf_Off according to the elf architecture
- Add fields to mod_loadifno_s:
- Program headers
- Exported symbols
- Data section address
- Padding requirement
- Section index for dynamic symbol table
- Number of symbols exported
- Add prottotype for modlib_freesymtab
* libs/libc/dlfcn/lib_dlclose.c
- Free the symbol table when the dll is closed
* libs/libc/dlfcn/lib_dlopen.c
- Add dump of program headers to debug routine
- Differentiate between ET_REL and ET_DYN objects
* libs/libc/machine/arm/armv7-m/arch_elf.c
- Add handling of R_ARM_RELATIVE and R_ARM_JUMP slot relocation types
* libs/libc/modlib/modlib_loadshdrs.c
- Rename modlib_loadshdrs.c to modlib_loadhdrs.c
- Rename modlib_loadshdrs to modlib_loadhdrs
- Add code to load program headers
* libs/libc/modlib/modlib_symbols.c
- Define entry point structure
- Add offset parameter to modlib_symname() and use to find symbol names
- Add symtab section header parameter to modlib_readsym()
- Add offset parameter to modlib_symvalue() to locate symbol names
- Add modlib_insertsyntab() to create a symbol table for exporting and resolution
- Add findEP() to resolve a symbol in the modlib_global table
- Add modlib_findglobal() to find symbol in the modlib_global table
- Add modlib_freesymtab() to free the symbol table
* libs/libc/modlib/modlib_uninit.c
- Free header and sections from a module_loadinfo_s control block
* libs/libc/modlib/modlib_verify.c
- Handle ET_DYN shared objects
* libs/libc/modlib/modlib_globals.S
- Multi-target global table
- Define library APIs that may be resolved when loading a shared object
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
f0107683d5
commit
fec789047a
@@ -214,6 +214,17 @@
|
||||
#define PT_NOTE 4
|
||||
#define PT_SHLIB 5
|
||||
#define PT_PHDR 6
|
||||
|
||||
/* Processor specific values for the Phdr p_type field. */
|
||||
|
||||
#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
|
||||
|
||||
/* GCC specific */
|
||||
|
||||
#define PT_GNU_EH_FRAME 0x6474e550 /* GCC exception handler frame */
|
||||
#define PT_GNU_STACK 0x6474e551 /* Stack executability */
|
||||
#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */
|
||||
|
||||
#define PT_LOPROC 0x70000000
|
||||
#define PT_HIPROC 0x7fffffff
|
||||
|
||||
|
||||
Reference in New Issue
Block a user