fix "handle a -s option" commit
for targets which don't support variable length arrays.
This commit is contained in:
parent
d81611b641
commit
92efee6e52
1 changed files with 8 additions and 12 deletions
20
tccelf.c
20
tccelf.c
|
@ -2689,18 +2689,14 @@ static int elf_output_file(TCCState *s1, const char *filename)
|
||||||
/* Create the ELF file with name 'filename' */
|
/* Create the ELF file with name 'filename' */
|
||||||
ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order);
|
ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order);
|
||||||
if (s1->do_strip) {
|
if (s1->do_strip) {
|
||||||
const char *strip = "sstrip "; // super strip utility from ELFkickers
|
int rc;
|
||||||
const char *null = " 2> /dev/null";
|
const char *strip_cmd = "sstrip "; // super strip utility from ELFkickers
|
||||||
int len = strlen(strip) + strlen(filename) + strlen(null) + 1;
|
const char *null_dev = " 2> /dev/null";
|
||||||
{
|
char buf[1050];
|
||||||
int rc;
|
snprintf(buf, sizeof(buf), "%s%s%s", strip_cmd, filename, null_dev);
|
||||||
char buf[len];
|
rc = system(buf);
|
||||||
sprintf(buf, "%s%s%s", strip, filename, null);
|
if (rc)
|
||||||
rc = system(buf);
|
system(buf+1); // call a strip utility from binutils
|
||||||
if (rc) {
|
|
||||||
system(buf+1); // call a strip utility from binutils
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
the_end:
|
the_end:
|
||||||
tcc_free(s1->symtab_to_dynsym);
|
tcc_free(s1->symtab_to_dynsym);
|
||||||
|
|
Loading…
Reference in a new issue