Change int to bool for the relocate_* functions
[deliverable/binutils-gdb.git] / bfd / mmo.c
index 7671646598866927cd8481f98d78d04307beff31..bd4303c531f0d8dc55c6983efbc4d5bed98a366f 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1,5 +1,5 @@
 /* BFD back-end for mmo objects (MMIX-specific object-format).
-   Copyright (C) 2001-2018 Free Software Foundation, Inc.
+   Copyright (C) 2001-2019 Free Software Foundation, Inc.
    Written by Hans-Peter Nilsson (hp@bitrange.com).
    Infrastructure and other bits originally copied from srec.c and
    binary.c.
@@ -431,22 +431,30 @@ static bfd_boolean mmo_write_section_description (bfd *, asection *);
 static bfd_boolean mmo_has_leading_or_trailing_zero_tetra_p (bfd *,
                                                             asection *);
 
-/* Global "const" variables initialized once.  Must not depend on
-   particular input or caller; put such things into the bfd or elsewhere.
-   Look ma, no static per-invocation data!  */
-
-static
-char valid_mmo_symbol_character_set[/* A-Z a-z (we assume consecutive
-                                      codes; sorry EBCDIC:ers!).  */
-                                   + 'Z' - 'A' + 1 + 'z' - 'a' + 1
-                                   /* Digits.  */
-                                   + 10
-                                   /* ':' and '_'.  */
-                                   + 1 + 1
-                                   /* Codes higher than 126.  */
-                                   + 256 - 126
-                                   /* Ending zero.  */
-                                   + 1];
+static const char
+valid_mmo_symbol_character_set[] =
+{
+  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+  'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+  'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+  ':', '_', 126, 127, 128, 129,
+  130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
+  140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+  150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
+  160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+  170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
+  180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
+  190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
+  200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
+  210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
+  220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
+  230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
+  240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
+  250, 251, 252, 253, 254, 255,
+  0
+};
 
 
 /* Get section SECNAME or create one if it doesn't exist.  When creating
@@ -465,7 +473,7 @@ mmo_make_section (bfd *abfd, const char *secname)
        {
          _bfd_error_handler
            /* xgettext:c-format */
-           (_("%pB: No core to allocate section name %s\n"),
+           (_("%pB: no core to allocate section name %s"),
             abfd, secname);
          bfd_set_error (bfd_error_system_call);
          return NULL;
@@ -484,21 +492,10 @@ static void
 mmo_init (void)
 {
   static bfd_boolean inited = FALSE;
-  int i = 0;
-  int j = 0;
-  static const char letters[]
-    = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789:_";
 
   if (inited)
     return;
   inited = TRUE;
-
-  /* Fill in the set of valid symbol characters.  */
-  strcpy (valid_mmo_symbol_character_set, letters);
-  i = strlen (letters);
-
-  for (j = 126; j < 256; j++)
-    valid_mmo_symbol_character_set[i++] = j;
 }
 
 /* Check whether an existing file is an mmo file.  */
@@ -541,7 +538,7 @@ mmo_object_p (bfd *abfd)
     {
       _bfd_error_handler
        /* xgettext:c-format */
-       (_("%pB: No core to allocate a symbol %d bytes long\n"),
+       (_("%pB: no core to allocate a symbol %d bytes long"),
         abfd, abfd->tdata.mmo_data->max_symbol_length);
       goto bad_final;
     }
@@ -2983,7 +2980,7 @@ mmo_write_symbols_and_terminator (bfd *abfd)
 
            _bfd_error_handler
              /* xgettext:c-format */
-             (_("%pB: Bad symbol definition: `Main' set to %s rather"
+             (_("%pB: bad symbol definition: `Main' set to %s rather"
                 " than the start address %s\n"),
               abfd, vmas_main, vmas_start);
            bfd_set_error (bfd_error_bad_value);
@@ -3318,6 +3315,7 @@ mmo_write_object_contents (bfd *abfd)
 #define mmo_section_already_linked \
   _bfd_generic_section_already_linked
 #define mmo_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define mmo_bfd_link_hide_symbol _bfd_generic_link_hide_symbol
 #define mmo_bfd_define_start_stop bfd_generic_define_start_stop
 
 /* We want to copy time of creation, otherwise we'd use
This page took 0.024724 seconds and 4 git commands to generate.