From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29650 invoked by alias); 13 Feb 2020 17:43:58 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 29637 invoked by uid 89); 13 Feb 2020 17:43:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:uZpRDXC, H*f:BdACbo4K2, st_type, HX-Languages-Length:1049 X-HELO: mail-oi1-f193.google.com Received: from mail-oi1-f193.google.com (HELO mail-oi1-f193.google.com) (209.85.167.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 17:43:56 +0000 Received: by mail-oi1-f193.google.com with SMTP id j132so6615905oih.9 for ; Thu, 13 Feb 2020 09:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WwrTRMjwtk+EN62nbYGAQTVPLmtNR+RFL8jMenMTrbQ=; b=ujYQgkZY0ZpqXtvyL5Z2ZbmRPvaxa9jnAIw1FpPFHzYiN3k+ptZzlqKmJ/eCyJ8ZG/ lpSG2V7a4jQYxjAD9QEQGZJqHkKttjUrFSsgW22C6PwtxyktR0xYrrn1Z7od0J0zJFYs gRMSUuG2AR29tt707L9QbnFLnk24UKJPPEM40zNCTvVv/DGg/TNs236XdGZil9KPyR5O k07WaecOibryNEWlLn/7VR5KmtcC4ClcPhGUxto2DAOscefKk8AeTDvtKveWI2bbolR4 mO5cbG0fyFwMuhQePoHONmfYaGn8eqIyQpFgeJwHt504FQoe3GFkuONYgq0Bfa7Muooo VZoA== MIME-Version: 1.0 References: <20200213072543.blhdiffkaoxpfoqm@google.com> <20200213172905.ebwvftkpixri3s77@google.com> In-Reply-To: <20200213172905.ebwvftkpixri3s77@google.com> From: "H.J. Lu" Date: Thu, 13 Feb 2020 17:43:00 -0000 Message-ID: Subject: Re: [PATCH] x86-64: Resolve R_X86_64_PLT32 referencing a local symbol even if defined in another section To: Fangrui Song Cc: Binutils , Nick Clifton Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00303.txt.bz2 On Thu, Feb 13, 2020 at 9:29 AM Fangrui Song wrote: > > On 2020-02-13, H.J. Lu wrote: > >On Wed, Feb 12, 2020 at 11:25 PM Fangrui Song wrote: > >> > >> See gas/testsuite/gas/i386/relax-5.s > >> Currently gas incorrectly emits a .L symbol. > >> Context: https://github.com/ClangBuiltLinux/linux/issues/811 > >> > >> (begin story > >> > >> I taught clang to emit a call insn referencing a local symbol if the > >> symbol is defined in the same translation unit. This can avoid unneeded > >> PLT if the object file is linked with -shared. > > > >Why does a linker generate a PLT entry for PLT32 relocation against a local > >symbol? Does BFD linker have the same issue? > > The problem is not a linker, but objtool (used by the Linux kernel)'s > unneeded constraint on st_type. > I don't have any problem with PLT32 and objtool in the current Linux kernel. Are you using very old Linux kernel? -- H.J.