diff --git a/tools/mklibs/Makefile b/tools/mklibs/Makefile
index bd967217ead4998758163e11190500bf6af2c460..7a82848adbd8f27899b02e24f8f4d16a6863b347 100644
--- a/tools/mklibs/Makefile
+++ b/tools/mklibs/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009 OpenWrt.org
+# Copyright (C) 2009-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,13 +7,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mklibs
-PKG_VERSION:=0.1.29
+PKG_VERSION:=0.1.34
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/m/mklibs/
-PKG_MD5SUM:=7f35dfdbde249a090199829c1a1222d8
-
-HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/mklibs
+PKG_MD5SUM:=afe0ed527ba96b8a882b5de350603007
 
 include $(INCLUDE_DIR)/host-build.mk
 
@@ -21,8 +19,8 @@ HOST_CFLAGS += -I$(CURDIR)/include
 
 define Host/Install
        $(INSTALL_BIN) \
-               $(HOST_BUILD_DIR)/src/mklibs.py \
-               $(HOST_BUILD_DIR)/src/mklibs-copy.py \
+               $(HOST_BUILD_DIR)/src/mklibs \
+               $(HOST_BUILD_DIR)/src/mklibs-copy \
                $(HOST_BUILD_DIR)/src/mklibs-readelf/mklibs-readelf \
                $(STAGING_DIR_HOST)/bin/
 endef
diff --git a/tools/mklibs/patches/001-missing_includes.patch b/tools/mklibs/patches/001-missing_includes.patch
deleted file mode 100644
index 9f3485cb1b2483d6f6916776559547f64b5d42b6..0000000000000000000000000000000000000000
--- a/tools/mklibs/patches/001-missing_includes.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/src/mklibs-readelf/elf.cpp
-+++ b/src/mklibs-readelf/elf.cpp
-@@ -25,6 +25,7 @@
- #include <fcntl.h>
- #include <sys/mman.h>
- #include <sys/stat.h>
-+#include <unistd.h>
- 
- using namespace Elf;
- 
---- a/src/mklibs-readelf/main.cpp
-+++ b/src/mklibs-readelf/main.cpp
-@@ -7,6 +7,7 @@
- 
- #include <elf.h>
- #include <getopt.h>
-+#include <stdio.h>
- 
- #include "elf.hpp"
- 
diff --git a/tools/mklibs/patches/002-disable_symbol_checks.patch b/tools/mklibs/patches/002-disable_symbol_checks.patch
index 7ec63937c430309b9bc0c01fc59f2b1ccab28adb..44be637609d7ff2247686cb8f1fd69b20fb6d4b5 100644
--- a/tools/mklibs/patches/002-disable_symbol_checks.patch
+++ b/tools/mklibs/patches/002-disable_symbol_checks.patch
@@ -1,23 +1,20 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -500,7 +500,7 @@ while 1:
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -524,7 +524,7 @@ while 1:
          # No progress in last pass. Verify all remaining symbols are weak.
          for name in unresolved:
              if not needed_symbols[name].weak:
--                raise "Unresolvable symbol %s" % name
+-                raise Exception("Unresolvable symbol %s" % name)
 +                print "WARNING: Unresolvable symbol %s" % name
          break
  
      previous_pass_unresolved = unresolved
-@@ -533,10 +533,7 @@ while 1:
- 
-     # which symbols are actually used from each lib
+@@ -559,7 +559,7 @@ while 1:
      for name in needed_symbols:
--        if not name in symbol_provider:
--            if not needed_symbols[name].weak:
--                raise "No library provides non-weak %s" % name
--        else:
-+        if name in symbol_provider:
+         if not name in symbol_provider:
+             if not needed_symbols[name].weak:
+-                raise Exception("No library provides non-weak %s" % name)
++                print "WARNING: Unresolvable symbol %s" % name
+         else:
              lib = symbol_provider[name]
              library_symbols_used[lib].add(library_symbols[lib][name])
- 
diff --git a/tools/mklibs/patches/003-no_copy.patch b/tools/mklibs/patches/003-no_copy.patch
index bd6505aff996d9bd3c158ee2c1c00b780d039102..e0ab2ac88d198e0be480c157f6c875d3fb5fcde3 100644
--- a/tools/mklibs/patches/003-no_copy.patch
+++ b/tools/mklibs/patches/003-no_copy.patch
@@ -1,6 +1,6 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -440,7 +440,7 @@ while 1:
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -463,7 +463,7 @@ while 1:
      passnr = passnr + 1
      # Gather all already reduced libraries and treat them as objects as well
      small_libs = []
@@ -9,7 +9,7 @@
          obj = dest_path + "/" + lib
          small_libs.append(obj)
          inode = os.stat(obj)[ST_INO]
