This is the mail archive of the binutils@sourceware.org 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 Jul 13, 2014, at 9:42 AM, pinskia@gmail.com wrote:

> 
> 
>> On Jul 11, 2014, at 1:19 PM, David Abdurachmanov <david.abdurachmanov@gmail.com> 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:
> 
> 
> This could be a bug in gcc too. I had debugged a case in the aarch64 backend where it would change from the small coding model to the tiny one in some cases. I have a fix but I don't have it right now as I am on vacation. I can post it around Tuesday or so.  I saw this while using a gcc 4.7 based gcc and with a distro build (I cannot remember the program right now either, maybe python). 

That would explain it.

But the following should be good enough for 4GB offset (small code model), IIUC.

  82348:       90000000        adrp    x0, 7e20c <Curl_FormReader>
  8234c:       f9400000        ldr     x0, [x0]

And ldr here takes imm12 unsigned offset. 82348 calculates page address the Curl_FormReader sits, and 8234c offset inside that page. ld.bfd does not complain about 82348 relocation, only about 8234c.

I can test your patch once it arrives. I am watching gcc-patches.

I know that changing code model compiles fine, but fPIC is not supported with mcmode=large. I could compile the code with mcmode=large, but I couldn't run it. This static library needs fPIC.

I can share the static libraries and combine_libs scripts if someone would like to test locally.

To confirm that problem is in GCC I packed Clang 3.4.1 for F19 on aarch64, but that didn't work. Some porting is needed for Clang (will debug it).

@Andreas,
I checked random function addresses and they seems to be 4-byte aligned, not 8-byte.

david

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