summaryrefslogtreecommitdiff
path: root/bfd/xsym.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-02-20 14:59:07 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-02-20 14:59:07 +0000
commit81dad398aa2d8fd69f005bb3ff841200313e0b89 (patch)
tree3dda217db2e43a90b0e2f4e81e4af49b2eeaec47 /bfd/xsym.c
parenta838e74a2ea7048ae18e36716b517747be1a0e95 (diff)
downloadgdb-81dad398aa2d8fd69f005bb3ff841200313e0b89.tar.gz
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.
Diffstat (limited to 'bfd/xsym.c')
-rw-r--r--bfd/xsym.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/bfd/xsym.c b/bfd/xsym.c
index 247e5c352c0..6b80dcf4094 100644
--- a/bfd/xsym.c
+++ b/bfd/xsym.c
@@ -1,5 +1,5 @@
/* 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.
@@ -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, buf, len, offset, offsetptr)
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++)
{