History

Revert "output all sections if we produce an executable file" -- Not a fix This reverts commit 089ce6235c99638ad4542a57af4d09e2be0efc88.

Revert "handle a -s option by executing sstrip/strip program" -- related, not a fix. This reverts commit 5cd4393a542ef4c64df7dcbb3fbe3a629666239d.

grischka committed 10 years ago

Commit 2d6aa651 parent 9c5bb163 files · +1 −14Browse files

Unified · Split

3 files
  1. libtcc.c +1 −2
  2. tcc.h +0 −1
  3. tccelf.c +0 −11
libtcc.c+1−2
@@ -2292,8 +2292,6 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 2291 unmodified lines
2292 case TCC_OPTION_dumpversion:2292 case TCC_OPTION_dumpversion:
2293 printf ("%s\n", TCC_VERSION);2293 printf ("%s\n", TCC_VERSION);
2294 exit(0);2294 exit(0);
2295 case TCC_OPTION_s:
2296 s->do_strip = 1;
2297 break;2295 break;
2298 case TCC_OPTION_traditional:2296 case TCC_OPTION_traditional:
2299 break;2297 break;
@@ -2314,6 +2312,7 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 14 unmodified lines
2314 break;2312 break;
2315 case TCC_OPTION_pedantic:2313 case TCC_OPTION_pedantic:
2316 case TCC_OPTION_pipe:2314 case TCC_OPTION_pipe:
2315 case TCC_OPTION_s:
2317 /* ignored */2316 /* ignored */
2318 break;2317 break;
2319 default:2318 default:
tcc.h+0−1
@@ -622,7 +622,6 @@ struct TCCState { · 621 unmodified lines
622 622
623 /* compile with debug symbol (and use them if error during execution) */623 /* compile with debug symbol (and use them if error during execution) */
624 int do_debug;624 int do_debug;
625 int do_strip;
626#ifdef CONFIG_TCC_BCHECK625#ifdef CONFIG_TCC_BCHECK
627 /* compile with built-in memory and bounds checker */626 /* compile with built-in memory and bounds checker */
628 int do_bounds_check;627 int do_bounds_check;
tccelf.c+0−11
@@ -2018,7 +2018,6 @@ static void alloc_sec_names(TCCState *s1, int file_type, Section *strsec) · 2017 unmodified lines
2018 s->sh_size = s->data_offset;2018 s->sh_size = s->data_offset;
2019 } else if (s1->do_debug ||2019 } else if (s1->do_debug ||
2020 file_type == TCC_OUTPUT_OBJ ||2020 file_type == TCC_OUTPUT_OBJ ||
2021 file_type == TCC_OUTPUT_EXE ||
2022 (s->sh_flags & SHF_ALLOC) ||2021 (s->sh_flags & SHF_ALLOC) ||
2023 i == (s1->nb_sections - 1)) {2022 i == (s1->nb_sections - 1)) {
2024 /* we output all sections if debug or object file */2023 /* we output all sections if debug or object file */
@@ -2688,16 +2687,6 @@ static int elf_output_file(TCCState *s1, const char *filename) · 663 unmodified lines
2688 2687
2689 /* Create the ELF file with name 'filename' */2688 /* Create the ELF file with name 'filename' */
2690 ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order);2689 ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order);
2691 if (s1->do_strip) {
2692 int rc;
2693 const char *strip_cmd = "sstrip "; // super strip utility from ELFkickers
2694 const char *null_dev = " 2> /dev/null";
2695 char buf[1050];
2696 snprintf(buf, sizeof(buf), "%s%s%s", strip_cmd, filename, null_dev);
2697 rc = system(buf);
2698 if (rc)
2699 system(buf+1); // call a strip utility from binutils
2700 }
2701 the_end:2690 the_end:
2702 tcc_free(s1->symtab_to_dynsym);2691 tcc_free(s1->symtab_to_dynsym);
2703 tcc_free(sec_order);2692 tcc_free(sec_order);

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