Changeset b36c5209 in rtems for cpukit/libdl/rtl-shell.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-shell.c

    rbe50969 rb36c5209  
    144144  bool                 symbols;      /**< Print the global symbols. */
    145145  bool                 dependencies; /**< Print any dependencies. */
     146  bool                 trampolines;  /**< Print trampoline stats. */
    146147  bool                 base;         /**< Include the base object file. */
    147148  const char*          re_name;      /**< Name regx to filter on. */
     
    516517    rtems_printf (print->printer, "%-*cusers         : %zu\n", indent, ' ', obj->users);
    517518    rtems_printf (print->printer, "%-*creferences    : %zu\n", indent, ' ', obj->refs);
     519    rtems_printf (print->printer, "%-*ctrampolines   : %zu\n", indent, ' ',
     520                  rtems_rtl_obj_trampolines (obj));
    518521    rtems_printf (print->printer, "%-*csymbols       : %zi\n", indent, ' ', obj->global_syms);
    519522    rtems_printf (print->printer, "%-*csymbol memory : %zi\n", indent, ' ', obj->global_size);
     
    536539      rtems_printf (print->printer, "\n");
    537540  }
     541  if (print->trampolines)
     542  {
     543    if (obj->tramp_size == 0)
     544    {
     545      rtems_printf (print->printer, "%-*ctrampolines: not supported\n", indent, ' ');
     546    }
     547    else
     548    {
     549      size_t slots = rtems_rtl_obj_trampoline_slots (obj);
     550      size_t used = rtems_rtl_obj_trampolines (obj);
     551      rtems_printf (print->printer, "%-*ctrampolines:\n", indent, ' ');
     552      rtems_printf (print->printer, "%-*cslots     : %zu\n", indent + 4, ' ',
     553                    slots);
     554      rtems_printf (print->printer, "%-*csize      : %zu\n", indent + 4, ' ',
     555                    obj->tramps_size);
     556      rtems_printf (print->printer, "%-*cslot size : %zu\n", indent + 4, ' ',
     557                    obj->tramp_size);
     558      rtems_printf (print->printer, "%-*cused      : %zu\n", indent + 4, ' ',
     559                    used);
     560      rtems_printf (print->printer, "%-*crelocs    : %zu\n", indent + 4, ' ',
     561                    obj->tramp_relocs);
     562      rtems_printf (print->printer, "%-*cunresolved: %zu\n", indent + 4, ' ',
     563                    slots - obj->tramp_relocs);
     564      rtems_printf (print->printer, "%-*cyield     : %zu%%\n", indent + 4, ' ',
     565                    slots ? (used * 100) / slots : 0);
     566    }
     567  }
    538568  return true;
    539569}
     
    568598{
    569599  rtems_rtl_obj_print print = { 0 };
    570   if (!rtems_rtl_check_opts (printer, "nlmsdb", argc, argv))
     600  if (!rtems_rtl_check_opts (printer, "anlmsdbt", argc, argv))
    571601    return 1;
    572602  print.printer = printer;
    573603  print.indent = 1;
    574604  print.oname = true;
    575   print.names = rtems_rtl_parse_opt ('n', argc, argv);
    576   print.stats = rtems_rtl_parse_opt ('l', argc, argv);;
    577   print.memory_map = rtems_rtl_parse_opt ('m', argc, argv);;
    578   print.symbols = rtems_rtl_parse_opt ('s', argc, argv);
    579   print.dependencies = rtems_rtl_parse_opt ('d', argc, argv);;
    580   print.base = rtems_rtl_parse_opt ('b', argc, argv);;
    581   print.re_name = rtems_rtl_parse_arg (' ', NULL, argc, argv);
     605  if (rtems_rtl_parse_opt ('a', argc, argv))
     606  {
     607    print.names = true;
     608    print.stats = true;
     609    print.memory_map = true;
     610    print.symbols = true;
     611    print.dependencies = true;
     612    print.trampolines = true;
     613  }
     614  else
     615  {
     616    print.names = rtems_rtl_parse_opt ('n', argc, argv);
     617    print.stats = rtems_rtl_parse_opt ('l', argc, argv);;
     618    print.memory_map = rtems_rtl_parse_opt ('m', argc, argv);;
     619    print.symbols = rtems_rtl_parse_opt ('s', argc, argv);
     620    print.dependencies = rtems_rtl_parse_opt ('d', argc, argv);;
     621    print.trampolines = rtems_rtl_parse_opt ('t', argc, argv);;
     622    print.base = rtems_rtl_parse_opt ('b', argc, argv);;
     623    print.re_name = rtems_rtl_parse_arg (' ', NULL, argc, argv);
     624  }
    582625  print.re_symbol = NULL;
    583626  print.rtl = rtems_rtl_lock ();
Note: See TracChangeset for help on using the changeset viewer.