For larger databases, users often only want their text to be placed in
hugepages. libhugetlbfs does not currenlty provide this mode, however,
so users have been working around it in ... odd ... ways. Add explicit
support for T-only relinking via new linker scripts for ppc64, x86 and
x86_64. Unfortunately, I do not think (with my knowledge, at least) that
ppc32 can support T-only, due to the limitation that the PLT must be
within 32M of the text segment, confirmed in testing and based upon the
comment in the elf32ppclinux.xBDT:
/* Just move to the very next hugepage, rather than using a guard
* page, because for ppc32 binaries we can't separate the text and
* PLT by >32MB */
Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
diff --git a/ldscripts/elf64ppc.xT b/ldscripts/elf64ppc.xT
new file mode 100644
index 000..d6a8297
--- /dev/null
+++ b/ldscripts/elf64ppc.xT
@@ -0,0 +1,230 @@
+/* Linker script for normal executables with text in hugepages */
+OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc",
+ "elf64-powerpc")
+OUTPUT_ARCH(powerpc:common64)
+ENTRY(_start)
+SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64");
SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64");
SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib");
SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+INPUT( -lhugetlbfs );
+PHDRS
+{
+ headers PT_PHDR PHDRS ;
+ interp PT_INTERP ;
+ htext PT_LOAD FILEHDR PHDRS FLAGS (0x0015);
+ data PT_LOAD ;
+ dynamic PT_DYNAMIC ;
+ note PT_NOTE ;
+ /* this is the value of PT_GNU_EH_FRAME as defined in
+ usr/include/elf.h but binutils does not recognize that identifier
+ as it does other PT_ constants. */
+ eh_frame_hdr 1685382480 FLAGS (0x0004);
+}
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ __executable_start = 0x1000; . = 0x1000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) } :interp :htext
+ .note.SuSE : { *(.note.SuSE) } :htext :note
+ .note.ABI-tag : { *(.note.ABI-tag) } :htext :note
+ .hash : { *(.hash) } :htext
+ .dynsym : { *(.dynsym) } :htext
+ .dynstr : { *(.dynstr) } :htext
+ .gnu.version: { *(.gnu.version) } :htext
+ .gnu.version_d : { *(.gnu.version_d) } :htext
+ .gnu.version_r : { *(.gnu.version_r) } :htext
+ .rel.init : { *(.rel.init) } :htext
+ .rela.init : { *(.rela.init) } :htext
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } :htext
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
:htext
+ .rel.fini : { *(.rel.fini) } :htext
+ .rela.fini : { *(.rela.fini) } :htext
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
:htext
+ .rela.rodata: { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
:htext
+ .rel.data.rel.ro : { *(.rel.data.rel.ro*) } :htext
+ .rela.data.rel.ro : { *(.rel.data.rel.ro*) } :htext
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } :htext
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
:htext
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } :htext
+ .rela.tdata: { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
:htext
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } :htext
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
:htext
+ .rel.ctors : { *(.rel.ctors) } :htext
+ .rela.ctors : { *(.rela.ctors) } :htext
+ .rel.dtors : { *(.rel.dtors) } :htext
+ .rela.dtors : { *(.rela.dtors) } :htext
+ .rel.got: { *(.rel.got) } :htext
+ .rela.got : { *(.rela.got) } :htext
+ .rela.toc : { *(.rela.toc) } :htext
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } :htext
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
:htext
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } :htext
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
:htext
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
:htext
+ .rela.sdata2: { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
:htext
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
:htext
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
:htext
+ .rel.bss: { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } :htext
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } :htext
+ .rel.plt: { *(.rel.plt) } :htext
+ .rela.plt : { *(.rela.plt) } :htext
+ .rela.tocbss : { *(.rela.tocbss) } :htext
+ .init :
+ {
+KEEP (*(.init))
+ } :htext =0x6000
+ .text :
+ {
+*(.text .stub .text.* .gnu.linkonce.t.*)
+KEEP (*(.text.*personality*))
+/* .gnu.warning sections are handled specially by elf32.em. */