diff options
| author | seyko <seyko2@gmail.com> | 2015-04-10 06:53:48 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2015-04-10 06:53:48 +0300 |
| commit | 5cd4393a542ef4c64df7dcbb3fbe3a629666239d (patch) | |
| tree | 999d6146f8af08ce50245a7df1389b420677a5a0 /tccelf.c | |
| parent | 089ce6235c99638ad4542a57af4d09e2be0efc88 (diff) | |
| download | tinycc-5cd4393a542ef4c64df7dcbb3fbe3a629666239d.tar.gz tinycc-5cd4393a542ef4c64df7dcbb3fbe3a629666239d.tar.bz2 | |
handle a -s option by executing sstrip/strip program
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -2689,6 +2689,20 @@ static int elf_output_file(TCCState *s1, const char *filename) /* Create the ELF file with name 'filename' */ ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order); + if (s1->do_strip) { + const char *strip = "sstrip "; // super strip utility from ELFkickers + const char *null = " 2> /dev/null"; + int len = strlen(strip) + strlen(filename) + strlen(null) + 1; + { + int rc; + char buf[len]; + sprintf(buf, "%s%s%s", strip, filename, null); + rc = system(buf); + if (rc) { + system(buf+1); // call a strip utility from binutils + } + } + } the_end: tcc_free(s1->symtab_to_dynsym); tcc_free(sec_order); |
