From efb901c11e4c00c877123018c63b776fd63333c8 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Aug 16 2005 20:51:30 +0000 Subject: - Patch abicheck to run dynamic linker directly instead of using ldd and receiving its intermixed lines. --- diff --git a/abicheck-1.2-ldlinux.patch b/abicheck-1.2-ldlinux.patch new file mode 100644 index 0000000..963daf2 --- /dev/null +++ b/abicheck-1.2-ldlinux.patch @@ -0,0 +1,53 @@ +diff -Nur abicheck-1.2-orig/abicheck.pl abicheck-1.2/abicheck.pl +--- abicheck-1.2-orig/abicheck.pl 2003-08-26 21:57:51.000000000 +0200 ++++ abicheck-1.2/abicheck.pl 2005-08-16 22:49:06.000000000 +0200 +@@ -496,7 +496,7 @@ + + if ( ! $pid ) { + # child here, go run ldd -r with debug env: +- exec_ldd($file); ++ exec_ldd($file,$file0); + exit 1; + } + +@@ -1241,7 +1241,7 @@ + # will read command output. + # + sub exec_ldd { +- my ($file) = @_; ++ my ($file,$file0) = @_; + + open(STDERR, ">&STDOUT"); + # need to close stdin on linux for some suid programs e.g. chsh (!) +@@ -1251,10 +1251,27 @@ + $ENV{LD_LIBRARY_PATH} = $ld_path; + } + +- # currently, no difference between OSs +- $ENV{LD_DEBUG} = "files,bindings"; +- exec 'ldd', '-r', $file; +- exit 1; # exec failed ++ my $ldlinux = ''; ++ open(DLFIND,"ldd $file0 |") or die "open: ldd: $!"; ++ while () { ++ /ld-linux/ and /(\S+)/ and $ldlinux = $1; ++ } ++ close(DLFIND); ++ if ( $ldlinux =~ /^$/ ) { ++ # currently, no difference between OSs ++ $ENV{LD_DEBUG} = "files,bindings"; ++ exec 'ldd', '-r', $file; ++ exit 1; # exec failed ++ } ++ else { ++ $ENV{LD_DEBUG} = "files,bindings"; ++ $ENV{LD_VERBOSE} = "yes"; ++ $ENV{LD_WARN} = "yes"; ++ $ENV{LD_BIND_NOW} = "yes"; ++ $ENV{LD_TRACE_LOADED_OBJECTS} = "1"; ++ exec $ldlinux, $file0; ++ exit 1; # exec failed ++ } + } + + # diff --git a/abicheck.spec b/abicheck.spec index 6296b77..677c1ae 100644 --- a/abicheck.spec +++ b/abicheck.spec @@ -3,7 +3,7 @@ Summary: ABI checking tool Name: abicheck Version: 1.2 -Release: 8 +Release: 9 License: LGPL Group: Applications/File URL: http://abicheck.sourceforge.net/ @@ -13,6 +13,7 @@ Patch1: abicheck-1.2-test-static.patch Patch2: abicheck-1.2-bindings-fc4.patch Patch3: abicheck-1.2-libgcc.patch Patch4: abicheck-1.2-fortify-source-fc5.patch +Patch5: abicheck-1.2-ldlinux.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Requires: binutils perl @@ -30,6 +31,7 @@ Binary Interface). %patch2 -p1 -b .bindings-fc4 %patch3 -p1 -b .libgcc %patch4 -p1 -b .fortify-source-fc5 +%patch5 -p1 -b .ldlinux sed -i -e 's!/usr/lib/!%{_libdir}/!g' test/Makefile @@ -45,7 +47,6 @@ install -p -m 0644 abicheck.1 $RPM_BUILD_ROOT%{_mandir}/man1 %check -cd test make test @@ -61,6 +62,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Aug 16 2005 Michael Schwendt - 1.2-9 +- Patch abicheck to run dynamic linker directly instead of + using ldd and receiving its intermixed lines. + * Mon Aug 15 2005 Michael Schwendt - 1.2-8 - Add libgcc symbols. - Add more _FORTIFY_SOURCE symbols.