From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123873 invoked by alias); 2 Apr 2018 11:55:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 123837 invoked by uid 89); 2 Apr 2018 11:55:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 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.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Apr 2018 11:55:13 +0000 Received: by mail-oi0-f41.google.com with SMTP id f63-v6so771281oic.4; Mon, 02 Apr 2018 04:55:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8rKK5VTInBNAQL2xE6mBj7IspCsJxibhGYAHtMO7tfg=; b=kG5SsH+JKPjN64zMJuSvGABHZSXicn4zndAkQMqjOeKgkFUAuM9wpZhzmzsyQoiM38 kY8xPqyEO2pQ6W+gU1ntXiQJDMItZXeul5gx7awjMskW2AmdG/qYpgo4PoNC5JyaqHop IA4zMq52huLHkyZ0uM6ItIqpvLFjdWVACNc4tIsKP/oawWG2sQjXn2cT7VwwRA/iVG+Q epg1pn4JWihLsx2BvEB1asJisPJpTkpPkueXoV07Lu+4J16Rf82vr/4tjjgzjinfgXE7 U+GcCO7B3vj6pPng8qL/HnBn7gCiendjLwMEofUY4CB1c03/5XaCRS3ZU41bvMd0Uycd FqJQ== X-Gm-Message-State: ALQs6tCtIDlUI86c7TDGz1WOqQSpJrRtpKNANG3QQRzVOBSVzu0AVUM3 M+2yAvhrmpuUtcrpnzof0zhVaud0+tg5D3cToIc= X-Google-Smtp-Source: AIpwx4/AnLX9RkwVNHqwYml5PLr6UJy/AZYC4OnRHrDu2QKxOwwyK1pANTh1ePMeXi8J1tTY4w/L8MNp+1NQRw8HjMw= X-Received: by 2002:aca:ea46:: with SMTP id i67-v6mr4689499oih.316.1522670111586; Mon, 02 Apr 2018 04:55:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.190.152 with HTTP; Mon, 2 Apr 2018 04:55:11 -0700 (PDT) In-Reply-To: <20171019002520.GA4932@gmail.com> References: <20171019002520.GA4932@gmail.com> From: "H.J. Lu" Date: Mon, 02 Apr 2018 11:55:00 -0000 Message-ID: Subject: Re: [PATCH] Use dlsym to check if libdl is needed for plugin To: Binutils Cc: GCC Patches , GDB Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00037.txt.bz2 On Wed, Oct 18, 2017 at 5:25 PM, H.J. Lu wrote: > config/plugins.m4 has > > if test "$plugins" = "yes"; then > AC_SEARCH_LIBS([dlopen], [dl]) > fi > > Plugin uses dlsym, but libasan.so only intercepts dlopen, not dlsym: > > [hjl@gnu-tools-1 binutils-text]$ nm -D /lib64/libasan.so.4| grep " dl" > 0000000000038580 W dlclose > U dl_iterate_phdr > 000000000004dc50 W dlopen > U dlsym > U dlvsym > [hjl@gnu-tools-1 binutils-text]$ > > Testing dlopen for libdl leads to false negative when -fsanitize=address > is used. It results in link failure: > > ../bfd/.libs/libbfd.a(plugin.o): undefined reference to symbol 'dlsym@@GLIBC_2.16' > > dlsym should be used to check if libdl is needed for plugin. > > OK for master? > > H.J. > --- > bfd/ > > PR gas/22318 > * configure: Regenerated. > > binutils/ > > PR gas/22318 > * configure: Regenerated. > > config/ > > * plugins.m4 (AC_PLUGINS): Use dlsym to check if libdl is needed. > > gas/ > > PR gas/22318 > * configure: Regenerated. > > gprof/ > > PR gas/22318 > * configure: Regenerated. > > ld/ > > PR gas/22318 > * configure: Regenerated. > diff --git a/config/plugins.m4 b/config/plugins.m4 > index 513c690e1b..c6acebc1ca 100644 > --- a/config/plugins.m4 > +++ b/config/plugins.m4 > @@ -16,6 +16,6 @@ AC_DEFUN([AC_PLUGINS], > [plugins=$maybe_plugins] > ) > if test "$plugins" = "yes"; then > - AC_SEARCH_LIBS([dlopen], [dl]) > + AC_SEARCH_LIBS([dlsym], [dl]) > fi > ]) If there are no objections, I will check into binutils master branch this week. -- H.J.