This is the mail archive of the
mailing list for the binutils project.
Re: RFC: Should AArch64 *_NC relocs complain on overflow ?
- From: Nick Clifton <nickc at redhat dot com>
- To: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm 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: Mon, 8 Feb 2016 16:36:01 +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>
>> + 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.