- added missing gcc_except_table section

- added ignore of paddings in elf2rpl
This commit is contained in:
dimok789 2016-10-11 19:04:55 +02:00
parent 4981b49563
commit be3bcba701
2 changed files with 26 additions and 16 deletions

View File

@ -193,6 +193,7 @@ SECTIONS {
/* Required compiler trash */
.fixup ALIGN(32) : { *(.fixup*) }
.got ALIGN(32) : { *(.got*) }
.gcc_except_table ALIGN(32) : { *(.gcc_except_table*) }
.hash ALIGN(32) : { *(.hash) }
.dynsym ALIGN(32) : { *(.dynsym) }

View File

@ -238,6 +238,9 @@ read(ElfFile &file, const std::string &filename)
case elf::R_PPC_RELATIVE:
*ptr = byte_swap(addr);
break;
case elf::R_PPC_NONE:
// ignore padding
break;
default:
std::cout << "Unexpected relocation type in .rela.dyn section" << std::endl;
return false;
@ -484,6 +487,12 @@ read(ElfFile &file, const std::string &filename)
auto symbol = getSectionSymbol(symSection, index);
auto addr = symbol->value + rela.addend;
if(type == elf::R_PPC_NONE)
{
// ignore padding
continue;
}
if(index == 0)
{
auto addend = static_cast<uint32_t>(rela.addend);