* options.h (General_options): Add --rosegment-gap option.
	* options.cc (finalize): --rosegment-gap implies --rosegment.
	* layout.cc (set_segment_offsets): Let user option override
	target->rosegment_gap().
This commit is contained in:
Roland McGrath 2013-05-10 22:33:35 +00:00
parent 0c6e6c39ad
commit bbc5ae17c4
4 changed files with 196 additions and 177 deletions

View File

@ -1,3 +1,10 @@
2013-05-10 Roland McGrath <mcgrathr@google.com>
* options.h (General_options): Add --rosegment-gap option.
* options.cc (finalize): --rosegment-gap implies --rosegment.
* layout.cc (set_segment_offsets): Let user option override
target->rosegment_gap().
2013-05-10 Roland McGrath <mcgrathr@google.com>
* options.h (General_options): Remove leading space from help

View File

@ -1,6 +1,6 @@
// layout.cc -- lay out output file sections for gold
// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
// Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
@ -3457,7 +3457,10 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
// If the target wants a fixed minimum distance from the
// text segment to the read-only segment, move up now.
uint64_t min_addr = start_addr + target->rosegment_gap();
uint64_t min_addr =
start_addr + (parameters->options().user_set_rosegment_gap()
? parameters->options().rosegment_gap()
: target->rosegment_gap());
if (addr < min_addr)
addr = min_addr;

View File

@ -1,6 +1,7 @@
// options.c -- handle command line options for gold
// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013
// Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@ -1272,6 +1273,10 @@ General_options::finalize()
}
}
// --rosegment-gap implies --rosegment.
if (this->user_set_rosegment_gap())
this->set_rosegment(true);
// FIXME: we can/should be doing a lot more sanity checking here.
}

View File

@ -927,6 +927,10 @@ class General_options
N_("Put read-only non-executable sections in their own segment"),
NULL);
DEFINE_uint64(rosegment_gap, options::TWO_DASHES, '\0', -1U,
N_("Set offset between executable and read-only segments"),
N_("OFFSET"));
DEFINE_string(m, options::EXACTLY_ONE_DASH, 'm', "",
N_("Set GNU linker emulation; obsolete"), N_("EMULATION"));