forked from pool/glibc
Andreas Schwab
30e48d0d7f
- Update to glibc 2.21 release. * A new semaphore algorithm has been implemented in generic C code for all machines * Added support for TSX lock elision of pthread mutexes on powerpc32, powerpc64 and powerpc64le * Optimized strcpy, stpcpy, strchrnul and strrchr implementations for AArch64 * i386 memcpy functions optimized with SSE2 unaligned load/store * New locales: tu_IN, bh_IN, raj_IN, ce_RU * The obsolete sigvec function has been removed - Patches from upstream removed * ifunc-x86-slow-sse4.patch * pthread-mutex-trylock-elision.patch - o-tmpfile.patch: Fix value of O_TMPFILE for architectures with non-default O_DIRECTORY (BZ #17912) OBS-URL: https://build.opensuse.org/request/show/285070 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=391
58 lines
1.7 KiB
Diff
58 lines
1.7 KiB
Diff
Index: glibc-2.20/elf/rtld.c
|
|
===================================================================
|
|
--- glibc-2.20.orig/elf/rtld.c
|
|
+++ glibc-2.20/elf/rtld.c
|
|
@@ -1591,6 +1591,52 @@ ERROR: ld.so: object '%s' cannot be load
|
|
}
|
|
}
|
|
|
|
+#if defined(__i386__)
|
|
+ /*
|
|
+ * Modifications by Red Hat Software
|
|
+ *
|
|
+ * Deal with the broken binaries from the non-versioned ages of glibc.
|
|
+ * If a binary does not have version information enabled, we assume that
|
|
+ * it is a glibc 2.0 binary and we load a compatibility library to try to
|
|
+ * overcome binary incompatibilities.
|
|
+ * Blame: gafton@redhat.com
|
|
+ */
|
|
+#define LIB_NOVERSION "/lib/obsolete/noversion/libNoVersion.so.1"
|
|
+
|
|
+ if (__glibc_unlikely (main_map->l_info[DT_NUM + DT_THISPROCNUM
|
|
+ + DT_VERSIONTAGIDX (DT_VERNEED)]
|
|
+ == NULL)
|
|
+ && (main_map->l_info[DT_DEBUG] != 0
|
|
+ || !(GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)))
|
|
+ {
|
|
+ struct stat test_st;
|
|
+ int test_fd;
|
|
+ bool can_load;
|
|
+
|
|
+ HP_TIMING_NOW (start);
|
|
+
|
|
+ can_load = true;
|
|
+ test_fd = __open (LIB_NOVERSION, O_RDONLY);
|
|
+ if (test_fd < 0)
|
|
+ can_load = false;
|
|
+ else
|
|
+ {
|
|
+ if (__fxstat (_STAT_VER, test_fd, &test_st) < 0
|
|
+ || test_st.st_size == 0)
|
|
+ can_load = false;
|
|
+ __close(test_fd);
|
|
+ }
|
|
+
|
|
+ if (can_load)
|
|
+ npreloads += do_preload (LIB_NOVERSION, main_map,
|
|
+ "nonversioned binary");
|
|
+
|
|
+ HP_TIMING_NOW (stop);
|
|
+ HP_TIMING_DIFF (diff, start, stop);
|
|
+ HP_TIMING_ACCUM_NT (load_time, diff);
|
|
+ }
|
|
+#endif
|
|
+
|
|
if (__glibc_unlikely (*first_preload != NULL))
|
|
{
|
|
/* Set up PRELOADS with a vector of the preloaded libraries. */
|