serge1/ELFIO

Loaded, modified, saved elf file is more different than expected from original

sktpin opened this issue · 1 comments

Hello, I'm don't know a lot of details about the .elf format, so maybe there can be a good reason for it.

I have a bare metal project for ARM Cortex M, using the ARM GCC compiler toolchain for that.
So I use ELFIO load a produced .elf file, search for one section by name, call set_data() on that section to change the content (size should remain the same), and call .save() on that elfio object.
The changed section is only a few uint32's big.

Looking at the resulting file in the hex editor, I find things like big blocks (kilobytes maybe) of zeroes where the original file had data.
Also, the saved file is now 6KB bigger than the original one.

Can there be legitimate reasons for these observations, or is something wrong? (I've not tried using it yet)

Duplicate of #62