aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-08-01 18:25:22 +0000
committerCary Coutant <ccoutant@google.com>2011-08-01 18:25:22 +0000
commit9590bf2544154e40e76e1e4d795d1b21327b0abb (patch)
tree52d41c1f96a4c0d6d0a8e102f61bc8a5f1c50687 /gold/symtab.cc
parent9300444e01cbd7db31985548a0a0eba2b8040b83 (diff)
downloadgdb-9590bf2544154e40e76e1e4d795d1b21327b0abb.zip
gdb-9590bf2544154e40e76e1e4d795d1b21327b0abb.tar.gz
gdb-9590bf2544154e40e76e1e4d795d1b21327b0abb.tar.bz2
* layout.cc (Layout::set_segment_offsets): Don't realign text
segment if -Ttext was specified. * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF file type. * object.h (Sized_relobj_file::e_type): New function. (Sized_relobj_file::e_type_): New data member. * symtab.cc (Symbol_table::add_from_relobj): Don't add section base address for ET_EXEC files. * target.cc (Target::do_make_elf_object_implementation): Allow ET_EXEC files with --just-symbols option.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index e289f79..ff6ff84 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1192,12 +1192,14 @@ Symbol_table::add_from_relobj(
{
memcpy(symbuf, p, sym_size);
elfcpp::Sym_write<size, big_endian> sw(symbuf);
- if (orig_st_shndx != elfcpp::SHN_UNDEF && is_ordinary)
+ if (orig_st_shndx != elfcpp::SHN_UNDEF
+ && is_ordinary
+ && relobj->e_type() == elfcpp::ET_REL)
{
- // Symbol values in object files are section relative.
- // This is normally what we want, but since here we are
- // converting the symbol to absolute we need to add the
- // section address. The section address in an object
+ // Symbol values in relocatable object files are section
+ // relative. This is normally what we want, but since here
+ // we are converting the symbol to absolute we need to add
+ // the section address. The section address in an object
// file is normally zero, but people can use a linker
// script to change it.
sw.put_st_value(sym.get_st_value()