Add hidden aliases for exported symbols which are used internally in order

Tue Aug 10 23:53:59 2004  Matthias Clasen  <maclas@gmx.de>

	Add hidden aliases for exported symbols which are
	used internally in order to get rid of many PLT
	entries.  (#145519, Arjan van de Ven)

	* gdk/Makefile.am: Add rules to generate gdk_pixbuf.def and
	gdk-pixbuf-alias.h from gdk-pixbuf.symbols, and make make
	check check the abi with abicheck.sh.

	* gdk/gdk-pixbuf.symbols: New file. Definition of the gdk-pixbuf
	ABI. The file can be processed by cpp to filter out certain
	subsets of symbols.

	* gdk/abicheck.sh: New file. Script to check the actually
	symbols exported from libgdk_pibuf.2.0.so against the symbols
	found in gdk-pixbuf.symbols.

	* gdk/makegdkpixbufalias.pl: New file. Perl script to generate the
	header containing the alias definitions for internally used
	exported symbols from a list of symbols.

	* *.c: Include gdk-pixbuf-alias.h
This commit is contained in:
Matthias Clasen 2004-08-11 04:10:18 +00:00 committed by Matthias Clasen
parent 4a465af574
commit f4437de139
14 changed files with 222 additions and 96 deletions

View File

@ -1,3 +1,27 @@
Tue Aug 10 23:53:59 2004 Matthias Clasen <maclas@gmx.de>
Add hidden aliases for exported symbols which are
used internally in order to get rid of many PLT
entries. (#145519, Arjan van de Ven)
* gdk/Makefile.am: Add rules to generate gdk_pixbuf.def and
gdk-pixbuf-alias.h from gdk-pixbuf.symbols, and make make
check check the abi with abicheck.sh.
* gdk/gdk-pixbuf.symbols: New file. Definition of the gdk-pixbuf
ABI. The file can be processed by cpp to filter out certain
subsets of symbols.
* gdk/abicheck.sh: New file. Script to check the actually
symbols exported from libgdk_pibuf.2.0.so against the symbols
found in gdk-pixbuf.symbols.
* gdk/makegdkpixbufalias.pl: New file. Perl script to generate the
header containing the alias definitions for internally used
exported symbols from a list of symbols.
* *.c: Include gdk-pixbuf-alias.h
2004-08-06 Hans Breuer <hans@breuer.org>
* gdk_pixbuf.def makefile.msc : updated

View File

@ -39,6 +39,16 @@ install-ms-lib:
uninstall-ms-lib:
endif
gdk_pixbuf.def: gdk-pixbuf.symbols
(echo -e EXPORTS; cpp -P -DINCLUDE_VARIABLES gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/\t/') > gdk_pixbuf.def
gdk-pixbuf-alias.h: gdk-pixbuf.symbols
cpp -P -DINCLUDE_INTERNAL_SYMBOLS gdk-pixbuf.symbols | ./makegdkpixbufalias.pl > gdk-pixbuf-alias.h
if OS_UNIX
TESTS = abicheck.sh
endif
lib_LTLIBRARIES = \
libgdk_pixbuf-2.0.la
@ -325,16 +335,23 @@ libgdk_pixbufinclude_HEADERS = \
gdk-pixdata.h
noinst_HEADERS = \
gdk-pixbuf-alias.h \
gdk-pixbuf-private.h
BUILT_SOURCES = gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.c \
gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c
BUILT_SOURCES = \
gdk-pixbuf-alias.h \
gdk-pixbuf-enum-types.h \
gdk-pixbuf-enum-types.c \
gdk-pixbuf-marshal.h \
gdk-pixbuf-marshal.c
CLEANFILES =
MAINTAINERCLEANFILES = \
gdk-pixbuf-enum-types.h gdk-pixbuf-enum-types.c \
gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c \
gdk-pixbuf.loaders
MAINTAINERCLEANFILES = \
gdk-pixbuf-enum-types.h \
gdk-pixbuf-enum-types.c \
gdk-pixbuf-marshal.h \
gdk-pixbuf-marshal.c \
gdk-pixbuf.loaders
#
# gdk-pixbuf-enum-types.h
@ -361,7 +378,7 @@ MAINTAINERCLEANFILES += s-enum-types-h
#
gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile
(cd $(srcdir) && glib-mkenums \
--fhead "#include <gdk-pixbuf/gdk-pixbuf.h>" \
--fhead "#include \"gdk-pixbuf-alias.h\"\n#include <gdk-pixbuf/gdk-pixbuf.h>" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
@ -387,7 +404,7 @@ MAINTAINERCLEANFILES += stamp-gdk-pixbuf-marshal.h
# gdk-pixbuf-marshal.c
#
$(srcdir)/gdk-pixbuf-marshal.c: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
$(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body >> xgen-gmc \
(echo -e "#include \"gdk-pixbuf-alias.h\"" | $(GLIB_GENMARSHAL) --prefix=gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body ) >> xgen-gmc \
&& cp xgen-gmc gdk-pixbuf-marshal.c \
&& rm -f xgen-gmc xgen-gmc~
@ -403,6 +420,9 @@ distclean-local:
EXTRA_DIST = \
gdk-pixbuf-csource.1 \
makefile.msc \
gdk-pixbuf.symbols \
makegdkpixbufalias.pl \
abicheck.sh \
gdk_pixbuf.def \
gdk_pixbuf.rc \
gdk-pixbuf-marshal.c \

5
gdk-pixbuf/abicheck.sh Executable file
View File

@ -0,0 +1,5 @@
#! /bin/sh
cpp -P -DINCLUDE_INTERNAL_SYMBOLS -DINCLUDE_MMX_SYMBOLS gdk-pixbuf.symbols | sed -e '/^$/d' | sort > expected-abi
nm -D .libs/libgdk_pixbuf-2.0.so | grep " T " | cut -c12- | grep "^\(gdk\|pixops\)_" | sort > actual-abi
diff -u expected-abi actual-abi

View File

@ -24,6 +24,7 @@
#include <config.h>
#include <errno.h>
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-i18n.h"

View File

@ -21,6 +21,7 @@
*/
#include <config.h>
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-private.h"
#include <stdlib.h>

View File

@ -33,6 +33,7 @@
#include <unistd.h>
#endif
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"

View File

@ -27,6 +27,7 @@
#include <config.h>
#include <string.h>
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-animation.h"
#include "gdk-pixbuf-io.h"

View File

@ -23,6 +23,7 @@
#include <config.h>
#include <math.h>
#include <string.h>
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf-private.h"
#include "pixops/pixops.h"

View File

@ -22,6 +22,7 @@
*/
#include <config.h>
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf-private.h"
#include <string.h>

View File

@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h>
#define GDK_PIXBUF_COMPILATION
#include "gdk-pixbuf-alias.h"
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-private.h"

View File

@ -0,0 +1,101 @@
gdk_colorspace_get_type
gdk_interp_type_get_type
gdk_pixbuf_add_alpha
gdk_pixbuf_alpha_mode_get_type
gdk_pixbuf_animation_get_height
gdk_pixbuf_animation_get_iter
gdk_pixbuf_animation_get_static_image
gdk_pixbuf_animation_get_type
gdk_pixbuf_animation_get_width
gdk_pixbuf_animation_is_static_image
gdk_pixbuf_animation_iter_advance
gdk_pixbuf_animation_iter_get_delay_time
gdk_pixbuf_animation_iter_get_pixbuf
gdk_pixbuf_animation_iter_get_type
gdk_pixbuf_animation_iter_on_currently_loading_frame
gdk_pixbuf_animation_new_from_file
gdk_pixbuf_animation_ref
gdk_pixbuf_animation_unref
gdk_pixbuf_composite
gdk_pixbuf_composite_color
gdk_pixbuf_composite_color_simple
gdk_pixbuf_copy
gdk_pixbuf_copy_area
gdk_pixbuf_error_get_type
gdk_pixbuf_error_quark
gdk_pixbuf_fill
gdk_pixbuf_flip
gdk_pixbuf_format_get_description
gdk_pixbuf_format_get_extensions
gdk_pixbuf_format_get_license
gdk_pixbuf_format_get_mime_types
gdk_pixbuf_format_get_name
gdk_pixbuf_format_is_disabled
gdk_pixbuf_format_is_scalable
gdk_pixbuf_format_is_writable
gdk_pixbuf_format_set_disabled
gdk_pixbuf_from_pixdata
gdk_pixbuf_get_bits_per_sample
gdk_pixbuf_get_colorspace
gdk_pixbuf_get_file_info
gdk_pixbuf_get_formats
gdk_pixbuf_get_has_alpha
gdk_pixbuf_get_height
gdk_pixbuf_get_n_channels
gdk_pixbuf_get_option
gdk_pixbuf_get_pixels
gdk_pixbuf_get_rowstride
gdk_pixbuf_get_type
gdk_pixbuf_get_width
gdk_pixbuf_loader_close
gdk_pixbuf_loader_get_animation
gdk_pixbuf_loader_get_format
gdk_pixbuf_loader_get_pixbuf
gdk_pixbuf_loader_get_type
gdk_pixbuf_loader_new
gdk_pixbuf_loader_new_with_mime_type
gdk_pixbuf_loader_new_with_type
gdk_pixbuf_loader_set_size
gdk_pixbuf_loader_write
#ifdef INCLUDE_INTERNAL_SYMBOLS
gdk_pixbuf_marshal_VOID__INT_INT
gdk_pixbuf_marshal_VOID__INT_INT_INT_INT
#endif
gdk_pixbuf_new
gdk_pixbuf_new_from_data
gdk_pixbuf_new_from_file
gdk_pixbuf_new_from_file_at_size
gdk_pixbuf_new_from_inline
gdk_pixbuf_new_from_xpm_data
gdk_pixbuf_new_subpixbuf
gdk_pixbuf_non_anim_new
gdk_pixbuf_ref
gdk_pixbuf_rotate_simple
gdk_pixbuf_rotation_get_type
gdk_pixbuf_saturate_and_pixelate
gdk_pixbuf_save
gdk_pixbuf_save_to_buffer
gdk_pixbuf_save_to_bufferv
gdk_pixbuf_save_to_callback
gdk_pixbuf_save_to_callbackv
gdk_pixbuf_savev
gdk_pixbuf_scale
gdk_pixbuf_scale_simple
gdk_pixbuf_set_option
gdk_pixbuf_unref
#ifdef INCLUDE_VARIABLES
gdk_pixbuf_major_version
gdk_pixbuf_micro_version
gdk_pixbuf_minor_version
gdk_pixbuf_version
#endif
gdk_pixdata_deserialize
gdk_pixdata_from_pixbuf
gdk_pixdata_serialize
gdk_pixdata_to_csource
#ifdef INCLUDE_MMX_SYMBOLS
pixops_composite_line_22_4a4_mmx
pixops_composite_line_color_22_4a4_mmx
pixops_have_mmx
pixops_scale_line_22_33_mmx
#endif

View File

@ -17,6 +17,7 @@
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include "gdk-pixbuf-alias.h"
#include "gdk-pixdata.h"
#include "gdk-pixbuf-private.h"

View File

@ -1,88 +0,0 @@
EXPORTS
gdk_colorspace_get_type
gdk_interp_type_get_type
gdk_pixbuf_add_alpha
gdk_pixbuf_alpha_mode_get_type
gdk_pixbuf_animation_get_height
gdk_pixbuf_animation_get_iter
gdk_pixbuf_animation_get_static_image
gdk_pixbuf_animation_get_type
gdk_pixbuf_animation_get_width
gdk_pixbuf_animation_is_static_image
gdk_pixbuf_animation_iter_advance
gdk_pixbuf_animation_iter_get_delay_time
gdk_pixbuf_animation_iter_get_pixbuf
gdk_pixbuf_animation_iter_get_type
gdk_pixbuf_animation_iter_on_currently_loading_frame
gdk_pixbuf_animation_new_from_file
gdk_pixbuf_animation_ref
gdk_pixbuf_animation_unref
gdk_pixbuf_composite
gdk_pixbuf_composite_color
gdk_pixbuf_composite_color_simple
gdk_pixbuf_copy
gdk_pixbuf_copy_area
gdk_pixbuf_error_get_type
gdk_pixbuf_error_quark
gdk_pixbuf_fill
gdk_pixbuf_flip
gdk_pixbuf_format_get_description
gdk_pixbuf_format_get_extensions
gdk_pixbuf_format_get_mime_types
gdk_pixbuf_format_get_name
gdk_pixbuf_format_is_scalable
gdk_pixbuf_format_is_writable
gdk_pixbuf_from_pixdata
gdk_pixbuf_get_bits_per_sample
gdk_pixbuf_get_colorspace
gdk_pixbuf_get_file_info
gdk_pixbuf_get_formats
gdk_pixbuf_get_has_alpha
gdk_pixbuf_get_height
gdk_pixbuf_get_n_channels
gdk_pixbuf_get_option
gdk_pixbuf_get_pixels
gdk_pixbuf_get_rowstride
gdk_pixbuf_get_type
gdk_pixbuf_get_width
gdk_pixbuf_loader_close
gdk_pixbuf_loader_get_animation
gdk_pixbuf_loader_get_format
gdk_pixbuf_loader_get_pixbuf
gdk_pixbuf_loader_get_type
gdk_pixbuf_loader_new
gdk_pixbuf_loader_new_with_mime_type
gdk_pixbuf_loader_new_with_type
gdk_pixbuf_loader_set_size
gdk_pixbuf_loader_write
gdk_pixbuf_major_version
gdk_pixbuf_micro_version
gdk_pixbuf_minor_version
gdk_pixbuf_new
gdk_pixbuf_new_from_data
gdk_pixbuf_new_from_file
gdk_pixbuf_new_from_file_at_size
gdk_pixbuf_new_from_inline
gdk_pixbuf_new_from_xpm_data
gdk_pixbuf_new_subpixbuf
gdk_pixbuf_non_anim_new
gdk_pixbuf_ref
gdk_pixbuf_rotate_simple
gdk_pixbuf_rotation_get_type
gdk_pixbuf_saturate_and_pixelate
gdk_pixbuf_save
gdk_pixbuf_save_to_buffer
gdk_pixbuf_save_to_bufferv
gdk_pixbuf_save_to_callback
gdk_pixbuf_save_to_callbackv
gdk_pixbuf_savev
gdk_pixbuf_scale
gdk_pixbuf_scale_simple
gdk_pixbuf_set_option
gdk_pixbuf_unref
gdk_pixbuf_version
gdk_pixdata_deserialize
gdk_pixdata_from_pixbuf
gdk_pixdata_serialize
gdk_pixdata_to_csource

View File

@ -0,0 +1,56 @@
#!/usr/bin/perl -w
print <<EOF;
/* Generated by makegdkpixbufalias.pl */
#include <glib.h>
#ifdef G_HAVE_GNUC_VISIBILITY
#ifdef GDK_PIXBUF_DISABLE_DEPRECATED
#define WAS_NO_DEPR
#endif
#undef GDK_PIXBUF_DISABLE_DEPRECATED
#ifdef G_DISABLE_DEPRECATED
#define WAS_NO_G_DEPR
#endif
#undef G_DISABLE_DEPRECATED
#include "gdk-pixbuf.h"
#include "gdk-pixdata.h"
#include "gdk-pixbuf-marshal.h"
EOF
while (<>) {
# ignore empty lines
next if /^\s*$/;
my $str = $_;
chomp($str);
my $alias = $str."__internal_alias";
print "extern __typeof ($str) $alias __attribute((visibility(\"hidden\"))); \n";
print "extern __typeof ($str) $str __attribute((alias(\"$alias\"), visibility(\"default\"))); \n";
print "#define $str $alias \n";
print "\n";
}
print <<EOF;
#ifdef WAS_NO_DEPR
#define GDK_PIXBUF_DISABLE_DEPRECATED
#undef WAS_NO_DEPR
#endif
#ifdef WAS_NO_G_DEPR
#define G_DISABLE_DEPRECATED
#undef WAS_NO_G_DEPR
#endif
#endif /* G_HAVE_GNUC_VISIBILITY */
EOF