PR gold/12880

* layout.cc (Layout::attach_allocated_section_to_segment): Add a
	.interp section to a PT_INTERP segment even if we have seen a
	--dynamic-linker option.  Don't do it if we have seen a PHDRS
	clause in a linker script.
	(Layout::finalize): Don't create a .interp section if we've
	already create a PT_INTERP segment.
	(Layout::create_interp): Always call choose_output_section (revert
	patch of 2011-06-17).  Don't create PT_INTERP segment.
	* script-sections.cc
	(Script_sections::create_note_and_tls_segments): Add a .interp
	section to a PT_INTERP segment even if we have seen a
	--dynamic-linker option.
This commit is contained in:
Ian Lance Taylor
2011-06-19 22:09:17 +00:00
parent 8b7789423c
commit e1f74f9823
3 changed files with 36 additions and 41 deletions

View File

@ -3938,12 +3938,9 @@ Script_sections::create_note_and_tls_segments(
}
// If we are making a shared library, and we see a section named
// .interp, and the -dynamic-linker option was not used, then
// put the .interp section in a PT_INTERP segment. This is for
// GNU ld compatibility.
if (strcmp((*p)->name(), ".interp") == 0
&& parameters->options().shared()
&& parameters->options().dynamic_linker() == NULL)
// .interp then put the .interp section in a PT_INTERP segment.
// This is for GNU ld compatibility.
if (strcmp((*p)->name(), ".interp") == 0)
{
elfcpp::Elf_Word seg_flags =
Layout::section_flags_to_segment((*p)->flags());