ELF: Make some functions constant. NFC.

This is a preparation for ICF.

llvm-svn: 261710
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index ad81780..1bf467b 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -68,7 +68,7 @@
 // Returns a section that Rel relocation is pointing to.
 template <class ELFT>
 InputSectionBase<ELFT> *
-InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) {
+InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) const {
   // Global symbol
   uint32_t SymIndex = Rel.getSymbol(Config->Mips64EL);
   if (SymbolBody *B = File->getSymbolBody(SymIndex))
@@ -83,7 +83,7 @@
 
 template <class ELFT>
 InputSectionBase<ELFT> *
-InputSectionBase<ELFT>::getRelocTarget(const Elf_Rela &Rel) {
+InputSectionBase<ELFT>::getRelocTarget(const Elf_Rela &Rel) const {
   return getRelocTarget(reinterpret_cast<const Elf_Rel &>(Rel));
 }
 
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index f0d4972..5c5ec2a 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -73,8 +73,8 @@
   ArrayRef<uint8_t> getSectionData() const;
 
   // Returns a section that Rel is pointing to. Used by the garbage collector.
-  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rel &Rel);
-  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel);
+  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rel &Rel) const;
+  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel) const;
 
   template <bool isRela>
   using RelIteratorRange =