Update my email address in MAINTAINERS
[deliverable/binutils-gdb.git] / bfd / elf32-epiphany.c
index 9e61ed59032e2e926a06ced0d2d639b5d0cf879b..6de4211546be8fccc39b842b62c6f46ab989f44b 100644 (file)
@@ -1,5 +1,5 @@
 /* Adapteva epiphany specific support for 32-bit ELF
 /* Adapteva epiphany specific support for 32-bit ELF
-   Copyright (C) 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 2000-2021 Free Software Foundation, Inc.
    Contributed by Embecosm on behalf of Adapteva, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
    Contributed by Embecosm on behalf of Adapteva, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -42,7 +42,7 @@ struct epiphany_opcode
   unsigned short mask;
 };
 
   unsigned short mask;
 };
 
-static bfd_boolean epiphany_relaxed = FALSE;
+static bool epiphany_relaxed = false;
 
 /* Relocation tables.  */
 static reloc_howto_type epiphany_elf_howto_table [] =
 
 /* Relocation tables.  */
 static reloc_howto_type epiphany_elf_howto_table [] =
@@ -57,45 +57,45 @@ static reloc_howto_type epiphany_elf_howto_table [] =
          co,                   /* complain_on_overflow */             \
          bfd_elf_generic_reloc,/* special_function */ \
          name,                 /* name */ \
          co,                   /* complain_on_overflow */             \
          bfd_elf_generic_reloc,/* special_function */ \
          name,                 /* name */ \
-         FALSE,                /* partial_inplace */ \
+         false,                /* partial_inplace */ \
          sm,                   /* src_mask */ \
          dm,                   /* dst_mask */ \
          pr)                   /* pcrel_offset */
 
   /* This reloc does nothing.  */
          sm,                   /* src_mask */ \
          dm,                   /* dst_mask */ \
          pr)                   /* pcrel_offset */
 
   /* This reloc does nothing.  */
-  AHOW (R_EPIPHANY_NONE,    0, 3,0, FALSE, 0, complain_overflow_dont,    "R_EPIPHANY_NONE",        0,          0),
+  AHOW (R_EPIPHANY_NONE,    0, 3,0, false, 0, complain_overflow_dont,    "R_EPIPHANY_NONE",        0,          0),
 
   /* 8 bit absolute (not likely) */
 
   /* 8 bit absolute (not likely) */
