The current implementation of libhugetlbfs segment remapping requires that a binary be linked with a custom linker script that is included in the library distribution. Over time these custom linker scripts have needed updating to keep them compatible with changes occuring in binutils. While we've been able to keep up in the past, we are now at an impasse. The powerpc version of binutils has introduced a new requirement concerning the placement of the .plt and .got sections within the binary. To achieve this special placement, binutils-2.18 has introduced a new, backwards-incompatible linker script keyword: SPECIAL. Based on my investigation, this keyword must be used for reliable linking of binaries. It also cannot be used on older versions of binutils without syntax errors. These conflicting requirements forced a decision to be made: start supporting linker scripts for each release of binutils, or eliminate linker scripts altogether. This patch series implements the latter approach.
A handy option has appeared in GNU ld on 05/30/2006 and was released in binutils 2.18. The options -z common-page-size and -z max-page-size can be used to create a gap between the text and data segments. This gap is all that is strictly needed to allow remapping of those segments into huge pages. Our library has a few dependencies on the custom linker scripts that must first be removed before the remapping strategy in elflink.c can be used to remap these "script-less" binaries. --- Changes since V1: Parts of V1 have already been merged When fixing up unaligned segments, check for collisions with other mmaps Identify segments as read-only or writable, not as text or data Check that remapping "plan" follows slice restrictions HUGETLB_ELFMAP parameter overrides PF_LINUX_HUGETLB ELF flag ld.hugetlbfs supports new parameter --hugetlbfs-align (only 1 align option) Various comment and code cleanups Adam Litke (4): ld.hugetlbfs: Add support for relinking with system scripts elflink: Consolidate parsing code elflink: Support full segment remapping with the system linker scripts elflink: Handle unaligned segment starting addresses elflink.c | 214 ++++++++++++++++++++++++++++++++++++++++++++-------------- ld.hugetlbfs | 15 ++++ 2 files changed, 177 insertions(+), 52 deletions(-) -- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel