bloaty -d sections firmware.elf | grep bdscr Bloat in bdscr is a subtle but impactful inefficiency in embedded and low-level software. It stems from over-alignment, static allocation, and leftover debug structures. Detecting it requires basic binary inspection tools; fixing it yields measurable gains in size, speed, and maintainability.
bdscr_t *blocks; blocks = malloc(actual_count * sizeof(bdscr_t)); In release builds: bloat bdscr
.bdscr : KEEP(*(.bdscr)) . = ALIGN(4096); // Over-alignment > FLASH With: bloaty -d sections firmware
Always audit your linker scripts and descriptor data structures – especially when porting code across different flash architectures or toolchains. and maintainability. bdscr_t *blocks
5.1. Linker Script Optimization Replace:
objcopy --remove-section=.bdscr firmware.elf stripped.elf Scenario: A Zigbee IoT hub firmware had a .bdscr section of 64KB, but only 2KB was actually used.