This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[COMMITTED] elf/ldconfig.c: Expand comment in search_dir.

Developers should be careful to make sure their development
libraries always point to the SONAME file and not the arbitrary
package name or ldconfig may create the wrong set of links.
After working this out for some Red Hat packages I decided to
add more comments to search_dir. The comments should be self
explanatory and are exactly what ldconfig does. I have yet to
talk about the badness that happens if you say copy to and is not u+x, perhaps I'll either fix
that (by preventing symlinks to non-u+x files or documenting
it in more comments).

2014-11-29  Carlos O'Donell  <>

	* elf/ldconfig.c (search_dir): Expand comment.

--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -893,8 +893,30 @@ search_dir (const struct dir_entry *entry)
       /* A link may just point to itself.  */
       if (is_link)
-         /* If the path the link points to isn't its soname and it is not
-            .so symlink for ld(1) only, we treat it as a normal file.  */
+         /* If the path the link points to isn't its soname or it is not
+            the .so symlink for ld(1), we treat it as a normal file.
+            You should always do this:
+      -> SONAME -> Arbitrary package-chosen name.
+            e.g. -> ->
+            Given a SONAME of
+            You should *never* do this:
+      ->
+            If you do, and your SONAME is, then
+            fails to point at the SONAME. In that case ldconfig may consider
+   as another implementation of SONAME and will create
+            symlinks against it causing problems when you try to upgrade
+            or downgrade. The problems will arise because ldconfig will,
+            depending on directory ordering, creat symlinks against
+            e.g. ->, but when is removed
+            (typically by the removal of a development pacakge not required
+            for the runtime) it will break the symlink and the
+            application will fail to start.  */
          const char *real_base_name = basename (real_file_name);
          if (strcmp (real_base_name, soname) != 0)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]