aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2008-09-29 21:10:26 +0000
committerCary Coutant <ccoutant@google.com>2008-09-29 21:10:26 +0000
commiteff458138e2978ee9a3aef4ebee40d53da11e764 (patch)
treee3dc9d42321c76802d091efde97049a536c77ef4 /gold/symtab.cc
parent1927a18f3190247ad2b049b46e5bbe00f889507a (diff)
downloadgdb-eff458138e2978ee9a3aef4ebee40d53da11e764.zip
gdb-eff458138e2978ee9a3aef4ebee40d53da11e764.tar.gz
gdb-eff458138e2978ee9a3aef4ebee40d53da11e764.tar.bz2
* mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
* object.cc (Sized_relobj::do_layout): Use constant invalid_address instead of -1U. (Sized_relobj::do_finalize_local_symbols): Likewise. (Sized_relobj::map_to_kept_section): Likewise. * object.h (Sized_relobj::invalid_address): New constant. (Sized_relobj::do_output_section_offset): Check for invalid_address and return -1ULL. * output.cc (Output_reloc::local_section_offset): Use constant invalid_address instead of -1U. (Output_reloc::get_address): Likewise. (Output_section::output_address): Change -1U to -1ULL. * output.h (Output_reloc::invalid_address): New constant. * reloc.cc (Sized_relobj::write_sections): Use constant invalid_address instead of -1U. (Sized_relobj::relocate_sections): Likewise. * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol values for merge sections. * target-reloc.h (relocate_for_relocatable): Use constant invalid_address instead of -1U.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 3bb88d8..c2de3bc 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2136,11 +2136,20 @@ Symbol_table::sized_finalize_symbol(Symbol* unsized_sym)
}
uint64_t secoff64 = relobj->output_section_offset(shndx);
- Value_type secoff = convert_types<Value_type, uint64_t>(secoff64);
- if (sym->type() == elfcpp::STT_TLS)
- value = sym->value() + os->tls_offset() + secoff;
- else
- value = sym->value() + os->address() + secoff;
+ if (secoff64 == -1ULL)
+ {
+ // The section needs special handling (e.g., a merge section).
+ value = os->output_address(relobj, shndx, sym->value());
+ }
+ else
+ {
+ Value_type secoff =
+ convert_types<Value_type, uint64_t>(secoff64);
+ if (sym->type() == elfcpp::STT_TLS)
+ value = sym->value() + os->tls_offset() + secoff;
+ else
+ value = sym->value() + os->address() + secoff;
+ }
}
}
break;