summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-01-22 08:48:19 +1100
committerChris Johns <chrisj@rtems.org>2019-02-09 10:06:34 +1100
commit194eb403c39f5ad346e63dc3352e29570857fd93 (patch)
tree3ef4976810a6e4545a0d4c68138c270ed3abd22c /testsuites
parentlibdl: Add support for trampolines (diff)
downloadrtems-194eb403c39f5ad346e63dc3352e29570857fd93.tar.bz2
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
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/Makefile.am15
-rw-r--r--testsuites/libtests/dl08/dl-load.c4
-rw-r--r--testsuites/libtests/dl09/dl-load.c10
-rw-r--r--testsuites/libtests/dl09/dl-o5.c1
4 files changed, 21 insertions, 9 deletions
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index 22cf613dd3..166f45e21b 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -576,16 +576,19 @@ dl08-o5.o: dl08/dl-o5.c Makefile
$(AM_V_CC)$(COMPILE) -c -o $@ $<
dl08-o6-123456789-123456789.o: dl08/dl-o6-123456789-123456789.c Makefile
$(AM_V_CC)$(COMPILE) -c -o $@ $<
-# echo "#" > etc/rtl-libs.conf
-# echo " # blah blah" >> etc/rtl-libs.conf
-etc/rtl-libs.conf:
+etc/libdl.conf:
mkdir etc; \
- echo "/libdl08*.a" >> etc/rtl-libs.conf
+ echo "#" > etc/libdl.conf
+ echo " # blah blah" >> etc/libdl.conf
+ echo "/libdl08*.a" >> etc/libdl.conf
+ echo "" >> etc/libdl.conf
+ echo "x" >> etc/libdl.conf
+ echo "" >> etc/libdl.conf
noinst_LIBRARIES = libdl08_1.a libdl08_2.a
libdl08_1_a_SOURCES = dl08-o2.c dl08-o4.c
libdl08_2_a_SOURCES = dl08-o3.c dl08-o5.c \
dl08-o6-123456789-123456789.c
-dl08.tar: etc/rtl-libs.conf dl08-o1.o libdl08_1.a libdl08_2.a
+dl08.tar: etc/libdl.conf dl08-o1.o libdl08_1.a libdl08_2.a
@rm -f $@
$(AM_V_GEN)$(PAX) -w -f $@ $+
dl08-tar.c: dl08.tar
@@ -601,7 +604,7 @@ dl08$(EXEEXT): $(dl08_OBJECTS) $(dl08_DEPENDENCIES) dl08-sym.o
$(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+
CLEANFILES += dl08.pre dl08-sym.o libdl08_1.a libdl08_2.a dl08-o1.o dl08-o2.o \
dl08-o3.o dl08-o4.o dl08-o5.o dl08-o6-123456789-123456789.o \
- dl08.tar dl08-tar.h etc/rtl-libs.conf
+ dl08.tar dl08-tar.h etc/libdl.conf
endif
endif
diff --git a/testsuites/libtests/dl08/dl-load.c b/testsuites/libtests/dl08/dl-load.c
index 6f4c6f3fa4..44330e8f9d 100644
--- a/testsuites/libtests/dl08/dl-load.c
+++ b/testsuites/libtests/dl08/dl-load.c
@@ -15,11 +15,13 @@
RTEMS_RTL_TRACE_UNLOAD | \
RTEMS_RTL_TRACE_SYMBOL | \
RTEMS_RTL_TRACE_RELOC | \
+ RTEMS_RTL_TRACE_LOAD_SECT | \
RTEMS_RTL_TRACE_ALLOCATOR | \
RTEMS_RTL_TRACE_UNRESOLVED | \
RTEMS_RTL_TRACE_ARCHIVES | \
RTEMS_RTL_TRACE_DEPENDENCY)
- #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */
+ /* RTEMS_RTL_TRACE_ALL */
+ #define DL_DEBUG_TRACE DEBUG_TRACE
#define DL_RTL_CMDS 1
#else
#define DL_DEBUG_TRACE 0
diff --git a/testsuites/libtests/dl09/dl-load.c b/testsuites/libtests/dl09/dl-load.c
index ee0ef0a335..160f8157d9 100644
--- a/testsuites/libtests/dl09/dl-load.c
+++ b/testsuites/libtests/dl09/dl-load.c
@@ -99,7 +99,7 @@ static void dl_check_resolved(void* handle, bool has_unresolved)
handle, unresolved != 0 ? "" : "no ");
}
-static void* dl_load_obj(const char* name, bool has_unresolved)
+static void* dl_load_obj (const char* name, bool has_unresolved)
{
void* handle;
@@ -184,11 +184,17 @@ int dl_load_test(void)
dl_load_dump ();
+ /*
+ * Check for any resolved externals.
+ */
+ printf ("Check is any unresolved externals exist:\n");
+ dl_check_resolved (RTLD_SELF, false);
+
printf ("Running rtems_main_o1:\n");
if (dl_call (o[0].handle, "rtems_main_o1"))
return 1;
- for (i = 0; i < NUMOF(od); ++i)
+ for (i = 0; i < NUMOF (od); ++i)
dl_object_close (&o[i]);
return 0;
diff --git a/testsuites/libtests/dl09/dl-o5.c b/testsuites/libtests/dl09/dl-o5.c
index 84e8c84173..fc02e19272 100644
--- a/testsuites/libtests/dl09/dl-o5.c
+++ b/testsuites/libtests/dl09/dl-o5.c
@@ -7,6 +7,7 @@
*/
#include "dl-load.h"
+#include "dl-o4.h"
#include "dl-o5.h"
#include <inttypes.h>