On 8/23/05, Matthew Burgess <[EMAIL PROTECTED]> wrote:
> Hi folks.
> 
> Does anyone know why shared libraries need the execute bit set on them?
>  My most recent build (gcc4-based) has most[1] *.so files installed
> with 755 permissions.  As it's so consistent, I'm assuming there is a
> reason for them to be executable.  Thanks to Tarek Ghaleb and Andrew
> Benton for highlighting the issue [2].
> 

As you indicated other commercial UNIX's historically set the execute
permission bit. This was used to help the VM subsystem determine what
memory pages should be given priority to remain in memory (executable
pages get priority).

Modern systems (inclduing Linux I *believe*, although have not
confirmed) now examine various elements of the actual file as it is
loaded to determine this, therefore the execute bit is no longer used
to make this decision. Thats certainly true of Solaris 9 and above,
and HPUX 11i.

Failing to set the execute bit on a shared library should therefore
only become an issue if the Linux VM uses that as a hint for paging,
and even then will only impact paging performance (slightly), not
break anything.

That said, it is useful to leave libc.6.so as executable so you can
run the library to get the version details.

-- -
Steve Crosby
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to