This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [AArch64/bfd/2.24] relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: David Abdurachmanov <david dot abdurachmanov at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 14 Jul 2014 16:25:51 +0100
- Subject: Re: [AArch64/bfd/2.24] relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against
- Authentication-results: sourceware.org; auth=none
- References: <B98BFD30-327B-47F6-94F3-CAD15DD20917 at gmail dot com>
On 11/07/14 21:19, David Abdurachmanov wrote:
> Hi,
>
> Tested on Fedora 19 Remix aarch64 (GCC 4.8.1, binutils 2.23.52.0.1-9.fc19 20130226) and June 28 Fedora 21 (rawhide) (GCC 4.9.0, binutils 2.24). Default linker if bfd.
>
> I am building a package called CVMFS. It depends on pacparser, which internally depends on Mozilla's SpiderMonkey JS engine.
>
> The packages compiles on i386, x86_64, and armv7hl for Fedora 19 and 20.
>
> I got these linker errors:
>
> libcvmfs.a(libcvmfs.a_pub.o): In function `TryArgumentFormatter':
> :(.text+0x77044): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
These sound like problems with the alignment of the target symbol.
AAELF64 says:
"Relocation types whose names end with â_NCâ are non-checking relocation
types. These must not generate diagnostics in case of field overflow.
... Some non-checking relocations may, however, be expected to check for
correct alignment of the result; the notes explain when this is permitted."
Then:
"312 - R_AARCH64_LD64_GOT_LO12_NC G(GDAT(S+A)) Set the LD/ST immediate
field to bits [11:3] of X. No overflow check; check that X&7 = 0"
So this instruction requires that the target symbol be 64-bit aligned.
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_ConvertArgumentsVA':
> :(.text+0x77230): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_ConvertValue':
> :(.text+0x78630): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_EnumerateResolvedStandardClasses':
> :(.text+0x85000): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_InitObjectClass'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_GetScopeChain':
> :(.text+0x8512c): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_LockGCThing':
> :(.text+0x85530): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_UnlockGCThing':
> :(.text+0x855a8): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_InstanceOf':
> :(.text+0x862c4): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_GetConstructor':
> :(.text+0x86948): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_SealObject':
> :(.text+0x86adc): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'
> libcvmfs.a(libcvmfs.a_pub.o): In function `JS_AliasProperty':
> :(.text+0x87560): additional relocation overflows omitted from the output
> collect2: error: ld returned 1 exit status
> make[2]: *** [cvmfs/test_libcvmfs] Error 1
>
> All these functions are in jsapi.o. Other object files contains code calling the same functions [js_GetErrorMessage, js_InitObjectClass] and none of them are reported.
>
The other objects may be using accesses with less strict alignment
constraints.
> ./src/spidermonkey/js/src/Linux_All_DBG.OBJ/jsapi.o
> 0000000000000094 t TryArgumentFormatter
...
>
> ./src/spidermonkey/js/src/Linux_All_DBG.OBJ/jscntxt.o
> 000000000000219c T js_GetErrorMessage
>
And indeed, this symbol is only 32-bit aligned.
As to why this is occurring, you'll need to do more investigation. Is
it the compiler making an assumption that the object is sufficiently
aligned than it has a right to, or is it just a design error in the
software -- ie the compiler has been giving incorrect information about
the target object.
R.