Hey together ;o)

I again played a little with dlpreopening on windows (with wgcc). Now i
again know why it didn't work ;o)

Libtool generates a symbol table on the fly which it then compiles and
links in, correct?
That symbols table contains both .text and .data symbols. There is no
problem with .text symbols so far ;o) As i saw the ....nmS file uses a
one letter prefix to identify the type of symbol. My mdemo.nmS for
exmaple has three types:

 T      .text i think, so all functions
 B      .bss (??) i think, initialized data
 C      .data (??) uninitialized data?

Please correct me if i'm wrong ;o). Now on windows, it would be cool
(and neccessary) to know if a symbol comes from a shared library (since
i then need to import it.). The extern definition of data symbols should
have a __declspec(dllimport) where apropriate. With wgcc it would be a
little easier, since wgcc automatically generates the "__imp_" pointers
(needed for __declspec(dllimport) to work) for all static libraries too,
so one would not have to differentiate (but this would *only* work for
wgcc then...).

I now changed libtool a little (quick and dirty hack ;o) to be:

global_symbol_to_cdecl="awk '{ if(\$1 != \"T\") { print \"extern
__declspec\(dllimport\) int \" \$3 \";\" } else { print  "extern int \"
\$3 \";\" } }'"

This puts another problem into place: this does *not* compile with the
microsoft compiler *except* when using C++. For that reason i added the
-xc++ option to the compiler command.

Now i ran mdemo test ok with wgcc ;o)

Any thoughts on this?

Cheers, Markus

P.S.: the windows compiler does not define data symbols in object files
if they are not referenced at least once in that object file. So the
libtool mdemo/foo(1|2).c nothing variable is missing in the objects
unless i initialize them with something (0 in my case...).


_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to