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: 37427 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