* xtensa-isa-internal.h (xtensa_length_decode_fn): Warning fix.
* xtensa-isa.h (xtensa_insnbuf_to_chars): Likewise.
(xtensa_insnbuf_from_chars, xtensa_isa_length_from_chars): Likewise.
include/coff/
* xcoff.h (struct xcoff_loader_info): Warning fix.
bfd/
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix.
* coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise.
* coff-rs6000.c (xcoff_write_armap_big): Warning fixes. Remove
useless assignments.
(xcoff_write_archive_contents_big): Likewise.
(_bfd_xcoff_put_ldsymbol_name): Likewise.
* coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
* coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
* cofflink.c (process_embedded_commands): Warning fixes.
* cpu-arm.c: Delete unnecessary prototypes. Convert to C90.
Warning fixes.
* dwarf2.c: Warning fixes.
* elf-bfd.h: Likewise.
* elf-eh-frame.c: Likewise.
* elf-strtab.c: Likewise.
* elf.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-sh-symbian.c: Likewise.
* elf32-sh.c: Delete unnecessary prototypes. Warning fixes.
* elf64-sh64.c: Likewise.
* peicode.h: Likewise.
* elf64-mmix.c: Warning fixes.
* elfcode.h: Likewise.
* elfxx-mips.c: Likewise.
* libbfd-in.h: Likewise.
* libbfd.c: Likewise.
* mach-o.c: Likewise.
* merge.c: Likewise.
* mmo.c: Likewise.
* opncls.c: Likewise.
* pef.c: Likewise.
* srec.c: Likewise.
* vms-hdr.c: Likewise.
* vms-tir.c: Likewise.
* xtensa-isa.c: Likewise.
* xtensa-modules.c: Likewise.
* xsym.c: Likewise.
(pstrcmp): Use correct choice of string lengths. Fix return value.
(bfd_sym_module_name): Correct string length.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
+2005-02-21 Alan Modra <amodra@bigpond.net.au>
+
+ * bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix.
+ * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise.
+ * coff-rs6000.c (xcoff_write_armap_big): Warning fixes. Remove
+ useless assignments.
+ (xcoff_write_archive_contents_big): Likewise.
+ (_bfd_xcoff_put_ldsymbol_name): Likewise.
+ * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
+ * coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
+ * cofflink.c (process_embedded_commands): Warning fixes.
+ * cpu-arm.c: Delete unnecessary prototypes. Convert to C90.
+ Warning fixes.
+ * dwarf2.c: Warning fixes.
+ * elf-bfd.h: Likewise.
+ * elf-eh-frame.c: Likewise.
+ * elf-strtab.c: Likewise.
+ * elf.c: Likewise.
+ * elf32-m68k.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf32-sh-symbian.c: Likewise.
+ * elf32-sh.c: Delete unnecessary prototypes. Warning fixes.
+ * elf64-sh64.c: Likewise.
+ * peicode.h: Likewise.
+ * elf64-mmix.c: Warning fixes.
+ * elfcode.h: Likewise.
+ * elfxx-mips.c: Likewise.
+ * libbfd-in.h: Likewise.
+ * libbfd.c: Likewise.
+ * mach-o.c: Likewise.
+ * merge.c: Likewise.
+ * mmo.c: Likewise.
+ * opncls.c: Likewise.
+ * pef.c: Likewise.
+ * srec.c: Likewise.
+ * vms-hdr.c: Likewise.
+ * vms-tir.c: Likewise.
+ * xtensa-isa.c: Likewise.
+ * xtensa-modules.c: Likewise.
+ * xsym.c: Likewise.
+ (pstrcmp): Use correct choice of string lengths. Fix return value.
+ (bfd_sym_module_name): Correct string length.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+2005-02-18 Alan Modra <amodra@bigpond.net.au>
+
+ * coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
+
2005-02-17 Alexandre Oliva <aoliva@redhat.com>
* elf32-frv.c (elf32_frv_relocate_section): Remove warning from
the remote memory. */
extern bfd *bfd_elf_bfd_from_remote_memory
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
+ int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size
the remote memory. */
extern bfd *bfd_elf_bfd_from_remote_memory
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
+ int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size
/* BFD back-end for Motorola 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Written by Cygnus Support.
(irel->r_vaddr - datasec->vma + datasec->output_offset), p);
memset (p + 4, 0, 8);
if (targetsec != NULL)
- strncpy (p + 4, targetsec->output_section->name, 8);
+ strncpy ((char *) p + 4, targetsec->output_section->name, 8);
}
return TRUE;
/* BFD back-end for IBM RS/6000 "XCOFF" files.
- Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004
+ Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced
if (sym_32)
{
struct xcoff_ar_hdr_big *hdr;
- bfd_byte *symbol_table;
- bfd_byte *st;
+ char *symbol_table;
+ char *st;
file_ptr fileoff;
bfd_vma symbol_table_size =
+ 8 * sym_32
+ str_32 + (str_32 & 1);
- symbol_table = NULL;
- symbol_table = (bfd_byte *) bfd_zmalloc (symbol_table_size);
+ symbol_table = bfd_zmalloc (symbol_table_size);
if (symbol_table == NULL)
return FALSE;
bfd_bwrite (symbol_table, symbol_table_size, abfd);
free (symbol_table);
- symbol_table = NULL;
prevoff = nextoff;
nextoff = nextoff + symbol_table_size;
if (sym_64)
{
struct xcoff_ar_hdr_big *hdr;
- bfd_byte *symbol_table;
- bfd_byte *st;
+ char *symbol_table;
+ char *st;
file_ptr fileoff;
bfd_vma symbol_table_size =
+ 8 * sym_64
+ str_64 + (str_64 & 1);
- symbol_table = NULL;
- symbol_table = (bfd_byte *) bfd_zmalloc (symbol_table_size);
+ symbol_table = bfd_zmalloc (symbol_table_size);
if (symbol_table == NULL)
return FALSE;
bfd_bwrite (symbol_table, symbol_table_size, abfd);
free (symbol_table);
- symbol_table = NULL;
PRINT20 (fhdr->symoff64, nextoff);
}
size_t i;
struct xcoff_ar_hdr_big *hdr, ahdr;
bfd_size_type size;
- bfd_byte *member_table, *mt;
+ char *member_table, *mt;
bfd_vma member_table_size;
memset (&fhdr, 0, SIZEOF_AR_FILE_HDR_BIG);
+ total_namlen);
member_table_size += member_table_size & 1;
- member_table = NULL;
- member_table = (bfd_byte *) bfd_zmalloc (member_table_size);
+ member_table = bfd_zmalloc (member_table_size);
if (member_table == NULL)
return FALSE;
return FALSE;
free (member_table);
- member_table = NULL;
PRINT20 (fhdr.memoff, nextoff);
if (ldinfo->string_size + len + 3 > ldinfo->string_alc)
{
bfd_size_type newalc;
- bfd_byte *newstrings;
+ char *newstrings;
newalc = ldinfo->string_alc * 2;
if (newalc == 0)
while (ldinfo->string_size + len + 3 > newalc)
newalc *= 2;
- newstrings = ((bfd_byte *)
- bfd_realloc ((PTR) ldinfo->strings, newalc));
+ newstrings = bfd_realloc (ldinfo->strings, newalc);
if (newstrings == NULL)
{
ldinfo->failed = TRUE;
/* BFD back-end for IBM RS/6000 "XCOFF64" files.
- Copyright 2000, 2001, 2002, 2003, 2004
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written Clinton Popetz.
Contributed by Cygnus Support.
if (ldinfo->string_size + len + 3 > ldinfo->string_alc)
{
bfd_size_type newalc;
- bfd_byte *newstrings;
+ char *newstrings;
newalc = ldinfo->string_alc * 2;
if (newalc == 0)
while (ldinfo->string_size + len + 3 > newalc)
newalc *= 2;
- newstrings = ((bfd_byte *)
- bfd_realloc ((PTR) ldinfo->strings, newalc));
+ newstrings = bfd_realloc (ldinfo->strings, newalc);
if (newstrings == NULL)
{
ldinfo->failed = TRUE;
/* Support for the generic parts of COFF, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004
+ 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_size_type debug_string_size;
unsigned int i;
unsigned int limit = bfd_get_symcount (abfd);
- bfd_signed_vma written = 0;
+ bfd_vma written = 0;
asymbol **p;
string_size = 0;
/* COFF specific linker code.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
free (copy);
return 0;
}
- e = copy + sec->size;
+ e = (char *) copy + sec->size;
- for (s = copy; s < e ; )
+ for (s = (char *) copy; s < e ; )
{
- if (s[0]!= '-')
+ if (s[0] != '-')
{
s++;
continue;
}
- if (strncmp (s,"-attr", 5) == 0)
+ if (strncmp (s, "-attr", 5) == 0)
{
char *name;
char *attribs;
/* BFD support for the ARM processor
- Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004
+ Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
#include "libbfd.h"
#include "libiberty.h"
-static const bfd_arch_info_type * compatible
- PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
-static bfd_boolean scan
- PARAMS ((const struct bfd_arch_info *, const char *));
-static bfd_boolean arm_check_note
- PARAMS ((bfd *, char *, bfd_size_type, const char *, char **));
-
/* This routine is provided two arch_infos and works out which ARM
machine which would be compatible with both and returns a pointer
to its info structure. */
static const bfd_arch_info_type *
-compatible (a,b)
- const bfd_arch_info_type * a;
- const bfd_arch_info_type * b;
+compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
{
/* If a & b are for different architecture we can do nothing. */
if (a->arch != b->arch)
};
static bfd_boolean
-scan (info, string)
- const struct bfd_arch_info * info;
- const char * string;
+scan (const struct bfd_arch_info *info, const char *string)
{
int i;
Returns TRUE if they were merged successfully or FALSE otherwise. */
bfd_boolean
-bfd_arm_merge_machines (ibfd, obfd)
- bfd * ibfd;
- bfd * obfd;
+bfd_arm_merge_machines (bfd *ibfd, bfd *obfd)
{
unsigned int in = bfd_get_mach (ibfd);
unsigned int out = bfd_get_mach (obfd);
} arm_Note;
static bfd_boolean
-arm_check_note (abfd, buffer, buffer_size, expected_name, description_return)
- bfd * abfd;
- char * buffer;
- bfd_size_type buffer_size;
- const char * expected_name;
- char ** description_return;
+arm_check_note (bfd *abfd,
+ bfd_byte *buffer,
+ bfd_size_type buffer_size,
+ const char *expected_name,
+ char **description_return)
{
unsigned long namesz;
unsigned long descsz;
namesz = bfd_get_32 (abfd, buffer);
descsz = bfd_get_32 (abfd, buffer + offsetof (arm_Note, descsz));
type = bfd_get_32 (abfd, buffer + offsetof (arm_Note, type));
- descr = buffer + offsetof (arm_Note, name);
+ descr = (char *) buffer + offsetof (arm_Note, name);
/* Check for buffer overflow. */
if (namesz + descsz + offsetof (arm_Note, name) > buffer_size)
#define NOTE_ARCH_STRING "arch: "
bfd_boolean
-bfd_arm_update_notes (abfd, note_section)
- bfd * abfd;
- const char * note_section;
+bfd_arm_update_notes (bfd *abfd, const char *note_section)
{
asection * arm_arch_section;
bfd_size_type buffer_size;
if (strcmp (arch_string, expected) != 0)
{
- strcpy (buffer + offsetof (arm_Note, name) + ((strlen (NOTE_ARCH_STRING) + 3) & ~3), expected);
+ strcpy ((char *) buffer + (offsetof (arm_Note, name)
+ + ((strlen (NOTE_ARCH_STRING) + 3) & ~3)),
+ expected);
if (! bfd_set_section_contents (abfd, arm_arch_section, buffer,
(file_ptr) 0, buffer_size))
/* Extract the machine number stored in a note section. */
unsigned int
-bfd_arm_get_mach_from_notes (abfd, note_section)
- bfd * abfd;
- const char * note_section;
+bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section)
{
asection * arm_arch_section;
bfd_size_type buffer_size;
/* DWARF 2 support.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
struct dwarf_block
{
unsigned int size;
- char *data;
+ bfd_byte *data;
};
struct dwarf2_debug
{
/* A list of all previously read comp_units. */
- struct comp_unit* all_comp_units;
+ struct comp_unit *all_comp_units;
/* The next unread compilation unit within the .debug_info section.
Zero indicates that the .debug_info section has not been loaded
into a buffer yet. */
- char* info_ptr;
+ bfd_byte *info_ptr;
/* Pointer to the end of the .debug_info section memory buffer. */
- char* info_ptr_end;
+ bfd_byte *info_ptr_end;
/* Pointer to the section and address of the beginning of the
section. */
- asection* sec;
- char* sec_info_ptr;
+ asection *sec;
+ bfd_byte *sec_info_ptr;
/* Pointer to the symbol table. */
- asymbol** syms;
+ asymbol **syms;
/* Pointer to the .debug_abbrev section loaded into memory. */
- char* dwarf_abbrev_buffer;
+ bfd_byte *dwarf_abbrev_buffer;
/* Length of the loaded .debug_abbrev section. */
unsigned long dwarf_abbrev_size;
/* Buffer for decode_line_info. */
- char *dwarf_line_buffer;
+ bfd_byte *dwarf_line_buffer;
/* Length of the loaded .debug_line section. */
unsigned long dwarf_line_size;
/* Pointer to the .debug_str section loaded into memory. */
- char* dwarf_str_buffer;
+ bfd_byte *dwarf_str_buffer;
/* Length of the loaded .debug_str section. */
unsigned long dwarf_str_size;
struct comp_unit
{
/* Chain the previously read compilation units. */
- struct comp_unit* next_unit;
+ struct comp_unit *next_unit;
/* Keep the bdf convenient (for memory allocation). */
- bfd* abfd;
+ bfd *abfd;
/* The lowest and higest addresses contained in this compilation
unit as specified in the compilation unit header. */
struct arange arange;
/* The DW_AT_name attribute (for error messages). */
- char* name;
+ char *name;
/* The abbrev hash table. */
- struct abbrev_info** abbrevs;
+ struct abbrev_info **abbrevs;
/* Note that an error was found by comp_unit_find_nearest_line. */
int error;
/* The DW_AT_comp_dir attribute. */
- char* comp_dir;
+ char *comp_dir;
/* TRUE if there is a line number table associated with this comp. unit. */
int stmtlist;
/* Pointer to the current comp_unit so that we can find a given entry
by its reference. */
- char *info_ptr_unit;
+ bfd_byte *info_ptr_unit;
/* The offset into .debug_line of the line number table. */
unsigned long line_offset;
/* Pointer to the first child die for the comp unit. */
- char *first_child_die_ptr;
+ bfd_byte *first_child_die_ptr;
/* The end of the comp unit. */
- char *end_ptr;
+ bfd_byte *end_ptr;
/* The decoded line number, NULL if not yet decoded. */
- struct line_info_table* line_table;
+ struct line_info_table *line_table;
/* A list of the functions found in this comp. unit. */
- struct funcinfo* function_table;
+ struct funcinfo *function_table;
/* Pointer to dwarf2_debug structure. */
struct dwarf2_debug *stash;
/* Read dwarf information from a buffer. */
static unsigned int
-read_1_byte (bfd *abfd ATTRIBUTE_UNUSED, char *buf)
+read_1_byte (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf)
{
return bfd_get_8 (abfd, buf);
}
static int
-read_1_signed_byte (bfd *abfd ATTRIBUTE_UNUSED, char *buf)
+read_1_signed_byte (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf)
{
return bfd_get_signed_8 (abfd, buf);
}
static unsigned int
-read_2_bytes (bfd *abfd, char *buf)
+read_2_bytes (bfd *abfd, bfd_byte *buf)
{
return bfd_get_16 (abfd, buf);
}
static unsigned int
-read_4_bytes (bfd *abfd, char *buf)
+read_4_bytes (bfd *abfd, bfd_byte *buf)
{
return bfd_get_32 (abfd, buf);
}
static bfd_uint64_t
-read_8_bytes (bfd *abfd, char *buf)
+read_8_bytes (bfd *abfd, bfd_byte *buf)
{
return bfd_get_64 (abfd, buf);
}
-static char *
+static bfd_byte *
read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED,
- char *buf,
+ bfd_byte *buf,
unsigned int size ATTRIBUTE_UNUSED)
{
/* If the size of a host char is 8 bits, we can return a pointer
static char *
read_string (bfd *abfd ATTRIBUTE_UNUSED,
- char *buf,
+ bfd_byte *buf,
unsigned int *bytes_read_ptr)
{
/* Return a pointer to the embedded string. */
- if (*buf == '\0')
+ char *str = (char *) buf;
+ if (*str == '\0')
{
*bytes_read_ptr = 1;
return NULL;
}
- *bytes_read_ptr = strlen (buf) + 1;
- return buf;
+ *bytes_read_ptr = strlen (str) + 1;
+ return str;
}
static char *
read_indirect_string (struct comp_unit* unit,
- char *buf,
+ bfd_byte *buf,
unsigned int *bytes_read_ptr)
{
bfd_uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
+ char *str;
if (unit->offset_size == 4)
offset = read_4_bytes (unit->abfd, buf);
return NULL;
}
- buf = stash->dwarf_str_buffer + offset;
- if (*buf == '\0')
+ str = (char *) stash->dwarf_str_buffer + offset;
+ if (*str == '\0')
return NULL;
- return buf;
+ return str;
}
/* END VERBATIM */
static bfd_uint64_t
-read_address (struct comp_unit *unit, char *buf)
+read_address (struct comp_unit *unit, bfd_byte *buf)
{
switch (unit->addr_size)
{
read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
{
struct abbrev_info **abbrevs;
- char *abbrev_ptr;
+ bfd_byte *abbrev_ptr;
struct abbrev_info *cur_abbrev;
unsigned int abbrev_number, bytes_read, abbrev_name;
unsigned int abbrev_form, hash_number;
/* Read an attribute value described by an attribute form. */
-static char *
+static bfd_byte *
read_attribute_value (struct attribute *attr,
unsigned form,
struct comp_unit *unit,
- char *info_ptr)
+ bfd_byte *info_ptr)
{
bfd *abfd = unit->abfd;
unsigned int bytes_read;
/* Read an attribute described by an abbreviated attribute. */
-static char *
+static bfd_byte *
read_attribute (struct attribute *attr,
struct attr_abbrev *abbrev,
struct comp_unit *unit,
- char *info_ptr)
+ bfd_byte *info_ptr)
{
attr->name = abbrev->name;
info_ptr = read_attribute_value (attr, abbrev->form, unit, info_ptr);
{
struct line_info* prev_line;
bfd_vma address;
- char* filename;
+ char *filename;
unsigned int line;
unsigned int column;
int end_sequence; /* End of (sequential) code sequence. */
bfd* abfd;
unsigned int num_files;
unsigned int num_dirs;
- char* comp_dir;
- char** dirs;
+ char *comp_dir;
+ char **dirs;
struct fileinfo* files;
struct line_info* last_line; /* largest VMA */
struct line_info* lcl_head; /* local head; used in 'add_line_info' */
struct funcinfo
{
struct funcinfo *prev_func;
- char* name;
+ char *name;
bfd_vma low;
bfd_vma high;
};
static char *
concat_filename (struct line_info_table *table, unsigned int file)
{
- char* filename;
+ char *filename;
if (file - 1 >= table->num_files)
{
if (! IS_ABSOLUTE_PATH (filename))
{
- char* dirname = (table->files[file - 1].dir
+ char *dirname = (table->files[file - 1].dir
? table->dirs[table->files[file - 1].dir - 1]
: table->comp_dir);
{
bfd *abfd = unit->abfd;
struct line_info_table* table;
- char *line_ptr;
- char *line_end;
+ bfd_byte *line_ptr;
+ bfd_byte *line_end;
struct line_head lh;
unsigned int i, bytes_read, offset_size;
char *cur_file, *cur_dir;
find_abstract_instance_name (struct comp_unit *unit, bfd_uint64_t die_ref)
{
bfd *abfd = unit->abfd;
- char *info_ptr;
+ bfd_byte *info_ptr;
unsigned int abbrev_number, bytes_read, i;
struct abbrev_info *abbrev;
struct attribute attr;
scan_unit_for_functions (struct comp_unit *unit)
{
bfd *abfd = unit->abfd;
- char *info_ptr = unit->first_child_die_ptr;
+ bfd_byte *info_ptr = unit->first_child_die_ptr;
int nesting_level = 1;
while (nesting_level)
struct abbrev_info *abbrev;
struct attribute attr;
struct funcinfo *func;
- char* name = 0;
+ char *name = 0;
abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
info_ptr += bytes_read;
parse_comp_unit (bfd *abfd,
struct dwarf2_debug *stash,
bfd_vma unit_length,
- char *info_ptr_unit,
+ bfd_byte *info_ptr_unit,
unsigned int offset_size)
{
struct comp_unit* unit;
unsigned int abbrev_number, bytes_read, i;
struct abbrev_info *abbrev;
struct attribute attr;
- char *info_ptr = stash->info_ptr;
- char *end_ptr = info_ptr + unit_length;
+ bfd_byte *info_ptr = stash->info_ptr;
+ bfd_byte *end_ptr = info_ptr + unit_length;
bfd_size_type amt;
version = read_2_bytes (abfd, info_ptr);
case DW_AT_comp_dir:
{
- char* comp_dir = attr.u.str;
+ char *comp_dir = attr.u.str;
if (comp_dir)
{
/* Irix 6.2 native cc prepends <machine>.: to the compilation
bfd_vma length;
bfd_boolean found;
unsigned int offset_size = addr_size;
- char *info_ptr_unit = stash->info_ptr;
+ bfd_byte *info_ptr_unit = stash->info_ptr;
length = read_4_bytes (abfd, stash->info_ptr);
/* A 0xffffff length is the DWARF3 way of indicating we use
{
struct cie_header hdr;
unsigned char version;
- unsigned char augmentation[20];
+ char augmentation[20];
bfd_vma code_align;
bfd_signed_vma data_align;
bfd_vma ra_column;
see elf.c, elfcode.h. */
bfd *(*elf_backend_bfd_from_remote_memory)
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
+ int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
/* This function is used by `_bfd_elf_get_synthetic_symtab';
see elf.c. */
extern bfd *_bfd_elf32_bfd_from_remote_memory
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma, char *, int));
+ int (*target_read_memory) (bfd_vma, bfd_byte *, int));
extern bfd *_bfd_elf64_bfd_from_remote_memory
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma, char *, int));
+ int (*target_read_memory) (bfd_vma, bfd_byte *, int));
/* SH ELF specific routine. */
for (;;)
{
- unsigned char *aug;
+ char *aug;
bfd_byte *start, *end, *insns;
bfd_size_type length;
/* Cannot handle unknown versions. */
REQUIRE (cie.version == 1 || cie.version == 3);
- REQUIRE (strlen (buf) < sizeof (cie.augmentation));
+ REQUIRE (strlen ((char *) buf) < sizeof (cie.augmentation));
- strcpy (cie.augmentation, buf);
- buf = strchr (buf, '\0') + 1;
+ strcpy (cie.augmentation, (char *) buf);
+ buf = (bfd_byte *) strchr ((char *) buf, '\0') + 1;
ENSURE_NO_RELOCS (buf);
if (buf[0] == 'e' && buf[1] == 'h')
{
|| ent->need_lsda_relative
|| ent->per_encoding_relative)
{
- unsigned char *aug;
+ char *aug;
unsigned int action, extra_string, extra_data;
unsigned int per_width, per_encoding;
/* Skip length, id and version. */
buf += 9;
- aug = buf;
- buf = strchr (buf, '\0') + 1;
+ aug = (char *) buf;
+ buf += strlen (aug) + 1;
skip_leb128 (&buf, end);
skip_leb128 (&buf, end);
skip_leb128 (&buf, end);
/* Make room for the new augmentation string and data bytes. */
memmove (buf + extra_string + extra_data, buf, end - buf);
- memmove (aug + extra_string, aug, buf - aug);
+ memmove (aug + extra_string, aug, buf - (bfd_byte *) aug);
buf += extra_string;
end += extra_string + extra_data;
/* ELF strtab with GC and suffix merging support.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
struct elf_strtab_hash_entry *B = *(struct elf_strtab_hash_entry **) b;
unsigned int lenA = A->len;
unsigned int lenB = B->len;
- const unsigned char *s = A->root.string + lenA - 1;
- const unsigned char *t = B->root.string + lenB - 1;
+ const unsigned char *s = (const unsigned char *) A->root.string + lenA - 1;
+ const unsigned char *t = (const unsigned char *) B->root.string + lenB - 1;
int l = lenA < lenB ? lenA : lenB;
while (l)
file, into a newly allocated buffer, and return a pointer to the
buffer. */
-static char *
+static bfd_byte *
elf_read (bfd *abfd, file_ptr offset, bfd_size_type size)
{
- char *buf;
+ bfd_byte *buf;
if ((buf = bfd_alloc (abfd, size)) == NULL)
return NULL;
bfd_elf_get_str_section (bfd *abfd, unsigned int shindex)
{
Elf_Internal_Shdr **i_shdrp;
- char *shstrtab = NULL;
+ bfd_byte *shstrtab = NULL;
file_ptr offset;
bfd_size_type shstrtabsize;
i_shdrp = elf_elfsections (abfd);
if (i_shdrp == 0 || i_shdrp[shindex] == 0)
- return 0;
+ return NULL;
- shstrtab = (char *) i_shdrp[shindex]->contents;
+ shstrtab = i_shdrp[shindex]->contents;
if (shstrtab == NULL)
{
/* No cached one, attempt to read, and cache what we read. */
shstrtab = elf_read (abfd, offset, shstrtabsize);
i_shdrp[shindex]->contents = shstrtab;
}
- return shstrtab;
+ return (char *) shstrtab;
}
char *
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Shdr *symtab_shndx_hdr;
Elf_Internal_Shdr *symstrtab_hdr;
- char *outbound_syms;
- char *outbound_shndx;
+ bfd_byte *outbound_syms;
+ bfd_byte *outbound_shndx;
int idx;
bfd_size_type amt;
bfd_boolean name_local_sections;
(bfd *templ,
bfd_vma ehdr_vma,
bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma, char *, int))
+ int (*target_read_memory) (bfd_vma, bfd_byte *, int))
{
return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory)
(templ, ehdr_vma, loadbasep, target_read_memory);
bfd_put_32 (abfd, irel->r_offset + datasec->output_offset, p);
memset (p + 4, 0, 8);
if (targetsec != NULL)
- strncpy (p + 4, targetsec->output_section->name, 8);
+ strncpy ((char *) p + 4, targetsec->output_section->name, 8);
}
if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf)
bfd_put_32 (abfd, sizeof APUINFO_LABEL, buffer);
bfd_put_32 (abfd, num_entries * 4, buffer + 4);
bfd_put_32 (abfd, 0x2, buffer + 8);
- strcpy (buffer + 12, APUINFO_LABEL);
+ strcpy ((char *) buffer + 12, APUINFO_LABEL);
length = 20;
for (i = 0; i < num_entries; i++)
/* Renesas / SuperH specific support for Symbian 32-bit ELF files
- Copyright 2004
+ Copyright 2004, 2005
Free Software Foundation, Inc.
Contributed by Red Hat
typedef struct symbol_rename
{
struct symbol_rename * next;
- bfd_byte * current_name;
- bfd_byte * new_name;
+ char * current_name;
+ char * new_name;
struct elf_link_hash_entry * current_hash;
unsigned long new_symndx;
}
static bfd_boolean
sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
- bfd_byte * current_name, bfd_byte * new_name)
+ char * current_name, char * new_name)
{
struct elf_link_hash_entry * new_hash;
symbol_rename * node;
static bfd_boolean
-sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, bfd_byte * name)
+sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name)
{
if (DEBUG)
fprintf (stderr, "IMPORT '%s'\n", name);
}
static bfd_boolean
-sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, bfd_byte * name)
+sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, char * name)
{
if (DEBUG)
fprintf (stderr, "EXPORT '%s'\n", name);
sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
asection * sec, bfd_byte * contents)
{
- bfd_byte *s;
- bfd_byte *e;
+ char *s;
+ char *e;
bfd_boolean result = TRUE;
bfd_size_type sz = sec->rawsize ? sec->rawsize : sec->size;
- for (s = contents, e = s + sz; s < e;)
+ for (s = (char *) contents, e = s + sz; s < e;)
{
- bfd_byte * directive = s;
+ char * directive = s;
switch (*s)
{
result = FALSE;
else
{
- bfd_byte * new_name;
- bfd_byte * new_name_end;
- bfd_byte name_end_char;
+ char * new_name;
+ char * new_name_end;
+ char name_end_char;
/* Skip the IMPORT directive. */
s += strlen (DIRECTIVE_IMPORT);
}
else
{
- bfd_byte * current_name;
- bfd_byte * current_name_end;
- bfd_byte current_name_end_char;
+ char * current_name;
+ char * current_name_end;
+ char current_name_end_char;
/* Skip the 'AS '. */
s += strlen (DIRECTIVE_AS);
result = FALSE;
else
{
- bfd_byte * name;
- bfd_byte * name_end;
- bfd_byte name_end_char;
+ char * name;
+ char * name_end;
+ char name_end_char;
/* Skip the directive. */
s += strlen (DIRECTIVE_EXPORT);
if (! result)
{
if (DEBUG)
- fprintf (stderr, "offset into .directive section: %d\n", directive - contents);
+ fprintf (stderr, "offset into .directive section: %d\n",
+ directive - (char *) contents);
bfd_set_error (bfd_error_invalid_operation);
_bfd_error_handler (_("%B: Unrecognised .directive command: %s"),
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type sh_elf_ignore_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static reloc_howto_type *sh_elf_reloc_type_lookup
- (bfd *, bfd_reloc_code_real_type);
-static void sh_elf_info_to_howto
- (bfd *, arelent *, Elf_Internal_Rela *);
-static bfd_boolean sh_elf_set_private_flags
- (bfd *, flagword);
-static bfd_boolean sh_elf_copy_private_data
- (bfd *, bfd *);
-static bfd_boolean sh_elf_merge_private_data
- (bfd *, bfd *);
-static bfd_boolean sh_elf_set_mach_from_flags
- (bfd *);
-static bfd_boolean sh_elf_relax_section
- (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
static bfd_boolean sh_elf_relax_delete_bytes
(bfd *, asection *, bfd_vma, int);
static bfd_boolean sh_elf_align_loads
static bfd_boolean sh_elf_swap_insns
(bfd *, asection *, void *, bfd_byte *, bfd_vma);
#endif
-static bfd_boolean sh_elf_relocate_section
- (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
-static bfd_byte *sh_elf_get_relocated_section_contents
- (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
- bfd_boolean, asymbol **);
-static void sh_elf_copy_indirect_symbol
- (const struct elf_backend_data *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *);
static int sh_elf_optimized_tls_reloc
(struct bfd_link_info *, int, int);
-static bfd_boolean sh_elf_mkobject
- (bfd *);
-static bfd_boolean sh_elf_object_p
- (bfd *);
-static bfd_boolean sh_elf_check_relocs
- (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-static struct bfd_hash_entry *sh_elf_link_hash_newfunc
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-static struct bfd_link_hash_table *sh_elf_link_hash_table_create
- (bfd *);
-static bfd_boolean sh_elf_adjust_dynamic_symbol
- (struct bfd_link_info *, struct elf_link_hash_entry *);
-static bfd_boolean sh_elf_size_dynamic_sections
- (bfd *, struct bfd_link_info *);
-static bfd_boolean sh_elf_finish_dynamic_symbol
- (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
-static bfd_boolean sh_elf_finish_dynamic_sections
- (bfd *, struct bfd_link_info *);
-static bfd_reloc_status_type sh_elf_reloc_loop
- (int, bfd *, asection *, bfd_byte *, bfd_vma, asection *, bfd_vma,
- bfd_vma);
-static bfd_boolean create_got_section
- (bfd *, struct bfd_link_info *);
-static bfd_boolean sh_elf_create_dynamic_sections
- (bfd *, struct bfd_link_info *);
static bfd_vma dtpoff_base
(struct bfd_link_info *);
static bfd_vma tpoff
(struct bfd_link_info *, bfd_vma);
-static asection * sh_elf_gc_mark_hook
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *);
-static bfd_boolean sh_elf_gc_sweep_hook
- (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-static bfd_boolean allocate_dynrelocs
- (struct elf_link_hash_entry *, void *);
-static bfd_boolean readonly_dynrelocs
- (struct elf_link_hash_entry *, void *);
-static enum elf_reloc_type_class sh_elf_reloc_type_class
- (const Elf_Internal_Rela *);
-#ifdef INCLUDE_SHMEDIA
-inline static void movi_shori_putval (bfd *, unsigned long, char *);
-#endif
-#if !defined SH_TARGET_ALREADY_DEFINED
-static bfd_boolean elf32_shlin_grok_prstatus
- (bfd *abfd, Elf_Internal_Note *note);
-static bfd_boolean elf32_shlin_grok_psinfo
- (bfd *abfd, Elf_Internal_Note *note);
-#endif
/* The name of the dynamic interpreter. This is put in the .interp
section. */
#define elf_sh_plt_reloc_offset(info) (info->shared ? 52 : 44)
inline static void
-movi_shori_putval (bfd *output_bfd, unsigned long value, char *addr)
+movi_shori_putval (bfd *output_bfd, unsigned long value, bfd_byte *addr)
{
bfd_put_32 (output_bfd,
bfd_get_32 (output_bfd, addr)
/* MMIX-specific support for 64-bit ELF.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com>
This file is part of BFD, the Binary File Descriptor library.
position for the stub. There's supposed to be room allocated
for the stub. */
bfd_byte *stubcontents
- = ((char *) datap
+ = ((bfd_byte *) datap
- (addr - (isec->output_section->vma + isec->output_offset))
+ size
+ mmix_elf_section_data (isec)->pjs.stub_offset);
/* SuperH SH64-specific support for 64-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define sh64_elf64_hash_table(p) \
((struct elf_sh64_link_hash_table *) ((p)->hash))
-static bfd_boolean sh_elf64_copy_private_data
- (bfd *, bfd *);
-static bfd_boolean sh_elf64_copy_private_data_internal
- (bfd *, bfd *);
-static bfd_boolean sh_elf64_merge_private_data
- (bfd *, bfd *);
static bfd_reloc_status_type sh_elf64_ignore_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type sh_elf64_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static reloc_howto_type *sh_elf64_reloc_type_lookup
- (bfd *, bfd_reloc_code_real_type);
-static void sh_elf64_info_to_howto
- (bfd *, arelent *, Elf_Internal_Rela *);
-static bfd_boolean sh_elf64_relocate_section
- (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
-static bfd_byte *sh_elf64_get_relocated_section_contents
- (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
- bfd_boolean, asymbol **);
-static bfd_boolean sh_elf64_set_mach_from_flags
- (bfd *);
-static bfd_boolean sh_elf64_set_private_flags
- (bfd *, flagword);
-static asection *sh_elf64_gc_mark_hook
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *);
-static bfd_boolean sh_elf64_gc_sweep_hook
- (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-static bfd_boolean sh_elf64_check_relocs
- (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-static int sh64_elf64_get_symbol_type
- (Elf_Internal_Sym *, int);
-static bfd_boolean sh64_elf64_add_symbol_hook
- (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
- flagword *, asection **, bfd_vma *);
-static bfd_boolean sh64_elf64_link_output_symbol_hook
- (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
- struct elf_link_hash_entry *);
-static bfd_boolean sh64_elf64_fake_sections
- (bfd *, Elf_Internal_Shdr *, asection *);
-static void sh64_elf64_final_write_processing
- (bfd *, bfd_boolean);
-static struct bfd_hash_entry *sh64_elf64_link_hash_newfunc
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-static struct bfd_link_hash_table *sh64_elf64_link_hash_table_create
- (bfd *);
-inline static void movi_shori_putval
- (bfd *, unsigned long, char *);
-inline static void movi_3shori_putval
- (bfd *, bfd_vma, char *);
-static bfd_boolean sh64_elf64_create_dynamic_sections
- (bfd *, struct bfd_link_info *);
-static bfd_boolean sh64_elf64_adjust_dynamic_symbol
- (struct bfd_link_info *info, struct elf_link_hash_entry *);
-static bfd_boolean sh64_elf64_discard_copies
- (struct elf_sh64_link_hash_entry *, void *);
-static bfd_boolean sh64_elf64_size_dynamic_sections
- (bfd *, struct bfd_link_info *);
-static bfd_boolean sh64_elf64_finish_dynamic_symbol
- (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
-static bfd_boolean sh64_elf64_finish_dynamic_sections
- (bfd *, struct bfd_link_info *);
static reloc_howto_type sh_elf64_howto_table[] = {
/* No relocation. */
/* Set the SHF_SH5_ISA32 flag for ISA SHmedia code sections. */
-bfd_boolean
+static bfd_boolean
sh64_elf64_fake_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
Elf_Internal_Shdr *elf_section_hdr,
asection *asect)
}
inline static void
-movi_shori_putval (bfd *output_bfd, unsigned long value, char *addr)
+movi_shori_putval (bfd *output_bfd, unsigned long value, bfd_byte *addr)
{
bfd_put_32 (output_bfd,
bfd_get_32 (output_bfd, addr)
}
inline static void
-movi_3shori_putval (bfd *output_bfd, bfd_vma value, char *addr)
+movi_3shori_putval (bfd *output_bfd, bfd_vma value, bfd_byte *addr)
{
bfd_put_32 (output_bfd,
bfd_get_32 (output_bfd, addr)
(bfd *templ,
bfd_vma ehdr_vma,
bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma, char *, int))
+ int (*target_read_memory) (bfd_vma, bfd_byte *, int))
{
Elf_External_Ehdr x_ehdr; /* Elf file header, external form */
Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
bfd *nbfd;
struct bfd_in_memory *bim;
int contents_size;
- char *contents;
+ bfd_byte *contents;
int err;
unsigned int i;
bfd_vma loadbase;
/* Read in the ELF header in external format. */
- err = target_read_memory (ehdr_vma, (char *) &x_ehdr, sizeof x_ehdr);
+ err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr, sizeof x_ehdr);
if (err)
{
bfd_set_error (bfd_error_system_call);
bfd_set_error (bfd_error_no_memory);
return NULL;
}
- err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (char *) x_phdrs,
+ err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs,
i_ehdr.e_phnum * sizeof x_phdrs[0]);
if (err)
{
ss = bfd_malloc (count);
if (ss == NULL)
goto error_return;
- if (! _bfd_ecoff_get_accumulated_ss (handle, ss))
+ if (! _bfd_ecoff_get_accumulated_ss (handle, (bfd_byte *) ss))
goto error_return;
count = hdr->ipdMax;
(This include file is not for users of the library.)
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Cygnus Support.
(bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
void *), void *);
-extern bfd_vma read_unsigned_leb128 (bfd *, char *, unsigned int *);
-extern bfd_signed_vma read_signed_leb128 (bfd *, char *, unsigned int *);
+extern bfd_vma read_unsigned_leb128 (bfd *, bfd_byte *, unsigned int *);
+extern bfd_signed_vma read_signed_leb128 (bfd *, bfd_byte *, unsigned int *);
/* Assorted BFD support routines, only used internally.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004
+ 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_vma
read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
- char *buf,
+ bfd_byte *buf,
unsigned int *bytes_read_ptr)
{
bfd_vma result;
unsigned int num_read;
- int shift;
+ unsigned int shift;
unsigned char byte;
result = 0;
num_read = 0;
do
{
- byte = bfd_get_8 (abfd, (bfd_byte *) buf);
+ byte = bfd_get_8 (abfd, buf);
buf++;
num_read++;
result |= (((bfd_vma) byte & 0x7f) << shift);
bfd_signed_vma
read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
- char *buf,
- unsigned int * bytes_read_ptr)
+ bfd_byte *buf,
+ unsigned int *bytes_read_ptr)
{
bfd_vma result;
- unsigned shift;
- int num_read;
+ unsigned int shift;
+ unsigned int num_read;
unsigned char byte;
result = 0;
num_read = 0;
do
{
- byte = bfd_get_8 (abfd, (bfd_byte *) buf);
+ byte = bfd_get_8 (abfd, buf);
buf ++;
num_read ++;
result |= (((bfd_vma) byte & 0x7f) << shift);
shift += 7;
}
while (byte & 0x80);
- if ((shift < 8 * sizeof (result)) && (byte & 0x40))
+ if (shift < 8 * sizeof (result) && (byte & 0x40))
result |= (((bfd_vma) -1) << shift);
*bytes_read_ptr = num_read;
return result;
(This include file is not for users of the library.)
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Cygnus Support.
(bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
void *), void *);
-extern bfd_vma read_unsigned_leb128 (bfd *, char *, unsigned int *);
-extern bfd_signed_vma read_signed_leb128 (bfd *, char *, unsigned int *);
+extern bfd_vma read_unsigned_leb128 (bfd *, bfd_byte *, unsigned int *);
+extern bfd_signed_vma read_signed_leb128 (bfd *, bfd_byte *, unsigned int *);
/* Extracted from init.c. */
/* Extracted from libbfd.c. */
bfd_set_error (bfd_error_file_truncated);
return -1;
}
- sym->strtab = b->buffer + sym->stroff;
+ sym->strtab = (char *) b->buffer + sym->stroff;
return 0;
}
if (ret < 0)
return NULL;
- return buf;
+ return (char *) buf;
}
int
/* SEC_MERGE support.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
eltalign = ((eltalign ^ (eltalign - 1)) + 1) >> 1;
if (!eltalign || eltalign > mask)
eltalign = mask + 1;
- entry = sec_merge_add (sinfo->htab, p, (unsigned) eltalign, secinfo);
+ entry = sec_merge_add (sinfo->htab, (char *) p, (unsigned) eltalign,
+ secinfo);
if (! entry)
goto error_return;
p += entry->len;
if (!nul && !((p - secinfo->contents) & mask))
{
nul = TRUE;
- entry = sec_merge_add (sinfo->htab, p,
+ entry = sec_merge_add (sinfo->htab, (char *) p,
(unsigned) mask + 1, secinfo);
if (! entry)
goto error_return;
{
for (p = secinfo->contents; p < end; p += sec->entsize)
{
- entry = sec_merge_add (sinfo->htab, p, 1, secinfo);
+ entry = sec_merge_add (sinfo->htab, (char *) p, 1, secinfo);
if (! entry)
goto error_return;
}
struct sec_merge_hash_entry *B = *(struct sec_merge_hash_entry **) b;
unsigned int lenA = A->len;
unsigned int lenB = B->len;
- const unsigned char *s = A->root.string + lenA - 1;
- const unsigned char *t = B->root.string + lenB - 1;
+ const unsigned char *s = (const unsigned char *) A->root.string + lenA - 1;
+ const unsigned char *t = (const unsigned char *) B->root.string + lenB - 1;
int l = lenA < lenB ? lenA : lenB;
while (l)
struct sec_merge_hash_entry *B = *(struct sec_merge_hash_entry **) b;
unsigned int lenA = A->len;
unsigned int lenB = B->len;
- const unsigned char *s = A->root.string + lenA - 1;
- const unsigned char *t = B->root.string + lenB - 1;
+ const unsigned char *s = (const unsigned char *) A->root.string + lenA - 1;
+ const unsigned char *t = (const unsigned char *) B->root.string + lenB - 1;
int l = lenA < lenB ? lenA : lenB;
int tail_align = (lenA & (A->alignment - 1)) - (lenB & (A->alignment - 1));
{
p = secinfo->contents + (offset / sec->entsize) * sec->entsize;
}
- entry = sec_merge_hash_lookup (secinfo->htab, p, 0, FALSE);
+ entry = sec_merge_hash_lookup (secinfo->htab, (char *) p, 0, FALSE);
if (!entry)
{
if (! secinfo->htab->strings)
/* BFD back-end for mmo objects (MMIX-specific object-format).
- Copyright 2001, 2002, 2003, 2004
+ Copyright 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Hans-Peter Nilsson (hp@bitrange.com).
Infrastructure and other bits originally copied from srec.c and
particular input or caller; put such things into the bfd or elsewhere.
Look ma, no static per-invocation data! */
-static unsigned
+static
char valid_mmo_symbol_character_set[/* A-Z a-z (we assume consecutive
codes; sorry EBCDIC:ers!). */
+ 'Z' - 'A' + 1 + 'z' - 'a' + 1
static asection *
mmo_get_spec_section (bfd *abfd, int spec_data_number)
{
- bfd_byte *secname;
+ char *secname;
asection *sec;
bfd_byte buf[4];
unsigned int secname_length;
if (bfd_bread (secname + i * 4, 4, abfd) != 4)
goto format_error_free;
- if (secname[i * 4] == LOP)
+ if (secname[i * 4] == (char) LOP)
{
/* A bit of overkill, but we handle char 0x98 in a section name,
and recognize misparsing. */
mmo_write_tetra_raw (abfd, LOP_SPEC_SECTION);
mmo_write_tetra (abfd, (strlen (sec->name) + 3) / 4);
- mmo_write_chunk (abfd, sec->name, strlen (sec->name));
+ mmo_write_chunk (abfd, (bfd_byte *) sec->name, strlen (sec->name));
mmo_flush_chunk (abfd);
/* FIXME: We can get debug sections (.debug_line & Co.) with a section
flag still having SEC_RELOC set. Investigate. This might be true
/* opncls.c -- open and close a BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Cygnus Support.
unsigned long crc32;
bfd_byte *contents;
int crc_offset;
+ char *name;
BFD_ASSERT (abfd);
BFD_ASSERT (crc32_out);
}
/* Crc value is stored after the filename, aligned up to 4 bytes. */
- crc_offset = strlen (contents) + 1;
+ name = (char *) contents;
+ crc_offset = strlen (name) + 1;
crc_offset = (crc_offset + 3) & ~3;
crc32 = bfd_get_32 (abfd, contents + crc_offset);
*crc32_out = crc32;
- return contents;
+ return name;
}
/*
static bfd_boolean
separate_debug_file_exists (const char *name, const unsigned long crc)
{
- static char buffer [8 * 1024];
+ static unsigned char buffer [8 * 1024];
unsigned long file_crc = 0;
int fd;
bfd_size_type count;
char * contents;
bfd_size_type crc_offset;
FILE * handle;
- static char buffer[8 * 1024];
+ static unsigned char buffer[8 * 1024];
size_t count;
if (abfd == NULL || sect == NULL || filename == NULL)
fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
if (strncmp (symbol->name, "__traceback_", strlen ("__traceback_")) == 0)
{
- char *buf = alloca (symbol->udata.i);
+ unsigned char *buf = alloca (symbol->udata.i);
size_t offset = symbol->value + 4;
size_t len = symbol->udata.i;
int ret;
goto error;
max = loaderlen - (header.loader_strings_offset + imports[index].name);
- symname = loaderbuf + header.loader_strings_offset + imports[index].name;
+ symname = (char *) loaderbuf;
+ symname += header.loader_strings_offset + imports[index].name;
namelen = 0;
for (s = symname; s < (symname + max); s++)
{
count = 0;
if (codesec != NULL)
{
- unsigned long ncount = 0;
+ long ncount = 0;
bfd_pef_parse_traceback_tables (abfd, codesec, codebuf, codelen,
&ncount, csym);
count += ncount;
/* Support for the generic parts of PE/PEI, for BFD.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
- Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005 Free Software Foundation, Inc.
Written by Cygnus Solutions.
This file is part of BFD, the Binary File Descriptor library.
struct internal_reloc * int_reltab;
}
pe_ILF_vars;
-
-static asection_ptr pe_ILF_make_a_section PARAMS ((pe_ILF_vars *, const char *, unsigned int, flagword));
-static void pe_ILF_make_a_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr));
-static void pe_ILF_make_a_symbol PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword));
-static void pe_ILF_save_relocs PARAMS ((pe_ILF_vars *, asection_ptr));
-static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct bfd_symbol **, unsigned int));
-static bfd_boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned int, bfd_byte *, bfd_byte *, unsigned int, unsigned int));
-static const bfd_target * pe_ILF_object_p PARAMS ((bfd *));
-static const bfd_target * pe_bfd_object_p PARAMS ((bfd *));
#endif /* COFF_IMAGE_WITH_PE */
/**********************************************************************/
static bfd_boolean
pe_ILF_build_a_bfd (bfd * abfd,
unsigned int magic,
- bfd_byte * symbol_name,
- bfd_byte * source_dll,
+ char * symbol_name,
+ char * source_dll,
unsigned int ordinal,
unsigned int types)
{
vars.int_reltab = (struct internal_reloc *) ptr;
ptr += SIZEOF_ILF_INT_RELOCS;
- vars.string_table = ptr;
- vars.string_ptr = ptr + STRING_SIZE_SIZE;
+ vars.string_table = (char *) ptr;
+ vars.string_ptr = (char *) ptr + STRING_SIZE_SIZE;
ptr += SIZEOF_ILF_STRINGS;
- vars.end_string_ptr = ptr;
+ vars.end_string_ptr = (char *) ptr;
/* The remaining space in bim->buffer is used
by the pe_ILF_make_a_section() function. */
id6->contents[0] = ordinal & 0xff;
id6->contents[1] = ordinal >> 8;
- strcpy (id6->contents + 2, symbol);
+ strcpy ((char *) id6->contents + 2, symbol);
}
if (import_name_type != IMPORT_ORDINAL)
/* Create an import symbol for the DLL, without the
.dll suffix. */
- ptr = strrchr (source_dll, '.');
+ ptr = (bfd_byte *) strrchr (source_dll, '.');
if (ptr)
* ptr = 0;
pe_ILF_make_a_symbol (& vars, "__IMPORT_DESCRIPTOR_", source_dll, NULL, 0);
{
bfd_byte buffer[16];
bfd_byte * ptr;
- bfd_byte * symbol_name;
- bfd_byte * source_dll;
+ char * symbol_name;
+ char * source_dll;
unsigned int machine;
bfd_size_type size;
unsigned int ordinal;
return NULL;
}
- symbol_name = ptr;
- source_dll = ptr + strlen (ptr) + 1;
+ symbol_name = (char *) ptr;
+ source_dll = symbol_name + strlen (symbol_name) + 1;
/* Verify that the strings are null terminated. */
- if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size))
+ if (ptr[size - 1] != 0
+ || (bfd_size_type) ((bfd_byte *) source_dll - ptr) >= size)
{
_bfd_error_handler
(_("%B: string not null terminated in ILF object file."), abfd);
/* BFD back-end for s-record objects.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004
+ 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
len = 40;
return srec_write_record (abfd, 0, (bfd_vma) 0,
- abfd->filename, abfd->filename + len);
+ (bfd_byte *) abfd->filename,
+ (bfd_byte *) abfd->filename + len);
}
static bfd_boolean
/* vms-hdr.c -- BFD back-end for VMS/VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005
Free Software Foundation, Inc.
HDR record handling functions
pnt[10] = 0;
pnt[16] = 0;
pnt[24] = 0;
- sprintf (tbuf, "%2s-%3s-%s %s", pnt + 8, pnt + 4, pnt + 20, pnt + 11);
+ sprintf ((char *) tbuf, "%2s-%3s-%s %s",
+ pnt + 8, pnt + 4, pnt + 20, pnt + 11);
#else
#include <starlet.h>
struct
/* vms-tir.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
TIR record handling functions
case TIR_S_C_CTL_SETRB:
/* Set relocation base: pop stack, set image location counter
arg: none. */
- dummy = _bfd_vms_pop (abfd, &psect);
+ dummy = _bfd_vms_pop (abfd, (int *) &psect);
if (psect >= PRIV (section_count))
alloc_section (abfd, psect);
image_set_ptr (abfd, (int) psect, (uquad) dummy);
case TIR_S_C_CTL_STLOC:
/* Set location: pop index, restore location counter from index
arg: none. */
- dummy = _bfd_vms_pop (abfd, &psect);
+ dummy = _bfd_vms_pop (abfd, (int *) &psect);
(*_bfd_error_handler) (_("%s: not fully implemented"),
tir_cmd_name (ptr[-1]));
break;
case TIR_S_C_CTL_STKDL:
/* Stack defined location: pop index, push location counter from index
arg: none. */
- dummy = _bfd_vms_pop (abfd, &psect);
+ dummy = _bfd_vms_pop (abfd, (int *) &psect);
(*_bfd_error_handler) (_("%s: not fully implemented"),
tir_cmd_name (ptr[-1]));
break;
/* xSYM symbol-file support for BFD.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
#define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-static int pstrcmp PARAMS ((unsigned char *, unsigned char *));
static unsigned long compute_offset
PARAMS ((unsigned long, unsigned long, unsigned long, unsigned long));
extern const bfd_target sym_vec;
static int
-pstrcmp (a, b)
- unsigned char *a;
- unsigned char *b;
+pstrcmp (const char *as, const char *bs)
{
+ const unsigned char *a = (const unsigned char *) as;
+ const unsigned char *b = (const unsigned char *) bs;
unsigned char clen;
int ret;
- clen = (a[0] > b[0]) ? a[0] : b[0];
+ clen = (a[0] > b[0]) ? b[0] : a[0];
ret = memcmp (a + 1, b + 1, clen);
if (ret != 0)
return ret;
else if (a[0] < b[0])
return -1;
else
- return 0;
+ return 1;
}
static unsigned long
bfd *abfd;
bfd_sym_version *version;
{
- unsigned char version_string[32];
+ char version_string[32];
long ret;
ret = bfd_bread (version_string, sizeof (version_string), abfd);
sdata = abfd->tdata.sym_data;
if (index == 0)
- return "";
+ return (const unsigned char *) "";
index *= 2;
if ((index / sdata->header.dshb_page_size)
> sdata->header.dshb_nte.dti_page_count)
- return "\009[INVALID]";
+ return (const unsigned char *) "\09[INVALID]";
return (const unsigned char *) sdata->name_table + index;
}
bfd_sym_modules_table_entry entry;
if (bfd_sym_fetch_modules_table_entry (abfd, &entry, index) < 0)
- return "\011[INVALID]";
+ return (const unsigned char *) "\09[INVALID]";
return bfd_sym_symbol_name (abfd, entry.mte_nte_index);
}
case 3:
{
- unsigned long value;
+ long value;
fprintf (f, "scalar (0x%x) of ", type);
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
bfd_sym_fetch_long (buf, len, offset, &offset, &value);
- fprintf (f, " (%lu)", value);
+ fprintf (f, " (%lu)", (unsigned long) value);
break;
}
case 5:
{
- unsigned long lower, upper, nelem;
- unsigned long i;
+ long lower, upper, nelem;
+ int i;
fprintf (f, "enumeration (0x%x) of ", type);
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
bfd_sym_fetch_long (buf, len, offset, &offset, &lower);
bfd_sym_fetch_long (buf, len, offset, &offset, &upper);
bfd_sym_fetch_long (buf, len, offset, &offset, &nelem);
- fprintf (f, " from %lu to %lu with %lu elements: ", lower, upper, nelem);
+ fprintf (f, " from %lu to %lu with %lu elements: ",
+ (unsigned long) lower, (unsigned long) upper,
+ (unsigned long) nelem);
for (i = 0; i < nelem; i++)
{
/* Configurable Xtensa ISA support.
- Copyright 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
both. */
int
-xtensa_insnbuf_to_chars (xtensa_isa isa, const xtensa_insnbuf insn, char *cp,
+xtensa_insnbuf_to_chars (xtensa_isa isa,
+ const xtensa_insnbuf insn,
+ unsigned char *cp,
int num_chars)
{
xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
by endianness. */
void
-xtensa_insnbuf_from_chars (xtensa_isa isa, xtensa_insnbuf insn, const char *cp,
+xtensa_insnbuf_from_chars (xtensa_isa isa,
+ xtensa_insnbuf insn,
+ const unsigned char *cp,
int num_chars)
{
xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
int
-xtensa_isa_length_from_chars (xtensa_isa isa, const char *cp)
+xtensa_isa_length_from_chars (xtensa_isa isa, const unsigned char *cp)
{
xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa;
return (intisa->length_decode_fn) (cp);
/* Xtensa configuration-specific ISA information.
- Copyright 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
};
static int
-length_decoder (const char *insn)
+length_decoder (const unsigned char *insn)
{
int op0 = (insn[0] >> 4) & 0xf;
return length_table[op0];
+2005-02-21 Alan Modra <amodra@bigpond.net.au>
+
+ * xtensa-isa-internal.h (xtensa_length_decode_fn): Warning fix.
+ * xtensa-isa.h (xtensa_insnbuf_to_chars): Likewise.
+ (xtensa_insnbuf_from_chars, xtensa_isa_length_from_chars): Likewise.
+
2005-02-14 Paolo Bonzini <bonzini@gnu.org>
PR bootstrap/19818
+2005-02-21 Alan Modra <amodra@bigpond.net.au>
+
+ * xcoff.h (struct xcoff_loader_info): Warning fix.
+
2005-01-10 Inderpreet Singh <inderpreetb@noida.hcltech.com>
* maxq.h (F_MAXQ10, F_MAXQ20): Define.
/* Internal format of XCOFF object file data structures for BFD.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
size_t string_size;
/* String table. */
- bfd_byte *strings;
+ char *strings;
/* Allocated size of string table. */
size_t string_alc;
/* Internal definitions for configurable Xtensa ISA support.
- Copyright 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
typedef int (*xtensa_undo_reloc_fn) (uint32 *, uint32);
typedef void (*xtensa_opcode_encode_fn) (xtensa_insnbuf);
typedef int (*xtensa_format_decode_fn) (const xtensa_insnbuf);
-typedef int (*xtensa_length_decode_fn) (const char *);
+typedef int (*xtensa_length_decode_fn) (const unsigned char *);
typedef struct xtensa_format_internal_struct
{
/* Interface definition for configurable Xtensa ISA support.
- Copyright 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
extern int
xtensa_insnbuf_to_chars (xtensa_isa isa, const xtensa_insnbuf insn,
- char *cp, int num_chars);
+ unsigned char *cp, int num_chars);
extern void
xtensa_insnbuf_from_chars (xtensa_isa isa, xtensa_insnbuf insn,
- const char *cp, int num_chars);
+ const unsigned char *cp, int num_chars);
\f
/* ISA information. */
XTENSA_UNDEFINED on error. */
extern int
-xtensa_isa_length_from_chars (xtensa_isa isa, const char *cp);
+xtensa_isa_length_from_chars (xtensa_isa isa, const unsigned char *cp);
/* Get the number of stages in the processor's pipeline. The pipeline