Re: Re: libbfd, libtool Win32 and Re: Building a MinGW GLib etc...

2002-09-17 Thread Max Bowsher

Guido Draheim wrote:
 How old may a gcc/binutils pair be? My oldest crosscompilers
 are gcc 2.95.3 and ld --version reports 2.11.90.8. And for
 all I know, these are in fact the oldest versions around,
 no one want to go back beyond, I guess.

 Is that enough, Max?

Test:

$ echo '__declspec(dllexport) void foo () {}'  foo.c
$ gcc -shared foo.c -o foo.dll
$ objdump -p foo.dll | fgrep -A 5 Characteristics

The first chunk of the fgrepped objdump output should contain something like:
| Characteristics 0x2006
| executable
| line numbers stripped
| DLL

The gcc completing without errors is probably enough, though. The objdump is
just confirmation.


Max.



___
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool



Re: Re: libbfd, libtool Win32 and Re: Building a MinGW GLib etc...

2002-09-17 Thread David Olofson

On Tuesday 17 September 2002 13:01, Max Bowsher wrote:
[...]
 $ echo '__declspec(dllexport) void foo () {}'  foo.c
 $ gcc -shared foo.c -o foo.dll
 $ objdump -p foo.dll | fgrep -A 5 Characteristics
[...]

It worked on my 2.95.2 collector's item cross compiler... Oh, and the 
export table does indeed show the foo() function as well.

(BTW, the native objdump works just as fine as the one that belongs to 
the cross compiler. As expected, since it's based on libbfd, I suppose.)


Anyway, unless I'm missing something, we still need import libs to be 
generated for compilers that can't link DLLs directly. I've just looked 
at a few DLLs, but it seems to me that objdump -p DLL digs the required 
info out. Here's the interesting part of the output from SDL.dll, for 
example:

[Ordinal/Name Pointer] Table
[   0] SDL_AddTimer
[   1] SDL_AllocRW
[   2] SDL_AudioDriverName
[   3] SDL_AudioInit
[   4] SDL_AudioQuit
[   5] SDL_BuildAudioCVT
...

Has anyone tried hacking a script to turn that into a .def file? Or 
should I, or someone else, just try to add a feature to objdump?


//David Olofson --- Programmer, Reologica Instruments AB

.- M A I A -.
|  Multimedia Application Integration Architecture  |
| A Free/Open Source Plugin API for Professional Multimedia |
` http://www.linuxdj.com/maia -'
.- David Olofson ---.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`- http://olofson.net -'


___
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool