History

ignore symbol main for .dylib; skip libtcc1 for tccrun mode;

wanjochan committed 6 years ago

Commit 55f89631 parent 853a4983 files · +11 −4Browse files

Unified · Split

3 files
  1. Makefile +1 −1
  2. tccelf.c +4 −1
  3. tccmacho.c +6 −2
Makefile+1−1
@@ -252,7 +252,7 @@ libtcc.dylib: $(LIBTCC_OBJ) · 251 unmodified lines
252 252
253# OSX libtcc.dylib (without rpath/ prefix)253# OSX libtcc.dylib (without rpath/ prefix)
254libtcc.osx: $(LIBTCC_OBJ)254libtcc.osx: $(LIBTCC_OBJ)
255 $S$(CC) -shared -install_name libtcc.dylib -o libtcc.dylib $^ $(LDFLAGS) 255 $S$(CC) -shared -o libtcc.dylib $^ $(LDFLAGS)
256 256
257# windows dynamic libtcc library257# windows dynamic libtcc library
258libtcc.dll : $(LIBTCC_OBJ)258libtcc.dll : $(LIBTCC_OBJ)
tccelf.c+4−1
@@ -1457,7 +1457,10 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1456 unmodified lines
1457 tcc_add_btstub(s1);1457 tcc_add_btstub(s1);
1458 }1458 }
1459#endif1459#endif
1460 tcc_add_support(s1, TCC_LIBTCC1);1460 /* libtcc1 is not needed when tccrun mode */
1461 if (s1->output_type != TCC_OUTPUT_MEMORY){
1462 tcc_add_support(s1, TCC_LIBTCC1);
1463 }
1461#ifndef TCC_TARGET_MACHO1464#ifndef TCC_TARGET_MACHO
1462 /* add crt end if not memory output */1465 /* add crt end if not memory output */
1463 if (s1->output_type != TCC_OUTPUT_MEMORY)1466 if (s1->output_type != TCC_OUTPUT_MEMORY)
tccmacho.c+6−2
@@ -813,8 +813,12 @@ ST_FUNC int macho_output_file(TCCState *s1, const char *filename) · 812 unmodified lines
813 Section *s;813 Section *s;
814 collect_sections(s1, &mo);814 collect_sections(s1, &mo);
815 relocate_syms(s1, s1->symtab, 0);815 relocate_syms(s1, s1->symtab, 0);
816 mo.ep->entryoff = get_sym_addr(s1, "main", 1, 1)816 if (s1->output_type == TCC_OUTPUT_DLL) {
817 - get_segment(&mo, 1)->vmaddr;817 /* TODO: more handling for .dylib ? */
818 } else {
819 mo.ep->entryoff = get_sym_addr(s1, "main", 1, 1)
820 - get_segment(&mo, 1)->vmaddr;
821 }
818 if (s1->nb_errors)822 if (s1->nb_errors)
819 goto do_ret;823 goto do_ret;
820 824

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t