This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
bfd gcc4 warning fixes
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Mon, 21 Feb 2005 01:35:03 +1030
- Subject: bfd gcc4 warning fixes
Mostly boring warnings related to "char *" and "unsigned char *" now
getting a warning when one is assigned to the other. I generally went
for using "bfd_byte *" (ie. unsigned char *) for chunks of binary and
"char *" for strings.
I noticed some fairly obvious errors in xsym.c while doing this, so
those are fixed as part of this patch.
include/
* 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.
Index: include/xtensa-isa-internal.h
===================================================================
RCS file: /cvs/src/src/include/xtensa-isa-internal.h,v
retrieving revision 1.4
diff -u -p -r1.4 xtensa-isa-internal.h
--- include/xtensa-isa-internal.h 12 Nov 2004 21:59:13 -0000 1.4
+++ include/xtensa-isa-internal.h 19 Feb 2005 08:09:32 -0000
@@ -49,7 +49,7 @@ typedef int (*xtensa_do_reloc_fn) (uint3
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
{
Index: include/xtensa-isa.h
===================================================================
RCS file: /cvs/src/src/include/xtensa-isa.h,v
retrieving revision 1.3
diff -u -p -r1.3 xtensa-isa.h
--- include/xtensa-isa.h 12 Nov 2004 21:59:13 -0000 1.3
+++ include/xtensa-isa.h 19 Feb 2005 08:09:32 -0000
@@ -209,11 +209,11 @@ xtensa_insnbuf_free (xtensa_isa isa, xte
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);
/* ISA information. */
@@ -242,7 +242,7 @@ xtensa_isa_maxlength (xtensa_isa isa);
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
Index: include/coff/xcoff.h
===================================================================
RCS file: /cvs/src/src/include/coff/xcoff.h,v
retrieving revision 1.11
diff -u -p -r1.11 xcoff.h
--- include/coff/xcoff.h 29 Jun 2003 13:52:02 -0000 1.11
+++ include/coff/xcoff.h 19 Feb 2005 08:09:32 -0000
@@ -409,7 +409,7 @@ struct xcoff_loader_info
size_t string_size;
/* String table. */
- bfd_byte *strings;
+ char *strings;
/* Allocated size of string table. */
size_t string_alc;
Index: bfd/bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.93
diff -u -p -r1.93 bfd-in.h
--- bfd/bfd-in.h 10 Feb 2005 09:15:08 -0000 1.93
+++ bfd/bfd-in.h 19 Feb 2005 08:08:03 -0000
@@ -681,7 +681,7 @@ extern int bfd_get_elf_phdrs
the remote memory. */
extern bfd *ibfd_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
Index: bfd/coff-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-m68k.c,v
retrieving revision 1.13
diff -u -p -r1.13 coff-m68k.c
--- bfd/coff-m68k.c 25 Jun 2003 06:40:18 -0000 1.13
+++ bfd/coff-m68k.c 19 Feb 2005 08:08:04 -0000
@@ -510,7 +510,7 @@ bfd_m68k_coff_create_embedded_relocs (ab
(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;
Index: bfd/coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.66
diff -u -p -r1.66 coff-rs6000.c
--- bfd/coff-rs6000.c 21 Oct 2004 15:28:16 -0000 1.66
+++ bfd/coff-rs6000.c 19 Feb 2005 08:08:05 -0000
@@ -1849,8 +1849,8 @@ xcoff_write_armap_big (abfd, elength, ma
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 =
@@ -1860,8 +1860,7 @@ xcoff_write_armap_big (abfd, elength, ma
+ 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;
@@ -1941,7 +1940,6 @@ xcoff_write_armap_big (abfd, elength, ma
bfd_bwrite (symbol_table, symbol_table_size, abfd);
free (symbol_table);
- symbol_table = NULL;
prevoff = nextoff;
nextoff = nextoff + symbol_table_size;
@@ -1952,8 +1950,8 @@ xcoff_write_armap_big (abfd, elength, ma
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 =
@@ -1963,8 +1961,7 @@ xcoff_write_armap_big (abfd, elength, ma
+ 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;
@@ -2039,7 +2036,6 @@ xcoff_write_armap_big (abfd, elength, ma
bfd_bwrite (symbol_table, symbol_table_size, abfd);
free (symbol_table);
- symbol_table = NULL;
PRINT20 (fhdr->symoff64, nextoff);
}
@@ -2311,7 +2307,7 @@ xcoff_write_archive_contents_big (abfd)
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);
@@ -2476,8 +2472,7 @@ xcoff_write_archive_contents_big (abfd)
+ 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;
@@ -2530,7 +2525,6 @@ xcoff_write_archive_contents_big (abfd)
return FALSE;
free (member_table);
- member_table = NULL;
PRINT20 (fhdr.memoff, nextoff);
@@ -3530,7 +3524,7 @@ _bfd_xcoff_put_ldsymbol_name (abfd, ldin
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)
@@ -3538,8 +3532,7 @@ _bfd_xcoff_put_ldsymbol_name (abfd, ldin
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;
Index: bfd/coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.57
diff -u -p -r1.57 coff64-rs6000.c
--- bfd/coff64-rs6000.c 21 Oct 2004 15:28:19 -0000 1.57
+++ bfd/coff64-rs6000.c 19 Feb 2005 08:08:07 -0000
@@ -564,7 +564,7 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ld
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)
@@ -572,8 +572,7 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ld
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;
Index: bfd/coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.46
diff -u -p -r1.46 coffgen.c
--- bfd/coffgen.c 31 Jan 2005 23:13:17 -0000 1.46
+++ bfd/coffgen.c 19 Feb 2005 08:08:08 -0000
@@ -1155,7 +1155,7 @@ coff_write_symbols (abfd)
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;
Index: bfd/cofflink.c
===================================================================
RCS file: /cvs/src/src/bfd/cofflink.c,v
retrieving revision 1.52
diff -u -p -r1.52 cofflink.c
--- bfd/cofflink.c 31 Jan 2005 23:13:17 -0000 1.52
+++ bfd/cofflink.c 19 Feb 2005 08:08:10 -0000
@@ -1221,16 +1221,16 @@ process_embedded_commands (bfd *output_b
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;
Index: bfd/cpu-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-arm.c,v
retrieving revision 1.14
diff -u -p -r1.14 cpu-arm.c
--- bfd/cpu-arm.c 13 Aug 2004 03:15:56 -0000 1.14
+++ bfd/cpu-arm.c 19 Feb 2005 08:08:10 -0000
@@ -24,21 +24,12 @@
#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)
@@ -105,9 +96,7 @@ processors[] =
};
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;
@@ -162,9 +151,7 @@ const bfd_arch_info_type bfd_arm_arch =
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);
@@ -226,12 +213,11 @@ typedef struct
} 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;
@@ -246,7 +232,7 @@ arm_check_note (abfd, buffer, buffer_siz
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)
@@ -279,9 +265,7 @@ arm_check_note (abfd, buffer, buffer_siz
#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;
@@ -329,7 +313,9 @@ bfd_arm_update_notes (abfd, note_section
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))
@@ -374,9 +360,7 @@ architectures[] =
/* 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;
Index: bfd/dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.60
diff -u -p -r1.60 dwarf2.c
--- bfd/dwarf2.c 17 Jan 2005 17:11:59 -0000 1.60
+++ bfd/dwarf2.c 19 Feb 2005 08:08:11 -0000
@@ -71,44 +71,44 @@ struct attribute
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;
@@ -127,48 +127,48 @@ struct arange
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;
@@ -211,38 +211,38 @@ struct attr_abbrev
/* 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
@@ -253,27 +253,29 @@ read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED
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);
@@ -315,16 +317,16 @@ read_indirect_string (struct comp_unit*
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)
{
@@ -370,7 +372,7 @@ static struct abbrev_info**
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;
@@ -477,11 +479,11 @@ read_abbrevs (bfd *abfd, bfd_uint64_t of
/* 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;
@@ -605,11 +607,11 @@ read_attribute_value (struct attribute *
/* 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);
@@ -625,7 +627,7 @@ struct line_info
{
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. */
@@ -644,8 +646,8 @@ struct line_info_table
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' */
@@ -654,7 +656,7 @@ struct line_info_table
struct funcinfo
{
struct funcinfo *prev_func;
- char* name;
+ char *name;
bfd_vma low;
bfd_vma high;
};
@@ -763,7 +765,7 @@ add_line_info (struct line_info_table *t
static char *
concat_filename (struct line_info_table *table, unsigned int file)
{
- char* filename;
+ char *filename;
if (file - 1 >= table->num_files)
{
@@ -776,7 +778,7 @@ concat_filename (struct line_info_table
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);
@@ -846,8 +848,8 @@ decode_line_info (struct comp_unit *unit
{
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;
@@ -1265,7 +1267,7 @@ static char *
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;
@@ -1306,7 +1308,7 @@ static bfd_boolean
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)
@@ -1315,7 +1317,7 @@ scan_unit_for_functions (struct comp_uni
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;
@@ -1417,7 +1419,7 @@ static struct comp_unit *
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;
@@ -1428,8 +1430,8 @@ parse_comp_unit (bfd *abfd,
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);
@@ -1527,7 +1529,7 @@ parse_comp_unit (bfd *abfd,
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
@@ -1791,7 +1793,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd
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
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.172
diff -u -p -r1.172 elf-bfd.h
--- bfd/elf-bfd.h 11 Feb 2005 16:41:09 -0000 1.172
+++ bfd/elf-bfd.h 19 Feb 2005 08:08:16 -0000
@@ -269,7 +269,7 @@ struct cie
{
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;
@@ -955,7 +955,7 @@ struct elf_backend_data
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. */
@@ -1780,10 +1780,10 @@ extern char *elfcore_write_lwpstatus
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. */
Index: bfd/elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.43
diff -u -p -r1.43 elf-eh-frame.c
--- bfd/elf-eh-frame.c 17 Feb 2005 12:39:17 -0000 1.43
+++ bfd/elf-eh-frame.c 19 Feb 2005 08:08:17 -0000
@@ -453,7 +453,7 @@ _bfd_elf_discard_section_eh_frame
for (;;)
{
- unsigned char *aug;
+ char *aug;
bfd_byte *start, *end, *insns;
bfd_size_type length;
@@ -563,10 +563,10 @@ _bfd_elf_discard_section_eh_frame
/* 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')
{
@@ -1088,7 +1088,7 @@ _bfd_elf_write_section_eh_frame (bfd *ab
|| 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;
@@ -1102,8 +1102,8 @@ _bfd_elf_write_section_eh_frame (bfd *ab
/* 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);
@@ -1117,7 +1117,7 @@ _bfd_elf_write_section_eh_frame (bfd *ab
/* 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;
Index: bfd/elf-strtab.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-strtab.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf-strtab.c
--- bfd/elf-strtab.c 29 Oct 2003 22:59:37 -0000 1.8
+++ bfd/elf-strtab.c 19 Feb 2005 08:08:17 -0000
@@ -263,8 +263,8 @@ strrevcmp (const void *a, const void *b)
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)
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.265
diff -u -p -r1.265 elf.c
--- bfd/elf.c 11 Feb 2005 16:41:09 -0000 1.265
+++ bfd/elf.c 19 Feb 2005 08:08:19 -0000
@@ -210,10 +210,10 @@ bfd_elf_hash (const char *namearg)
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;
@@ -253,15 +253,15 @@ char *
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. */
@@ -270,7 +270,7 @@ bfd_elf_get_str_section (bfd *abfd, unsi
shstrtab = elf_read (abfd, offset, shstrtabsize);
i_shdrp[shindex]->contents = shstrtab;
}
- return shstrtab;
+ return (char *) shstrtab;
}
char *
@@ -5576,8 +5576,8 @@ swap_out_syms (bfd *abfd,
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;
@@ -7866,7 +7866,7 @@ bfd_elf_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))
{
return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory)
(templ, ehdr_vma, loadbasep, target_read_memory);
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.72
diff -u -p -r1.72 elf32-m68k.c
--- bfd/elf32-m68k.c 11 Jan 2005 09:32:49 -0000 1.72
+++ bfd/elf32-m68k.c 19 Feb 2005 08:08:20 -0000
@@ -2170,7 +2170,7 @@ bfd_m68k_elf32_create_embedded_relocs (a
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)
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.135
diff -u -p -r1.135 elf32-ppc.c
--- bfd/elf32-ppc.c 28 Jan 2005 17:58:24 -0000 1.135
+++ bfd/elf32-ppc.c 19 Feb 2005 08:08:23 -0000
@@ -6110,7 +6110,7 @@ ppc_elf_final_write_processing (bfd *abf
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++)
Index: bfd/elf32-sh-symbian.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh-symbian.c,v
retrieving revision 1.4
diff -u -p -r1.4 elf32-sh-symbian.c
--- bfd/elf32-sh-symbian.c 16 Sep 2004 14:52:05 -0000 1.4
+++ bfd/elf32-sh-symbian.c 19 Feb 2005 08:08:24 -0000
@@ -96,8 +96,8 @@
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;
}
@@ -109,7 +109,7 @@ static symbol_rename * rename_list = NUL
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;
@@ -173,7 +173,7 @@ sh_symbian_import_as (struct bfd_link_in
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);
@@ -184,7 +184,7 @@ sh_symbian_import (bfd * abfd ATTRIBUTE_
}
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);
@@ -202,14 +202,14 @@ static bfd_boolean
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)
{
@@ -229,9 +229,9 @@ sh_symbian_process_embedded_commands (st
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);
@@ -282,9 +282,9 @@ sh_symbian_process_embedded_commands (st
}
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);
@@ -331,9 +331,9 @@ sh_symbian_process_embedded_commands (st
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);
@@ -374,7 +374,8 @@ sh_symbian_process_embedded_commands (st
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"),
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.119
diff -u -p -r1.119 elf32-sh.c
--- bfd/elf32-sh.c 31 Jan 2005 23:13:21 -0000 1.119
+++ bfd/elf32-sh.c 19 Feb 2005 08:08:28 -0000
@@ -32,20 +32,6 @@ static bfd_reloc_status_type sh_elf_relo
(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
@@ -54,67 +40,12 @@ 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. */
@@ -3369,7 +3300,7 @@ static const bfd_byte *elf_sh_pic_plt_en
#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)
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.40
diff -u -p -r1.40 elf64-mmix.c
--- bfd/elf64-mmix.c 21 Oct 2004 15:28:25 -0000 1.40
+++ bfd/elf64-mmix.c 19 Feb 2005 08:08:29 -0000
@@ -993,7 +993,7 @@ mmix_elf_perform_relocation (isec, howto
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);
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.51
diff -u -p -r1.51 elf64-sh64.c
--- bfd/elf64-sh64.c 21 Oct 2004 15:28:26 -0000 1.51
+++ bfd/elf64-sh64.c 19 Feb 2005 08:08:30 -0000
@@ -107,70 +107,10 @@ struct elf_sh64_link_hash_table
#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. */
@@ -2271,7 +2211,7 @@ sh_elf64_get_relocated_section_contents
/* 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)
@@ -3199,7 +3139,7 @@ sh64_elf64_link_hash_table_create (bfd *
}
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)
@@ -3212,7 +3152,7 @@ movi_shori_putval (bfd *output_bfd, unsi
}
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)
Index: bfd/elfcode.h
===================================================================
RCS file: /cvs/src/src/bfd/elfcode.h,v
retrieving revision 1.63
diff -u -p -r1.63 elfcode.h
--- bfd/elfcode.h 6 Feb 2005 23:21:44 -0000 1.63
+++ bfd/elfcode.h 19 Feb 2005 08:08:31 -0000
@@ -1499,7 +1499,7 @@ NAME(_bfd_elf,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))
{
Elf_External_Ehdr x_ehdr; /* Elf file header, external form */
Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */
@@ -1508,13 +1508,13 @@ NAME(_bfd_elf,bfd_from_remote_memory)
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);
@@ -1574,7 +1574,7 @@ NAME(_bfd_elf,bfd_from_remote_memory)
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)
{
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.121
diff -u -p -r1.121 elfxx-mips.c
--- bfd/elfxx-mips.c 16 Feb 2005 04:45:23 -0000 1.121
+++ bfd/elfxx-mips.c 19 Feb 2005 08:08:37 -0000
@@ -818,7 +818,7 @@ mips_elf_create_procedure_table (void *h
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;
Index: bfd/libbfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/libbfd-in.h,v
retrieving revision 1.45
diff -u -p -r1.45 libbfd-in.h
--- bfd/libbfd-in.h 17 Jan 2005 17:12:00 -0000 1.45
+++ bfd/libbfd-in.h 19 Feb 2005 08:08:37 -0000
@@ -686,6 +686,6 @@ extern void bfd_section_already_linked_t
(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 *);
Index: bfd/libbfd.c
===================================================================
RCS file: /cvs/src/src/bfd/libbfd.c,v
retrieving revision 1.35
diff -u -p -r1.35 libbfd.c
--- bfd/libbfd.c 11 Feb 2005 15:59:51 -0000 1.35
+++ bfd/libbfd.c 19 Feb 2005 08:08:41 -0000
@@ -865,12 +865,12 @@ warn_deprecated (const char *what,
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;
@@ -878,7 +878,7 @@ read_unsigned_leb128 (bfd *abfd ATTRIBUT
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);
@@ -893,12 +893,12 @@ read_unsigned_leb128 (bfd *abfd ATTRIBUT
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;
@@ -906,14 +906,14 @@ read_signed_leb128 (bfd *abfd ATTRIBUTE_
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;
Index: bfd/mach-o.c
===================================================================
RCS file: /cvs/src/src/bfd/mach-o.c,v
retrieving revision 1.14
diff -u -p -r1.14 mach-o.c
--- bfd/mach-o.c 16 Feb 2005 04:45:23 -0000 1.14
+++ bfd/mach-o.c 19 Feb 2005 08:08:41 -0000
@@ -798,7 +798,7 @@ bfd_mach_o_scan_read_symtab_strtab (abfd
bfd_set_error (bfd_error_file_truncated);
return -1;
}
- sym->strtab = b->buffer + sym->stroff;
+ sym->strtab = (char *) b->buffer + sym->stroff;
return 0;
}
@@ -2120,7 +2120,7 @@ bfd_mach_o_core_file_failing_command (ab
if (ret < 0)
return NULL;
- return buf;
+ return (char *) buf;
}
int
Index: bfd/merge.c
===================================================================
RCS file: /cvs/src/src/bfd/merge.c,v
retrieving revision 1.21
diff -u -p -r1.21 merge.c
--- bfd/merge.c 24 Jun 2004 04:46:25 -0000 1.21
+++ bfd/merge.c 19 Feb 2005 08:08:41 -0000
@@ -446,7 +446,8 @@ record_section (struct sec_merge_info *s
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;
@@ -477,7 +478,7 @@ record_section (struct sec_merge_info *s
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;
@@ -491,7 +492,7 @@ record_section (struct sec_merge_info *s
{
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;
}
@@ -512,8 +513,8 @@ strrevcmp (const void *a, const void *b)
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)
@@ -537,8 +538,8 @@ strrevcmp_align (const void *a, const vo
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));
@@ -829,7 +830,7 @@ _bfd_merged_section_offset (bfd *output_
{
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)
Index: bfd/mmo.c
===================================================================
RCS file: /cvs/src/src/bfd/mmo.c,v
retrieving revision 1.24
diff -u -p -r1.24 mmo.c
--- bfd/mmo.c 24 Oct 2004 22:50:43 -0000 1.24
+++ bfd/mmo.c 19 Feb 2005 08:08:42 -0000
@@ -424,7 +424,7 @@ static bfd_boolean mmo_has_leading_or_tr
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
@@ -947,7 +947,7 @@ mmo_get_generic_spec_data_section (bfd *
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;
@@ -996,7 +996,7 @@ mmo_get_spec_section (bfd *abfd, int spe
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. */
@@ -2547,7 +2547,7 @@ EXAMPLE
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
Index: bfd/opncls.c
===================================================================
RCS file: /cvs/src/src/bfd/opncls.c,v
retrieving revision 1.27
diff -u -p -r1.27 opncls.c
--- bfd/opncls.c 31 Jan 2005 23:13:28 -0000 1.27
+++ bfd/opncls.c 19 Feb 2005 08:08:42 -0000
@@ -980,6 +980,7 @@ get_debug_link_info (bfd *abfd, unsigned
unsigned long crc32;
bfd_byte *contents;
int crc_offset;
+ char *name;
BFD_ASSERT (abfd);
BFD_ASSERT (crc32_out);
@@ -997,13 +998,14 @@ get_debug_link_info (bfd *abfd, unsigned
}
/* 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;
}
/*
@@ -1022,7 +1024,7 @@ DESCRIPTION
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;
@@ -1286,7 +1288,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *
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)
Index: bfd/pef.c
===================================================================
RCS file: /cvs/src/src/bfd/pef.c,v
retrieving revision 1.12
diff -u -p -r1.12 pef.c
--- bfd/pef.c 16 Feb 2005 02:38:53 -0000 1.12
+++ bfd/pef.c 19 Feb 2005 08:08:43 -0000
@@ -106,7 +106,7 @@ bfd_pef_print_symbol (abfd, afile, symbo
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;
@@ -884,7 +884,8 @@ static int bfd_pef_parse_function_stubs
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++)
{
@@ -978,7 +979,7 @@ static long bfd_pef_parse_symbols (abfd,
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;
Index: bfd/peicode.h
===================================================================
RCS file: /cvs/src/src/bfd/peicode.h,v
retrieving revision 1.43
diff -u -p -r1.43 peicode.h
--- bfd/peicode.h 14 Feb 2005 11:20:37 -0000 1.43
+++ bfd/peicode.h 19 Feb 2005 08:08:44 -0000
@@ -130,15 +130,6 @@ typedef struct
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 */
/**********************************************************************/
@@ -740,8 +731,8 @@ static jump_table jtab[] =
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)
{
@@ -837,10 +828,10 @@ pe_ILF_build_a_bfd (bfd * abfd
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. */
@@ -930,7 +921,7 @@ pe_ILF_build_a_bfd (bfd * abfd
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)
@@ -1042,7 +1033,7 @@ pe_ILF_build_a_bfd (bfd * abfd
/* 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);
@@ -1087,8 +1078,8 @@ pe_ILF_object_p (bfd * abfd)
{
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;
@@ -1225,11 +1216,12 @@ pe_ILF_object_p (bfd * abfd)
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);
Index: bfd/srec.c
===================================================================
RCS file: /cvs/src/src/bfd/srec.c,v
retrieving revision 1.32
diff -u -p -r1.32 srec.c
--- bfd/srec.c 8 Oct 2004 14:54:01 -0000 1.32
+++ bfd/srec.c 19 Feb 2005 08:08:44 -0000
@@ -1014,7 +1014,8 @@ srec_write_header (abfd)
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
Index: bfd/vms-hdr.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-hdr.c,v
retrieving revision 1.13
diff -u -p -r1.13 vms-hdr.c
--- bfd/vms-hdr.c 30 Nov 2003 18:40:41 -0000 1.13
+++ bfd/vms-hdr.c 19 Feb 2005 08:08:45 -0000
@@ -225,7 +225,8 @@ get_vms_time_string ()
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
Index: bfd/vms-tir.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-tir.c,v
retrieving revision 1.12
diff -u -p -r1.12 vms-tir.c
--- bfd/vms-tir.c 31 Jan 2005 23:13:30 -0000 1.12
+++ bfd/vms-tir.c 19 Feb 2005 08:08:46 -0000
@@ -1598,7 +1598,7 @@ tir_ctl (bfd *abfd, unsigned char *ptr)
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);
@@ -1622,7 +1622,7 @@ tir_ctl (bfd *abfd, unsigned char *ptr)
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;
@@ -1630,7 +1630,7 @@ tir_ctl (bfd *abfd, unsigned char *ptr)
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;
Index: bfd/xsym.c
===================================================================
RCS file: /cvs/src/src/bfd/xsym.c,v
retrieving revision 1.11
diff -u -p -r1.11 xsym.c
--- bfd/xsym.c 11 Feb 2005 17:22:47 -0000 1.11
+++ bfd/xsym.c 19 Feb 2005 08:08:47 -0000
@@ -55,21 +55,20 @@
#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;
@@ -79,7 +78,7 @@ pstrcmp (a, b)
else if (a[0] < b[0])
return -1;
else
- return 0;
+ return 1;
}
static unsigned long
@@ -255,7 +254,7 @@ bfd_sym_read_version (abfd, version)
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);
@@ -1207,12 +1206,12 @@ bfd_sym_symbol_name (abfd, index)
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;
}
@@ -1225,7 +1224,7 @@ bfd_sym_module_name (abfd, 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);
}
@@ -1727,26 +1726,28 @@ bfd_sym_print_type_information (abfd, f,
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++)
{
Index: bfd/xtensa-isa.c
===================================================================
RCS file: /cvs/src/src/bfd/xtensa-isa.c,v
retrieving revision 1.4
diff -u -p -r1.4 xtensa-isa.c
--- bfd/xtensa-isa.c 12 Nov 2004 21:59:11 -0000 1.4
+++ bfd/xtensa-isa.c 19 Feb 2005 08:08:48 -0000
@@ -120,7 +120,9 @@ byte_to_bit_index (int byte_index)
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;
@@ -178,7 +180,9 @@ xtensa_insnbuf_to_chars (xtensa_isa 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;
@@ -392,7 +396,7 @@ xtensa_isa_maxlength (xtensa_isa 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);
Index: bfd/xtensa-modules.c
===================================================================
RCS file: /cvs/src/src/bfd/xtensa-modules.c,v
retrieving revision 1.4
diff -u -p -r1.4 xtensa-modules.c
--- bfd/xtensa-modules.c 8 Oct 2004 00:22:10 -0000 1.4
+++ bfd/xtensa-modules.c 19 Feb 2005 08:08:49 -0000
@@ -9074,7 +9074,7 @@ static int length_table[16] = {
};
static int
-length_decoder (const char *insn)
+length_decoder (const unsigned char *insn)
{
int op0 = (insn[0] >> 4) & 0xf;
return length_table[op0];
--
Alan Modra
IBM OzLabs - Linux Technology Centre