[rtems commit] dl01, dl02, dl05: Fix unresolved printf symbol
Sebastian Huber
sebh at rtems.org
Wed Nov 15 07:10:48 UTC 2017
Module: rtems
Branch: master
Commit: 62119d21da8c7893cecbbf57c1478dcbabb63370
Changeset: http://git.rtems.org/rtems/commit/?id=62119d21da8c7893cecbbf57c1478dcbabb63370
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Nov 15 07:55:43 2017 +0100
dl01, dl02, dl05: Fix unresolved printf symbol
The link time wrap of printf leads to unresolved symbols in the loadable
modules. This resulted in infinite loops and test timeouts. Use
rtems_printf() for output.
Update #3199.
---
testsuites/libtests/dl01/dl-o1.c | 7 +++----
testsuites/libtests/dl02/dl-o1.c | 7 ++++---
testsuites/libtests/dl02/dl-o2.c | 6 ++++--
testsuites/libtests/dl05/dl-o5.cpp | 9 +++++++--
4 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/testsuites/libtests/dl01/dl-o1.c b/testsuites/libtests/dl01/dl-o1.c
index 6e7bb8a..a47beb1 100644
--- a/testsuites/libtests/dl01/dl-o1.c
+++ b/testsuites/libtests/dl01/dl-o1.c
@@ -6,14 +6,13 @@
* http://www.rtems.org/license/LICENSE.
*/
-#include <stdio.h>
-#include <stdlib.h>
-
/**
* Hello World as a loadable module.
*/
-#include <stdio.h>
+#include <rtems/test.h>
+
+#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
diff --git a/testsuites/libtests/dl02/dl-o1.c b/testsuites/libtests/dl02/dl-o1.c
index ff5a853..a4355d6 100644
--- a/testsuites/libtests/dl02/dl-o1.c
+++ b/testsuites/libtests/dl02/dl-o1.c
@@ -6,12 +6,13 @@
* http://www.rtems.org/license/LICENSE.
*/
-#include <stdio.h>
-#include <stdlib.h>
+#include "dl-o2.h"
#include <dlfcn.h>
-#include "dl-o2.h"
+#include <rtems/test.h>
+
+#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
typedef int (*func1_t)(int argc, const char* argv[]);
diff --git a/testsuites/libtests/dl02/dl-o2.c b/testsuites/libtests/dl02/dl-o2.c
index 43a337a..4c1a918 100644
--- a/testsuites/libtests/dl02/dl-o2.c
+++ b/testsuites/libtests/dl02/dl-o2.c
@@ -6,10 +6,12 @@
* http://www.rtems.org/license/LICENSE.
*/
-#include <stdio.h>
-
#include "dl-o2.h"
+#include <rtems/test.h>
+
+#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
+
int dl_o2_func1 (int argc, char* argv[])
{
int arg;
diff --git a/testsuites/libtests/dl05/dl-o5.cpp b/testsuites/libtests/dl05/dl-o5.cpp
index 5918e8f..b70790e 100644
--- a/testsuites/libtests/dl05/dl-o5.cpp
+++ b/testsuites/libtests/dl05/dl-o5.cpp
@@ -1,6 +1,11 @@
-#include <cstdio>
-#include <stdexcept>
#include "dl-load.h" /* make the symbol a C linkage */
+
+#include <stdexcept>
+
+#include <rtems/test.h>
+
+#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
+
void exception_dl(bool throw_runtime)
{
printf("exception_dl: begin\n");
More information about the vc
mailing list