Merge "Rename ROCm Threads AMDGPU Threads" into amd-common
[deliverable/binutils-gdb.git] / bfd / elf64-sparc.c
index f523ce7f84688b5cfb74150bd1c8643bc335e0a9..8bf9623bd9fca6e240db79135353c19a2391fbb8 100644 (file)
    section can represent up to two relocs, we must tell the user to allocate
    more space.  */
 
-#if GCC_VERSION >= 4003
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wtype-limits"
-#endif
 static long
 elf64_sparc_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
 {
+#if SIZEOF_LONG == SIZEOF_INT
   if (sec->reloc_count >= LONG_MAX / 2 / sizeof (arelent *))
     {
       bfd_set_error (bfd_error_file_too_big);
       return -1;
     }
+#endif
   return (sec->reloc_count * 2 + 1) * sizeof (arelent *);
 }
-#if GCC_VERSION >= 4003
-# pragma GCC diagnostic pop
-#endif
 
 static long
 elf64_sparc_get_dynamic_reloc_upper_bound (bfd *abfd)
@@ -121,17 +116,17 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect,
       if (ELF64_R_SYM (rela.r_info) == STN_UNDEF)
        relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
       else if (/* PR 17512: file: 996185f8.  */
-               (!dynamic && ELF64_R_SYM(rela.r_info) > bfd_get_symcount(abfd))
-               || (dynamic
-                   && ELF64_R_SYM(rela.r_info) > bfd_get_dynamic_symcount(abfd)))
-        {
-          _bfd_error_handler
+              ELF64_R_SYM (rela.r_info) > (dynamic
+                                           ? bfd_get_dynamic_symcount (abfd)
+                                           : bfd_get_symcount (abfd)))
+       {
+         _bfd_error_handler
            /* xgettext:c-format */
            (_("%pB(%pA): relocation %d has invalid symbol index %ld"),
             abfd, asect, i, (long) ELF64_R_SYM (rela.r_info));
          bfd_set_error (bfd_error_bad_value);
          relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
-        }
+       }
       else
        {
          asymbol **ps, *s;
@@ -753,7 +748,7 @@ elf64_sparc_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
 {
   const char *name;
 
-  name = bfd_get_section_name (abfd, sec);
+  name = bfd_section_name (sec);
 
   if (strcmp (name, ".stab") == 0)
     {
This page took 0.025001 seconds and 4 git commands to generate.