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 @@
11 version 0.9.24:
22
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+
36 - ignore AS_NEEDED ld command
47 - mark executable sections as executable when running in memory
58 - 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
18741874
18751875 /* second short pass to update sh_link and sh_info fields of new
18761876 sections */
1877− sm = sm_table;
18781877 for(i = 1; i < ehdr.e_shnum; i++) {
18791878 s = sm_table[i].s;
18801879 if (!s || !sm_table[i].new_section)
@@ -1888,6 +1887,7 @@ static int tcc_load_object_file(TCCState *s1, · 7 unmodified lines
18881887 s1->sections[s->sh_info]->reloc = s;
18891888 }
18901889 }
1890+ sm = sm_table;
18911891
18921892 /* resolve symbols */
18931893 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
19491949 if (sym_index >= nb_syms)
19501950 goto invalid_reloc;
19511951 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) {
19531954 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);
19551957 goto fail;
19561958 }
19571959 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