ao-elftohex: Add conditions for skipping ELF sections
authorKeith Packard <keithp@keithp.com>
Sun, 9 Apr 2017 19:48:54 +0000 (12:48 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 9 Apr 2017 19:48:54 +0000 (12:48 -0700)
commit04d4b17635fc9395c70aa0840971c00082f509ba
treeef9cfaf1cac508ecf925384c6da9e57c667b18b3
parent86d5119f19b5f3131d224982e011fd233b48aa22
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