Library for creating relocatable software
C Java Perl C# M4 Makefile Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
java
mono
python
tests
.gitignore
CMakeLists.txt
COPYING.binreloc
ChangeLog
Makefile
README.md
basic.c
binreloc.m4
fdbr-test.c
fdbr.c
generate.pl
glib.c
normal.c

README.md

Short description

BinReloc is a Linux library for creating relocatable applications and libraries.

The problem

The Listaller project (http://listaller.tenstral.net) supports relocation. This means that a package can be installed to any location, like how Win32 installers let you choose a directory. However, most applications are not relocatable. The paths where in they search for data files are usually hardcoded at compile time.

On Win32, applications and libraries are easily relocatable because argv[0] is always a full path to the executable. For libraries, the DllMain() DLL initialization function provides a unique DLL handle. One can use that handle to obtain the DLL's full path.

On Linux however, no easy mechanisms exist. argv[0] is not a full path, but equals what the user typed at the command prompt. For executables, you can still find your full location by resolving the symlink /proc/self/exe, but that won't work for libraries.

The solution

This is why BinReloc is created. BinReloc provides an easy-to-use API that uses all kinds of dynamic linker and kernel magic to find out the full path of your executable or library. BinReloc is meant to be included in your project and adds no dependancies that you don't want.

Please go to http://listaller.tenstral.net/docs/chap-Listaller-App-Development.html#sect-Listaller-App-Development-Relocation for a complete guide.