Robert Nelson

From music to microprocessors and everything in between.

github.com/rdnelson

A Dummy’s Guide to Linker Scripts

Posted:


Normally, writing C code is pretty straightforward. There are a few steps that are just repeated over and over:

  1. Write code.
  2. Compile code.
  3. Link code.
  4. A binary is created.

Most people overlook the black magic that happens in step 3, and some may not even realize it’s a step. This is because the linker is usually configured to hide all of the difficult decisions that it makes. Unfortunately, when we move away from the desktop environment into the embedded world, the linker no longer knows how to make the difficult decisions, and we need to tell it what to do. This is where linker scripts come in. But first, we need to discuss what exactly the linker needs to know in the first place.

Full post

Running git commands within a hook

Posted:


Git has many features that provide it with flexibility to be used in all kinds of situations. While all of these features are documented, sometimes they can get in the way, and it can be difficult to know whether a bug or a feature is causing the problem. I encountered one such scenario when I tried to build the static page generator that this site runs on.

Full post