History

fix "handle a -s option" commit

for targets which don't support variable length arrays.

seyko committed 11 years ago

Commit 92efee61 parent d81611b1 file · +8 −12Browse files

Unified · Split

tccelf.c+8−12
@@ -2689,18 +2689,14 @@ static int elf_output_file(TCCState *s1, const char *filename) · 2688 unmodified lines
26892689 /* Create the ELF file with name 'filename' */
26902690 ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order);
26912691 if (s1->do_strip) {
2692− const char *strip = "sstrip "; // super strip utility from ELFkickers
2693− const char *null = " 2> /dev/null";
2694− int len = strlen(strip) + strlen(filename) + strlen(null) + 1;
2695− {
2696− int rc;
2697− char buf[len];
2698− sprintf(buf, "%s%s%s", strip, filename, null);
2699− rc = system(buf);
2700− if (rc) {
2701− system(buf+1); // call a strip utility from binutils
2702− }
2703− }
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
27042700 }
27052701 the_end:
27062702 tcc_free(s1->symtab_to_dynsym);

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