diff options
| author | grischka <grischka> | 2017-05-13 08:59:06 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2017-05-13 08:59:06 +0200 |
| commit | 28435ec58c2ef9bb571cad5f8a1129aea3ecc204 (patch) | |
| tree | a08b77f90c9c24972e0fccd6c223af73b5b240f6 /tccelf.c | |
| parent | 3a9d6b3655bd15e752e65a4f0f23f64f4ec56fe1 (diff) | |
| download | tinycc-28435ec58c2ef9bb571cad5f8a1129aea3ecc204.tar.gz tinycc-28435ec58c2ef9bb571cad5f8a1129aea3ecc204.tar.bz2 | |
configure: --config-musl/-uClibc switch & misc cleanups
- configure:
- add --config-uClibc,-musl switch and suggest to use
it if uClibc/musl is detected
- make warning options magic clang compatible
- simplify (use $confvars instead of individual options)
- Revert "Remove some unused-parameter lint"
7443db0d5f841b81a55e918bf8c228dd20f9ddb2
rather use -Wno-unused-parameter (or just not -Wextra)
- #ifdef functions that are unused on some targets
- tccgen.c: use PTR_SIZE==8 instead of (X86_64 || ARM64)
- tccpe.c: fix some warnings
- integrate dummy arm-asm better
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -1127,8 +1127,6 @@ ST_FUNC void tcc_add_bcheck(TCCState *s1) init_section->data_offset - 4, R_386_PC32, sym_index); /* R_386_PC32 = R_X86_64_PC32 = 2 */ } -#else - (void) s1; /* not used */ #endif } @@ -1739,7 +1737,7 @@ static void fill_dynamic(TCCState *s1, struct dyn_inf *dyninf) put_dt(dynamic, DT_SYMTAB, s1->dynsym->sh_addr); put_dt(dynamic, DT_STRSZ, dyninf->dynstr->data_offset); put_dt(dynamic, DT_SYMENT, sizeof(ElfW(Sym))); -#if defined(TCC_TARGET_ARM64) || defined(TCC_TARGET_X86_64) +#if PTR_SIZE == 8 put_dt(dynamic, DT_RELA, dyninf->rel_addr); put_dt(dynamic, DT_RELASZ, dyninf->rel_size); put_dt(dynamic, DT_RELAENT, sizeof(ElfW_Rel)); @@ -2760,7 +2758,7 @@ ST_FUNC int tcc_load_dll(TCCState *s1, int fd, const char *filename, int level) #define LD_TOK_EOF (-1) /* return next ld script token */ -static int ld_next(char *name, int name_size) +static int ld_next(TCCState *s1, char *name, int name_size) { int c; char *q; @@ -2905,10 +2903,10 @@ static int ld_add_file_list(TCCState *s1, const char *cmd, int as_needed) group = !strcmp(cmd, "GROUP"); if (!as_needed) new_undef_syms(); - t = ld_next(filename, sizeof(filename)); + t = ld_next(s1, filename, sizeof(filename)); if (t != '(') expect("("); - t = ld_next(filename, sizeof(filename)); + t = ld_next(s1, filename, sizeof(filename)); for(;;) { libname[0] = '\0'; if (t == LD_TOK_EOF) { @@ -2918,7 +2916,7 @@ static int ld_add_file_list(TCCState *s1, const char *cmd, int as_needed) } else if (t == ')') { break; } else if (t == '-') { - t = ld_next(filename, sizeof(filename)); + t = ld_next(s1, filename, sizeof(filename)); if ((t != LD_TOK_NAME) || (filename[0] != 'l')) { tcc_error_noabort("library name expected"); ret = -1; @@ -2953,9 +2951,9 @@ static int ld_add_file_list(TCCState *s1, const char *cmd, int as_needed) } } } - t = ld_next(filename, sizeof(filename)); + t = ld_next(s1, filename, sizeof(filename)); if (t == ',') { - t = ld_next(filename, sizeof(filename)); + t = ld_next(s1, filename, sizeof(filename)); } } if (group && !as_needed) { @@ -2981,7 +2979,7 @@ ST_FUNC int tcc_load_ldscript(TCCState *s1) ch = handle_eob(); for(;;) { - t = ld_next(cmd, sizeof(cmd)); + t = ld_next(s1, cmd, sizeof(cmd)); if (t == LD_TOK_EOF) return 0; else if (t != LD_TOK_NAME) @@ -2994,11 +2992,11 @@ ST_FUNC int tcc_load_ldscript(TCCState *s1) } else if (!strcmp(cmd, "OUTPUT_FORMAT") || !strcmp(cmd, "TARGET")) { /* ignore some commands */ - t = ld_next(cmd, sizeof(cmd)); + t = ld_next(s1, cmd, sizeof(cmd)); if (t != '(') expect("("); for(;;) { - t = ld_next(filename, sizeof(filename)); + t = ld_next(s1, filename, sizeof(filename)); if (t == LD_TOK_EOF) { tcc_error_noabort("unexpected end of file"); return -1; |
