aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-04 23:53:15 +0000
committerIan Lance Taylor <iant@google.com>2008-02-04 23:53:15 +0000
commit7d26c6cc60a44ed1c465b9ae9eae1d096ecedc05 (patch)
treeb9a1437aae29db11f6964883149af1818bb7d23d /gold
parent2d312b6be3acaf6cac82abf81dd10124efd2705e (diff)
downloadgdb-7d26c6cc60a44ed1c465b9ae9eae1d096ecedc05.zip
gdb-7d26c6cc60a44ed1c465b9ae9eae1d096ecedc05.tar.gz
gdb-7d26c6cc60a44ed1c465b9ae9eae1d096ecedc05.tar.bz2
Print PHDRS clause for debugging.
Diffstat (limited to 'gold')
-rw-r--r--gold/script-sections.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/gold/script-sections.cc b/gold/script-sections.cc
index 441c3ee..7f51e8b 100644
--- a/gold/script-sections.cc
+++ b/gold/script-sections.cc
@@ -1777,6 +1777,14 @@ Output_section_definition::print(FILE* f) const
this->fill_->print(f);
}
+ if (this->phdrs_ != NULL)
+ {
+ for (String_list::const_iterator p = this->phdrs_->begin();
+ p != this->phdrs_->end();
+ ++p)
+ fprintf(f, " :%s", p->c_str());
+ }
+
fprintf(f, "\n");
}
@@ -1967,6 +1975,10 @@ class Phdrs_element
this->segment_->set_flags(this->flags_);
}
+ // Print for debugging.
+ void
+ print(FILE*) const;
+
private:
// The name used in the script.
std::string name_;
@@ -1989,6 +2001,27 @@ class Phdrs_element
Output_segment* segment_;
};
+// Print for debugging.
+
+void
+Phdrs_element::print(FILE* f) const
+{
+ fprintf(f, " %s 0x%x", this->name_.c_str(), this->type_);
+ if (this->includes_filehdr_)
+ fprintf(f, " FILEHDR");
+ if (this->includes_phdrs_)
+ fprintf(f, " PHDRS");
+ if (this->is_flags_valid_)
+ fprintf(f, " FLAGS(%u)", this->flags_);
+ if (this->load_address_ != NULL)
+ {
+ fprintf(f, " AT(");
+ this->load_address_->print(f);
+ fprintf(f, ")");
+ }
+ fprintf(f, ";\n");
+}
+
// Class Script_sections.
Script_sections::Script_sections()
@@ -2844,6 +2877,16 @@ Script_sections::print(FILE* f) const
(*p)->print(f);
fprintf(f, "}\n");
+
+ if (this->phdrs_elements_ != NULL)
+ {
+ fprintf(f, "PHDRS {\n");
+ for (Phdrs_elements::const_iterator p = this->phdrs_elements_->begin();
+ p != this->phdrs_elements_->end();
+ ++p)
+ (*p)->print(f);
+ fprintf(f, "}\n");
+ }
}
} // End namespace gold.