This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: objcopy.c: redefine-sym-specific for archive files
- From: Nick Clifton <nickc at redhat dot com>
- To: Daniel Marques <marques at cs dot cornell dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 26 Apr 2005 18:04:03 +0100
- Subject: Re: PATCH: objcopy.c: redefine-sym-specific for archive files
- References: <426D7DB3.3080304@cs.cornell.edu>
Hi Daniel,
If an archive file (e.g. libc.a) consists of more than one object file
(e.g, a.o & b.o) each containing a definition for a symbol named 'foo',
objcopy --redefine-sym foo=bar libc.a will redefine both symbols.
This might not always be the desired behavior. The attached patch adds
the --redefine-sym-specific option to object copy. Its usage is
Why add a new switch ? Why not simply extend the syntax accepted by the
--redefine-sym switch so that if a colon is present it behaves as per
your new switch ?
--redefine-sym-specific <objectfile>:<old>=<new>
Also - with a patch like this that adds a new feature, we really need an
FSF copyright assignment in place before we can accept the patch. Would
you be interested in completing such an assignment ?
I did not include a version for reading these from a file, as that
> would require either 'generalizing' add_redefine_syms_file() or
'cloning' that function, and I though such a decision should be left
to the maintainers.
Actually I would definitely encourage breaking out the code from
add_redefine_syms_file, generalizing it and making it available to other
switches which might benefit.
Cheers
Nick