Finalize ELF file sections
We currently produce fairly slim files, but a few final tweaks are needed. This is essentially a reminder to revisit the issue later.
-
Remove .note.gnu.property
section (only for GNU toolchain builds as written by GCC) -
Remove .comment
section -
Work out .gnu_debuglink
which is writing some garbage
String dump of section '.gnu_debuglink':
[ 0] d08620e3491bf9b85e393bed273892d3be82b.debug
[ 31] y6e
${objcopy} -R .comment -R .note.gnu.property ${file}
is how to remove sections.
The command doesn't fail if the section isn't present, so can always call to remove it. Can add it into the --strip-unneeded -R .comment -R .note.gnu.property
command so basically free.