ports/163116: [PATCH] devel/libtar: text relocations in .so on i386
jilles at stack.nl
Wed Dec 7 22:30:10 UTC 2011
>Synopsis: [PATCH] devel/libtar: text relocations in .so on i386
>Arrival-Date: Wed Dec 07 22:30:09 UTC 2011
>Originator: Jilles Tjoelker
>Release: FreeBSD 8.2-STABLE i386
The FreeBSD Project
The library libtar.so.0 has text relocations, meaning relocations
in the program code that should be read-only. Text relocations cause
unnecessary load on the VM system and may affect security negatively.
There is a DT_TEXTREL entry:
% objdump -p /usr/local/lib/libtar.so.0 | grep TEXTREL
There are many relocations in the text segment (mostly R_386_PC32 on i386):
% objdump -R /usr/local/lib/libtar.so.0 | less
It is expected on i386 to have mainly R_386_RELATIVE, R_386_GLOB_DAT and
R_386_JUMP_SLOT relocations plus some R_386_32.
The build process generates libtar.so.0 from objects that were not
compiled with -fPIC. The below patch adds this.
While it works to add non-PIC objects to a shared object on i386
(different from amd64 where it does not work), this is not a good idea.
--- devel-libtar-fix-i386-textrel.patch begins here ---
--- ports/devel/libtar/Makefile.orig 2011-09-24 00:22:07.000000000 +0200
+++ ports/devel/libtar/Makefile 2011-12-07 23:14:20.000000000 +0100
@@ -25,8 +25,6 @@
--- devel-libtar-fix-i386-textrel.patch ends here ---
More information about the freebsd-ports-bugs