summaryrefslogtreecommitdiff
path: root/recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch')
-rw-r--r--recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch b/recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch
new file mode 100644
index 0000000000..d3dffef9e2
--- /dev/null
+++ b/recipes/glibc/glibc-2.3.2/glibc23-errno-hack.patch
@@ -0,0 +1,58 @@
+--- glibc-2.3.2/elf/rtld.c.orig 2003-11-02 16:12:36.000000000 -0500
++++ glibc-2.3.2/elf/rtld.c 2003-11-02 16:24:43.000000000 -0500
+@@ -966,6 +966,55 @@ of this helper program; chances are you
+ GL(dl_rtld_map).l_prev = GL(dl_loaded);
+ ++GL(dl_nloaded);
+
++#if defined(__linux__) && defined(__i386__)
++ /* Debian note: this code imported from Red Hat. */
++ /* Force non-TLS libraries for glibc 2.0 binaries
++ or if a buggy binary references non-TLS errno or h_errno. */
++ if (__builtin_expect (GL(dl_loaded)->l_info[DT_NUM
++ + DT_THISPROCNUM
++ + DT_VERSIONTAGIDX (DT_VERNEED)]
++ == NULL, 0)
++ && GL(dl_loaded)->l_info[DT_DEBUG])
++ GL(dl_osversion) = 0x20401;
++ else if ((__builtin_expect (mode, normal) != normal
++ || GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_LIBLIST)] == NULL)
++ /* Only binaries have DT_DEBUG dynamic tags... */
++ && GL(dl_loaded)->l_info[DT_DEBUG])
++ {
++ /* Workaround for buggy binaries. This doesn't handle buggy
++ libraries. */
++ bool buggy = false;
++ const ElfW(Sym) *symtab = (const void *) D_PTR (GL(dl_loaded), l_info[DT_SYMTAB]);
++ const char *strtab = (const void *) D_PTR (GL(dl_loaded), l_info[DT_STRTAB]);
++ Elf_Symndx symidx;
++ for (symidx = GL(dl_loaded)->l_buckets[0x6c994f % GL(dl_loaded)->l_nbuckets];
++ !buggy && symidx != STN_UNDEF;
++ symidx = GL(dl_loaded)->l_chain[symidx])
++ {
++ if (__builtin_expect (strcmp (strtab + symtab[symidx].st_name,
++ "errno") == 0, 0)
++ && ELFW(ST_TYPE) (symtab[symidx].st_info) != STT_TLS)
++ buggy = true;
++ }
++ for (symidx = GL(dl_loaded)->l_buckets[0xe5c992f % GL(dl_loaded)->l_nbuckets];
++ !buggy && symidx != STN_UNDEF;
++ symidx = GL(dl_loaded)->l_chain[symidx])
++ {
++ if (__builtin_expect (strcmp (strtab + symtab[symidx].st_name,
++ "h_errno") == 0, 0)
++ && ELFW(ST_TYPE) (symtab[symidx].st_info) != STT_TLS)
++ buggy = true;
++ }
++ if (__builtin_expect (buggy, false))
++ {
++ if (GL(dl_osversion) > 0x20401)
++ GL(dl_osversion) = 0x20401;
++ _dl_error_printf ("ld.so: Incorrectly built binary which accesses errno or h_errno directly.\n"
++ "ld.so: See /usr/share/doc/libc6/FAQ.gz.\n");
++ }
++ }
++#endif
++
+ /* Set up the program header information for the dynamic linker
+ itself. It is needed in the dl_iterate_phdr() callbacks. */
+ ElfW(Ehdr) *rtld_ehdr = (ElfW(Ehdr) *) GL(dl_rtld_map).l_map_start;