piątek, 28 grudnia 2012

linking and optimization

Some info regarding shared libraries and link optimization (just not to forget).

Command to check library's specific headers, e.g. library "soname" and required library and their versions:
objdump -p libXXX.so

To display exported symbols:
nm -g -D -C --defined-only libXXX.so

Some makefile macros to create shared library:
LIB_LINKER_NAME := libXXX.so
LIB_VERSION_MAJOR := 1
LIB_VERSION_MINOR := 1
LIB_SONAME_NAME := $(LIB_LINKER_NAME).$(LIB_VERSION_MAJOR)
LIB_REAL_NAME := $(LIB_SONAME_NAME).$(LIB_VERSION_MINOR)
$(CC) -shared -o $(LIB_REAL_NAME) $(OBJ) -L$(LIB_DIR) $(LIBS) -Wl,-soname=$(LIB_SONAME_NAME) -Wl,--version-script=XXX.expmap


Export map file for shared library:
XXX.expmap:
{
  global:
    fun1;
    fun2;

  local:
    *;
};


References
http://www.akkadia.org/drepper/dsohowto.pdf
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
http://mail-index.netbsd.org/tech-toolchain/1998/07/17/0000.html
wiki.linuxquestions.org/wiki/Library-related_Commands_and_Files
http://www.oracle.com/technetwork/articles/servers-storage-dev/linkinglibraries-396782.html
http://www.shrubbery.net/solaris9ab/SUNWdev/LLM/p17.html
http://www.iecc.com/linker/linker10.html
http://accu.org/index.php/journals/1372
http://www.sco.com/developers/devspecs/gabi41.pdf

Reference regarding ldconfig and embedded doubts
http://sourceware.org/ml/crossgcc/2008-11/msg00001.html

References regarding prelinking
www.mvista.com/download/vision08/Strategies-to-improve-embedded-Linux-application-performance-Vision2008.pdf
http://www.sourceware.org/ml/binutils/2006-06/msg00418.html
http://people.redhat.com/jakub/prelink.pdf
http://lwn.net/Articles/341244/

Brak komentarzy:

Prześlij komentarz