Add prototypes for static functions.
[binutils-gdb.git] / bfd / elf32-hppa.c
index f1becf8a577a2afd6287a2e458e03bece5b0153b..784c699971b79d8774526b6f4787e7d7b731fb74 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for HP PA-RISC ELF files.
-   Copyright (C) 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+   Free Software Foundation, Inc.
 
    Written by
 
@@ -215,7 +216,7 @@ static reloc_howto_type * elf_hppa_reloc_type_lookup
 static boolean elf32_hppa_set_section_contents
   PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
 
-static void elf_info_to_howto
+static void elf32_hppa_info_to_howto
   PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
 
 static boolean elf32_hppa_backend_symbol_table_processing
@@ -234,7 +235,7 @@ static void add_entry_to_symext_chain
 static void
 elf_hppa_tc_make_sections PARAMS ((bfd *, symext_chainS *));
 
-static boolean hppa_elf_is_local_label PARAMS ((bfd *, asymbol *));
+static boolean hppa_elf_is_local_label_name PARAMS ((bfd *, const char *));
 
 static boolean elf32_hppa_add_symbol_hook
   PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
@@ -296,7 +297,9 @@ static boolean elf32_hppa_link_output_symbol_hook
 static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
 {
   {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_NONE"},
-  {R_PARISC_DIR32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR32"},
+  /* The values in DIR32 are to placate the check in
+     _bfd_stab_section_find_nearest_line.  */
+  {R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false},
   {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR21L"},
   {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR17R"},
   {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR17F"},
@@ -939,25 +942,26 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
    relocation with modifications based on format and field.  */
 
 elf32_hppa_reloc_type **
-hppa_elf_gen_reloc_type (abfd, base_type, format, field, ignore)
+hppa_elf_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
      bfd *abfd;
      elf32_hppa_reloc_type base_type;
      int format;
      int field;
      int ignore;
+     asymbol *sym;
 {
   elf32_hppa_reloc_type *finaltype;
   elf32_hppa_reloc_type **final_types;
 
   /* Allocate slots for the BFD relocation.  */
-  final_types = (elf32_hppa_reloc_type **)
-    bfd_alloc_by_size_t (abfd, sizeof (elf32_hppa_reloc_type *) * 2);
+  final_types = ((elf32_hppa_reloc_type **)
+                bfd_alloc (abfd, sizeof (elf32_hppa_reloc_type *) * 2));
   if (final_types == NULL)
     return NULL;
 
   /* Allocate space for the relocation itself.  */
-  finaltype = (elf32_hppa_reloc_type *)
-    bfd_alloc_by_size_t (abfd, sizeof (elf32_hppa_reloc_type));
+  finaltype = ((elf32_hppa_reloc_type *)
+              bfd_alloc (abfd, sizeof (elf32_hppa_reloc_type)));
   if (finaltype == NULL)
     return NULL;
 
@@ -1169,7 +1173,7 @@ elf32_hppa_set_section_contents (abfd, section, location, offset, count)
 /* Translate from an elf into field into a howto relocation pointer.  */
 
 static void
-elf_info_to_howto (abfd, cache_ptr, dst)
+elf32_hppa_info_to_howto (abfd, cache_ptr, dst)
      bfd *abfd;
      arelent *cache_ptr;
      Elf32_Internal_Rela *dst;
@@ -1550,11 +1554,11 @@ elf_hppa_reloc_type_lookup (abfd, code)
 /* Return true if SYM represents a local label symbol.  */
 
 static boolean
-hppa_elf_is_local_label (abfd, sym)
+hppa_elf_is_local_label_name (abfd, name)
      bfd *abfd;
-     asymbol *sym;
+     const char *name;
 {
-  return (sym->name[0] == 'L' && sym->name[1] == '$');
+  return (name[0] == 'L' && name[1] == '$');
 }
 
 /* Do any backend specific processing when beginning to write an object
@@ -1865,7 +1869,7 @@ elf32_hppa_backend_symbol_table_processing (abfd, esyms,symcnt)
     {
       symext_entryS se =
        ELF32_PARISC_SX_GET (abfd,
-                            (symextn_hdr->contents
+                            ((unsigned char *)symextn_hdr->contents
                              + i * ELF32_PARISC_SX_SIZE));
       unsigned int se_value = ELF32_PARISC_SX_VAL (se);
       unsigned int se_type = ELF32_PARISC_SX_TYPE (se);
@@ -2956,10 +2960,11 @@ error_return:
 
 /* Misc BFD support code.  */
 #define bfd_elf32_bfd_reloc_type_lookup                elf_hppa_reloc_type_lookup
-#define bfd_elf32_bfd_is_local_label           hppa_elf_is_local_label
+#define bfd_elf32_bfd_is_local_label_name      hppa_elf_is_local_label_name
 
 /* Symbol extension stuff.  */
 #define bfd_elf32_set_section_contents         elf32_hppa_set_section_contents
+#define elf_info_to_howto                      elf32_hppa_info_to_howto
 #define elf_backend_symbol_table_processing \
   elf32_hppa_backend_symbol_table_processing
 #define elf_backend_begin_write_processing \