Ignore:
Timestamp:
May 3, 2019, 12:15:20 AM (7 weeks ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
8bd4f61c
Parents:
be50969
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libdl/rtl-mdreloc-h8300.c

    rbe50969 rb36c5209  
    6767}
    6868
    69 bool
     69rtems_rtl_elf_rel_status
    7070rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj*            obj,
    7171                                   const Elf_Rela*           rela,
     
    8181  (void) syminfo;
    8282  (void) symvalue;
    83   return true;
    84 }
    85 
    86 bool
     83  return rtems_rtl_elf_rel_no_error;
     84}
     85
     86rtems_rtl_elf_rel_status
    8787rtems_rtl_elf_relocate_rela (rtems_rtl_obj*            obj,
    8888                             const Elf_Rela*           rela,
     
    131131      if (((Elf32_Sword)tmp > 0x7f) || ((Elf32_Sword)tmp < -(Elf32_Sword)0x80)){
    132132        printf("PCREL8 overflow\n");
    133           return false;
     133          return rtems_rtl_elf_rel_failure;
    134134      } else {
    135135        *(uint8_t *)where = tmp;
     
    142142      if (((Elf32_Sword)tmp > 0x7fff) || ((Elf32_Sword)tmp < -(Elf32_Sword)0x8000)){
    143143        printf("PCREL16 overflow\n");
    144        return false;
     144       return rtems_rtl_elf_rel_failure;
    145145      } else {
    146146       *(uint16_t *)where = tmp;
     
    151151      rtems_rtl_set_error (EINVAL, "rela type record not supported");
    152152      printf("Unsupported reloc types\n");
    153       return false;
     153      return rtems_rtl_elf_rel_failure;
    154154  }
    155   return true;
    156 }
    157 
    158 bool
     155  return rtems_rtl_elf_rel_no_error;
     156}
     157
     158rtems_rtl_elf_rel_status
    159159rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj*           obj,
    160160                                  const Elf_Rel*            rel,
     
    171171  (void) symvalue;
    172172  rtems_rtl_set_error (EINVAL, "rel type record not supported");
    173   return false;
    174 }
    175 
    176 bool
     173  return rtems_rtl_elf_rel_failure;
     174}
     175
     176rtems_rtl_elf_rel_status
    177177rtems_rtl_elf_relocate_rel (rtems_rtl_obj*            obj,
    178178                            const Elf_Rel*            rel,
     
    189189  (void) symvalue;
    190190  rtems_rtl_set_error (EINVAL, "rel type record not supported");
    191   return false;
     191  return rtems_rtl_elf_rel_failure;
    192192}
    193193
Note: See TracChangeset for help on using the changeset viewer.