ELF: Make some functions constant. NFC.

This is a preparation for ICF.

llvm-svn: 261710
This commit is contained in:
Rui Ueyama 2016-02-24 00:23:13 +00:00
parent 436d91d835
commit d7e4a281c4
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ InputSectionBase<ELFT>::getOffset(const Elf_Sym &Sym) {
// 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 @@ InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) {
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));
}

View File

@ -73,8 +73,8 @@ public:
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 =