Index: gdb/coffread.c |
diff --git a/gdb/coffread.c b/gdb/coffread.c |
index c727228b8ff273b3bb3116a75844752096bb07bc..b0a8b8202995186f5a99c737612fe7d56b70c96d 100644 |
--- a/gdb/coffread.c |
+++ b/gdb/coffread.c |
@@ -311,7 +311,7 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd) |
args.resultp = § |
bfd_map_over_sections (abfd, find_targ_sec, &args); |
if (sect != NULL) |
- addr = bfd_get_section_vma (objfile->obfd, sect); |
+ addr = bfd_get_section_vma (abfd, sect); |
return addr; |
} |
@@ -1306,7 +1306,6 @@ static const char * |
coff_getfilename (union internal_auxent *aux_entry) |
{ |
static char buffer[BUFSIZ]; |
- char *temp; |
const char *result; |
if (aux_entry->x_file.x_n.x_zeroes == 0) |
@@ -1455,10 +1454,11 @@ patch_type (struct type *type, struct type *real_type) |
if (TYPE_NAME (real_target)) |
{ |
+ /* The previous copy of TYPE_NAME is allocated by |
+ process_coff_symbol. */ |
if (TYPE_NAME (target)) |
- xfree (TYPE_NAME (target)); |
- TYPE_NAME (target) = concat (TYPE_NAME (real_target), |
- (char *) NULL); |
+ xfree ((char*) TYPE_NAME (target)); |
+ TYPE_NAME (target) = xstrdup (TYPE_NAME (real_target)); |
} |
} |
@@ -1470,7 +1470,7 @@ static void |
patch_opaque_types (struct symtab *s) |
{ |
struct block *b; |
- struct dict_iterator iter; |
+ struct block_iterator iter; |
struct symbol *real_sym; |
/* Go through the per-file symbols only. */ |
@@ -1486,7 +1486,7 @@ patch_opaque_types (struct symtab *s) |
&& TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR |
&& TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0) |
{ |
- char *name = SYMBOL_LINKAGE_NAME (real_sym); |
+ const char *name = SYMBOL_LINKAGE_NAME (real_sym); |
int hash = hashname (name); |
struct symbol *sym, *prev; |
@@ -1675,7 +1675,7 @@ process_coff_symbol (struct coff_symbol *cs, |
} |
else |
TYPE_NAME (SYMBOL_TYPE (sym)) = |
- concat (SYMBOL_LINKAGE_NAME (sym), (char *) NULL); |
+ xstrdup (SYMBOL_LINKAGE_NAME (sym)); |
} |
/* Keep track of any type which points to empty structured |
@@ -2158,7 +2158,7 @@ coff_read_enum_type (int index, int length, int lastsym, |
SYMBOL_TYPE (xsym) = type; |
TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); |
- SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); |
+ SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); |
if (SYMBOL_VALUE (xsym) < 0) |
unsigned_enum = 0; |
TYPE_FIELD_BITSIZE (type, n) = 0; |
@@ -2195,6 +2195,7 @@ static const struct sym_fns coff_sym_fns = |
default_symfile_relocate, /* sym_relocate: Relocate a debug |
section. */ |
+ NULL, /* sym_probe_fns */ |
&psym_functions |
}; |