public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* dll building : segmentation faults
@ 1997-08-06  9:13 Andreas Jellinghaus (bei rf)
       [not found] ` <jelling@iitb.fhg.de>
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Jellinghaus (bei rf) @ 1997-08-06  9:13 UTC (permalink / raw)
  To: gnu-win32

gcc    -c dllentry.c -o dllentry.o
ld -s --base-file my_dll.base --entry _dll_entry@12 \
        --dll --output my_dll.jnk dllentry.o 
dlltool --base-file my_dll.base --def my_dll.def --dllname my_dll.dll \
        --output-exp my_dll.exp --output-lib my_dll.a 
ld -s --dll --entry _dll_entry@12 --output my_dll.dll my_dll.exp  dllentry.o 

working dllentry.c :
#include <windows.h>
asm(".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");
WINAPI dll_entry(int a,int b,int c) { return 1; }
char* dummy() { return ""; }

not working dllentry.c :
#include <windows.h>
asm(".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");
WINAPI dll_entry(int a,int b,int c) { return 1; }
void dummy() { return ; }

(also not working int dummy, int* dummy, ...).  any hints ? i'm using gnu win
32, beta 18 (i tried this on winnt and linux with the same result).

andreas

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dll building : segmentation faults
       [not found] ` <jelling@iitb.fhg.de>
@ 1997-08-07  9:45   ` Philippe GIACINTI
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe GIACINTI @ 1997-08-07  9:45 UTC (permalink / raw)
  To: aj; +Cc: gnu-win32

Hi,

1) The fixup asm(".section .idata$3 ...") is here to terminate the Import
Directory Table in which each element is 5x32 bits long and which should be
terminated with a NULL element.
So I think the correct fixup should be
	asm(".section .idata$3\n" ".long 0,0,0,0,0"); only 5 zeros ...

2) May be can you try to put the fixup at end of your file, I had problems
which were solved that way ... ( don't ask me why )

#include <windows.h>
/* asm(".section .idata$3\n" ".long 0,0,0,0,0,0,0,0"); not here */
WINAPI dll_entry(int a,int b,int c) { return 1; }
void dummy() { return ; }
/* put it here */
asm(".section .idata$3\n" ".long 0,0,0,0,0");

3) I had also some troubles with strange relocations that I have solved in
adding a third link pass ...


Hope this helps,

Best regards.

-- 

 ==========================================================================
|                         Philippe GIACINTI                                |
|                                                                          |
| DALiM GmbH R&D                                email:  giac@dalim.de      |
| Daimler Strasse 2,                            tel:    +49.7851.9196-28   |
| D-77694 Kehl-Sundheim Germany                 fax:    +49.7851.73576	   |
|                                                                          |
 ==========================================================================
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-08-07  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-06  9:13 dll building : segmentation faults Andreas Jellinghaus (bei rf)
     [not found] ` <jelling@iitb.fhg.de>
1997-08-07  9:45   ` Philippe GIACINTI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).