aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-07-25 22:48:42 +0000
committerIan Lance Taylor <ian@airs.com>2011-07-25 22:48:42 +0000
commitd12a5ea8c9d5fb95d740c8e34a3d035c3c815635 (patch)
tree64e09c4cfe50f6c1a3ced007db7ef8f4850f66d4 /gold/layout.cc
parentdea91a5c342ccd76b908e094a184ed2538c0f8c2 (diff)
downloadgdb-d12a5ea8c9d5fb95d740c8e34a3d035c3c815635.zip
gdb-d12a5ea8c9d5fb95d740c8e34a3d035c3c815635.tar.gz
gdb-d12a5ea8c9d5fb95d740c8e34a3d035c3c815635.tar.bz2
* layout.cc (Layout::relaxation_loop_body): Only clear load_seg if
the -Ttext option is not 0 modulo the page size. If we clear load_seg, clear phdr_seg too. * testsuite/Makefile.am (check_PROGRAMS): Add flagstest_o_ttext_1. (flagstest_o_ttext_1): New target. (check_DATA): Add flagstest_o_ttext_2. (flagstest_o_ttext_2): New target. * testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 39aabf5..2a8d3b4 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -2095,8 +2095,12 @@ Layout::relaxation_loop_body(
// 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;
+ if (parameters->options().user_set_Ttext()
+ && parameters->options().Ttext() % target->common_pagesize() != 0)
+ {
+ load_seg = NULL;
+ phdr_seg = NULL;
+ }
gold_assert(phdr_seg == NULL
|| load_seg != NULL