/usr/local/lib/tcc/i386/bcheck.o: error: '__bound_error_msg' defined twice #include <stdio.h> int main () { #if 1 int v[10]; v[10] = 0; fprintf(stderr, "is bounds error catched?\n"); #endif return 0; } // tcc -b test.c
Unified · Split
| @@ -1589,10 +1589,13 @@ ST_FUNC void tcc_add_bcheck(TCCState *s1) · 1588 unmodified lines | |||
| 1589 | pinit = section_ptr_add(init_section, 5); | 1589 | pinit = section_ptr_add(init_section, 5); |
| 1590 | pinit[0] = 0xe8; | 1590 | pinit[0] = 0xe8; |
| 1591 | put32(pinit + 1, -4); | 1591 | put32(pinit + 1, -4); |
| 1592 | tcc_add_support(s1, "bcheck.o"); | ||
| 1593 | sym_index = find_elf_sym(symtab_section, "__bound_init"); | 1592 | sym_index = find_elf_sym(symtab_section, "__bound_init"); |
| 1594 | if (!sym_index) | 1593 | if (!sym_index) { |
| 1595 | tcc_error("__bound_init not defined"); | 1594 | tcc_add_support(s1, "bcheck.o"); |
| 1595 | sym_index = find_elf_sym(symtab_section, "__bound_init"); | ||
| 1596 | if (!sym_index) | ||
| 1597 | tcc_error("__bound_init not defined"); | ||
| 1598 | } | ||
| 1596 | put_elf_reloc(symtab_section, init_section, | 1599 | put_elf_reloc(symtab_section, init_section, |
| 1597 | init_section->data_offset - 4, R_386_PC32, sym_index); | 1600 | init_section->data_offset - 4, R_386_PC32, sym_index); |
| 1598 | } | 1601 | } |