LD.HUGETLBFS(1)
π LD.HUGETLBFS π
okay bestie, gather round, because this is ld.hugetlbfs(1) from the General Commands Manual and it's literally the glow-up your linker never knew it needed π¦
β¨ NAME β¨
ld.hugetlbfs β link a program for huge pages π
πΈ SYNOPSIS πΈ
ld.hugetlbfs [options]
π DESCRIPTION π
so here's the tea: ld.hugetlbfs is a straight-up replacement for your normal ld command, except it links programs so they can use hugepages. iconic behavior, no notes.
when you're building under gcc, you want to pass the option -B /usr/share/libhugetlbfs β that's you telling gcc "hey babe, go look in a non-standard location for the linker" π«Ά. and you could totally set that in the CFLAGS environment variable if you want it to just live there rent-free.
π -Wl,--hugetlbfs-align
this linking method gives you greater flexibility at runtime, fr fr. by using HUGETLB_ELFMAP, you get to control exactly which program segments get dropped into 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 π
and if you wanna be extra extra, you can pick specific huge page sizes for the read-only and writable segments using this advanced syntax:
HUGETLB_ELFMAP=[R[=<pagesize>]:[W[=<pagesize>]]
periodt. π
π§ -Wl,--hugetlbfs-link=B
under binutils 2.16 or older, this option links the application to store BSS data (only) into hugepages. just BSS. nothing else. she's minimal like that.
π -Wl,--hugetlbfs-link=BDT
under binutils 2.16 or older, this option links the application to store text, initialized data and BSS data into hugepages. she's doing the MOST and honestly? we love her for it.
π FILES π
[DESTDIR|/usr/share]/doc/libhugetlbfs/HOWTO
like, go read the HOWTO bestie, it's right there π
π SEE ALSO π
the whole friend group, honestly π
π«Ά AUTHORS π«Ά
libhugetlbfs was written by various people on the libhugetlbfs-devel mailing list. a collective effort, a group project that actually got finished (unlike ours π), we stan π
and that's the whole page!! this version dropped on March 12, 2012 and it's giving libhugetlbfs manual page energy from the jump. mwah, go link something huge πΈβ¨π
π¦ where this page comes from
- debian bookworm: libhugetlbfs-bin 2.23-5 Β· LGPL-2.1-only
- debian trixie: libhugetlbfs-bin 2.24-1+b1 Β· LGPL-2.1-only
- nixpkgs unstable: libhugetlbfs 2.24
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libhugetlbfs 2.24.0.g1322884-160000.3.2 Β· LGPL-2.1-or-later
- ubuntu jammy: libhugetlbfs-bin 2.23-4 Β· LGPL-2.1-only
- ubuntu noble: libhugetlbfs-bin 2.23-5build1 Β· LGPL-2.1-only
- ubuntu questing: libhugetlbfs-bin 2.24-1
- ubuntu resolute: libhugetlbfs-bin 2.24-1build1 Β· LGPL-2.1-only
- ubuntu stonking: libhugetlbfs-bin 2.24-1build1 Β· LGPL-2.1-only
- Copyright 2012 Cray Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms