[GOLD] R_PPC64_REL16_HIGH relocs
authorAlan Modra <amodra@gmail.com>
Fri, 28 Jun 2019 00:47:08 +0000 (10:17 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 28 Jun 2019 00:47:08 +0000 (10:17 +0930)
These relocs have been around for quite a while.  It's past time gold
supported them.

elfcpp/
* powerpc.h (R_PPC64_REL16_HIGH, R_PPC64_REL16_HIGHA),
(R_PPC64_REL16_HIGHER, R_PPC64_REL16_HIGHERA),
(R_PPC64_REL16_HIGHEST, R_PPC64_REL16_HIGHESTA): Define.

gold/
* powerpc.cc (Target_powerpc::Scan::get_reference_flags): Handle
REL16_HIGH* relocs.
(Target_powerpc::Scan::local): Likewise.
(Target_powerpc::Scan::global): Likewise.
(Target_powerpc::Relocate::relocate): Likewise.

elfcpp/ChangeLog
elfcpp/powerpc.h
gold/ChangeLog
gold/powerpc.cc

index fbb045be656fe571e3580b9c11671650bcda23ca..0565d7889b992a7986c62d3733f61773d01b06a3 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-28  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.h (R_PPC64_REL16_HIGH, R_PPC64_REL16_HIGHA),
+       (R_PPC64_REL16_HIGHER, R_PPC64_REL16_HIGHERA),
+       (R_PPC64_REL16_HIGHEST, R_PPC64_REL16_HIGHESTA): Define.
+
 2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        * arm.h (Tag_MVE_arch): Define new enum value.
index cb0e05e016f4fff5b0ce339ad8bdf65ca15af151..4008f55966f61ddc51b24148afd0a8858d82aba9 100644 (file)
@@ -200,6 +200,13 @@ enum
   R_PPC_VLE_SDAREL_HA16A = 231,
   R_PPC_VLE_SDAREL_HA16D = 232,
 
+  R_PPC64_REL16_HIGH = 240,
+  R_PPC64_REL16_HIGHA = 241,
+  R_PPC64_REL16_HIGHER = 242,
+  R_PPC64_REL16_HIGHERA = 243,
+  R_PPC64_REL16_HIGHEST = 244,
+  R_PPC64_REL16_HIGHESTA = 245,
+
   R_POWERPC_REL16DX_HA = 246,
   R_PPC64_JMP_IREL = 247,
   R_POWERPC_IRELATIVE = 248,
index 1c66f6e70cd65281d4c832f1cd688715a1a0a88d..955e556c60acfef755f7cc92683e7dec7ae6ae7a 100644 (file)
@@ -1,3 +1,11 @@
+2019-06-28  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Handle
+       REL16_HIGH* relocs.
+       (Target_powerpc::Scan::local): Likewise.
+       (Target_powerpc::Scan::global): Likewise.
+       (Target_powerpc::Relocate::relocate): Likewise.
+
 2019-06-10  Martin Liska  <mliska@suse.cz>
 
        * errors.h: Include string.
index e251a9341f482aab87d85928b21129490ca67783..1f2407130b243a1733e8c8256ac1e14fd1a850e9 100644 (file)
@@ -6464,6 +6464,12 @@ Target_powerpc<size, big_endian>::Scan::get_reference_flags(
     case elfcpp::R_POWERPC_REL16_LO:
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
+    case elfcpp::R_PPC64_REL16_HIGH:
+    case elfcpp::R_PPC64_REL16_HIGHA:
+    case elfcpp::R_PPC64_REL16_HIGHER:
+    case elfcpp::R_PPC64_REL16_HIGHERA:
+    case elfcpp::R_PPC64_REL16_HIGHEST:
+    case elfcpp::R_PPC64_REL16_HIGHESTA:
       ref = Symbol::RELATIVE_REF;
       break;
 
@@ -6964,6 +6970,12 @@ Target_powerpc<size, big_endian>::Scan::local(
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
     case elfcpp::R_POWERPC_REL16DX_HA:
+    case elfcpp::R_PPC64_REL16_HIGH:
+    case elfcpp::R_PPC64_REL16_HIGHA:
+    case elfcpp::R_PPC64_REL16_HIGHER:
+    case elfcpp::R_PPC64_REL16_HIGHERA:
+    case elfcpp::R_PPC64_REL16_HIGHEST:
+    case elfcpp::R_PPC64_REL16_HIGHESTA:
     case elfcpp::R_POWERPC_SECTOFF:
     case elfcpp::R_POWERPC_SECTOFF_LO:
     case elfcpp::R_POWERPC_SECTOFF_HI:
@@ -7604,6 +7616,12 @@ Target_powerpc<size, big_endian>::Scan::global(
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
     case elfcpp::R_POWERPC_REL16DX_HA:
+    case elfcpp::R_PPC64_REL16_HIGH:
+    case elfcpp::R_PPC64_REL16_HIGHA:
+    case elfcpp::R_PPC64_REL16_HIGHER:
+    case elfcpp::R_PPC64_REL16_HIGHERA:
+    case elfcpp::R_PPC64_REL16_HIGHEST:
+    case elfcpp::R_PPC64_REL16_HIGHESTA:
     case elfcpp::R_POWERPC_SECTOFF:
     case elfcpp::R_POWERPC_SECTOFF_LO:
     case elfcpp::R_POWERPC_SECTOFF_HI:
@@ -9411,6 +9429,12 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
     case elfcpp::R_POWERPC_REL16_HI:
     case elfcpp::R_POWERPC_REL16_HA:
     case elfcpp::R_POWERPC_REL16DX_HA:
+    case elfcpp::R_PPC64_REL16_HIGH:
+    case elfcpp::R_PPC64_REL16_HIGHA:
+    case elfcpp::R_PPC64_REL16_HIGHER:
+    case elfcpp::R_PPC64_REL16_HIGHERA:
+    case elfcpp::R_PPC64_REL16_HIGHEST:
+    case elfcpp::R_PPC64_REL16_HIGHESTA:
     case elfcpp::R_POWERPC_REL14:
     case elfcpp::R_POWERPC_REL14_BRTAKEN:
     case elfcpp::R_POWERPC_REL14_BRNTAKEN:
@@ -9973,6 +9997,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
       // Fall through.
     case elfcpp::R_POWERPC_ADDR16_HI:
     case elfcpp::R_POWERPC_REL16_HI:
+    case elfcpp::R_PPC64_REL16_HIGH:
     case elfcpp::R_PPC64_TOC16_HI:
     case elfcpp::R_POWERPC_GOT16_HI:
     case elfcpp::R_POWERPC_PLT16_HI:
@@ -9995,6 +10020,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
       // Fall through.
     case elfcpp::R_POWERPC_ADDR16_HA:
     case elfcpp::R_POWERPC_REL16_HA:
+    case elfcpp::R_PPC64_REL16_HIGHA:
     case elfcpp::R_PPC64_TOC16_HA:
     case elfcpp::R_POWERPC_GOT16_HA:
     case elfcpp::R_POWERPC_PLT16_HA:
@@ -10018,6 +10044,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
        goto unsupp;
       // Fall through.
     case elfcpp::R_PPC64_ADDR16_HIGHER:
+    case elfcpp::R_PPC64_REL16_HIGHER:
     case elfcpp::R_PPC64_TPREL16_HIGHER:
       Reloc::addr16_hi2(view, value);
       break;
@@ -10028,6 +10055,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
        goto unsupp;
       // Fall through.
     case elfcpp::R_PPC64_ADDR16_HIGHERA:
+    case elfcpp::R_PPC64_REL16_HIGHERA:
     case elfcpp::R_PPC64_TPREL16_HIGHERA:
       Reloc::addr16_ha2(view, value);
       break;
@@ -10038,6 +10066,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
        goto unsupp;
       // Fall through.
     case elfcpp::R_PPC64_ADDR16_HIGHEST:
+    case elfcpp::R_PPC64_REL16_HIGHEST:
     case elfcpp::R_PPC64_TPREL16_HIGHEST:
       Reloc::addr16_hi3(view, value);
       break;
@@ -10048,6 +10077,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
        goto unsupp;
       // Fall through.
     case elfcpp::R_PPC64_ADDR16_HIGHESTA:
+    case elfcpp::R_PPC64_REL16_HIGHESTA:
     case elfcpp::R_PPC64_TPREL16_HIGHESTA:
       Reloc::addr16_ha3(view, value);
       break;