From c7eed3cf66d7b62e79f82a28cf40b512ad3bf65c Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Mon, 18 Jan 2016 18:52:04 +0000 Subject: [PATCH] [llvm-readobj][ELF] s/dyn_rela_/dyn_rel_/ No functional changes. Follow up to r258001. These template functions might return both REL and RELA relocations. The 'rel' noun looks less ambiguous. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258060 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-readobj/ELFDumper.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp index 4eac7e4b8bf..0bb3a3dbb83 100644 --- a/tools/llvm-readobj/ELFDumper.cpp +++ b/tools/llvm-readobj/ELFDumper.cpp @@ -110,10 +110,10 @@ private: void printRelocation(Elf_Rela Rel, const Elf_Shdr *SymTab); void printValue(uint64_t Type, uint64_t Value); - template - static const RELA *dyn_rela_begin(const DynRegionInfo ®ion); - template - static const RELA *dyn_rela_end(const DynRegionInfo ®ion); + template + static const REL *dyn_rel_begin(const DynRegionInfo ®ion); + template + static const REL *dyn_rel_end(const DynRegionInfo ®ion); Elf_Rel_Range dyn_rels() const; Elf_Rela_Range dyn_relas() const; StringRef getDynamicString(uint64_t Offset) const; @@ -1026,32 +1026,32 @@ ELFDumper::ELFDumper(const ELFFile *Obj, StreamWriter &Writer) } template -template -const RELA *ELFDumper::dyn_rela_begin(const DynRegionInfo &Region) { - if (Region.Size && Region.EntSize != sizeof(RELA)) +template +const REL *ELFDumper::dyn_rel_begin(const DynRegionInfo &Region) { + if (Region.Size && Region.EntSize != sizeof(REL)) report_fatal_error("Invalid relocation entry size"); - return reinterpret_cast(Region.Addr); + return reinterpret_cast(Region.Addr); } template -template -const RELA *ELFDumper::dyn_rela_end(const DynRegionInfo &Region) { +template +const REL *ELFDumper::dyn_rel_end(const DynRegionInfo &Region) { uint64_t Size = Region.Size; - if (Size % sizeof(RELA)) + if (Size % sizeof(REL)) report_fatal_error("Invalid relocation table size"); - return dyn_rela_begin(Region) + Size / sizeof(RELA); + return dyn_rel_begin(Region) + Size / sizeof(REL); } template typename ELFDumper::Elf_Rel_Range ELFDumper::dyn_rels() const { - return make_range(dyn_rela_begin(DynRelRegion), - dyn_rela_end(DynRelRegion)); + return make_range(dyn_rel_begin(DynRelRegion), + dyn_rel_end(DynRelRegion)); } template typename ELFDumper::Elf_Rela_Range ELFDumper::dyn_relas() const { - return make_range(dyn_rela_begin(DynRelaRegion), - dyn_rela_end(DynRelaRegion)); + return make_range(dyn_rel_begin(DynRelaRegion), + dyn_rel_end(DynRelaRegion)); } template