This commit is contained in:
Eelco Dolstra
2015-07-24 01:34:24 +02:00

View File

@@ -836,11 +836,18 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
/* no idea if this makes sense, but it was needed for some
program */
if (!shdr) shdr = findSection2(".rel.got");
if (!shdr) error("cannot find .rel.dyn or .rel.got");
/* some programs have neither section, but this doesn't seem
to be a problem */
if (!shdr) continue;
dyn->d_un.d_ptr = shdr->sh_addr;
}
else if (d_tag == DT_RELA) {
Elf_Shdr * shdr = findSection2(".rela.dyn");
/* some programs lack this section, but it doesn't seem to
be a problem */
if (!shdr) continue;
dyn->d_un.d_ptr = shdr->sh_addr;
}
else if (d_tag == DT_RELA)
dyn->d_un.d_ptr = findSection(".rela.dyn").sh_addr; /* PPC Linux */
else if (d_tag == DT_VERNEED)
dyn->d_un.d_ptr = findSection(".gnu.version_r").sh_addr;
else if (d_tag == DT_VERSYM)