diff options
| author | grischka <grischka> | 2007-10-30 15:13:21 +0000 |
|---|---|---|
| committer | grischka <grischka> | 2007-10-30 15:13:21 +0000 |
| commit | 2bcc187b1bbb6e3240400652af1a73cd799f250c (patch) | |
| tree | 4fd69c72d6e61c501ef64bf954a6bd0ac2d006c1 | |
| parent | d13aa5426ad17479407dc0a0aad4f6e37f8aa797 (diff) | |
| download | tinycc-2bcc187b1bbb6e3240400652af1a73cd799f250c.tar.gz tinycc-2bcc187b1bbb6e3240400652af1a73cd799f250c.tar.bz2 | |
Fix 'invalid relocation entry' problem on ubuntu - from Bernhard Fischer
| -rw-r--r-- | Changelog | 3 | ||||
| -rw-r--r-- | tccelf.c | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,8 @@ version 0.9.24: +- Fix "invalid relocation entry" problem on ubuntu - from Bernhard Fischer + http://lists.gnu.org/archive/html/tinycc-devel/2005-09/msg00051.html + - ignore AS_NEEDED ld command - mark executable sections as executable when running in memory - added support for win32 wchar_t (Filip Navara) @@ -1874,7 +1874,6 @@ static int tcc_load_object_file(TCCState *s1, /* second short pass to update sh_link and sh_info fields of new sections */ - sm = sm_table; for(i = 1; i < ehdr.e_shnum; i++) { s = sm_table[i].s; if (!s || !sm_table[i].new_section) @@ -1888,6 +1887,7 @@ static int tcc_load_object_file(TCCState *s1, s1->sections[s->sh_info]->reloc = s; } } + sm = sm_table; /* resolve symbols */ old_to_new_syms = tcc_mallocz(nb_syms * sizeof(int)); @@ -1949,9 +1949,11 @@ static int tcc_load_object_file(TCCState *s1, if (sym_index >= nb_syms) goto invalid_reloc; sym_index = old_to_new_syms[sym_index]; - if (!sym_index) { + /* ignore link_once in rel section. */ + if (!sym_index && !sm->link_once) { invalid_reloc: - error_noabort("Invalid relocation entry"); + error_noabort("Invalid relocation entry [%2d] '%s' @ %.8x", + i, strsec + sh->sh_name, rel->r_offset); goto fail; } rel->r_info = ELF32_R_INFO(sym_index, type); |
