* options.h (class General_options): Define -n/--nmagic and

-N/--omagic.
	* options.cc (General_options::finalize): For -n/--nmagic or
	-N/--omagic, set -static.
	* layout.cc (Layout::attach_allocated_section_to_segment): If
	-N/--omagic, don't put read-only and read-write sections in
	different segments.
	(Layout::find_first_load_seg): If -N/--omagic, don't insist on
	finding a read-only segment.
	(Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
	don't set the minimum segment alignment to the common page size,
	and don't set the file offset to the address modulo the page size.
	* script-sections.cc (Script_sections::create_segments): If
	-n/--omagic, don't put read-only and read-write sections in
	different segments.
This commit is contained in:
Ian Lance Taylor 2008-07-22 23:01:20 +00:00
parent 92de84a60c
commit af6156ef8d
5 changed files with 48 additions and 14 deletions

View file

@ -2657,7 +2657,8 @@ Script_sections::create_segments(Layout* layout)
need_new_segment = true;
}
else if (is_current_seg_readonly
&& ((*p)->flags() & elfcpp::SHF_WRITE) != 0)
&& ((*p)->flags() & elfcpp::SHF_WRITE) != 0
&& !parameters->options().omagic())
{
// Don't put a writable section in the same segment as a
// non-writable section.