|
From: John R. <jr...@bi...> - 2017-09-22 05:24:15
|
What is the purpose of the bits DF_1_INTERPOSE and DF_1_INITFIRST that are set in
the DT_FLAGS_1 word of the Dynamic section of files
$PREFIX/lib/valgrind/vgpreload_$TOOL-$ARCH-linux.so
for which the ultimate source is:
$ grep -e -z, Makefile*
Makefile.all.am:PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst
Makefile.all.am:PRELOAD_LDFLAGS_COMMON_SOLARIS = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst
Makefile.tool.am:TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack
Which particular symbols are those flags designed to affect?
It seems to me that there are no symbols whose resolution changes
because the flags are present, and that it would be a bug if there were
any such symbols at all.
The symbols of valgrind and its tools never should mix with
the symbols of the target program that a valgrind tool is analyzing.
Therefore those -z flags should be omitted.
This would help usage on other platforms of the same $ARCH
(such as building valgrind for Linux and using it also for Android programs),
where other ldso do not understand INTERPOSE.
--
John
|
|
From: Ivo R. <iv...@iv...> - 2017-09-22 08:33:23
|
2017-09-22 7:24 GMT+02:00 John Reiser <jr...@bi...>: > What is the purpose of the bits DF_1_INTERPOSE and DF_1_INITFIRST that are > set in > the DT_FLAGS_1 word of the Dynamic section of files > $PREFIX/lib/valgrind/vgpreload_$TOOL-$ARCH-linux.so > for which the ultimate source is: > $ grep -e -z, Makefile* > Makefile.all.am:PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared > -Wl,-z,interpose,-z,initfirst > Makefile.all.am:PRELOAD_LDFLAGS_COMMON_SOLARIS = -nodefaultlibs -shared > -Wl,-z,interpose,-z,initfirst > Makefile.tool.am:TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack > > Which particular symbols are those flags designed to affect? I can only add that Solaris followed Linux lead here. I tried to remove the -z flags on Solaris and did not observe problems... I. |
|
From: Tom H. <to...@co...> - 2017-09-22 10:09:47
|
On 22/09/17 09:33, Ivo Raisr wrote: > 2017-09-22 7:24 GMT+02:00 John Reiser <jr...@bi...>: >> What is the purpose of the bits DF_1_INTERPOSE and DF_1_INITFIRST that are >> set in >> the DT_FLAGS_1 word of the Dynamic section of files >> $PREFIX/lib/valgrind/vgpreload_$TOOL-$ARCH-linux.so >> for which the ultimate source is: >> $ grep -e -z, Makefile* >> Makefile.all.am:PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared >> -Wl,-z,interpose,-z,initfirst >> Makefile.all.am:PRELOAD_LDFLAGS_COMMON_SOLARIS = -nodefaultlibs -shared >> -Wl,-z,interpose,-z,initfirst >> Makefile.tool.am:TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack >> >> Which particular symbols are those flags designed to affect? > > I can only add that Solaris followed Linux lead here. > I tried to remove the -z flags on Solaris and did not observe problems... They appear to go all the way back to commit 918c3a7b7e0 by Jeremy in 2003 so I suspect the reason for them is long since forgotten... Tom -- Tom Hughes (to...@co...) http://compton.nu/ |