I think that the new linker, gold, is now feature complete, and with a bit more testing it should be ready for an open release. I wanted to get it to the point where it could build the Linux kernel. I haven’t actually tested that yet, but it now has everything it needs.
The most painful part was that the Linux kernel build uses many features of GNU linker scripts. gold doesn’t use linker scripts internally, so they had to be bolted onto the side. gold lays out executables in memory in the logical way for ELF: it assigns sections to segments, lays out the segments in memory, and then sets the section offsets based on their position in the segment. Linker scripts, unfortunately, work backward. The linker script effectively lays out the sections in memory, and then the linker has to figure out how to fit the sections into segments. This fitting has been a long set of horrors in the GNU linker, and naive linker scripts often lead to the notorious “not enough room for program headers” error message. Fortunately in gold I could take learn from the current state of affairs in the GNU linker, which is much better than it used to be.
My goal has been to release gold in this quarter, so I should make it.
Leave a Reply
You must be logged in to post a comment.