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

Cary Coutant ccoutant@gmail.com
Thu Nov 5 20:28:00 GMT 2015


> +      if (!parameters->options().apply_dynamic_relocs()
>
>>> Han: we need to test if gsym is NULL, in one of my cases, gsym is NULL and gold crashes.

Yes, sorry, I should have caught that.

>
> +          && parameters->options().output_is_position_independent()
> +          && gsym->needs_dynamic_reloc(reloc_property->reference_flags())
> +          && !gsym->can_use_relative_reloc(false))
> +        // We have generated an absolute dynamic relocation, so do not
> +        // apply the relocation statically. (Works around bugs in older
> +        // Android dynamic linkers.)
>
>>> Han: do we need to explicitly write zeros to this location instead of just do nothing? (Although I've checked the values of the resulting binary, the location contains all zeros)

Not as long as the compiler writes zeroes (which it should).

I've committed the attached patch.

-cary

2015-11-05  Cary Coutant  <ccoutant@gmail.com>

gold/
        PR gold/19163
        * 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-3.patch
Type: application/octet-stream
Size: 3312 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20151105/83d0cb1f/attachment.obj>


More information about the Binutils mailing list