-@@ -552,12 +552,7 @@ while 1:
+@@ -579,12 +579,7 @@ while 1:
          if not so_file:
              sys.exit("File not found:" + library)
          pic_file = find_pic(library)
@@ -23,7 +23,7 @@
              # we have a pic file, recompile
              debug(DEBUG_SPAM, "extracting from:", pic_file, "so_file:", so_file)
              soname = extract_soname(so_file)
-@@ -600,22 +595,14 @@ while 1:
+@@ -627,22 +622,14 @@ while 1:
              cmd.append(library_depends_gcc_libnames(so_file))
              command(target + "gcc", *cmd)
  
diff --git a/tools/mklibs/patches/004-libpthread_link.patch b/tools/mklibs/patches/004-libpthread_link.patch
index b4a6e4f51321832b2b891023c4fdee62044da51a..657e232b0cba4a7d21f216db2a5f13df141bd9cf 100644
--- a/tools/mklibs/patches/004-libpthread_link.patch
+++ b/tools/mklibs/patches/004-libpthread_link.patch
@@ -1,13 +1,13 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -105,14 +105,14 @@ def library_depends(obj):
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -106,14 +106,14 @@ def library_depends(obj):
  
  # Return a list of libraries the passed objects depend on. The
  # libraries are in "-lfoo" format suitable for passing to gcc.
 -def library_depends_gcc_libnames(obj):
 +def library_depends_gcc_libnames(obj, soname):
      if not os.access(obj, os.F_OK):
-         raise "Cannot find lib: " + obj
+         raise Exception("Cannot find lib: " + obj)
      libs = library_depends(obj)
      ret = []
      for i in libs:
@@ -17,7 +17,7 @@
              if match.group('ld'):
                  ret.append(find_lib(match.group(0)))
              elif match.group('lib'):
-@@ -592,7 +592,7 @@ while 1:
+@@ -619,7 +619,7 @@ while 1:
              cmd.extend(extra_flags)
              cmd.append("-lgcc")
              cmd.extend(["-L%s" % a for a in [dest_path] + [sysroot + b for b in lib_path if sysroot == "" or b not in ("/" + libdir + "/", "/usr/" + libdir + "/")]])
