Changeset b36c5209 in rtems for cpukit/libdl/rtl-mdreloc-mips.c


Ignore:
Timestamp:
May 3, 2019, 12:15:20 AM (6 months 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-mips.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,
     
    8282  (void) symvalue;
    8383  rtems_rtl_set_error (EINVAL, "rela type record not supported");
    84   return false;
    85 }
    86 
    87 bool
     84  return rtems_rtl_elf_rel_failure;
     85}
     86
     87rtems_rtl_elf_rel_status
    8888rtems_rtl_elf_relocate_rela (rtems_rtl_obj*            obj,
    8989                             const Elf_Rela*           rela,
     
    100100  (void) symvalue;
    101101  rtems_rtl_set_error (EINVAL, "rela type record not supported");
    102   return false;
    103 }
    104 
    105 bool
     102  return rtems_rtl_elf_rel_failure;
     103}
     104
     105rtems_rtl_elf_rel_status
    106106rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj*            obj,
    107107                                  const Elf_Rel*            rel,
     
    117117  (void) syminfo;
    118118  (void) symvalue;
    119   return true;
     119  return rtems_rtl_elf_rel_no_error;
    120120}
    121121
     
    128128 * just consider symtype here.
    129129 */
    130 bool
     130rtems_rtl_elf_rel_status
    131131rtems_rtl_elf_relocate_rel (rtems_rtl_obj*            obj,
    132132                            const Elf_Rel*            rel,
     
    163163      if ((tmp & 0xffff0000) != 0) {
    164164        printf("R_MIPS_16 Overflow\n");
    165         return false;
     165        return rtems_rtl_elf_rel_failure;
    166166      }
    167167
     
    225225      tmp = symvalue;
    226226      if (tmp == 0)
    227         return false;
     227        return rtems_rtl_elf_rel_failure;
    228228
    229229      addend &= 0xffff0000;
     
    255255      if (((Elf_Sword)tmp > 0x7fff) || ((Elf_Sword)tmp < -0x8000)) {
    256256        printf("R_MIPS_PC16 Overflow\n");
    257         return false;
     257        return rtems_rtl_elf_rel_failure;
    258258      }
    259259
     
    275275                           "in non-PLT relocations",
    276276                           sect->name, (uint32_t) ELF_R_TYPE(rel->r_info));
    277       return false;
     277      return rtems_rtl_elf_rel_failure;
    278278  }
    279279
    280   return true;
     280  return rtems_rtl_elf_rel_no_error;
    281281}
    282282
Note: See TracChangeset for help on using the changeset viewer.