This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][gold] Don't put rodata and text in the same segment.


In native client the rodata section cannot be in the same segment as
text since the data will fail to validate. We have been using a linker
script, but maybe others also think it is a good idea to have rodata
in a non executable segment.

The change to attach_allocated_section_to_segment is the core of the
patch. The update to find_first_load_seg is because it would now find
a non-executable segment that was not the first segment after the
sorting. The change to set_segment_offsets fixes what I think is a
hidden bug. I think it was never noticed because the executable
segment was normally followed by a rw one.

2010-09-01  Rafael Espindola  <espindola@google.com>

	* layout.cc (Layout::attach_allocated_section_to_segment): Don't put
	sections with different PF_X flags in the same segment.
	(Layout::find_first_load_seg): Search all segments to find the first one.
	(Layout::set_segment_offsets): Align the address of a segment that follows an
	executable one.

Cheers,
-- 
Rafael Ãvila de EspÃndola

Attachment: rodata.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]