You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
//===- AArch64ELFDynamic.cpp ----------------------------------------------===//
|
|
//
|
|
// The MCLinker Project
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#include "AArch64ELFDynamic.h"
|
|
|
|
#include "mcld/LD/ELFFileFormat.h"
|
|
#include "mcld/LinkerConfig.h"
|
|
|
|
namespace mcld {
|
|
|
|
AArch64ELFDynamic::AArch64ELFDynamic(const GNULDBackend& pParent,
|
|
const LinkerConfig& pConfig)
|
|
: ELFDynamic(pParent, pConfig) {
|
|
}
|
|
|
|
AArch64ELFDynamic::~AArch64ELFDynamic() {
|
|
}
|
|
|
|
void AArch64ELFDynamic::reserveTargetEntries(const ELFFileFormat& pFormat) {
|
|
// reservePLTGOT
|
|
if (config().options().hasNow()) {
|
|
if (pFormat.hasGOT())
|
|
reserveOne(llvm::ELF::DT_PLTGOT);
|
|
} else {
|
|
if (pFormat.hasGOTPLT())
|
|
reserveOne(llvm::ELF::DT_PLTGOT);
|
|
}
|
|
}
|
|
|
|
void AArch64ELFDynamic::applyTargetEntries(const ELFFileFormat& pFormat) {
|
|
// applyPLTGOT
|
|
if (config().options().hasNow()) {
|
|
if (pFormat.hasGOT())
|
|
applyOne(llvm::ELF::DT_PLTGOT, pFormat.getGOT().addr());
|
|
} else {
|
|
if (pFormat.hasGOTPLT())
|
|
applyOne(llvm::ELF::DT_PLTGOT, pFormat.getGOTPLT().addr());
|
|
}
|
|
}
|
|
|
|
} // namespace mcld
|