Hi,
after replacing .so files with linker scripts, I get
| ldconfig: /usr/lib64/libxmlrpc_client.so is not an ELF file - it has the wrong magic bytes at the start.
from /sbin/ldconfig calls. File above is
| $ ls -l /usr/lib64/libxmlrpc_client.so | -rw-r--r--. 1 root root 108 15. Feb 22:34 /usr/lib64/libxmlrpc_client.so | $ cat /usr/lib64/libxmlrpc_client.so | INPUT(/usr/lib64/libxmlrpc_client.so.3 AS_NEEDED(/usr/lib64/libxmlrpc.so.3 /usr/lib64/libxmlrpc_util.so.3)) | $
Other linker scripts have a similar format and same permissions but do not create this warning.
What am I doing wrong?
Enrico
Enrico Scholz wrote:
after replacing .so files with linker scripts, I get
| ldconfig: /usr/lib64/libxmlrpc_client.so is not an ELF file - it has the | wrong magic bytes at the start.
from /sbin/ldconfig calls. File above is
| $ ls -l /usr/lib64/libxmlrpc_client.so | -rw-r--r--. 1 root root 108 15. Feb 22:34 /usr/lib64/libxmlrpc_client.so | $ cat /usr/lib64/libxmlrpc_client.so | INPUT(/usr/lib64/libxmlrpc_client.so.3 | AS_NEEDED(/usr/lib64/libxmlrpc.so.3 /usr/lib64/libxmlrpc_util.so.3)) $
Other linker scripts have a similar format and same permissions but do not create this warning.
What am I doing wrong?
Check the library's DT_SONAME field, it should be libxmlrpc.so.3, not libxmlrpc.so (which I suspect it is).
Kevin Kofler
Kevin Kofler kevin.kofler@chello.at writes:
| ldconfig: /usr/lib64/libxmlrpc_client.so is not an ELF file - it has the | wrong magic bytes at the start.
... Check the library's DT_SONAME field, it should be libxmlrpc.so.3, not libxmlrpc.so (which I suspect it is).
should be ok:
$ readelf -a /usr/lib64/libxmlrpc*.so.3 | grep SON 0x000000000000000e (SONAME) Library soname: [libxmlrpc.so.3] 0x000000000000000e (SONAME) Library soname: [libxmlrpc_abyss.so.3] 0x000000000000000e (SONAME) Library soname: [libxmlrpc_client.so.3] 0x000000000000000e (SONAME) Library soname: [libxmlrpc_server.so.3] 0x000000000000000e (SONAME) Library soname: [libxmlrpc_server_abyss.so.3] 0x000000000000000e (SONAME) Library soname: [libxmlrpc_server_cgi.so.3] 0x000000000000000e (SONAME) Library soname: [libxmlrpc_util.so.3]
Enrico
What ldconfig actually does is fairly stupid. When a file is not something else (i.e. ELF), it checks if the entire contents contain either "GROUP" or "GNU ld script" and barfs if they don't.
So the generic advice is to put:
/* GNU ld script Explain briefly what this is here for. */
at the top of your installed linker script. That's what's in the installed linker scripts you noticed working fine.
In your case, INPUT and GROUP are completely equivalent. (GROUP really only matters when .a libraries are involved.) So you could also s/INPUT/GROUP/ (or, equivalently, use INPUT(GROUP(...))) if you like.
But using a comment containing the magic string "GNU ld script" seems like the most sensible thing given ldconfig's behavior. It seems to me we might want to change ldconfig to be less obtuse about this. But that will come later if it does. For example, we can have its message explicitly tell you to add the magic comment if it's a linker script, and perhaps we can make that just a warning rather than a fatal error.
Thanks, Roland
Roland McGrath roland@redhat.com writes:
So the generic advice is to put:
/* GNU ld script
thx; adding this comment fixed the ldconfig issue.
Enrico