Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp206747pxb; Fri, 15 Jan 2021 00:46:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5yvMLTnmf56+laqWVP+ikRdh0Cs0cWbrh58+SKvd+2/EyuCWc/Br9ncOzXYJHpmdg2ppJ X-Received: by 2002:a17:906:9588:: with SMTP id r8mr7838571ejx.148.1610700365284; Fri, 15 Jan 2021 00:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610700365; cv=none; d=google.com; s=arc-20160816; b=Uzm1ttbQxXsENKdFNr1rnXdbHgBPcx/u0Yd3AlTyZBhARlaKYfF7HMZ5aDq3FWfy8X qCmM66ivkx5TY4kJ6tVUlBuJMgrpVjnhB1ozJVgtoUFxjpJe+c5kakZcTg3CfgGl209l ZG/KjcZV8bFS33oU1B7abhZ3L7A2QcR18L5mEajVJ+JExg6p8gQ+bvnu3ewzcUOMCfs3 YddnVl89fK3kjsfYUk2F3a7L5PdrMklAG9eXbkH4gZ/6NYtH+ghM0LVuMGZKP4/NCvHn m9nsp3fqJUWv7E966ch9FjDYSMYZOwhOOuXo+Ho7wKiC97lt9W7MayAXQsh+CqfTKXzV 1NqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LD/haCq3XpvQOx/86O8R8bQ+l2gOmeWA4e289rpVU/U=; b=RIqhs2wDPnNVzDoN94E3WS5kx1RS8qQJCaz2auMM88KFmDl6gy8SCwSo2qGYKxkcOk NQ7Whe1vtVNWIvm/xhEospCiEizXkX9v4bj8Zy2L3PHX5PoqC4G5iGwM/H47gVkjvwZG kg5Yy+0VKSvjcn4I3yhICc32f6jUPDlBURa5X3UEXPeUNTwAheD07367UXGRepG0fu87 lsC3Fm3+jcndMLM5v2Jeo+WWBN3Am7+BYXctv/dOXS8yvfGAM5yWuMyMCZ0vPN0iO/sF zBnkO4UbpN77UAdPmuYEcTP5RjPgwS4VNxQvpmumXM9+/U1aox2ctJOaszOvPeRmDx1k gJ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sciVsVPc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si3812859edq.184.2021.01.15.00.45.41; Fri, 15 Jan 2021 00:46:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sciVsVPc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732334AbhAOIKG (ORCPT + 99 others); Fri, 15 Jan 2021 03:10:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:54138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbhAOIKG (ORCPT ); Fri, 15 Jan 2021 03:10:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED103221E9; Fri, 15 Jan 2021 08:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610698165; bh=Mq/LTukrC0t3iHVpjub9KIF5jll7ihy+9U7R71ci734=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sciVsVPcKNtoAmAZUP47NaO7j3y4z02VjQlVZdZu5cGXUqlf+Xi1neW9JE++SfpWX wGhiuzgWWY98zuD8lYfyyXQI3MsXwVGoR48s8a7PBCVqG718XlpG/Qrxy9E30r6mKO Um/7+yBEwaSfRbQLnFqAWu3+nxZlAC73qaa1nuDPCVPr0d1gGGWXIYSYo7gHf9hWyv w/zqgMsgG2B6+OecEAVjo/LCIgU5dRak0ukKyaqunIZUjomYCqKem6DN5bofB5KAc5 Yberl18nHnF5npmPzcL0VBdh0xLD7sRUfpRNl/lYhpvOhmmJxjYIAkBPk9pKaqQyJU lZsfGczkkwxlQ== Date: Fri, 15 Jan 2021 09:09:20 +0100 From: Jessica Yu To: Nick Desaulniers Cc: Fangrui Song , LKML , clang-built-linux , Sam Ravnborg , Marco Elver Subject: Re: [PATCH v2] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols Message-ID: <20210115080920.GA9637@linux-8ccs> References: <20210114211840.GA5617@linux-8ccs> <20210114215416.993167-1-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux-8ccs 5.8.0-rc6-lp150.12.61-default+ x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Nick Desaulniers [14/01/21 14:01 -0800]: >On Thu, Jan 14, 2021 at 1:54 PM 'Fangrui Song' via Clang Built Linux > wrote: >> >> clang-12 -fno-pic (since >> https://github.com/llvm/llvm-project/commit/a084c0388e2a59b9556f2de0083333232da3f1d6) >> can emit `call __stack_chk_fail@PLT` instead of `call __stack_chk_fail` >> on x86. The two forms should have identical behaviors on x86-64 but the >> former causes GNU as<2.37 to produce an unreferenced undefined symbol >> _GLOBAL_OFFSET_TABLE_. >> >> (On x86-32, there is an R_386_PC32 vs R_386_PLT32 difference but the >> linker behavior is identical as far as Linux kernel is concerned.) >> >> Simply ignore _GLOBAL_OFFSET_TABLE_ for now, like what >> scripts/mod/modpost.c:ignore_undef_symbol does. This also fixes the >> problem for gcc/clang -fpie and -fpic, which may emit `call foo@PLT` for >> external function calls on x86. >> >> Note: ld -z defs and dynamic loaders do not error for unreferenced >> undefined symbols so the module loader is reading too much. If we ever >> need to ignore more symbols, the code should be refactored to ignore >> unreferenced symbols. >> >> Reported-by: Marco Elver >> Link: https://github.com/ClangBuiltLinux/linux/issues/1250 >> Signed-off-by: Fangrui Song > >Thanks for the patch. > >Reviewed-by: Nick Desaulniers > >Jessica, would you mind adding when applying: > >Cc: > >as I suspect we might want this fixed in stable tree's branches, too. >It might of interest to add: > >Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27178 > >too. Sure, will do! Thanks, Jessica