In this article, we will explore some of my favorite binary introspection tools, such as GNU Binutils. The material is geared toward the embedded software crowd that typically writes C and C++, but many of the ideas, tools, and lessons learned can be applied to a variety of low-level software. We will walk through practical examples of how the tools can be leveraged to aid in the development process irrespective of the compiler you are using (e.g. GCC, Clang, IAR, ARMCC, etc).
In this post, I will show you how to set up a code size dashboard for your project. I’ll cover why should track code size, how to do it, and the steps to calculate code size deltas on every pull requests to keep it to a minimum.
In this post, we will review compiler options that we can use to reduce firmware code size. We will focus on
arm-none-eabi-gcc, the GCC compiler used for ARM-based microcontrollers, though most of the compile-time flags we will cover are available in other GCC flavors as well as in Clang.
Every firmware engineer has run out of code space at some point or another. Whether they are trying to cram in another feature, or to make enough space for A/B firmware updates more code space is always better.
In this series of posts, we’ll explore ways to save code space and ways not to do it. We will cover compiler options, coding style, logging, as well as desperate hacks when all you need is another 24 bytes.
But first, let’s talk about measuring code size.