diff --git a/tools/mklibs/patches/005-duplicate_syms.patch b/tools/mklibs/patches/005-duplicate_syms.patch
new file mode 100644
index 0000000000000000000000000000000000000000..b899330f5917fa9e654ecf5df0fe10a8beb002d1
--- /dev/null
+++ b/tools/mklibs/patches/005-duplicate_syms.patch
@@ -0,0 +1,39 @@
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -509,10 +509,7 @@ while 1:
+     num_unresolved = 0
+     unresolved = set()
+     for name in needed_symbols:
+-        if not name in present_symbols:
+-            debug(DEBUG_SPAM, "Still need: %s" % name)
+-            unresolved.add(name)
+-            num_unresolved = num_unresolved + 1
++        library_symbols[library][name] = symbol
+ 
+     debug (DEBUG_NORMAL, `len(needed_symbols)`, "symbols,",
+            `num_unresolved`, "unresolved")
+@@ -531,7 +528,6 @@ while 1:
+ 
+     library_symbols = {}
+     library_symbols_used = {}
+-    symbol_provider = {}
+ 
+     # WORKAROUND: Always add libgcc on old-abi arm
+     header = elf_header(find_lib(libraries.copy().pop()))
+@@ -557,12 +553,10 @@ while 1:
+ 
+     # which symbols are actually used from each lib
+     for name in needed_symbols:
+-        if not name in symbol_provider:
+-            if not needed_symbols[name].weak:
+-                print "WARNING: Unresolvable symbol %s" % name
+-        else:
+-            lib = symbol_provider[name]
+-            library_symbols_used[lib].add(library_symbols[lib][name])
++        for lib in libraries:
++            if name in library_symbols[lib]:
++                library_symbols_used[lib].add(library_symbols[lib][name])
++
+ 
+     # reduce libraries
+     for library in libraries:
diff --git a/tools/mklibs/patches/005-readelf_fixes.patch b/tools/mklibs/patches/005-readelf_fixes.patch
deleted file mode 100644
index 8ae095455134e9fee836a621bd89015193413d6b..0000000000000000000000000000000000000000
--- a/tools/mklibs/patches/005-readelf_fixes.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/src/mklibs-readelf/main.cpp
-+++ b/src/mklibs-readelf/main.cpp
-@@ -57,6 +57,10 @@ static void process_elf_header (Elf::fil
- static void process_dynamics (Elf::file *file, int64_t tag)
- {
-   const Elf::section_type<Elf::section_type_DYNAMIC> *section = file->get_section_DYNAMIC ();
-+
-+  if (!section)
-+    return;
-+
-   for (std::vector<Elf::dynamic *>::const_iterator it = section->get_dynamics ().begin (); it != section->get_dynamics ().end (); ++it)
-   {
-     Elf::dynamic *dynamic = *it;
-@@ -67,6 +71,9 @@ static void process_dynamics (Elf::file
- 
- static void process_symbols_provided (const Elf::section_type<Elf::section_type_DYNSYM> *section)
- {
-+  if (!section)
-+    return;
-+
-   for (std::vector<Elf::symbol *>::const_iterator it = section->get_symbols ().begin (); it != section->get_symbols ().end (); ++it)
-   {
-     const Elf::symbol *symbol = *it;
-@@ -95,6 +102,9 @@ static void process_symbols_provided (co
- 
- static void process_symbols_undefined (const Elf::section_type<Elf::section_type_DYNSYM> *section)
- {
-+  if (!section)
-+    return;
-+
-   for (std::vector<Elf::symbol *>::const_iterator it = section->get_symbols ().begin (); it != section->get_symbols ().end (); ++it)
-   {
-     const Elf::symbol *symbol = *it;
diff --git a/tools/mklibs/patches/006-duplicate_syms.patch b/tools/mklibs/patches/006-duplicate_syms.patch
deleted file mode 100644
index 3f39ee5bb48cae0354d96c7df6a94465abe8e537..0000000000000000000000000000000000000000
--- a/tools/mklibs/patches/006-duplicate_syms.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -507,7 +507,6 @@ while 1:
- 
-     library_symbols = {}
-     library_symbols_used = {}
--    symbol_provider = {}
- 
-     # WORKAROUND: Always add libgcc on old-abi arm
-     header = elf_header(find_lib(libraries.copy().pop()))
-@@ -525,17 +524,13 @@ while 1:
-         library_symbols_used[library] = set()
-         for symbol in symbols:
-             for name in symbol.base_names():
--                if name in symbol_provider:
--                    debug(DEBUG_SPAM, "duplicate symbol %s in %s and %s" % (symbol, symbol_provider[name], library))
--                else:
--                    library_symbols[library][name] = symbol
--                    symbol_provider[name] = library
-+                library_symbols[library][name] = symbol
- 
-     # which symbols are actually used from each lib
-     for name in needed_symbols:
--        if name in symbol_provider:
--            lib = symbol_provider[name]
--            library_symbols_used[lib].add(library_symbols[lib][name])
-+        for lib in libraries:
-+            if name in library_symbols[lib]:
-+                library_symbols_used[lib].add(library_symbols[lib][name])
- 
-     # reduce libraries
-     for library in libraries:
diff --git a/tools/mklibs/patches/007-uclibc_init.patch b/tools/mklibs/patches/006-uclibc_init.patch
similarity index 89%
rename from tools/mklibs/patches/007-uclibc_init.patch
rename to tools/mklibs/patches/006-uclibc_init.patch
index e76515085c4bb7d5efcd8cbeaa8a88e1084c1919..63b595607c605ea615c96be3510a734f66d979e9 100644
--- a/tools/mklibs/patches/007-uclibc_init.patch
+++ b/tools/mklibs/patches/006-uclibc_init.patch
@@ -1,6 +1,6 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -571,6 +571,11 @@ while 1:
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -597,6 +597,11 @@ while 1:
                  extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o")
                  symbols.add(ProvidedSymbol('__dso_handle', None, None, True))
  
diff --git a/tools/mklibs/patches/008-gc_sections.patch b/tools/mklibs/patches/007-gc_sections.patch
similarity index 87%
rename from tools/mklibs/patches/008-gc_sections.patch
rename to tools/mklibs/patches/007-gc_sections.patch
index 2775493b092b171ecd73f77bc6c985b7b76d7646..2a75b675b56116b3b9ac64dedd6b67f83cb50841 100644
--- a/tools/mklibs/patches/008-gc_sections.patch
+++ b/tools/mklibs/patches/007-gc_sections.patch
@@ -1,6 +1,6 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -583,7 +583,7 @@ while 1:
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -609,7 +609,7 @@ while 1:
              # compile in only used symbols
              cmd = []
              cmd.extend(gcc_options)
diff --git a/tools/mklibs/patches/009-uclibc_libgcc_link.patch b/tools/mklibs/patches/008-uclibc_libgcc_link.patch
similarity index 88%
rename from tools/mklibs/patches/009-uclibc_libgcc_link.patch
rename to tools/mklibs/patches/008-uclibc_libgcc_link.patch
index 36f20671931bb2c0e42a852d623077e7d8e77e0d..648b8ef3fd302a2b6aa4b502b00c2c58cbf7cfe6 100644
--- a/tools/mklibs/patches/009-uclibc_libgcc_link.patch
+++ b/tools/mklibs/patches/008-uclibc_libgcc_link.patch
@@ -1,6 +1,6 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -112,11 +112,8 @@ def library_depends_gcc_libnames(obj, so
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -113,11 +113,8 @@ def library_depends_gcc_libnames(obj, so
      ret = []
      for i in libs:
          match = re.match("^(((?P<ld>ld\S*)|(lib(?P<lib>\S+))))\.so.*$", i)
@@ -14,7 +14,7 @@
      return ' '.join(ret)
  
  class Symbol(object):
-@@ -560,6 +557,7 @@ while 1:
+@@ -586,6 +583,7 @@ while 1:
              extra_flags = []
              extra_pre_obj = []
              extra_post_obj = []
@@ -22,7 +22,7 @@
  
              symbols.update(library_symbols_used[library])
  
-@@ -590,9 +588,10 @@ while 1:
+@@ -616,9 +614,10 @@ while 1:
              cmd.append(pic_file)
              cmd.extend(extra_post_obj)
              cmd.extend(extra_flags)
diff --git a/tools/mklibs/patches/010-uclibc_libpthread_symbols.patch b/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch
similarity index 92%
rename from tools/mklibs/patches/010-uclibc_libpthread_symbols.patch
rename to tools/mklibs/patches/009-uclibc_libpthread_symbols.patch
index 0c97216d1aa6bc6f16696ff2829047a390692506..50eb31ab77a4e93e064b98a3ee3eef187ee91b84 100644
--- a/tools/mklibs/patches/010-uclibc_libpthread_symbols.patch
+++ b/tools/mklibs/patches/009-uclibc_libpthread_symbols.patch
@@ -1,6 +1,6 @@
---- a/src/mklibs.py
-+++ b/src/mklibs.py
-@@ -161,9 +161,10 @@ def undefined_symbols(obj):
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -162,9 +162,10 @@ def undefined_symbols(obj):
      return result
  
  class ProvidedSymbol(Symbol):
@@ -12,7 +12,7 @@
  
      def base_names(self):
          ret = []
-@@ -204,11 +205,15 @@ def provided_symbols(obj):
+@@ -205,11 +206,15 @@ def provided_symbols(obj):
          if version_string.lower() not in ('base', 'none'):
              version = version_string
  
@@ -29,7 +29,7 @@
  
      return result
      
-@@ -476,6 +481,9 @@ while 1:
+@@ -500,6 +505,9 @@ while 1:
              debug(DEBUG_SPAM, "present_symbols adding %s" % symbol)
              names = symbol.base_names()
              for name in names:
@@ -39,7 +39,7 @@
                  present_symbols[name] = symbol
  
      # are we finished?
-@@ -567,12 +575,16 @@ while 1:
+@@ -593,12 +601,16 @@ while 1:
                  # may segfault in ptmalloc_init due to undefined weak reference
                  extra_pre_obj.append(sysroot + libc_extras_dir + "/soinit.o")
                  extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o")
diff --git a/tools/mklibs/patches/010-remove_STT_GNU_IFUNC.patch b/tools/mklibs/patches/010-remove_STT_GNU_IFUNC.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6bae8c7ce53c4f485f1b0b361534064e5bf938d5
--- /dev/null
+++ b/tools/mklibs/patches/010-remove_STT_GNU_IFUNC.patch
@@ -0,0 +1,20 @@
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -84,7 +84,7 @@ static void process_symbols_provided (co
+       continue;
+     if (shndx == SHN_UNDEF || shndx == SHN_ABS)
+       continue;
+-    if (type != STT_NOTYPE && type != STT_OBJECT && type != STT_FUNC && type != STT_GNU_IFUNC && type != STT_COMMON && type != STT_TLS)
++    if (type != STT_NOTYPE && type != STT_OBJECT && type != STT_FUNC && type != STT_COMMON && type != STT_TLS)
+       continue;
+     if (!name.size())
+       continue;
+@@ -115,7 +115,7 @@ static void process_symbols_undefined (c
+       continue;
+     if (shndx != SHN_UNDEF)
+       continue;
+-    if (type != STT_NOTYPE && type != STT_OBJECT && type != STT_FUNC && type != STT_GNU_IFUNC && type != STT_COMMON && type != STT_TLS)
++    if (type != STT_NOTYPE && type != STT_OBJECT && type != STT_FUNC && type != STT_COMMON && type != STT_TLS)
+       continue;
+     if (!name.size())
+       continue;