Unified · Split
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | version 0.9.24: |
| 2 | 2 | |
| 3 | +- Fix "invalid relocation entry" problem on ubuntu - from Bernhard Fischer | |
| 4 | + http://lists.gnu.org/archive/html/tinycc-devel/2005-09/msg00051.html | |
| 5 | + | |
| 3 | 6 | - ignore AS_NEEDED ld command |
| 4 | 7 | - mark executable sections as executable when running in memory |
| 5 | 8 | - added support for win32 wchar_t (Filip Navara) |
| @@ -1874,7 +1874,6 @@ static int tcc_load_object_file(TCCState *s1, · 1873 unmodified lines | ||
| 1874 | 1874 | |
| 1875 | 1875 | /* second short pass to update sh_link and sh_info fields of new |
| 1876 | 1876 | sections */ |
| 1877 | − sm = sm_table; | |
| 1878 | 1877 | for(i = 1; i < ehdr.e_shnum; i++) { |
| 1879 | 1878 | s = sm_table[i].s; |
| 1880 | 1879 | if (!s || !sm_table[i].new_section) |
| @@ -1888,6 +1887,7 @@ static int tcc_load_object_file(TCCState *s1, · 7 unmodified lines | ||
| 1888 | 1887 | s1->sections[s->sh_info]->reloc = s; |
| 1889 | 1888 | } |
| 1890 | 1889 | } |
| 1890 | + sm = sm_table; | |
| 1891 | 1891 | |
| 1892 | 1892 | /* resolve symbols */ |
| 1893 | 1893 | old_to_new_syms = tcc_mallocz(nb_syms * sizeof(int)); |
| @@ -1949,9 +1949,11 @@ static int tcc_load_object_file(TCCState *s1, · 55 unmodified lines | ||
| 1949 | 1949 | if (sym_index >= nb_syms) |
| 1950 | 1950 | goto invalid_reloc; |
| 1951 | 1951 | sym_index = old_to_new_syms[sym_index]; |
| 1952 | − if (!sym_index) { | |
| 1952 | + /* ignore link_once in rel section. */ | |
| 1953 | + if (!sym_index && !sm->link_once) { | |
| 1953 | 1954 | invalid_reloc: |
| 1954 | − error_noabort("Invalid relocation entry"); | |
| 1955 | + error_noabort("Invalid relocation entry [%2d] '%s' @ %.8x", | |
| 1956 | + i, strsec + sh->sh_name, rel->r_offset); | |
| 1955 | 1957 | goto fail; |
| 1956 | 1958 | } |
| 1957 | 1959 | rel->r_info = ELF32_R_INFO(sym_index, type); |