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
34
35
36
37
38
39
40
41
42
43
44
|
http://lists.gnu.org/archive/html/tinycc-devel/2005-08/msg00011.html
--- tccelf.c
+++ tccelf.c
@@ -2300,19 +2300,27 @@
expect("(");
t = ld_next(s1, filename, sizeof(filename));
for(;;) {
- if (t == LD_TOK_EOF) {
- error_noabort("unexpected end of file");
- return -1;
- } else if (t == ')') {
- break;
- } else if (t != LD_TOK_NAME) {
- error_noabort("filename expected");
- return -1;
- }
- tcc_add_file(s1, filename);
- t = ld_next(s1, filename, sizeof(filename));
- if (t == ',') {
+ if (strcmp(filename, "AS_NEEDED")) {
+ if (t == LD_TOK_EOF) {
+ error_noabort("unexpected end of file");
+ return -1;
+ } else if (t == ')') {
+ break;
+ } else if (t != LD_TOK_NAME) {
+ error_noabort("filename expected");
+ return -1;
+ }
+ tcc_add_file(s1, filename);
t = ld_next(s1, filename, sizeof(filename));
+ if (t == ',') {
+ t = ld_next(s1, filename, sizeof(filename));
+ }
+ } else {
+ /* TODO: Implement AS_NEEDED support. Ignore it for now */
+ do {
+ t = ld_next(s1, filename, sizeof(cmd));
+ } while (t != ')');
+ t = ld_next(s1, filename, sizeof(cmd));
}
}
} else if (!strcmp(cmd, "OUTPUT_FORMAT") ||
|