This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] - objcopy --extract-symbol clears e_flags ELF header field
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Ronald Hoogenboom <hoogenboom30 at zonnet dot nl>, binutils at sourceware dot org
- Date: Sun, 18 Oct 2015 05:13:23 -0400 (EDT)
- Subject: Re: [PATCH] - objcopy --extract-symbol clears e_flags ELF header field
- Authentication-results: sourceware.org; auth=none
- References: <561D44BC dot 9080307 at atom dot grundel> <20151014002120 dot GK4434 at bubble dot grove dot modra dot org> <561EB0A7 dot 9000402 at atom dot grundel> <20151015130648 dot GA13961 at bubble dot grove dot modra dot org>
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