Skip to content

Commit 820da7b

Browse files
author
Adam Joseph
committed
patchelf.cc: handle DT_MIPS_XHASH and .MIPS.xhash
glibc changed their ABI in commit 23c1c256ae7b0f010d0fcaff60682b620887b164 on 2019-Aug-29, by changing the structure of the .gnu.hash data on MIPS and moving it to a different section. We need to adapt to this change by glibc. Closes #368
1 parent 8db45c6 commit 820da7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/patchelf.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,10 @@ void ElfFile<ElfFileParamNames>::rewriteHeaders(Elf_Addr phdrAddress)
990990
// some binaries might this section stripped
991991
// in which case we just ignore the value.
992992
if (shdr) dyn->d_un.d_ptr = (*shdr).get().sh_addr;
993+
} else if (d_tag == DT_MIPS_XHASH) {
994+
// the .MIPS.xhash section was added to the glibc-ABI
995+
// in commit 23c1c256ae7b0f010d0fcaff60682b620887b164
996+
dyn->d_un.d_ptr = findSectionHeader(".MIPS.xhash").sh_addr;
993997
} else if (d_tag == DT_JMPREL) {
994998
auto shdr = tryFindSectionHeader(".rel.plt");
995999
if (!shdr) shdr = tryFindSectionHeader(".rela.plt");

0 commit comments

Comments
 (0)