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]
Other format: [Raw text]

Re: Binutils 2.14 prerelease 2


Hi Daniel,

> I've just uploaded the new prerelease to:
>   ftp://sources.redhat.com/pub/binutils/snapshots/binutils-2.13.92.tar.bz2
>
> There are some test failures on mips-linux (all testsuite problems);
> mips64-linux (dunno); v850-elf (ld-elf/merge);

The v850-elf bug is due to the fact that the port did not have a
pc-relative 32-bit reloc.  The following patch fixes this and I will
be applying it to the mainline and branch shortly.

Cheers
        Nick

include/elf/ChangeLog        
2003-06-03  Nick Clifton  <nickc@redhat.com>

	* v850.h (R_V850_32): Rename to R_V850_ABS32.
        Add R_V850_REL32.

bfd/ChangeLog        
2003-06-03  Nick Clifton  <nickc@redhat.com>

	* elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to
	R_V850_ABS32.  Add entry for R_V850_REL32.
        (v850_elf_reloc_map): Likewise.
        (v850_elf_check_relocs): Likewise.
        (v850_elf_perform_relocation): Likewise.
        (v850_elf_final_link_relocate): Likewise.  Include computation
	to make R_V850_REl32 pc-relative.
          
gas/ChangeLog        
2003-06-03  Nick Clifton  <nickc@redhat.com>

	* tc-v850.c (tc-gen_reloc): Translate BFD_RELOC_32 into
        BFD_RELOC_32_PCREL if the reloc is pc-relative.  Do this
        before calling bfd_reloc_type_lookup.
        
Index: include/elf/v850.h
===================================================================
RCS file: /cvs/src/src/include/elf/v850.h,v
retrieving revision 1.6
diff -c -3 -p -r1.6 v850.h
*** include/elf/v850.h	29 Aug 2002 06:49:35 -0000	1.6
--- include/elf/v850.h	3 Jun 2003 16:14:05 -0000
*************** START_RELOC_NUMBERS (v850_reloc_type)
*** 53,59 ****
       RELOC_NUMBER (R_V850_HI16_S, 3)
       RELOC_NUMBER (R_V850_HI16, 4)
       RELOC_NUMBER (R_V850_LO16, 5)
!      RELOC_NUMBER (R_V850_32, 6)
       RELOC_NUMBER (R_V850_16, 7)
       RELOC_NUMBER (R_V850_8, 8)
       RELOC_NUMBER( R_V850_SDA_16_16_OFFSET, 9)		/* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */
--- 53,59 ----
       RELOC_NUMBER (R_V850_HI16_S, 3)
       RELOC_NUMBER (R_V850_HI16, 4)
       RELOC_NUMBER (R_V850_LO16, 5)
!      RELOC_NUMBER (R_V850_ABS32, 6)
       RELOC_NUMBER (R_V850_16, 7)
       RELOC_NUMBER (R_V850_8, 8)
       RELOC_NUMBER( R_V850_SDA_16_16_OFFSET, 9)		/* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */
*************** START_RELOC_NUMBERS (v850_reloc_type)
*** 75,80 ****
--- 75,81 ----
       RELOC_NUMBER (R_V850_LONGCALL, 25)
       RELOC_NUMBER (R_V850_LONGJUMP, 26)
       RELOC_NUMBER (R_V850_ALIGN, 27)
+      RELOC_NUMBER (R_V850_REL32, 28)
  END_RELOC_NUMBERS (R_V850_max)
  
  
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 elf32-v850.c
*** bfd/elf32-v850.c	9 May 2003 02:27:04 -0000	1.31
--- bfd/elf32-v850.c	3 Jun 2003 16:14:07 -0000
*************** static reloc_howto_type v850_elf_howto_t
*** 189,195 ****
  	 FALSE),			/* pcrel_offset */
  
    /* Simple 32bit reloc.  */
!   HOWTO (R_V850_32,			/* type */
  	 0,				/* rightshift */
  	 2,				/* size (0 = byte, 1 = short, 2 = long) */
  	 32,				/* bitsize */
--- 189,195 ----
  	 FALSE),			/* pcrel_offset */
  
    /* Simple 32bit reloc.  */
!   HOWTO (R_V850_ABS32,			/* type */
  	 0,				/* rightshift */
  	 2,				/* size (0 = byte, 1 = short, 2 = long) */
  	 32,				/* bitsize */
*************** static reloc_howto_type v850_elf_howto_t
*** 197,203 ****
  	 0,				/* bitpos */
  	 complain_overflow_dont,	/* complain_on_overflow */
  	 v850_elf_reloc,		/* special_function */
! 	 "R_V850_32",			/* name */
  	 FALSE,				/* partial_inplace */
  	 0xffffffff,			/* src_mask */
  	 0xffffffff,			/* dst_mask */
--- 197,203 ----
  	 0,				/* bitpos */
  	 complain_overflow_dont,	/* complain_on_overflow */
  	 v850_elf_reloc,		/* special_function */
! 	 "R_V850_ABS32",		/* name */
  	 FALSE,				/* partial_inplace */
  	 0xffffffff,			/* src_mask */
  	 0xffffffff,			/* dst_mask */
*************** static reloc_howto_type v850_elf_howto_t
*** 518,523 ****
--- 518,538 ----
         0,                     /* src_mask */
         0,                     /* dst_mask */
         TRUE),                 /* pcrel_offset */
