PATCH: Check ELF class for DT_NEEDED (Re: Problem with biarch support: Wrong library linked in...)
H . J . Lu
hjl@lucon.org
Tue Jun 11 18:12:00 GMT 2002
More information about the Binutils mailing list
Tue Jun 11 18:12:00 GMT 2002
- Previous message (by thread): Problem with biarch support: Wrong library linked in...
- Next message (by thread): PATCH: Check ELF class for DT_NEEDED (Re: Problem with biarch support: Wrong library linked in...)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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. H.J. -------------- next part -------------- 2002-06-11 H.J. Lu <hjl@gnu.org> * emultempl/elf32.em: Include "elf-bfd.h" instead of "elf/common.h". (gld${EMULATION_NAME}_try_needed): Return false if ELF class doesn't match. --- ld/emultempl/elf32.em.class Wed Jun 5 09:11:53 2002 +++ ld/emultempl/elf32.em Tue Jun 11 18:09:51 2002 @@ -50,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suit #include "ldfile.h" #include "ldemul.h" #include "ldgram.h" -#include "elf/common.h" +#include "elf-bfd.h" static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); @@ -266,6 +266,7 @@ gld${EMULATION_NAME}_try_needed (name, f { bfd *abfd; const char *soname; + struct elf_backend_data *inbed, *outbed; abfd = bfd_openr (name, bfd_get_target (output_bfd)); if (abfd == NULL) @@ -279,6 +280,14 @@ gld${EMULATION_NAME}_try_needed (name, f { bfd_close (abfd); return false; + } + + inbed = get_elf_backend_data (abfd); + outbed = get_elf_backend_data (output_bfd); + if (inbed->s->elfclass != outbed->s->elfclass) + { + bfd_close (abfd); + return false; } /* Check whether this object would include any conflicting library
- Previous message (by thread): Problem with biarch support: Wrong library linked in...
- Next message (by thread): PATCH: Check ELF class for DT_NEEDED (Re: Problem with biarch support: Wrong library linked in...)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list