diff --git a/libhugetlbfs.changes b/libhugetlbfs.changes index 5cfddb4..8ddfbb8 100644 --- a/libhugetlbfs.changes +++ b/libhugetlbfs.changes @@ -1,13 +1,3 @@ -------------------------------------------------------------------- -Tue Feb 9 09:29:27 UTC 2010 - trenn@novell.com - -- Removed unused files - -------------------------------------------------------------------- -Mon Feb 8 22:48:44 UTC 2010 - jengelh@medozas.de - -- add workarounds for broken Makefile logic to detect arch - ------------------------------------------------------------------- Mon Feb 1 11:35:48 UTC 2010 - jengelh@medozas.de diff --git a/libhugetlbfs.howto.patch b/libhugetlbfs.howto.patch new file mode 100644 index 0000000..9166731 --- /dev/null +++ b/libhugetlbfs.howto.patch @@ -0,0 +1,27 @@ +Update HOWTO with specific instructions on fixing segafaults when using xB linker script +with NX bit support. + +Signed-off-by: Eric B Munson + +--- + HOWTO | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/HOWTO ++++ b/HOWTO +@@ -594,6 +594,15 @@ If an application fails to run, set the + to 1. This causes additional diagnostics to be run. This information should + be included when sending bug reports to the libhugetlbfs team. + ++Specific Scenarios: ++------------------- ++ ++ISSUE: When using the xB linker script with a 32 bit binary on an x86 host with ++ NX support enabled, the binary segfaults. ++ ++TRY: Recompiling with the --hugetlbfs-align options and use the new relinking ++ method or booting your kernel with noexec32=off. ++ + Trademarks + ========== + diff --git a/libhugetlbfs.install-header.patch b/libhugetlbfs.install-header.patch new file mode 100644 index 0000000..4152dd7 --- /dev/null +++ b/libhugetlbfs.install-header.patch @@ -0,0 +1,16 @@ +--- + Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/Makefile ++++ b/Makefile +@@ -275,7 +275,8 @@ objscript.%: % + install: libs tools $(OBJDIRS:%=%/install) $(INSTALL_OBJSCRIPT:%=objscript.%) + @$(VECHO) INSTALL + $(INSTALL) -d $(DESTDIR)$(LDSCRIPTDIR) +- $(INSTALL) -m 644 $(INSTALL_HEADERS) $(HEADERDIR) ++ $(INSTALL) -d $(DESTDIR)$(HEADERDIR) ++ $(INSTALL) -m 644 $(INSTALL_HEADERS) $(DESTDIR)$(HEADERDIR) + $(INSTALL) -m 644 $(INSTALL_LDSCRIPTS:%=ldscripts/%) $(DESTDIR)$(LDSCRIPTDIR) + $(INSTALL) -d $(DESTDIR)$(BINDIR) + $(INSTALL) -d $(DESTDIR)$(EXEDIR) diff --git a/libhugetlbfs.linker-sections.patch b/libhugetlbfs.linker-sections.patch new file mode 100644 index 0000000..601dd21 --- /dev/null +++ b/libhugetlbfs.linker-sections.patch @@ -0,0 +1,102 @@ +Subject: [PATCH V2] Update SECTIONS from linker scripts for binutils 2.19 compatibility + +When building the linker script tests on SLES 11, the resulting executable +had an invalid size for the interp section. This is dues to a new section +that was not present in the old script. This patch adds this section to +all of the linker scripts. + +Credit goes to Alan Modra for identifying what change needed to be made + +Signed-off-by: Eric B Munson + +--- + ldscripts/elf32ppclinux.xB | 1 + + ldscripts/elf32ppclinux.xBDT | 1 + + ldscripts/elf64ppc.xB | 1 + + ldscripts/elf64ppc.xBDT | 1 + + ldscripts/elf_i386.xB | 1 + + ldscripts/elf_i386.xBDT | 1 + + ldscripts/elf_x86_64.xB | 1 + + ldscripts/elf_x86_64.xBDT | 1 + + 8 files changed, 8 insertions(+) + +--- a/ldscripts/elf32ppclinux.xB ++++ b/ldscripts/elf32ppclinux.xB +@@ -27,6 +27,7 @@ SECTIONS + .interp : { *(.interp) } :text :interp + .note.SuSE : { *(.note.SuSE) } :text :note + .note.ABI-tag : { *(.note.ABI-tag) } :text :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :text :note + .hash : { *(.hash) } :text + .dynsym : { *(.dynsym) } :text + .dynstr : { *(.dynstr) } :text +--- a/ldscripts/elf32ppclinux.xBDT ++++ b/ldscripts/elf32ppclinux.xBDT +@@ -26,6 +26,7 @@ SECTIONS + .interp : { *(.interp) } :htext :interp + .note.SuSE : { *(.note.SuSE) } :htext :note + .note.ABI-tag : { *(.note.ABI-tag) } :htext :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :htext :note + .hash : { *(.hash) } :htext + .dynsym : { *(.dynsym) } :htext + .dynstr : { *(.dynstr) } :htext +--- a/ldscripts/elf64ppc.xB ++++ b/ldscripts/elf64ppc.xB +@@ -26,6 +26,7 @@ SECTIONS + .interp : { *(.interp) } :text :interp + .note.SuSE : { *(.note.SuSE) } :text :note + .note.ABI-tag : { *(.note.ABI-tag) } :text :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :text :note + .hash : { *(.hash) } :text + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } +--- a/ldscripts/elf64ppc.xBDT ++++ b/ldscripts/elf64ppc.xBDT +@@ -25,6 +25,7 @@ SECTIONS + .interp : { *(.interp) } :interp :htext + .note.SuSE : { *(.note.SuSE) } :htext :note + .note.ABI-tag : { *(.note.ABI-tag) } :htext :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :htext :note + .hash : { *(.hash) } :htext + .dynsym : { *(.dynsym) } :htext + .dynstr : { *(.dynstr) } :htext +--- a/ldscripts/elf_i386.xB ++++ b/ldscripts/elf_i386.xB +@@ -29,6 +29,7 @@ SECTIONS + .interp : { *(.interp) } :text :interp + .note.SuSE : { *(.note.SuSE) } :text :note + .note.ABI-tag : { *(.note.ABI-tag) } :text :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :text :note + .hash : { *(.hash) } :text + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } +--- a/ldscripts/elf_i386.xBDT ++++ b/ldscripts/elf_i386.xBDT +@@ -30,6 +30,7 @@ SECTIONS + .interp : { *(.interp) } :htext :interp + .note.SuSE : { *(.note.SuSE) } :htext :note + .note.ABI-tag : { *(.note.ABI-tag) } :htext :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :htext :note + .hash : { *(.hash) } :htext + .dynsym : { *(.dynsym) } :htext + .dynstr : { *(.dynstr) } :htext +--- a/ldscripts/elf_x86_64.xB ++++ b/ldscripts/elf_x86_64.xB +@@ -29,6 +29,7 @@ SECTIONS + .interp : { *(.interp) } :text :interp + .note.SuSE : { *(.note.SuSE) } :text :note + .note.ABI-tag : { *(.note.ABI-tag) } :text :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :text :note + .hash : { *(.hash) } :text + .dynsym : { *(.dynsym) } :text + .dynstr : { *(.dynstr) } :text +--- a/ldscripts/elf_x86_64.xBDT ++++ b/ldscripts/elf_x86_64.xBDT +@@ -31,6 +31,7 @@ SECTIONS + .hash : { *(.hash) } :htext + .note.SuSE : { *(.note.SuSE) } :htext :note + .note.ABI-tag : { *(.note.ABI-tag) } :htext :note ++ .note.gnu.build-id : { *(.note.gnu.build-id) } :htext :note + .dynsym : { *(.dynsym) } :htext + .dynstr : { *(.dynstr) } :htext + .gnu.version : { *(.gnu.version) } :htext diff --git a/libhugetlbfs.linkerscript.patch b/libhugetlbfs.linkerscript.patch new file mode 100644 index 0000000..b7fa191 --- /dev/null +++ b/libhugetlbfs.linkerscript.patch @@ -0,0 +1,61 @@ +ADAM G. LITKE - +Libhugetlbfs ships a set of linker scripts which can be used to enable ELF +segment remapping into huge pages. These linker scripts +no longer work with the version of binutils shipped with SLES11. + +This has been a known problem. Linker scripts are essentially tied to specific +versions of binutils but libhugetlbfs only ships a single +set. To avoid maintaining and shipping an ever-growing number of linker +scripts, a new method of linking binaries for use with huge +pages was developed in libhugetlbfs-2.0. Unfortunately, some customers will +likely continue to use the old method of linking +binaries (with the shipped linker scripts) and will experience problems. The +solution to this problem is either to fix the linker scripts +for SLES11 by supplying a distro-specific patch, or strip out the deprecated +linker scripts so they cannot be used at all. I would prefer +to fix the linker scripts (if possible) to allow customers more time to switch +to the new linking method. + +Fix for ppc32 BDT script + +The only linker script that is known to have problems is the script used to +place text, data, and bss into huge pages on 32bit +PowerPC. The attached patch fixes the issue by adding the 'SPECIAL' notation +to the .plt and .got sections which is required for +correct functioning of the dynamic linker. + + +--- + ldscripts/elf32ppclinux.xBDT | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/ldscripts/elf32ppclinux.xBDT ++++ b/ldscripts/elf32ppclinux.xBDT +@@ -163,8 +163,9 @@ SECTIONS + .got1 : { *(.got1) } :hdata + .got2 : { *(.got2) } :hdata + .dynamic : { *(.dynamic) } :dynamic :hdata +- .got : { *(.got.plt .got) } :hdata ++ .got : SPECIAL { *(.got) } :hdata + /* . = DATA_SEGMENT_RELRO_END (0, .); */ ++ .plt : SPECIAL { *(.plt) } :hdata + .data : + { + *(.data .data.* .gnu.linkonce.d.*) +@@ -172,6 +173,7 @@ SECTIONS + SORT(CONSTRUCTORS) + } :hdata + .data1 : { *(.data1) } :hdata ++ .got : SPECIAL { *(.got) } :hdata + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ +@@ -190,7 +192,7 @@ SECTIONS + *(.scommon) + PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); + } :hdata +- .plt : { *(.plt) } :hdata ++ .plt : SPECIAL { *(.plt) } :hdata + .bss : + { + *(.dynbss) diff --git a/libhugetlbfs.small_bss.patch b/libhugetlbfs.small_bss.patch new file mode 100644 index 0000000..c0b9b63 --- /dev/null +++ b/libhugetlbfs.small_bss.patch @@ -0,0 +1,17 @@ +--- + elflink.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/elflink.c ++++ b/elflink.c +@@ -622,6 +622,10 @@ static int verify_segment_layout(struct + unsigned long prev_end = segs[i - 1].end; + unsigned long start = segs[i].start; + ++ /* Don't worry about consecutive normal page segments */ ++ if (!segs[i - 1].huge && !segs[i].huge) ++ continue; ++ + /* Make sure alignment hasn't caused segments to overlap */ + if (prev_end > start) { + WARNING("Layout problem with segments %i and %i:\n\t" diff --git a/libhugetlbfs.spec b/libhugetlbfs.spec index 4d2e21d..195fd50 100644 --- a/libhugetlbfs.spec +++ b/libhugetlbfs.spec @@ -40,6 +40,7 @@ Patch2: libhugetlbfs.s390.patch Patch3: libhugetlbfs.exchange_library_order.patch Patch4: libhugetlbfs.tests-malloc.patch Patch5: libhugetlbfs.run_test_fix.patch +#Patch7: libhugetlbfs.versioning.patch %description The libhugetlbfs package interacts with the Linux hugetlbfs to @@ -77,11 +78,7 @@ tests= %ifarch ppc ppc64 %ix86 x86_64 tests=install-tests %endif -make \ -%ifarch sparc sparcv9 - CC32="gcc" CC64="" NATIVEONLY=1 \ -%endif - %{my_make_flags} install $tests +make %{my_make_flags} install $tests mkdir -p $RPM_BUILD_ROOT/usr/include cp -avL hugetlbfs.h $RPM_BUILD_ROOT/usr/include chmod 644 $RPM_BUILD_ROOT%{_libdir}/*.a