While trying to solve an issue with a game not running in SELinux, I discovered that the libfmod-3.75.so library contains .text relocations (TEXTRELs). This leads to problems when trying to use it in SELinux, since some SELinux policies (such as one used in Fedora Core 5, for example) doesn’t allow textrels in libraries. The result is that programs using FMOD won’t run on these systems (unless the policy is changed). It also results in slower loading of the library on systems where it does run.

Is the FMOD library compiled with position independent code ? If not, enabling that (-fPIC option with gcc) will most likely resolve most of the textrels, probably all of them. Is there any possibility that this could be done ?

You can check for the presence of textrels with readelf or objdump:

$ readelf -d libfmod-3.75.so | grep TEXTREL
0x00000016 (TEXTREL) 0x0

$ objdump -x libfmod-3.75.so | grep TEXTREL

The scanelf utility from gentoo’s [url=http://www.gentoo.org/proj/en/hardened/pax-utils.xml:168pneb2]pax-utils[/url:168pneb2] ([url=http://trumpetti.atm.tut.fi/gentoo/distfiles/pax-utils-0.1.14.tar.bz2:168pneb2]download[/url:168pneb2]) can be used to list more detailed information if PIC doesn’t solve everything, using something like ‘scanelf -T libfmod-3.75.so’. For more info about resolving TEXTRELs, see [url=http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml:168pneb2]this page[/url:168pneb2].

  • Gerry
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.