aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-06-23 06:07:50 +0000
committerIan Lance Taylor <ian@airs.com>2009-06-23 06:07:50 +0000
commit3ee173de46efe0473d4aa2f63b16fe5943599e2b (patch)
tree2ba540f683064d87f528f68f905053dc7e525744
parent898135b9a14e4d378c03dd974d130ed92ad9d141 (diff)
downloadgdb-3ee173de46efe0473d4aa2f63b16fe5943599e2b.zip
gdb-3ee173de46efe0473d4aa2f63b16fe5943599e2b.tar.gz
gdb-3ee173de46efe0473d4aa2f63b16fe5943599e2b.tar.bz2
* script-sections.cc (Script_sections::create_segments): Don't put
program headers in a PT_LOAD segment if -n or -N.
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/script-sections.cc5
2 files changed, 11 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index fea0a34..ed774ac 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,4 +1,9 @@
-2009-06-22 Ian Lance Taylor <ian@airs.com>
+2009-06-22 Ian Lance Taylor <iant@google.com>
+
+ * script-sections.cc (Script_sections::create_segments): Don't put
+ program headers in a PT_LOAD segment if -n or -N.
+
+2009-06-22 Ian Lance Taylor <iant@google.com>
PR 10141
* options.h (class General_options): Add -z lazy and -z now. Sort
diff --git a/gold/script-sections.cc b/gold/script-sections.cc
index 9daf9ec..23610ac 100644
--- a/gold/script-sections.cc
+++ b/gold/script-sections.cc
@@ -2981,6 +2981,11 @@ Script_sections::create_segments(Layout* layout)
if (first_seg == NULL)
return NULL;
+ // -n or -N mean that the program is not demand paged and there is
+ // no need to put the program headers in a PT_LOAD segment.
+ if (parameters->options().nmagic() || parameters->options().omagic())
+ return NULL;
+
size_t sizeof_headers = this->total_header_size(layout);
uint64_t vma = first_seg->vaddr();