Skip to content
Permalink
Browse files

PLUGINS: Implement NONE relocation for PPC

It's used by recent versions of GCC in .eh_frame sections
  • Loading branch information...
lephilousophe committed Sep 29, 2019
1 parent 81b364f commit be4dd18dbc070292c061791fe0581a978baf8162
Showing with 4 additions and 0 deletions.
  1. +1 −0 backends/plugins/elf/elf32.h
  2. +3 −0 backends/plugins/elf/ppc-loader.cpp
@@ -236,6 +236,7 @@ typedef struct {
#define R_ARM_V4BX 40

// PPC relocation types
#define R_PPC_NONE 0
#define R_PPC_ADDR32 1
#define R_PPC_ADDR16_LO 4
#define R_PPC_ADDR16_HI 5
@@ -61,6 +61,9 @@ bool PPCDLObject::relocate(Elf32_Off offset, Elf32_Word size, byte *relSegment)
//debug(8, "elfloader: i=%05d %p +0x%04x: (0x%08x) 0x%08x ", i, src, rel[i].r_addend, sym->st_value, *src);

switch (REL_TYPE(rel[i].r_info)) {
case R_PPC_NONE:
debug(8, "elfloader: R_PPC_NONE");
break;
case R_PPC_ADDR32:
*src = value;
debug(8, "elfloader: R_PPC_ADDR32 -> 0x%08x", *src);

0 comments on commit be4dd18

Please sign in to comment.
You can’t perform that action at this time.