public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
* How is a Cygwin EXE/DLL customized?
@ 2018-07-25 22:25 Paul Benedict
  2018-07-26  7:27 ` Marco Atzeri
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Benedict @ 2018-07-25 22:25 UTC (permalink / raw)
  To: cygwin-developers

Good day,

I am researching and trying to learn how an EXE/DLL produced by Cygwin's toolchain gets special treatment. This email I write only after doing several days of diligent research. Some things I have done so far... Read the FAQ [1], searched through Stack Overflow and Cygwin mailing lists, built a simple EXE+DLL combo project, inspected the binaries with MS Dependency Walker, dumped symbols using the "nm" command, and read several relevant source files [2]... At this point, I hit a wall; that's why I am turning to the development community. I hope you find this email well.

So it appears to me Cygwin is customizing the GNU toolchain. Am I on the right track? Please correct anything I have misunderstood and gotten wrong. The customization is most apparent as such:

*) Cygwin GCC is automatically stubbing in initialization code before any of my code
*) Cygwin LD is automatically linking to cygwin1.dll

If what I am seeing is correct, can I be pointed to the Cygwin Git project and/or files where those customizations of GCC and LD have taken place? I am really interested in learning the "boot" sequences of Cygwin EXE/DLL and how they get written into the binaries. Documentation in this area seems very scarce.

Thank you!

References:
[1] https://cygwin.com/faq.html#faq.programming.msvs-mingw
[2] From Git HEAD:
winsup/cygwin/crt0.c
winsup/cygwin/cygthread.cc
winsup/cygwin/cygtls.cc
winsup/cygwin/cygtls.h
winsup/cygwin/cygtls_padsize.h
winsup/cygwin/dll_init.cc
winsup/cygwin/dll_init.h
winsup/cygwin/external.cc
winsup/cygwin/how-cygtls-works.txt
winsup/cygwin/how-startup-shutdown-works.txt
winsup/cygwin/include/cygwin/cygwin_dll.h
winsup/cygwin/include/sys/cygwin.h
winsup/cygwin/lib/cygwin_attach_dll.c
winsup/cygwin/lib/libcmain.c
winsup/cygwin/lib/premain[0/1/2/3].c
winsup/cygwin/winsup.h
winsup/testsuite/winsup.api/cygload.cc
winsup/testsuite/winsup.api/cygload.h

Cheers and God bless,
Paul

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

* Re: How is a Cygwin EXE/DLL customized?
  2018-07-25 22:25 How is a Cygwin EXE/DLL customized? Paul Benedict
@ 2018-07-26  7:27 ` Marco Atzeri
  2018-07-26 12:42   ` cyg Simple
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Atzeri @ 2018-07-26  7:27 UTC (permalink / raw)
  To: cygwin-developers

Am 26.07.2018 um 00:25 schrieb Paul Benedict:
> Good day,
>

> If what I am seeing is correct, can I be pointed to the Cygwin Git project and/or files where those customizations of GCC and LD have taken place? I am really interested in learning the "boot" sequences of Cygwin EXE/DLL and how they get written into the binaries. Documentation in this area seems very scarce.

you should look at the patches for GCC included in the source package
code. You can download it with cygwin setup, just click on the "Src ?"
column for the gcc row. It will be put in "/usr/src"

There are no patches for binutils/ld for what I see on its source
  package

> Cheers and God bless,
> Paul

Regards
Marco


---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus

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

* Re: How is a Cygwin EXE/DLL customized?
  2018-07-26  7:27 ` Marco Atzeri
@ 2018-07-26 12:42   ` cyg Simple
  0 siblings, 0 replies; 3+ messages in thread
From: cyg Simple @ 2018-07-26 12:42 UTC (permalink / raw)
  To: cygwin-developers

On 7/26/2018 3:26 AM, Marco Atzeri wrote:
> Am 26.07.2018 um 00:25 schrieb Paul Benedict:
>> Good day,
>>
> 
>> If what I am seeing is correct, can I be pointed to the Cygwin Git
>> project and/or files where those customizations of GCC and LD have
>> taken place? I am really interested in learning the "boot" sequences
>> of Cygwin EXE/DLL and how they get written into the binaries.
>> Documentation in this area seems very scarce.
> 
> you should look at the patches for GCC included in the source package
> code. You can download it with cygwin setup, just click on the "Src ?"
> column for the gcc row. It will be put in "/usr/src"
> 

You should also move this conversation to cygwin@cygwin.com as this list
is about developing Cygwin, not a general forum of how things are done.

-- 
cyg Simple

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

end of thread, other threads:[~2018-07-26 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25 22:25 How is a Cygwin EXE/DLL customized? Paul Benedict
2018-07-26  7:27 ` Marco Atzeri
2018-07-26 12:42   ` cyg Simple

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).