Bloat Bdscr Upd (2026)

bdscr_t *blocks; blocks = malloc(actual_count * sizeof(bdscr_t)); In release builds:

bdscr_t blocks[256]; // 256 * 32 bytes = 8KB Use: bloat bdscr

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. blocks = malloc(actual_count * sizeof(bdscr_t))

Linker script reserved a 64KB aligned block for OTA descriptor storage due to a legacy flash driver requirement. In release builds: bdscr_t blocks[256]

5.1. Linker Script Optimization Replace:

.bdscr : ALIGN(4) KEEP(*(.bdscr)) > FLASH Instead of:

gcc -DNDEBUG -ffunction-sections -fdata-sections ... ld --gc-sections -o output.elf input.o Or manually strip after linking: