History

Clean up lots of rogue tabs.

Still some more tabs to be taken care of. arm-gen.c and tcccoff.c have so many style issues that I'm just going to throw clang-format at them.

gus knight committed 11 years ago

Commit d6b64e21 parent 410312210 files · +427 −428Browse files

Showing the changes to tccelf.c (1 of 10 files). Show all

Unified · Split

tccelf.c+140−140
@@ -451,7 +451,7 @@ ST_FUNC void relocate_syms(TCCState *s1, int do_resolve) · 450 unmodified lines
451451 if (addr) {
452452 sym->st_value = (addr_t)addr;
453453 #ifdef DEBUG_RELOC
454− printf ("relocate_sym: %s -> 0x%lx\n", name, sym->st_value);
454+ printf ("relocate_sym: %s -> 0x%lx\n", name, sym->st_value);
455455 #endif
456456 goto found;
457457 }
@@ -580,10 +580,10 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 122 unmodified lines
580580 {
581581 int x, is_thumb, is_call, h, blx_avail, is_bl, th_ko;
582582 x = (*(int *) ptr) & 0xffffff;
583− if (sym->st_shndx == SHN_UNDEF)
584− val = s1->plt->sh_addr;
583+ if (sym->st_shndx == SHN_UNDEF)
584+ val = s1->plt->sh_addr;
585585 #ifdef DEBUG_RELOC
586− printf ("reloc %d: x=0x%x val=0x%x ", type, x, val);
586+ printf ("reloc %d: x=0x%x val=0x%x ", type, x, val);
587587 #endif
588588 (*(int *)ptr) &= 0xff000000;
589589 if (x & 0x800000)
@@ -595,8 +595,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 5 unmodified lines
595595 is_call = (type == R_ARM_CALL || (type == R_ARM_PC24 && is_bl));
596596 x += val - addr;
597597 #ifdef DEBUG_RELOC
598− printf (" newx=0x%x name=%s\n", x,
599− (char *) symtab_section->link->data + sym->st_name);
598+ printf (" newx=0x%x name=%s\n", x,
599+ (char *) symtab_section->link->data + sym->st_name);
600600 #endif
601601 h = x & 2;
602602 th_ko = (x & 3) && (!blx_avail || !is_call);
@@ -797,21 +797,21 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 194 unmodified lines
797797 break;
798798 case R_AARCH64_JUMP26:
799799 case R_AARCH64_CALL26:
800− /* This check must match the one in build_got_entries, testing
801− if we really need a PLT slot. */
802− if (sym->st_shndx == SHN_UNDEF)
803− /* We've put the PLT slot offset into r_addend when generating
804− it, and that's what we must use as relocation value (adjusted
805− by section offset of course). */
806− val = s1->plt->sh_addr + rel->r_addend;
800+ /* This check must match the one in build_got_entries, testing
801+ if we really need a PLT slot. */
802+ if (sym->st_shndx == SHN_UNDEF)
803+ /* We've put the PLT slot offset into r_addend when generating
804+ it, and that's what we must use as relocation value (adjusted
805+ by section offset of course). */
806+ val = s1->plt->sh_addr + rel->r_addend;
807807 #ifdef DEBUG_RELOC
808− printf ("reloc %d @ 0x%lx: val=0x%lx name=%s\n", type, addr, val,
809− (char *) symtab_section->link->data + sym->st_name);
808+ printf ("reloc %d @ 0x%lx: val=0x%lx name=%s\n", type, addr, val,
809+ (char *) symtab_section->link->data + sym->st_name);
810810 #endif
811811 if (((val - addr) + ((uint64_t)1 << 27)) & ~(uint64_t)0xffffffc)
812− {
812+ {
813813 tcc_error("R_AARCH64_(JUMP|CALL)26 relocation failed (val=%lx, addr=%lx)", addr, val);
814− }
814+ }
815815 *(uint32_t *)ptr = 0x14000000 | (type == R_AARCH64_CALL26) << 31 |
816816 ((val - addr) >> 2 & 0x3ffffff);
817817 break;
@@ -836,9 +836,9 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 18 unmodified lines
836836 case R_AARCH64_JUMP_SLOT:
837837 /* They don't need addend */
838838 #ifdef DEBUG_RELOC
839− printf ("reloc %d @ 0x%lx: val=0x%lx name=%s\n", type, addr,
840− val - rel->r_addend,
841− (char *) symtab_section->link->data + sym->st_name);
839+ printf ("reloc %d @ 0x%lx: val=0x%lx name=%s\n", type, addr,
840+ val - rel->r_addend,
841+ (char *) symtab_section->link->data + sym->st_name);
842842 #endif
843843 *(addr_t *)ptr = val - rel->r_addend;
844844 break;
@@ -879,12 +879,12 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 34 unmodified lines
879879 qrel->r_offset = rel->r_offset;
880880 if (esym_index) {
881881 qrel->r_info = ELFW(R_INFO)(esym_index, R_X86_64_64);
882− qrel->r_addend = rel->r_addend;
882+ qrel->r_addend = rel->r_addend;
883883 qrel++;
884884 break;
885885 } else {
886− qrel->r_info = ELFW(R_INFO)(0, R_X86_64_RELATIVE);
887− qrel->r_addend = *(long long *)ptr + val;
886+ qrel->r_info = ELFW(R_INFO)(0, R_X86_64_RELATIVE);
887+ qrel->r_addend = *(long long *)ptr + val;
888888 qrel++;
889889 }
890890 }
@@ -917,14 +917,14 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 26 unmodified lines
917917 goto plt32pc32;
918918
919919 case R_X86_64_PLT32:
920− /* We've put the PLT slot offset into r_addend when generating
921− it, and that's what we must use as relocation value (adjusted
922− by section offset of course). */
923− val = s1->plt->sh_addr + rel->r_addend;
924− /* fallthrough. */
925−
926− plt32pc32:
927− {
920+ /* We've put the PLT slot offset into r_addend when generating
921+ it, and that's what we must use as relocation value (adjusted
922+ by section offset of course). */
923+ val = s1->plt->sh_addr + rel->r_addend;
924+ /* fallthrough. */
925+
926+ plt32pc32:
927+ {
928928 long long diff;
929929 diff = (long long)val - addr;
930930 if (diff < -2147483648LL || diff > 2147483647LL) {
@@ -1080,8 +1080,8 @@ static void build_got(TCCState *s1) · 149 unmodified lines
10801080 and 'info' can be modifed if more precise info comes from the DLL.
10811081 Returns offset of GOT or PLT slot. */
10821082 static unsigned long put_got_entry(TCCState *s1,
1083− int reloc_type, unsigned long size, int info,
1084− int sym_index)
1083+ int reloc_type, unsigned long size, int info,
1084+ int sym_index)
10851085 {
10861086 int index, need_plt_entry;
10871087 const char *name;
@@ -1107,18 +1107,18 @@ static unsigned long put_got_entry(TCCState *s1, · 19 unmodified lines
11071107 #endif
11081108
11091109 if (need_plt_entry && !s1->plt) {
1110− /* add PLT */
1111− s1->plt = new_section(s1, ".plt", SHT_PROGBITS,
1112− SHF_ALLOC | SHF_EXECINSTR);
1113− s1->plt->sh_entsize = 4;
1110+ /* add PLT */
1111+ s1->plt = new_section(s1, ".plt", SHT_PROGBITS,
1112+ SHF_ALLOC | SHF_EXECINSTR);
1113+ s1->plt->sh_entsize = 4;
11141114 }
11151115
11161116 /* If a got/plt entry already exists for that symbol, no need to add one */
11171117 if (sym_index < s1->nb_sym_attrs) {
1118− if (need_plt_entry && s1->sym_attrs[sym_index].plt_offset)
1119− return s1->sym_attrs[sym_index].plt_offset;
1120− else if (!need_plt_entry && s1->sym_attrs[sym_index].got_offset)
1121− return s1->sym_attrs[sym_index].got_offset;
1118+ if (need_plt_entry && s1->sym_attrs[sym_index].plt_offset)
1119+ return s1->sym_attrs[sym_index].plt_offset;
1120+ else if (!need_plt_entry && s1->sym_attrs[sym_index].got_offset)
1121+ return s1->sym_attrs[sym_index].got_offset;
11221122 }
11231123
11241124 symattr = alloc_sym_attr(s1, sym_index);
@@ -1135,7 +1135,7 @@ static unsigned long put_got_entry(TCCState *s1, · 10 unmodified lines
11351135 Section *plt;
11361136 uint8_t *p;
11371137 int modrm;
1138− unsigned long relofs;
1138+ unsigned long relofs;
11391139
11401140 #if defined(TCC_OUTPUT_DLL_WITH_PLT)
11411141 modrm = 0x25;
@@ -1160,10 +1160,10 @@ static unsigned long put_got_entry(TCCState *s1, · 18 unmodified lines
11601160 put32(p + 8, PTR_SIZE * 2);
11611161 }
11621162
1163− /* The PLT slot refers to the relocation entry it needs
1164− via offset. The reloc entry is created below, so its
1165− offset is the current data_offset. */
1166− relofs = s1->got->reloc ? s1->got->reloc->data_offset : 0;
1163+ /* The PLT slot refers to the relocation entry it needs
1164+ via offset. The reloc entry is created below, so its
1165+ offset is the current data_offset. */
1166+ relofs = s1->got->reloc ? s1->got->reloc->data_offset : 0;
11671167 symattr->plt_offset = plt->data_offset;
11681168 p = section_ptr_add(plt, 16);
11691169 p[0] = 0xff; /* jmp *(got + x) */
@@ -1171,19 +1171,19 @@ static unsigned long put_got_entry(TCCState *s1, · 1 unmodified line
11711171 put32(p + 2, s1->got->data_offset);
11721172 p[6] = 0x68; /* push $xxx */
11731173 #ifdef TCC_TARGET_X86_64
1174− /* On x86-64, the relocation is referred to by _index_. */
1175− put32(p + 7, relofs / sizeof (ElfW_Rel));
1174+ /* On x86-64, the relocation is referred to by _index_. */
1175+ put32(p + 7, relofs / sizeof (ElfW_Rel));
11761176 #else
11771177 put32(p + 7, relofs);
11781178 #endif
11791179 p[11] = 0xe9; /* jmp plt_start */
11801180 put32(p + 12, -(plt->data_offset));
11811181
1182− /* If this was an UNDEF symbol set the offset in the
1183− dynsymtab to the PLT slot, so that PC32 relocs to it
1184− can be resolved. */
1185− if (sym->st_shndx == SHN_UNDEF)
1186− offset = plt->data_offset - 16;
1182+ /* If this was an UNDEF symbol set the offset in the
1183+ dynsymtab to the PLT slot, so that PC32 relocs to it
1184+ can be resolved. */
1185+ if (sym->st_shndx == SHN_UNDEF)
1186+ offset = plt->data_offset - 16;
11871187 }
11881188 #elif defined(TCC_TARGET_ARM)
11891189 if (need_plt_entry) {
@@ -1220,7 +1220,7 @@ static unsigned long put_got_entry(TCCState *s1, · 30 unmodified lines
12201220
12211221 /* the symbol is modified so that it will be relocated to
12221222 the PLT */
1223− if (sym->st_shndx == SHN_UNDEF)
1223+ if (sym->st_shndx == SHN_UNDEF)
12241224 offset = plt->data_offset - 16;
12251225 }
12261226 #elif defined(TCC_TARGET_ARM64)
@@ -1250,19 +1250,19 @@ static unsigned long put_got_entry(TCCState *s1, · 23 unmodified lines
12501250 #error unsupported CPU
12511251 #endif
12521252 if (s1->dynsym) {
1253− /* XXX This might generate multiple syms for name. */
1253+ /* XXX This might generate multiple syms for name. */
12541254 index = put_elf_sym(s1->dynsym, offset,
12551255 size, info, 0, sym->st_shndx, name);
12561256 /* Create the relocation (it's against the GOT for PLT
1257− and GOT relocs). */
1257+ and GOT relocs). */
12581258 put_elf_reloc(s1->dynsym, s1->got,
12591259 s1->got->data_offset,
12601260 reloc_type, index);
12611261 } else {
1262− /* Without .dynsym (i.e. static link or memory output) we
1263− still need relocs against the generated got, so as to fill
1264− the entries with the symbol values (determined later). */
1265− put_elf_reloc(symtab_section, s1->got,
1262+ /* Without .dynsym (i.e. static link or memory output) we
1263+ still need relocs against the generated got, so as to fill
1264+ the entries with the symbol values (determined later). */
1265+ put_elf_reloc(symtab_section, s1->got,
12661266 s1->got->data_offset,
12671267 reloc_type, sym_index);
12681268 }
@@ -1324,8 +1324,8 @@ ST_FUNC void build_got_entries(TCCState *s1) · 55 unmodified lines
13241324 build_got(s1);
13251325 sym_index = ELFW(R_SYM)(rel->r_info);
13261326 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
1327− if (type != R_ARM_GOTOFF && type != R_ARM_GOTPC
1328− && sym->st_shndx == SHN_UNDEF) {
1327+ if (type != R_ARM_GOTOFF && type != R_ARM_GOTPC
1328+ && sym->st_shndx == SHN_UNDEF) {
13291329 unsigned long ofs;
13301330 /* look at the symbol got offset. If none, then add one */
13311331 if (type == R_ARM_GOT32)
@@ -1333,27 +1333,27 @@ ST_FUNC void build_got_entries(TCCState *s1) · 1 unmodified line
13331333 else
13341334 reloc_type = R_ARM_JUMP_SLOT;
13351335 ofs = put_got_entry(s1, reloc_type, sym->st_size,
1336− sym->st_info, sym_index);
1336+ sym->st_info, sym_index);
13371337 #ifdef DEBUG_RELOC
13381338 printf ("maybegot: %s, %d, %d --> ofs=0x%x\n",
1339− (char *) symtab_section->link->data + sym->st_name,
1340− type, sym->st_shndx, ofs);
1339+ (char *) symtab_section->link->data + sym->st_name,
1340+ type, sym->st_shndx, ofs);
13411341 #endif
1342− if (type != R_ARM_GOT32) {
1343− addr_t *ptr = (addr_t*)(s1->sections[s->sh_info]->data
1344− + rel->r_offset);
1345− /* x must be signed! */
1346− int x = *ptr & 0xffffff;
1347− x = (x << 8) >> 8;
1348− x <<= 2;
1349− x += ofs;
1350− x >>= 2;
1342+ if (type != R_ARM_GOT32) {
1343+ addr_t *ptr = (addr_t*)(s1->sections[s->sh_info]->data
1344+ + rel->r_offset);
1345+ /* x must be signed! */
1346+ int x = *ptr & 0xffffff;
1347+ x = (x << 8) >> 8;
1348+ x <<= 2;
1349+ x += ofs;
1350+ x >>= 2;
13511351 #ifdef DEBUG_RELOC
1352− printf ("insn=0x%x --> 0x%x (x==0x%x)\n", *ptr,
1353− (*ptr & 0xff000000) | x, x);
1352+ printf ("insn=0x%x --> 0x%x (x==0x%x)\n", *ptr,
1353+ (*ptr & 0xff000000) | x, x);
13541354 #endif
1355− *ptr = (*ptr & 0xff000000) | x;
1356− }
1355+ *ptr = (*ptr & 0xff000000) | x;
1356+ }
13571357 }
13581358 break;
13591359 case R_ARM_THM_JUMP24:
@@ -1397,22 +1397,22 @@ ST_FUNC void build_got_entries(TCCState *s1) · 37 unmodified lines
13971397 sym_index);
13981398 break;
13991399
1400− case R_AARCH64_JUMP26:
1401− case R_AARCH64_CALL26:
1400+ case R_AARCH64_JUMP26:
1401+ case R_AARCH64_CALL26:
14021402 if (!s1->got)
14031403 build_got(s1);
14041404 sym_index = ELFW(R_SYM)(rel->r_info);
14051405 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
14061406 if (sym->st_shndx == SHN_UNDEF) {
1407− unsigned long ofs;
1408− reloc_type = R_AARCH64_JUMP_SLOT;
1407+ unsigned long ofs;
1408+ reloc_type = R_AARCH64_JUMP_SLOT;
14091409 ofs = put_got_entry(s1, reloc_type, sym->st_size,
1410− sym->st_info, sym_index);
1411− /* We store the place of the generated PLT slot
1412− in our addend. */
1413− rel->r_addend += ofs;
1410+ sym->st_info, sym_index);
1411+ /* We store the place of the generated PLT slot
1412+ in our addend. */
1413+ rel->r_addend += ofs;
14141414 }
1415− break;
1415+ break;
14161416 #elif defined(TCC_TARGET_C67)
14171417 case R_C60_GOT32:
14181418 case R_C60_GOTOFF:
@@ -1439,29 +1439,29 @@ ST_FUNC void build_got_entries(TCCState *s1) · 20 unmodified lines
14391439 case R_X86_64_PLT32:
14401440 sym_index = ELFW(R_SYM)(rel->r_info);
14411441 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
1442− if (type == R_X86_64_PLT32 &&
1443− ELFW(ST_VISIBILITY)(sym->st_other) != STV_DEFAULT)
1444− {
1445− rel->r_info = ELFW(R_INFO)(sym_index, R_X86_64_PC32);
1446− break;
1447− }
1442+ if (type == R_X86_64_PLT32 &&
1443+ ELFW(ST_VISIBILITY)(sym->st_other) != STV_DEFAULT)
1444+ {
1445+ rel->r_info = ELFW(R_INFO)(sym_index, R_X86_64_PC32);
1446+ break;
1447+ }
14481448
14491449 if (!s1->got)
14501450 build_got(s1);
14511451 if (type == R_X86_64_GOT32 || type == R_X86_64_GOTPCREL ||
14521452 type == R_X86_64_PLT32) {
1453− unsigned long ofs;
1453+ unsigned long ofs;
14541454 /* look at the symbol got offset. If none, then add one */
14551455 if (type == R_X86_64_GOT32 || type == R_X86_64_GOTPCREL)
14561456 reloc_type = R_X86_64_GLOB_DAT;
14571457 else
14581458 reloc_type = R_X86_64_JUMP_SLOT;
14591459 ofs = put_got_entry(s1, reloc_type, sym->st_size,
1460− sym->st_info, sym_index);
1461− if (type == R_X86_64_PLT32)
1462− /* We store the place of the generated PLT slot
1463− in our addend. */
1464− rel->r_addend += ofs;
1460+ sym->st_info, sym_index);
1461+ if (type == R_X86_64_PLT32)
1462+ /* We store the place of the generated PLT slot
1463+ in our addend. */
1464+ rel->r_addend += ofs;
14651465 }
14661466 break;
14671467 #else
@@ -1546,21 +1546,21 @@ static int tcc_add_support(TCCState *s1, const char *filename) · 78 unmodified lines
15461546 snprintf(buf, sizeof(buf), "%s/%s/%s", s1->tcc_lib_path,
15471547 /* an cpu specific path inside tcc_lib_path, mainly for keeping libtcc1.a */
15481548 #ifdef TCC_TARGET_I386
1549− "i386"
1549+ "i386"
15501550 #endif
15511551 #ifdef TCC_TARGET_X86_64
15521552 "x86-64"
15531553 #endif
15541554 #ifdef TCC_TARGET_ARM
1555− "arm"
1555+ "arm"
15561556 #endif
15571557 #ifdef TCC_TARGET_ARM64
1558− "arm64"
1558+ "arm64"
15591559 #endif
15601560 #ifdef TCC_TARGET_C67
1561− "C67"
1561+ "C67"
15621562 #endif
1563− ,filename);
1563+ ,filename);
15641564
15651565 return tcc_add_file(s1, buf, TCC_FILETYPE_BINARY);
15661566 }
@@ -1587,17 +1587,17 @@ ST_FUNC void tcc_add_bcheck(TCCState *s1) · 20 unmodified lines
15871587 when __bound_ptr_add, __bound_new_region,
15881588 __bound_delete_region called */
15891589
1590− int sym_index = find_elf_sym(symtab_section, "__bound_init");
1591− if (sym_index) {
1592− Section *init_section = find_section(s1, ".init");
1593− unsigned char *pinit = section_ptr_add(init_section, 5);
1594− pinit[0] = 0xe8;
1595− put32(pinit + 1, -4);
1596− put_elf_reloc(symtab_section, init_section,
1590+ int sym_index = find_elf_sym(symtab_section, "__bound_init");
1591+ if (sym_index) {
1592+ Section *init_section = find_section(s1, ".init");
1593+ unsigned char *pinit = section_ptr_add(init_section, 5);
1594+ pinit[0] = 0xe8;
1595+ put32(pinit + 1, -4);
1596+ put_elf_reloc(symtab_section, init_section,
15971597 init_section->data_offset - 4, R_386_PC32, sym_index);
1598− }
1599− else
1600− tcc_warning("__bound_init not defined");
1598+ }
1599+ else
1600+ tcc_warning("__bound_init not defined");
16011601 }
16021602 #endif
16031603 }
@@ -1905,11 +1905,11 @@ static void export_global_syms(TCCState *s1) · 301 unmodified lines
19051905 s1->symtab_to_dynsym = tcc_mallocz(sizeof(int) * nb_syms);
19061906 for_each_elem(symtab_section, 1, sym, ElfW(Sym)) {
19071907 if (ELFW(ST_BIND)(sym->st_info) != STB_LOCAL) {
1908− name = (char *) symtab_section->link->data + sym->st_name;
1909− dynindex = put_elf_sym(s1->dynsym, sym->st_value, sym->st_size,
1910− sym->st_info, 0, sym->st_shndx, name);
1911− index = sym - (ElfW(Sym) *) symtab_section->data;
1912− s1->symtab_to_dynsym[index] = dynindex;
1908+ name = (char *) symtab_section->link->data + sym->st_name;
1909+ dynindex = put_elf_sym(s1->dynsym, sym->st_value, sym->st_size,
1910+ sym->st_info, 0, sym->st_shndx, name);
1911+ index = sym - (ElfW(Sym) *) symtab_section->data;
1912+ s1->symtab_to_dynsym[index] = dynindex;
19131913 }
19141914 }
19151915 }
@@ -2179,15 +2179,15 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, int phnum, · 263 unmodified lines
21792179 file_offset += s->sh_size;
21802180 }
21812181 }
2182− if (j == 0) {
2183− /* Make the first PT_LOAD segment include the program
2184− headers itself (and the ELF header as well), it'll
2185− come out with same memory use but will make various
2186− tools like binutils strip work better. */
2187− ph->p_offset &= ~(ph->p_align - 1);
2188− ph->p_vaddr &= ~(ph->p_align - 1);
2189− ph->p_paddr &= ~(ph->p_align - 1);
2190− }
2182+ if (j == 0) {
2183+ /* Make the first PT_LOAD segment include the program
2184+ headers itself (and the ELF header as well), it'll
2185+ come out with same memory use but will make various
2186+ tools like binutils strip work better. */
2187+ ph->p_offset &= ~(ph->p_align - 1);
2188+ ph->p_vaddr &= ~(ph->p_align - 1);
2189+ ph->p_paddr &= ~(ph->p_align - 1);
2190+ }
21912191 ph->p_filesz = file_offset - ph->p_offset;
21922192 ph->p_memsz = addr - ph->p_vaddr;
21932193 ph++;
@@ -2662,10 +2662,10 @@ static int elf_output_file(TCCState *s1, const char *filename) · 468 unmodified lines
26622662 for_each_elem(s1->dynsym, 1, sym, ElfW(Sym)) {
26632663 if (sym->st_shndx == SHN_UNDEF) {
26642664 /* relocate to PLT if symbol corresponds to a PLT entry,
2665− but not if it's a weak symbol */
2666− if (ELFW(ST_BIND)(sym->st_info) == STB_WEAK)
2667− sym->st_value = 0;
2668− else if (sym->st_value)
2665+ but not if it's a weak symbol */
2666+ if (ELFW(ST_BIND)(sym->st_info) == STB_WEAK)
2667+ sym->st_value = 0;
2668+ else if (sym->st_value)
26692669 sym->st_value += s1->plt->sh_addr;
26702670 } else if (sym->st_shndx < SHN_LORESERVE) {
26712671 /* do symbol relocation */
@@ -2690,14 +2690,14 @@ static int elf_output_file(TCCState *s1, const char *filename) · 18 unmodified lines
26902690 /* Create the ELF file with name 'filename' */
26912691 ret = tcc_write_elf_file(s1, filename, phnum, phdr, file_offset, sec_order);
26922692 if (s1->do_strip) {
2693− int rc;
2694− const char *strip_cmd = "sstrip "; // super strip utility from ELFkickers
2695− const char *null_dev = " 2> /dev/null";
2696− char buf[1050];
2697− snprintf(buf, sizeof(buf), "%s%s%s", strip_cmd, filename, null_dev);
2698− rc = system(buf);
2699− if (rc)
2700− system(buf+1); // call a strip utility from binutils
2693+ int rc;
2694+ const char *strip_cmd = "sstrip "; // super strip utility from ELFkickers
2695+ const char *null_dev = " 2> /dev/null";
2696+ char buf[1050];
2697+ snprintf(buf, sizeof(buf), "%s%s%s", strip_cmd, filename, null_dev);
2698+ rc = system(buf);
2699+ if (rc)
2700+ system(buf+1); // call a strip utility from binutils
27012701 }
27022702 the_end:
27032703 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