From patchwork Wed Feb 5 06:09:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 1233665 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109188-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=uu508ZA6; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=SDCPaoS/; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48CB3n07Lvz9sSY for ; Wed, 5 Feb 2020 17:09:40 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; q=dns; s=default; b=tRZ2itrNSlNYqwpA VDAk643pV6Cf2iCzL2JfgKp8j5cpB14x4FG1ZzLSYUc4m741mQOsR46K3/G4ywMJ SOo/b0QKZohSZX6hW35iK+rmmqRKHLIzktKvda1bQZoyf7y8nNPpClNHg1Z4Fy4I i1RKNOJ/T0n9qh1lSr2lp59iueA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; s=default; bh=wneFbAbsFY4BCZXMct7c1+ FGnBM=; b=uu508ZA6LAlt4c4pzwSUmzXtx40yW5ACfJ8dDSVPEh93vTXBB3pxNC PBCQRP3ORA6vVjaRZI9rVfu+EJlTMbd74AhB3S9VppciQ3/sam6DFmoWkZnD6hxq aF+T1lLSJwJnSd8hzLKikZfXA8/gp4VhOxQDFJzC6SdiZQrJvD/Hw= Received: (qmail 90035 invoked by alias); 5 Feb 2020 06:09:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 90026 invoked by uid 89); 5 Feb 2020 06:09:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 required=5.0 tests=AWL, BAYES_00, ENV_AND_HDR_SPF_MATCH, FSL_HELO_FAKE, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-HELO:sk:mail-pg, 6497, H*M:google X-HELO: mail-pg1-f181.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=4Il581H9aDdIAv71V8pyG4eBAsqQ34Da+ScwevuWlDM=; b=SDCPaoS/SZyqpCWi6/gdEh313Esqet2mpSAEhIbcKOJEfqeQYi/i7Mkfu8hmpPp49y sx36q6tHlyqImGWsJSBuZGBFoFKaOAQ0J8vd70LJ3pp04IftycGoUW6Yi0E6EH7Yh8C2 NPqzOU3jclFXRR/wtU8SJQpxhTVGZYMjLzJ2+FBlVee6rBuQLQh1hSkrD+Ua8ZNQqxoC z96wayzHuggmZnqBdqpMX6k7dyyCiI8JfJUrTVAo1uzNGy70K9Nx28RK+hJVRCmGfD3V 8l28EfQUn31+/B7iNNSr3o04XycLbkP7VIpInStzKEprnRR3sr22n3Z+JMCmsMVo6VTe u/0A== Date: Tue, 4 Feb 2020 22:09:22 -0800 From: Fangrui Song To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH] Improve IFUNC check Message-ID: <20200205060922.5pbgm5hfj2r6vrl2@google.com> MIME-Version: 1.0 Content-Disposition: inline GNU ld's RISCV port does not support IFUNC. ld -no-pie produces no relocation and the test passed incorrectly. Be more rigid by testing IRELATIVE explicitly. --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index b959d2d988..0107f0dec5 100755 --- a/configure +++ b/configure @@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ -o conftest conftest.S 1>&5 2>&5; then # Do a link to see if the backend supports IFUNC relocs. $READELF -r conftest 1>&5 - LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { + LC_ALL=C $READELF -Wr conftest | grep -q IRELATIVE && { libc_cv_ld_gnu_indirect_function=yes } fi diff --git a/configure.ac b/configure.ac index 49b900c1ed..1fbaf65951 100644 --- a/configure.ac +++ b/configure.ac @@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then # Do a link to see if the backend supports IFUNC relocs. $READELF -r conftest 1>&AS_MESSAGE_LOG_FD - LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { + LC_ALL=C $READELF -Wr conftest | grep -q IRELATIVE && { libc_cv_ld_gnu_indirect_function=yes } fi