libdl: Add support for large memory programs

- Add trampolines to support relocs that are out of range on
  support architectures.

- Support not loading separate text/data sections in an object
  file if the symbol provided in the section is a duplicate.
  A base image may have pulled in part of an object and another
  part needs to be dynamically loaded.

- Refactor the unresolved handling to scale to hundreds of
  unresolved symbols when loading large number of files.

Updates #3685
This commit is contained in:
Chris Johns
2019-01-22 08:48:19 +11:00
parent d8c70ba65b
commit 194eb403c3
16 changed files with 687 additions and 460 deletions

View File

@@ -128,17 +128,6 @@ typedef struct
bool base; /**< Include the base object file. */
} rtems_rtl_obj_print;
/**
* Return the different between 2 void*.
*/
static size_t
rtems_rtl_delta_voids (void* higher, void* lower)
{
char* ch = higher;
char* cl = lower;
return ch - cl;
}
/**
* Parse an argument.
*/
@@ -235,11 +224,11 @@ rtems_rtl_obj_printer (rtems_rtl_obj_print* print, rtems_rtl_obj* obj)
{
printf ("%-*cexec size : %zi\n", print->indent, ' ', obj->exec_size);
printf ("%-*ctext base : %p (%zi)\n", print->indent, ' ',
obj->text_base, rtems_rtl_delta_voids (obj->const_base, obj->text_base));
obj->text_base, obj->text_size);
printf ("%-*cconst base : %p (%zi)\n", print->indent, ' ',
obj->const_base, rtems_rtl_delta_voids (obj->data_base, obj->const_base));
obj->const_base, obj->const_size);
printf ("%-*cdata base : %p (%zi)\n", print->indent, ' ',
obj->data_base, rtems_rtl_delta_voids (obj->bss_base, obj->data_base));
obj->data_base, obj->data_size);
printf ("%-*cbss base : %p (%zi)\n", print->indent, ' ',
obj->bss_base, obj->bss_size);
}