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 {
14   m_Pair.d_tag = 0;
15   m_Pair.d_un.d_val = 0;
16 }
17 
~Entry()18 Entry<32, true>::~Entry()
19 {
20 }
21 
setValue(uint64_t pTag,uint64_t pValue)22 void Entry<32, true>::setValue(uint64_t pTag, uint64_t pValue)
23 {
24   m_Pair.d_tag = pTag;
25   m_Pair.d_un.d_val = pValue;
26 }
27 
emit(uint8_t * pAddress) const28 size_t Entry<32, true>::emit(uint8_t* pAddress) const
29 {
30   memcpy(reinterpret_cast<void*>(pAddress),
31          reinterpret_cast<const void*>(&m_Pair),
32          sizeof(Pair));
33   return sizeof(Pair);
34 }
35 
36 //===----------------------------------------------------------------------===//
37 /// 64-bit dynamic entry
Entry()38 Entry<64, true>::Entry()
39 {
40   m_Pair.d_tag = 0;
41   m_Pair.d_un.d_val = 0;
42 }
43 
~Entry()44 Entry<64, true>::~Entry()
45 {
46 }
47 
setValue(uint64_t pTag,uint64_t pValue)48 void Entry<64, true>::setValue(uint64_t pTag, uint64_t pValue)
49 {
50   m_Pair.d_tag = pTag;
51   m_Pair.d_un.d_val = pValue;
52 }
53 
emit(uint8_t * pAddress) const54 size_t Entry<64, true>::emit(uint8_t* pAddress) const
55 {
56   memcpy(reinterpret_cast<void*>(pAddress),
57          reinterpret_cast<const void*>(&m_Pair),
58          sizeof(Pair));
59   return sizeof(Pair);
60 }
61 
62