This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Check ELF class for DT_NEEDED (Re: Problem with biarch support: Wrong library linked in...)
- From: "H . J . Lu" <hjl at lucon dot org>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 11 Jun 2002 19:16:45 -0700
- Subject: Re: PATCH: Check ELF class for DT_NEEDED (Re: Problem with biarch support: Wrong library linked in...)
- References: <hoofeifeaz.fsf@gee.suse.de> <20020611181247.A21131@lucon.org>
On Tue, Jun 11, 2002 at 06:12:47PM -0700, H . J . Lu wrote:
> On Tue, Jun 11, 2002 at 09:46:28AM +0200, Andreas Jaeger wrote:
> >
> > On x86-64 we have both 32-bit libs in lib and 64-bit libs in lib64.
> > But this gives a problem with the search done in emultempl/elf32.em.
> > ld suddenly decides to use a 32-bit library:
> >
> > $ gcc -Wall -o xw -L/usr/X11R6/lib64 -lX11 -lXext -lXmu -lm xw.o xaccess.o fashion.o -lXinerama
> > /usr/X11R6/lib/libSM.so.6: could not read symbols: Invalid operation
> > collect2: ld returned 1 exit status
> > make: *** [xw] Error 1
> >
>
> Here is a patch.
>
>
Here is an update.
H.J.
---
2002-06-11 H.J. Lu <hjl@gnu.org>
* emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Return
false if xvec doesn't match.
--- ld/emultempl/elf32.em.class Wed Jun 5 09:11:53 2002
+++ ld/emultempl/elf32.em Tue Jun 11 19:14:13 2002
@@ -281,6 +281,13 @@ gld${EMULATION_NAME}_try_needed (name, f
return false;
}
+ /* For DT_NEEDED, they have to match. */
+ if (abfd->xvec != output_bfd->xvec)
+ {
+ bfd_close (abfd);
+ return false;
+ }
+
/* Check whether this object would include any conflicting library
versions. If FORCE is set, then we skip this check; we use this
the second time around, if we couldn't find any compatible