diff options
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 75a90f7..6f6e6cb 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -340,7 +340,7 @@ cs_to_section (cs, objfile) { asection *sect = NULL; struct find_targ_sec_arg args; - int off = SECT_OFF_TEXT; + int off = SECT_OFF_TEXT (objfile); args.targ_index = cs->c_secnum; args.resultp = § @@ -349,11 +349,11 @@ cs_to_section (cs, objfile) { /* This is the section. Figure out what SECT_OFF_* code it is. */ if (bfd_get_section_flags (abfd, sect) & SEC_CODE) - off = SECT_OFF_TEXT; + off = SECT_OFF_TEXT (objfile); else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD) - off = SECT_OFF_DATA; + off = SECT_OFF_DATA (objfile); else - off = SECT_OFF_BSS; + off = SECT_OFF_BSS (objfile); } return off; } @@ -843,7 +843,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (ISFCN (cs->c_type) && cs->c_sclass != C_TPDEF) { /* Record all functions -- external and static -- in minsyms. */ - tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); record_minimal_symbol (cs->c_name, tmpaddr, mst_text, objfile); fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr; @@ -908,7 +908,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) followed by a later file with no symbols. */ if (in_source_file) complete_symtab (filestring, - cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT), + cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)), main_aux.x_scn.x_scnlen); in_source_file = 0; } @@ -969,10 +969,8 @@ coff_symtab_read (symtab_offset, nsyms, objfile) || cs->c_sclass == C_THUMBEXT) tmpaddr += ANOFFSET (objfile->section_offsets, sec); - switch (sec) + if (sec == SECT_OFF_TEXT (objfile) || sec == SECT_OFF_RODATA (objfile)) { - case SECT_OFF_TEXT: - case SECT_OFF_RODATA: ms_type = cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC || cs->c_sclass == C_THUMBEXT ? @@ -981,21 +979,23 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (tmpaddr & 1) /* FIXME: delete this line */ SMASH_TEXT_ADDRESS (tmpaddr); #endif - break; - case SECT_OFF_DATA: + } + else + if (sec == SECT_OFF_DATA (objfile)) + { ms_type = cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ? mst_data : mst_file_data; - break; - case SECT_OFF_BSS: + } + else + if (sec == SECT_OFF_BSS (objfile)) + { ms_type = cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ? mst_data : mst_file_data; - break; - default: - ms_type = mst_unknown; - break; - } + } + else + ms_type = mst_unknown; } if (cs->c_name[0] != '@' /* Skip tdesc symbols */ ) @@ -1099,11 +1099,11 @@ coff_symtab_read (symtab_offset, nsyms, objfile) of the epilogue. */ cs->c_value + FUNCTION_EPILOGUE_SIZE - + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT), + + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)), #else fcn_cs_saved.c_value + fcn_aux_saved.x_sym.x_misc.x_fsize - + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT), + + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)), #endif objfile ); @@ -1115,7 +1115,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (STREQ (cs->c_name, ".bb")) { tmpaddr = cs->c_value; - tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); push_context (++depth, tmpaddr); } else if (STREQ (cs->c_name, ".eb")) @@ -1135,7 +1135,7 @@ coff_symtab_read (symtab_offset, nsyms, objfile) if (local_symbols && context_stack_depth > 0) { tmpaddr = - cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); /* Make a block for the local symbols within. */ finish_block (0, &local_symbols, new->old_blocks, new->start_addr, tmpaddr, objfile); @@ -1427,7 +1427,7 @@ enter_linenos (file_offset, first_line, last_line, objfile) if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line) record_line (current_subfile, first_line + L_LNNO32 (&lptr), lptr.l_addr.l_paddr - + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT)); + + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))); else break; } @@ -1547,7 +1547,7 @@ process_coff_symbol (cs, aux, objfile) if (ISFCN (cs->c_type)) { - SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); SYMBOL_TYPE (sym) = lookup_function_type (decode_function_type (cs, cs->c_type, aux)); @@ -1577,7 +1577,7 @@ process_coff_symbol (cs, aux, objfile) case C_EXT: SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; - SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); add_symbol_to_list (sym, &global_symbols); break; @@ -1586,7 +1586,7 @@ process_coff_symbol (cs, aux, objfile) case C_STAT: SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value; - SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT); + SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (within_function) { /* Static symbol of local scope */ |