patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Wed Jun 25 23:33:01 2014 +0200 (2014-06-25)
changeset 3325 069f43a215cc
permissions -rw-r--r--
all: fix wildcard to work with make-4.x

In make-3.8x, the $(wildacrd) function would sort the entries,
while in make-4.x, it would just return the entries in any
unpredictable order [*]

Use the $(sort) function to get reproducible behaviour.

[*] Well, most probably the roder the entries appear when read
from readdir()

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