FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 02-20-2010, 08:55 AM
Enrico Scholz
 
Default How to package .so linker scripts?

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
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-20-2010, 10:10 AM
Kevin Kofler
 
Default How to package .so linker scripts?

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

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-20-2010, 10:39 AM
Enrico Scholz
 
Default How to package .so linker scripts?

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
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-20-2010, 08:49 PM
Roland McGrath
 
Default How to package .so linker scripts?

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
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 02-22-2010, 08:56 AM
Enrico Scholz
 
Default How to package .so linker scripts?

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
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 09:07 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org