This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Missing part from "[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: Tue, 20 Oct 2015 07:37:07 -0400 (EDT)
- Subject: Missing part from "[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:
> binutils/
> * objcopy.c (copy_object): Don't omit bfd_copy_private_bfd_data
> call when extract_symbol.
Don't you want to remove the exact same lines in setup_section,
dominating the bfd_copy_private_section_data call there?
Tested native i686-linux, cris-elf and mmix, no regressions.
I guess you know better which other targets need testing.
binutils:
* objcopy.c (setup_section): Don't omit bfd_copy_private_bfd_data
call when extract_symbol.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 324456a..d8b2795 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -2933,11 +2933,6 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
isection->output_section = osection;
isection->output_offset = 0;
- /* Do not copy backend data if --extract-symbol is passed; anything
- that needs to look at the section contents will fail. */
- if (extract_symbol)
- return;
-
if ((isection->flags & SEC_GROUP) != 0)
{
asymbol *gsym = group_signature (isection);
brgds, H-P