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. πŸ’…

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.

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 πŸŒΈβœ¨πŸ‘‘