On Thu, Jan 9, 2020 at 3:13 PM Thomas Monjalon <tho...@monjalon.net> wrote:
>
> 02/12/2019 16:20, David Marchand:
> > So far, we did not pay attention to direct access to variables but they
> > are part of the API/ABI too and should be clearly identified.
> >
> > Introduce a __rte_experimental_var tag and mark existing exported
> > variables.
> >
> > Fixes: a4bcd61de82d ("buildtools: add script to check experimental API 
> > exports")
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: David Marchand <david.march...@redhat.com>
> > ---
> > +     elif grep -qe "\(\.data\|\*COM\*\).*[[:space:]]$SYM$" $DUMPFILE &&
> > +             ! grep -q "\.data\.experimental.*[[:space:]]$SYM$" $DUMPFILE
>
> I like such regex ;)

Err.. thanks?


> I don't know COM section but I am not an ELF expert.

I am no ELF expert either.

IIUC, this section is a special one used when generating object files
for common symbols but the compiler is not sure where the actual
symbol should go.
It is then resolved as .data or .bss when linking.


> Maybe you can just add a comment in the commit log about searching
> the symbol in .data and COM sections, even if we don't know exactly why.

Actually, this is a good thing you asked about it.
I did a new check before/after the series.

Example for rte_net_ice_dynflag_proto_xtr_vlan_mask.

Before:
/home/dmarchan/builds/build-gcc-shared/drivers/a715181@@tmp_rte_pmd_ice@sta/net_ice_ice_rxtx.c.o
0000000000000008       O *COM*    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/a715181@@tmp_rte_pmd_ice@sta/net_ice_ice_ethdev.c.o
0000000000000000         *UND*    0000000000000000
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/libtmp_rte_pmd_ice.a
0000000000000000         *UND*    0000000000000000
rte_net_ice_dynflag_proto_xtr_vlan_mask
0000000000000008       O *COM*    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/librte_pmd_ice.a
0000000000000000         *UND*    0000000000000000
rte_net_ice_dynflag_proto_xtr_vlan_mask
0000000000000008       O *COM*    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/librte_pmd_ice.so.20.0.1
0000000000063890 g     O .bss    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask

After:
/home/dmarchan/builds/build-gcc-shared/drivers/a715181@@tmp_rte_pmd_ice@sta/net_ice_ice_rxtx.c.o
0000000000000020 g     O .data.experimental    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/a715181@@tmp_rte_pmd_ice@sta/net_ice_ice_ethdev.c.o
0000000000000000         *UND*    0000000000000000
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/libtmp_rte_pmd_ice.a
0000000000000000         *UND*    0000000000000000
rte_net_ice_dynflag_proto_xtr_vlan_mask
0000000000000020 g     O .data.experimental    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/librte_pmd_ice.a
0000000000000000         *UND*    0000000000000000
rte_net_ice_dynflag_proto_xtr_vlan_mask
0000000000000020 g     O .data.experimental    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask
/home/dmarchan/builds/build-gcc-shared/drivers/librte_pmd_ice.so.20.0.1
00000000000604f0 g     O .data    0000000000000008
rte_net_ice_dynflag_proto_xtr_vlan_mask

The thing that scares me is that the final symbol gets moved from .bss
to .data in the .so.


Neil?


--
David Marchand

Reply via email to