This is the mail archive of the
mailing list for the binutils project.
[gold commit] Fix edge cases in orphan section placement
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Mon, 12 Dec 2016 18:04:45 -0800
- Subject: [gold commit] Fix edge cases in orphan section placement
- Authentication-results: sourceware.org; auth=none
There were still some cases I found where orphan section placement
was screwy -- where the script has no output section description for
either .data or .bss, a .bss orphan section ends up getting placed
before the .data section. In addition, if there is an output section
description for a data section not named .data (e.g., .rela.dyn),
the orphan .bss gets placed before it. This patch cleans that up,
by tracking the last allocated section even as we're adding orphans.
I've also improved segment layout in the absence of a PHDRS clause.
A zero-length NOBITS section will no longer force a new segment
when followed by a PROGBITS section.
2016-12-12 Cary Coutant <email@example.com>
* script-sections.cc (Orphan_section_placement::update_last_alloc):
(Orphan_section_placement::find_place): Place orphan .data section
after either RODATA or TEXT.
(Script_sections::place_orphan): Call update_last_alloc for allocated
(Script_sections::create_segments): Improve handling of BSS.