Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix endianness issues for powerpc PIE
Previously when running `patchelf --set-rpath "/usr/sbin" my_bin` on a PIE ppc32 binary that had no RPATH a few issues were encountered. This commit fixes: 1. The PT_PHDR being sorted improperly due to the type being read in incorrect endianness 2. The aligment being set to default 0x1000 due to the machine arch being read in incorrect endianness 3. The interpreter being clobbered due to the replace sections routine reading sh_offset and sh_size in incorrect endianness 4. The PHDR segment having an incorrect virt and phys address due to reading the e_phoff in the incorrect endianness This also fixes a read of the shdr.sh_type in writeReplacedSections but this was not encountered during testing.
- Loading branch information