aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-02 03:28:52 +0000
committerIan Lance Taylor <iant@google.com>2007-11-02 03:28:52 +0000
commitf7e2ee482013bd5df3e3726305eab7c5ed5ce020 (patch)
tree769d43a72a997fd42bcebdacc315e1c938c3e5a6 /gold/object.h
parent6a7eedfedcbe83b936a8be8abc489f0202205c7a (diff)
downloadgdb-f7e2ee482013bd5df3e3726305eab7c5ed5ce020.zip
gdb-f7e2ee482013bd5df3e3726305eab7c5ed5ce020.tar.gz
gdb-f7e2ee482013bd5df3e3726305eab7c5ed5ce020.tar.bz2
Reworked from Andrew Chatham: report error locations.
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/gold/object.h b/gold/object.h
index 46e332f..9fdb9a3 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -76,6 +76,15 @@ struct Read_symbols_data
unsigned int verneed_info;
};
+// Information used to print error messages.
+
+struct Symbol_location_info
+{
+ std::string source_file;
+ std::string enclosing_symbol_name;
+ int line_number;
+};
+
// Data about a single relocation section. This is read in
// read_relocs and processed in scan_relocs.
@@ -188,6 +197,11 @@ class Object
section_flags(unsigned int shndx)
{ return this->do_section_flags(shndx); }
+ // Return the section link field given a section index.
+ unsigned int
+ section_link(unsigned int shndx)
+ { return this->do_section_link(shndx); }
+
// Read the symbol information.
void
read_symbols(Read_symbols_data* sd)
@@ -277,6 +291,10 @@ class Object
virtual uint64_t
do_section_flags(unsigned int shndx) = 0;
+ // Get section link field--implemented by child class.
+ virtual unsigned int
+ do_section_link(unsigned int shndx) = 0;
+
// Get the file.
Input_file*
input_file() const
@@ -660,6 +678,13 @@ class Sized_relobj : public Relobj
gold_assert(ins.second);
}
+ // Return the name of the symbol that spans the given offset in the
+ // specified section in this object. This is used only for error
+ // messages and is not particularly efficient.
+ bool
+ get_symbol_location_info(unsigned int shndx, off_t offset,
+ Symbol_location_info* info);
+
// Read the symbols.
void
do_read_symbols(Read_symbols_data*);
@@ -706,6 +731,11 @@ class Sized_relobj : public Relobj
do_section_flags(unsigned int shndx)
{ return this->elf_file_.section_flags(shndx); }
+ // Return the section link field.
+ unsigned int
+ do_section_link(unsigned int shndx)
+ { return this->elf_file_.section_link(shndx); }
+
private:
// For convenience.
typedef Sized_relobj<size, big_endian> This;