public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: [AArch64] PR18270, fix handling of GOT entry for local symbol
@ 2015-04-20 18:04 Jiong Wang
  2015-04-24 14:23 ` Nicholas Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Jiong Wang @ 2015-04-20 18:04 UTC (permalink / raw)
  Cc: binutils

2015-04-20 17:22 GMT+01:00 Jiong Wang <jiong.wang@arm.com>:
>
> I reproduced on current binutils-gdb HEAD. The reason is as what RTH has
> explained we are handling GOT entry for local symbol incorrectly thus
> that relocation still relocate the symbol itself instead of the
> associated GOT entry. While the symbol itself may contains value not
> 8bytes aligned, then trigger alignment check errors.
>
> Even worse, if that symbol contains a value 8bytes aligned, then we pass
> the later alignment check, report nothing, and generate buggy binary
> silently.
>
> The patch will handle GOT entry for local symbol as the following:
>
>   * apply the relocation using GOT entry address.
>   * generate a R_AARCH64_RELATIVE relocation for the GOT entry, so the local
>     symbol's address could be updated with the shared object's runtime base address.
>
> OK for trunk?
>
> no regression on binutils-gdb native test.
> pass the testcase given by David.
> pass my small "exectuable + .so" execution test, verified the runtime behavior is OK.
>


Sorry, should be PR18270.

2015-04-20  Jiong. Wang  <jiong.wang@arm.com>

bfd/
  PR18270
  * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
  GOT_NORMAL for both sgot/srelgot section.
  (elfNN_aarch64_final_link_relocate): Relocate against GOT entry
  address and generate necessary runtime relocation for GOT entry.

Regards,
Jiong

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-24 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-20 18:04 [AArch64] PR18270, fix handling of GOT entry for local symbol Jiong Wang
2015-04-24 14:23 ` Nicholas Clifton
2015-04-24 22:37   ` Jiong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).