This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patches] X86-64 shared linking fix


Bo Thorsen <bo@sonofthor.dk> writes:

> This is a slight rearrangement and optimization of the code around the patch 
> I just sent. The logic hasn't changed. Please apply this instead of the 
> previous one.

If the logic hasn't changed, I won't apply it since it breaks the
resulting stuff.  Did you manage to get dynamic linked programs
running?

Andreas

> 2001-06-20  Bo Thorsen  <bo@suse.co.uk>
> 
> 	* elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
> 	  shared libraries.
> 
> Index: elf64-x86-64.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf64-x86-64.c,v
> retrieving revision 1.20
> diff -u -r1.20 elf64-x86-64.c
> --- elf64-x86-64.c	2001/06/19 13:30:40	1.20
>+++ elf64-x86-64.c	2001/06/20 15:42:02
> @@ -1442,7 +1442,9 @@
>  	case R_X86_64_PC8:
>  	case R_X86_64_PC16:
>  	case R_X86_64_PC32:
> -	  if (h == NULL)
>+	  if (h == NULL || h->dynindx == -1 ||
>+	      (info->symbolic

It should be:
              || (info->symbolic

The operator should be in front of the line.

>+	       && h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
>  	    break;
>  	  /* Fall through.  */
>  	case R_X86_64_8:
> @@ -1451,15 +1453,7 @@
>  	case R_X86_64_64:
>  	  /* FIXME: The ABI says the linker should make sure the value is
>  	     the same when it's zeroextended to 64 bit.	 */
> -	  if (info->shared
> -	      && (input_section->flags & SEC_ALLOC) != 0
> -	      && ((r_type != R_X86_64_PC8
> -		   && r_type != R_X86_64_PC16
> -		   && r_type != R_X86_64_PC32)
> -		  || (! info->symbolic
> -		      || (h->elf_link_hash_flags
> -			  & ELF_LINK_HASH_DEF_REGULAR) == 0)))
> -
>+	  if (info->shared && (input_section->flags & SEC_ALLOC) != 0)
>  	    {
>  	      Elf_Internal_Rela outrel;
>  	      boolean skip, relocate;
> 
> Bo.

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]