Shared library permissions

Bruce Dubbs bdubbs at
Mon Aug 22 12:59:44 PDT 2005

Matthew Burgess 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].

[Links deleted]

> So, after all that, there's lots of anecdotal evidence that we should
> retain the execute permissions on shared libs, but nothing conclusive
> that it's *required* on modern Linux systems.  Can someone with far
> better googling skills (or just plain technical knowledge) be so good as
> to enlighten me, please?
> Regards,
> Matt
> [1] Exceptions being: /lib/ (555), /usr/lib/
> (644), /usr/lib/ (644), /usr/lib/
> (644), and Perl's modules (555)
> [2]

I don't know how often it is true, but you can execute some libraries.
For example:

$ /lib/
GNU C Library stable release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Compiled by GNU CC version 3.4.3.
Compiled on a Linux 2.6.11 system on 2005-04-06.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        Native POSIX Threads Library by Ulrich Drepper et al
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:

  -- Bruce

More information about the lfs-dev mailing list