* elf-bfd.h (struct elf_obj_tdata): Move find_line_info, local_stubs,
[binutils-gdb.git] / gold / dynobj.h
index 186b67cf7ecfbd07840ab6525cd49d2f28c7fccc..e027485f386b607a78cbc90e0bcdf043664ac721 100644 (file)
@@ -208,9 +208,19 @@ class Sized_dynobj : public Dynobj
 
   // Return a view of the contents of a section.  Set *PLEN to the
   // size.
-  Object::Location
-  do_section_contents(unsigned int shndx)
-  { return this->elf_file_.section_contents(shndx); }
+  const unsigned char*
+  do_section_contents(unsigned int shndx, section_size_type* plen,
+                     bool cache)
+  {
+    Location loc(this->elf_file_.section_contents(shndx));
+    *plen = convert_to_section_size_type(loc.data_size);
+    if (*plen == 0)
+      {
+       static const unsigned char empty[1] = { '\0' };
+       return empty;
+      }
+    return this->get_view(loc.file_offset, *plen, true, cache);
+  }
 
   // Return section flags.
   uint64_t