Hash tables, dynamic section, i386 PLT, gold_assert.
[deliverable/binutils-gdb.git] / elfcpp / elfcpp_file.h
index 043c2690148f15aa13e55484b9c64812e9369f1f..c9563eeed74f496f5b4e056d0f8ba37880ad4340 100644 (file)
@@ -102,6 +102,10 @@ class Elf_file
   typename File::Location
   section_contents(unsigned int shndx);
 
+  // Return the flags of section SHNDX.
+  typename Elf_types<size>::Elf_WXword
+  section_flags(unsigned int shndx);
+
  private:
   // Shared constructor code.
   void
@@ -250,6 +254,25 @@ Elf_file<size, big_endian, File>::section_contents(unsigned int shndx)
   return typename File::Location(shdr.get_sh_offset(), shdr.get_sh_size());
 }
 
+// Return the section flags of section SHNDX.
+
+template<int size, bool big_endian, typename File>
+typename Elf_types<size>::Elf_WXword
+Elf_file<size, big_endian, File>::section_flags(unsigned int shndx)
+{
+  File* const file = this->file_;
+
+  if (shndx >= this->shnum())
+    file->error(_("section_flags: 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_flags();
+}
+
 } // End namespace elfcpp.
 
 #endif // !defined(ELFCPP_FILE_H)
This page took 0.023854 seconds and 4 git commands to generate.