1a2,13
> * Copyright (c) 2011-2013 ARM Limited
> * All rights reserved
> *
> * The license below extends only to copyright in the software and shall
> * not be construed as granting a license to any other intellectual
> * property including but not limited to intellectual property relating
> * to a hardware implementation of the functionality of the software
> * licensed hereunder. You may use the software subject to the license
> * terms below provided that you ensure that this notice is replicated
> * unmodified and in its entirety in all distributions of the software,
> * modified or unmodified, in source code or in binary form.
> *
64c76
< if (gelf_getehdr(elf, &ehdr) ==0) {
---
> if (gelf_getehdr(elf, &ehdr) == 0) {
97,99c109,110
< } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
< arch = ObjectFile::Alpha;
< } else if (ehdr.e_machine == EM_ARM) {
---
> } else if (ehdr.e_machine == EM_ARM &&
> ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
104a116,120
> } else if ((ehdr.e_machine == EM_AARCH64) &&
> ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
> arch = ObjectFile::Arm64;
> } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
> arch = ObjectFile::Alpha;
107,110c123,126
< if (ehdr.e_ident[EI_DATA] == ELFDATA2MSB) {
< arch = ObjectFile::Power;
< } else {
< fatal("The binary you're trying to load is compiled for "
---
> if (ehdr.e_ident[EI_DATA] == ELFDATA2MSB) {
> arch = ObjectFile::Power;
> } else {
> fatal("The binary you're trying to load is compiled for "
113c129
< }
---
> }
124,126c140
< switch (ehdr.e_ident[EI_OSABI])
< {
<
---
> switch (ehdr.e_ident[EI_OSABI]) {
209c223,224
< result->_programHeaderTable = phdr.p_paddr + e_phoff;
---
> result->_programHeaderTable =
> phdr.p_paddr + (e_phoff - phdr.p_offset);
426c441
< ElfObject::loadSections(PortProxy& memProxy, Addr addrMask)
---
> ElfObject::loadSections(PortProxy& memProxy, Addr addrMask, Addr offset)
428c443
< if (!ObjectFile::loadSections(memProxy, addrMask))
---
> if (!ObjectFile::loadSections(memProxy, addrMask, offset))
434c449
< if (!loadSection(&(*extraIt), memProxy, addrMask)) {
---
> if (!loadSection(&(*extraIt), memProxy, addrMask, offset)) {