libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test for dlloader API


From: Peter Rosin
Subject: Re: Test for dlloader API
Date: Thu, 28 Jan 2010 09:06:10 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Den 2010-01-28 07:16 skrev Ralf Wildenhues:
Hi Peter,

* Peter Rosin wrote on Mon, Jan 25, 2010 at 04:12:47PM CET:
As promised, here's a testsuite addition for the dlloader API.

Thank you!

2010-01-25  Peter Rosin  <address@hidden>

        Testsuite exposure for dlloader API.
        * tests/dlloader-api.at: New file, new test.
        * Makefile.am (TESTSUITE_AT): Update.

So far I've only take a cursory look:

Thanks! I have snipped those comments that I've applied to my working
copy.

There are several more instances that fail when using CC=g++.  The patch
below makes it pass in this case for me, please look over it that I
haven't made any mistakes.

Ouch, didn't think of that. The loadlibrary.at test as similar issues.
I'll fix that up too.

The test fails for me when Libtool is configured with --disable-shared.
I'm not sure that failure is specific to this test, whether we need to
fix it before committing the test or so; looking at this is probably
prudent.

Fails for me to, sorry for not testing that myself, I'll fix it.

*time passes*

Not sure how to proceed... When I added -dlopen module.la to the link
of the main program and a LTDL_SET_PRELOADED_SYMBOLS invocation it
*almost* works. But the test still fails since it isn't possible to add
a custom loader before the preopen loader. I get this diff in the
expected output when running the program:

@@ -6,7 +6,6 @@
 first_sym (first): first_ctx
 result: first_symbol
 first_close (first): first_ctx
-first_open denies a request
 result: module_symbol
 first_open denies a request
 last_open ("last"): last_ctx

I.e. the "first" loader doesn't see any request regarding opening
of module.la. Come to think of it, it only sees the request to open
the actual shared library when the preopen loader isn't involved,
and since that step don't happen with preopened modules the
behaviour is not that surprising...

The test clearly expects too much from the current implementation, but I
kinda think you should be able to override the preopen loader as well.

So, how to weaken^Wfix the test?

What about just tossing the "real" module and settle for checking that
a prepended loader is in front of an appended loader?

@@ -196,7 +196,7 @@ main (int argc, char* argv[])
   first->find_sym = first_sym;
   first->dlloader_init = first_init; /* test that it isn't called twice */
   first->dlloader_exit = first_exit;
-  first->dlloader_data = first_ctx;
+  first->dlloader_data = (void *)first_ctx;
   first->priority = LT_DLLOADER_PREPEND;
if (first_init (first->dlloader_data))

I'm going with (lt_user_data) instead of (void *) as you did for the
"last" loader.

@@ -357,7 +357,13 @@ cleanup:
AT_DATA([module.c],
 [[
+#ifdef __cplusplus
+extern "C"
+#endif
 const char *symbol (void);
+#ifdef __cplusplus
+extern "C"
+#endif
 const char *
 symbol (void)
 {

I believe extern "C" is only needed on the declaration, and not
the definition, so I zapped the second instance...

Cheers,
Peter

--
They are in the crowd with the answer before the question.
> Why do you dislike Jeopardy?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]