aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-27 22:38:18 +0000
committerIan Lance Taylor <iant@google.com>2008-02-27 22:38:18 +0000
commit7019cd256559b48bc642fcb8ff9a4ea9e98bced7 (patch)
treec88847678e9c212b482d4a30beccdd74abdd90c6 /gold/object.cc
parent20b4711e0556d73b7a16250447ee5ca505b834db (diff)
downloadgdb-7019cd256559b48bc642fcb8ff9a4ea9e98bced7.zip
gdb-7019cd256559b48bc642fcb8ff9a4ea9e98bced7.tar.gz
gdb-7019cd256559b48bc642fcb8ff9a4ea9e98bced7.tar.bz2
Implement -q/--emit-relocs.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gold/object.cc b/gold/object.cc
index 3db6f85..c886717 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -593,8 +593,9 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
// Keep track of which sections to omit.
std::vector<bool> omit(shnum, false);
- // Keep track of reloc sections when doing a relocatable link.
+ // Keep track of reloc sections when emitting relocations.
const bool output_is_object = parameters->output_is_object();
+ const bool emit_relocs = output_is_object || parameters->emit_relocs();
std::vector<unsigned int> reloc_sections;
// Keep track of .eh_frame sections.
@@ -660,7 +661,7 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
// ones associated with sections which are not being discarded.
// However, we don't know that yet for all sections. So save
// reloc sections and process them later.
- if (output_is_object
+ if (emit_relocs
&& (shdr.get_sh_type() == elfcpp::SHT_REL
|| shdr.get_sh_type() == elfcpp::SHT_RELA))
{
@@ -704,7 +705,7 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
// When doing a relocatable link handle the reloc sections at the
// end.
- if (output_is_object)
+ if (emit_relocs)
this->size_relocatable_relocs();
for (std::vector<unsigned int>::const_iterator p = reloc_sections.begin();
p != reloc_sections.end();