#include "aout/aout64.h"
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native, now */
-/* defined in stabsread.c; used for completing cfront stabs strings */
-extern void
-resolve_cfront_continuation PARAMS((struct objfile * objfile,
- struct symbol * sym, char * p));
-
\f
/* We put a pointer to this structure in the read_symtab_private field
of the psymtab. */
/* Local function prototypes */
+static void
+process_now PARAMS ((struct objfile *));
+
static void
free_header_files PARAMS ((void));
lowest_text_address = address;
prim_record_minimal_symbol_and_info
- (obsavestring (name, strlen (name), &objfile -> symbol_obstack),
- address,
- ms_type,
- NULL,
- section,
- objfile);
+ (name, address, ms_type, NULL, section, objfile);
}
\f
/* Scan and build partial symbols for a symbol file.
cont_count++;
}
-void
+static void
process_now(objfile)
struct objfile * objfile;
{
}
name = (char *) bfd_asymbol_name (*rel->sym_ptr_ptr);
- prim_record_minimal_symbol
- (obsavestring (name, strlen (name), &objfile -> symbol_obstack),
- address,
- mst_solib_trampoline,
- objfile);
+ prim_record_minimal_symbol (name, address, mst_solib_trampoline,
+ objfile);
}
do_cleanups (back_to);
CORE_ADDR last_function_start = 0;
struct cleanup *back_to;
bfd *abfd;
+ int textlow_not_set;
/* Current partial symtab */
struct partial_symtab *pst;
abfd = objfile->obfd;
symbuf_end = symbuf_idx = 0;
next_symbol_text_func = dbx_next_symbol_text;
+ textlow_not_set = 1;
for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
{
#define DBXREAD_ONLY
#define START_PSYMTAB(ofile,secoff,fname,low,symoff,global_syms,static_syms)\
start_psymtab(ofile, secoff, fname, low, symoff, global_syms, static_syms)
-#define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps)\
- end_psymtab(pst,ilist,ninc,c_off,c_text,dep_list,n_deps)
+#define END_PSYMTAB(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)\
+ end_psymtab(pst,ilist,ninc,c_off,c_text,dep_list,n_deps,textlow_not_set)
#include "partial-stab.h"
}
? (text_addr + section_offsets->offsets[SECT_OFF_TEXT])
: lowest_text_address)
+ text_size,
- dependency_list, dependencies_used);
+ dependency_list, dependencies_used, textlow_not_set);
}
do_cleanups (back_to);
struct partial_symtab *
end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
- capping_text, dependency_list, number_dependencies)
+ capping_text, dependency_list, number_dependencies, textlow_not_set)
struct partial_symtab *pst;
char **include_list;
int num_includes;
CORE_ADDR capping_text;
struct partial_symtab **dependency_list;
int number_dependencies;
+ int textlow_not_set;
{
int i;
struct objfile *objfile = pst -> objfile;
if (capping_symbol_offset != -1)
- LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst);
+ LDSYMLEN(pst) = capping_symbol_offset - LDSYMOFF(pst);
pst->texthigh = capping_text;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
we have to do some tricks to fill in texthigh and textlow.
The first trick is in partial-stab.h: if we see a static
or global function, and the textlow for the current pst
- is still 0, then we use that function's address for
- the textlow of the pst. */
+ is not set (ie: textlow_not_set), then we use that function's
+ address for the textlow of the pst. */
/* Now, to fill in texthigh, we remember the last function seen
in the .o file (also in partial-stab.h). Also, there's a hack in
a reliable texthigh by taking the address plus size of the
last function in the file. */
- if (pst->texthigh == 0 && last_function_name) {
- char *p;
- int n;
- struct minimal_symbol *minsym;
-
- p = strchr (last_function_name, ':');
- if (p == NULL)
- p = last_function_name;
- n = p - last_function_name;
- p = alloca (n + 1);
- strncpy (p, last_function_name, n);
- p[n] = 0;
+ if (pst->texthigh == 0 && last_function_name)
+ {
+ char *p;
+ int n;
+ struct minimal_symbol *minsym;
+
+ p = strchr (last_function_name, ':');
+ if (p == NULL)
+ p = last_function_name;
+ n = p - last_function_name;
+ p = alloca (n + 1);
+ strncpy (p, last_function_name, n);
+ p[n] = 0;
- minsym = lookup_minimal_symbol (p, pst->filename, objfile);
+ minsym = lookup_minimal_symbol (p, pst->filename, objfile);
- if (minsym)
- pst->texthigh = SYMBOL_VALUE_ADDRESS (minsym) +
- (long) MSYMBOL_INFO (minsym);
+ if (minsym)
+ pst->texthigh = SYMBOL_VALUE_ADDRESS (minsym)
+ + (long) MSYMBOL_INFO (minsym);
- last_function_name = NULL;
- }
+ last_function_name = NULL;
+ }
/* this test will be true if the last .o file is only data */
- if (pst->textlow == 0)
- /* This loses if the text section really starts at address zero
- (generally true when we are debugging a .o file, for example).
- That is why this whole thing is inside SOFUN_ADDRESS_MAYBE_MISSING. */
+ if (textlow_not_set)
pst->textlow = pst->texthigh;
+ else
+ {
+ struct partial_symtab *p1;
- /* If we know our own starting text address, then walk through all other
- psymtabs for this objfile, and if any didn't know their ending text
- address, set it to our starting address. Take care to not set our
- own ending address to our starting address, nor to set addresses on
- `dependency' files that have both textlow and texthigh zero. */
- if (pst->textlow) {
- struct partial_symtab *p1;
-
- ALL_OBJFILE_PSYMTABS (objfile, p1) {
- if (p1->texthigh == 0 && p1->textlow != 0 && p1 != pst) {
- p1->texthigh = pst->textlow;
- /* if this file has only data, then make textlow match texthigh */
- if (p1->textlow == 0)
- p1->textlow = p1->texthigh;
- }
+ /* If we know our own starting text address, then walk through all other
+ psymtabs for this objfile, and if any didn't know their ending text
+ address, set it to our starting address. Take care to not set our
+ own ending address to our starting address, nor to set addresses on
+ `dependency' files that have both textlow and texthigh zero. */
+
+ ALL_OBJFILE_PSYMTABS (objfile, p1)
+ {
+ if (p1->texthigh == 0 && p1->textlow != 0 && p1 != pst)
+ {
+ p1->texthigh = pst->textlow;
+ /* if this file has only data, then make textlow match texthigh */
+ if (p1->textlow == 0)
+ p1->textlow = p1->texthigh;
+ }
+ }
}
- }
/* End of kludge for patching Solaris textlow and texthigh. */
#endif /* SOFUN_ADDRESS_MAYBE_MISSING. */