2002-06-07 Chris Demetriou <cgd@broadcom.com>
[deliverable/binutils-gdb.git] / bfd / elfcode.h
index 204756c745db2f31cc569ad1aa2cd19dffc8f570..3e29c0287b14954bdf65848ecf6b542845eacd9e 100644 (file)
@@ -1,6 +1,6 @@
 /* ELF executable support for BFD.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001 Free Software Foundation, Inc.
+   2001, 2002 Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, from information published
    in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -203,12 +203,14 @@ static char *elf_symbol_flags PARAMS ((flagword));
    format.  */
 
 void
-elf_swap_symbol_in (abfd, src, shndx, dst)
+elf_swap_symbol_in (abfd, psrc, pshn, dst)
      bfd *abfd;
-     const Elf_External_Sym *src;
-     const Elf_External_Sym_Shndx *shndx;
+     const PTR psrc;
+     const PTR pshn;
      Elf_Internal_Sym *dst;
 {
+  const Elf_External_Sym *src = (const Elf_External_Sym *) psrc;
+  const Elf_External_Sym_Shndx *shndx = (const Elf_External_Sym_Shndx *) pshn;
   int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
 
   dst->st_name = H_GET_32 (abfd, src->st_name);
@@ -1150,7 +1152,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
 
       /* If we have a SHT_SYMTAB_SHNDX section for the symbol table,
         read the raw contents.  */
-      if (elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr)
+      if (elf_elfsections (abfd) != NULL
+         && elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr)
        {
          amt = shndx_hdr->sh_size;
          x_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
@@ -1241,8 +1244,9 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
       /* Skip first symbol, which is a null dummy.  */
       for (i = 1; i < symcount; i++)
        {
-         elf_swap_symbol_in (abfd, x_symp + i,
-                             x_shndx + (x_shndx != NULL ? i : 0), &i_sym);
+         elf_swap_symbol_in (abfd, (const PTR) (x_symp + i),
+                             (const PTR) (x_shndx + (x_shndx ? i : 0)),
+                             &i_sym);
          memcpy (&sym->internal_elf_sym, &i_sym, sizeof (Elf_Internal_Sym));
 #ifdef ELF_KEEP_EXTSYM
          memcpy (&sym->native_elf_sym, x_symp + i, sizeof (Elf_External_Sym));
@@ -1694,6 +1698,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = {
   elf_write_out_phdrs,
   elf_write_shdrs_and_ehdr,
   elf_write_relocs,
+  elf_swap_symbol_in,
   elf_swap_symbol_out,
   elf_slurp_reloc_table,
   elf_slurp_symbol_table,
This page took 0.022961 seconds and 4 git commands to generate.