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 51BB0A00C5; Thu, 1 Dec 2022 11:55:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA9CF42D11; Thu, 1 Dec 2022 11:55:29 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A1AE842D0D; Thu, 1 Dec 2022 11:55:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669892128; x=1701428128; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=5XCaEpVw3bv7c9LvDYmddjNLtNOkLDsS0KIdJH/1lfw=; b=hxVBKKYI4nO6jY7BW6wxobAT8OnUJiH+Uz6ZDLuOwsM35Dqkb3n1xEh8 iM+qN0TawI0WoEczlZQaB2LHaTO5PA4AM1DbwQuuLyx1AoyZ7xb1L37CV ZFkCbaNgWxuLl6mdVK37gReqduqtF/Zmy3RwOHzqleQvXi7ATQP6mVEKb t4npyMa9RaX1ZpH1m0b3uq6vSB68eQQpfVG1NLQPVP1bkpA3BIJeSQLeH a4snxKxVdhW7PUEOgIdb3wc8zZxUcFTcOo9rw7SbtdLsj/sNheYPmbV60 bBcAttlHrlweYTYyYZtBK57L34OG5HBDOlNwNCV7+monbCi92KGZy1HAR Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="342577441" X-IronPort-AV: E=Sophos;i="5.96,209,1665471600"; d="scan'208";a="342577441" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2022 02:55:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10547"; a="646713602" X-IronPort-AV: E=Sophos;i="5.96,209,1665471600"; d="scan'208";a="646713602" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 01 Dec 2022 02:55:27 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 1 Dec 2022 02:55:27 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 1 Dec 2022 02:55:27 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 1 Dec 2022 02:55:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b0oPdhRZ7Ix05NFUCocqXRVSdq2C9IZN+KAPXhhkF0wXJw3qFYfX1ugqRFESKKZPuLVrCpWjVZ4OQ1yEdWKAqSNevjpSxwC7XX3oPxgpDz+tib4G91gg0iiQPDJRi+S62B+18nkqQGKAlDLJAD2RVM+hku++gOkMq5W2WTVxdrXj4EvOYbKlXBkb6eqFBhP/wP6GGCYOQhxoVYORmf+wKgtonuim9WFkkweNbqdIYCi5C5v0moL06qEcdL+ubrUiCukYNbiOrinA870R2yQ6oDyqhaIK7za9e1ktbTVtvqfhigNRE5YjTbNrWGuBQAVP2Wird3WH40f9sC7sCfuzSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fbv8dVHYUF92EK6RZVxYaIakCQHYybwIkjF3LSxlc0o=; b=eQ5VzT6xRdolbWKLzGZAJOaiVBmybGqWn73KIftWfcMfvwdt6tmo4a2xPwcQxK5iq4p8qxS0VfWoEBSnpqJGVQKhqTw7yTOz1qyyn2jwCg/FLLfmOeWyHR4sLf6KTwdgd7RFqFHzldU7yuDrj/j7e0JA+GQ0e5do/On2/Z5bEpQDy7tNwFHFtu2xuKzeCM4XY6MI5gNd2cRoFgg0Lv7oO1VftOrnK0tYQQ4+Mn62jfakznoWLootvxK38Tfdpig99SgAliDHomBcrDlHsbOS6VMSPDAGjHhocwobu1LID4B2Ep0n7lGI4HcCS4lsuKAoULBFHBpboWak7tcEcr6qFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BN6PR11MB1618.namprd11.prod.outlook.com (2603:10b6:405:d::13) by MW3PR11MB4730.namprd11.prod.outlook.com (2603:10b6:303:58::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8; Thu, 1 Dec 2022 10:55:24 +0000 Received: from BN6PR11MB1618.namprd11.prod.outlook.com ([fe80::15e5:f3ce:18ff:7d16]) by BN6PR11MB1618.namprd11.prod.outlook.com ([fe80::15e5:f3ce:18ff:7d16%5]) with mapi id 15.20.5880.008; Thu, 1 Dec 2022 10:55:24 +0000 Date: Thu, 1 Dec 2022 10:55:15 +0000 From: Bruce Richardson To: David Marchand CC: , , , Luca Boccassi , Thomas Monjalon , Abdullah =?iso-8859-1?Q?=D6mer_Yama=E7?= Subject: Re: [PATCH v3 1/2] drivers: fix symbol exports when map is omitted Message-ID: References: <20221129140032.35940-1-david.marchand@redhat.com> <20221201100847.322141-1-david.marchand@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221201100847.322141-1-david.marchand@redhat.com> X-ClientProxiedBy: LO4P265CA0011.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ad::19) To BN6PR11MB1618.namprd11.prod.outlook.com (2603:10b6:405:d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR11MB1618:EE_|MW3PR11MB4730:EE_ X-MS-Office365-Filtering-Correlation-Id: d658af6f-6171-4e0d-2526-08dad38a8b99 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yx413w5RSSpCmagL7V+2JNJVpFYm+oFzwzIts4Li+3sdPT6prtxDss6FO1Lmt5T8VnLC4caMTZeZRERIcvTFZCnxIm/Kkoyyt1kXMganvGKwqomJL+5F/WhEV80BU0I2BOe6zEukmLtrBmWbHOVduIZho3NrGSD0D5l1EbB2B0o51LVu1a53Djqz/4hMsqEK59s6D0gPek5NNCmhKtdCQTyXFGZlJNArwu/ssfp6JNG98vVZd8aifvrUy73DCpIFFC+YgXcsBYpsvjmffM5W/QPFehrTdEIQieiSF/14v4vLe0uk3Uu4/eZOLQmLpBS+JnGVGHoVMexeI6JjkfT64Me9IXdVrSqc66xPitz+tO7ftWg6TVFK/c2ZVrcYna6FrzDfOqZUzhSmtCMojDvTgU8gQjsj3JsP53cdJNK2t3HTwOKKa47y0PC7PN39ZzhxvHNrhqaxHeHC5ZrGjt9/YWJoRJPMV49MHZq0oVEZLJ3f6vYNzq9EVuD++Vi90HxOyNrRppF/7uHkPXIu+LntNoI2vJf5RKhaTcjRf3euybUabCsUEvTIX6Ual1JILmbiZRbs9CjroHoReK1/i1xrjPihutow4z0a6MVfMF7cfHMD98+elDLPxoZooj8MfqLr1/8o+spHUhzKkARv6I+qYA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB1618.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(376002)(136003)(366004)(346002)(39860400002)(451199015)(86362001)(54906003)(6916009)(316002)(6486002)(45080400002)(44832011)(478600001)(8676002)(66946007)(4326008)(66476007)(8936002)(5660300002)(41300700001)(66556008)(83380400001)(82960400001)(38100700002)(6512007)(2906002)(186003)(6666004)(26005)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9QqUcTCzBr4ldbaD7ufMeZtFpb1k9WWQMYPMDjHv01a1ZEjB7LgzuDNnSTjK?= =?us-ascii?Q?cq8igaHrJ7QmOBneX44rCSyMp2ZhWBiZ/ydjTc2M3I9W0YhWFOzRYv7j9zNu?= =?us-ascii?Q?dhZXKDSqCJbEm3CJGVytDDDJ+LMEw7qCRsdzDrpVkSc2M4X4dZ0EDXhit317?= =?us-ascii?Q?jXSWiF2/OrS57gC2WPyIiAedZz1jsi+CqySLPZn7hA/IpsuGu0P4bu5B6S0L?= =?us-ascii?Q?qeYVpdPp9tZRqdijn6vBgNbvYCwcmUnovWHRYaX10JXzzpqftFgJAc0uynR0?= =?us-ascii?Q?o2PsZouQZr7C/pk2FjD++CGT/DgSFr4JPujZhzuqS6ltsVa2xxny0Oe+zl8r?= =?us-ascii?Q?lsmh1rUgFeSvGgzXkT0q7jO+5mmoKbXjWd+dvgKmDtJ574PB1RH5mZ5Jt7Ai?= =?us-ascii?Q?0QuwcBhuYeAj7jlPIhRkeDx5NOVIS8Lxjra7XdrZirqa90URNT2FXOC7bZo6?= =?us-ascii?Q?7vqHwiRRmel1qNyGFowaxQUhi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-ascii?Q?EETRcLF0zR+PHHH7gje+2+Kmpc5DqeOzdx/8UdgqQ+3LQ1ooWPHlOqslL0g1?= =?us-ascii?Q?IJ75qMoNKXAzzW8Wb4V0zgc8krhmaT1kRjE+H/mIcAefBzGhY7J9ZEC4r8tl?= =?us-ascii?Q?4lAcrOQ9Fg3GaXuWP/Kc+/1tsmQvrHVfgAoSiSnuvXqAq3Qkq79ndt5B6qXE?= =?us-ascii?Q?p6SPXEUXCOcs9Vu5ILla9P2u2BXd3FUsJzHuroFa8Ngc1dKAiB5HW6sORdZO?= =?us-ascii?Q?OA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d658af6f-6171-4e0d-2526-08dad38a8b99 X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1618.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2022 10:55:24.0800 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 39TJvfUYVhsnZQ8WPRKBxV6ee4d85CNA3AkrGELEkutHwpRq48VJaMoizQh9pyL1Dl9/0iC4rmEvP3Ur6/d1uYprxvXLEd7ujY5m0dCdi6M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4730 X-OriginatorOrg: intel.com 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 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. > + else > + lk_deps += [version_map] > + if not is_windows and developer_mode > + # on unix systems check the output of the > + # check-symbols.sh script, using it as a > + # dependency of the .so build > + lk_deps += custom_target(lib_name + '.sym_chk', > + command: [check_symbols, version_map, '@INPUT@'], > + capture: true, > + input: static_lib, > + output: lib_name + '.sym_chk') > + endif > + endif > + > + 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 += [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=' + version_map] > - if developer_mode > - # on unix systems check the output of the > - # check-symbols.sh script, using it as a > - # dependency of the .so build > - lk_deps += custom_target(lib_name + '.sym_chk', > - command: [check_symbols, version_map, '@INPUT@'], > - capture: true, > - input: static_lib, > - output: lib_name + '.sym_chk') > - endif > + lk_args = ['-Wl,--version-script=' + mingw_map.full_path()] > endif > + else > + lk_args = ['-Wl,--version-script=' + version_map] > endif > > shared_lib = shared_library(lib_name, sources, > diff --git a/drivers/version.map b/drivers/version.map > new file mode 100644 > index 0000000000..78c3585d7c > --- /dev/null > +++ b/drivers/version.map > @@ -0,0 +1,3 @@ > +DPDK_23 { > + local: *; > +}; > -- Reviewed-by: Bruce Richardson