From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by sourceware.org (Postfix) with ESMTPS id CE8F93858D20 for ; Wed, 9 Mar 2022 00:26:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE8F93858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f46.google.com with SMTP id fs4-20020a17090af28400b001bf5624c0aaso867650pjb.0 for ; Tue, 08 Mar 2022 16:26:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S8ktJ7QPlsFApUd/t6I4T4aa6vfivQc3fse5NgdNk2c=; b=kqlzigsLCiPNAuZBmqA61SNGRAR+D5Ifq9XFLyWaYLQ69BBnqIJV7Y2iKrRohIkuQu l0dkc0czUYI6BA1hf/FjmCprbC7xdzWVEDuqwAZ9VXE/3hhaK1YPSMnJsicDYGViowU8 DZvfvaSOiy/VnYkKVU+VbVaugraMieu03jPN8oot1/TUURF1PV5ZggglwzyNjvRJV4HS Q0QPjISbrupjGRFrh0Nlyq4TpxVZi4183kzlAgcchUcMUUJqMiVCfTBza+ThIyupMXDH iLxDkXkL8e3SgPTnT1uiyFYThRcElSTVYdnmWGxImAueZBqDkfCLp8+heBo7awcCFwe8 f/dw== X-Gm-Message-State: AOAM532USHEpLllh8rss9tzes+0hdIrG6wTU5r9UNjlyZujtTdNbQDGK CIPQLCTM3tJA+so4KrLgfUB9IYQ+kdQ= X-Google-Smtp-Source: ABdhPJwoAzlb78JPCTIrQhG/wYSngAheOiXUqxAHYSM43aETDTq7D3WTaDp69rbclgyVjluzDc5vpw== X-Received: by 2002:a17:903:41c1:b0:151:ed5e:6bc4 with SMTP id u1-20020a17090341c100b00151ed5e6bc4mr12014796ple.113.1646785566871; Tue, 08 Mar 2022 16:26:06 -0800 (PST) Received: from localhost ([2601:647:6300:b760:5f77:8a14:573e:dee8]) by smtp.gmail.com with ESMTPSA id z11-20020a056a001d8b00b004f74f8268cbsm235598pfw.85.2022.03.08.16.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:26:06 -0800 (PST) Date: Tue, 8 Mar 2022 16:26:05 -0800 From: Fangrui Song To: Richard Earnshaw Cc: Ra T , binutils@sourceware.org Subject: Re: R_AARCH64_CALL26 Relocation Error on Ubuntu 18.04 Message-ID: <20220309002605.5dp5cenx5kpekxiw@gmail.com> References: <77e611a2-ed1f-0905-f4a9-17c945503421@foss.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <77e611a2-ed1f-0905-f4a9-17c945503421@foss.arm.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2022 00:26:09 -0000 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.