[gst-devel] saving relocation entries

Stefan Kost ensonic at hora-obscura.de
Mon May 14 12:21:17 CEST 2007


time for an update. For the clarification (JMPREL) and (REL) are  
section addresses and not sizes. The gst_type_register_static_full()  
is a full win, here the summary for libgstcoreelements.so


I now also applied the GstElementDetails change to all elements in  
libgstcoreelements.so, previously there was a small size increment,  
because the use of both gst_element_class_set_details() and  
gst_element_class_set_details_simple(). Now the result summary is the  


There is quite some saving on the relocs as expected. the thing I  
don't understand is that the resulting new binary is 1664 bytes  
bigger. If I use readelf -S and sum up the section-sizes the new  
version is 533 bytes shorter.

I am not that much concerned about +/-1kbyte, the saved relocs are  
more important, but I am curios and would like to understand where it  
comes from.


Quoting Stefan Kost <ensonic at hora-obscura.de>:

> hi,
> after reading
> http://people.redhat.com/drepper/dsohowto.pdf
> and studying the gobject change described here
> http://bugzilla.gnome.org/show_bug.cgi?id=337058
> I did something simillar for gstreamer. First I added
> gst_type_register_static_full() to utils.c and change GST_BOILERPLATE
> macro to use it. This is the before and after for the coreelements
> $ readelf -d /usr/lib/gstreamer-0.10/libgstcoreelements.so  | grep REL
>   0x00000002 (PLTRELSZ)                   1912 (bytes)
>   0x00000014 (PLTREL)                     REL
>   0x00000017 (JMPREL)                     0x3550
>   0x00000011 (REL)                        0x2e38
>   0x00000012 (RELSZ)                      1816 (bytes)
>   0x00000013 (RELENT)                     8 (bytes)
>   0x6ffffffa (RELCOUNT)                   214
> $ readelf -d /usr/lib/gstreamer-0.10/libgstcoreelements.so  | grep REL
>   0x00000002 (PLTRELSZ)                   1920 (bytes)
>   0x00000014 (PLTREL)                     REL
>   0x00000017 (JMPREL)                     0x344c
>   0x00000011 (REL)                        0x2e6c
>   0x00000012 (RELSZ)                      1504 (bytes)
>   0x00000013 (RELENT)                     8 (bytes)
>   0x6ffffffa (RELCOUNT)                   175
> So its saves 39 relocations there (should be 48, need to check).
> The same scheme can be initialized to other datastructures like e.g.
> GstElementDetails (see
> http://bugzilla.gnome.org/show_bug.cgi?id=437457). What do you think?
> Next I will do the same for Interfaces and proprose
> g_type_register_static_full(), g_type_add_interface_static_simple|full().
> Ciao
>    Stefan
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

More information about the gstreamer-devel mailing list