Fix depfixer on MIPS.

This commit is contained in:
Aurelien Jarno 2016-10-23 22:42:25 +03:00 committed by Jussi Pakkanen
parent 63aaa3aa52
commit caa1ef6318
2 changed files with 7 additions and 0 deletions

View File

@ -52,3 +52,4 @@ Scott D Phillips
Gautier Pelloux-Prayer
Alexandre Foley
Jouni Kosonen
Aurelien Jarno

View File

@ -23,6 +23,7 @@ DT_RPATH = 15
DT_RUNPATH = 29
DT_STRTAB = 5
DT_SONAME = 14
DT_MIPS_RLD_MAP_REL = 1879048245
class DataSizes():
def __init__(self, ptrsize, is_le):
@ -307,6 +308,11 @@ class Elf(DataSizes):
rpentry.d_tag = 0
self.dynamic = self.dynamic[:i] + self.dynamic[i+1:] + [rpentry]
break;
# DT_MIPS_RLD_MAP_REL is relative to the offset of the tag. Adjust it consequently.
for entry in self.dynamic[i:]:
if entry.d_tag == DT_MIPS_RLD_MAP_REL:
entry.val += 2 * (self.ptrsize // 8)
break
self.bf.seek(sec.sh_offset)
for entry in self.dynamic:
entry.write(self.bf)