mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 894829 - Avoid symbol resolution for relocations for the same symbol in faulty.lib. r=nfroyd
This commit is contained in:
parent
ba3a64dfdf
commit
53e9be1b70
@ -637,6 +637,8 @@ bool
|
||||
CustomElf::Relocate()
|
||||
{
|
||||
DEBUG_LOG("Relocate %s @%p", GetPath(), static_cast<void *>(base));
|
||||
uint32_t symtab_index = (uint32_t) -1;
|
||||
void *symptr = NULL;
|
||||
for (Array<Reloc>::iterator rel = relocations.begin();
|
||||
rel < relocations.end(); ++rel) {
|
||||
/* Location of the relocation */
|
||||
@ -648,16 +650,17 @@ CustomElf::Relocate()
|
||||
continue;
|
||||
}
|
||||
/* Other relocation types need a symbol resolution */
|
||||
const Sym sym = symtab[ELF_R_SYM(rel->r_info)];
|
||||
void *symptr;
|
||||
/* Avoid symbol resolution when it's the same symbol as last iteration */
|
||||
if (symtab_index != ELF_R_SYM(rel->r_info)) {
|
||||
symtab_index = ELF_R_SYM(rel->r_info);
|
||||
const Sym sym = symtab[symtab_index];
|
||||
if (sym.st_shndx != SHN_UNDEF) {
|
||||
symptr = GetPtr(sym.st_value);
|
||||
} else {
|
||||
/* TODO: avoid symbol resolution when it's the same symbol as last
|
||||
* iteration */
|
||||
/* TODO: handle symbol resolving to NULL vs. being undefined. */
|
||||
symptr = GetSymbolPtrInDeps(strtab.GetStringAt(sym.st_name));
|
||||
}
|
||||
}
|
||||
|
||||
if (symptr == NULL)
|
||||
LOG("%s: Warning: relocation to NULL @0x%08" PRIxAddr,
|
||||
|
Loading…
Reference in New Issue
Block a user