diff options
author | Chris Johns <chrisj@rtems.org> | 2019-05-03 10:15:20 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2019-05-03 10:15:20 +1000 |
commit | b36c52097f52012f9a52dff6fc8393d63805158b (patch) | |
tree | 011b4cb678d343e0e6422d36bbcce982fdf48e30 /cpukit/libdl/rtl-elf.h | |
parent | bsp/motorola_powerpc: Fix debug output (diff) | |
download | rtems-b36c52097f52012f9a52dff6fc8393d63805158b.tar.bz2 |
libdl: Do not access the ELF file while the allocator is locked.
- Load symbols before allocation.
- Parse reloc records and place any reloc recs in a cache to use
while the allocator is locked.
- Relocate symbols after section allocation.
- Split section loading into allocation/locating and loading.
- Update all arch back-ends with a new reloc interface to control
tramp handling.
- Add `-a` and `-t` to the object list shell command.
Closes #3741
Diffstat (limited to 'cpukit/libdl/rtl-elf.h')
-rw-r--r-- | cpukit/libdl/rtl-elf.h | 73 |
1 files changed, 40 insertions, 33 deletions
diff --git a/cpukit/libdl/rtl-elf.h b/cpukit/libdl/rtl-elf.h index 73d1e01bb1..660b0c47b4 100644 --- a/cpukit/libdl/rtl-elf.h +++ b/cpukit/libdl/rtl-elf.h @@ -52,6 +52,17 @@ extern "C" { **/ /** + * ELF Relocation status codes. + */ +typedef enum rtems_rtl_elf_rel_status +{ + rtems_rtl_elf_rel_no_error, /**< There is no error processing the record. */ + rtems_rtl_elf_rel_failure, /**< There was a failure processing the record. */ + rtems_rtl_elf_rel_tramp_cache, /**< The reloc record may need a trampoliine. */ + rtems_rtl_elf_rel_tramp_add /**< Add a trampoliine. */ +} rtems_rtl_elf_rel_status; + +/** * Relocation trampoline relocation data. */ typedef struct rtems_rtl_mdreloc_trmap @@ -143,20 +154,19 @@ size_t rtems_rtl_elf_relocate_tramp_max_size (void); * relocation record requires a trampoline. * * @param obj The object file being relocated. - * @param rel The ELF relocation record. + * @param rela The ELF relocation record. * @param sect The section of the object file the relocation is for. * @param symname The symbol's name. * @param syminfo The ELF symbol info field. * @param symvalue If a symbol is referenced, this is the symbols value. - * @retval bool The relocation is valid. - * @retval bool The relocation is not valid. + * @retval rtems_rtl_elf_rel_status The result of the trampoline parsing. */ -bool rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, - const Elf_Rel* rel, - const rtems_rtl_obj_sect* sect, - const char* symname, - const Elf_Byte syminfo, - const Elf_Word symvalue); +rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, + const Elf_Rel* rel, + const rtems_rtl_obj_sect* sect, + const char* symname, + const Elf_Byte syminfo, + const Elf_Word symvalue); /** * Architecture specific relocation handler compiled in for a specific @@ -169,15 +179,14 @@ bool rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, * @param symname The symbol's name. * @param syminfo The ELF symbol info field. * @param symvalue If a symbol is referenced, this is the symbols value. - * @retval bool The relocation is valid. - * @retval bool The relocation is not valid. + * @retval rtems_rtl_elf_rel_status The result of the trampoline parsing. */ -bool rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, - const Elf_Rela* rela, - const rtems_rtl_obj_sect* sect, - const char* symname, - const Elf_Byte syminfo, - const Elf_Word symvalue); +rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, + const Elf_Rela* rela, + const rtems_rtl_obj_sect* sect, + const char* symname, + const Elf_Byte syminfo, + const Elf_Word symvalue); /** * Architecture specific relocation handler compiled in for a specific @@ -190,15 +199,14 @@ bool rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, * @param symname The symbol's name. * @param syminfo The ELF symbol info field. * @param symvalue If a symbol is referenced, this is the symbols value. - * @retval bool The relocation has been applied. - * @retval bool The relocation could not be applied. + * @retval rtems_rtl_elf_rel_status The result of the trampoline parsing. */ -bool rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, - const Elf_Rel* rel, - const rtems_rtl_obj_sect* sect, - const char* symname, - const Elf_Byte syminfo, - const Elf_Word symvalue); +rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, + const Elf_Rel* rel, + const rtems_rtl_obj_sect* sect, + const char* symname, + const Elf_Byte syminfo, + const Elf_Word symvalue); /** * Architecture specific relocation handler compiled in for a specific @@ -211,15 +219,14 @@ bool rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, * @param symname The symbol's name. * @param syminfo The ELF symbol info field. * @param symvalue If a symbol is referenced, this is the symbols value. - * @retval bool The relocation has been applied. - * @retval bool The relocation could not be applied. + * @retval rtems_rtl_elf_rel_status The result of the trampoline parsing. */ -bool rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, - const Elf_Rela* rela, - const rtems_rtl_obj_sect* sect, - const char* symname, - const Elf_Byte syminfo, - const Elf_Word symvalue); +rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, + const Elf_Rela* rela, + const rtems_rtl_obj_sect* sect, + const char* symname, + const Elf_Byte syminfo, + const Elf_Word symvalue); /** * The ELF format check handler. |