}
-static reloc_howto_type *
+static const reloc_howto_type *
elf_hppa_reloc_type_lookup (arch, code)
bfd_arch_info_type *arch;
bfd_reloc_code_real_type code;
if (!stub_desc->stub_contents)
{
stub_desc->allocated_size = STUB_BUFFER_INCR;
- stub_desc->stub_contents = (char *) xmalloc (STUB_BUFFER_INCR);
+ stub_desc->stub_contents = (char *) bfd_xmalloc (STUB_BUFFER_INCR);
}
else if ((stub_desc->allocated_size - stub_desc->real_size) < STUB_MAX_SIZE)
{
stub_desc->allocated_size = stub_desc->allocated_size + STUB_BUFFER_INCR;
- stub_desc->stub_contents = (char *) xrealloc (stub_desc->stub_contents,
- stub_desc->allocated_size);
+ stub_desc->stub_contents = (char *) realloc (stub_desc->stub_contents,
+ stub_desc->allocated_size);
+ if (stub_desc->stub_contents == NULL)
+ abort ();
}
stub_desc->stub_secp = (int *) (stub_desc->stub_contents + stub_desc->real_size);
be generated. */
else if (strcmp (section->name, ".hppa_symextn") == 0)
{
- /* If this is the first time through and there are no output
- sections, then read the contents of the symbol extension section
- from disk. */
- if (! symext_chain_built
- || ((section->output_section == NULL)
- && (abfd->direction == read_direction)))
+ /* If there are no output sections, then read the contents of the
+ symbol extension section from disk. */
+ if (section->output_section == NULL
+ && abfd->direction == read_direction)
{
return bfd_generic_get_section_contents (abfd, section, location,
offset, count);
else if (! symext_chain_built)
{
int i;
- int *symtab_map = elf_sym_extra(section->output_section->owner);
+ int *symtab_map =
+ (int *) elf_sym_extra(section->output_section->owner);
for (i = 0; i < section->output_section->owner->symcount; i++ )
{
elf_hppa_tc_symbol(section->output_section->owner,
- section->output_section->owner->outsymbols[i],
+ ((elf_symbol_type *)
+ section->output_section->owner->outsymbols[i]),
symtab_map[i]);
}
symext_chain_built++;
elf_hppa_tc_make_sections (section->output_section->owner, NULL);
}
+
+ /* At this point we know that the symbol extension section has been
+ built. We just need to copy it into the user's buffer. */
if (count == 0)
return true;
#define TARGET_BIG_SYM bfd_elf32_hppa_vec
#define TARGET_BIG_NAME "elf32-hppa"
#define ELF_ARCH bfd_arch_hppa
+#define ELF_MACHINE_CODE EM_HPPA
#define ELF_MAXPAGESIZE 0x1000
#include "elf32-target.h"
#define ELF_MAXPAGESIZE 1
#endif
+#ifndef elf_backend_object_p
+#define elf_backend_object_p 0 /* elf_backend_object_p */
+#endif
#ifndef elf_backend_symbol_processing
#define elf_backend_symbol_processing 0 /* elf_backend_symbol_processing */
#endif
#endif
0, /* elf_64_p */
ELF_ARCH, /* arch */
+ ELF_MACHINE_CODE, /* elf_machine_code */
ELF_MAXPAGESIZE, /* maxpagesize */
elf_info_to_howto, /* elf_info_to_howto */
elf_info_to_howto_rel, /* elf_info_to_howto_rel */
+ elf_backend_object_p, /* elf_backend_object_p */
elf_backend_symbol_processing, /* elf_backend_symbol_processing */
elf_backend_symbol_table_processing, /* elf_backend_symbol_table_processing */
elf_backend_section_processing, /* elf_backend_section_processing */
#define ELF_MAXPAGESIZE 1
#endif
+#ifndef elf_backend_object_p
+#define elf_backend_object_p 0 /* elf_backend_object_p */
+#endif
#ifndef elf_backend_symbol_processing
#define elf_backend_symbol_processing 0 /* elf_backend_symbol_processing */
#endif
#endif
1, /* elf_64_p */
ELF_ARCH, /* arch */
+ ELF_MACHINE_CODE, /* elf_machine_code */
ELF_MAXPAGESIZE, /* maxpagesize */
elf_info_to_howto, /* elf_info_to_howto */
elf_info_to_howto_rel, /* elf_info_to_howto_rel */
+ elf_backend_object_p, /* elf_backend_object_p */
elf_backend_symbol_processing, /* elf_backend_symbol_processing */
elf_backend_symbol_table_processing, /* elf_backend_symbol_table_processing */
elf_backend_section_processing, /* elf_backend_section_processing */
/* The architecture for this backend. */
enum bfd_architecture arch;
+ /* The ELF machine code (EM_xxxx) for this backend. */
+ int elf_machine_code;
+
/* The maximum page size for this backend. */
bfd_vma maxpagesize;
/* The remaining functions are hooks which are called only if they
are not NULL. */
+ /* A function to permit a backend specific check on whether a
+ particular BFD format is relevant for an object file, and to
+ permit the backend to set any global information it wishes. When
+ this is called elf_elfheader is set, but anything else should be
+ used with caution. If this returns false, the check_format
+ routine will return a wrong_format error. */
+ boolean (*elf_backend_object_p) PARAMS ((bfd *));
+
/* A function to do additional symbol processing when reading the
ELF symbol table. This is where any processor-specific special
section indices are handled. */
typedef struct elf_sym_extra Elf_Sym_Extra;
-struct bfd_elf_arch_map {
- enum bfd_architecture bfd_arch;
- int elf_arch;
-};
-
-extern const struct bfd_elf_arch_map bfd_elf_arch_map[];
-extern const int bfd_elf_arch_map_size;
-
struct bfd_elf_section_data {
Elf_Internal_Shdr this_hdr;
Elf_Internal_Shdr rel_hdr;