Module: xenomai-3
Branch: next
Commit: 82b63250083ea00f868f615a50d25256f3e219be
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=82b63250083ea00f868f615a50d25256f3e219be

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep 21 15:38:07 2016 +0200

boilerplate/bootstrap: do not override main() in PIC mode

The PIC version of the bootstrap module is intended to be part of
shared libraries which want to enable Xenomai's auto-init feature when
loaded (i.e. dlopened).

Therefore, overriding the main() entry point is meaningless in such
context, assuming the latter should be defined in the main executable
instead.

---

 lib/boilerplate/init/bootstrap.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/boilerplate/init/bootstrap.c b/lib/boilerplate/init/bootstrap.c
index 119b405..b0d4a12 100644
--- a/lib/boilerplate/init/bootstrap.c
+++ b/lib/boilerplate/init/bootstrap.c
@@ -28,6 +28,8 @@ static char *const *early_argv;
 
 const int xenomai_auto_bootstrap = 1;
 
+#ifndef __PIC__
+
 int __real_main(int argc, char *const argv[]);
 
 int __wrap_main(int argc, char *const argv[])
@@ -43,6 +45,8 @@ int xenomai_main(int argc, char *const argv[])
        return __real_main(argc, argv);
 }
 
+#endif /* !__PIC__ */
+
 __bootstrap_ctor static void xenomai_bootstrap(void)
 {
        char *arglist, *argend, *p, **v, *const *argv;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to