aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorbellard <bellard>2003-04-16 21:25:59 +0000
committerbellard <bellard>2003-04-16 21:25:59 +0000
commit066d5e7a849c04c93a98b954f81a4b0585340f00 (patch)
tree015ab3d39f44f524f0bdf38a464c0b2d58d936b6 /tccelf.c
parent214ccccea7f9645e3f0249642174a3d650e6a000 (diff)
downloadtinycc-066d5e7a849c04c93a98b954f81a4b0585340f00.tar.gz
tinycc-066d5e7a849c04c93a98b954f81a4b0585340f00.tar.bz2
ignore OUTPUT_FORMAT and TARGET ld script commands (fixes Redhat >= 7 static link problems)
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tccelf.c b/tccelf.c
index 891a68b..e90ee6c 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1954,6 +1954,21 @@ static int tcc_load_ldscript(TCCState *s1)
t = ld_next(s1, filename, sizeof(filename));
}
}
+ } else if (!strcmp(cmd, "OUTPUT_FORMAT") ||
+ !strcmp(cmd, "TARGET")) {
+ /* ignore some commands */
+ t = ld_next(s1, cmd, sizeof(cmd));
+ if (t != '(')
+ expect("(");
+ for(;;) {
+ t = ld_next(s1, filename, sizeof(filename));
+ if (t == LD_TOK_EOF) {
+ error_noabort("unexpected end of file");
+ return -1;
+ } else if (t == ')') {
+ break;
+ }
+ }
} else {
return -1;
}