binutils/bfd/elf64-ppc.c patch: Add PLTREL24 support

Elliot Lee sopwith at redhat.com
Thu Sep 19 00:48:11 EST 2002


I understand these are good addresses to send binutils ppc64 patches to -
please correct me if wrong...

This patch makes bfd handle the PLTREL24 relocation thingie. I needed it
to make glibc-CVS/sysdeps/powerpc/powerpc64/elf/start.S assemble. I just
did a cut & paste from elf32-ppc.c, hopefully it's sane.

-- Elliot
"Do not trust the horse, Trojans! Whatever it is, I fear the Greeks, even
though they bring gifts."
-------------- next part --------------
? obj
? ppc64-pltrel24.patch
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.63
diff -u -r1.63 elf64-ppc.c
--- bfd/elf64-ppc.c	22 Aug 2002 01:27:19 -0000	1.63
+++ bfd/elf64-ppc.c	18 Sep 2002 14:40:38 -0000
@@ -543,6 +543,22 @@
 	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
+  /* 24-bit PC relative relocation to the symbol's procedure linkage table.
+     FIXME: R_PPC64_PLTREL24 not supported.  */
+  HOWTO (R_PPC64_PLTREL24,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 26,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC64_PLTREL24",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x3ffffffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
   /* 32-bit PC relative relocation to the symbol's procedure linkage table.
      FIXME: R_PPC64_PLTREL32 not supported.  */
   HOWTO (R_PPC64_PLTREL32,	/* type */
@@ -1258,6 +1274,8 @@
       break;
     case BFD_RELOC_PPC_GLOB_DAT:	 ppc_reloc = R_PPC64_GLOB_DAT;
       break;
+    case BFD_RELOC_24_PLT_PCREL:         ppc_reloc = R_PPC64_PLTREL24;
+      break;
     case BFD_RELOC_32_PCREL:		 ppc_reloc = R_PPC64_REL32;
       break;
     case BFD_RELOC_32_PLTOFF:		 ppc_reloc = R_PPC64_PLT32;
@@ -5837,6 +5855,7 @@
 	case R_PPC64_PLTGOT16_LO_DS:
 	case R_PPC64_PLTREL32:
 	case R_PPC64_PLTREL64:
+	case R_PPC64_PLTREL24:
 	  /* These ones haven't been implemented yet.  */
 
 	  (*_bfd_error_handler)
Index: include/elf/ppc.h
===================================================================
RCS file: /cvs/src/src/include/elf/ppc.h,v
retrieving revision 1.8
diff -u -r1.8 ppc.h
--- include/elf/ppc.h	12 Feb 2002 06:31:24 -0000	1.8
+++ include/elf/ppc.h	18 Sep 2002 14:40:39 -0000
@@ -160,6 +160,7 @@
 #define R_PPC64_REL32             R_PPC_REL32
 #define R_PPC64_PLT32             R_PPC_PLT32
 #define R_PPC64_PLTREL32          R_PPC_PLTREL32
+#define R_PPC64_PLTREL24          R_PPC_PLTREL24
 #define R_PPC64_PLT16_LO          R_PPC_PLT16_LO
 #define R_PPC64_PLT16_HI          R_PPC_PLT16_HI
 #define R_PPC64_PLT16_HA          R_PPC_PLT16_HA


More information about the Linuxppc64-dev mailing list