2001-05-24 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / bfd / elf.c
index 92a546d3c55a1c7c5f41dd8233f148c7c87a7160..fc31cdc8e1fc05b9389e3a1882d26481e567075c 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -558,6 +558,18 @@ bfd_elf_generic_reloc (abfd,
   return bfd_reloc_continue;
 }
 \f
+/* Finish SHF_MERGE section merging.  */
+
+boolean
+_bfd_elf_merge_sections (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  if (elf_hash_table (info)->merge_info)
+    _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info);
+  return true;
+}
+\f
 /* Print out the program headers.  */
 
 boolean
@@ -1014,8 +1026,9 @@ _bfd_elf_link_hash_hide_symbol (info, h)
      struct elf_link_hash_entry *h;
 {
   h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
-  h->dynindx = -1;
   h->plt.offset = (bfd_vma) -1;
+  if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+    h->dynindx = -1;
 }
 
 /* Initialize an ELF linker hash table.  */
@@ -1436,7 +1449,7 @@ bfd_section_from_shdr (abfd, shindex)
          }
        *hdr2 = *hdr;
        elf_elfsections (abfd)[shindex] = hdr2;
-       target_sect->reloc_count += hdr->sh_size / hdr->sh_entsize;
+       target_sect->reloc_count += NUM_SHDR_ENTRIES (hdr);
        target_sect->flags |= SEC_RELOC;
        target_sect->relocation = NULL;
        target_sect->rel_filepos = hdr->sh_offset;
@@ -3413,7 +3426,10 @@ prep_headers (abfd)
     case bfd_arch_cris:
       i_ehdrp->e_machine = EM_CRIS;
       break;
-      /* also note that EM_M32, AT&T WE32100 is unknown to bfd */
+    case bfd_arch_openrisc:
+      i_ehdrp->e_machine = EM_OPENRISC;
+      break;
+      /* Also note that EM_M32, AT&T WE32100 is unknown to bfd.  */
     default:
       i_ehdrp->e_machine = EM_NONE;
     }
@@ -4730,7 +4746,7 @@ _bfd_elf_slurp_version_tables (abfd)
       Elf_Internal_Verdef *iverdefarr;
       Elf_Internal_Verdef iverdefmem;
       unsigned int i;
-      int maxidx;
+      unsigned int maxidx;
 
       hdr = &elf_tdata (abfd)->dynverdef_hdr;
 
@@ -4750,8 +4766,8 @@ _bfd_elf_slurp_version_tables (abfd)
        {
          _bfd_elf_swap_verdef_in (abfd, everdef, &iverdefmem);
 
-         if ((iverdefmem.vd_ndx & VERSYM_VERSION) > maxidx)
-           maxidx = iverdefmem.vd_ndx & VERSYM_VERSION;
+         if ((iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION)) > maxidx)
+           maxidx = iverdefmem.vd_ndx & ((unsigned) VERSYM_VERSION);
 
          everdef = ((Elf_External_Verdef *)
                     ((bfd_byte *) everdef + iverdefmem.vd_next));
This page took 0.028882 seconds and 4 git commands to generate.