Non-executable shared objects work fine, but libraries marked executable may also be runnable as standalone programs.
So, what's the point of setting this x?
None, unless you want them to emit version or other info
Must all library packagers do that?
What will happen if I dlopen() a shared library that has 0644
You'll get a new shared object handle (so long as the file is readable etc.) ... the exec bit doesn't affect this
As to why libraries which aren't usable as standalone executables still have the exec bit set: this is probably just an artefact of the build system or link script used.
example output, just for reference:
GNU C Library (Ubuntu EGLIBC 2.15-0ubuntu10) stable release version 2.15, by Roland McGrath et al.
Copyright (C) 2012 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 4.6.3.
Compiled on a Linux 3.2.14 system on 2012-04-19.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see: