[gold][aarch64] PR gold/19163: zero-out ABS64/32/16/ in .rela.dyn.

Cary Coutant ccoutant@gmail.com
Thu Oct 29 00:29:00 GMT 2015


> 2015-10-26  Han Shen  <shenhan@google.com>
>
>         PR gold/19163 - zero out ABS64/32/16 in .rela.dyn.
>
>         * aarch64.cc (AArch64_relobj::ZeroOutRecord): New data struct.
>         (AArch64_relobj::zero_out_list_): New member.
>         (AArch64_relobj::ZeroOutIter): New typedef.
>         (AArch64_relobj::ZeroOutList): Likewise.
>         (AArch64_relobj::zero_out_relocs): New method.
>         (AArch64_relobj::do_relocate_sections): Add hook to call
>         zero_out_relocs.
>         (AArch64_relocate_functions::zero_out): New helper method.
>         (Target_aarch64::Scan::global): Record global symbols that are
>         added to .rela.dyn.

It doesn't seem necessary to me to make a list of all those
relocations, then apply them, then zero them out. Rather than make a
list, how about just skipping the relocation when applicable?

I'd also like to see this under the control of an option, so that we
only need to use it for as long as the buggy dynamic linkers are out
there.

The attached patch adds a --no-apply-dynamic-relocs flag. When set,
Relocate::relocate() will skip applying the link-time relocation for
those cases where we've generated an absolute dynamic relocation.
Please give this a try; if it works, I'd prefer this approach.

-cary


2015-10-28  Cary Coutant  <ccoutant@gmail.com>

gold/
        * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply
        certain relocations if --no-apply-dynamic-relocs is set.
        * options.h (--apply-dynamic-relocs): New aarch64-specific option.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr19163-2.patch
Type: application/octet-stream
Size: 2613 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20151029/fbedb564/attachment.obj>


More information about the Binutils mailing list