Merge "linker: fix mips build"
am: ce11d26bd7
Change-Id: Ic61331efa9e3b721febbf8794b22458c740bacc5
This commit is contained in:
commit
430c64f8d1
2 changed files with 17 additions and 15 deletions
|
@ -2220,21 +2220,6 @@ bool VersionTracker::init(const soinfo* si_from) {
|
|||
return init_verneed(si_from) && init_verdef(si_from);
|
||||
}
|
||||
|
||||
#if !defined(__mips__)
|
||||
#if defined(USE_RELA)
|
||||
static ElfW(Addr) get_addend(ElfW(Rela)* rela, ElfW(Addr) reloc_addr __unused) {
|
||||
return rela->r_addend;
|
||||
}
|
||||
#else
|
||||
static ElfW(Addr) get_addend(ElfW(Rel)* rel, ElfW(Addr) reloc_addr) {
|
||||
if (ELFW(R_TYPE)(rel->r_info) == R_GENERIC_RELATIVE ||
|
||||
ELFW(R_TYPE)(rel->r_info) == R_GENERIC_IRELATIVE) {
|
||||
return *reinterpret_cast<ElfW(Addr)*>(reloc_addr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO (dimitry): Methods below need to be moved out of soinfo
|
||||
// and in more isolated file in order minimize dependencies on
|
||||
// unnecessary object in the linker binary. Consider making them
|
||||
|
@ -2260,6 +2245,21 @@ bool soinfo::lookup_version_info(const VersionTracker& version_tracker, ElfW(Wor
|
|||
return true;
|
||||
}
|
||||
|
||||
#if !defined(__mips__)
|
||||
#if defined(USE_RELA)
|
||||
static ElfW(Addr) get_addend(ElfW(Rela)* rela, ElfW(Addr) reloc_addr __unused) {
|
||||
return rela->r_addend;
|
||||
}
|
||||
#else
|
||||
static ElfW(Addr) get_addend(ElfW(Rel)* rel, ElfW(Addr) reloc_addr) {
|
||||
if (ELFW(R_TYPE)(rel->r_info) == R_GENERIC_RELATIVE ||
|
||||
ELFW(R_TYPE)(rel->r_info) == R_GENERIC_IRELATIVE) {
|
||||
return *reinterpret_cast<ElfW(Addr)*>(reloc_addr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename ElfRelIteratorT>
|
||||
bool soinfo::relocate(const VersionTracker& version_tracker, ElfRelIteratorT&& rel_iterator,
|
||||
const soinfo_list_t& global_group, const soinfo_list_t& local_group) {
|
||||
|
|
|
@ -32,10 +32,12 @@
|
|||
|
||||
#include "linker.h"
|
||||
#include "linker_debug.h"
|
||||
#include "linker_globals.h"
|
||||
#include "linker_phdr.h"
|
||||
#include "linker_relocs.h"
|
||||
#include "linker_reloc_iterators.h"
|
||||
#include "linker_sleb128.h"
|
||||
#include "linker_soinfo.h"
|
||||
|
||||
template bool soinfo::relocate<plain_reloc_iterator>(const VersionTracker& version_tracker,
|
||||
plain_reloc_iterator&& rel_iterator,
|
||||
|
|
Loading…
Reference in a new issue