-  AHOW (R_EPIPHANY_8,      0, 0, 8, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_8",      0x000000ff, 0x000000ff),
+  AHOW (R_EPIPHANY_8,      0, 0, 8, false, 0, complain_overflow_bitfield, "R_EPIPHANY_8",      0x000000ff, 0x000000ff),
   /* 16 bit absolute */
   /* 16 bit absolute */
-  AHOW (R_EPIPHANY_16,     0, 1,16, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_16",     0x0000ffff, 0x00ff1fe0),
+  AHOW (R_EPIPHANY_16,     0, 1,16, false, 0, complain_overflow_bitfield, "R_EPIPHANY_16",     0x0000ffff, 0x00ff1fe0),
   /* A 32 bit absolute relocation.  */
   /* A 32 bit absolute relocation.  */
-  AHOW (R_EPIPHANY_32,     0, 2,32, FALSE, 0, complain_overflow_dont,     "R_EPIPHANY_32",     0xffffffff, 0xffffffff),
+  AHOW (R_EPIPHANY_32,     0, 2,32, false, 0, complain_overflow_dont,     "R_EPIPHANY_32",     0xffffffff, 0xffffffff),
 
   /*  8 bit relative relocation */
 
   /*  8 bit relative relocation */
-  HOWTO ( R_EPIPHANY_8_PCREL,  0, 0,  8, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", FALSE, 0x000000ff, 0x000000ff, FALSE),
+  HOWTO ( R_EPIPHANY_8_PCREL,  0, 0,  8, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", false, 0x000000ff, 0x000000ff, false),
   /* 16 bit relative relocation */
   /* 16 bit relative relocation */
-  HOWTO ( R_EPIPHANY_16_PCREL, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", FALSE, 0x000000ff, 0x000000ff, FALSE),
+  HOWTO ( R_EPIPHANY_16_PCREL, 0, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", false, 0x000000ff, 0x000000ff, false),
   /* 32 bit relative relocation */
   /* 32 bit relative relocation */
-  HOWTO ( R_EPIPHANY_32_PCREL, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", FALSE, 0x000000ff, 0x000000ff, FALSE),
+  HOWTO ( R_EPIPHANY_32_PCREL, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", false, 0x000000ff, 0x000000ff, false),
 
   /* 8 bit pc-relative relocation */
 
   /* 8 bit pc-relative relocation */
-  AHOW (R_EPIPHANY_SIMM8,   1, 0, 8,  TRUE, 8, complain_overflow_signed,   "R_EPIPHANY_SIMM8",  0x000000ff, 0x0000ff00),
+  AHOW (R_EPIPHANY_SIMM8,   1, 0, 8,  true, 8, complain_overflow_signed,   "R_EPIPHANY_SIMM8",  0x000000ff, 0x0000ff00),
   /* 24 bit pc-relative relocation */
   /* 24 bit pc-relative relocation */
-  AHOW (R_EPIPHANY_SIMM24,  1, 2,24,  TRUE, 8, complain_overflow_signed,   "R_EPIPHANY_SIMM24",         0x00ffffff, 0xffffff00),
+  AHOW (R_EPIPHANY_SIMM24,  1, 2,24,  true, 8, complain_overflow_signed,   "R_EPIPHANY_SIMM24",         0x00ffffff, 0xffffff00),
 
   /* %HIGH(EA) */
 
   /* %HIGH(EA) */
-  AHOW (R_EPIPHANY_HIGH,    0, 2,16, FALSE, 0, complain_overflow_dont,    "R_EPIPHANY_HIGH",    0x0ff01fe0, 0x0ff01fe0),
+  AHOW (R_EPIPHANY_HIGH,    0, 2,16, false, 0, complain_overflow_dont,    "R_EPIPHANY_HIGH",    0x0ff01fe0, 0x0ff01fe0),
 
   /* %LOW(EA) */
 
   /* %LOW(EA) */
-  AHOW (R_EPIPHANY_LOW,            0, 2,16, FALSE, 0, complain_overflow_dont,  "R_EPIPHANY_LOW",     0x0ff01fe0, 0x0ff01fe0),
+  AHOW (R_EPIPHANY_LOW,            0, 2,16, false, 0, complain_overflow_dont,  "R_EPIPHANY_LOW",     0x0ff01fe0, 0x0ff01fe0),
 
   /* simm11 */
 
   /* simm11 */
-  AHOW (R_EPIPHANY_SIMM11,  0, 2,11, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_SIMM11",         0x00ff0380, 0x00ff0380),
+  AHOW (R_EPIPHANY_SIMM11,  0, 2,11, false, 0, complain_overflow_bitfield, "R_EPIPHANY_SIMM11",         0x00ff0380, 0x00ff0380),
   /* imm12 - sign-magnitude */
   /* imm12 - sign-magnitude */
-  AHOW (R_EPIPHANY_IMM11,   0, 2,11, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_IMM12",  0x00ff0380, 0x00ff0380),
+  AHOW (R_EPIPHANY_IMM11,   0, 2,11, false, 0, complain_overflow_bitfield, "R_EPIPHANY_IMM12",  0x00ff0380, 0x00ff0380),
   /* imm8 */
   /* imm8 */
-  AHOW (R_EPIPHANY_IMM8,    0, 1, 8, FALSE, 8, complain_overflow_signed,   "R_EPIPHANY_IMM8",   0x0000ff00, 0x0000ff00)
+  AHOW (R_EPIPHANY_IMM8,    0, 1, 8, false, 8, complain_overflow_signed,   "R_EPIPHANY_IMM8",   0x0000ff00, 0x0000ff00)
 
 
 };
 
 
 };
@@ -175,10 +175,10 @@ epiphany_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
 /* This function handles relaxing for the epiphany.
    Dummy placeholder for future optimizations.  */
 
 /* This function handles relaxing for the epiphany.
    Dummy placeholder for future optimizations.  */
 
-static bfd_boolean
+static bool
 epiphany_elf_relax_section (bfd *abfd, asection *sec,
                            struct bfd_link_info *link_info,
 epiphany_elf_relax_section (bfd *abfd, asection *sec,
                            struct bfd_link_info *link_info,
-                           bfd_boolean *again)
+                           bool *again)
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *internal_relocs;
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *internal_relocs;
@@ -189,24 +189,24 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
   static unsigned long page_start = 0;
   static unsigned long page_end = 0;
   static unsigned int pass = 0;
   static unsigned long page_start = 0;
   static unsigned long page_end = 0;
   static unsigned int pass = 0;
-  static bfd_boolean new_pass = FALSE;
-  static bfd_boolean changed = FALSE;
+  static bool new_pass = false;
+  static bool changed = false;
   struct misc misc ATTRIBUTE_UNUSED;
   asection *stab;
 
   /* Assume nothing changes.  */
   struct misc misc ATTRIBUTE_UNUSED;
   asection *stab;
 
   /* Assume nothing changes.  */
-  *again = FALSE;
+  *again = false;
 
   if (first_section == NULL)
     {
 
   if (first_section == NULL)
     {
-      epiphany_relaxed = TRUE;
+      epiphany_relaxed = true;
       first_section = sec;
     }
 
   if (first_section == sec)
     {
       pass++;
       first_section = sec;
     }
 
   if (first_section == sec)
     {
       pass++;
-      new_pass = TRUE;
+      new_pass = true;
     }
 
   /* We don't have to do anything for a relocatable link,
     }
 
   /* We don't have to do anything for a relocatable link,
@@ -216,7 +216,7 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
       || (sec->flags & SEC_RELOC) == 0
       || sec->reloc_count == 0
       || (sec->flags & SEC_CODE) == 0)
       || (sec->flags & SEC_RELOC) == 0
       || sec->reloc_count == 0
       || (sec->flags & SEC_CODE) == 0)
-    return TRUE;
+    return true;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
@@ -278,8 +278,8 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
       if (new_pass)
        {
          pass = 1;
       if (new_pass)
        {
          pass = 1;
-         new_pass = FALSE;
-         changed = TRUE; /* Pre-initialize to break out of pass 1.  */
+         new_pass = false;
+         changed = true; /* Pre-initialize to break out of pass 1.  */
          search_addr = 0xFFFFFFFF;
        }
 
          search_addr = 0xFFFFFFFF;
        }
 
@@ -292,15 +292,15 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
            search_addr = BASEADDR (sec);
 
          /* Found a page => more work to do.  */
            search_addr = BASEADDR (sec);
 
          /* Found a page => more work to do.  */
-         *again = TRUE;
+         *again = true;
        }
     }
   else
     {
       if (new_pass)
        {
        }
     }
   else
     {
       if (new_pass)
        {
-         new_pass = FALSE;
-         changed = FALSE;
+         new_pass = false;
+         changed = false;
          page_start = PAGENO (search_addr);
          page_end = page_start | 0x00003FFF;
        }
          page_start = PAGENO (search_addr);
          page_end = page_start | 0x00003FFF;
        }
@@ -313,9 +313,9 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
          if (!epiphany_elf_relax_section_page (abfd, sec, &changed, &misc,
                                                page_start, page_end))
 #endif
          if (!epiphany_elf_relax_section_page (abfd, sec, &changed, &misc,
                                                page_start, page_end))
 #endif
-           return FALSE;
+           return false;
        }
        }
-      *again = TRUE;
+      *again = true;
     }
 
   /* Perform some house keeping after relaxing the section.  */
     }
 
   /* Perform some house keeping after relaxing the section.  */
@@ -344,7 +344,7 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
   if (elf_section_data (sec)->relocs != internal_relocs)
     free (internal_relocs);
 
   if (elf_section_data (sec)->relocs != internal_relocs)
     free (internal_relocs);
 
-  return TRUE;
+  return true;
 
  error_return:
   if (symtab_hdr->contents != (unsigned char *) isymbuf)
 
  error_return:
   if (symtab_hdr->contents != (unsigned char *) isymbuf)
@@ -353,12 +353,12 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec,
     free (contents);
   if (elf_section_data (sec)->relocs != internal_relocs)
     free (internal_relocs);
     free (contents);
   if (elf_section_data (sec)->relocs != internal_relocs)
     free (internal_relocs);
-  return FALSE;
+  return false;
 }
 
 /* Set the howto pointer for a EPIPHANY ELF reloc.  */
 
 }
 
 /* Set the howto pointer for a EPIPHANY ELF reloc.  */
 
