Files
rk35xx-android14/frameworks/compile/mclinker/include/mcld/Target/ELFDynamic.tcc
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

53 lines
1.4 KiB
C++

//===- ELFDynamic.h -------------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
/// 32-bit dynamic entry
Entry<32, true>::Entry() {
m_Pair.d_tag = 0;
m_Pair.d_un.d_val = 0;
}
Entry<32, true>::~Entry() {
}
void Entry<32, true>::setValue(uint64_t pTag, uint64_t pValue) {
m_Pair.d_tag = pTag;
m_Pair.d_un.d_val = pValue;
}
size_t Entry<32, true>::emit(uint8_t* pAddress) const {
memcpy(reinterpret_cast<void*>(pAddress),
reinterpret_cast<const void*>(&m_Pair),
sizeof(Pair));
return sizeof(Pair);
}
//===----------------------------------------------------------------------===//
/// 64-bit dynamic entry
Entry<64, true>::Entry() {
m_Pair.d_tag = 0;
m_Pair.d_un.d_val = 0;
}
Entry<64, true>::~Entry() {
}
void Entry<64, true>::setValue(uint64_t pTag, uint64_t pValue) {
m_Pair.d_tag = pTag;
m_Pair.d_un.d_val = pValue;
}
size_t Entry<64, true>::emit(uint8_t* pAddress) const {
memcpy(reinterpret_cast<void*>(pAddress),
reinterpret_cast<const void*>(&m_Pair),
sizeof(Pair));
return sizeof(Pair);
}