From bc12c9abefaed5a83dee5afd4f90e2830adbfa29 Mon Sep 17 00:00:00 2001 From: James Benton Date: Wed, 23 May 2018 16:11:50 +0100 Subject: [PATCH] elf2rpl: Fix REL32 -> REL16 conversion. --- tools/elf2rpl/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/elf2rpl/main.cpp b/tools/elf2rpl/main.cpp index f1548b0..212c84a 100644 --- a/tools/elf2rpl/main.cpp +++ b/tools/elf2rpl/main.cpp @@ -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; }