-static bfd_boolean
+static bool
 epiphany_info_to_howto_rela (bfd * abfd,
                             arelent * cache_ptr,
                             Elf_Internal_Rela * dst)
 epiphany_info_to_howto_rela (bfd * abfd,
                             arelent * cache_ptr,
                             Elf_Internal_Rela * dst)
@@ -372,10 +372,10 @@ epiphany_info_to_howto_rela (bfd * abfd,
       _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
                          abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
                          abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
-      return FALSE;
+      return false;
     }
   cache_ptr->howto = & epiphany_elf_howto_table [r_type];
     }
   cache_ptr->howto = & epiphany_elf_howto_table [r_type];
-  return TRUE;
+  return true;
 }
 
 /* Perform a single relocation.
 }
 
 /* Perform a single relocation.
@@ -468,7 +468,7 @@ epiphany_final_link_relocate (reloc_howto_type *  howto,
    section, which means that the addend must be adjusted
    accordingly.  */
 
    section, which means that the addend must be adjusted
    accordingly.  */
 
-static bfd_boolean
+static int
 epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                               struct bfd_link_info *info,
                               bfd *input_bfd,
 epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
                               struct bfd_link_info *info,
                               bfd *input_bfd,
@@ -518,9 +518,9 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        }
       else
        {
        }
       else
        {
-         bfd_boolean warned ATTRIBUTE_UNUSED;
-         bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED;
-         bfd_boolean ignored ATTRIBUTE_UNUSED;
+         bool warned ATTRIBUTE_UNUSED;
+         bool unresolved_reloc ATTRIBUTE_UNUSED;
+         bool ignored ATTRIBUTE_UNUSED;
 
          RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                   r_symndx, symtab_hdr, sym_hashes,
 
          RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                   r_symndx, symtab_hdr, sym_hashes,
@@ -555,7 +555,7 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 
            case bfd_reloc_undefined:
              (*info->callbacks->undefined_symbol)
 
            case bfd_reloc_undefined:
              (*info->callbacks->undefined_symbol)
-               (info, name, input_bfd, input_section, rel->r_offset, TRUE);
+               (info, name, input_bfd, input_section, rel->r_offset, true);
              break;
 
            case bfd_reloc_outofrange:
              break;
 
            case bfd_reloc_outofrange:
@@ -584,7 +584,7 @@ epiphany_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        }
     }
 
        }
     }
 
-  return TRUE;
+  return true;
 }
 
 /* We only have a little-endian target.  */
 }
 
 /* We only have a little-endian target.  */
This page took 0.027405 seconds and 4 git commands to generate.