[cfe-dev] LLVM/Clang and getting rid of the system linker (GNU ld or MSVC link.exe)

Joerg Sonnenberger joerg at britannica.bec.de
Sun Apr 17 16:19:11 PDT 2011


On Sun, Apr 17, 2011 at 04:29:34PM +0200, Ruben Van Boxem wrote:
> 3. LLVM linker (+Clang?)  links together the IR files into one object
> file (perhaps existing GNU .o or MSVC .obj files), executing its
> link-time-optimizations in the process.

You can already do this by calling opt etc by hand.

> 4. A *simple* tool turns the complete object file into native
> executable format, adding the platform-dependent parts that are
> missing from the semi-platform-agnostic file created in the previous
> step. This tool can in the first steps of the implementation be the
> system linker, but all it would do is do the object->executable
> conversion.

A linker is not a simple tool. Depending on the platform, a lot of
processing has to be done. Dropping common sections, building
constructor tables, dealing with all the different relocation types etc.
It is good old rocket science -- not exactly extremely advanced stuff,
but a good lot things to get right.

Joerg



More information about the cfe-dev mailing list