2007-08-29 H.J. Lu <hongjiu.lu@intel.com>
[binutils.git] / gold / reloc-types.h
blob62538d60117c3f06690b076e165bd751cb58a75b
1 // reloc-types.h -- ELF relocation templates for gold -*- C++ -*-
3 // This header files defines a few convenient templated types for use
4 // when handling ELF relocations.
6 #ifndef GOLD_RELOC_TYPES_H
7 #define GOLD_RELOC_TYPES_H
9 #include "elfcpp.h"
11 namespace gold
14 // Pick the ELF relocation accessor class and the size based on
15 // SH_TYPE, which is either elfcpp::SHT_REL or elfcpp::SHT_RELA.
17 template<int sh_type, int size, bool big_endian>
18 struct Reloc_types;
20 template<int size, bool big_endian>
21 struct Reloc_types<elfcpp::SHT_REL, size, big_endian>
23 typedef typename elfcpp::Rel<size, big_endian> Reloc;
24 static const int reloc_size = elfcpp::Elf_sizes<size>::rel_size;
27 template<int size, bool big_endian>
28 struct Reloc_types<elfcpp::SHT_RELA, size, big_endian>
30 typedef typename elfcpp::Rela<size, big_endian> Reloc;
31 static const int reloc_size = elfcpp::Elf_sizes<size>::rela_size;
34 }; // End namespace gold.
36 #endif // !defined(GOLD_RELOC_TYPE_SH)