GNU Tools Cauldron SFrame talk notes

Sterling Augustine saugustine@google.com
Wed Oct 15 20:03:22 GMT 2025


re: --sframe-index, there are two issues that make it an unacceptable
solution. Both boil down to the fact that debug-info is not a good
model for this problem.

The first is that sframes (and the index itself, in whatever form),
needs to be loadable, and indeed, *loaded* at the point the stack
trace is taken, possibly by the kernel itself. Adding a section like
.gdb_index post-link is simply a matter of objcopy --add-section=....
It doesn't need to be loaded, or have any special handling by anything
other than the debugger. Adding a loadable segment post-link is
substantially more complicated.

The second is that even though gdb_index is easy to add post-link,
users thought it was sufficiently annoying that we added linker
support in three linkers: gnu-ld, gnu-gold, and lld itself. These
additions were completely uncontroversial. That's a pretty big
testament to the value of having the linker do it. It's easy to add a
linker flag, but much harder to add a post-link build step. Especially
with things like build-ids, read-only file systems, and whatever else.
Adding sframes would mean every package in every distro would need to
add a post-link build step, and a distro would have a very hard time
enabling it by default without hundreds of packages updating
themselves.

I have only anecdata here, but I suspect somewhere around 90% of
gdb_index users do it at the link step, rather than post-link.


More information about the Binutils mailing list