From 60c1f70bb92bfc0077cb5265fca0519ff81580d9 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Thu, 10 Sep 2020 05:49:15 +0200 Subject: [PATCH] Revert commit 55f8963dfab5c543f7f34589d3ef9d3f2da3db14 from wanjochan until better tested on all platforms --- Makefile | 2 +- tccelf.c | 5 +---- tccmacho.c | 8 ++------ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 9aafe0de..ca5fae4c 100644 --- a/Makefile +++ b/Makefile @@ -252,7 +252,7 @@ libtcc.dylib: $(LIBTCC_OBJ) # OSX libtcc.dylib (without rpath/ prefix) libtcc.osx: $(LIBTCC_OBJ) - $S$(CC) -shared -o libtcc.dylib $^ $(LDFLAGS) + $S$(CC) -shared -install_name libtcc.dylib -o libtcc.dylib $^ $(LDFLAGS) # windows dynamic libtcc library libtcc.dll : $(LIBTCC_OBJ) diff --git a/tccelf.c b/tccelf.c index fa065165..452f4ebd 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1457,10 +1457,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) tcc_add_btstub(s1); } #endif - /* libtcc1 is not needed when tccrun mode */ - if (s1->output_type != TCC_OUTPUT_MEMORY){ - tcc_add_support(s1, TCC_LIBTCC1); - } + tcc_add_support(s1, TCC_LIBTCC1); #ifndef TCC_TARGET_MACHO /* add crt end if not memory output */ if (s1->output_type != TCC_OUTPUT_MEMORY) diff --git a/tccmacho.c b/tccmacho.c index 8b33aa95..93dee3b1 100644 --- a/tccmacho.c +++ b/tccmacho.c @@ -813,12 +813,8 @@ ST_FUNC int macho_output_file(TCCState *s1, const char *filename) Section *s; collect_sections(s1, &mo); relocate_syms(s1, s1->symtab, 0); - if (s1->output_type == TCC_OUTPUT_DLL) { - /* TODO: more handling for .dylib ? */ - } else { - mo.ep->entryoff = get_sym_addr(s1, "main", 1, 1) - - get_segment(&mo, 1)->vmaddr; - } + mo.ep->entryoff = get_sym_addr(s1, "main", 1, 1) + - get_segment(&mo, 1)->vmaddr; if (s1->nb_errors) goto do_ret;