Top all-time · #1654
MaskRay
Personal blog · maskray.meprogrammingsystems
MaskRay's personal blog at maskray.me covers programming and systems. Since 2018, 46 different Hacker News readers have linked it 168 times, most often “Long branches in compilers, assemblers, and linkers”. It is still writing: the last post was on 2026-10-12, and you can follow it by feed.
Most-linked posts?
- Long branches in compilers, assemblers, and linkers5 people · 5 mentions · first linked 2026-01-25
- Default -Bsymbolic-global-functions for shared object performance4 people · 5 mentions · first linked 2021-05-16
- Exploring Object File Formats4 people · 4 mentions · first linked 2024-01-15
- Why Isn't Ld.lld Faster4 people · 4 mentions · first linked 2021-12-19
- Evolution of the ELF object file format4 people · 4 mentions · first linked 2024-05-26
- Precompiled Headers4 people · 4 mentions · first linked 2023-07-17
- All about thread-local storage4 people · 4 mentions · first linked 2021-02-16
- Better performance for dynamic linking with -fno-semantic-interposition3 people · 4 mentions · first linked 2021-05-09
- C++ Dynamic Initialization: .init, .ctors, and .init_array3 people · 3 mentions · first linked 2021-11-08
- MMU-less systems and FDPIC3 people · 3 mentions · first linked 2024-02-21
What Hacker News says?
> [H]ow does glibc maintain ABI compatibility? Alias attributes? Symbol versioning[1,2]. Kind of like aliases, but more awkward. In theory it’s not specific to glibc, in practice hardly anyone else bothers being so careful about their ABI. Note that dynamically linked musl, which Alpine uses (I think..?), doesn’t understand symbol versioning, though I expect this will only last until the first ABI break in musl. [1]…
Comment linking /blog/2020-11-26-all-about-symbol-versioning
on “Glibc is still not Y2038 compliant by default”Submitted Evolution of the ELF object file format as a story · 148 points
HN discussionhttps://maskray.me/blog/ has plenty of solid information on the LLVM and GCC/Binutils toolchains.
Comment linking /blog/
on “Ask HN: Great Blogs by Programmers”Submitted Integrated assembler improvements in LLVM 19 as a story · 104 points
HN discussionA lot of vendors use non-lazy binding for security reasons, and some platforms don't support anything other than RTLD_NOW (e.g., Android). Anyway, while what you said is theoretically half-true, a fairly large number of libraries are not designed/encapsulated well. This means almost all of their symbols are exported dynamically, so, the idea that there are only "few public exported symbols" is unfortunately false. H…
Comment linking /blog/2021-05-16-elf-interposition-and-bsymbolic
on “Why is the Rust compiler so slow?”Submitted Compiling C++ with the Clang API as a story · 103 points
HN discussionThanks! I was able to find some additional info on no-MMU Linux [1], [2], [3]. It seems position-independent executables are the norm on regular (MMU) Linux now anyway (and probably have been for a long time). I took a look under the covers of uClibc and it seems like malloc just delegates most of its work to mmap, at least for the malloc-simple implementation [4]. That implies to me that different processes' heaps…
Comment linking /blog/2024-02-20-mmu-less-systems-and-fdpic
on “The future of 32-bit support in the kernel”Submitted When can glibc be built with Clang? as a story · 100 points
HN discussionInterposing libc.so symbols in a shared object is not affected by -fno-semantic-interposition or -Bsymbolic https://maskray.me/blog/2021-05-16-elf-interposition-and-bsy... Solaris offers a similar model called direct bindings.
Comment linking /blog/2021-05-16-elf-interposition-and-bsymbolic
on “Python is 1.3x faster by just adjusting some compiling options for libpython”Submitted Clang’s -O0 output: branch displacement and size increase as a story · 98 points
HN discussionFolks may be interested in the two blog posts which have more technical details: https://maskray.me/blog/2021-05-09-fno-semantic-interpositio... https://maskray.me/blog/2021-05-16-elf-interposition-and-bsy...
Comment linking /blog/2021-05-16-elf-interposition-and-bsymbolic
on “Python is 1.3x faster by just adjusting some compiling options for libpython”Submitted Exploring Object File Formats as a story · 85 points
HN discussion> https://git.lain.faith/sys64738/airs-notes.git Oh, that’s awesome, it even has some things transcribed from Fengrui Song’s blog ( https://maskray.me/ ) as well—I sometimes feel like it’s the only place where some particulars of binutils(-compatible) behaviour are documented (I don’t come there for the generalities, though, like GP is seeking). I only wish there were more of these transcriptions :)
Comment linking /
on “Show HN: I'm 17 and wrote this guide on how CPUs run programs”Submitted Removing global state from LLD, the LLVM linker as a story · 84 points
HN discussionshameless plug: lld 23.x is significantly faster than 22.x! I wrote about the optimizations in https://maskray.me/blog/2026-04-12-recent-lld-elf-performanc... As a side note, parallel input file parsing and symbol resolution aren't a silver bullet. I have an experimental branch (net ~800 lines of code) adding this to lld/ELF, but it actually loses performance when restricted to --threads={1,2} I read how mold implem…
Comment linking /blog/2026-04-12-recent-lld-elf-performance-improvements
on “Mold: A Massively Parallel Linker”Submitted C++ Exit-Time Destructors as a story · 75 points
HN discussionRegarding: `cmpb $0, %fs:__tls_guard@tpoff`, the per-function-call overhead is due to dynamic initialization on first use requirement: > Block variables with static or thread(since C++11) storage duration are initialized the first time control passes through their declaration (unless their initialization is zero- or constant-initialization, which can be performed before the block is first entered). On all further ca…
Comment linking /blog/2021-02-14-all-about-thread-local-storage
on “0+0 > 0: C++ thread-local storage performance”Submitted Exploring GNU extensions in the Linux kernel as a story · 71 points
HN discussionTake a look at https://maskray.me/blog/2021-02-14-all-about-thread-local-st... I think what you want is to force the "initial exec" model using an attribute to get the more efficient code. IIRC this (or something equivalent) is what libGL does because basically every OpenGL function call needs to read the thread-local variable holding the current GL context. The downside is that dlopen()ing your library may fail.
Comment linking /blog/2021-02-14-all-about-thread-local-storage
on “0+0 > 0: C++ thread-local storage performance”Submitted Skipping Boring Functions in Debuggers as a story · 65 points
HN discussionLinkers and Loaders I have analyzed a few object file formats in another blog post https://maskray.me/blog/2024-01-14-exploring-object-file-for... (HN discussion: https://news.ycombinator.com/item?id=38998914 ) ELF is technically not complicated and simpler than COFF and Mach-O.
Comment linking /blog/2024-01-14-exploring-object-file-formats
on “Evolution of the ELF object file format”Submitted Evolution of the ELF object file format as a story · 55 points
HN discussionXmonad has something called grid select, which works kind of like a combination of pie menus and a grid, while also being keyboard navigable(I use vim keybindings hjkl). http://maskray.me/static/xmonad-grid-select.jpg https://hackage.haskell.org/package/xmonad-contrib-0.13/docs...
Comment linking /static/xmonad-grid-select.jpg
on “Pie Menus: A 30-Year Retrospective: Take a Look and Feel Free”Submitted When can glibc be built with Clang? as a story · 55 points
HN discussionI’m also a bit weirded out by the lack of mentions of dominators (in TFA or in the article[1] it links to). Once you have the dominator tree, though, you’re still going to need to answer LCA queries on it (in this problem and in an SSA-based compiler both), so there seems to be no way around this part. The algorithm in the article does O(1) queries with O(V+E) preprocessing (assuming linear-preprocessing LCA, which,…
Comment linking /blog/2020-12-11-dominator-tree
on “Using obscure graph theory to solve programming languages problems”Submitted Relocatable linking as a story · 52 points
HN discussionYou can do somethings like this using the .init and .fini sections in a dynamically loaded shared lib. https://maskray.me/blog/2021-11-07-init-ctors-init-array
Comment linking /blog/2021-11-07-init-ctors-init-array
on “On self-modifying executables in Rust”Submitted All about thread-local storage as a story · 50 points
HN discussionI put my question to a friend of mine who works on linkers, and his take was that for a single threaded linker like ld.bfd the copy-bytes part would probably dominate, but that for a multithreaded linker like lld that part trivially parallelizes and so the slow part tends to be elsewhere. He also pointed me at a recent blogpost by the lld maintainer on this topic: https://maskray.me/blog/2021-12-19-why-isnt-ld.lld-f…
Comment linking /blog/2021-12-19-why-isnt-ld.lld-faster
on “Do we need a link step?”Submitted C++ Dynamic Initialization: .init, .ctors, and .init_array as a story · 45 points
HN discussion