aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2014-07-02 16:12:51 -0700
committerCary Coutant <ccoutant@google.com>2014-09-02 15:44:58 -0700
commit54674d38930c7da1af518510fede6f700f5ca596 (patch)
treeaef7ff0038d0040cafb00667066b48bc874b17bb /gold
parent9860cbcfb60bdae2f9800e6a6ea5f21ef1507d08 (diff)
downloadgdb-54674d38930c7da1af518510fede6f700f5ca596.zip
gdb-54674d38930c7da1af518510fede6f700f5ca596.tar.gz
gdb-54674d38930c7da1af518510fede6f700f5ca596.tar.bz2
Make Elf_file::section_name() a const function, so that it can be used in
places where we have only a const Elf_file*. elfcpp/ * elfcpp_file.h (Elf_file::shnum): New const function. (Elf_file::shstrndx): New const function. (Elf_file::large_shndx_offset): New const function. (Elf_file::section_name): Add const attribute. (Elf_file::section_header_offset): Likewise. gold/ * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute. * dynobj.h (Sized_dynobj::do_section_name): Likewise. * incremental.cc (Sized_relobj_incr::do_section_name): Likewise. (Sized_incr_dynobj::do_section_name): Likewise. * incremental.h (Sized_relobj_incr::do_section_name): Likewise. (Sized_incr_dynobj::do_section_name): Likewise. * object.h (Object::section_name): Likewise. (Object::do_section_name): Likewise. (Sized_relobj_file::do_section_name): Likewise. * plugin.cc (Sized_pluginobj::do_section_name): Likewise. * plugin.h (Sized_pluginobj::do_section_name): Likewise.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog14
-rw-r--r--gold/dwp.cc2
-rw-r--r--gold/dynobj.h2
-rw-r--r--gold/incremental.cc8
-rw-r--r--gold/incremental.h4
-rw-r--r--gold/object.h6
-rw-r--r--gold/plugin.cc2
-rw-r--r--gold/plugin.h2
8 files changed, 27 insertions, 13 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 0fa1561..2c09a05 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,19 @@
2014-09-02 Cary Coutant <ccoutant@google.com>
+ * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
+ * dynobj.h (Sized_dynobj::do_section_name): Likewise.
+ * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
+ (Sized_incr_dynobj::do_section_name): Likewise.
+ * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
+ (Sized_incr_dynobj::do_section_name): Likewise.
+ * object.h (Object::section_name): Likewise.
+ (Object::do_section_name): Likewise.
+ (Sized_relobj_file::do_section_name): Likewise.
+ * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
+ * plugin.h (Sized_pluginobj::do_section_name): Likewise.
+
+2014-09-02 Cary Coutant <ccoutant@google.com>
+
PR gold/17005
* ehframe.cc (Fde::write): Add output_offset parameter.
(Cie::write): Likewise.
diff --git a/gold/dwp.cc b/gold/dwp.cc
index 359d4b7..5401e0c 100644
--- a/gold/dwp.cc
+++ b/gold/dwp.cc
@@ -272,7 +272,7 @@ class Sized_relobj_dwo : public Sized_relobj<size, big_endian>
// Get the name of a section.
std::string
- do_section_name(unsigned int shndx)
+ do_section_name(unsigned int shndx) const
{ return this->elf_file_.section_name(shndx); }
// Get the size of a section.
diff --git a/gold/dynobj.h b/gold/dynobj.h
index 03b8053..c20ed20 100644
--- a/gold/dynobj.h
+++ b/gold/dynobj.h
@@ -203,7 +203,7 @@ class Sized_dynobj : public Dynobj
// Get the name of a section.
std::string
- do_section_name(unsigned int shndx)
+ do_section_name(unsigned int shndx) const
{ return this->elf_file_.section_name(shndx); }
// Return a view of the contents of a section. Set *PLEN to the
diff --git a/gold/incremental.cc b/gold/incremental.cc
index 2345cf8..bbc055c 100644
--- a/gold/incremental.cc
+++ b/gold/incremental.cc
@@ -2270,10 +2270,10 @@ Sized_relobj_incr<size, big_endian>::do_section_size(unsigned int)
template<int size, bool big_endian>
std::string
-Sized_relobj_incr<size, big_endian>::do_section_name(unsigned int shndx)
+Sized_relobj_incr<size, big_endian>::do_section_name(unsigned int shndx) const
{
- Output_sections& out_sections(this->output_sections());
- Output_section* os = out_sections[shndx];
+ const Output_sections& out_sections(this->output_sections());
+ const Output_section* os = out_sections[shndx];
if (os == NULL)
return NULL;
return os->name();
@@ -2858,7 +2858,7 @@ Sized_incr_dynobj<size, big_endian>::do_section_size(unsigned int)
template<int size, bool big_endian>
std::string
-Sized_incr_dynobj<size, big_endian>::do_section_name(unsigned int)
+Sized_incr_dynobj<size, big_endian>::do_section_name(unsigned int) const
{
gold_unreachable();
}
diff --git a/gold/incremental.h b/gold/incremental.h
index f84511d..5440c86 100644
--- a/gold/incremental.h
+++ b/gold/incremental.h
@@ -1901,7 +1901,7 @@ class Sized_relobj_incr : public Sized_relobj<size, big_endian>
// Get the name of a section.
std::string
- do_section_name(unsigned int shndx);
+ do_section_name(unsigned int shndx) const;
// Return a view of the contents of a section.
const unsigned char*
@@ -2112,7 +2112,7 @@ class Sized_incr_dynobj : public Dynobj
// Get the name of a section.
std::string
- do_section_name(unsigned int shndx);
+ do_section_name(unsigned int shndx) const;
// Return a view of the contents of a section.
const unsigned char*
diff --git a/gold/object.h b/gold/object.h
index 92cdbdd..754b1d2 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -507,7 +507,7 @@ class Object
// Return the name of a section given a section index.
std::string
- section_name(unsigned int shndx)
+ section_name(unsigned int shndx) const
{ return this->do_section_name(shndx); }
// Return the section flags given a section index.
@@ -822,7 +822,7 @@ class Object
// Get the name of a section--implemented by child class.
virtual std::string
- do_section_name(unsigned int shndx) = 0;
+ do_section_name(unsigned int shndx) const = 0;
// Get section flags--implemented by child class.
virtual uint64_t
@@ -2315,7 +2315,7 @@ class Sized_relobj_file : public Sized_relobj<size, big_endian>
// Get the name of a section.
std::string
- do_section_name(unsigned int shndx)
+ do_section_name(unsigned int shndx) const
{ return this->elf_file_.section_name(shndx); }
// Return the location of the contents of a section.
diff --git a/gold/plugin.cc b/gold/plugin.cc
index 62807b8..6519732 100644
--- a/gold/plugin.cc
+++ b/gold/plugin.cc
@@ -1209,7 +1209,7 @@ Sized_pluginobj<size, big_endian>::do_section_size(unsigned int)
template<int size, bool big_endian>
std::string
-Sized_pluginobj<size, big_endian>::do_section_name(unsigned int)
+Sized_pluginobj<size, big_endian>::do_section_name(unsigned int) const
{
gold_unreachable();
return std::string();
diff --git a/gold/plugin.h b/gold/plugin.h
index 320b02d..9ef2812 100644
--- a/gold/plugin.h
+++ b/gold/plugin.h
@@ -490,7 +490,7 @@ class Sized_pluginobj : public Pluginobj
// Get the name of a section.
std::string
- do_section_name(unsigned int shndx);
+ do_section_name(unsigned int shndx) const;
// Return a view of the contents of a section.
const unsigned char*