Blob Blame History Raw
--- a/gold/powerpc.cc	2015-01-09 12:22:41.336190605 -0700
+++ b/gold/powerpc.cc	2015-01-09 12:25:12.129711802 -0700
@@ -72,19 +72,12 @@ public:
 		 const typename elfcpp::Ehdr<size, big_endian>& ehdr)
     : Sized_relobj_file<size, big_endian>(name, input_file, offset, ehdr),
       special_(0), has_small_toc_reloc_(false), opd_valid_(false),
-      opd_ent_(), access_from_map_(), has14_(), stub_table_(),
-      e_flags_(ehdr.get_e_flags()), st_other_()
-  {
-    this->set_abiversion(0);
-  }
+      opd_ent_(), access_from_map_(), has14_(), stub_table_()
+  { }
 
   ~Powerpc_relobj()
   { }
 
-  // Read the symbols then set up st_other vector.
-  void
-  do_read_symbols(Read_symbols_data*);
-
   // The .got2 section shndx.
   unsigned int
   got2_shndx() const
@@ -270,22 +263,6 @@ public:
     return NULL;
   }
 
-  int
-  abiversion() const
-  { return this->e_flags_ & elfcpp::EF_PPC64_ABI; }
-
-  // Set ABI version for input and output
-  void
-  set_abiversion(int ver);
-
-  unsigned int
-  ppc64_local_entry_offset(const Symbol* sym) const
-  { return elfcpp::ppc64_decode_local_entry(sym->nonvis() >> 3); }
-
-  unsigned int
-  ppc64_local_entry_offset(unsigned int symndx) const
-  { return elfcpp::ppc64_decode_local_entry(this->st_other_[symndx] >> 5); }
-
 private:
   struct Opd_ent
   {
@@ -339,12 +316,6 @@ private:
 
   // The stub table to use for a given input section.
   std::vector<Stub_table<size, big_endian>*> stub_table_;
-
-  // Header e_flags
-  elfcpp::Elf_Word e_flags_;
-
-  // ELF st_other field for local symbols.
-  std::vector<unsigned char> st_other_;
 };
 
 template<int size, bool big_endian>
@@ -1334,14 +1305,6 @@ public:
     STATUS_OVERFLOW
   };
 
-  int
-  abiversion() const
-  { return this->e_flags_ & elfcpp::EF_PPC64_ABI; }
-
-  // Set ABI version for input and output.
-  void
-  set_abiversion(int ver);
-
 private:
   typedef Powerpc_relocate_functions<size, big_endian> This;
   typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
@@ -1967,24 +1930,6 @@ class Stub_control
   output_section()
   { return output_section_; }
 
-  int
-  abiversion () const
-  { return this->processor_specific_flags() & elfcpp::EF_PPC64_ABI; }
-
-  void
-  set_abiversion (int ver)
-  {
-    elfcpp::Elf_Word flags = this->processor_specific_flags();
-    flags &= ~elfcpp::EF_PPC64_ABI;
-    flags |= ver & elfcpp::EF_PPC64_ABI;
-    this->set_processor_specific_flags(flags);
-  }
-
-  // Offset to to save stack slot
-  int
-  stk_toc () const
-  { return this->abiversion() < 2 ? 40 : 24; }
-
  private:
   typedef enum
   {
@@ -3660,26 +3605,6 @@ Stub_table<size, big_endian>::do_write(O
 	    }
 	}
     }
-  else
-    {
-      // Define .TOC. as for 32-bit _GLOBAL_OFFSET_TABLE_
-      Symbol *gotsym = symtab->lookup(".TOC.", NULL);
-      if (gotsym != NULL && gotsym->is_undefined())
-	{
-	  Target_powerpc<size, big_endian>* target =
-	    static_cast<Target_powerpc<size, big_endian>*>(
-		parameters->sized_target<size, big_endian>());
-	  Output_data_got_powerpc<size, big_endian>* got
-	    = target->got_section(symtab, layout);
-	  symtab->define_in_output_data(".TOC.", NULL,
-					Symbol_table::PREDEFINED,
-					got, 0x8000, 0,
-					elfcpp::STT_OBJECT,
-					elfcpp::STB_LOCAL,
-					elfcpp::STV_HIDDEN, 0,
-					false, false);
-	}
-    }
 }
 
 // Write out .glink.
