History

fix: try to add a bounds.o only if __bounds_init not found

/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

seyko committed 11 years ago

Commit f2cfc071 parent 3b7f5001 file · +6 −3Browse files

Unified · Split

tccelf.c+6−3
@@ -1589,10 +1589,13 @@ ST_FUNC void tcc_add_bcheck(TCCState *s1) · 1588 unmodified lines
15891589 pinit = section_ptr_add(init_section, 5);
15901590 pinit[0] = 0xe8;
15911591 put32(pinit + 1, -4);
1592− tcc_add_support(s1, "bcheck.o");
15931592 sym_index = find_elf_sym(symtab_section, "__bound_init");
1594− if (!sym_index)
1595− tcc_error("__bound_init not defined");
1593+ if (!sym_index) {
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+ }
15961599 put_elf_reloc(symtab_section, init_section,
15971600 init_section->data_offset - 4, R_386_PC32, sym_index);
15981601 }

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