public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
Cc: Ra T <jupitertrain311@gmail.com>, binutils@sourceware.org
Subject: Re: R_AARCH64_CALL26 Relocation Error on Ubuntu 18.04
Date: Tue, 8 Mar 2022 16:26:05 -0800	[thread overview]
Message-ID: <20220309002605.5dp5cenx5kpekxiw@gmail.com> (raw)
In-Reply-To: <77e611a2-ed1f-0905-f4a9-17c945503421@foss.arm.com>

On 2022-03-01, Richard Earnshaw via Binutils wrote:
>
>
>On 01/03/2022 01:45, Ra T via Binutils wrote:
>>Has anyone seen this problem on NVidia's L4T (based on Ubuntu 18.04) with a
>>Jetson AGX Xavier?
>>
>>I'm trying to compile Qt 5.15.8, and the opensource Chromium build
>>(QtWebEngine) is failing with the error:
>>
>>"relocation truncated to fit: R_AARCH64_CALL26 against symbol ... defined
>>in .text section in /lib/aarch64-linux-gnu/libc.so.6"
>>
>>The symbols listed are gettimeofday@@GLIBC2.17 and ntohs@@GLIBC_2.17.
>>
>>It seems similar to this bug:
>>https://bugzilla.redhat.com/show_bug.cgi?id=1243559
>>
>>But I could not find a more recent bug.  L4T 32.6.1 is using binutils 2.30,
>>g++ 7.5.
>>
>>Sorry for newb questions, if this is the wrong mailing list let me know.
>>
>>Regards,
>>Rad
>
>It's not a bug, the linker is telling you that the target of the call 
>instruction is too far away from the instruction.  This can happen if 
>your program or library contains too much compiled code.  It's most 
>common when code is built without optimization.  You could also try 
>building with -Os to reduce the amount of code generated.
>
>If all else fails, you might need to partition your code into multiple 
>shared libraries so that each is smaller and less than the limit 
>imposed by the instruction set.
>
>R.

This is likely a bug. R_AARCH64_CALL26/R_AARCH64_JUMP26 have a range of
+-128MiB and the linker is expected to create range extension thunks
(veneers) automatically. The thunk code in ld may not be so reliable to
handle all cases.

Folks who have worked on ld/testsuite/ld-aarch64/farcall-*
may have some idea.

Diagnosing such an issue usually requires the reporter to provide the full
input to ld (https://sourceware.org/bugzilla/show_bug.cgi?id=26119).
The input is large, so the report may need to provide a downloadable
link.

      reply	other threads:[~2022-03-09  0:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  1:45 Ra T
2022-03-01 13:29 ` Richard Earnshaw
2022-03-09  0:26   ` Fangrui Song [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220309002605.5dp5cenx5kpekxiw@gmail.com \
    --to=i@maskray.me \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=binutils@sourceware.org \
    --cc=jupitertrain311@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).