+   
+   /* Simple pc-relative 32bit reloc.  */
+   HOWTO (R_V850_REL32,			/* type */
+ 	 0,				/* rightshift */
+ 	 2,				/* size (0 = byte, 1 = short, 2 = long) */
+ 	 32,				/* bitsize */
+ 	 TRUE,				/* pc_relative */
+ 	 0,				/* bitpos */
+ 	 complain_overflow_dont,	/* complain_on_overflow */
+ 	 v850_elf_reloc,		/* special_function */
+ 	 "R_V850_REL32",		/* name */
+ 	 FALSE,				/* partial_inplace */
+ 	 0xffffffff,			/* src_mask */
+ 	 0xffffffff,			/* dst_mask */
+ 	 FALSE),			/* pcrel_offset */
  };
  
  /* Map BFD reloc types to V850 ELF reloc types.  */
*************** static const struct v850_elf_reloc_map v
*** 538,544 ****
    { BFD_RELOC_HI16_S,		           R_V850_HI16_S                 },
    { BFD_RELOC_HI16,		           R_V850_HI16                   },
    { BFD_RELOC_LO16,		           R_V850_LO16                   },
!   { BFD_RELOC_32,		           R_V850_32                     },
    { BFD_RELOC_16,		           R_V850_16                     },
    { BFD_RELOC_8,		           R_V850_8                      },
    { BFD_RELOC_V850_SDA_16_16_OFFSET,       R_V850_SDA_16_16_OFFSET       },
--- 553,560 ----
    { BFD_RELOC_HI16_S,		           R_V850_HI16_S                 },
    { BFD_RELOC_HI16,		           R_V850_HI16                   },
    { BFD_RELOC_LO16,		           R_V850_LO16                   },
!   { BFD_RELOC_32,		           R_V850_ABS32                  },
!   { BFD_RELOC_32_PCREL,		           R_V850_REL32                  },
    { BFD_RELOC_16,		           R_V850_16                     },
    { BFD_RELOC_8,		           R_V850_8                      },
    { BFD_RELOC_V850_SDA_16_16_OFFSET,       R_V850_SDA_16_16_OFFSET       },
*************** v850_elf_check_relocs (abfd, info, sec, 
*** 672,678 ****
  	case R_V850_HI16_S:
  	case R_V850_HI16:
  	case R_V850_LO16:
! 	case R_V850_32:
  	case R_V850_16:
  	case R_V850_8:
  	case R_V850_CALLT_6_7_OFFSET:
--- 688,695 ----
  	case R_V850_HI16_S:
  	case R_V850_HI16:
  	case R_V850_LO16:
! 	case R_V850_ABS32:
! 	case R_V850_REL32:
  	case R_V850_16:
  	case R_V850_8:
  	case R_V850_CALLT_6_7_OFFSET:
*************** v850_elf_perform_relocation (abfd, r_typ
*** 905,911 ****
        /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */
        return bfd_reloc_notsupported;
  
!     case R_V850_32:
        bfd_put_32 (abfd, addend, address);
        return bfd_reloc_ok;
  
--- 922,929 ----
        /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */
        return bfd_reloc_notsupported;
  
!     case R_V850_REL32:
!     case R_V850_ABS32:
        bfd_put_32 (abfd, addend, address);
        return bfd_reloc_ok;
  
*************** v850_elf_final_link_relocate (howto, inp
*** 1466,1476 ****
        value = SEXT24 (value);
        break;
  
      case R_V850_HI16_S:
      case R_V850_HI16:
      case R_V850_LO16:
      case R_V850_16:
!     case R_V850_32:
      case R_V850_8:
        break;
  
--- 1484,1500 ----
        value = SEXT24 (value);
        break;
  
+     case R_V850_REL32:
+       value -= (input_section->output_section->vma
+ 		+ input_section->output_offset
+ 		+ offset);
+       break;
+ 
      case R_V850_HI16_S:
      case R_V850_HI16:
      case R_V850_LO16:
      case R_V850_16:
!     case R_V850_ABS32:
      case R_V850_8:
        break;
  
Index: gas/config/tc-v850.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.c,v
retrieving revision 1.32
diff -c -3 -p -r1.32 tc-v850.c
*** gas/config/tc-v850.c	21 May 2003 12:07:56 -0000	1.32
--- gas/config/tc-v850.c	3 Jun 2003 16:14:09 -0000
*************** tc_gen_reloc (seg, fixp)
*** 2239,2244 ****
--- 2239,2260 ----
    reloc->sym_ptr_ptr  = (asymbol **) xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
    reloc->address      = fixp->fx_frag->fr_address + fixp->fx_where;
+ 
+   if (   fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
+       || fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+       || fixp->fx_r_type == BFD_RELOC_V850_LONGCALL
+       || fixp->fx_r_type == BFD_RELOC_V850_LONGJUMP
+       || fixp->fx_r_type == BFD_RELOC_V850_ALIGN)
+     reloc->addend = fixp->fx_offset;
+   else
+     {
+       if (fixp->fx_r_type == BFD_RELOC_32
+ 	  && fixp->fx_pcrel)
+ 	fixp->fx_r_type = BFD_RELOC_32_PCREL;
+ 
+       reloc->addend = fixp->fx_addnumber;
+     }
+ 
    reloc->howto        = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
  
    if (reloc->howto == (reloc_howto_type *) NULL)
*************** tc_gen_reloc (seg, fixp)
*** 2252,2267 ****
  
        return NULL;
      }
- 
-   if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-       || fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
-     reloc->addend = fixp->fx_offset;
-   else if (   fixp->fx_r_type == BFD_RELOC_V850_LONGCALL
- 	   || fixp->fx_r_type == BFD_RELOC_V850_LONGJUMP
-            || fixp->fx_r_type == BFD_RELOC_V850_ALIGN)
-     reloc->addend = fixp->fx_offset;
-   else
-     reloc->addend = fixp->fx_addnumber;
  
    return reloc;
  }
--- 2268,2273 ----


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