[RFC][PATCH] Check ELF relocs after opening all all input files

H.J. Lu hjl.tools@gmail.com
Tue Apr 19 18:03:00 GMT 2016
On Tue, Apr 19, 2016 at 9:01 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi H.J.
>
>> Delaying checking ELF relocations until opening all input files so
>> that symbol information is final when relocations are checked.  This
>> is only enabled for x86 targets.
>
>> Any comments, feedbacks?
>
> What benefit is gained by doing this ?  I would guess that it is connected
> with symbols changing type and/or visibility and/or protected status, but
> it would be nice to know what you are hoping to achieve.

Yes,  this change is motivated by that discussion.  Currently backend
check_relocs doesn't have the final information on symbols.  A better
linker can provide better diagnostics in check_relocs if symbol info is
final.

> The code seems quite straightforward - but why limit the change to x86
> targets only ?  Are you expecting that it might break other targets ?

I can't test non-x86 targets.  The problem may only show up on
native build.

> I assume that you have tested the patch with the x86 variants that you
> have changed - were there any regressions or changes ?

None.

> Would it be worth creating a test the demonstrates the value of the change.
> If the test was not restricted to x86 targets then it could be used to
> prompt a conversion of non-x86 targets as well.

I am working on it.

Here is a simpler patch.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-ELF-relocs-after-opening-all-input-files.patch
Type: text/x-patch
Size: 12228 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160419/d101e332/attachment.bin>


More information about the Binutils mailing list