mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Bug 727959 - Don't error out when missing symbol for PLT relocations is weak. r=nfroyd
This commit is contained in:
parent
bf43c7e164
commit
471d20d072
@ -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…
x
Reference in New Issue
Block a user