This is the mail archive of the binutils@sourceware.org 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]

[gold patch committed]: Define IRELATIVE relocs


This patch defines the IRELATIVE relocs for the gold targets.  While
doing this I noticed that the old VTINHERIT and VTENTRY relocs were
misnamed for x86_64, so I corrected the names.  Committed to mainline.

Ian

elfcpp/ChangeLog

2010-08-04  Ian Lance Taylor  <iant@google.com>

	* i386.h (R_386_IRELATIVE): Define.
	* powerpc.h (R_POWERPC_IRELATIVE): Define.
	(R_PPC_RELAX32, R_PPC_RELAX32PC): Don't define.
	(R_PPC_RELAX32_PLT, R_PPC_RELAX32PC_PLT): Don't define.
	* sparc.h (R_SPARC_IRELATIVE): Define.
	* x86_64.h (R_X86_64_IRELATIVE): Define.
	(R_X86_64_GNU_VTINHERIT): Rename from R_386_GNU_VTINHERIT.
	(R_X86_64_GNU_VTENTRY): Rename from R_386_GNU_VTENTRY.

gold/ChangeLog

2010-08-04  Ian Lance Taylor  <iant@google.com>

	* x86_64.cc (Target_x86_64::Scan::local): Use
	R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
	R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
	(Target_x86_64::Scan::global): Likewise.
	(Target_x86_64::Relocate::relocate): Likewise.
	(Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
	Likewise.


Index: elfcpp/i386.h
===================================================================
RCS file: /cvs/src/src/elfcpp/i386.h,v
retrieving revision 1.4
diff -u -r1.4 i386.h
--- elfcpp/i386.h	2 Nov 2007 03:31:41 -0000	1.4
+++ elfcpp/i386.h	4 Aug 2010 09:50:31 -0000
@@ -1,6 +1,6 @@
 // i386.h -- ELF definitions specific to EM_386  -*- C++ -*-
 
-// Copyright 2006, 2007, Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of elfcpp.
@@ -85,6 +85,7 @@
   R_386_TLS_DESC_CALL = 40, // Marker of call through TLS desc for relaxation
   R_386_TLS_DESC = 41,      // TLS descriptor containing pointer to code and
                             // to argument, returning TLS offset for symbol
+  R_386_IRELATIVE = 42,     // Adjust indirectly by program base
   // Used by Intel.
   R_386_USED_BY_INTEL_200 = 200,
   // GNU vtable garbage collection extensions.
Index: elfcpp/powerpc.h
===================================================================
RCS file: /cvs/src/src/elfcpp/powerpc.h,v
retrieving revision 1.1
diff -u -r1.1 powerpc.h
--- elfcpp/powerpc.h	12 Jun 2008 16:58:40 -0000	1.1
+++ elfcpp/powerpc.h	4 Aug 2010 09:50:31 -0000
@@ -1,6 +1,6 @@
 // powerpc.h -- ELF definitions specific to EM_PPC and EM_PPC64  -*- C++ -*-
 
-// Copyright 2008, Free Software Foundation, Inc.
+// Copyright 2008, 2010 Free Software Foundation, Inc.
 // Written by David S. Miller <davem@davemloft.net>.
 
 // This file is part of elfcpp.
@@ -165,10 +165,8 @@
   R_PPC_EMB_RELST_HA = 114,
   R_PPC_EMB_BIT_FLD = 115,
   R_PPC_EMB_RELSDA = 116,
-  R_PPC_RELAX32 = 245,
-  R_PPC_RELAX32PC = 246,
-  R_PPC_RELAX32_PLT = 247,
-  R_PPC_RELAX32PC_PLT = 248,
+
+  R_POWERPC_IRELATIVE = 248,
   R_PPC_REL16 = 249,
   R_PPC_REL16_LO = 250,
   R_PPC_REL16_HI = 251,
Index: elfcpp/sparc.h
===================================================================
RCS file: /cvs/src/src/elfcpp/sparc.h,v
retrieving revision 1.2
diff -u -r1.2 sparc.h
--- elfcpp/sparc.h	16 Apr 2008 01:56:33 -0000	1.2
+++ elfcpp/sparc.h	4 Aug 2010 09:50:31 -0000
@@ -1,6 +1,6 @@
 // sparc.h -- ELF definitions specific to EM_SPARC  -*- C++ -*-
 
-// Copyright 2008, Free Software Foundation, Inc.
+// Copyright 2008, 2010 Free Software Foundation, Inc.
 // Written by David S. Miller <davem@davemloft.net>.
 
 // This file is part of elfcpp.
@@ -141,6 +141,8 @@
   R_SPARC_SIZE32 = 86,        // size of symbol, 32-bit
   R_SPARC_SIZE64 = 87,        // size of symbol, 64-bit
 
+  R_SPARC_IRELATIVE = 249,    // Adjust indirectly by program base
+
   // GNU vtable garbage collection extensions.
   R_SPARC_GNU_VTINHERIT = 250,
   R_SPARC_GNU_VTENTRY = 251,
Index: elfcpp/x86_64.h
===================================================================
RCS file: /cvs/src/src/elfcpp/x86_64.h,v
retrieving revision 1.4
diff -u -r1.4 x86_64.h
--- elfcpp/x86_64.h	9 Jan 2008 19:40:24 -0000	1.4
+++ elfcpp/x86_64.h	4 Aug 2010 09:50:31 -0000
@@ -1,6 +1,6 @@
 // x86-64.h -- ELF definitions specific to EM_X86_64  -*- C++ -*-
 
-// Copyright 2006, 2007, Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
 // Written by Andrew Chatham.
 
 // This file is part of elfcpp.
@@ -90,9 +90,10 @@
   R_X86_64_GOTPC32_TLSDESC = 34, // 32-bit PC relative to TLS descriptor in GOT
   R_X86_64_TLSDESC_CALL = 35,    // Relaxable call through TLS descriptor
   R_X86_64_TLSDESC = 36,         // 2 by 64-bit TLS descriptor
+  R_X86_64_IRELATIVE = 37,          // Adjust indirectly by program base
   // GNU vtable garbage collection extensions.
-  R_386_GNU_VTINHERIT = 250,
-  R_386_GNU_VTENTRY = 251
+  R_X86_64_GNU_VTINHERIT = 250,
+  R_X86_64_GNU_VTENTRY = 251
 };
 
 } // End namespace elfcpp.
