diff options
author | Chris Johns <chrisj@rtems.org> | 2019-01-15 17:47:41 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2019-02-09 10:06:34 +1100 |
commit | d8c70ba65b13cd023b50b8aed5d91e455017cdd5 (patch) | |
tree | f78c3441ef74a7315ef4f7850bd27631bf0d2502 /cpukit/libdl/rtl-mdreloc-mips.c | |
parent | libdl: Fix the support for constructors and desctructors. (diff) | |
download | rtems-d8c70ba65b13cd023b50b8aed5d91e455017cdd5.tar.bz2 |
libdl: Add support for trampolines
- Trampolines or fixups for veneers provide long jump support
for instruciton sets that implement short relative address
branches. The linker provides trampolines when creating a
static image. This patch adds trampoline support to libdl
and the ARM architecture.
- The dl09 test requires enough memory so modules are outside
the relative branch instruction ranges for the architecture.
Updates #3685
Diffstat (limited to 'cpukit/libdl/rtl-mdreloc-mips.c')
-rw-r--r-- | cpukit/libdl/rtl-mdreloc-mips.c | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/cpukit/libdl/rtl-mdreloc-mips.c b/cpukit/libdl/rtl-mdreloc-mips.c index 7ad18b382f..4860fdfe72 100644 --- a/cpukit/libdl/rtl-mdreloc-mips.c +++ b/cpukit/libdl/rtl-mdreloc-mips.c @@ -25,18 +25,68 @@ rtems_rtl_elf_rel_resolve_sym (Elf_Word type) return true; } +size_t +rtems_rtl_elf_relocate_tramp_max_size (void) +{ + /* + * Disable by returning 0. + */ + return 0; +} + bool -rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, +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) +{ + (void) obj; + (void) rela; + (void) sect; + (void) symname; + (void) syminfo; + (void) symvalue; + rtems_rtl_set_error (EINVAL, "rela type record not supported"); + return false; +} + +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) { + (void) obj; + (void) rela; + (void) sect; + (void) symname; + (void) syminfo; + (void) symvalue; rtems_rtl_set_error (EINVAL, "rela type record not supported"); return false; } +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) +{ + (void) obj; + (void) rel; + (void) sect; + (void) symname; + (void) syminfo; + (void) symvalue; + return true; +} + /* * 1. _gp_disp symbol are not considered in this file. * 2. There is a local/external column; @@ -46,7 +96,7 @@ rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, * just consider symtype here. */ bool -rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, +rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, const Elf_Rel* rel, const rtems_rtl_obj_sect* sect, const char* symname, @@ -183,16 +233,16 @@ rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, break; - default: - printf ("rtl: reloc unknown: sym = %lu, type = %lu, offset = %p, " - "contents = %p\n", + default: + printf ("rtl: reloc unknown: sym = %lu, type = %lu, offset = %p, " + "contents = %p\n", ELF_R_SYM(rel->r_info), (uint32_t) ELF_R_TYPE(rel->r_info), (void *)rel->r_offset, (void *)*where); - rtems_rtl_set_error (EINVAL, - "%s: Unsupported relocation type %ld " - "in non-PLT relocations", - sect->name, (uint32_t) ELF_R_TYPE(rel->r_info)); - return false; + rtems_rtl_set_error (EINVAL, + "%s: Unsupported relocation type %ld " + "in non-PLT relocations", + sect->name, (uint32_t) ELF_R_TYPE(rel->r_info)); + return false; } return true; |