ld.hugetlbfs (1) - Linux Man Pages
ld.hugetlbfs: link a program for huge pages
ld.hugetlbfs - link a program for huge pages
ld.hugetlbfs replaces the normal ld command for linking programs to use hugepages. Under gcc, you should use the option -B /usr/share/libhugetlbfs which tells gcc to look in a non-standard location for the linker. This could be set in the CFLAGS environment variable.
This method of linking an application permits greater flexibility at runtime. Using HUGETLB_ELFMAP, it is possible to control which program segments are placed in hugepages. The following four settings will cause the indicated segments to be placed in hugepages:
HUGETLB_ELFMAP=R Read-only segments (text)
HUGETLB_ELFMAP=W Writable segments (data/BSS)
HUGETLB_ELFMAP=RW All segments (text/data/BSS)
HUGETLB_ELFMAP=no No segments
It is possible to select specific huge page sizes for read-only and writable segments by using the following advanced syntax:
Under binutils 2.16 or older, this option will link the application to store BSS data (only) into hugepages.
Under binutils 2.16 or older, this option will link the application to store text, initialized data and BSS data into hugepages.
AUTHORSlibhugetlbfs was written by various people on the libhugetlbfs-devel mailing list.