Objcopy allows to strip/remove and manipulate all kinds of symbols in an object. Sometimes it might be
useful to be able to ADD a symbol too.
The attached patch does just that. It adds the --add-symbol option (can be used multiple times) that
allows to add a new symbol to the end of the symbol table with an arbitrary absolute value.
I've added the section support. <symbol>=[<section>:]<value>
This binds the new symbol to (and makes it relative to) the specified section.
Extended the --add-symbol with the possibility to specify symbol flags. Some symbol flags depend on
the ordering of symbols in the symtab (warning, indirect) if I understand correctly... so I preserved
the order of the added symbols. Maybe one more useful feature could be to add a symbol in front of
another existing symbol, to enhance the usability of the warning flag (does it actually have the effect
as it is described in the bfd.h file?).
Refer to bugzilla item 19104.
The patch was made against the binutils-2.24-32 from fedora 21. It may apply with some fuzz.