This is the mail archive of the
mailing list for the binutils project.
Re: RFC: Should AArch64 *_NC relocs complain on overflow ?
- From: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- To: Nick Clifton <nickc at redhat dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Jiong Wang <jiong dot wang at foss dot arm dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 9 Feb 2016 10:19:40 +0000
- Subject: Re: RFC: Should AArch64 *_NC relocs complain on overflow ?
- Authentication-results: sourceware.org; auth=none
- References: <87a8nb7bk8 dot fsf at redhat dot com> <ADC64823-9296-45C9-BCED-FFDC03CA29BB at arm dot com> <56B88C97 dot 6090308 at redhat dot com> <56B8945D dot 2060700 at arm dot com> <56B8C3F1 dot 7000701 at redhat dot com>
On 08/02/16 16:36, Nick Clifton wrote:
> Hi Richard,
>>> + Try to catch this situation here and provide a more helpful
>>> + error message to the user. */
>>> + if (addend & ((1 << howto->rightshift) - 1)
>>> + /* FIXME: Are we testing all of the appropriate reloc
>>> + types here ? */
>>> + && (real_r_type == BFD_RELOC_AARCH64_LDST16_LO12
>>> + || real_r_type == BFD_RELOC_AARCH64_LDST32_LO12
>>> + || real_r_type == BFD_RELOC_AARCH64_LDST64_LO12
>>> + || real_r_type == BFD_RELOC_AARCH64_LDST128_LO12))
>> Those are checking relocations (don't have _NC in the name), so I'd
>> expect that they already check alignment as part of their standard
>> overflow test (if they don't that's probably a different bug).
> Actually they are not. Despite their names, they are actually non-checking
> relocations. (Check the complain_on_overflow field if you do not believe me).
> This confused me for a long time. There is a terrible dichotomy between the
> BFD_RELOC_* names and the R_AARCH64_ names and it really would be a good idea
> to tidy this whole mess one day.
Nevertheless, it's still not a complete list of the names. For that
you'll need to work through the AAELF64 spec. Sadly, this isn't all
that explicit as it's sometimes in the textual summary for a group and
sometimes specified for a particular relocation.