elf2rpl: Fix REL32 -> REL16 conversion.

This commit is contained in:
James Benton 2018-05-23 16:11:50 +01:00
parent ba2df5be91
commit bc12c9abef

View File

@ -521,13 +521,13 @@ fixRelocations(ElfFile &file)
newRelocations.emplace_back();
auto &newRel = newRelocations.back();
// Modify current relocation to R_PPC_GHS_REL16_LO
rels[i].info = (index << 8) | elf::R_PPC_GHS_REL16_LO;
// Modify current relocation to R_PPC_GHS_REL16_HI
rels[i].info = (index << 8) | elf::R_PPC_GHS_REL16_HI;
rels[i].addend = addend;
rels[i].offset = offset;
// Create a R_PPC_GHS_REL16_HI
newRel.info = (index << 8) | elf::R_PPC_GHS_REL16_HI;
// Create a R_PPC_GHS_REL16_LO
newRel.info = (index << 8) | elf::R_PPC_GHS_REL16_LO;
newRel.addend = addend + 2;
newRel.offset = offset + 2;
}