public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Function call difference between cygwin and Windows
@ 2019-07-19  8:23 Biswapriyo Nath
  2019-07-19 12:45 ` Václav Haisman
  0 siblings, 1 reply; 2+ messages in thread
From: Biswapriyo Nath @ 2019-07-19  8:23 UTC (permalink / raw)
  To: cygwin

If a function calls both cygwin and Windows functions the binary creates
extra subroutine (in assembly) for cygwin ones. Example:

* Windows function:

   call cs:CreatePipe

* cygwin function:

   call ioctl

   ioctl proc near
   jmp cs:__imp_ioctl
   endp

The binary is statically compiled. Why there are extra subroutines? Is this
"by-design"? Or am I missing something?

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

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

* Re: Function call difference between cygwin and Windows
  2019-07-19  8:23 Function call difference between cygwin and Windows Biswapriyo Nath
@ 2019-07-19 12:45 ` Václav Haisman
  0 siblings, 0 replies; 2+ messages in thread
From: Václav Haisman @ 2019-07-19 12:45 UTC (permalink / raw)
  To: cygwin

On Fri, 19 Jul 2019 at 10:23, Biswapriyo Nath wrote:
>
> If a function calls both cygwin and Windows functions the binary creates
> extra subroutine (in assembly) for cygwin ones. Example:
>
> * Windows function:
>
>    call cs:CreatePipe
>
> * cygwin function:
>
>    call ioctl
>
>    ioctl proc near
>    jmp cs:__imp_ioctl
>    endp
>
> The binary is statically compiled. Why there are extra subroutines? Is this
> "by-design"? Or am I missing something?

This is how Windows DLLs work. See also
<https://stackoverflow.com/a/22688670/341065>.

-- 
VH

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

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

end of thread, other threads:[~2019-07-19 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19  8:23 Function call difference between cygwin and Windows Biswapriyo Nath
2019-07-19 12:45 ` Václav Haisman

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