From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: weak functions in some drivers Date: Tue, 21 Jun 2016 17:01:59 +0100 Message-ID: <576964F7.3020804@intel.com> References: <9A518F3E-04B9-4E40-BDDE-B16433A21BF9@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: "Damjan Marion (damarion)" , "dev@dpdk.org" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5840BC31E for ; Tue, 21 Jun 2016 18:02:05 +0200 (CEST) In-Reply-To: <9A518F3E-04B9-4E40-BDDE-B16433A21BF9@cisco.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Damjan, On 6/21/2016 4:01 PM, Damjan Marion (damarion) wrote: >=20 > Hello, >=20 > We just spent few hours troubleshooting why vPMD is not working > in i40e driver. Conclusion was that problem is caused by linker=20 > linking the wrong instance of the i40e_rx_vec_dev_conf_condition_check(= ...). >=20 > That function is defined 2 times, once in i40e_rxtx.c and once in=20 > i40e_rxtx_vec.c. First one is defined as weak and it just returns -1. >=20 > librte_pmd_i40e.a contains both versions: >=20 > $ objdump -x librte_pmd_i40e.a| grep i40e_rx_vec_dev_conf_condition_che= ck > 0000000000006ca0 w F .text 0000000000000006 i40e_rx_vec_dev_conf_co= ndition_check > 00000000000007c1 g F .text.unlikely 000000000000001c i40e_rx_vec_de= v_conf_condition_check >=20 > However when we are linking our app, linker was picking 1st (weak) one = and vPMD init was failing. App is linking with correct instance of the function for me, how can I reproduce this linkage issue? >=20 > Workaround we applied to get int working: -Wl,--whole-archive -= Wl,=E2=80=94no-whole-archive These flags already wraps PMD libraries, can you please give more detail about workaround? Thanks, ferruh