@@ -3707,34 +3632,16 @@ Output_data_glink<size, big_endian>::do_
 
       elfcpp::Swap<64, big_endian>::writeval(p, pltoff),	p += 8;
 
-      if (this->targ_->abiversion() < 2)
-	{
-	  write_insn<big_endian>(p, mflr_12),			p += 4;
-	  write_insn<big_endian>(p, bcl_20_31),			p += 4;
-	  write_insn<big_endian>(p, mflr_11),			p += 4;
-	  write_insn<big_endian>(p, ld_2_11 + l(-16)),		p += 4;
-	  write_insn<big_endian>(p, mtlr_12),			p += 4;
-	  write_insn<big_endian>(p, add_11_2_11),		p += 4;
-	  write_insn<big_endian>(p, ld_12_11 + 0),		p += 4;
-	  write_insn<big_endian>(p, ld_2_11 + 8),		p += 4;
-	  write_insn<big_endian>(p, mtctr_12),			p += 4;
-	  write_insn<big_endian>(p, ld_11_11 + 16),		p += 4;
-	}
-      else
-	{
-	  write_insn<big_endian>(p, mflr_0),			p += 4;
-	  write_insn<big_endian>(p, bcl_20_31),			p += 4;
-	  write_insn<big_endian>(p, mflr_11),			p += 4;
-	  write_insn<big_endian>(p, ld_2_11 + l(-16)),		p += 4;
-	  write_insn<big_endian>(p, mtlr_0),			p += 4;
-	  write_insn<big_endian>(p, sub_12_12_11),		p += 4;
-	  write_insn<big_endian>(p, add_11_2_11),		p += 4;
-	  write_insn<big_endian>(p, addi_0_12 + l(-48)),	p += 4;
-	  write_insn<big_endian>(p, ld_12_11 + 0),		p += 4;
-	  write_insn<big_endian>(p, srdi_0_0_2),		p += 4;
-	  write_insn<big_endian>(p, mtctr_12),			p += 4;
-	  write_insn<big_endian>(p, ld_11_11 + 8),		p += 4;
-	}
+      write_insn<big_endian>(p, mflr_12),			p += 4;
+      write_insn<big_endian>(p, bcl_20_31),			p += 4;
+      write_insn<big_endian>(p, mflr_11),			p += 4;
+      write_insn<big_endian>(p, ld_2_11 + l(-16)),		p += 4;
+      write_insn<big_endian>(p, mtlr_12),			p += 4;
+      write_insn<big_endian>(p, add_12_2_11),			p += 4;
+      write_insn<big_endian>(p, ld_11_12 + 0),			p += 4;
+      write_insn<big_endian>(p, ld_2_12 + 8),			p += 4;
+      write_insn<big_endian>(p, mtctr_11),			p += 4;
+      write_insn<big_endian>(p, ld_11_12 + 16),			p += 4;
       write_insn<big_endian>(p, bctr),				p += 4;
       while (p < oview + this->pltresolve_size)
 	write_insn<big_endian>(p, nop), p += 4;
@@ -3743,17 +3650,14 @@ Output_data_glink<size, big_endian>::do_
       uint32_t indx = 0;
       while (p < oview + oview_size)
 	{
-	  if (this->targ_->abiversion() < 2)
+	  if (indx < 0x8000)
 	    {
-	      if (indx < 0x8000)
-		{
-		  write_insn<big_endian>(p, li_0_0 + indx),		p += 4;
-		}
-	      else
-		{
-		  write_insn<big_endian>(p, lis_0_0 + hi(indx)),	p += 4;
-		  write_insn<big_endian>(p, ori_0_0_0 + l(indx)),	p += 4;
-		}
+	      write_insn<big_endian>(p, li_0_0 + indx),			p += 4;
+	    }
+	  else
+	    {
+	      write_insn<big_endian>(p, lis_0_0 + hi(indx)),		p += 4;
+	      write_insn<big_endian>(p, ori_0_0_0 + l(indx)),		p += 4;
 	    }
 	  uint32_t branch_off = 8 - (p - oview);
 	  write_insn<big_endian>(p, b + (branch_off & 0x3fffffc)),	p += 4;
@@ -4240,6 +4144,24 @@ Target_powerpc<size, big_endian>::plt_en
   return count;
 }
 
