[rtems commit] libtest/dl09: Test trampolines only when supported
Chris Johns
chrisj at rtems.org
Tue May 5 22:50:52 UTC 2020
Module: rtems
Branch: master
Commit: e78c0806cbbf0c9fae5c8c355ea81636b704f908
Changeset: http://git.rtems.org/rtems/commit/?id=e78c0806cbbf0c9fae5c8c355ea81636b704f908
Author: Chris Johns <chrisj at rtems.org>
Date: Wed May 6 08:46:57 2020 +1000
libtest/dl09: Test trampolines only when supported
---
testsuites/libtests/dl09/dl-load.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/testsuites/libtests/dl09/dl-load.c b/testsuites/libtests/dl09/dl-load.c
index ab9a0df..9b03a37 100644
--- a/testsuites/libtests/dl09/dl-load.c
+++ b/testsuites/libtests/dl09/dl-load.c
@@ -165,17 +165,33 @@ static void dl_object_close (objects* o)
free (o->space);
}
+/*
+ * Private architecture back end call.
+ */
+extern size_t rtems_rtl_elf_relocate_tramp_max_size (void);
+static size_t dl_alloc_size (void)
+{
+ /*
+ * If the max tramp size is 0 there is no tramp support, so
+ * return 0.
+ */
+ if (rtems_rtl_elf_relocate_tramp_max_size () == 0)
+ return 0;
+ return MBYTES(32);
+}
+
int dl_load_test(void)
{
- object_def od[5] = { { "/dl09-o1.o", true, MBYTES(32) },
- { "/dl09-o2.o", true, MBYTES(32) },
- { "/dl09-o3.o", true, MBYTES(32) },
- { "/dl09-o4.o", true, MBYTES(32) },
+ object_def od[5] = { { "/dl09-o1.o", true, dl_alloc_size () },
+ { "/dl09-o2.o", true, dl_alloc_size () },
+ { "/dl09-o3.o", true, dl_alloc_size () },
+ { "/dl09-o4.o", true, dl_alloc_size () },
{ "/dl09-o5.o", false, 0 } };
objects o[5] = { 0 };
size_t i;
printf ("Test source (link in strstr): %s\n", dl_localise_file (__FILE__));
+ printf ("Allocation size: %zu\n", dl_alloc_size ());
#if DL09_DEBUG_TRACE
rtems_rtl_trace_set_mask (DL09_DEBUG_TRACE);
More information about the vc
mailing list