How to package .so linker scripts?

Roland McGrath roland at redhat.com
Sat Feb 20 21:49:47 UTC 2010


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


More information about the devel mailing list