aboutsummaryrefslogtreecommitdiff
path: root/tccrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccrun.c')
-rw-r--r--tccrun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccrun.c b/tccrun.c
index 950ffb0..85957b8 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -108,6 +108,8 @@ LIBTCCAPI int tcc_run(TCCState *s1, int argc, char **argv)
int (*prog_main)(int, char **);
s1->runtime_main = "main";
+ if ((s1->dflag & 16) && !find_elf_sym(s1->symtab, s1->runtime_main))
+ return 0;
if (tcc_relocate(s1, TCC_RELOCATE_AUTO) < 0)
return -1;
prog_main = tcc_get_symbol_err(s1, s1->runtime_main);