From: Neil Horman <nhorman@tuxdriver.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCHv3 2/3] rte_compat: Add MAP_STATIC_SYMBOL macro
Date: Mon, 29 Jun 2015 09:44:15 -0400 [thread overview]
Message-ID: <20150629134415.GB2177@hmsreliant.think-freely.org> (raw)
In-Reply-To: <2152455.CiuiDMrZSi@xps13>
On Sun, Jun 28, 2015 at 10:13:31PM +0200, Thomas Monjalon wrote:
> 2015-06-26 10:30, Neil Horman:
> > On Fri, Jun 26, 2015 at 02:52:50PM +0200, Thomas Monjalon wrote:
> > > 2015-06-25 10:35, Neil Horman:
> > > > +/*
> > > > + * MAP_STATIC_SYMBOL
> > > > + * If a function has been bifurcated into multiple versions, none of which
> > > > + * are defined as the exported symbol name in the map file, this macro can be
> > > > + * used to alias a specific version of the symbol to its exported name. For
> > > > + * example, if you have 2 versions of a function foo_v1 and foo_v2, where the
> > > > + * former is mapped to foo@DPDK_1 and the latter is mapped to foo@DPDK_2 when
> > > > + * building a shared library, this macro can be used to map either foo_v1 or
> > > > + * foo_v2 to the symbol foo when building a static library, e.g.:
> > > > + * MAP_STATIC_SYMBOL(void foo(), foo_v2);
> > > > + */
> > > > +#define MAP_STATIC_SYMBOL(f, p)
> > > > +
> > > > #else
> > > > /*
> > > > * No symbol versioning in use
> > > > @@ -104,7 +105,7 @@
> > > > #define __vsym
> > > > #define BASE_SYMBOL(b, n)
> > > > #define BIND_DEFAULT_SYMBOL(b, e, n)
> > > > -
> > > > +#define MAP_STATIC_SYMBOL(f, p) f __attribute__((alias( RTE_STR(p))))
> > >
> > > Is it working with clang and icc?
> > No idea. It should work with clang (though I don't have it installed at the
> > moment), as the docs say the .symver directive is supported
> >
> > as for icc, thats out of my control completely, as I don't have any access to
> > it.
> >
> > > Why not just define foo as foo_v2?
> > I'm not sure what you mean here. Are you suggesting that we just change the abi
> > so applications have to call foo_v2 rather than foo when we change the
> > prototype. I suppose we could do that, but that seems like it would be an awful
> > irritant to users. They would rather have a single symbol to call if it does
> > the same function.
> >
> > > As this is the equivalent of BIND_DEFAULT_SYMBOL for the static case,
> > > it would be easier to mix them in only one macro.
> > >
> > Because of where its used. If you use BIND_DEFAULT_SYMBOL to do the work of
> > MAP_STATIC_SYMBOL, every compilation unit will define its own alias and you'll
> > get symbol conflicts.
>
> Oh, you mean it shouldn't be used in a .h file?
> If so, this limitation should be noted in the description above.
>
Its already noted in the example, I'd rather not make a unilateral statement
about where to use it above because there can be cause to use it internally as
well.
> OK for that solution, that's the best we have at the moment.
>
next prev parent reply other threads:[~2015-06-29 13:44 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 19:33 [dpdk-dev] [PATCH 1/2] rte_compat.h : Clean up some typos Neil Horman
2015-06-23 19:33 ` [dpdk-dev] [PATCH 2/2] ABI: Add some documentation Neil Horman
2015-06-24 11:21 ` Mcnamara, John
2015-06-24 11:23 ` [dpdk-dev] [PATCH 1/2] rte_compat.h : Clean up some typos Mcnamara, John
2015-06-24 18:06 ` Neil Horman
2015-06-24 18:34 ` [dpdk-dev] [PATCHv2 " Neil Horman
2015-06-24 18:34 ` [dpdk-dev] [PATCHv2 2/2] ABI: Add some documentation Neil Horman
2015-06-24 21:09 ` Thomas Monjalon
2015-06-25 11:35 ` Neil Horman
2015-06-25 13:22 ` Thomas Monjalon
2015-06-25 7:19 ` Zhang, Helin
2015-06-25 7:42 ` Gonzalez Monroy, Sergio
2015-06-25 8:00 ` Gonzalez Monroy, Sergio
2015-06-25 12:25 ` Neil Horman
2015-06-29 16:35 ` [dpdk-dev] [PATCH] lib: remove redundant definition of local symbols Thomas Monjalon
2015-06-30 15:50 ` Thomas Monjalon
2015-06-24 19:41 ` [dpdk-dev] [PATCHv2 1/2] rte_compat.h : Clean up some typos Thomas Monjalon
2015-06-24 20:15 ` Neil Horman
2015-06-24 20:49 ` Thomas Monjalon
2015-06-25 7:37 ` [dpdk-dev] [PATCH " Gajdzica, MaciejX T
2015-06-25 12:28 ` Neil Horman
2015-06-25 14:35 ` [dpdk-dev] [PATCHv3 1/3] " Neil Horman
2015-06-25 14:35 ` [dpdk-dev] [PATCHv3 2/3] rte_compat: Add MAP_STATIC_SYMBOL macro Neil Horman
2015-06-26 10:13 ` Gajdzica, MaciejX T
2015-06-26 12:52 ` Thomas Monjalon
2015-06-26 14:30 ` Neil Horman
2015-06-28 20:13 ` Thomas Monjalon
2015-06-29 13:44 ` Neil Horman [this message]
2015-06-25 14:35 ` [dpdk-dev] [PATCHv3 3/3] ABI: Add some documentation Neil Horman
2015-06-26 13:00 ` Thomas Monjalon
2015-06-26 14:54 ` Neil Horman
2015-06-28 20:24 ` Thomas Monjalon
2015-06-29 13:53 ` Neil Horman
2015-06-26 12:45 ` [dpdk-dev] [PATCHv3 1/3] rte_compat.h : Clean up some typos Thomas Monjalon
2015-06-29 13:59 ` [dpdk-dev] [PATCHv4 1/4] " Neil Horman
2015-06-29 13:59 ` [dpdk-dev] [PATCHv4 2/4] rte_compat: Add MAP_STATIC_SYMBOL macro Neil Horman
2015-06-29 13:59 ` [dpdk-dev] [PATCHv4 3/4] rte_compat: remove BASE_SYMBOL Neil Horman
2015-06-29 13:59 ` [dpdk-dev] [PATCHv4 4/4] ABI: Add some documentation Neil Horman
2015-06-29 15:07 ` Thomas Monjalon
2015-07-08 9:52 ` [dpdk-dev] [PATCHv4 1/4] rte_compat.h : Clean up some typos Thomas Monjalon
2015-07-08 11:04 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150629134415.GB2177@hmsreliant.think-freely.org \
--to=nhorman@tuxdriver.com \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).