+// Return the offset of the first non-reserved PLT entry.
+
+template<int size, bool big_endian>
+unsigned int
+Target_powerpc<size, big_endian>::first_plt_entry_offset() const
+{
+  return this->plt_->first_plt_entry_offset();
+}
+
+// Return the size of each PLT entry.
+
+template<int size, bool big_endian>
+unsigned int
+Target_powerpc<size, big_endian>::plt_entry_size() const
+{
+  return Output_data_plt_powerpc<size, big_endian>::get_plt_entry_size();
+}
+
 // Create a GOT entry for local dynamic __tls_get_addr calls.
 
 template<int size, bool big_endian>
@@ -4267,12 +4189,8 @@ Target_powerpc<size, big_endian>::tlsld_
 
 template<int size, bool big_endian>
 int
-Target_powerpc<size, big_endian>::Scan::get_reference_flags(
-    unsigned int r_type,
-    const Target_powerpc* target)
+Target_powerpc<size, big_endian>::Scan::get_reference_flags(unsigned int r_type)
 {
-  int ref = 0;
-
   switch (r_type)
     {
     case elfcpp::R_POWERPC_NONE:
@@ -4280,7 +4198,7 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_GNU_VTENTRY:
     case elfcpp::R_PPC64_TOC:
       // No symbol reference.
-      break;
+      return 0;
 
     case elfcpp::R_PPC64_ADDR64:
     case elfcpp::R_PPC64_UADDR64:
@@ -4291,15 +4209,13 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_ADDR16_LO:
     case elfcpp::R_POWERPC_ADDR16_HI:
     case elfcpp::R_POWERPC_ADDR16_HA:
-      ref = Symbol::ABSOLUTE_REF;
-      break;
+      return Symbol::ABSOLUTE_REF;
 
     case elfcpp::R_POWERPC_ADDR24:
     case elfcpp::R_POWERPC_ADDR14:
     case elfcpp::R_POWERPC_ADDR14_BRTAKEN:
     case elfcpp::R_POWERPC_ADDR14_BRNTAKEN:
-      ref = Symbol::FUNCTION_CALL | Symbol::ABSOLUTE_REF;
-      break;
+      return Symbol::FUNCTION_CALL | Symbol::ABSOLUTE_REF;
 
     case elfcpp::R_PPC64_REL64:
     case elfcpp::R_POWERPC_REL32:
@@ -4308,16 +4224,14 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_REL16_LO:
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
-      ref = Symbol::RELATIVE_REF;
-      break;
+      return Symbol::RELATIVE_REF;
 
     case elfcpp::R_POWERPC_REL24:
     case elfcpp::R_PPC_PLTREL24:
     case elfcpp::R_POWERPC_REL14:
     case elfcpp::R_POWERPC_REL14_BRTAKEN:
     case elfcpp::R_POWERPC_REL14_BRNTAKEN:
-      ref = Symbol::FUNCTION_CALL | Symbol::RELATIVE_REF;
-      break;
+      return Symbol::FUNCTION_CALL | Symbol::RELATIVE_REF;
 
     case elfcpp::R_POWERPC_GOT16:
     case elfcpp::R_POWERPC_GOT16_LO:
@@ -4332,13 +4246,11 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_PPC64_TOC16_DS:
     case elfcpp::R_PPC64_TOC16_LO_DS:
       // Absolute in GOT.
-      ref = Symbol::ABSOLUTE_REF;
-      break;
+      return Symbol::ABSOLUTE_REF;
 
     case elfcpp::R_POWERPC_GOT_TPREL16:
     case elfcpp::R_POWERPC_TLS:
-      ref = Symbol::TLS_REF;
-      break;
+      return Symbol::TLS_REF;
 
     case elfcpp::R_POWERPC_COPY:
     case elfcpp::R_POWERPC_GLOB_DAT:
@@ -4347,12 +4259,8 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_DTPMOD:
     default:
       // Not expected.  We will give an error later.
-      break;
+      return 0;
     }
-
-  if (size == 64 && target->abiversion() < 2)
-    ref |= Symbol::FUNC_DESC_ABI;
-  return ref;
 }
 
 // Report an unsupported relocation against a local symbol.
@@ -4423,8 +4331,6 @@ Target_powerpc<size, big_endian>::Scan::
 	case elfcpp::R_PPC64_JMP_IREL:
 	case elfcpp::R_PPC64_ADDR16_DS:
 	case elfcpp::R_PPC64_ADDR16_LO_DS:
