[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: binutils / hardening-wrapper diversion conflict



Hi Matthias,

Matthias Klose wrote:

> 2.20.51.20100418-1 added a diversion for ld.bfd (which is not in
> 2.20.1), this doesn't work well with hardening-wrapper diverting the
> very same binary.

Thanks for the pointer.

> , but if we want to keep it, we probably have to
>
>  - ship ld.bfd.system
>  - make ld.bfd.system a symlink to ld.bfd.system
>  - let binutils-multiarch divert ld.bfd.system
>  - let hardening-wrapper divert ld.bfd
>
> Any thoughts?

If multiarch ld were needed, this would be a good way.  The
upgrade path is tricky.

(The order of events for a binutils-multiarch upgrade would
have to be:

 add ld.bfd.system diversion
 unpack new binutils-multiarch
 remove ld.bfd diversion
 
But then, hardening-wrapper would need to pre-depend on
binutils-multiarch | not-binutils-multiarch.  Yuck.)

> I can't remember why we did want to have the ld
> diversion

I was using it to experiment with linking mips objects on an x86
without using a full cross-toolchain.  It is not very useful
because there is no multiarch cross-assembler to go with it.

I would say, just drop the multiarch ld.  We can add it back
once gas becomes useful with multiple targets, which is probably
a while away still.

Hope that helps,
Jonathan

Untested.

 debian/binutils-multiarch.postinst   |    1 +
 debian/binutils-multiarch.postrm.in  |    1 -
 debian/binutils-multiarch.preinst.in |    1 -
 debian/binutils-multiarch.prerm.in   |    1 +
 debian/changelog                     |    6 ++++++
 debian/rules                         |   10 ++--------
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/debian/binutils-multiarch.postinst b/debian/binutils-multiarch.postinst
index 19965ff..0345fe6 100644
--- a/debian/binutils-multiarch.postinst
+++ b/debian/binutils-multiarch.postinst
@@ -21,6 +21,7 @@ old_diversion() {
 }
 
 # remove obsolete diversions
+old_diversion /usr/bin/ld.bfd
 old_diversion /usr/bin/c++filt
 old_diversion /usr/lib/libbfd.a /usr/lib/libbfd-single.a
 old_diversion /usr/lib/libopcodes.a /usr/lib/libopcodes-single.a
diff --git a/debian/binutils-multiarch.postrm.in b/debian/binutils-multiarch.postrm.in
index 777a3c9..9c57ec2 100644
--- a/debian/binutils-multiarch.postrm.in
+++ b/debian/binutils-multiarch.postrm.in
@@ -43,7 +43,6 @@ for prog in nm objdump objcopy strings strip size \
 do
 	diversion 2.9.5.0.16-1 "/usr/bin/$prog"
 done
-diversion 2.20.51.20100418-1 /usr/bin/ld.bfd
 
 if [ "$1" = "remove" ]; then
 	ldconfig
diff --git a/debian/binutils-multiarch.preinst.in b/debian/binutils-multiarch.preinst.in
index 89d2f97..2853a74 100644
--- a/debian/binutils-multiarch.preinst.in
+++ b/debian/binutils-multiarch.preinst.in
@@ -20,7 +20,6 @@ diversion() {
 	fi
 }
 
-diversion 2.20.51.20100418-1 /usr/bin/ld.bfd
 for prog in nm objdump objcopy strings strip size \
             ar ranlib addr2line gprof readelf
 do
diff --git a/debian/binutils-multiarch.prerm.in b/debian/binutils-multiarch.prerm.in
index 00ed78f..d2781a2 100644
--- a/debian/binutils-multiarch.prerm.in
+++ b/debian/binutils-multiarch.prerm.in
@@ -39,6 +39,7 @@ old_diversion() {
 }
 
 # remove obsolete diversions
+old_diversion /usr/bin/ld.bfd
 old_diversion /usr/bin/c++filt
 old_diversion /usr/lib/libbfd.a /usr/lib/libbfd-single.a
 old_diversion /usr/lib/libopcodes.a /usr/lib/libopcodes-single.a
diff --git a/debian/changelog b/debian/changelog
index 52f1bda..140a20b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+binutils (2.20.51.20100710-2.1) experimental; urgency=low
+
+  * Remove ld.bfd from binutils-multiarch.
+
+ -- Jonathan Nieder <jrnieder@gmail.com>  Mon, 19 Jul 2010 10:43:42 -0500
+
 binutils (2.20.51.20100710-2) experimental; urgency=medium
 
   * Don't use configury for cross builds for native builds. LP: #604134.
diff --git a/debian/rules b/debian/rules
index ffb32d6..c4aaec7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -539,14 +539,8 @@ ifeq ($(with_multiarch),yes)
 	: # As gas/README points out (search for --enable-targets),
 	: # multi-arch gas is not ready yet.
 	rm -f $(d_mul)/$(PF)/bin/as
-
-	: # binutils will provide ldscripts for the native architecture.
-	set -e; for i in $(d_bin)/$(PF)/lib/ldscripts/*; do \
-		rm -f $(d_mul)/$(PF)/lib/ldscripts/`basename $$i`; \
-	done
-
-	: # binutils will provide the ld symlink.
-	mv -f $(d_mul)/$(PF)/bin/ld $(d_mul)/$(PF)/bin/ld.bfd
+	rm -f $(d_mul)/$(PF)/bin/ld
+	rm -fr $(d_mul)/$(PF)/lib/ldscripts
 
   ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64))
 	rm -f $(d_mul)/$(PF)/bin/embedspu
-- 
1.7.2.rc2


Reply to: