Skip to content

Commit

Permalink
In symbol tables, rewrite st_value for STT_SECTION entries
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Jan 14, 2014
1 parent bf03aff commit df6243f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/patchelf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,10 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
unsigned int newIndex = findSection3(section); // inefficient
//debug("rewriting symbol %d: index = %d (%s) -> %d\n", entry, shndx, section.c_str(), newIndex);
wri(sym->st_shndx, newIndex);
/* Rewrite st_value. FIXME: we should do this for all
types, but most don't actually change. */
if (ELF32_ST_TYPE(rdi(sym->st_info)) == STT_SECTION)
wri(sym->st_value, rdi(shdrs[newIndex].sh_addr));
}
}
}
Expand Down

0 comments on commit df6243f

Please sign in to comment.