This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR binutils/16318: Objcopy loses EI_OSABI
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 13 Dec 2013 19:07:50 +0100
- Subject: Re: PATCH: PR binutils/16318: Objcopy loses EI_OSABI
- Authentication-results: sourceware.org; auth=none
- References: <20131212224436 dot GA15572 at intel dot com> <20131212230633 dot GA15944 at intel dot com> <878uvorcza dot fsf at igel dot home> <CAMe9rOphM3cL17bQcE9XsHoH=HyfVF2rKvE4McmTKKCHcWQBcA at mail dot gmail dot com>
"H.J. Lu" <hjl.tools@gmail.com> writes:
> On Fri, Dec 13, 2013 at 7:23 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> "H.J. Lu" <hongjiu.lu@intel.com> writes:
>>
>>> diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
>>> index e70887b..4f49820 100644
>>> --- a/bfd/elf64-sh64.c
>>> +++ b/bfd/elf64-sh64.c
>>> @@ -2268,6 +2268,9 @@ sh_elf64_copy_private_data_internal (bfd *ibfd, bfd *obfd)
>>> || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
>>> return TRUE;
>>>
>>> + if (! _bfd_elf_copy_private_bfd_data (ibfd, obfd))
>>> + return FALSE;
>>> +
>>> o_shdrp = elf_elfsections (obfd);
>>> for (osec = obfd->sections; osec; osec = osec->next)
>>> {
>>> @@ -2285,10 +2288,7 @@ sh_elf64_copy_private_data_internal (bfd *ibfd, bfd *obfd)
>>> }
>>> }
>>>
>>> - /* Copy object attributes. */
>>> - _bfd_elf_copy_obj_attributes (ibfd, obfd);
>>> -
>>> - return sh_elf64_set_private_flags (obfd, elf_elfheader (ibfd)->e_flags);
>>> + return sh_elf64_set_mach_from_flags (obfd);
>>> }
>>
>> What about the other caller of sh_elf64_copy_private_data_internal?
>
> I don't know it enough to tell.
I don't think _bfd_elf_copy_private_bfd_data is appropriate in a
merge_private_bfd_data hook, so some refactoring is probably needed.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."