diff options
Diffstat (limited to 'lld/ELF/Relocations.cpp')
| -rw-r--r-- | lld/ELF/Relocations.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index e19b1e6c8efb..707768dee6d3 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -459,7 +459,8 @@ private: // InputSectionBase. class RelocationScanner { public: - template <class ELFT> void scanSection(InputSectionBase &s); + template <class ELFT> + void scanSection(InputSectionBase &s, bool isEH = false); private: InputSectionBase *sec; @@ -1617,10 +1618,11 @@ void RelocationScanner::scan(Relocs<RelTy> rels) { }); } -template <class ELFT> void RelocationScanner::scanSection(InputSectionBase &s) { +template <class ELFT> +void RelocationScanner::scanSection(InputSectionBase &s, bool isEH) { sec = &s; getter = OffsetGetter(s); - const RelsOrRelas<ELFT> rels = s.template relsOrRelas<ELFT>(); + const RelsOrRelas<ELFT> rels = s.template relsOrRelas<ELFT>(!isEH); if (rels.areRelocsCrel()) scan<ELFT>(rels.crels); else if (rels.areRelocsRel()) @@ -1658,7 +1660,7 @@ template <class ELFT> void elf::scanRelocations() { RelocationScanner scanner; for (Partition &part : partitions) { for (EhInputSection *sec : part.ehFrame->sections) - scanner.template scanSection<ELFT>(*sec); + scanner.template scanSection<ELFT>(*sec, /*isEH=*/true); if (part.armExidx && part.armExidx->isLive()) for (InputSection *sec : part.armExidx->exidxSections) if (sec->isLive()) |