-	case elfcpp::R_PPC64_ADDR16_HIGH:
-	case elfcpp::R_PPC64_ADDR16_HIGHA:
 	case elfcpp::R_PPC64_ADDR16_HIGHER:
 	case elfcpp::R_PPC64_ADDR16_HIGHEST:
 	case elfcpp::R_PPC64_ADDR16_HIGHERA:
@@ -4433,8 +4339,6 @@ Target_powerpc<size, big_endian>::Scan::
 	case elfcpp::R_POWERPC_ADDR30:
 	case elfcpp::R_PPC64_TPREL16_DS:
 	case elfcpp::R_PPC64_TPREL16_LO_DS:
-	case elfcpp::R_PPC64_TPREL16_HIGH:
-	case elfcpp::R_PPC64_TPREL16_HIGHA:
 	case elfcpp::R_PPC64_TPREL16_HIGHER:
 	case elfcpp::R_PPC64_TPREL16_HIGHEST:
 	case elfcpp::R_PPC64_TPREL16_HIGHERA:
@@ -4605,6 +4509,7 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_GNU_VTINHERIT:
     case elfcpp::R_POWERPC_GNU_VTENTRY:
     case elfcpp::R_PPC64_TOCSAVE:
+    case elfcpp::R_PPC_EMB_MRKREF:
     case elfcpp::R_POWERPC_TLS:
       break;
 
@@ -4641,8 +4546,6 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_ADDR16_HI:
     case elfcpp::R_POWERPC_ADDR16_HA:
     case elfcpp::R_POWERPC_UADDR16:
-    case elfcpp::R_PPC64_ADDR16_HIGH:
-    case elfcpp::R_PPC64_ADDR16_HIGHA:
     case elfcpp::R_PPC64_ADDR16_HIGHER:
     case elfcpp::R_PPC64_ADDR16_HIGHERA:
     case elfcpp::R_PPC64_ADDR16_HIGHEST:
@@ -4709,35 +4612,31 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
     case elfcpp::R_POWERPC_SECTOFF:
-    case elfcpp::R_POWERPC_SECTOFF_LO:
-    case elfcpp::R_POWERPC_SECTOFF_HI:
-    case elfcpp::R_POWERPC_SECTOFF_HA:
-    case elfcpp::R_PPC64_SECTOFF_DS:
-    case elfcpp::R_PPC64_SECTOFF_LO_DS:
     case elfcpp::R_POWERPC_TPREL16:
+    case elfcpp::R_POWERPC_DTPREL16:
+    case elfcpp::R_POWERPC_SECTOFF_LO:
     case elfcpp::R_POWERPC_TPREL16_LO:
+    case elfcpp::R_POWERPC_DTPREL16_LO:
+    case elfcpp::R_POWERPC_SECTOFF_HI:
     case elfcpp::R_POWERPC_TPREL16_HI:
+    case elfcpp::R_POWERPC_DTPREL16_HI:
+    case elfcpp::R_POWERPC_SECTOFF_HA:
     case elfcpp::R_POWERPC_TPREL16_HA:
-    case elfcpp::R_PPC64_TPREL16_DS:
-    case elfcpp::R_PPC64_TPREL16_LO_DS:
-    case elfcpp::R_PPC64_TPREL16_HIGH:
-    case elfcpp::R_PPC64_TPREL16_HIGHA:
+    case elfcpp::R_POWERPC_DTPREL16_HA:
+    case elfcpp::R_PPC64_DTPREL16_HIGHER:
     case elfcpp::R_PPC64_TPREL16_HIGHER:
+    case elfcpp::R_PPC64_DTPREL16_HIGHERA:
     case elfcpp::R_PPC64_TPREL16_HIGHERA:
+    case elfcpp::R_PPC64_DTPREL16_HIGHEST:
     case elfcpp::R_PPC64_TPREL16_HIGHEST:
+    case elfcpp::R_PPC64_DTPREL16_HIGHESTA:
     case elfcpp::R_PPC64_TPREL16_HIGHESTA:
-    case elfcpp::R_POWERPC_DTPREL16:
-    case elfcpp::R_POWERPC_DTPREL16_LO:
-    case elfcpp::R_POWERPC_DTPREL16_HI:
-    case elfcpp::R_POWERPC_DTPREL16_HA:
+    case elfcpp::R_PPC64_TPREL16_DS:
+    case elfcpp::R_PPC64_TPREL16_LO_DS:
     case elfcpp::R_PPC64_DTPREL16_DS:
     case elfcpp::R_PPC64_DTPREL16_LO_DS:
