Procházet zdrojové kódy

include dummied-out dlopen and dlsym functions for static binaries

these don't work (or do anything at all) but at least make it possible
to static link programs that insist on "having" dynamic loading
support...as long as they don't actually need to use it.

adding real support for dlopen/dlsym with static linking is going to
be significantly more difficult...
Rich Felker před 13 roky
rodič
revize
5a09a53010
1 změnil soubory, kde provedl 10 přidání a 1 odebrání
  1. 10 1
      src/ldso/dynlink.c

+ 10 - 1
src/ldso/dynlink.c

@@ -674,6 +674,16 @@ void *__dlsym(void *p, const char *s, void *ra)
 	pthread_rwlock_unlock(&lock);
 	return res;
 }
+#else
+void *dlopen(const char *file, int mode)
+{
+	return 0;
+}
+void *__dlsym(void *p, const char *s, void *ra)
+{
+	return 0;
+}
+#endif
 
 char *dlerror()
 {
@@ -684,4 +694,3 @@ int dlclose(void *p)
 {
 	return 0;
 }
-#endif