missing 1992 copyrights, although they changed in 1992.
/* BFD back-end for a.out.adobe binaries.
- Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Written by Cygnus Support. Based on bout.c.
This file is part of BFD, the Binary File Descriptor library.
if (N_BADMAG (anexec)) {
targ = getenv ("GNUTARGET");
- if (targ && strcmp (targ, a_out_adobe_vec.name))
+ if (targ && !strcmp (targ, a_out_adobe_vec.name))
; /* Just continue anyway, if specifically set to this format */
else
{
bfd *abfd;
{
struct internal_exec *execp = exec_hdr (abfd);
- unsigned long bss_start;
asection *sect;
struct external_segdesc ext[1];
char *section_name;
default:
fprintf (stderr, "Unknown section type in a.out.adobe file: %x\n",
- ext->e_type);
+ ext->e_type[0]);
goto no_more_sections;
}
#define aout_32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define aout_32_bfd_relax_section bfd_generic_relax_section
+#define aout_32_bfd_seclet_link bfd_generic_seclet_link
bfd_target a_out_adobe_vec =
{
/* BFD back-end for AMD 29000 COFF binaries.
- Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Contributed by David Wood at New York University 7/8/91.
This file is part of BFD, the Binary File Descriptor library.
/* BFD support to byte-swap a symbol table in MIPS (Third-Eye, `ecoff') format.
- Copyright 1992 Free Software Foundation, Inc.
+ Copyright 1992, 1993 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* ELF executable support for BFD.
- Copyright 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1993 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
{
struct strtab *ss;
- ss = (struct strtab *)malloc(sizeof(struct strtab));
- ss->tab = malloc(1);
+ ss = (struct strtab *) bfd_xmalloc(sizeof(struct strtab));
+ ss->tab = bfd_xmalloc(1);
BFD_ASSERT(ss->tab != 0);
*ss->tab = 0;
ss->nentries = 0;
if (ss->length)
ss->tab = realloc(ss->tab, ss->length + ln);
else
- ss->tab = malloc(ln);
+ ss->tab = bfd_xmalloc(ln);
BFD_ASSERT(ss->tab != 0);
strcpy(ss->tab + ss->length, str);
sym = symbase;
/* Temporarily allocate room for the raw ELF symbols. */
- x_symp = (Elf_External_Sym *) malloc (symcount * sizeof (Elf_External_Sym));
+ x_symp = (Elf_External_Sym *) bfd_xmalloc (symcount * sizeof (Elf_External_Sym));
if (bfd_read ((PTR) x_symp, sizeof (Elf_External_Sym), symcount, abfd)
!= symcount * sizeof (Elf_External_Sym))
return (0);
}
-/* FIXME!!! sparc howto should go into elf-32-sparc.c */
-#ifdef sparc
enum reloc_type
{
+ R_SPARC_offset = 0,
R_SPARC_NONE = 0,
R_SPARC_8, R_SPARC_16, R_SPARC_32,
R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
R_SPARC_GLOB_DAT, R_SPARC_JMP_SLOT,
R_SPARC_RELATIVE,
R_SPARC_UA32,
+ R_SPARC_max,
+
+ R_386_offset = R_SPARC_max,
+ R_386_NONE = 0,
+ R_386_32, R_386_PC32,
+ R_386_GOT32, R_386_PLT32,
+ R_386_COPY,
+ R_386_GLOB_DAT, R_386_JUMP_SLOT,
+ R_386_RELATIVE,
+ R_386_GOTOFF, R_386_GOTPC,
+ R_386_max,
};
+#if 0 /* not used */
#define RELOC_TYPE_NAMES \
"R_SPARC_NONE", \
"R_SPARC_8", "R_SPARC_16", "R_SPARC_32", \
"R_SPARC_COPY", \
"R_SPARC_GLOB_DAT", "R_SPARC_JMP_SLOT", \
"R_SPARC_RELATIVE", \
- "R_SPARC_UA32"
+ "R_SPARC_UA32", \
+ "R_386_NONE", \
+ "R_386_32", "R_386_PC32", \
+ "R_386_GOT32", "R_386_PLT32", \
+ "R_386_COPY", \
+ "R_386_GLOB_DAT", "R_386_JUMP_SLOT", \
+ "R_386_RELATIVE", \
+ "R_386_GOTOFF", "R_386_GOTPC"
+#endif
-static reloc_howto_type elf_howto_table[] =
+static reloc_howto_type elf_sparc_howto_table[] =
{
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,false,false, 0,"R_SPARC_NONE", false,0,0x00000000,false),
HOWTO(R_SPARC_8, 0,0, 8,false,0,true, true, 0,"R_SPARC_8", false,0,0x000000ff,false),
HOWTO(R_SPARC_RELATIVE,0,0,00,false,0,false,false,0,"R_SPARC_RELATIVE",false,0,0x00000000,false),
HOWTO(R_SPARC_UA32, 0,0,00,false,0,false,false,0,"R_SPARC_UA32", false,0,0x00000000,false),
};
+
+#if 0
+static const reloc_howto_type elf_386_howto_table[] =
+{
+ HOWTO (R_386_NONE, 0, 0, 0, false, 0,
#endif
static void
Elf_Internal_Rela *dst)
{
/* FIXME!!! just doing sparc for now... */
-#ifdef sparc
- BFD_ASSERT (ELF_R_TYPE(dst->r_info) < 24);
+ switch (abfd->arch_info->arch)
+ {
+ case bfd_arch_sparc:
+ BFD_ASSERT (ELF_R_TYPE(dst->r_info) < R_SPARC_max);
+ cache_ptr->howto = &elf_sparc_howto_table[ELF_R_TYPE(dst->r_info)];
+ break;
- cache_ptr->howto = &elf_howto_table[ELF_R_TYPE(dst->r_info)];
-#else
- fprintf (stderr, "elf_info_to_howto not implemented\n");
- abort ();
+#if 0
+ case bfd_arch_i386:
+ BFD_ASSER (ELF_R_TYPE (dst->r_info) < R_386_max);
+ cache_ptr->howto = &elf_i386_howto_table[ELF_R_TYPE (dst->r_info)];
+ break;
#endif
+
+ default:
+ fprintf (stderr, "elf_info_to_howto not implemented\n");
+ abort ();
+ }
}
-
+
static boolean
DEFUN(elf_slurp_reloca_table,(abfd, asect, symbols),
bfd *abfd AND
#define elf_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define elf_bfd_relax_section bfd_generic_relax_section
+#define elf_bfd_seclet_link bfd_generic_seclet_link
+
bfd_target elf_big_vec =
{
/* name: identify kind of target */
/* bfd back-end for HP PA-RISC SOM objects.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
/* BFD back-end for SCO System V 3.2 Unix core files.
This was based on trad-core.c, which was written by John Gilmore of
Cygnus Support.
- Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
Written by Scott Michel, IntelliMED Corporation. scottm%intime@uunet
NB: This does work with SCO System V 3.2 Unix and ODT. However, it
/* seclet.c
- Copyright (C) 1992 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
/* BFD back end for traditional Unix core files (U-area and raw sections)
- Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#define trad_unix_canonicalize_reloc (unsigned int (*) PARAMS \
((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0u
#define trad_unix_make_empty_symbol (struct symbol_cache_entry * \
- (*) ((bfd *))) bfd_false
+ (*) (bfd *)) bfd_false
#define trad_unix_print_symbol (void (*) PARAMS \
((bfd *, PTR, struct symbol_cache_entry *, \
bfd_print_symbol_type))) bfd_false
#define trad_unix_get_lineno (alent * (*) PARAMS \
((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr
#define trad_unix_set_arch_mach (boolean (*) PARAMS \
- (bfd *, enum bfd_architecture, unsigned long))) bfd_false
+ ((bfd *, enum bfd_architecture, unsigned long))) bfd_false
#define trad_unix_find_nearest_line (boolean (*) PARAMS \
- (bfd *abfd, struct sec *section, \
+ ((bfd *abfd, struct sec *section, \
struct symbol_cache_entry **symbols,bfd_vma offset, \
CONST char **file, CONST char **func, unsigned int *line))) bfd_false
#define trad_unix_sizeof_headers (int (*) PARAMS \
- (bfd *, boolean))) bfd_0
+ ((bfd *, boolean))) bfd_0
#define trad_unix_bfd_debug_info_start bfd_void
#define trad_unix_bfd_debug_info_end bfd_void
#define trad_unix_bfd_debug_info_accumulate (void (*) PARAMS \
- (bfd *, struct sec *))) bfd_void
+ ((bfd *, struct sec *))) bfd_void
#define trad_unix_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
#define trad_unix_bfd_relax_section bfd_generic_relax_section
+#define trad_unix_bfd_seclet_link \
+ ((boolean (*) PARAMS ((bfd *, PTR, boolean))) bfd_false)
+
/* If somebody calls any byte-swapping routines, shoot them. */
void
swap_abort()
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- '_', /* symbol prefix */
+ 0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
3, /* minimum alignment power */