summaryrefslogtreecommitdiff
path: root/gold/target.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/target.cc
parent9300444e01cbd7db31985548a0a0eba2b8040b83 (diff)
downloadbinutils-gdb-9590bf2544154e40e76e1e4d795d1b21327b0abb.tar.gz
* 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/target.cc')
-rw-r--r--gold/target.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gold/target.cc b/gold/target.cc
index 4a7af83c161..091f9d34cd5 100644
--- a/gold/target.cc
+++ b/gold/target.cc
@@ -72,7 +72,10 @@ Target::do_make_elf_object_implementation(
const elfcpp::Ehdr<size, big_endian>& ehdr)
{
int et = ehdr.get_e_type();
- if (et == elfcpp::ET_REL)
+ // ET_EXEC files are valid input for --just-symbols/-R,
+ // and we treat them as relocatable objects.
+ if (et == elfcpp::ET_REL
+ || (et == elfcpp::ET_EXEC && input_file->just_symbols()))
{
Sized_relobj_file<size, big_endian>* obj =
new Sized_relobj_file<size, big_endian>(name, input_file, offset, ehdr);