ao-elftohex: Add conditions for skipping ELF sections
authorKeith Packard <keithp@keithp.com>
Sun, 9 Apr 2017 19:48:54 +0000 (12:48 -0700)
committerBdale Garbee <bdale@gag.com>
Sat, 22 Apr 2017 17:52:34 +0000 (11:52 -0600)
commitf036b35a6fe1e187b2faea5c4ddf72359b33a44f
treeb92c0efe9e495805489310c3e162b138b357cb01
parent1db7169b193808c733852054e9a4713cdbd76cea
ao-elftohex: Add conditions for skipping ELF sections

Skip sections with size 0, or which are of type SHT_NOBITS or which
don't have the SHF_ALLOC flag set.

This avoids crashing on sections which don't have any data to copy.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/ao-elftohex/ao-elftohex.c
ao-tools/lib/ao-elf.c