mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 727959 - Don't error out when missing symbol for PLT relocations is weak. r=nfroyd
This commit is contained in:
parent
982211b8db
commit
ba812f1af5
@ -679,9 +679,12 @@ CustomElf::RelocateJumps()
|
||||
symptr = GetSymbolPtrInDeps(strtab.GetStringAt(sym.st_name));
|
||||
|
||||
if (symptr == NULL) {
|
||||
log("%s: Error: relocation to NULL @0x%08" PRIxAddr " for symbol \"%s\"",
|
||||
GetPath(), rel->r_offset, strtab.GetStringAt(sym.st_name));
|
||||
return false;
|
||||
log("%s: %s: relocation to NULL @0x%08" PRIxAddr " for symbol \"%s\"",
|
||||
GetPath(),
|
||||
(ELF_ST_BIND(sym.st_info) == STB_WEAK) ? "Warning" : "Error",
|
||||
rel->r_offset, strtab.GetStringAt(sym.st_name));
|
||||
if (ELF_ST_BIND(sym.st_info) != STB_WEAK)
|
||||
return false;
|
||||
}
|
||||
/* Apply relocation */
|
||||
*(void **) ptr = symptr;
|
||||
|
@ -26,12 +26,18 @@
|
||||
#define ELFCLASS ELFCLASS64
|
||||
#define ELF_R_TYPE ELF64_R_TYPE
|
||||
#define ELF_R_SYM ELF64_R_SYM
|
||||
#ifndef ELF_ST_BIND
|
||||
#define ELF_ST_BIND ELF64_ST_BIND
|
||||
#endif
|
||||
#define PRIxAddr "lx"
|
||||
#else
|
||||
#define Elf_(type) Elf32_ ## type
|
||||
#define ELFCLASS ELFCLASS32
|
||||
#define ELF_R_TYPE ELF32_R_TYPE
|
||||
#define ELF_R_SYM ELF32_R_SYM
|
||||
#ifndef ELF_ST_BIND
|
||||
#define ELF_ST_BIND ELF32_ST_BIND
|
||||
#endif
|
||||
#define PRIxAddr "x"
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user