mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 18:20:12 +08:00
From Craig Silverstein: Implement section_info.
This commit is contained in:
@ -143,6 +143,11 @@ class Elf_file
|
|||||||
Elf_Word
|
Elf_Word
|
||||||
section_link(unsigned int shndx);
|
section_link(unsigned int shndx);
|
||||||
|
|
||||||
|
// Return the info field of section SHNDX.
|
||||||
|
Elf_Word
|
||||||
|
section_info(unsigned int shndx);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shared constructor code.
|
// Shared constructor code.
|
||||||
void
|
void
|
||||||
@ -348,6 +353,25 @@ Elf_file<size, big_endian, File>::section_link(unsigned int shndx)
|
|||||||
return shdr.get_sh_link();
|
return shdr.get_sh_link();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return the sh_info field of section SHNDX.
|
||||||
|
|
||||||
|
template<int size, bool big_endian, typename File>
|
||||||
|
Elf_Word
|
||||||
|
Elf_file<size, big_endian, File>::section_info(unsigned int shndx)
|
||||||
|
{
|
||||||
|
File* const file = this->file_;
|
||||||
|
|
||||||
|
if (shndx >= this->shnum())
|
||||||
|
file->error(_("section_info: bad shndx %u >= %u"),
|
||||||
|
shndx, this->shnum());
|
||||||
|
|
||||||
|
typename File::View v(file->view(this->section_header_offset(shndx),
|
||||||
|
This::shdr_size));
|
||||||
|
|
||||||
|
Ef_shdr shdr(v.data());
|
||||||
|
return shdr.get_sh_info();
|
||||||
|
}
|
||||||
|
|
||||||
} // End namespace elfcpp.
|
} // End namespace elfcpp.
|
||||||
|
|
||||||
#endif // !defined(ELFCPP_FILE_H)
|
#endif // !defined(ELFCPP_FILE_H)
|
||||||
|
Reference in New Issue
Block a user