patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch
author danielrubiob@gmail.com
Tue Feb 11 21:34:48 2014 +0100 (2014-02-11)
changeset 3285 a8cb9039fade
permissions -rw-r--r--
complibs/cloog: bump version

Signed-off-by: Daniel Rubio Bonilla <danielrubiob@gmail.com>
[yann.morin.1998@free.fr: re-order versions]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Cody P Schafer <dev@codyps.com>
Message-Id: <c2de3964cd6d5e4173cc.1391984023@uemo>
Patchwork-Id: 318637
yann@1625
     1
	Hack from Debian to hopefully get sandbox working on mips
yann@1625
     2
yann@1625
     3
<`Kumba> ths: given the SHN_UNDEF thing is a hack, what's the preferred solution?
yann@1625
     4
<ths> For fakeroot the simplest trigger is "fakeroot file /bin/ls".
yann@1625
     5
<ths> `Kumba: I haven't found a better one yet.
yann@1625
     6
<ths> Probably marker symbols around the stub section, and then exclude it from the link map.
yann@1625
     7
<ths> This needs a ld change.
yann@1625
     8
yann@1625
     9
diff -durN glibc-2.10.1.orig/elf/do-lookup.h glibc-2.10.1/elf/do-lookup.h
yann@1625
    10
--- glibc-2.10.1.orig/elf/do-lookup.h	2009-03-30 23:14:32.000000000 +0200
yann@1625
    11
+++ glibc-2.10.1/elf/do-lookup.h	2009-11-13 00:51:36.000000000 +0100
yann@1625
    12
@@ -248,6 +248,12 @@
yann@1625
    13
 		}
yann@1625
    14
 	      /* FALLTHROUGH */
yann@1625
    15
 	    case STB_GLOBAL:
yann@1625
    16
+#ifdef __mips__
yann@1625
    17
+	      /* HACK: MIPS marks its lazy evaluation stubs with SHN_UNDEF
yann@1625
    18
+		 symbols, we skip them. */
yann@1625
    19
+	      if (sym->st_shndx == SHN_UNDEF)
yann@1625
    20
+		break;
yann@1625
    21
+#endif
yann@1625
    22
 	      /* Global definition.  Just what we need.  */
yann@1625
    23
 	      result->s = sym;
yann@1625
    24
 	      result->m = (struct link_map *) map;