Bug 6765 - [PATCH] support symbol unbinding in objcopy
Summary: [PATCH] support symbol unbinding in objcopy
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.19
: P2 enhancement
Target Milestone: ---
Assignee: unassigned
Depends on:
Reported: 2008-07-24 14:16 UTC by Stephen Kell
Modified: 2008-07-24 14:17 UTC (History)
1 user (show)

See Also:
Last reconfirmed:

Patch to objcopy adding --unbind-symbol option (2.71 KB, patch)
2008-07-24 14:17 UTC, Stephen Kell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Kell 2008-07-24 14:16:37 UTC
When manipulating object code, it's often useful to separate symbol references
from symbol definitions -- for example in conjunction with the --wrap option to
ld. Ordinarily --wrap doesn't work within the scope of a single object file,
since the assembler has already resolved references to symbols defined in the
same file. The attached patch to objcopy (current CVS) supports undoing this
binding process, by providing an --unbind-symbol operation which replaces a
single symbol entry SYMBOL with (up to) two: __def_SYMBOL and __ref_SYMBOL. 

It's not been extensively tested, but seems to work. If it looks good, please
consider committing it. I'd be grateful for feedback in any case.
Comment 1 Stephen Kell 2008-07-24 14:17:23 UTC
Created attachment 2839 [details]
Patch to objcopy adding --unbind-symbol option