Diff

Differences From Artifact [28e54aa43c]:

To Artifact [ae2ecf71a4]:



1
2
3
4


5
6
7
8
9

10
11
12
13
14
15
16
17
18
19

20
21
22
23

24
25
26
27
28
29
30
1
2
3


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33
+


-
-
+
+





+










+



-
+







Binary files tcc-0.9.26.orig/.libtcc.c.swp and tcc-0.9.26-1sharedlibfix/.libtcc.c.swp differ
diff -uNr tcc-0.9.26.orig/libtcc.c tcc-0.9.26-1sharedlibfix/libtcc.c
--- tcc-0.9.26.orig/libtcc.c	2013-02-15 08:24:00.000000000 -0600
+++ tcc-0.9.26-1sharedlibfix/libtcc.c	2014-06-23 14:34:51.289507000 -0500
@@ -1189,6 +1189,18 @@
+++ tcc-0.9.26-1sharedlibfix/libtcc.c	2014-06-23 15:29:04.679507000 -0500
@@ -1189,6 +1189,20 @@
 #endif
         tcc_error_noabort("unrecognized ELF file");
         goto the_end;
+    } else {
+#ifdef TCC_IS_NATIVE
+#ifndef TCC_TARGET_PE
+        if (s1->output_type == TCC_OUTPUT_MEMORY) {
+            /* If it's not an ELF file, but dlopen() can open it, do that. */
+            void *h;
+            h = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY);
+            if (h) {
+                ret = 0;
+                goto the_end;
+            }
+        }
+#endif
+#endif
     }
 
     if (memcmp((char *)&ehdr, ARMAG, 8) == 0) {
@@ -1269,7 +1281,15 @@
@@ -1269,7 +1283,15 @@
     const char *libs[] = { "%s/%s.def", "%s/lib%s.def", "%s/%s.dll", "%s/lib%s.dll", "%s/lib%s.a", NULL };
     const char **pp = s->static_link ? libs + 4 : libs;
 #else
+#  ifdef SHOBJEXT
+#    define str1(s) str2(s)
+#    define str2(s) #s
+    const char *libs[] = { "%s/lib%s." str1(SHOBJEXT), "%s/lib%s.a", NULL };