* elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
[deliverable/binutils-gdb.git] / bfd / merge.c
index 866b69ce730a7a8746f8c3724fb7733f1f697cae..9dc2e7083443eb7b5731c5a9447abf6bb627956c 100644 (file)
@@ -353,7 +353,7 @@ sec_merge_emit (abfd, entry)
   if (alignment_power)
     free (pad);
 
-  return entry == NULL || entry->secinfo != secinfo;
+  return (boolean) (entry == NULL || entry->secinfo != secinfo);
 }
 
 /* This function is called for each input file from the add_symbols
@@ -383,14 +383,6 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo)
       return true;
     }
 
-  if (sec->output_section != NULL
-      && bfd_is_abs_section (sec->output_section))
-    {
-      /* The section is being discarded from the link, so we should
-        just ignore it.  */
-      return true;
-    }
-
   align = bfd_get_section_alignment (sec->owner, sec);
   if ((sec->entsize < (unsigned int)(1 << align)
        && ((sec->entsize & (sec->entsize - 1))
@@ -417,15 +409,14 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo)
   if (sinfo == NULL)
     {
       /* Initialize the information we need to keep track of.  */
-      sinfo = (struct sec_merge_info *)
-             bfd_alloc (abfd, (bfd_size_type) sizeof (struct sec_merge_info));
+      amt = sizeof (struct sec_merge_info);
+      sinfo = (struct sec_merge_info *) bfd_alloc (abfd, amt);
       if (sinfo == NULL)
        goto error_return;
       sinfo->next = (struct sec_merge_info *) *psinfo;
       sinfo->chain = NULL;
       *psinfo = (PTR) sinfo;
-      sinfo->htab =
-       sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS));
+      sinfo->htab = sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS));
       if (sinfo->htab == NULL)
        goto error_return;
     }
@@ -676,7 +667,7 @@ merge_strings (sinfo)
        break;
       if (e->len > 4 * e->u.entsize)
        {
-         s = e->root.string + e->len - e->u.entsize;
+         s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
          hash = 0;
          for (i = 0; i < 4 * e->u.entsize; i++)
            {
@@ -699,7 +690,7 @@ merge_strings (sinfo)
          else
            *p = (PTR) e;
        }
-      s = e->root.string + e->len - e->u.entsize;
+      s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
       hash = 0;
       for (i = 0; i < e->u.entsize; i++)
        {
@@ -843,10 +834,7 @@ _bfd_merge_sections (abfd, xsinfo, remove_hook)
           the hash table at all.  */
        for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
          if (secinfo->first == NULL)
-           {
-             secinfo->sec->_cooked_size = 0;
-             secinfo->sec->flags |= SEC_EXCLUDE;
-           }
+           secinfo->sec->_cooked_size = 0;
     }
 
   return true;
@@ -912,7 +900,7 @@ _bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend)
       if (sec->entsize == 1)
        {
          p = secinfo->contents + offset + addend - 1;
-         while (*p && p >= secinfo->contents)
+         while (p >= secinfo->contents && *p)
            --p;
          ++p;
        }
This page took 0.024629 seconds and 4 git commands to generate.