From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D2D6FA0542 for ; Fri, 2 Dec 2022 11:01:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A96DB40687; Fri, 2 Dec 2022 11:01:26 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9E512400D6 for ; Fri, 2 Dec 2022 11:01:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669975284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ucZCgtyRF1i8TOUxj6QRfqtua/toPz6YErbQt3JGRgA=; b=Uh6stiMEMqNqBEZaZ5Lui0ckcQTHrG+blHpM4iBv/DrHBVYCPqKcR/fXTR36UsM39snz93 qA5jgIJaDZILrlci4LxUCWW48dwU0TppxPgPjLyYHdgUZ8TpTmElstIcmULYkpk2OMWWPd kwPqG5+nlR16ydFr332HuJmTTG5TD+Q= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-265-T5dGn5zHPLmuVJ94FY7FkA-1; Fri, 02 Dec 2022 05:01:23 -0500 X-MC-Unique: T5dGn5zHPLmuVJ94FY7FkA-1 Received: by mail-pj1-f72.google.com with SMTP id k7-20020a17090a39c700b002192c16f19aso4894752pjf.1 for ; Fri, 02 Dec 2022 02:01:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ucZCgtyRF1i8TOUxj6QRfqtua/toPz6YErbQt3JGRgA=; b=gZo/XEU1z1XrhuuBTRxUpYLGLvJ2LZGjxnsT9IUn3x0WbmTSURJcVXk0SzuAiqAejE 10QrBnTrD6Tv6GeFJ8AnCETdpzbdHl2jIqb60Vz3KqSW5M907JD96NXLChE91MGKWefN ZrtGpAUgjfw6nG6CAtxR7p3WmOmk7OlA9dr8v6VjpW/IYDzuqKd4v86KMQ2WMhv/olnG gEO9uAdoCgToL4UVJHCUMZU3hu2WrpLNEJhIbcAtifCAq8HJ1mqsbM3gUuJPkPbW4dQx 3Dt181jcaJopZ+ekB2gNe/gLw9dR67NJ52cxAbojXtIzKsvdvdA+CiJ86WHTUzU7lGZn ym9g== X-Gm-Message-State: ANoB5pm00hhZ9VS1+7ohnE2Nua3vhV0mrixyhOeuY+wgM2dJHMyzgdAE ordxwDPf2xpzMut06NQxDawgMXakL2y51+9i0VpsLUdAgqD72umnoGjR2pzh4YQkxVPWCmNLPwY VMYHmZ33xhh/FRMBMBb3piOM= X-Received: by 2002:a05:6a00:330d:b0:56c:6bcc:cf0e with SMTP id cq13-20020a056a00330d00b0056c6bcccf0emr51865382pfb.64.1669975282859; Fri, 02 Dec 2022 02:01:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf64ceHFJYIlQKoxzRnFi6zvEl/pcsTaGUNh4DDOMUcRXrg8THRsmLRzC7LIpYnUvK6RvkAjkwa0z0EsLsVixSM= X-Received: by 2002:a05:6a00:330d:b0:56c:6bcc:cf0e with SMTP id cq13-20020a056a00330d00b0056c6bcccf0emr51865341pfb.64.1669975282529; Fri, 02 Dec 2022 02:01:22 -0800 (PST) MIME-Version: 1.0 References: <20221129140032.35940-1-david.marchand@redhat.com> <20221201100847.322141-1-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Fri, 2 Dec 2022 11:01:11 +0100 Message-ID: Subject: Re: [PATCH v3 1/2] drivers: fix symbol exports when map is omitted To: Bruce Richardson Cc: dev@dpdk.org, ferruh.yigit@amd.com, stable@dpdk.org, Luca Boccassi , Thomas Monjalon , =?UTF-8?B?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu, Dec 1, 2022 at 11:55 AM Bruce Richardson wrote: > > On Thu, Dec 01, 2022 at 11:08:46AM +0100, David Marchand wrote: > > ld exports any global symbol by default if no version script is passed. > > As a consequence, the incriminated change let any public symbol leak > > out of the driver shared libraries. > > > > Hide again those symbols by providing a default map file which > > unexports any global symbol using a local: * catch-all statement. > > > > The checks are skipped for this default map file as it is intentionnally > > an empty map (see commit b67bdda86cd4 ("devtools: catch empty symbol > > maps")) and there is nothing else to check in this map. > > > > Fixes: 7dde9c844a37 ("drivers: omit symbol map when unneeded") > > Cc: stable@dpdk.org > > > > Reported-by: Luca Boccassi > > Signed-off-by: David Marchand > > Tested-by: Ferruh Yigit > > --- > > Changes since v2: > > - separated the Windows cleanup in next patch, > > > > Changes since v1: > > - excluded drivers/version.map from maps checked by default in > > check-symbol-maps.sh, > > > > --- > > devtools/check-symbol-maps.sh | 2 +- > > drivers/meson.build | 68 +++++++++++++++++++---------------- > > drivers/version.map | 3 ++ > > 3 files changed, 41 insertions(+), 32 deletions(-) > > create mode 100644 drivers/version.map > > > > diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh > > index 0a6062de26..8c116bfa9c 100755 > > --- a/devtools/check-symbol-maps.sh > > +++ b/devtools/check-symbol-maps.sh > > @@ -8,7 +8,7 @@ cd $(dirname $0)/.. > > export LC_ALL=C > > > > if [ $# = 0 ] ; then > > - set -- $(find lib drivers -name '*.map') > > + set -- $(find lib drivers -name '*.map' -a ! -path drivers/version.map) > > fi > > > > ret=0 > > diff --git a/drivers/meson.build b/drivers/meson.build > > index c4ff3ff1ba..5188302057 100644 > > --- a/drivers/meson.build > > +++ b/drivers/meson.build > > @@ -210,40 +210,46 @@ foreach subpath:subdirs > > > > lk_deps = [] > > lk_args = [] > > - if fs.is_file(version_map) > > - def_file = custom_target(lib_name + '_def', > > - command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], > > - input: version_map, > > - output: '@0@_exports.def'.format(lib_name)) > > - > > - mingw_map = custom_target(lib_name + '_mingw', > > - command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'], > > - input: version_map, > > - output: '@0@_mingw.map'.format(lib_name)) > > - > > - lk_deps = [version_map, def_file, mingw_map] > > - if is_windows > > - if is_ms_linker > > - lk_args = ['-Wl,/def:' + def_file.full_path()] > > - if meson.version().version_compare('<0.54.0') > > - lk_args += ['-Wl,/implib:drivers\\' + implib] > > - endif > > - else > > - lk_args = ['-Wl,--version-script=' + mingw_map.full_path()] > > + if not fs.is_file(version_map) > > + version_map = '@0@/version.map'.format(meson.current_source_dir()) > > + lk_deps += [version_map] > > Technically, for this patch the lk_deps assignment does not need to be > split into two, but it does make the second patch smaller, so I'm ok to > keep this as you have in this version. Yes, otherwise, I would have kept it untouched. Thanks for the review! -- David Marchand