diff options
| author | seyko <seyko2@gmail.com> | 2015-03-26 06:04:36 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2015-03-26 06:04:36 +0300 |
| commit | a105837aaeb16fdea39bb6607c548c6d1ab38d1d (patch) | |
| tree | 87ea6675fad6524af614846f10d9d4d5f5b419d0 /tccelf.c | |
| parent | cde79a805e673b21bd2aa2fc916975f423f8ccf6 (diff) | |
| download | tinycc-a105837aaeb16fdea39bb6607c548c6d1ab38d1d.tar.gz tinycc-a105837aaeb16fdea39bb6607c548c6d1ab38d1d.tar.bz2 | |
fix: enforce bcheck.o linking when -b option is used
fixes a crash for the empry program (tcc -b empty.c)
empty.c: int main() { return 0; }
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1564,7 +1564,10 @@ ST_FUNC void tcc_add_bcheck(TCCState *s1) pinit = section_ptr_add(init_section, 5); pinit[0] = 0xe8; put32(pinit + 1, -4); - sym_index = find_elf_sym(symtab_section, "__bound_init"); + tcc_add_support(s1, "bcheck.o"); + sym_index = find_elf_sym(symtab_section, "__bound_init"); + if (!sym_index) + tcc_error("__bound_init not defined"); put_elf_reloc(symtab_section, init_section, init_section->data_offset - 4, R_386_PC32, sym_index); } |
