diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-10-20 05:15:46 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-10-20 05:15:46 +0000 |
commit | 3a47045432484224045297da5e3254941c93b071 (patch) | |
tree | b610063b08829f46eb73649728d94856ee17c9b8 /gdb/coffread.c | |
parent | 459877ea9d6bf27d5f7337e2155fb33c0bd996b0 (diff) | |
download | gdb-3a47045432484224045297da5e3254941c93b071.zip gdb-3a47045432484224045297da5e3254941c93b071.tar.gz gdb-3a47045432484224045297da5e3254941c93b071.tar.bz2 |
* objfiles.c (objfile_relocate): When relocating ->sections, use
objfile not symfile_objfile.
* symtab.h, minsyms.c (minsyms_sort): New function.
* objfiles.c (objfile_relocate): Call it.
* remote-vx.c (vx_add_symbols): Call breakpoint_re_set.
* objfiles.c, objfiles.h (objfile_to_front): New function.
* remote-vx.c (vx_add_symbols): Call it.
* coffread.c (coff_symtab_read): Handle common symbols the same
way that partial-stab.h does.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 82b7299..ddd0511 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -38,6 +38,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "gdb-stabs.h" #include "stabsread.h" #include "complaints.h" +#include "target.h" struct coff_symfile_info { file_ptr min_lineno_offset; /* Where in file lowest line#s are */ @@ -908,10 +909,29 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile) /* FIXME: should use mst_abs, and not relocate, if absolute. */ enum minimal_symbol_type ms_type; - int sec = cs_to_section (cs, objfile); - tmpaddr = cs->c_value; - if (cs->c_sclass != C_STAT) - tmpaddr += ANOFFSET (section_offsets, sec); + int sec; + + if (cs->c_secnum == N_UNDEF) + { + /* This is a common symbol. See if the target + environment knows where it has been relocated to. */ + CORE_ADDR reladdr; + if (target_lookup_symbol (cs->c_name, &reladdr)) + { + /* Error in lookup; ignore symbol. */ + break; + } + tmpaddr = reladdr; + sec = SECT_OFF_BSS; + } + else + { + sec = cs_to_section (cs, objfile); + tmpaddr = cs->c_value; + if (cs->c_sclass != C_STAT) + tmpaddr += ANOFFSET (section_offsets, sec); + } + switch (sec) { case SECT_OFF_TEXT: |