deleting relocs, objcopy and BFD

H.J. Lu hjl.tools@gmail.com
Tue May 2 19:20:00 GMT 2017


On Tue, May 2, 2017 at 7:50 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Guys,
>
>> Problem 1: incoherence with internal relocs and external relocs breaks> the API.
> I am checking in the attached patch in order to stop objcopy from attempting
> to merge notes when the internal reloc count is greater than the external
> reloc count.  This does not fix the underlying problem, but it should at
> least make objcopy safe, for now.
>
>> b) To remove the API limitation/bug in BFD, somehow.  Maybe adding
>>     end-of-list sentinels to `sec->relocation' and `sec->orelocation',
>>     adjusting `bfd_set_reloc' to install it according to its `relcount'
>>     argument, leaving `sec->reloc_count' untouched, and also making
>>     `elfNN_BE_write_relocs' to use the sentinel when writing.
>
> I think that option b) would be better.  I wonder though whether it might
> be simpler to just let targets override the bfd_set_reloc () function with
> their own implementation, should they have special requirements.  I have not
> investigated this yet, but it seems like it would be the simplest solution,
> provided that it can be made to work.
>

I checked in this to fix build on 32-bit hosts.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Cast-relcount-to-unsigned-long-when-comparing-with-s.patch
Type: text/x-patch
Size: 1763 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170502/4101ebda/attachment.bin>


More information about the Binutils mailing list