Static Bundle Object: Modernizing Static Linking Eyal Itkin 10 min read · 2 days ago 2 days ago -- Listen Share
TL;DR
In the previous chapter I discussed some of the technical limitations of the .a archive of plain object-code ( .o ) files that is used for static libraries, limitations which are magnified when the linking relies on pkg-config or CMake. In the end, I proposed having a new ELF type ( ET_STAT ) that will be used to create a new file format for static libraries — Static Bundle Object ( .sbo ).
Two months after the initial publication, the technical white paper about this new format was finalized and submitted to the ELF committee. The paper was accompanied by a working proof-of-concept based on GNU’s ld linker.
After being discussed in the committee, the final verdict is mixed:
The committee supports the proposed binary format.
the proposed binary format. The motion to introduce it as part of the ELF standard, and specifically using a new e_type value, was denied.
What does it mean? Well, the majority agreed the paper presents a strong case against the currently formed ( .a ) static archives of plain object-code ( .o ) files. They also agreed with the essence of the proposal which is to combine together all of these .o files, and finalize their local relocations so that internal functions will no longer be exposed to the library’s users.
That said, the committee argued that the existing ET_REL ELF e_type is broad enough to cover such a use case, hence there is no need to involve the ELF standard at the moment. In essence, they declared it is more of a “tooling issue” than an “ELF issue”, and encouraged me to work directly with the maintainers of the linkers so to add support for my proposed feature.
While the Static Bundle Object format was not accepted “as-is”, it was still generally approved. The revised format proposal is to keep the existing relocatable e_type for the newly created Static Bundle Object file, and embed this file inside a .a archive so to maintain compatibility.
... continue reading