Changeset 2a61542 in rtems


Ignore:
Timestamp:
Apr 12, 2018, 4:09:48 AM (15 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
31cd205d
Parents:
4ff09d5b
git-author:
Chris Johns <chrisj@…> (04/12/18 04:09:48)
git-committer:
Chris Johns <chrisj@…> (04/12/18 07:54:59)
Message:

libdl: RAP format fixes.

  • Do not error if a RAP section is not found.
  • Free a symbol table via the RTL allocator interface.
  • Add the symbols to the global symbol table.

Update #2769

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libdl/rtl-rap.c

    r4ff09d5b r2a61542  
    247247
    248248    if (!targetsect)
    249     {
    250       rtems_rtl_set_error (EINVAL, "no target section found");
    251       free (symname_buffer);
    252       return false;
    253     }
     249      continue;
    254250
    255251    if (!rtems_rtl_rap_read_uint32 (rap->decomp, &header))
     
    593589
    594590  if (!rtems_rtl_obj_comp_read (rap->decomp, rap->strtab, rap->strtab_size))
    595     return false;
     591  {
     592    rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_SYMBOL, obj->global_table);
     593    return false;
     594  }
    596595
    597596  for (sym = 0, gsym = obj->global_table; sym < rap->symbols; ++sym)
     
    606605        !rtems_rtl_rap_read_uint32 (rap->decomp, &value))
    607606    {
    608       free (obj->global_table);
     607      rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_SYMBOL, obj->global_table);
    609608      obj->global_table = NULL;
    610609      obj->global_syms = 0;
     
    630629      rtems_rtl_set_error (EINVAL,
    631630                           "duplicate global symbol: %s", rap->strtab + name);
    632       free (obj->global_table);
     631      rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_SYMBOL, obj->global_table);
    633632      obj->global_table = NULL;
    634633      obj->global_syms = 0;
     
    640639    if (!symsect)
    641640    {
    642       free (obj->global_table);
     641      rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_SYMBOL, obj->global_table);
    643642      obj->global_table = NULL;
    644643      obj->global_syms = 0;
     
    662661    ++gsym;
    663662  }
     663
     664  if (obj->global_syms)
     665    rtems_rtl_symbol_obj_add (obj);
    664666
    665667  return true;
Note: See TracChangeset for help on using the changeset viewer.