[PATCH] - objcopy --extract-symbol clears e_flags ELF header field
Hans-Peter Nilsson
hp@bitrange.com
Sun Oct 18 09:13:00 GMT 2015
On Thu, 15 Oct 2015, Alan Modra wrote:
> On Wed, Oct 14, 2015 at 09:44:39PM +0200, Ronald Hoogenboom wrote:
> > Or move the 2 lines to after the bfd_copy_private_bfd_data. So BFD needs to
> > be adapted for all kinds of targets I never even heard about. There the test
> > in the testsuite will be indispensable. Can you give me some pointers on how
> > to get that done?
>
> My advice about moving the tests to binutils/testsuite/ probably
> wasn't so good. On looking at objcopy.exp in detail, I see many of
> the tests require a C compiler. That means you need a whole lot more
> infrastructure in order to test cross-binutils well. So perhaps the
> test is best left in ld/testsuite, but moved out of ld-elf.
>
> Like this. The new testcase shows that objcopy --extract-symbol
> isn't working on PE, mips, mmix and some aout targets.
Regarding mmix, you get an inconsistency error:
x/ld/../binutils/objcopy: tmpdir/extract:
Bad symbol definition: `Main' set to 0000000000000000 rather than the start address 0000000000000000
That's because objcopy --extract-symbol hacks in a start-address
0 instead of letting it be or consulting the target (new
framework may be needed). Why does it change the start-address?
The symbols are left, so why zero the start-adress; why is that
more logical than keeping it when removing all contents?
If the answer is ELF-related, I think it'd be up to ELF bits to
handle the start-address-zeroing.
brgds, H-P
More information about the Binutils
mailing list