This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: PR 855: objcopy creates invalid object
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Sat, 16 Apr 2005 16:23:22 -0700
- Subject: PATCH: PR 855: objcopy creates invalid object
This is the second part of the patch to fix PR 855.
H.J.
----
2005-04-16 H.J. Lu <hongjiu.lu@intel.com>
PR 855
* elf.c (_bfd_elf_copy_private_section_data): Don't copy linker
created group data.
--- bfd/elf.c.fake 2005-04-16 14:55:12.000000000 -0700
+++ bfd/elf.c 2005-04-16 16:16:21.000000000 -0700
@@ -5578,9 +5578,14 @@ _bfd_elf_copy_private_section_data (bfd
/* Set things up for objcopy. The output SHT_GROUP section will
have its elf_next_in_group pointing back to the input group
- members. */
- elf_next_in_group (osec) = elf_next_in_group (isec);
- elf_group_name (osec) = elf_group_name (isec);
+ members. Ignore linker created group section. See
+ elfNN_ia64_object_p in elfxx-ia64.c. */
+ if (elf_sec_group (isec) == NULL
+ || (elf_sec_group (isec)->flags & SEC_LINKER_CREATED) == 0)
+ {
+ elf_next_in_group (osec) = elf_next_in_group (isec);
+ elf_group_name (osec) = elf_group_name (isec);
+ }
osec->use_rela_p = isec->use_rela_p;