aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-10 23:08:18 +0000
committerAlan Modra <amodra@gmail.com>2013-03-10 23:08:18 +0000
commitdc3714f31f5b15f9c078dcf7ddaa705dacd313c0 (patch)
tree29717f9ed43f8fa606369975acac03a8e719c056 /gold/symtab.h
parent3bcc5422890014bfa8f8602d3c680c29a3384c29 (diff)
downloadgdb-dc3714f31f5b15f9c078dcf7ddaa705dacd313c0.zip
gdb-dc3714f31f5b15f9c078dcf7ddaa705dacd313c0.tar.gz
gdb-dc3714f31f5b15f9c078dcf7ddaa705dacd313c0.tar.bz2
* gold.cc (queue_middle_tasks): Move detect_odr_violations..
* layout.cc (Layout_task_runner::run): ..to here. * symtab.h (struct Symbol_location): Extract from.. (class Symbol_table): ..here. * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location. * target.h (class Target): Add function_location and do_function_location functions. (class Sized_target): Add do_function_location. * object.h (class Sized_relobj_file): Move find_shdr.. (class Object): ..to here. * object.cc: Likewise. Update to suit. Instantiate. (Sized_relobj_file::find_eh_frame): Update find_shdr call. * powerpc.cc (class Powerpc_dynobj): New. (Target_powerpc::do_function_location): New function. (Powerpc_relobj::do_find_special_sections): Update find_shdr call. (Powerpc_dynobj::do_read_symbols): New function. (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index f26d4b9..040be95 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -1180,6 +1180,25 @@ struct Define_symbol_in_segment
bool only_if_ref;
};
+// Specify an object/section/offset location. Used by ODR code.
+
+struct Symbol_location
+{
+ // Object where the symbol is defined.
+ Object* object;
+ // Section-in-object where the symbol is defined.
+ unsigned int shndx;
+ // For relocatable objects, offset-in-section where the symbol is defined.
+ // For dynamic objects, address where the symbol is defined.
+ off_t offset;
+ bool operator==(const Symbol_location& that) const
+ {
+ return (this->object == that.object
+ && this->shndx == that.shndx
+ && this->offset == that.offset);
+ }
+};
+
// This class manages warnings. Warnings are a GNU extension. When
// we see a section named .gnu.warning.SYM in an object file, and if
// we wind using the definition of SYM from that object file, then we
@@ -1599,19 +1618,6 @@ class Symbol_table
// the locations the symbols is (weakly) defined (and certain other
// conditions are met). This map will be used later to detect
// possible One Definition Rule (ODR) violations.
- struct Symbol_location
- {
- Object* object; // Object where the symbol is defined.
- unsigned int shndx; // Section-in-object where the symbol is defined.
- off_t offset; // Offset-in-section where the symbol is defined.
- bool operator==(const Symbol_location& that) const
- {
- return (this->object == that.object
- && this->shndx == that.shndx
- && this->offset == that.offset);
- }
- };
-
struct Symbol_location_hash
{
size_t operator()(const Symbol_location& loc) const