This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [AArch64] PR18270, fix handling of GOT entry for local symbol
- From: Jiong Wang <wong dot kwongyuan dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 20 Apr 2015 19:04:32 +0100
- Subject: Re: [AArch64] PR18270, fix handling of GOT entry for local symbol
- Authentication-results: sourceware.org; auth=none
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