Support 64-bit entry size in SHT_HASH (for s390).
[deliverable/binutils-gdb.git] / gold / aarch64.cc
index 4153389643e392392492fababe67ee676dc4cf54..2dcd6204cdd7166f3468ec48326f259d2bde676e 100644 (file)
@@ -2023,7 +2023,7 @@ AArch64_relobj<size, big_endian>::try_fix_erratum_843419_optimized(
   if (-(1 << 20) <= adr_imm && adr_imm < (1 << 20))
     {
       // Convert 'adrp' into 'adr'.
-      Insntype adr_insn = adrp_insn & ((1 << 31) - 1);
+      Insntype adr_insn = adrp_insn & ((1u << 31) - 1);
       adr_insn = Insn_utilities::
        aarch64_adr_encode_imm(adr_insn, adr_imm);
       elfcpp::Swap<32, big_endian>::writeval(adrp_view, adr_insn);
@@ -3424,7 +3424,7 @@ const Target::Target_info Target_aarch64<64, false>::aarch64_info =
   '\0',                        // wrap_char
   "/lib/ld.so.1",      // program interpreter
   0x400000,            // default_text_segment_address
-  0x1000             // abi_pagesize (overridable by -z max-page-size)
+  0x10000,             // abi_pagesize (overridable by -z max-page-size)
   0x1000,              // common_pagesize (overridable by -z common-page-size)
   false,                // isolate_execinstr
   0,                    // rosegment_gap
@@ -3434,7 +3434,8 @@ const Target::Target_info Target_aarch64<64, false>::aarch64_info =
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
   NULL,                        // attributes_vendor
-  "_start"             // entry_symbol_name
+  "_start",            // entry_symbol_name
+  32,                  // hash_entry_size
 };
 
 template<>
@@ -3451,7 +3452,7 @@ const Target::Target_info Target_aarch64<32, false>::aarch64_info =
   '\0',                        // wrap_char
   "/lib/ld.so.1",      // program interpreter
   0x400000,            // default_text_segment_address
-  0x1000             // abi_pagesize (overridable by -z max-page-size)
+  0x10000,             // abi_pagesize (overridable by -z max-page-size)
   0x1000,              // common_pagesize (overridable by -z common-page-size)
   false,                // isolate_execinstr
   0,                    // rosegment_gap
@@ -3461,7 +3462,8 @@ const Target::Target_info Target_aarch64<32, false>::aarch64_info =
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
   NULL,                        // attributes_vendor
-  "_start"             // entry_symbol_name
+  "_start",            // entry_symbol_name
+  32,                  // hash_entry_size
 };
 
 template<>
@@ -3478,7 +3480,7 @@ const Target::Target_info Target_aarch64<64, true>::aarch64_info =
   '\0',                        // wrap_char
   "/lib/ld.so.1",      // program interpreter
   0x400000,            // default_text_segment_address
-  0x1000             // abi_pagesize (overridable by -z max-page-size)
+  0x10000,             // abi_pagesize (overridable by -z max-page-size)
   0x1000,              // common_pagesize (overridable by -z common-page-size)
   false,                // isolate_execinstr
   0,                    // rosegment_gap
@@ -3488,7 +3490,8 @@ const Target::Target_info Target_aarch64<64, true>::aarch64_info =
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
   NULL,                        // attributes_vendor
-  "_start"             // entry_symbol_name
+  "_start",            // entry_symbol_name
+  32,                  // hash_entry_size
 };
 
 template<>
@@ -3505,7 +3508,7 @@ const Target::Target_info Target_aarch64<32, true>::aarch64_info =
   '\0',                        // wrap_char
   "/lib/ld.so.1",      // program interpreter
   0x400000,            // default_text_segment_address
-  0x1000             // abi_pagesize (overridable by -z max-page-size)
+  0x10000,             // abi_pagesize (overridable by -z max-page-size)
   0x1000,              // common_pagesize (overridable by -z common-page-size)
   false,                // isolate_execinstr
   0,                    // rosegment_gap
@@ -3515,7 +3518,8 @@ const Target::Target_info Target_aarch64<32, true>::aarch64_info =
   0,                   // large_common_section_flags
   NULL,                        // attributes_section
   NULL,                        // attributes_vendor
-  "_start"             // entry_symbol_name
+  "_start",            // entry_symbol_name
+  32,                  // hash_entry_size
 };
 
 // Get the GOT section, creating it if necessary.
@@ -5987,6 +5991,29 @@ Target_aarch64<size, big_endian>::Scan::local(
     case elfcpp::R_AARCH64_PREL16:
       break;
 
+    case elfcpp::R_AARCH64_ADR_GOT_PAGE:
+    case elfcpp::R_AARCH64_LD64_GOT_LO12_NC:
+      // This pair of relocations is used to access a specific GOT entry.
+      {
+       bool is_new = false;
+       // This symbol requires a GOT entry.
+       if (is_ifunc)
+         is_new = got->add_local_plt(object, r_sym, GOT_TYPE_STANDARD);
+       else
+         is_new = got->add_local(object, r_sym, GOT_TYPE_STANDARD);
+       if (is_new && parameters->options().output_is_position_independent())
+         target->rela_dyn_section(layout)->
+           add_local_relative(object,
+                              r_sym,
+                              elfcpp::R_AARCH64_RELATIVE,
+                              got,
+                              object->local_got_offset(r_sym,
+                                                       GOT_TYPE_STANDARD),
+                              0,
+                              false);
+      }
+      break;
+
     case elfcpp::R_AARCH64_LD_PREL_LO19:        // 273
     case elfcpp::R_AARCH64_ADR_PREL_LO21:       // 274
     case elfcpp::R_AARCH64_ADR_PREL_PG_HI21:    // 275
This page took 0.025078 seconds and 4 git commands to generate.