From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-042.btinternet.com (mailomta2-sa.btinternet.com [213.120.69.8]) by sourceware.org (Postfix) with ESMTPS id E8683385840D for ; Sat, 20 Nov 2021 15:24:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E8683385840D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from sa-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.38.7]) by sa-prd-fep-042.btinternet.com with ESMTP id <20211120152403.OQKD14747.sa-prd-fep-042.btinternet.com@sa-prd-rgout-004.btmx-prd.synchronoss.net>; Sat, 20 Nov 2021 15:24:03 +0000 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 613943C60AB95328 X-Originating-IP: [81.129.146.209] X-OWM-Source-IP: 81.129.146.209 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvuddrgedtgdejhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeeuteevudekgefgleelueeluedtleefjeeuudffhfelvddvffehfeffuddujeeuheenucffohhmrghinhepughllhdrshhopdhmihgtrhhoshhofhhtrdgtohhmpdhgnhhurdhorhhgnecukfhppeekuddruddvledrudegiedrvddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddtfegnpdhinhgvthepkedurdduvdelrddugeeirddvtdelpdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdprhgtphhtthhopefvohhmrdfmrggtvhhinhhskhihsehvvggtthhorhdrtghomhdprhgtphhtthhopegthihgfihinhdquggvvhgvlhhophgvrhhssegthihgfihinhdrtghomh X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.103] (81.129.146.209) by sa-prd-rgout-004.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 613943C60AB95328; Sat, 20 Nov 2021 15:24:03 +0000 Message-ID: Date: Sat, 20 Nov 2021 15:23:45 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: How is cygwin1.dll linked in? Content-Language: en-GB To: Tom.Kacvinsky@vector.com, cygwin-developers@cygwin.com References: From: Jon Turney In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1192.6 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2021 15:24:08 -0000 On 19/11/2021 14:38, Kacvinsky, Tom wrote: > I built the base Cygwin (really, just cygwin1.dll` and then went to compile > a test problem. I did not see an import library for cygwin1.dll. so I am of The import library is libcygwin.a (technically this is a hybrid import/static library) > the opinion there is "magic" for doing this. Is that magic the .idata section? > I _think_ the .data section is what passed on imported functions to the DLL > and adds it to the run time dependencies of the executable, but I am not I don't quite understand what this is saying. The .idata section (strictly, the Import Directory) is used by the Windows PE loader to determine which DLLs to load, and to fixup references to imported symbols. See https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-idata-section > sure of this. > > Any help on this matter would be appreciated. I think maybe that answer to your question is that this is done via the gcc specs file, which you can examine using `gcc -dumpspecs' This contains: *lib: %{pg:-lgmon} %{pthread: } -lcygwin %{mwindows:-lgdi32 -lcomdlg32} %{fvtable-verify=preinit:-lvtv -lpsapi; fvtable-verify=std:-lvtv -lpsapi} -ladvapi32 -lshell32 -luser32 -lkernel32 which means that -lcygwin (and others) are passed to the linker. See https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html for more details.