Handmade Network»Forums»Wheel Reinvention Jam
Felipe
4 posts
Self taught C programmer, game enthusiast, otherwise a boring person
Jam Submission - C Linker

I worked to create a linker (for an existing compiler/linker) from scratch that produced graphs diagrams and other kinds of visual output about the code being linked.

A single person proved to be not enough for doing all that in one week, regardless here's the result. It outputs information about the linking file and almost any important number it uses.

The main idea is to be more transparent to the user, and stop being a black box.

While working on this I discovered that some file format and specifications used in this process (linking) are pretty well documented, like the COFF/PE file format, but at the same time others are pretty much obscure like PDBs. A new goal is to create open and well documented containers for all the information generated from this tools, to help develop programs like dumpers, debuggers and analyzers.

Demo.mp4

Help_output.png

Linker_output.png

corsac_0.4.1.zip

Corsac is an ongoing project and I hope to have a useful program in the near future.

Simon Anciaux
1341 posts
Jam Submission - C Linker

Is the code for this available ? I would be interested in understanding what exactly the linker has to do to generate an executable.

Felipe
4 posts
Self taught C programmer, game enthusiast, otherwise a boring person
Jam Submission - C Linker

Thanks!

I plan on continuing and develop it into a full real world linker.

Regarding porting it to Linux, the platform specific code is already separated from the "linker logic" so porting it should be trivial. I expect it to work soon on Linux and Essence. The only roadblock I can think of is file formats, right now it can only accept win64/COFF files as inputs and pe64/COFF as output.

Felipe
4 posts
Self taught C programmer, game enthusiast, otherwise a boring person
Jam Submission - C Linker
Replying to mrmixer (#25287)

I don't plan on releasing the source code of this project, but I do plan on taking the important bits of the linker and making it public, as a stand alone more streamlined version.