From 1d7ea43aae259570b2ac9bdd92a047d22bf73362 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 31 Dec 2009 05:43:29 +0000 Subject: [PATCH] PR 10979 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used, don't put the file header and segment headers in the text segment. --- gold/ChangeLog | 5 +++++ gold/layout.cc | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index 027940eacb..b2d7a4fd96 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,6 +1,11 @@ 2009-12-30 Ian Lance Taylor PR 10979 + * layout.cc (Layout::relaxation_loop_body): If -Ttext was used, + don't put the file header and segment headers in the text + segment. + + PR 10979 * common.cc (Sort_commons::operator()): Stabilize sort when both entries are NULL. (Symbol_table::do_allocate_commons_list): When allocating common diff --git a/gold/layout.cc b/gold/layout.cc index 8bbeebe938..c633d7be5f 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -1482,6 +1482,12 @@ Layout::relaxation_loop_body( != General_options::OBJECT_FORMAT_ELF) load_seg = NULL; + // If the user set the address of the text segment, that may not be + // compatible with putting the segment headers and file headers into + // that segment. + if (parameters->options().user_set_Ttext()) + load_seg = NULL; + gold_assert(phdr_seg == NULL || load_seg != NULL || this->script_options_->saw_sections_clause()); -- 2.11.0