aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mklibs/patches/006-uclibc_init.patch
blob: da83340fe4af8e4f5c787d230cb76fc5de8c831d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- a/src/mklibs
+++ b/src/mklibs
@@ -604,6 +604,11 @@ while 1:
                 extra_post_obj.append(sysroot + libc_extras_dir + "/sofini.o")
                 symbols.add(ProvidedSymbol('__dso_handle', None, None, True))
 
+            if soname in ("libc.so.0"):
+                symbols.add(ProvidedSymbol('__uClibc_init', None, None, True))
+                symbols.add(ProvidedSymbol('__uClibc_fini', None, None, True))
+                extra_flags.append("-Wl,-init,__uClibc_init")
+
             map_file = find_pic_map(library)
             if map_file:
                 extra_flags.append("-Wl,--version-script=" + map_file)