This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [AArch64/bfd/2.24] relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against

On 07/11/2014 01:19 PM, David Abdurachmanov wrote:
> libcvmfs.a(libcvmfs.a_pub.o): In function `TryArgumentFormatter':
> :(.text+0x77044): relocation truncated to fit: R_AARCH64_LD64_GOT_LO12_NC against `js_GetErrorMessage'

Was this libcvmfs.a_pub.o created via ld -r?  I'm curious because libcvmfs.a
only has one object file in it.

The aarch64 linker backend appears to be buggy in that it does not handle
creating GOT entries for local symbols (h == NULL).  In fact, it *silently*
does nothing with them, passing through the original symbol address unchanged.
 Which is worse than erroring out earlier -- if your symbols had instead been
accidentally aligned, the link would have succeeded but with incorrect
relocations applied.

I presume that someone thought that this case could never happen, because gcc
isn't supposed to create GOT references to local symbols.

But if one were to massage the object files after the fact, with ld -r and/or
objcopy --localize-symbol, one can produce an object file that the current
linker simply cannot handle.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]