History

Fix 'invalid relocation entry' problem on ubuntu - from Bernhard Fischer

grischka committed 19 years ago

Commit 2bcc1871 parent d13aa542 files · +8 −3Browse files

Unified · Split

2 files
  1. Changelog +3 −0
  2. tccelf.c +5 −3
Changelog+3−0
@@ -1,5 +1,8 @@
1version 0.9.24:1version 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- ignore AS_NEEDED ld command6- ignore AS_NEEDED ld command
4- mark executable sections as executable when running in memory7- mark executable sections as executable when running in memory
5- added support for win32 wchar_t (Filip Navara)8- added support for win32 wchar_t (Filip Navara)
tccelf.c+5−3
@@ -1874,7 +1874,6 @@ static int tcc_load_object_file(TCCState *s1, · 1873 unmodified lines
1874 1874
1875 /* second short pass to update sh_link and sh_info fields of new1875 /* second short pass to update sh_link and sh_info fields of new
1876 sections */1876 sections */
1877 sm = sm_table;
1878 for(i = 1; i < ehdr.e_shnum; i++) {1877 for(i = 1; i < ehdr.e_shnum; i++) {
1879 s = sm_table[i].s;1878 s = sm_table[i].s;
1880 if (!s || !sm_table[i].new_section)1879 if (!s || !sm_table[i].new_section)
@@ -1888,6 +1887,7 @@ static int tcc_load_object_file(TCCState *s1, · 7 unmodified lines
1888 s1->sections[s->sh_info]->reloc = s;1887 s1->sections[s->sh_info]->reloc = s;
1889 }1888 }
1890 }1889 }
1890 sm = sm_table;
1891 1891
1892 /* resolve symbols */1892 /* resolve symbols */
1893 old_to_new_syms = tcc_mallocz(nb_syms * sizeof(int));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 if (sym_index >= nb_syms)1949 if (sym_index >= nb_syms)
1950 goto invalid_reloc;1950 goto invalid_reloc;
1951 sym_index = old_to_new_syms[sym_index];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 invalid_reloc: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 goto fail;1957 goto fail;
1956 }1958 }
1957 rel->r_info = ELF32_R_INFO(sym_index, type);1959 rel->r_info = ELF32_R_INFO(sym_index, type);

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