1 //===- ELFDynamic.h -------------------------------------------------------===//
2 //
3 // The MCLinker Project
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //===----------------------------------------------------------------------===//
11 /// 32-bit dynamic entry
Entry()12 Entry<32, true>::Entry() {
13 m_Pair.d_tag = 0;
14 m_Pair.d_un.d_val = 0;
15 }
16
~Entry()17 Entry<32, true>::~Entry() {
18 }
19
setValue(uint64_t pTag,uint64_t pValue)20 void Entry<32, true>::setValue(uint64_t pTag, uint64_t pValue) {
21 m_Pair.d_tag = pTag;
22 m_Pair.d_un.d_val = pValue;
23 }
24
emit(uint8_t * pAddress) const25 size_t Entry<32, true>::emit(uint8_t* pAddress) const {
26 memcpy(reinterpret_cast<void*>(pAddress),
27 reinterpret_cast<const void*>(&m_Pair),
28 sizeof(Pair));
29 return sizeof(Pair);
30 }
31
32 //===----------------------------------------------------------------------===//
33 /// 64-bit dynamic entry
Entry()34 Entry<64, true>::Entry() {
35 m_Pair.d_tag = 0;
36 m_Pair.d_un.d_val = 0;
37 }
38
~Entry()39 Entry<64, true>::~Entry() {
40 }
41
setValue(uint64_t pTag,uint64_t pValue)42 void Entry<64, true>::setValue(uint64_t pTag, uint64_t pValue) {
43 m_Pair.d_tag = pTag;
44 m_Pair.d_un.d_val = pValue;
45 }
46
emit(uint8_t * pAddress) const47 size_t Entry<64, true>::emit(uint8_t* pAddress) const {
48 memcpy(reinterpret_cast<void*>(pAddress),
49 reinterpret_cast<const void*>(&m_Pair),
50 sizeof(Pair));
51 return sizeof(Pair);
52 }
53