Implement PowerPC64 .localentry for value 1
[deliverable/binutils-gdb.git] / gas / config / tc-ppc.c
index 92e5eb5d39c00cc788c99fcda864a696a745dd3d..4388b2570b94a565f071424b2378e6ccbd75bf79 100644 (file)
@@ -2378,12 +2378,22 @@ ppc_elf_localentry (int ignore ATTRIBUTE_UNUSED)
   if (resolve_expression (&exp)
       && exp.X_op == O_constant)
     {
-      unsigned char encoded = PPC64_SET_LOCAL_ENTRY_OFFSET (exp.X_add_number);
+      unsigned int encoded, ok;
 
-      if (exp.X_add_number != (offsetT) PPC64_LOCAL_ENTRY_OFFSET (encoded))
-        as_bad (_(".localentry expression for `%s' "
-                 "is not a valid power of 2"), S_GET_NAME (sym));
+      ok = 1;
+      if (exp.X_add_number == 1 || exp.X_add_number == 7)
+       encoded = exp.X_add_number << STO_PPC64_LOCAL_BIT;
       else
+       {
+         encoded = PPC64_SET_LOCAL_ENTRY_OFFSET (exp.X_add_number);
+         if (exp.X_add_number != (offsetT) PPC64_LOCAL_ENTRY_OFFSET (encoded))
+           {
+             as_bad (_(".localentry expression for `%s' "
+                       "is not a valid power of 2"), S_GET_NAME (sym));
+             ok = 0;
+           }
+       }
+      if (ok)
        {
          bfdsym = symbol_get_bfdsym (sym);
          elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
This page took 0.02347 seconds and 4 git commands to generate.