public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: De-Jian Zhao <dejian.zhao@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Why /usr/bin/*.dll must be executable?
Date: Fri, 20 Apr 2012 17:32:00 -0000	[thread overview]
Message-ID: <4F919DA6.7000700@gmail.com> (raw)
In-Reply-To: <20120420162718.GK22155@calimero.vinschen.de>

On 2012-4-21 0:27, Corinna Vinschen wrote:
> On Apr 21 00:17, De-Jian Zhao wrote:
>> On 2012-4-20 21:07, Václav Zeman wrote:
>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>> Hi,
>>>>
>>>> When I type "cyg" and Tab, many executables starting with "cyg" are listed
>>>> (Display all 262 possibilities? (y or n) y). I find that many of them are
>>>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>>>> executable applications (*.exe). Since *.dll files are only libraries, they
>>>> are not necessary to have the attribute of "x". Thus, I run the command
>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed the
>>>> terminal and failed to restart Cygwin. I started my  older version of Cygwin
>>>> (I did not deleted it after installing a new version), and added "x" to the
>>>> previous *.dll files. The dead Cygwin revived.
>>>>
>>>> I am confused why /usr/bin/*.dll should be executable. I thought they were
>>>> only library files. When I tried to run a dll file, bash says "cannot
>>>> execute binary file". Are there some hidden stories?
>>> DLLs are executables thus they need the +x bit. This is a Windows thing.
>>>
>> If this is a windows thing, removing the x bit should not affect
>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
> Windows requires the x bit for DLLs to be loadable as executable code
> into the address space of a process.  As Václav wrote, it's a Windows
> thing.

Can Windows see the rwx bits assigned by Cygwin to the files? I tried 
removing the x bit of an executable file blastall.exe (chmod a-x 
blastall.exe); the file can not be executed under Cygwin, but still can 
be executed under cmd console of Windows. It seems that Windows does not 
honor the rwx bits assigned by Cygwin.

Is there a detailed description of the starting process of Cygwin 
system? Or, how does Cygwin interact with *.dll files?

After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" and 
perl could not be started any more. This could be cured by ran "chmod 
a+x /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary 
executables will communicate with their corresponding *.dll files when 
executed. The *.dll provide the required functions and subroutines and 
that's enough. There is no need to mark *.dll with an x bit.

I have no strong background of computer science. Maybe there is some 
basic knowledge beyond my imagination. Hope you can help disclose it to 
me. Thanks.


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

  parent reply	other threads:[~2012-04-20 17:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 13:03 De-Jian Zhao
2012-04-20 13:05 ` De-Jian Zhao
2012-04-20 13:08 ` Václav Zeman
2012-04-20 16:18   ` De-Jian Zhao
2012-04-20 16:28     ` Corinna Vinschen
2012-04-20 17:25       ` Nellis, Kenneth
2012-04-20 17:29         ` Larry Hall (Cygwin)
2012-04-20 17:37           ` De-Jian Zhao
2012-04-20 17:46             ` Larry Hall (Cygwin)
2012-04-20 17:40           ` Nellis, Kenneth
2012-04-20 17:32       ` De-Jian Zhao [this message]
2012-04-20 17:41         ` Larry Hall (Cygwin)
2012-04-20 17:47           ` De-Jian Zhao
2012-04-20 17:58             ` Larry Hall (Cygwin)
2012-04-20 18:21               ` De-Jian Zhao
2012-04-20 18:43                 ` Larry Hall (Cygwin)
2012-04-20 22:10                 ` Mike Kaganski
2012-04-22  2:29                   ` Larry Hall (Cygwin)
2012-04-20 18:05             ` Larry Hall (Cygwin)
2012-04-23 19:01   ` Warren Young
2012-04-23 20:16     ` Larry Hall (Cygwin)
2012-04-23 22:13       ` Warren Young
2012-04-23 23:55       ` Richard Troy
2012-04-24  0:19         ` Warren Young
2012-04-24 16:49           ` Larry Hall (Cygwin)
2012-04-20 19:06 ` Jon TURNEY
2012-04-21  3:37   ` De-Jian Zhao
2012-04-23 19:02   ` Warren Young
2012-04-23 19:26     ` David Sastre Medina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F919DA6.7000700@gmail.com \
    --to=dejian.zhao@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).