diff options
author | Rui Ueyama <ruiu@google.com> | 2015-06-25 00:07:39 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-06-25 00:07:39 +0000 |
commit | 6a75acb1c2fde67614d86084d09f9debc0425d67 (patch) | |
tree | 309c7b3e212857adbb8aca424df37aab404b7069 /llvm/lib/Object/COFFObjectFile.cpp | |
parent | aa938fa6b645d98bd1b2367bdd4babd3d491b8c2 (diff) | |
download | bcm5719-llvm-6a75acb1c2fde67614d86084d09f9debc0425d67.tar.gz bcm5719-llvm-6a75acb1c2fde67614d86084d09f9debc0425d67.zip |
libObject/COFF: Add a function to get pointers to relocation entries.
llvm-svn: 240610
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/COFFObjectFile.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 797ee1a7cda..507d690f096 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -16,6 +16,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/iterator_range.h" #include "llvm/Support/COFF.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -1029,6 +1030,15 @@ COFFObjectFile::getCOFFRelocation(const RelocationRef &Reloc) const { return toRel(Reloc.getRawDataRefImpl()); } +iterator_range<const coff_relocation *> +COFFObjectFile::getRelocations(const coff_section *Sec) const { + const coff_relocation *I = getFirstReloc(Sec, Data, base()); + const coff_relocation *E = I; + if (I) + E += getNumberOfRelocations(Sec, Data, base()); + return make_range(I, E); +} + #define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(reloc_type) \ case COFF::reloc_type: \ Res = #reloc_type; \ |