summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Rosin <peda@lysator.liu.se>2012-11-02 23:50:43 +0100
committerPeter Rosin <peda@lysator.liu.se>2012-11-02 23:50:43 +0100
commit34fe402efa1e969cf902cf7370e29564c005d508 (patch)
treeb68d63d35641b1b15d7597d65a40e395d37f80e9 /tests
parent2ed79f5937f28958b4fdf0b3aeed7330d675d2a1 (diff)
downloadlibtool-34fe402efa1e969cf902cf7370e29564c005d508.tar.gz
libtool: add @INIT@ to the preloader, for data imports on Windows
* m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS) [dumpbin]: Adjust lt_cv_sys_global_symbol_to_cdecl so that it declares imported data symbols as __declspec(dllimport). Adjust lt_cv_sys_global_symbol_to_c_name_address and lt_cv_sys_global_symbol_to_c_name_address_lib_prefix so that they fill in "(void*) 0" for imported data symbols. Add new lt_cv_sys_global_symbol_to_import which finds imported data symbols if non-empty and export this variable to the libtool script in the global_symbol_to_import variable. Adjust lt_cv_sys_global_symbol_pipe so that data imports can be located. * build-aux/ltmain.in (func_generate_dlsyms): When data imports are present, as indicated by global_symbol_to_import, generate a relocation function lt_syminit that fills in the addresses of data imports at runtime and point to the new function with a new virtual @INIT@ entry in the symbol list. * libltdl/loaders/preopen.c (add_symlist): Look for the virtual @INIT@ symbol (i.e. lt_syminit) and call it. (vm_sym): Step past the @INIT@ symbol, if present. * tests/demo.at (dlmain.c): Call the @INIT@ symbol, if present. * NEWS: Update. Signed-off-by: Peter Rosin <peda@lysator.liu.se>
Diffstat (limited to 'tests')
-rw-r--r--tests/demo.at2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/demo.at b/tests/demo.at
index c86e1e91..eb8a97fd 100644
--- a/tests/demo.at
+++ b/tests/demo.at
@@ -295,6 +295,8 @@ int main ()
if (s->address) {
const char *name = s->name;
printf ("found symbol: %s\n", name);
+ if (STREQ ("@INIT@", name))
+ ((void(*)())s->address)();
if (STREQ ("hello", name))
phello = (int(*)())s->address;
else if (STREQ ("foo", name))