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 14CB4A0542; Fri, 2 Dec 2022 11:01:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D10CC42B8C; Fri, 2 Dec 2022 11:01:27 +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 E9D5F40687 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=1669975285; 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=MC4pMT540cZ5EltTykk+sy7zpBSwWfkxCzdh0+NQ+Msiot/0hSZWhI9mGgA4GrQoIwAIDU w7MptawUF5r1HzybnhI5y88mc65XboJ3+3T4aYtjLZbOEL9UtCzzlBiy/qOtk1xFP8Hopk S9TRku2pb/UX33vwBqn8njcY8u2n0bo= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-75-q81Tv0XjOs2eV07BQmLKlA-1; Fri, 02 Dec 2022 05:01:23 -0500 X-MC-Unique: q81Tv0XjOs2eV07BQmLKlA-1 Received: by mail-pj1-f71.google.com with SMTP id z1-20020a17090a66c100b002196a0895a6so4873796pjl.5 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=Q5zpIiQ+70AVSYjLcEpHB6d+af5Xvx2kU9h6+xU8MIJggsQqnd5/Lc4+lVLw7SiYJf TTArFUXFmiWL7GtO5PdP0b61Gll+LbbUTh2T1wetIaV2dlH3srUor0tP+dkT79s/ozFm fOvm6klDk5+umonr0+zKHXkejgY7kZfzq4PwlFor4IqYfdU7o7dBtfBYgIeAFGaiBi+t 0CxEgoBL9jF2e23KylSPHcGLmfWfuhVzvYR/o6jWjHUTgOss1MNkyGIynd0zg4Vjblzd NSM1BWCbghuH1bzOpIppj7r1BcrZ9DqwMZPGPJWxnXG3nuC5Tq4zJG8TVv3sETQQ+s+x NcfA== X-Gm-Message-State: ANoB5pksbPB+h183caI6hJevA/xWosmxWdNBtR54tPZTN8tQSrfh9jUl YEuNUrcK3F01JeNlgVw8Fr6XLBf80wBXc9zS55pbfWwdEG/wSMnBGmrn7DqjKD3XSDp9JfL4JYy vsWjmVmrt8psmEuTVxvA= X-Received: by 2002:a05:6a00:330d:b0:56c:6bcc:cf0e with SMTP id cq13-20020a056a00330d00b0056c6bcccf0emr51865372pfb.64.1669975282812; 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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