delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/14/01:24:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-AuthUser: gerrit:koeln.convey.de
Date: Wed, 14 May 2003 07:18:23 +0200
From: "Gerrit P. Haase" <gp AT familiehaase DOT de>
Organization: Esse keine toten Tiere
X-Priority: 3 (Normal)
Message-ID: <164294981791.20030514071823@familiehaase.de>
To: RomikB <romikb AT mail DOT ru>
CC: cygwin AT cygwin DOT com
Subject: Re: DLL creating problem
In-Reply-To: <10212936061.20030513223900@mail.ru>
References: <10212936061 DOT 20030513223900 AT mail DOT ru>
MIME-Version: 1.0

Hallo RomikB,

Am Dienstag, 13. Mai 2003 um 21:39 schriebst du:

> Hello All,

> I have a problem when trying to create a DLL.

> For Ex:

> i have two source files: file_asm.asm , file_c.c

> ------file_asm.asm-------
> global _function_asm
> extern _printf
> section .text
> _function_asm:
>   push dword str
>   call _printf
>   add esp,0x04
>   mov ecx,0x1000
>   mov edi,bss_data
>   rep stosd
>   ret
> section .data
>   str db "String2print",0
> section .bss
>   bss_data resd 0x1000
> ------file_c.c------
> void function_c(void){
> }
> --------------------

> I need to create a DLL(no-cygwin)

> compile:
>   nasm -f format -o file_asm.o   {format = elf | win32 | coff }
>   gcc -c file_c.c -o file_c.o

[...]

>   please, give me a hint. How can i create a DLL.

gcc -shared -o cyg_your_dll.dll \
    -Wl,--out-implib=lib_your_.dll.a \
    -Wl,--export-all-symbols \
    -Wl,--enable-auto-import \
    -Wl,--whole-archive \
    file_asm.o file_c.o \
    -Wl,--no-whole-archive ${dependency_libs}


You'll also need to figure what switches to add to get a DLL that
doesn't depend on cygwin1.dll.


Gerrit
-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019