[PATCH 1/2] libfdt: Add version.lds file

David Gibson david at gibson.dropbear.id.au
Wed Nov 26 12:47:53 EST 2008


On Tue, Nov 25, 2008 at 12:16:48PM -0500, Josh Boyer wrote:
> On Tue, Nov 25, 2008 at 11:57:47AM -0500, Josh Boyer wrote:
> >On Tue, Nov 25, 2008 at 10:50:32AM -0600, Jon Loeliger wrote:
> >>> Add the initial symbol versioning file as groundwork for creating
> >>> a libfdt shared library
> >>> 
> >>> Signed-off-by: Josh Boyer <jwboyer at linux.vnet.ibm.com>
> >>> ---
> >>>  libfdt/version.lds |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
> >>>  1 files changed, 48 insertions(+), 0 deletions(-)
> >>>  create mode 100644 libfdt/version.lds
> >>> 
> >>> diff --git a/libfdt/version.lds b/libfdt/version.lds
> >>> new file mode 100644
> >>> index 0000000..7d90672
> >>> --- /dev/null
> >>> +++ b/libfdt/version.lds
> >>> @@ -0,0 +1,48 @@
> >>> +LIBFDT_1.2 {
> >>> +	global:
> >>> +		fdt_next_node;
> >>> +		fdt_check_header;
> >>> +		fdt_move;
> >>> +		fdt_string;
> >>
> >>Oh wow....  Any mechanism for making this a NOT hard-coded list?
> >>Some in-source macro-doo-dad-flag-setup-section-list thing?
> >
> >Yeah, I had the same thought.  I'll look a bit more, but this is what
> >libhugetlbfs is using at the moment.  The only other library I'm
> >remotely familiar with that does versioning is glibc.  Maybe they
> >have magic foo I can steal.
> 
> No really awesome magic.  They have a similar mechanism of having
> a hard-coded list.  We could do something like this in the source
> code:

Not to mention that looking at glibc source tends to make one's eyes
bleed.

> #define fdt_func ver_1_2_fdt_func
> int fdt_func(...) {
> 
> and then this in version.lds:
> 
> LIBFDT_1.2 {
> 	global:
> 		ver_1_2*;
> }
> 
> but that seems pretty ugly too...

I concur

> The hard-coded list is pretty simple, at the risk of missing things.

I'm actually not too wirried about missing things.  If we miss
something, it's pretty easy to fix.  It probably would be a good idea
to make the testsuite build against the shared version of the library
to verify that at least the functions exercised there are correctly
exposed.

I'm marginally more worried about an overbroad wildcard including
something we didn't really want exposed.  I think the versioning
script needs a:
	local:
		*
after the global list to to inhibit exposing everything else.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the devicetree-discuss mailing list