diff mbox

ARM hard-float linker path - consensus

Message ID 20120418123542.GL2880@linaro.org
State New
Headers show

Commit Message

Steve McIntyre April 18, 2012, 12:35 p.m. UTC
On Fri, Apr 13, 2012 at 06:37:11PM +0100, Steve McIntyre wrote:
>Hi folks,
>
>As promised, here's minutes from the call we had this
>afternoon. Spoiler: the result we've agreed is
>
>  /lib/ld-linux-armhf.so.3
>
>And here's a transcription of the minutes from
>
>  https://wiki.linaro.org/OfficeofCTO/HardFloat/LinkerPathCallApr2012

And there's a slight wrinkle we've found (of course). The change of
the filename equates to a change of soname for the linker too. Adam
found this a couple of days back when doing rebuilds of the glibc and
toolchain packages in Ubuntu, and between us we've come up with a
(hacky, ugly, *never* to be upstreamed) solution. It seems to work
fine for us, to at least allow for supporting old binaries until
packages are all rebuilt to use the new linker path/soname. Just
talking to Andreas, the openSUSE folks are running with this too.

/me waits for the barrage of rotten fruit...



Cheers,
diff mbox

Patch

============================

For backward compatibility with armhf binaries built with the
old linker SONAME, we need to fake out the linker to believe
the new is the old, until such a point as everything is rebuilt

--- eglibc-2.15.orig/elf/dl-load.c      2012-04-14 12:11:37.000000000 +0000
+++ eglibc-2.15/elf/dl-load.c   2012-04-15 00:39:36.558765502 +0000
@@ -2303,10 +2303,13 @@ 
          soname = ((const char *) D_PTR (l, l_info[DT_STRTAB])
                    + l->l_info[DT_SONAME]->d_un.d_val);
          if (strcmp (name, soname) != 0)
+#ifdef __arm__
+            if (strcmp(name, "ld-linux.so.3") || strcmp(soname, "ld-linux-armhf.so.3"))
+#endif
            continue;
 
          /* We have a match on a new name -- cache it.  */
-         add_name_to_object (l, soname);
+         add_name_to_object (l, name);
          l->l_soname_added = 1;
        }