Library for creating relocatable software
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Initial import Nov 13, 2014
java Initial import Nov 13, 2014
mono Initial import Nov 13, 2014
python
tests Initial import Nov 13, 2014
.gitignore Initial import Nov 13, 2014
CMakeLists.txt Initial import Nov 13, 2014
COPYING.binreloc Initial import Nov 13, 2014
ChangeLog Initial import Nov 13, 2014
Makefile Initial import Nov 13, 2014
README.md Update binreloc docs link Oct 24, 2016
basic.c Initial import Nov 13, 2014
binreloc.m4 Initial import Nov 13, 2014
fdbr-test.c
fdbr.c
generate.pl
glib.c Initial import Nov 13, 2014
normal.c Initial import Nov 13, 2014

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.