1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/ports-2.10.1/630-mips_shn_undef-hack.patch Fri Apr 08 00:59:32 2011 +0200
1.3 @@ -0,0 +1,24 @@
1.4 + Hack from Debian to hopefully get sandbox working on mips
1.5 +
1.6 +<`Kumba> ths: given the SHN_UNDEF thing is a hack, what's the preferred solution?
1.7 +<ths> For fakeroot the simplest trigger is "fakeroot file /bin/ls".
1.8 +<ths> `Kumba: I haven't found a better one yet.
1.9 +<ths> Probably marker symbols around the stub section, and then exclude it from the link map.
1.10 +<ths> This needs a ld change.
1.11 +
1.12 +diff -durN glibc-2.10.1.orig/elf/do-lookup.h glibc-2.10.1/elf/do-lookup.h
1.13 +--- glibc-2.10.1.orig/elf/do-lookup.h 2009-03-30 23:14:32.000000000 +0200
1.14 ++++ glibc-2.10.1/elf/do-lookup.h 2009-11-13 00:51:36.000000000 +0100
1.15 +@@ -248,6 +248,12 @@
1.16 + }
1.17 + /* FALLTHROUGH */
1.18 + case STB_GLOBAL:
1.19 ++#ifdef __mips__
1.20 ++ /* HACK: MIPS marks its lazy evaluation stubs with SHN_UNDEF
1.21 ++ symbols, we skip them. */
1.22 ++ if (sym->st_shndx == SHN_UNDEF)
1.23 ++ break;
1.24 ++#endif
1.25 + /* Global definition. Just what we need. */
1.26 + result->s = sym;
1.27 + result->m = (struct link_map *) map;