From 4a056523cf7f721d674e4898e434184128d3d9f4 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 25 Nov 2019 15:33:24 +0100 Subject: libtests/dl*: Rename source files Rename source files to use a %.c -> %.o and %.cc -> %.o pattern. Use *.cc for C++ source files instead of *.cpp to be in line with other C++ source files. Update #3818. --- testsuites/libtests/Makefile.am | 58 ++++++++--------- testsuites/libtests/dl01/dl-o1.c | 30 --------- testsuites/libtests/dl01/dl01-o1.c | 30 +++++++++ testsuites/libtests/dl02/dl-o1.c | 75 ---------------------- testsuites/libtests/dl02/dl-o2.c | 37 ----------- testsuites/libtests/dl02/dl02-o1.c | 75 ++++++++++++++++++++++ testsuites/libtests/dl02/dl02-o2.c | 37 +++++++++++ testsuites/libtests/dl04/dl-cpp.cc | 4 ++ testsuites/libtests/dl04/dl-cpp.cpp | 4 -- testsuites/libtests/dl04/dl-o4.cpp | 30 --------- testsuites/libtests/dl04/dl04-o4.cc | 30 +++++++++ testsuites/libtests/dl05/dl-cpp.cc | 30 +++++++++ testsuites/libtests/dl05/dl-cpp.cpp | 30 --------- testsuites/libtests/dl05/dl-o5.cpp | 33 ---------- testsuites/libtests/dl05/dl05-o5.cc | 33 ++++++++++ testsuites/libtests/dl07/dl-o1.c | 56 ---------------- testsuites/libtests/dl07/dl-o2.c | 51 --------------- testsuites/libtests/dl07/dl-o3.c | 59 ----------------- testsuites/libtests/dl07/dl-o4.c | 53 --------------- testsuites/libtests/dl07/dl-o5.c | 52 --------------- testsuites/libtests/dl07/dl07-o1.c | 56 ++++++++++++++++ testsuites/libtests/dl07/dl07-o2.c | 51 +++++++++++++++ testsuites/libtests/dl07/dl07-o3.c | 59 +++++++++++++++++ testsuites/libtests/dl07/dl07-o4.c | 53 +++++++++++++++ testsuites/libtests/dl07/dl07-o5.c | 52 +++++++++++++++ testsuites/libtests/dl08/dl-o1.c | 61 ------------------ testsuites/libtests/dl08/dl-o2.c | 39 ----------- testsuites/libtests/dl08/dl-o3.c | 40 ------------ testsuites/libtests/dl08/dl-o4.c | 40 ------------ testsuites/libtests/dl08/dl-o5.c | 39 ----------- .../libtests/dl08/dl-o6-123456789-123456789.c | 50 --------------- testsuites/libtests/dl08/dl08-o1.c | 61 ++++++++++++++++++ testsuites/libtests/dl08/dl08-o2.c | 39 +++++++++++ testsuites/libtests/dl08/dl08-o3.c | 40 ++++++++++++ testsuites/libtests/dl08/dl08-o4.c | 40 ++++++++++++ testsuites/libtests/dl08/dl08-o5.c | 39 +++++++++++ .../libtests/dl08/dl08-o6-123456789-123456789.c | 50 +++++++++++++++ testsuites/libtests/dl09/dl-o1.c | 63 ------------------ testsuites/libtests/dl09/dl-o2.c | 40 ------------ testsuites/libtests/dl09/dl-o3.c | 41 ------------ testsuites/libtests/dl09/dl-o4.c | 41 ------------ testsuites/libtests/dl09/dl-o5.c | 38 ----------- testsuites/libtests/dl09/dl09-o1.c | 63 ++++++++++++++++++ testsuites/libtests/dl09/dl09-o2.c | 40 ++++++++++++ testsuites/libtests/dl09/dl09-o3.c | 41 ++++++++++++ testsuites/libtests/dl09/dl09-o4.c | 41 ++++++++++++ testsuites/libtests/dl09/dl09-o5.c | 38 +++++++++++ testsuites/libtests/dl10/dl-o1.c | 61 ------------------ testsuites/libtests/dl10/dl-o2.c | 39 ----------- testsuites/libtests/dl10/dl-o3.c | 40 ------------ testsuites/libtests/dl10/dl-o4.c | 40 ------------ testsuites/libtests/dl10/dl-o5.c | 36 ----------- testsuites/libtests/dl10/dl-o6.c | 18 ------ testsuites/libtests/dl10/dl10-o1.c | 61 ++++++++++++++++++ testsuites/libtests/dl10/dl10-o2.c | 39 +++++++++++ testsuites/libtests/dl10/dl10-o3.c | 40 ++++++++++++ testsuites/libtests/dl10/dl10-o4.c | 40 ++++++++++++ testsuites/libtests/dl10/dl10-o5.c | 36 +++++++++++ testsuites/libtests/dl10/dl10-o6.c | 18 ++++++ 59 files changed, 1265 insertions(+), 1265 deletions(-) delete mode 100644 testsuites/libtests/dl01/dl-o1.c create mode 100644 testsuites/libtests/dl01/dl01-o1.c delete mode 100644 testsuites/libtests/dl02/dl-o1.c delete mode 100644 testsuites/libtests/dl02/dl-o2.c create mode 100644 testsuites/libtests/dl02/dl02-o1.c create mode 100644 testsuites/libtests/dl02/dl02-o2.c create mode 100644 testsuites/libtests/dl04/dl-cpp.cc delete mode 100644 testsuites/libtests/dl04/dl-cpp.cpp delete mode 100644 testsuites/libtests/dl04/dl-o4.cpp create mode 100644 testsuites/libtests/dl04/dl04-o4.cc create mode 100644 testsuites/libtests/dl05/dl-cpp.cc delete mode 100644 testsuites/libtests/dl05/dl-cpp.cpp delete mode 100644 testsuites/libtests/dl05/dl-o5.cpp create mode 100644 testsuites/libtests/dl05/dl05-o5.cc delete mode 100644 testsuites/libtests/dl07/dl-o1.c delete mode 100644 testsuites/libtests/dl07/dl-o2.c delete mode 100644 testsuites/libtests/dl07/dl-o3.c delete mode 100644 testsuites/libtests/dl07/dl-o4.c delete mode 100644 testsuites/libtests/dl07/dl-o5.c create mode 100644 testsuites/libtests/dl07/dl07-o1.c create mode 100644 testsuites/libtests/dl07/dl07-o2.c create mode 100644 testsuites/libtests/dl07/dl07-o3.c create mode 100644 testsuites/libtests/dl07/dl07-o4.c create mode 100644 testsuites/libtests/dl07/dl07-o5.c delete mode 100644 testsuites/libtests/dl08/dl-o1.c delete mode 100644 testsuites/libtests/dl08/dl-o2.c delete mode 100644 testsuites/libtests/dl08/dl-o3.c delete mode 100644 testsuites/libtests/dl08/dl-o4.c delete mode 100644 testsuites/libtests/dl08/dl-o5.c delete mode 100644 testsuites/libtests/dl08/dl-o6-123456789-123456789.c create mode 100644 testsuites/libtests/dl08/dl08-o1.c create mode 100644 testsuites/libtests/dl08/dl08-o2.c create mode 100644 testsuites/libtests/dl08/dl08-o3.c create mode 100644 testsuites/libtests/dl08/dl08-o4.c create mode 100644 testsuites/libtests/dl08/dl08-o5.c create mode 100644 testsuites/libtests/dl08/dl08-o6-123456789-123456789.c delete mode 100644 testsuites/libtests/dl09/dl-o1.c delete mode 100644 testsuites/libtests/dl09/dl-o2.c delete mode 100644 testsuites/libtests/dl09/dl-o3.c delete mode 100644 testsuites/libtests/dl09/dl-o4.c delete mode 100644 testsuites/libtests/dl09/dl-o5.c create mode 100644 testsuites/libtests/dl09/dl09-o1.c create mode 100644 testsuites/libtests/dl09/dl09-o2.c create mode 100644 testsuites/libtests/dl09/dl09-o3.c create mode 100644 testsuites/libtests/dl09/dl09-o4.c create mode 100644 testsuites/libtests/dl09/dl09-o5.c delete mode 100644 testsuites/libtests/dl10/dl-o1.c delete mode 100644 testsuites/libtests/dl10/dl-o2.c delete mode 100644 testsuites/libtests/dl10/dl-o3.c delete mode 100644 testsuites/libtests/dl10/dl-o4.c delete mode 100644 testsuites/libtests/dl10/dl-o5.c delete mode 100644 testsuites/libtests/dl10/dl-o6.c create mode 100644 testsuites/libtests/dl10/dl10-o1.c create mode 100644 testsuites/libtests/dl10/dl10-o2.c create mode 100644 testsuites/libtests/dl10/dl10-o3.c create mode 100644 testsuites/libtests/dl10/dl10-o4.c create mode 100644 testsuites/libtests/dl10/dl10-o5.c create mode 100644 testsuites/libtests/dl10/dl10-o6.c diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index 889a8ad78f..9af8098062 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -329,7 +329,7 @@ dl01/init.c: dl01-tar.o dl01.pre: $(dl01_OBJECTS) $(dl01_DEPENDENCIES) @rm -f dl01.pre $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl01-o1.o: dl01/dl-o1.c Makefile +dl01-o1.o: dl01/dl01-o1.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< dl01.tar: dl01-o1.o @rm -f $@ @@ -360,9 +360,9 @@ dl02/init.c: dl02-tar.o dl02.pre: $(dl02_OBJECTS) $(dl02_DEPENDENCIES) @rm -f dl02.pre $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl02-o1.o: dl02/dl-o1.c Makefile +dl02-o1.o: dl02/dl02-o1.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl02-o2.o: dl02/dl-o2.c Makefile +dl02-o2.o: dl02/dl02-o2.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< dl02.tar: dl02-o1.o dl02-o2.o @rm -f $@ @@ -399,14 +399,14 @@ if TEST_dl04 lib_tests += dl04 lib_screens += dl04/dl04.scn lib_docs += dl04/dl04.doc -dl04_SOURCES = dl04/init.c dl04/dl-load.c dl04/dl-cpp.cpp dl04-tar.c \ +dl04_SOURCES = dl04/init.c dl04/dl-load.c dl04/dl-cpp.cc dl04-tar.c \ dl04-tar.h dl04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl04) $(support_includes) dl04/init.c: dl04-tar.o dl04.pre: $(dl04_OBJECTS) $(dl04_DEPENDENCIES) @rm -f dl04.pre $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl04-o4.o: dl04/dl-o4.cpp Makefile +dl04-o4.o: dl04/dl04-o4.cc Makefile $(AM_V_GEN)$(CXXCOMPILE) -c -o $@ $< dl04.tar: dl04-o4.o @rm -f $@ @@ -433,14 +433,14 @@ if TEST_dl05 lib_tests += dl05 lib_screens += dl05/dl05.scn lib_docs += dl05/dl05.doc -dl05_SOURCES = dl05/init.c dl05/dl-load.c dl05/dl-cpp.cpp dl05-tar.c \ +dl05_SOURCES = dl05/init.c dl05/dl-load.c dl05/dl-cpp.cc dl05-tar.c \ dl05-tar.h dl05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl05) $(support_includes) dl05/init.c: dl05-tar.o dl05.pre: $(dl05_OBJECTS) $(dl05_DEPENDENCIES) @rm -f dl05.pre dl05-sym.o $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl05-o5.o: dl05/dl-o5.cpp +dl05-o5.o: dl05/dl05-o5.cc $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< dl05.tar: dl05-o5.o @rm -f $@ @@ -522,15 +522,15 @@ dl07/init.c: dl07-tar.o dl07.pre: $(dl07_OBJECTS) $(dl07_DEPENDENCIES) @rm -f dl07.pre dl07-sym.o $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl07-o1.o: dl07/dl-o1.c Makefile +dl07-o1.o: dl07/dl07-o1.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o2.o: dl07/dl-o2.c Makefile +dl07-o2.o: dl07/dl07-o2.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o3.o: dl07/dl-o3.c Makefile +dl07-o3.o: dl07/dl07-o3.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o4.o: dl07/dl-o4.c Makefile +dl07-o4.o: dl07/dl07-o4.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o5.o: dl07/dl-o5.c Makefile +dl07-o5.o: dl07/dl07-o5.c Makefile $(AM_V_CC) $(COMPILE) -c -o $@ $< dl07.tar: dl07-o1.o dl07-o2.o dl07-o3.o dl07-o4.o dl07-o5.o @rm -f $@ @@ -562,17 +562,17 @@ dl08/init.c: dl08-tar.o dl08.pre: $(dl08_OBJECTS) $(dl08_DEPENDENCIES) @rm -f dl08.pre dl08-syms.o $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl08-o1.o: dl08/dl-o1.c Makefile +dl08-o1.o: dl08/dl08-o1.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o2.o: dl08/dl-o2.c Makefile +dl08-o2.o: dl08/dl08-o2.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o3.o: dl08/dl-o3.c Makefile +dl08-o3.o: dl08/dl08-o3.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o4.o: dl08/dl-o4.c Makefile +dl08-o4.o: dl08/dl08-o4.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o5.o: dl08/dl-o5.c Makefile +dl08-o5.o: dl08/dl08-o5.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o6-123456789-123456789.o: dl08/dl-o6-123456789-123456789.c Makefile +dl08-o6-123456789-123456789.o: dl08/dl08-o6-123456789-123456789.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< noinst_LIBRARIES = libdl08_1.a libdl08_2.a libdl08_1_a_SOURCES = dl08-o2.c dl08-o4.c @@ -609,15 +609,15 @@ dl09/init.c: dl09-tar.o dl09.pre: $(dl09_OBJECTS) $(dl09_DEPENDENCIES) @rm -f dl09.pre dl09-syms.o $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl09-o1.o: dl09/dl-o1.c Makefile +dl09-o1.o: dl09/dl09-o1.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o2.o: dl09/dl-o2.c Makefile +dl09-o2.o: dl09/dl09-o2.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o3.o: dl09/dl-o3.c Makefile +dl09-o3.o: dl09/dl09-o3.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o4.o: dl09/dl-o4.c Makefile +dl09-o4.o: dl09/dl09-o4.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o5.o: dl09/dl-o5.c Makefile +dl09-o5.o: dl09/dl09-o5.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< dl09.tar: dl09-o1.o dl09-o2.o dl09-o3.o dl09-o4.o dl09-o5.o @rm -f $@ @@ -649,17 +649,17 @@ dl10/init.c: dl10-tar.o dl10.pre: $(dl10_OBJECTS) $(dl10_DEPENDENCIES) @rm -f dl10.pre dl10-syms.o $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl10-o1.o: dl10/dl-o1.c Makefile +dl10-o1.o: dl10/dl10-o1.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o2.o: dl10/dl-o2.c Makefile +dl10-o2.o: dl10/dl10-o2.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o3.o: dl10/dl-o3.c Makefile +dl10-o3.o: dl10/dl10-o3.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o4.o: dl10/dl-o4.c Makefile +dl10-o4.o: dl10/dl10-o4.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o5.o: dl10/dl-o5.c Makefile +dl10-o5.o: dl10/dl10-o5.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o6.o: dl10/dl-o6.c Makefile +dl10-o6.o: dl10/dl10-o6.c Makefile $(AM_V_CC)$(COMPILE) -c -o $@ $< noinst_LIBRARIES = libdl10_1.a libdl10_2.a libdl10_1_a_SOURCES = dl10-o2.c dl10-o4.c diff --git a/testsuites/libtests/dl01/dl-o1.c b/testsuites/libtests/dl01/dl-o1.c deleted file mode 100644 index a47beb1d51..0000000000 --- a/testsuites/libtests/dl01/dl-o1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -/** - * Hello World as a loadable module. - */ - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main (int argc, char* argv[]); - -int rtems_main (int argc, char* argv[]) -{ - int arg; - printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); - for (arg = 0; arg < argc; ++arg) - printf(" %d: %s\n", arg, argv[arg]); - return argc; -} diff --git a/testsuites/libtests/dl01/dl01-o1.c b/testsuites/libtests/dl01/dl01-o1.c new file mode 100644 index 0000000000..a47beb1d51 --- /dev/null +++ b/testsuites/libtests/dl01/dl01-o1.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +/** + * Hello World as a loadable module. + */ + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main (int argc, char* argv[]); + +int rtems_main (int argc, char* argv[]) +{ + int arg; + printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); + for (arg = 0; arg < argc; ++arg) + printf(" %d: %s\n", arg, argv[arg]); + return argc; +} diff --git a/testsuites/libtests/dl02/dl-o1.c b/testsuites/libtests/dl02/dl-o1.c deleted file mode 100644 index 2afb618800..0000000000 --- a/testsuites/libtests/dl02/dl-o1.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-o2.h" - -#include - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -typedef int (*func1_t)(int argc, const char* argv[]); - -static void* find_sym(const char* name) -{ - void* sym = dlsym(RTLD_DEFAULT, name); - if (sym == NULL) - printf("dlsym failed: not found: %s\n", name); - return sym; -} - -static int dl_o1_callback(const char* message, int count) -{ - printf("dl_o1_callback: %s\n", message); - return count + 1; -} - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main (int argc, const char* argv[]); - -#define PDOUBLE(_d) ((int) (_d)), (int) ((_d) * 100.0) % 100 - -int rtems_main (int argc, const char* argv[]) -{ - func1_t f1; - double f2_ret; - int arg; - int ret; - - printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); - for (arg = 0; arg < argc; ++arg) - printf(" %d: %s\n", arg, argv[arg]); - - f1 = find_sym ("dl_o2_func1"); - if (f1 == NULL) - return 0; - - if (f1 (argc, argv) != argc) - { - printf("rtems_main: dl_o2_func1 returned bad value\n"); - return 0; - } - - f2_ret = dl_o2_func2 (7.1, 33.0); - printf("rtems_main: dl_o2_func2 returned: %d.%02d\n", - PDOUBLE(f2_ret)); - if (f2_ret != (7.1 * 33.0)) - { - printf("rtems_main: dl_o2_func2 returned a bad\n"); - return 0; - } - - ret = dl_o2_func3 (dl_o1_callback, 1); - printf ("rtems_main: callback count: %d\n", ret); - - return argc; -} diff --git a/testsuites/libtests/dl02/dl-o2.c b/testsuites/libtests/dl02/dl-o2.c deleted file mode 100644 index 507333535b..0000000000 --- a/testsuites/libtests/dl02/dl-o2.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-o2.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__) - -int dl_o2_func1 (int argc, char* argv[]) -{ - int arg; - printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); - for (arg = 0; arg < argc; ++arg) - printf(" %d: %s\n", arg, argv[arg]); - return argc; -} - -#define PDOUBLE(_d) ((int) (_d)), (int) (((_d) + 0.005) * 100.0) % 100 - -double dl_o2_func2 (double d1, double d2) -{ - double ret = d1 * d2; - printf("dl_o2_func2: d1=%d.%02d d2=%d.%d ret=%d.%02d\n", - PDOUBLE(d1), PDOUBLE(d2), PDOUBLE(ret)); - return ret; -} - -int dl_o2_func3 (dl_o2_call_t callback, int count) -{ - return callback ("string in dl_o2", count + 1); -} diff --git a/testsuites/libtests/dl02/dl02-o1.c b/testsuites/libtests/dl02/dl02-o1.c new file mode 100644 index 0000000000..2afb618800 --- /dev/null +++ b/testsuites/libtests/dl02/dl02-o1.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-o2.h" + +#include + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +typedef int (*func1_t)(int argc, const char* argv[]); + +static void* find_sym(const char* name) +{ + void* sym = dlsym(RTLD_DEFAULT, name); + if (sym == NULL) + printf("dlsym failed: not found: %s\n", name); + return sym; +} + +static int dl_o1_callback(const char* message, int count) +{ + printf("dl_o1_callback: %s\n", message); + return count + 1; +} + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main (int argc, const char* argv[]); + +#define PDOUBLE(_d) ((int) (_d)), (int) ((_d) * 100.0) % 100 + +int rtems_main (int argc, const char* argv[]) +{ + func1_t f1; + double f2_ret; + int arg; + int ret; + + printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); + for (arg = 0; arg < argc; ++arg) + printf(" %d: %s\n", arg, argv[arg]); + + f1 = find_sym ("dl_o2_func1"); + if (f1 == NULL) + return 0; + + if (f1 (argc, argv) != argc) + { + printf("rtems_main: dl_o2_func1 returned bad value\n"); + return 0; + } + + f2_ret = dl_o2_func2 (7.1, 33.0); + printf("rtems_main: dl_o2_func2 returned: %d.%02d\n", + PDOUBLE(f2_ret)); + if (f2_ret != (7.1 * 33.0)) + { + printf("rtems_main: dl_o2_func2 returned a bad\n"); + return 0; + } + + ret = dl_o2_func3 (dl_o1_callback, 1); + printf ("rtems_main: callback count: %d\n", ret); + + return argc; +} diff --git a/testsuites/libtests/dl02/dl02-o2.c b/testsuites/libtests/dl02/dl02-o2.c new file mode 100644 index 0000000000..507333535b --- /dev/null +++ b/testsuites/libtests/dl02/dl02-o2.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-o2.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__) + +int dl_o2_func1 (int argc, char* argv[]) +{ + int arg; + printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); + for (arg = 0; arg < argc; ++arg) + printf(" %d: %s\n", arg, argv[arg]); + return argc; +} + +#define PDOUBLE(_d) ((int) (_d)), (int) (((_d) + 0.005) * 100.0) % 100 + +double dl_o2_func2 (double d1, double d2) +{ + double ret = d1 * d2; + printf("dl_o2_func2: d1=%d.%02d d2=%d.%d ret=%d.%02d\n", + PDOUBLE(d1), PDOUBLE(d2), PDOUBLE(ret)); + return ret; +} + +int dl_o2_func3 (dl_o2_call_t callback, int count) +{ + return callback ("string in dl_o2", count + 1); +} diff --git a/testsuites/libtests/dl04/dl-cpp.cc b/testsuites/libtests/dl04/dl-cpp.cc new file mode 100644 index 0000000000..454de9004b --- /dev/null +++ b/testsuites/libtests/dl04/dl-cpp.cc @@ -0,0 +1,4 @@ +/* empty file to trick automake. */ +class empty +{ +}; diff --git a/testsuites/libtests/dl04/dl-cpp.cpp b/testsuites/libtests/dl04/dl-cpp.cpp deleted file mode 100644 index 454de9004b..0000000000 --- a/testsuites/libtests/dl04/dl-cpp.cpp +++ /dev/null @@ -1,4 +0,0 @@ -/* empty file to trick automake. */ -class empty -{ -}; diff --git a/testsuites/libtests/dl04/dl-o4.cpp b/testsuites/libtests/dl04/dl-o4.cpp deleted file mode 100644 index e63afe385f..0000000000 --- a/testsuites/libtests/dl04/dl-o4.cpp +++ /dev/null @@ -1,30 +0,0 @@ -class Foo { -public: - Foo() {}; - ~Foo() {}; - - virtual void f1() {}; - virtual void f2() {}; - virtual void f3() {}; - virtual void f4() {}; - virtual void f5() {}; - virtual void f6() {}; - virtual void f7() {}; -}; - -class Bar : public Foo { -}; - -void baz(void) -{ - Bar b; - - b.f1(); -} - -extern "C" { - void func(void) - { - baz(); - } -} diff --git a/testsuites/libtests/dl04/dl04-o4.cc b/testsuites/libtests/dl04/dl04-o4.cc new file mode 100644 index 0000000000..e63afe385f --- /dev/null +++ b/testsuites/libtests/dl04/dl04-o4.cc @@ -0,0 +1,30 @@ +class Foo { +public: + Foo() {}; + ~Foo() {}; + + virtual void f1() {}; + virtual void f2() {}; + virtual void f3() {}; + virtual void f4() {}; + virtual void f5() {}; + virtual void f6() {}; + virtual void f7() {}; +}; + +class Bar : public Foo { +}; + +void baz(void) +{ + Bar b; + + b.f1(); +} + +extern "C" { + void func(void) + { + baz(); + } +} diff --git a/testsuites/libtests/dl05/dl-cpp.cc b/testsuites/libtests/dl05/dl-cpp.cc new file mode 100644 index 0000000000..0e2005713e --- /dev/null +++ b/testsuites/libtests/dl05/dl-cpp.cc @@ -0,0 +1,30 @@ +/* + * The base image needs this to include the RTTI data. + */ +#include +#include +#include "dl-load.h" +void exception_base(bool throw_runtime) +{ + printf("%s: begin\n", __func__); + try + { + if (throw_runtime) + throw std::runtime_error("eb: throw std::runtime_error"); + else + throw dl_test_throw_me("eb: throw me"); + } + catch (std::exception const& e) + { + printf("%s: caught: %s\n", __func__, e.what()); + } + catch (dl_test_throw_me const& e) + { + printf("%s: caught: %s\n", __func__, e.what()); + } + catch (...) + { + printf("%s: caught: unknown\n", __func__); + } + printf("%s: end\n", __func__); +} diff --git a/testsuites/libtests/dl05/dl-cpp.cpp b/testsuites/libtests/dl05/dl-cpp.cpp deleted file mode 100644 index 0e2005713e..0000000000 --- a/testsuites/libtests/dl05/dl-cpp.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The base image needs this to include the RTTI data. - */ -#include -#include -#include "dl-load.h" -void exception_base(bool throw_runtime) -{ - printf("%s: begin\n", __func__); - try - { - if (throw_runtime) - throw std::runtime_error("eb: throw std::runtime_error"); - else - throw dl_test_throw_me("eb: throw me"); - } - catch (std::exception const& e) - { - printf("%s: caught: %s\n", __func__, e.what()); - } - catch (dl_test_throw_me const& e) - { - printf("%s: caught: %s\n", __func__, e.what()); - } - catch (...) - { - printf("%s: caught: unknown\n", __func__); - } - printf("%s: end\n", __func__); -} diff --git a/testsuites/libtests/dl05/dl-o5.cpp b/testsuites/libtests/dl05/dl-o5.cpp deleted file mode 100644 index b70790ea7b..0000000000 --- a/testsuites/libtests/dl05/dl-o5.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "dl-load.h" /* make the symbol a C linkage */ - -#include - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -void exception_dl(bool throw_runtime) -{ - printf("exception_dl: begin\n"); - try - { - printf("exception_dl: throwing...\n"); - if (throw_runtime) - throw std::runtime_error("throw std::runtime_error object"); - else - throw dl_test_throw_me("throw dl_test_throw_me object"); - } - catch (dl_test_throw_me const& e) - { - printf("%s: caught: %s\n", __func__, e.what()); - } - catch (std::exception const& e) - { - printf("%s: caught: %s\n", __func__, e.what()); - } - catch (...) - { - printf("%s: caught: unknown\n", __func__); - } - printf("exception_dl: end\n"); -} diff --git a/testsuites/libtests/dl05/dl05-o5.cc b/testsuites/libtests/dl05/dl05-o5.cc new file mode 100644 index 0000000000..b70790ea7b --- /dev/null +++ b/testsuites/libtests/dl05/dl05-o5.cc @@ -0,0 +1,33 @@ +#include "dl-load.h" /* make the symbol a C linkage */ + +#include + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +void exception_dl(bool throw_runtime) +{ + printf("exception_dl: begin\n"); + try + { + printf("exception_dl: throwing...\n"); + if (throw_runtime) + throw std::runtime_error("throw std::runtime_error object"); + else + throw dl_test_throw_me("throw dl_test_throw_me object"); + } + catch (dl_test_throw_me const& e) + { + printf("%s: caught: %s\n", __func__, e.what()); + } + catch (std::exception const& e) + { + printf("%s: caught: %s\n", __func__, e.what()); + } + catch (...) + { + printf("%s: caught: unknown\n", __func__); + } + printf("exception_dl: end\n"); +} diff --git a/testsuites/libtests/dl07/dl-o1.c b/testsuites/libtests/dl07/dl-o1.c deleted file mode 100644 index e3a9cec6cf..0000000000 --- a/testsuites/libtests/dl07/dl-o1.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2018 Chris Johns . - * All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-o1.h" - -#include -#include "dl-load.h" - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -/* - * Create some symbols. The uninitialised will be in the common section with - * separated text and data and this means there is no actual section in the ELF - * file, the details for this are in the symbols. - */ -int dl01_bss1; /* unitialised, .bss */ -float dl01_bss2[30]; /* unitialised, .bss */ -char dl01_bss3[10]; /* unitialised, .bss */ -int dl01_data1 = 1; /* initialised, .data */ -float dl01_data2 = 0.3333; /* initialised, .data */ -const int dl01_const1 = 3; /* read-only, .const */ -const float dl01_const2 = 0.666; /* read-only, .const */ -int dl01_func1(void) /* code, .text */ -{ - return 4; -} - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o1 (void); - -#define DL_NAME "dlo1" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o1 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - return 0; -} diff --git a/testsuites/libtests/dl07/dl-o2.c b/testsuites/libtests/dl07/dl-o2.c deleted file mode 100644 index bbb493ef21..0000000000 --- a/testsuites/libtests/dl07/dl-o2.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o2.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl02_bss1; -float dl02_bss2[7]; -char dl02_bss3[21]; -int dl02_data1; -float dl02_data2; - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o2 (int argc, const char* argv[]); - -#define DL_NAME "dlo2" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o2 (int argc, const char* argv[]) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); - printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); - printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); - printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); - return 0; -} diff --git a/testsuites/libtests/dl07/dl-o3.c b/testsuites/libtests/dl07/dl-o3.c deleted file mode 100644 index c499f6cab7..0000000000 --- a/testsuites/libtests/dl07/dl-o3.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o2.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o3 (int argc, const char* argv[]); - -#define DL_NAME "dlo3" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o3 (int argc, const char* argv[]) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); - printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); - printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); - printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - return 0; -} diff --git a/testsuites/libtests/dl07/dl-o4.c b/testsuites/libtests/dl07/dl-o4.c deleted file mode 100644 index c9028ae808..0000000000 --- a/testsuites/libtests/dl07/dl-o4.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o4.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - - -int dl04_unresolv_1; -float dl04_unresolv_2; -char dl04_unresolv_3; -char* dl04_unresolv_4; -const int dl04_unresolv_5 = 4; -const char* dl04_unresolv_6 = "dl-O4"; - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o4 (int argc, const char* argv[]); - -#define DL_NAME "dlo4" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o4 (int argc, const char* argv[]) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - return 0; -} diff --git a/testsuites/libtests/dl07/dl-o5.c b/testsuites/libtests/dl07/dl-o5.c deleted file mode 100644 index fc56fd31a2..0000000000 --- a/testsuites/libtests/dl07/dl-o5.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - - -uint64_t dl05_unresolv_1; -uint16_t dl05_unresolv_2; -uint32_t dl05_unresolv_3; -uint8_t dl05_unresolv_4; -int64_t dl05_unresolv_5; - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o5 (int argc, const char* argv[]); - -#define DL_NAME "dlo5" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o5 (int argc, const char* argv[]) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - return 0; -} diff --git a/testsuites/libtests/dl07/dl07-o1.c b/testsuites/libtests/dl07/dl07-o1.c new file mode 100644 index 0000000000..e3a9cec6cf --- /dev/null +++ b/testsuites/libtests/dl07/dl07-o1.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018 Chris Johns . + * All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-o1.h" + +#include +#include "dl-load.h" + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +/* + * Create some symbols. The uninitialised will be in the common section with + * separated text and data and this means there is no actual section in the ELF + * file, the details for this are in the symbols. + */ +int dl01_bss1; /* unitialised, .bss */ +float dl01_bss2[30]; /* unitialised, .bss */ +char dl01_bss3[10]; /* unitialised, .bss */ +int dl01_data1 = 1; /* initialised, .data */ +float dl01_data2 = 0.3333; /* initialised, .data */ +const int dl01_const1 = 3; /* read-only, .const */ +const float dl01_const2 = 0.666; /* read-only, .const */ +int dl01_func1(void) /* code, .text */ +{ + return 4; +} + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o1 (void); + +#define DL_NAME "dlo1" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o1 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + return 0; +} diff --git a/testsuites/libtests/dl07/dl07-o2.c b/testsuites/libtests/dl07/dl07-o2.c new file mode 100644 index 0000000000..bbb493ef21 --- /dev/null +++ b/testsuites/libtests/dl07/dl07-o2.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o2.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl02_bss1; +float dl02_bss2[7]; +char dl02_bss3[21]; +int dl02_data1; +float dl02_data2; + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o2 (int argc, const char* argv[]); + +#define DL_NAME "dlo2" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o2 (int argc, const char* argv[]) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); + printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); + printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); + printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); + return 0; +} diff --git a/testsuites/libtests/dl07/dl07-o3.c b/testsuites/libtests/dl07/dl07-o3.c new file mode 100644 index 0000000000..c499f6cab7 --- /dev/null +++ b/testsuites/libtests/dl07/dl07-o3.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o2.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o3 (int argc, const char* argv[]); + +#define DL_NAME "dlo3" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o3 (int argc, const char* argv[]) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); + printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); + printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); + printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + return 0; +} diff --git a/testsuites/libtests/dl07/dl07-o4.c b/testsuites/libtests/dl07/dl07-o4.c new file mode 100644 index 0000000000..c9028ae808 --- /dev/null +++ b/testsuites/libtests/dl07/dl07-o4.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o4.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + + +int dl04_unresolv_1; +float dl04_unresolv_2; +char dl04_unresolv_3; +char* dl04_unresolv_4; +const int dl04_unresolv_5 = 4; +const char* dl04_unresolv_6 = "dl-O4"; + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o4 (int argc, const char* argv[]); + +#define DL_NAME "dlo4" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o4 (int argc, const char* argv[]) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + return 0; +} diff --git a/testsuites/libtests/dl07/dl07-o5.c b/testsuites/libtests/dl07/dl07-o5.c new file mode 100644 index 0000000000..fc56fd31a2 --- /dev/null +++ b/testsuites/libtests/dl07/dl07-o5.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + + +uint64_t dl05_unresolv_1; +uint16_t dl05_unresolv_2; +uint32_t dl05_unresolv_3; +uint8_t dl05_unresolv_4; +int64_t dl05_unresolv_5; + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o5 (int argc, const char* argv[]); + +#define DL_NAME "dlo5" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o5 (int argc, const char* argv[]) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + return 0; +} diff --git a/testsuites/libtests/dl08/dl-o1.c b/testsuites/libtests/dl08/dl-o1.c deleted file mode 100644 index e6173f3a78..0000000000 --- a/testsuites/libtests/dl08/dl-o1.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2018 Chris Johns . - * All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-o1.h" - -#include -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o2.h" - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -/* - * Create some symbols. The uninitialised will be in the common section with - * separated text and data and this means there is no actual section in the ELF - * file, the details for this are in the symbols. - */ -int dl01_bss1; /* unitialised, .bss */ -float dl01_bss2[30]; /* unitialised, .bss */ -char dl01_bss3[10]; /* unitialised, .bss */ -int dl01_data1 = 1; /* initialised, .data */ -float dl01_data2 = 0.3333; /* initialised, .data */ -const int dl01_const1 = 3; /* read-only, .const */ -const float dl01_const2 = 0.666; /* read-only, .const */ -int dl01_func1(void) /* code, .text */ -{ - return 4; -} - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o1 (void); - -#define DL_NAME "dlo1" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o1 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - - rtems_main_o2 (); - - return 0; -} diff --git a/testsuites/libtests/dl08/dl-o2.c b/testsuites/libtests/dl08/dl-o2.c deleted file mode 100644 index e58c8750e9..0000000000 --- a/testsuites/libtests/dl08/dl-o2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o2.h" -#include "dl-o3.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl02_bss1; -float dl02_bss2[7]; -char dl02_bss3[21]; -int dl02_data1; -float dl02_data2; - -#define DL_NAME "dlo2" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o2 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); - printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); - printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); - printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); - - rtems_main_o3 (); - - return 0; -} diff --git a/testsuites/libtests/dl08/dl-o3.c b/testsuites/libtests/dl08/dl-o3.c deleted file mode 100644 index c84b3d72ad..0000000000 --- a/testsuites/libtests/dl08/dl-o3.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o3.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -#define DL_NAME "dlo3" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o3 () -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - - rtems_main_o4 (); - - return 0; -} diff --git a/testsuites/libtests/dl08/dl-o4.c b/testsuites/libtests/dl08/dl-o4.c deleted file mode 100644 index 72dfbc6850..0000000000 --- a/testsuites/libtests/dl08/dl-o4.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl04_unresolv_1; -float dl04_unresolv_2; -char dl04_unresolv_3; -char* dl04_unresolv_4; -const int dl04_unresolv_5 = 4; -const char* dl04_unresolv_6 = "dl-O4"; - -#define DL_NAME "dlo4" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o4 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - - rtems_main_o5 (); - - return 0; -} diff --git a/testsuites/libtests/dl08/dl-o5.c b/testsuites/libtests/dl08/dl-o5.c deleted file mode 100644 index 9257a684d7..0000000000 --- a/testsuites/libtests/dl08/dl-o5.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o5.h" -#include "dl-o6.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -uint64_t dl05_unresolv_1; -uint16_t dl05_unresolv_2; -uint32_t dl05_unresolv_3; -uint8_t dl05_unresolv_4; -int64_t dl05_unresolv_5; - -#define DL_NAME "dlo5" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o5 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - - rtems_main_o6 (); - - return 0; -} diff --git a/testsuites/libtests/dl08/dl-o6-123456789-123456789.c b/testsuites/libtests/dl08/dl-o6-123456789-123456789.c deleted file mode 100644 index 4aee277a3d..0000000000 --- a/testsuites/libtests/dl08/dl-o6-123456789-123456789.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o6.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -uint64_t dl06_unresolv_1; -uint16_t dl06_unresolv_2; -uint32_t dl06_unresolv_3; -uint8_t dl06_unresolv_4; -int64_t dl06_unresolv_5; - -#define DL_NAME "dlo6" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -void dl06_constructor (void) __attribute__ ((constructor)); -void dl06_destructor (void) __attribute__ ((destructor)); - -void dl06_constructor (void) -{ - printf (DL_NAME ": CONSTRUCTOR: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl06_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl06_unresolv_1)); - printf (DL_NAME ": dl06_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl06_unresolv_2)); - printf (DL_NAME ": dl06_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl06_unresolv_3)); - printf (DL_NAME ": dl06_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl06_unresolv_4)); - printf (DL_NAME ": dl06_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl06_unresolv_5)); -} - -void dl06_destructor (void) -{ - printf (DL_NAME ": DESTRUCTOR: %s\n", dl_localise_file (__FILE__)); -} - -int rtems_main_o6 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": long file name to test extended name loading\n"); - - return 0; -} diff --git a/testsuites/libtests/dl08/dl08-o1.c b/testsuites/libtests/dl08/dl08-o1.c new file mode 100644 index 0000000000..e6173f3a78 --- /dev/null +++ b/testsuites/libtests/dl08/dl08-o1.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018 Chris Johns . + * All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-o1.h" + +#include +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o2.h" + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +/* + * Create some symbols. The uninitialised will be in the common section with + * separated text and data and this means there is no actual section in the ELF + * file, the details for this are in the symbols. + */ +int dl01_bss1; /* unitialised, .bss */ +float dl01_bss2[30]; /* unitialised, .bss */ +char dl01_bss3[10]; /* unitialised, .bss */ +int dl01_data1 = 1; /* initialised, .data */ +float dl01_data2 = 0.3333; /* initialised, .data */ +const int dl01_const1 = 3; /* read-only, .const */ +const float dl01_const2 = 0.666; /* read-only, .const */ +int dl01_func1(void) /* code, .text */ +{ + return 4; +} + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o1 (void); + +#define DL_NAME "dlo1" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o1 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + + rtems_main_o2 (); + + return 0; +} diff --git a/testsuites/libtests/dl08/dl08-o2.c b/testsuites/libtests/dl08/dl08-o2.c new file mode 100644 index 0000000000..e58c8750e9 --- /dev/null +++ b/testsuites/libtests/dl08/dl08-o2.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o2.h" +#include "dl-o3.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl02_bss1; +float dl02_bss2[7]; +char dl02_bss3[21]; +int dl02_data1; +float dl02_data2; + +#define DL_NAME "dlo2" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o2 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); + printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); + printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); + printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); + + rtems_main_o3 (); + + return 0; +} diff --git a/testsuites/libtests/dl08/dl08-o3.c b/testsuites/libtests/dl08/dl08-o3.c new file mode 100644 index 0000000000..c84b3d72ad --- /dev/null +++ b/testsuites/libtests/dl08/dl08-o3.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o3.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +#define DL_NAME "dlo3" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o3 () +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + + rtems_main_o4 (); + + return 0; +} diff --git a/testsuites/libtests/dl08/dl08-o4.c b/testsuites/libtests/dl08/dl08-o4.c new file mode 100644 index 0000000000..72dfbc6850 --- /dev/null +++ b/testsuites/libtests/dl08/dl08-o4.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl04_unresolv_1; +float dl04_unresolv_2; +char dl04_unresolv_3; +char* dl04_unresolv_4; +const int dl04_unresolv_5 = 4; +const char* dl04_unresolv_6 = "dl-O4"; + +#define DL_NAME "dlo4" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o4 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + + rtems_main_o5 (); + + return 0; +} diff --git a/testsuites/libtests/dl08/dl08-o5.c b/testsuites/libtests/dl08/dl08-o5.c new file mode 100644 index 0000000000..9257a684d7 --- /dev/null +++ b/testsuites/libtests/dl08/dl08-o5.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o5.h" +#include "dl-o6.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +uint64_t dl05_unresolv_1; +uint16_t dl05_unresolv_2; +uint32_t dl05_unresolv_3; +uint8_t dl05_unresolv_4; +int64_t dl05_unresolv_5; + +#define DL_NAME "dlo5" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o5 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + + rtems_main_o6 (); + + return 0; +} diff --git a/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c b/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c new file mode 100644 index 0000000000..4aee277a3d --- /dev/null +++ b/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o6.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +uint64_t dl06_unresolv_1; +uint16_t dl06_unresolv_2; +uint32_t dl06_unresolv_3; +uint8_t dl06_unresolv_4; +int64_t dl06_unresolv_5; + +#define DL_NAME "dlo6" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +void dl06_constructor (void) __attribute__ ((constructor)); +void dl06_destructor (void) __attribute__ ((destructor)); + +void dl06_constructor (void) +{ + printf (DL_NAME ": CONSTRUCTOR: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl06_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl06_unresolv_1)); + printf (DL_NAME ": dl06_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl06_unresolv_2)); + printf (DL_NAME ": dl06_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl06_unresolv_3)); + printf (DL_NAME ": dl06_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl06_unresolv_4)); + printf (DL_NAME ": dl06_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl06_unresolv_5)); +} + +void dl06_destructor (void) +{ + printf (DL_NAME ": DESTRUCTOR: %s\n", dl_localise_file (__FILE__)); +} + +int rtems_main_o6 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": long file name to test extended name loading\n"); + + return 0; +} diff --git a/testsuites/libtests/dl09/dl-o1.c b/testsuites/libtests/dl09/dl-o1.c deleted file mode 100644 index 9404a45732..0000000000 --- a/testsuites/libtests/dl09/dl-o1.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2018 Chris Johns . - * All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-o1.h" - -#include -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o2.h" - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -/* - * Create some symbols. The uninitialised will be in the common section with - * separated text and data and this means there is no actual section in the ELF - * file, the details for this are in the symbols. - */ -int dl01_bss1; /* unitialised, .bss */ -float dl01_bss2[30]; /* unitialised, .bss */ -char dl01_bss3[10]; /* unitialised, .bss */ -int dl01_data1 = 1; /* initialised, .data */ -float dl01_data2 = 0.3333; /* initialised, .data */ -const int dl01_const1 = 3; /* read-only, .const */ -const float dl01_const2 = 0.666; /* read-only, .const */ -int dl01_func1(void) /* code, .text */ -{ - return 4; -} - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o1 (void); - -#define DL_NAME "dlo1" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o1 (void) -{ - printf (DL_NAME ": module: %s @ %p\n", - dl_localise_file (__FILE__), rtems_main_o1); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - printf (DL_NAME ": rtems_main_o2: %p\n", &rtems_main_o2); - - rtems_main_o2 (); - - return 0; -} diff --git a/testsuites/libtests/dl09/dl-o2.c b/testsuites/libtests/dl09/dl-o2.c deleted file mode 100644 index 4b9f15cd28..0000000000 --- a/testsuites/libtests/dl09/dl-o2.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o2.h" -#include "dl-o3.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl02_bss1; -float dl02_bss2[7]; -char dl02_bss3[21]; -int dl02_data1 = 0x12345678; -float dl02_data2; - -#define DL_NAME "dlo2" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o2 (void) -{ - printf (DL_NAME ": module: %s @ %p\n", - dl_localise_file (__FILE__), rtems_main_o2); - printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); - printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); - printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); - printf (DL_NAME ": dl02_data1: %4zu: %p: %08x\n", PAINT_VAR (dl02_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); - - rtems_main_o3 (); - - return 0; -} diff --git a/testsuites/libtests/dl09/dl-o3.c b/testsuites/libtests/dl09/dl-o3.c deleted file mode 100644 index 7f8f419bb1..0000000000 --- a/testsuites/libtests/dl09/dl-o3.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o3.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -#define DL_NAME "dlo3" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o3 () -{ - printf (DL_NAME ": module: %s : %p\n", - dl_localise_file (__FILE__), rtems_main_o3); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - - rtems_main_o4 (); - - return 0; -} diff --git a/testsuites/libtests/dl09/dl-o4.c b/testsuites/libtests/dl09/dl-o4.c deleted file mode 100644 index 9fea2e5d5c..0000000000 --- a/testsuites/libtests/dl09/dl-o4.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl04_unresolv_1 = 12345; -float dl04_unresolv_2; -char dl04_unresolv_3 = 'z'; -char* dl04_unresolv_4 = "aBcDeF"; -const int dl04_unresolv_5 = 4; -const char* dl04_unresolv_6 = "dl-O4"; - -#define DL_NAME "dlo4" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o4 (void) -{ - printf (DL_NAME ": module: %s @ %p\n", - dl_localise_file (__FILE__), rtems_main_o4); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - - rtems_main_o5 (); - - return 0; -} diff --git a/testsuites/libtests/dl09/dl-o5.c b/testsuites/libtests/dl09/dl-o5.c deleted file mode 100644 index fb1169256c..0000000000 --- a/testsuites/libtests/dl09/dl-o5.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2019 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -uint64_t dl05_unresolv_1; -uint16_t dl05_unresolv_2; -uint32_t dl05_unresolv_3; -uint8_t dl05_unresolv_4; -int64_t dl05_unresolv_5; - -#define DL_NAME "dlo5" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o5 (void) -{ - printf (DL_NAME ": module: %s @ %p\n", - dl_localise_file (__FILE__), rtems_main_o5); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - - return 0; -} diff --git a/testsuites/libtests/dl09/dl09-o1.c b/testsuites/libtests/dl09/dl09-o1.c new file mode 100644 index 0000000000..9404a45732 --- /dev/null +++ b/testsuites/libtests/dl09/dl09-o1.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018 Chris Johns . + * All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-o1.h" + +#include +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o2.h" + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +/* + * Create some symbols. The uninitialised will be in the common section with + * separated text and data and this means there is no actual section in the ELF + * file, the details for this are in the symbols. + */ +int dl01_bss1; /* unitialised, .bss */ +float dl01_bss2[30]; /* unitialised, .bss */ +char dl01_bss3[10]; /* unitialised, .bss */ +int dl01_data1 = 1; /* initialised, .data */ +float dl01_data2 = 0.3333; /* initialised, .data */ +const int dl01_const1 = 3; /* read-only, .const */ +const float dl01_const2 = 0.666; /* read-only, .const */ +int dl01_func1(void) /* code, .text */ +{ + return 4; +} + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o1 (void); + +#define DL_NAME "dlo1" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o1 (void) +{ + printf (DL_NAME ": module: %s @ %p\n", + dl_localise_file (__FILE__), rtems_main_o1); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + printf (DL_NAME ": rtems_main_o2: %p\n", &rtems_main_o2); + + rtems_main_o2 (); + + return 0; +} diff --git a/testsuites/libtests/dl09/dl09-o2.c b/testsuites/libtests/dl09/dl09-o2.c new file mode 100644 index 0000000000..4b9f15cd28 --- /dev/null +++ b/testsuites/libtests/dl09/dl09-o2.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o2.h" +#include "dl-o3.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl02_bss1; +float dl02_bss2[7]; +char dl02_bss3[21]; +int dl02_data1 = 0x12345678; +float dl02_data2; + +#define DL_NAME "dlo2" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o2 (void) +{ + printf (DL_NAME ": module: %s @ %p\n", + dl_localise_file (__FILE__), rtems_main_o2); + printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); + printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); + printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); + printf (DL_NAME ": dl02_data1: %4zu: %p: %08x\n", PAINT_VAR (dl02_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); + + rtems_main_o3 (); + + return 0; +} diff --git a/testsuites/libtests/dl09/dl09-o3.c b/testsuites/libtests/dl09/dl09-o3.c new file mode 100644 index 0000000000..7f8f419bb1 --- /dev/null +++ b/testsuites/libtests/dl09/dl09-o3.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o3.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +#define DL_NAME "dlo3" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o3 () +{ + printf (DL_NAME ": module: %s : %p\n", + dl_localise_file (__FILE__), rtems_main_o3); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + + rtems_main_o4 (); + + return 0; +} diff --git a/testsuites/libtests/dl09/dl09-o4.c b/testsuites/libtests/dl09/dl09-o4.c new file mode 100644 index 0000000000..9fea2e5d5c --- /dev/null +++ b/testsuites/libtests/dl09/dl09-o4.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl04_unresolv_1 = 12345; +float dl04_unresolv_2; +char dl04_unresolv_3 = 'z'; +char* dl04_unresolv_4 = "aBcDeF"; +const int dl04_unresolv_5 = 4; +const char* dl04_unresolv_6 = "dl-O4"; + +#define DL_NAME "dlo4" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o4 (void) +{ + printf (DL_NAME ": module: %s @ %p\n", + dl_localise_file (__FILE__), rtems_main_o4); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + + rtems_main_o5 (); + + return 0; +} diff --git a/testsuites/libtests/dl09/dl09-o5.c b/testsuites/libtests/dl09/dl09-o5.c new file mode 100644 index 0000000000..fb1169256c --- /dev/null +++ b/testsuites/libtests/dl09/dl09-o5.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2019 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +uint64_t dl05_unresolv_1; +uint16_t dl05_unresolv_2; +uint32_t dl05_unresolv_3; +uint8_t dl05_unresolv_4; +int64_t dl05_unresolv_5; + +#define DL_NAME "dlo5" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o5 (void) +{ + printf (DL_NAME ": module: %s @ %p\n", + dl_localise_file (__FILE__), rtems_main_o5); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + + return 0; +} diff --git a/testsuites/libtests/dl10/dl-o1.c b/testsuites/libtests/dl10/dl-o1.c deleted file mode 100644 index e6173f3a78..0000000000 --- a/testsuites/libtests/dl10/dl-o1.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2018 Chris Johns . - * All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-o1.h" - -#include -#include "dl-load.h" -#include "dl-o1.h" -#include "dl-o2.h" - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -/* - * Create some symbols. The uninitialised will be in the common section with - * separated text and data and this means there is no actual section in the ELF - * file, the details for this are in the symbols. - */ -int dl01_bss1; /* unitialised, .bss */ -float dl01_bss2[30]; /* unitialised, .bss */ -char dl01_bss3[10]; /* unitialised, .bss */ -int dl01_data1 = 1; /* initialised, .data */ -float dl01_data2 = 0.3333; /* initialised, .data */ -const int dl01_const1 = 3; /* read-only, .const */ -const float dl01_const2 = 0.666; /* read-only, .const */ -int dl01_func1(void) /* code, .text */ -{ - return 4; -} - -/* - * Yes a decl in the source. This is a modules main and I could not find which - * header main is defined in. - */ -int rtems_main_o1 (void); - -#define DL_NAME "dlo1" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o1 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); - printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); - printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); - printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); - printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); - printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); - printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); - - rtems_main_o2 (); - - return 0; -} diff --git a/testsuites/libtests/dl10/dl-o2.c b/testsuites/libtests/dl10/dl-o2.c deleted file mode 100644 index e58c8750e9..0000000000 --- a/testsuites/libtests/dl10/dl-o2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o2.h" -#include "dl-o3.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl02_bss1; -float dl02_bss2[7]; -char dl02_bss3[21]; -int dl02_data1; -float dl02_data2; - -#define DL_NAME "dlo2" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o2 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); - printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); - printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); - printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); - /* no %f in the rtems test printer */ - printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); - - rtems_main_o3 (); - - return 0; -} diff --git a/testsuites/libtests/dl10/dl-o3.c b/testsuites/libtests/dl10/dl-o3.c deleted file mode 100644 index c84b3d72ad..0000000000 --- a/testsuites/libtests/dl10/dl-o3.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o3.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -#define DL_NAME "dlo3" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o3 () -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - - rtems_main_o4 (); - - return 0; -} diff --git a/testsuites/libtests/dl10/dl-o4.c b/testsuites/libtests/dl10/dl-o4.c deleted file mode 100644 index 72dfbc6850..0000000000 --- a/testsuites/libtests/dl10/dl-o4.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o4.h" -#include "dl-o5.h" - -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -int dl04_unresolv_1; -float dl04_unresolv_2; -char dl04_unresolv_3; -char* dl04_unresolv_4; -const int dl04_unresolv_5 = 4; -const char* dl04_unresolv_6 = "dl-O4"; - -#define DL_NAME "dlo4" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o4 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); - printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); - printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); - printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); - printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); - printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); - - rtems_main_o5 (); - - return 0; -} diff --git a/testsuites/libtests/dl10/dl-o5.c b/testsuites/libtests/dl10/dl-o5.c deleted file mode 100644 index be496392c9..0000000000 --- a/testsuites/libtests/dl10/dl-o5.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" -#include "dl-o5.h" - -#include -#include - -#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); - -uint64_t dl05_unresolv_1; -uint16_t dl05_unresolv_2; -uint32_t dl05_unresolv_3; -uint8_t dl05_unresolv_4; -int64_t dl05_unresolv_5; - -#define DL_NAME "dlo5" -#define PAINT_VAR(_v) sizeof(_v), &_v, _v - -int rtems_main_o5 (void) -{ - printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); - printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); - printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); - printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); - printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); - printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); - - return 0; -} diff --git a/testsuites/libtests/dl10/dl-o6.c b/testsuites/libtests/dl10/dl-o6.c deleted file mode 100644 index 5e03a30773..0000000000 --- a/testsuites/libtests/dl10/dl-o6.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2014 Chris Johns . All rights reserved. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include "dl-load.h" - -#include -#include - -int rtems_main_o5 (void) -{ - /* duplicate symbol in archive */ - return 0; -} diff --git a/testsuites/libtests/dl10/dl10-o1.c b/testsuites/libtests/dl10/dl10-o1.c new file mode 100644 index 0000000000..e6173f3a78 --- /dev/null +++ b/testsuites/libtests/dl10/dl10-o1.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018 Chris Johns . + * All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-o1.h" + +#include +#include "dl-load.h" +#include "dl-o1.h" +#include "dl-o2.h" + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +/* + * Create some symbols. The uninitialised will be in the common section with + * separated text and data and this means there is no actual section in the ELF + * file, the details for this are in the symbols. + */ +int dl01_bss1; /* unitialised, .bss */ +float dl01_bss2[30]; /* unitialised, .bss */ +char dl01_bss3[10]; /* unitialised, .bss */ +int dl01_data1 = 1; /* initialised, .data */ +float dl01_data2 = 0.3333; /* initialised, .data */ +const int dl01_const1 = 3; /* read-only, .const */ +const float dl01_const2 = 0.666; /* read-only, .const */ +int dl01_func1(void) /* code, .text */ +{ + return 4; +} + +/* + * Yes a decl in the source. This is a modules main and I could not find which + * header main is defined in. + */ +int rtems_main_o1 (void); + +#define DL_NAME "dlo1" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o1 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n", PAINT_VAR (dl01_bss1)); + printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n", PAINT_VAR (dl01_bss2[0])); + printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl01_bss3[0])); + printf (DL_NAME ": dl01_data1: %4zu: %p: %d\n", PAINT_VAR (dl01_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl01_data2: %4zu: %p: %f\n", PAINT_VAR (dl01_data2)); + printf (DL_NAME ": dl01_const1: %4zu: %p: %d\n", PAINT_VAR (dl01_const1)); + printf (DL_NAME ": dl01_const2: %4zu: %p: %f\n", PAINT_VAR (dl01_const2)); + printf (DL_NAME ": dl01_func1: %4zu: %p\n", sizeof(dl01_func1), &dl01_func1); + + rtems_main_o2 (); + + return 0; +} diff --git a/testsuites/libtests/dl10/dl10-o2.c b/testsuites/libtests/dl10/dl10-o2.c new file mode 100644 index 0000000000..e58c8750e9 --- /dev/null +++ b/testsuites/libtests/dl10/dl10-o2.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o2.h" +#include "dl-o3.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl02_bss1; +float dl02_bss2[7]; +char dl02_bss3[21]; +int dl02_data1; +float dl02_data2; + +#define DL_NAME "dlo2" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o2 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl02_bss1: %4zu: %p: %d\n", PAINT_VAR (dl02_bss1)); + printf (DL_NAME ": dl02_bss2: %4zu: %p: %f\n", PAINT_VAR (dl02_bss2[0])); + printf (DL_NAME ": dl02_bss3: %4zu: %p: %02x\n", PAINT_VAR (dl02_bss3[0])); + printf (DL_NAME ": dl02_data1: %4zu: %p: %d\n", PAINT_VAR (dl02_data1)); + /* no %f in the rtems test printer */ + printf (DL_NAME ": dl02_data2: %4zu: %p: %f\n", PAINT_VAR (dl02_data2)); + + rtems_main_o3 (); + + return 0; +} diff --git a/testsuites/libtests/dl10/dl10-o3.c b/testsuites/libtests/dl10/dl10-o3.c new file mode 100644 index 0000000000..c84b3d72ad --- /dev/null +++ b/testsuites/libtests/dl10/dl10-o3.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o3.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +#define DL_NAME "dlo3" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o3 () +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + + rtems_main_o4 (); + + return 0; +} diff --git a/testsuites/libtests/dl10/dl10-o4.c b/testsuites/libtests/dl10/dl10-o4.c new file mode 100644 index 0000000000..72dfbc6850 --- /dev/null +++ b/testsuites/libtests/dl10/dl10-o4.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o4.h" +#include "dl-o5.h" + +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +int dl04_unresolv_1; +float dl04_unresolv_2; +char dl04_unresolv_3; +char* dl04_unresolv_4; +const int dl04_unresolv_5 = 4; +const char* dl04_unresolv_6 = "dl-O4"; + +#define DL_NAME "dlo4" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o4 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl04_unresolv_1: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_1)); + printf (DL_NAME ": dl04_unresolv_2: %4zu: %p: %f\n", PAINT_VAR (dl04_unresolv_2)); + printf (DL_NAME ": dl04_unresolv_3: %4zu: %p: %02x\n", PAINT_VAR (dl04_unresolv_3)); + printf (DL_NAME ": dl04_unresolv_4: %4zu: %p: %p\n", PAINT_VAR (dl04_unresolv_4)); + printf (DL_NAME ": dl04_unresolv_5: %4zu: %p: %d\n", PAINT_VAR (dl04_unresolv_5)); + printf (DL_NAME ": dl04_unresolv_6: %4zu: %p: %s\n", PAINT_VAR (dl04_unresolv_6)); + + rtems_main_o5 (); + + return 0; +} diff --git a/testsuites/libtests/dl10/dl10-o5.c b/testsuites/libtests/dl10/dl10-o5.c new file mode 100644 index 0000000000..be496392c9 --- /dev/null +++ b/testsuites/libtests/dl10/dl10-o5.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" +#include "dl-o5.h" + +#include +#include + +#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); + +uint64_t dl05_unresolv_1; +uint16_t dl05_unresolv_2; +uint32_t dl05_unresolv_3; +uint8_t dl05_unresolv_4; +int64_t dl05_unresolv_5; + +#define DL_NAME "dlo5" +#define PAINT_VAR(_v) sizeof(_v), &_v, _v + +int rtems_main_o5 (void) +{ + printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__)); + printf (DL_NAME ": dl05_unresolv_1: %4zu: %p: %" PRIu64 "\n", PAINT_VAR (dl05_unresolv_1)); + printf (DL_NAME ": dl05_unresolv_2: %4zu: %p: %" PRIu16 "\n", PAINT_VAR (dl05_unresolv_2)); + printf (DL_NAME ": dl05_unresolv_3: %4zu: %p: %" PRIu32 "\n", PAINT_VAR (dl05_unresolv_3)); + printf (DL_NAME ": dl05_unresolv_4: %4zu: %p: %" PRIu8 "\n", PAINT_VAR (dl05_unresolv_4)); + printf (DL_NAME ": dl05_unresolv_5: %4zu: %p: %" PRIi64 "\n", PAINT_VAR (dl05_unresolv_5)); + + return 0; +} diff --git a/testsuites/libtests/dl10/dl10-o6.c b/testsuites/libtests/dl10/dl10-o6.c new file mode 100644 index 0000000000..5e03a30773 --- /dev/null +++ b/testsuites/libtests/dl10/dl10-o6.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2014 Chris Johns . All rights reserved. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include "dl-load.h" + +#include +#include + +int rtems_main_o5 (void) +{ + /* duplicate symbol in archive */ + return 0; +} -- cgit v1.2.3