-    case elfcpp::R_PPC64_DTPREL16_HIGH:
-    case elfcpp::R_PPC64_DTPREL16_HIGHA:
-    case elfcpp::R_PPC64_DTPREL16_HIGHER:
-    case elfcpp::R_PPC64_DTPREL16_HIGHERA:
-    case elfcpp::R_PPC64_DTPREL16_HIGHEST:
-    case elfcpp::R_PPC64_DTPREL16_HIGHESTA:
+    case elfcpp::R_PPC64_SECTOFF_DS:
+    case elfcpp::R_PPC64_SECTOFF_LO_DS:
     case elfcpp::R_PPC64_TLSGD:
     case elfcpp::R_PPC64_TLSLD:
       break;
@@ -4971,6 +4870,7 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_GNU_VTINHERIT:
     case elfcpp::R_POWERPC_GNU_VTENTRY:
     case elfcpp::R_PPC_LOCAL24PC:
+    case elfcpp::R_PPC_EMB_MRKREF:
     case elfcpp::R_POWERPC_TLS:
       break;
 
@@ -5019,8 +4919,6 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_ADDR16_HI:
     case elfcpp::R_POWERPC_ADDR16_HA:
     case elfcpp::R_POWERPC_UADDR16:
-    case elfcpp::R_PPC64_ADDR16_HIGH:
-    case elfcpp::R_PPC64_ADDR16_HIGHA:
     case elfcpp::R_PPC64_ADDR16_HIGHER:
     case elfcpp::R_PPC64_ADDR16_HIGHERA:
     case elfcpp::R_PPC64_ADDR16_HIGHEST:
@@ -5107,7 +5005,7 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_PPC64_REL64:
     case elfcpp::R_POWERPC_REL32:
       // Make a dynamic relocation if necessary.
-      if (gsym->needs_dynamic_reloc(Scan::get_reference_flags(r_type, target)))
+      if (needs_dynamic_reloc<size>(gsym, Scan::get_reference_flags(r_type)))
 	{
 	  if (gsym->may_need_copy_reloc())
 	    {
@@ -5139,35 +5037,31 @@ Target_powerpc<size, big_endian>::Scan::
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
     case elfcpp::R_POWERPC_SECTOFF:
-    case elfcpp::R_POWERPC_SECTOFF_LO:
-    case elfcpp::R_POWERPC_SECTOFF_HI:
-    case elfcpp::R_POWERPC_SECTOFF_HA:
-    case elfcpp::R_PPC64_SECTOFF_DS:
-    case elfcpp::R_PPC64_SECTOFF_LO_DS:
     case elfcpp::R_POWERPC_TPREL16:
+    case elfcpp::R_POWERPC_DTPREL16:
+    case elfcpp::R_POWERPC_SECTOFF_LO:
     case elfcpp::R_POWERPC_TPREL16_LO:
+    case elfcpp::R_POWERPC_DTPREL16_LO:
+    case elfcpp::R_POWERPC_SECTOFF_HI:
     case elfcpp::R_POWERPC_TPREL16_HI:
+    case elfcpp::R_POWERPC_DTPREL16_HI:
+    case elfcpp::R_POWERPC_SECTOFF_HA:
     case elfcpp::R_POWERPC_TPREL16_HA:
-    case elfcpp::R_PPC64_TPREL16_DS:
-    case elfcpp::R_PPC64_TPREL16_LO_DS:
-    case elfcpp::R_PPC64_TPREL16_HIGH:
-    case elfcpp::R_PPC64_TPREL16_HIGHA:
+    case elfcpp::R_POWERPC_DTPREL16_HA:
+    case elfcpp::R_PPC64_DTPREL16_HIGHER:
     case elfcpp::R_PPC64_TPREL16_HIGHER:
+    case elfcpp::R_PPC64_DTPREL16_HIGHERA:
     case elfcpp::R_PPC64_TPREL16_HIGHERA:
+    case elfcpp::R_PPC64_DTPREL16_HIGHEST:
     case elfcpp::R_PPC64_TPREL16_HIGHEST:
+    case elfcpp::R_PPC64_DTPREL16_HIGHESTA:
     case elfcpp::R_PPC64_TPREL16_HIGHESTA:
-    case elfcpp::R_POWERPC_DTPREL16:
-    case elfcpp::R_POWERPC_DTPREL16_LO:
-    case elfcpp::R_POWERPC_DTPREL16_HI:
-    case elfcpp::R_POWERPC_DTPREL16_HA:
+    case elfcpp::R_PPC64_TPREL16_DS:
+    case elfcpp::R_PPC64_TPREL16_LO_DS:
     case elfcpp::R_PPC64_DTPREL16_DS:
     case elfcpp::R_PPC64_DTPREL16_LO_DS:
-    case elfcpp::R_PPC64_DTPREL16_HIGH:
-    case elfcpp::R_PPC64_DTPREL16_HIGHA:
-    case elfcpp::R_PPC64_DTPREL16_HIGHER:
-    case elfcpp::R_PPC64_DTPREL16_HIGHERA:
-    case elfcpp::R_PPC64_DTPREL16_HIGHEST:
-    case elfcpp::R_PPC64_DTPREL16_HIGHESTA:
+    case elfcpp::R_PPC64_SECTOFF_DS:
+    case elfcpp::R_PPC64_SECTOFF_LO_DS:
     case elfcpp::R_PPC64_TLSGD:
     case elfcpp::R_PPC64_TLSLD:
       break;
@@ -5900,8 +5794,7 @@ Target_powerpc<size, big_endian>::Reloca
 		  && (insn2 == nop
 		      || insn2 == cror_15_15_15 || insn2 == cror_31_31_31))
 		{
-		  elfcpp::Swap<32, big_endian>::
-		    writeval(wv + 1, ld_2_1 + target->stk_toc());
+		  elfcpp::Swap<32, big_endian>::writeval(wv + 1, ld_2_1 + 40);
 		  can_plt_call = true;
 		}
 	    }