Index: gold/x86_64.cc
===================================================================
RCS file: /cvs/src/src/gold/x86_64.cc,v
retrieving revision 1.112
diff -u -p -r1.112 x86_64.cc
--- gold/x86_64.cc	3 Aug 2010 14:07:13 -0000	1.112
+++ gold/x86_64.cc	4 Aug 2010 09:51:32 -0000
@@ -1150,8 +1150,8 @@ Target_x86_64::Scan::local(Symbol_table*
   switch (r_type)
     {
     case elfcpp::R_X86_64_NONE:
-    case elfcpp::R_386_GNU_VTINHERIT:
-    case elfcpp::R_386_GNU_VTENTRY:
+    case elfcpp::R_X86_64_GNU_VTINHERIT:
+    case elfcpp::R_X86_64_GNU_VTENTRY:
       break;
 
     case elfcpp::R_X86_64_64:
@@ -1508,8 +1508,8 @@ Target_x86_64::Scan::global(Symbol_table
   switch (r_type)
     {
     case elfcpp::R_X86_64_NONE:
-    case elfcpp::R_386_GNU_VTINHERIT:
-    case elfcpp::R_386_GNU_VTENTRY:
+    case elfcpp::R_X86_64_GNU_VTINHERIT:
+    case elfcpp::R_X86_64_GNU_VTENTRY:
       break;
 
     case elfcpp::R_X86_64_64:
@@ -1992,8 +1992,8 @@ Target_x86_64::Relocate::relocate(const 
   switch (r_type)
     {
     case elfcpp::R_X86_64_NONE:
-    case elfcpp::R_386_GNU_VTINHERIT:
-    case elfcpp::R_386_GNU_VTENTRY:
+    case elfcpp::R_X86_64_GNU_VTINHERIT:
+    case elfcpp::R_X86_64_GNU_VTENTRY:
       break;
 
     case elfcpp::R_X86_64_64:
@@ -2680,8 +2680,8 @@ Target_x86_64::Relocatable_size_for_relo
   switch (r_type)
     {
     case elfcpp::R_X86_64_NONE:
-    case elfcpp::R_386_GNU_VTINHERIT:
-    case elfcpp::R_386_GNU_VTENTRY:
+    case elfcpp::R_X86_64_GNU_VTINHERIT:
+    case elfcpp::R_X86_64_GNU_VTENTRY:
     case elfcpp::R_X86_64_TLSGD:            // Global-dynamic
     case elfcpp::R_X86_64_GOTPC32_TLSDESC:  // Global-dynamic (from ~oliva url)
     case elfcpp::R_X86_64_TLSDESC_CALL:

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