From patchwork Fri Jan 17 19:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1224948 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-108774-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.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=BTiZd51V; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Kx32K4Oz; 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 47zr6v59HQz9sR4 for ; Sat, 18 Jan 2020 06:03:03 +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:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=e12aAqLF91bT3ZdJ6BobKrh0w+Bdh HWGbG4mLdnHiQTujFO+EK6Gf98cvGN3FdsbLcjVMwKCJsTzQoD6kcJxNZEand3tB ikPQD8X7pdKL7dvBkzl3u+lC/oniyWcVAfrurnXze7mheWbgoIN2bDcORTx7nLPK murL8jrhVUF5is= 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:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=IUi1JIXF1Ajmj5GZt6AxyXHeqPI=; b=BTi Zd51VMsPrFe/DEgUGTNGyKnKc4oDNeGow/SHWiSbrHUPZdsBQXP8SHiSBWEN3dI3 DNG8DKJP4jhD1bMMQQH0z7R/ms1U9Ir4pOYl6nwdNaUAWqBcvN39OaQm2E4l0sS2 ZXI6AfYhToSTY21WJ6oTjeRWL0OlloTSwUSKXx0I= Received: (qmail 66491 invoked by alias); 17 Jan 2020 19:02:57 -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 66480 invoked by uid 89); 17 Jan 2020 19:02:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-HELO:sk:mail-ot X-HELO: mail-ot1-f54.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=HJ1gr49k9BJcc2/mIMzl7CLY9LCLLUfyFt7NVCqy8dU=; b=Kx32K4OzQI5DlOzZmVXLLfSPeVOzTQ3IaZZerPoahE6JQbKGgZEa9nFIJRijg+v/F+ PhvpQgg8W60V5ppisRZswUrbn9yB4eEFaV7jp2KUjZLatihGovdxDraKMwkKWEKK9SBI FHnbxLDd2NTzMyHqElvu8JmKdfy1FvhgWkC1TXqGMczyNRCTL70/HKmYXbf0+hoiX9Sq CyFVr00NsW+2F3DaF558248yEQDZQAR3qYf1EutgrwdfSd7q8jXMrPIL+zr28/7NWS8g JpRY/8ziu9WTgw9Sr0wYDuUNd/ZAQngVNMSzDfyO2VAtDlJgJencCzE8J0So9sWIfcTk k0ww== MIME-Version: 1.0 From: "H.J. Lu" Date: Fri, 17 Jan 2020 11:02:18 -0800 Message-ID: Subject: [PATCH] x86: Don't make 2 calls to dlerror () in a row To: GNU C Library We shouldn't make 2 calls to dlerror () in a row since the first call will clear the error. We should just use the return value from the first call. Tested on Linux/x86-64. From 7fe7a18b7bed14bc2da616281d72b2bdbe26b41c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 17 Jan 2020 10:13:43 -0800 Subject: [PATCH] x86: Don't make 2 calls to dlerror () in a row We shouldn't make 2 calls to dlerror () in a row since the first call will clear the error. We should just use the return value from the first call. Tested on Linux/x86-64. --- sysdeps/x86/tst-cet-legacy-5.c | 2 +- sysdeps/x86/tst-cet-legacy-6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/x86/tst-cet-legacy-5.c b/sysdeps/x86/tst-cet-legacy-5.c index b97e03d634..6c9bba06f5 100644 --- a/sysdeps/x86/tst-cet-legacy-5.c +++ b/sysdeps/x86/tst-cet-legacy-5.c @@ -38,7 +38,7 @@ do_test_1 (const char *modname, bool fail) if (strstr (err, "shadow stack isn't enabled") == NULL) { printf ("incorrect dlopen '%s' error: %s\n", modname, - dlerror ()); + err); exit (1); } diff --git a/sysdeps/x86/tst-cet-legacy-6.c b/sysdeps/x86/tst-cet-legacy-6.c index 3c4a47f2db..877e77747d 100644 --- a/sysdeps/x86/tst-cet-legacy-6.c +++ b/sysdeps/x86/tst-cet-legacy-6.c @@ -38,7 +38,7 @@ do_test_1 (const char *modname, bool fail) if (strstr (err, "shadow stack isn't enabled") == NULL) { printf ("incorrect dlopen '%s' error: %s\n", modname, - dlerror ()); + err); exit (1); } -- 2.24.1