@@ -6190,10 +6083,6 @@ Target_powerpc<size, big_endian>::Reloca
       if (r_type != elfcpp::R_PPC_PLTREL24)
 	addend = rela.get_r_addend();
       value = psymval->value(object, addend);
-      if (gsym != NULL)
-	value += object->ppc64_local_entry_offset(gsym);
-      else
-	value += object->ppc64_local_entry_offset(r_sym);
       if (size == 64 && is_branch_reloc(r_type))
 	value = target->symval_for_branch(value, gsym, object, &dest_shndx);
       unsigned int max_branch_offset = 0;
@@ -6257,10 +6146,8 @@ Target_powerpc<size, big_endian>::Reloca
 
     case elfcpp::R_PPC64_TPREL16_DS:
     case elfcpp::R_PPC64_TPREL16_LO_DS:
-    case elfcpp::R_PPC64_TPREL16_HIGH:
-    case elfcpp::R_PPC64_TPREL16_HIGHA:
       if (size != 64)
-	// R_PPC_TLSGD, R_PPC_TLSLD, R_PPC_EMB_RELST_LO, R_PPC_EMB_RELST_HI
+	// R_PPC_TLSGD and R_PPC_TLSLD
 	break;
     case elfcpp::R_POWERPC_TPREL16:
     case elfcpp::R_POWERPC_TPREL16_LO:
@@ -6290,8 +6177,6 @@ Target_powerpc<size, big_endian>::Reloca
     case elfcpp::R_POWERPC_DTPREL16_HI:
     case elfcpp::R_POWERPC_DTPREL16_HA:
     case elfcpp::R_POWERPC_DTPREL:
-    case elfcpp::R_PPC64_DTPREL16_HIGH:
-    case elfcpp::R_PPC64_DTPREL16_HIGHA:
       // tls symbol values are relative to tls_segment()->vaddr()
       value -= dtp_offset;
       break;
@@ -6432,34 +6317,6 @@ Target_powerpc<size, big_endian>::Reloca
       overflow = Reloc::CHECK_BITFIELD;
       break;
 
