I use objcopy -S -g -O binary test.elf test.bin
to get a .bin
file from .elf
.
$ ll test.bin
-rwxr-xr-x 1 hongzhuwang md_psw 1472320 Oct 28 19:07 test.bin
$ size test.elf
text data bss dec hex filename
173062 6328 6605424 6784814 67872e test.elf
The size of test.bin
is apparently larger than the sum of text and data in test.elf
. Why is there such a huge difference? Which sections will objcopy
copy from .elf
into .bin
?