-    case elfcpp::R_POWERPC_ADDR16_HI:
-    case elfcpp::R_POWERPC_ADDR16_HA:
-    case elfcpp::R_POWERPC_GOT16_HI:
-    case elfcpp::R_POWERPC_GOT16_HA:
-    case elfcpp::R_POWERPC_PLT16_HI:
-    case elfcpp::R_POWERPC_PLT16_HA:
-    case elfcpp::R_POWERPC_SECTOFF_HI:
-    case elfcpp::R_POWERPC_SECTOFF_HA:
-    case elfcpp::R_PPC64_TOC16_HI:
-    case elfcpp::R_PPC64_TOC16_HA:
-    case elfcpp::R_PPC64_PLTGOT16_HI:
-    case elfcpp::R_PPC64_PLTGOT16_HA:
-    case elfcpp::R_POWERPC_TPREL16_HI:
-    case elfcpp::R_POWERPC_TPREL16_HA:
-    case elfcpp::R_POWERPC_DTPREL16_HI:
-    case elfcpp::R_POWERPC_DTPREL16_HA:
-    case elfcpp::R_POWERPC_GOT_TLSGD16_HI:
-    case elfcpp::R_POWERPC_GOT_TLSGD16_HA:
-    case elfcpp::R_POWERPC_GOT_TLSLD16_HI:
-    case elfcpp::R_POWERPC_GOT_TLSLD16_HA:
-    case elfcpp::R_POWERPC_GOT_TPREL16_HI:
-    case elfcpp::R_POWERPC_GOT_TPREL16_HA:
-    case elfcpp::R_POWERPC_GOT_DTPREL16_HI:
-    case elfcpp::R_POWERPC_GOT_DTPREL16_HA:
-    case elfcpp::R_POWERPC_REL16_HI:
-    case elfcpp::R_POWERPC_REL16_HA:
-      if (size == 32)
-	break;
     case elfcpp::R_POWERPC_REL24:
     case elfcpp::R_PPC_PLTREL24:
     case elfcpp::R_PPC_LOCAL24PC:
@@ -6493,6 +6350,7 @@ Target_powerpc<size, big_endian>::Reloca
     case elfcpp::R_POWERPC_TLS:
     case elfcpp::R_POWERPC_GNU_VTINHERIT:
     case elfcpp::R_POWERPC_GNU_VTENTRY:
+    case elfcpp::R_PPC_EMB_MRKREF:
       break;
 
     case elfcpp::R_PPC64_ADDR64:
@@ -6563,12 +6421,6 @@ Target_powerpc<size, big_endian>::Reloca
       status = Reloc::addr16_u(view, value, overflow);
       break;
 
-    case elfcpp::R_PPC64_ADDR16_HIGH:
-    case elfcpp::R_PPC64_TPREL16_HIGH:
-    case elfcpp::R_PPC64_DTPREL16_HIGH:
-      if (size == 32)
-	// R_PPC_EMB_MRKREF, R_PPC_EMB_RELST_LO, R_PPC_EMB_RELST_HA
-	goto unsupp;
     case elfcpp::R_POWERPC_ADDR16_HI:
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_PPC64_TOC16_HI:
@@ -6583,12 +6435,6 @@ Target_powerpc<size, big_endian>::Reloca
       Reloc::addr16_hi(view, value);
       break;
 
-    case elfcpp::R_PPC64_ADDR16_HIGHA:
-    case elfcpp::R_PPC64_TPREL16_HIGHA:
-    case elfcpp::R_PPC64_DTPREL16_HIGHA:
-      if (size == 32)
-	// R_PPC_EMB_RELSEC16, R_PPC_EMB_RELST_HI, R_PPC_EMB_BIT_FLD
-	goto unsupp;
     case elfcpp::R_POWERPC_ADDR16_HA:
     case elfcpp::R_POWERPC_REL16_HA:
     case elfcpp::R_PPC64_TOC16_HA:
@@ -6713,6 +6559,11 @@ Target_powerpc<size, big_endian>::Reloca
     case elfcpp::R_PPC64_PLT16_LO_DS:
     case elfcpp::R_PPC64_PLTGOT16_DS:
     case elfcpp::R_PPC64_PLTGOT16_LO_DS:
+    case elfcpp::R_PPC_EMB_RELSEC16:
+    case elfcpp::R_PPC_EMB_RELST_LO:
+    case elfcpp::R_PPC_EMB_RELST_HI:
+    case elfcpp::R_PPC_EMB_RELST_HA:
+    case elfcpp::R_PPC_EMB_BIT_FLD:
     case elfcpp::R_PPC_EMB_RELSDA:
     case elfcpp::R_PPC_TOC16:
     default: