24 #include <sys/types.h>
27 #ifdef HAVE_SYS_FILE_H
32 #include "coff/internal.h"
34 #include "coff/xcoff.h"
36 #include "coff/rs6000.h"
53 #include "aout/stab_gnu.h"
120 #define INITIAL_STABVECTOR_LENGTH 40
151 #define XCOFF_DATA(objfile) \
152 ((struct coff_symfile_info *) objfile_data ((objfile), \
153 xcoff_objfile_data_key))
159 {
".dwabrev", NULL },
165 {
".dwrnges", NULL },
168 {
".dwframe", NULL },
178 _(
"line numbers off, `.bf' symbol not found"));
185 _(
"Mismatched .ef symbol ignored starting at symnum %d"), arg1);
192 _(
"Mismatched .eb symbol ignored starting at symnum %d"), arg1);
217 static void read_symbol (
struct internal_syment *,
int);
229 static void add_stab_to_list (
char *,
struct pending_stabs **);
232 static int compare_lte (
const void *,
const void *);
265 if (bfd_get_section_flags (abfd, sect) & SEC_CODE)
267 else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
285 asection **bfd_sect,
int *secnum)
329 add_stab_to_list (
char *stabname,
struct pending_stabs **stabvector)
331 if (*stabvector == NULL)
336 (*stabvector)->count = 0;
339 else if ((*stabvector)->count >= (*stabvector)->length)
344 (*stabvector)->
length *
sizeof (
char *));
346 (*stabvector)->stab[(*stabvector)->count++] = stabname;
414 return lte1->
pc - lte2->
pc;
435 #define NUM_OF_FUNCTIONS 20
441 for (function_count = 0, ii = 0; ii < oldLineTb->
nitems; ++ii)
445 if (function_count >= fentry_size)
452 fentry[function_count].
line = ii;
453 fentry[function_count].
pc = oldLineTb->
item[ii].
pc;
458 if (ii + 1 < oldLineTb->
nitems
459 && oldLineTb->
item[ii].
pc != oldLineTb->
item[ii + 1].
pc)
464 if (function_count == 0)
469 else if (function_count > 1)
470 qsort (fentry, function_count,
485 newline < oldLineTb->
nitems && oldLineTb->
item[newline].
line; ++newline)
486 newLineTb->
item[newline] = oldLineTb->
item[newline];
490 for (ii = 0; ii < function_count; ++ii)
494 jj = fentry[ii].
line;
495 if (jj + 1 < oldLineTb->
nitems
496 && oldLineTb->
item[jj].
pc != oldLineTb->
item[jj + 1].
pc)
498 newLineTb->
item[newline] = oldLineTb->
item[jj];
503 for (jj = fentry[ii].
line + 1;
506 newLineTb->
item[newline] = oldLineTb->
item[jj];
511 newLineTb->
nitems = oldLineTb->
nitems - function_count + extra_lines;
534 #define INITIAL_INCLUDE_TABLE_LENGTH 20
585 if (inclTable == NULL)
594 else if (inclIndx >= inclLength)
619 =
XCOFF_DATA (this_symtab_objfile)->max_lineno_offset;
629 unsigned int main_source_baseline = 0;
636 goto return_after_cleanup;
638 memset (&main_subfile,
'\0',
sizeof (main_subfile));
645 &main_source_baseline);
652 coff_data (this_symtab_objfile->
obfd)->local_linesz;
653 main_source_baseline = 0;
660 if (offset < inclTable[ii].begin)
663 (&main_subfile, offset, inclTable[ii].begin - linesz,
664 start, 0, &main_source_baseline);
674 (&main_subfile, inclTable[ii].begin, inclTable[ii].end,
675 start, 0, &main_source_baseline);
676 inclTable[ii].
subfile = &main_subfile;
682 tmpSubfile = inclTable[ii].
subfile =
685 memset (tmpSubfile,
'\0',
sizeof (
struct subfile));
690 inclTable[ii].end, start, 0, firstLine);
693 if (offset <= inclTable[ii].end)
694 offset = inclTable[ii].
end + linesz;
699 if (offset < max_offset + 1 - linesz)
702 &main_source_baseline);
738 && (inclTable[ii].
subfile)->line_vector)
743 lv = (inclTable[ii].
subfile)->line_vector;
773 char *fakename = strrchr (inclTable[ii].name,
'.');
775 if (fakename == NULL)
803 return_after_cleanup:
813 if (this_symtab_psymtab == NULL)
839 unsigned int curoffset;
842 struct internal_lineno int_lnno;
843 unsigned int limit_offset;
847 if (endoffset == 0 && startaddr == 0 && endaddr == 0)
849 curoffset = beginoffset;
850 limit_offset =
XCOFF_DATA (objfile)->max_lineno_offset;
854 if (endoffset >= limit_offset)
857 _(
"Bad line table offset in C_EINCL directive"));
860 limit_offset = endoffset;
865 abfd = objfile->
obfd;
866 linesz = coff_data (abfd)->local_linesz;
867 ext_lnno = alloca (linesz);
869 while (curoffset <= limit_offset)
871 bfd_seek (abfd, curoffset,
SEEK_SET);
872 bfd_bread (ext_lnno, linesz, abfd);
873 bfd_coff_swap_lineno_in (abfd, ext_lnno, &int_lnno);
876 addr = (int_lnno.l_lnno
877 ? int_lnno.l_addr.l_paddr
881 if (addr < startaddr || (endaddr && addr >= endaddr))
884 if (int_lnno.l_lnno == 0)
891 record_line (subfile, *firstLine + int_lnno.l_lnno,
902 #define complete_symtab(name, start_addr) { \
903 set_last_source_file (name); \
904 last_source_start_addr = start_addr; \
950 static int static_block_base = 0;
954 static int static_block_section = -1;
958 static int symname_alloced = 0;
970 struct internal_syment symbol;
974 if (this_symtab_objfile)
977 bfd_coff_swap_sym_in (objfile->
obfd, raw_symbol, &symbol);
986 else if (symbol.n_sclass & 0x80)
988 retval =
XCOFF_DATA (objfile)->debugsec + symbol.n_offset;
989 raw_symbol += coff_data (objfile->
obfd)->local_symesz;
1008 bfd *abfd = objfile->
obfd;
1013 const char *debugfmt = bfd_xcoff_is_xcoff64 (abfd) ?
"XCOFF64" :
"XCOFF";
1015 struct internal_syment symbol[1];
1016 union internal_auxent main_aux;
1021 int next_file_symnum = -1;
1022 unsigned int max_symnum;
1023 int just_started = 1;
1030 union internal_auxent fcn_aux_saved = main_aux;
1033 char *filestring =
" _start_ ";
1035 const char *last_csect_name;
1037 this_symtab_psymtab = pst;
1038 this_symtab_objfile = objfile;
1042 local_symesz = coff_data (abfd)->local_symesz;
1045 last_csect_name = 0;
1048 start_symtab (objfile, filestring, (
char *) NULL, file_start_addr);
1053 first_object_file_end = 0;
1057 while (
symnum < max_symnum)
1071 bfd_coff_swap_sym_in (abfd, raw_symbol, symbol);
1074 cs->
c_naux = symbol->n_numaux;
1075 if (symbol->n_zeroes)
1077 symname_alloced = 0;
1081 cs->
c_name = ((
struct external_syment *) raw_symbol)->e.e_name;
1084 if (cs->
c_name[E_SYMNMLEN - 1] !=
'\0')
1089 strncpy (p, cs->
c_name, E_SYMNMLEN);
1090 p[E_SYMNMLEN] =
'\0';
1092 symname_alloced = 1;
1095 else if (symbol->n_sclass & 0x80)
1097 cs->
c_name = debugsec + symbol->n_offset;
1098 symname_alloced = 0;
1103 cs->
c_name = strtbl + (
int) symbol->n_offset;
1104 symname_alloced = 1;
1106 cs->
c_value = symbol->n_value;
1109 cs->
c_type = (unsigned) symbol->n_type;
1111 raw_symbol += local_symesz;
1115 raw_auxptr = raw_symbol;
1118 for (ii = symbol->n_numaux; ii; --ii)
1120 raw_symbol += coff_data (abfd)->local_auxesz;
1151 #define CSECT(PP) ((PP)->x_csect)
1152 #define CSECT_LEN(PP) (CSECT(PP).x_scnlen.l)
1153 #define CSECT_ALIGN(PP) (SMTYP_ALIGN(CSECT(PP).x_smtyp))
1154 #define CSECT_SMTYP(PP) (SMTYP_SMTYP(CSECT(PP).x_smtyp))
1155 #define CSECT_SCLAS(PP) (CSECT(PP).x_smclas)
1158 bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->
c_type, cs->
c_sclass,
1159 0, cs->
c_naux, &main_aux);
1188 if (last_csect_name)
1191 cur_src_end_addr = file_end_addr;
1206 first_object_file_end
1214 file_end_addr = file_start_addr +
CSECT_LEN (&main_aux);
1217 last_csect_name = cs->
c_name;
1246 function_entry_point:
1253 fcn_aux_saved = main_aux;
1291 bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->
c_type, cs->
c_sclass,
1292 0, cs->
c_naux, &main_aux);
1293 goto function_entry_point;
1303 next_file_symnum = cs->
c_value;
1313 cur_src_end_addr = file_end_addr;
1325 bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->
c_type, cs->
c_sclass,
1326 0, cs->
c_naux, &main_aux);
1335 last_csect_name = 0;
1340 file_start_addr = file_end_addr = 0;
1344 fcn_stab_saved = *cs;
1348 if (strcmp (cs->
c_name,
".bf") == 0)
1353 bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->
c_type, cs->
c_sclass,
1354 0, cs->
c_naux, &main_aux);
1362 fcn_stab_saved.
c_name, 0, 0, objfile);
1363 if (newobj->
name != NULL)
1366 else if (strcmp (cs->
c_name,
".ef") == 0)
1368 bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->
c_type, cs->
c_sclass,
1369 0, cs->
c_naux, &main_aux);
1394 + fcn_aux_saved.x_sym.x_misc.x_fsize
1404 struct internal_syment symbol;
1407 static_block_base = symbol.n_value;
1408 static_block_section =
1415 static_block_base = 0;
1416 static_block_section = -1;
1428 _(
"Unrecognized storage class %d."),
1459 if (strcmp (cs->
c_name,
".bb") == 0)
1467 else if (strcmp (cs->
c_name,
".eb") == 0)
1475 if (depth-- != newobj->
depth)
1504 cur_src_end_addr = file_end_addr;
1516 #define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
1517 (SYMBOL2) = (struct symbol *) \
1518 obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol)); \
1519 *(SYMBOL2) = *(SYMBOL1);
1522 #define SYMNAME_ALLOC(NAME, ALLOCED) \
1523 ((ALLOCED) ? (NAME) : obstack_copy0 (&objfile->objfile_obstack, \
1524 (NAME), strlen (NAME)))
1533 struct symbol *sym = &onesymbol;
1534 struct symbol *sym2 = NULL;
1595 add_stab_to_list (name, &file_stabs);
1645 pp = strchr (name,
':');
1654 static_block_section)),
1655 cs->
c_name, 0, 0, objfile);
1674 static char buffer[BUFSIZ];
1676 if (aux_entry->x_file.x_n.x_zeroes == 0)
1677 strcpy (buffer, (
XCOFF_DATA (objfile)->strtbl
1678 + aux_entry->x_file.x_n.x_offset));
1681 strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN);
1682 buffer[FILNMLEN] =
'\0';
1693 char *stbl = xcoff->
symtbl;
1695 if (symno < 0 || symno >= nsyms)
1698 symbol->n_value = 0;
1699 symbol->n_scnum = -1;
1702 bfd_coff_swap_sym_in (this_symtab_objfile->
obfd,
1703 stbl + (symno * local_symesz),
1712 struct internal_syment symbol[1];
1715 return symbol->n_value;
1726 int xcoff64 = bfd_xcoff_is_xcoff64 (objfile->
obfd);
1730 char *stbl = info->
symtbl;
1733 struct internal_syment symbol[1];
1734 union internal_auxent main_aux[1];
1758 while (symno < nsyms)
1760 bfd_coff_swap_sym_in (symfile_bfd,
1761 stbl + (symno * local_symesz), symbol);
1762 if (symbol->n_sclass == C_FCN)
1764 char *
name = xcoff64 ? strtbl + symbol->n_offset : symbol->n_name;
1766 if (strcmp (name,
".bf") == 0)
1769 symno += symbol->n_numaux + 1;
1778 bfd_coff_swap_aux_in (objfile->
obfd, stbl + symno * local_symesz,
1779 symbol->n_type, symbol->n_sclass,
1780 0, symbol->n_numaux, main_aux);
1782 return main_aux->x_sym.x_misc.x_lnsz.x_lnno;
1798 count = asect->lineno_count;
1800 if (strcmp (asect->name,
".text") != 0 || count == 0)
1803 size = count * coff_data (abfd)->local_linesz;
1805 offset = asect->line_filepos;
1806 maxoff = offset +
size;
1827 (
gdb_stderr,
"Psymtab for %s already read in. Shouldn't happen.\n",
1874 (
gdb_stderr,
"Psymtab for %s already read in. Shouldn't happen.\n",
1879 if (((
struct symloc *) self->read_symtab_private)->numsyms != 0
1880 || self->number_of_dependencies)
1924 set_objfile_data (objfile, xcoff_objfile_data_key, xcoff);
1946 inclIndx = inclLength = inclDepth = 0;
1957 unsigned char lengthbuf[4];
1963 if (bfd_seek (abfd, offset,
SEEK_SET) < 0)
1964 error (
_(
"cannot seek to string table in %s: %s"),
1965 bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
1967 val = bfd_bread ((
char *) lengthbuf,
sizeof lengthbuf, abfd);
1968 length = bfd_h_get_32 (abfd, lengthbuf);
1973 if (val !=
sizeof lengthbuf || length <
sizeof lengthbuf)
1984 memcpy (strtbl, lengthbuf,
sizeof lengthbuf);
1985 if (length ==
sizeof lengthbuf)
1988 val = bfd_bread (strtbl +
sizeof lengthbuf, length -
sizeof lengthbuf, abfd);
1990 if (val != length -
sizeof lengthbuf)
1991 error (
_(
"cannot read string table from %s: %s"),
1992 bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
1993 if (strtbl[length - 1] !=
'\0')
1994 error (
_(
"bad symbol file: string table "
1995 "does not end with null character"));
2014 const char *
filename,
int first_symnum,
2023 global_syms, static_syms);
2046 const char **include_list,
int num_includes,
2047 int capping_symbol_number,
2049 int number_dependencies,
int textlow_not_set)
2053 if (capping_symbol_number != -1)
2055 capping_symbol_number
2059 first_fun_line_offset = 0;
2066 if (number_dependencies)
2077 for (i = 0; i < num_includes; i++)
2109 if (num_includes == 0
2110 && number_dependencies == 0
2133 const char **
name,
char **raw,
unsigned int *symnump,
2136 bfd_coff_swap_sym_in (objfile->
obfd, *raw, symbol);
2137 if (symbol->n_zeroes)
2141 if (symbol->n_name[E_SYMNMLEN - 1] !=
'\0')
2148 strncpy (p, symbol->n_name, E_SYMNMLEN);
2149 p[E_SYMNMLEN] =
'\0';
2155 *name = ((
struct external_syment *) *raw)->e.e_name;
2157 else if (symbol->n_sclass & 0x80)
2159 *name =
XCOFF_DATA (objfile)->debugsec + symbol->n_offset;
2163 *name =
XCOFF_DATA (objfile)->strtbl + symbol->n_offset;
2166 *raw += coff_data (objfile->
obfd)->local_symesz;
2167 if (symbol->n_numaux > 0)
2169 bfd_coff_swap_aux_in (objfile->
obfd, *raw, symbol->n_type,
2170 symbol->n_sclass, 0, symbol->n_numaux, aux);
2172 *symnump += symbol->n_numaux;
2173 *raw += coff_data (objfile->
obfd)->local_symesz * symbol->n_numaux;
2181 _(
"function `%s' appears to be defined "
2182 "outside of all compilation units"),
2191 const char *filestring = NULL;
2193 const char *namestring;
2194 int past_first_source_file = 0;
2203 const char **psymtab_include_list;
2204 int includes_allocated;
2209 int dependencies_used, dependencies_allocated;
2212 struct internal_syment symbol;
2213 union internal_auxent main_aux[5];
2214 unsigned int ssymnum;
2216 const char *last_csect_name = NULL;
2218 int last_csect_sec = 0;
2219 int misc_func_recorded = 0;
2220 int textlow_not_set = 1;
2224 includes_allocated = 30;
2226 psymtab_include_list = (
const char **) alloca (includes_allocated *
2227 sizeof (
const char *));
2229 dependencies_allocated = 30;
2230 dependencies_used = 0;
2237 abfd = objfile->
obfd;
2241 nsyms =
XCOFF_DATA (objfile)->symtbl_num_syms;
2243 while (ssymnum < nsyms)
2249 bfd_coff_swap_sym_in (abfd, sraw_symbol, &symbol);
2250 sclass = symbol.n_sclass;
2258 union internal_auxent csect_aux;
2259 unsigned int symnum_before = ssymnum;
2261 swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
2263 if (symbol.n_numaux > 1)
2265 bfd_coff_swap_aux_in
2267 sraw_symbol - coff_data (abfd)->local_symesz,
2270 symbol.n_numaux - 1,
2275 csect_aux = main_aux[0];
2278 if (namestring[0] ==
'$'
2279 || (namestring[0] ==
'.' && namestring[1] ==
'$'))
2282 switch (csect_aux.x_csect.x_smtyp & 0x7)
2285 switch (csect_aux.x_csect.x_smclas)
2288 if (last_csect_name)
2295 if (!misc_func_recorded)
2298 (last_csect_name, last_csect_val,
2299 mst_text, last_csect_sec, objfile);
2300 misc_func_recorded = 1;
2309 (objfile, pst, psymtab_include_list,
2310 includes_used, symnum_before, dependency_list,
2311 dependencies_used, textlow_not_set);
2313 dependencies_used = 0;
2327 if (namestring && (namestring[0] ==
'.'
2328 || namestring[0] ==
'@'))
2330 last_csect_name = namestring;
2331 last_csect_val = symbol.n_value;
2332 last_csect_sec = symbol.n_scnum;
2337 symbol.n_value + csect_aux.x_csect.x_scnlen.l;
2342 pst->
textlow = symbol.n_value;
2344 misc_func_recorded = 0;
2351 if (*namestring !=
'.')
2353 (namestring, symbol.n_value,
2355 symbol.n_scnum, objfile);
2360 warning (
_(
"More than one XMC_TC0 symbol found."));
2361 toc_offset = symbol.n_value;
2367 toc_offset -= bfd_section_vma (objfile->
obfd, bfd_sect);
2381 switch (csect_aux.x_csect.x_smclas)
2386 if (first_fun_line_offset == 0 && symbol.n_numaux > 1)
2387 first_fun_line_offset =
2388 main_aux[0].x_sym.x_fcnary.x_fcn.x_lnnoptr;
2391 (namestring, symbol.n_value,
2393 symbol.n_scnum, objfile);
2394 misc_func_recorded = 1;
2407 (namestring, symbol.n_value,
2409 misc_func_recorded = 1;
2427 if (*namestring !=
'.')
2429 (namestring, symbol.n_value,
2431 symbol.n_scnum, objfile);
2437 switch (csect_aux.x_csect.x_smclas)
2443 if (*namestring !=
'.')
2445 (namestring, symbol.n_value,
2447 symbol.n_scnum, objfile);
2459 unsigned int symnum_before;
2461 symnum_before = ssymnum;
2462 swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
2467 if (last_csect_name && !misc_func_recorded)
2474 mst_text, last_csect_sec, objfile);
2475 misc_func_recorded = 1;
2481 includes_used, symnum_before,
2482 dependency_list, dependencies_used,
2485 dependencies_used = 0;
2487 first_fun_line_offset = 0;
2494 if (!strcmp (namestring,
".file") && symbol.n_numaux > 0)
2499 filestring = namestring;
2506 last_csect_name = NULL;
2513 _(
"Storage class %d not recognized during scan"),
2563 int naux1 = symbol.n_numaux + 1;
2566 sraw_symbol += bfd_coff_symesz (abfd) * naux1;
2575 swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
2587 psymtab_language = tmp_language;
2599 if (pst && strcmp (namestring, pst->
filename) == 0)
2605 for (i = 0; i < includes_used; i++)
2606 if (strcmp (namestring, psymtab_include_list[i]) == 0)
2614 psymtab_include_list[includes_used++] = namestring;
2615 if (includes_used >= includes_allocated)
2617 const char **orig = psymtab_include_list;
2619 psymtab_include_list = (
const char **)
2620 alloca ((includes_allocated *= 2) *
2621 sizeof (
const char *));
2622 memcpy (psymtab_include_list, orig,
2623 includes_used *
sizeof (
const char *));
2640 swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
2643 p = strchr (namestring,
':');
2662 (gdbarch, namestring);
2668 psymtab_language, objfile);
2680 psymtab_language, objfile);
2690 if (p >= namestring + 2
2691 || (p == namestring + 1
2692 && namestring[0] !=
' '))
2698 psymtab_language, objfile);
2706 psymtab_language, objfile);
2713 if (p != namestring)
2719 psymtab_language, objfile);
2739 while ((*p >=
'0' && *p <=
'9')
2740 || *p ==
'(' || *p ==
',' || *p ==
')'
2763 while (*p && *p !=
';' && *p !=
',')
2769 if (*p ==
'\\' || (*p ==
'?' && p[1] ==
'\0'))
2774 for (q = p; *q && *q !=
':'; q++)
2781 0, psymtab_language, objfile);
2785 while (*p && *p !=
',')
2799 0, psymtab_language, objfile);
2805 int name_len = p - namestring;
2808 memcpy (name, namestring, name_len);
2809 name[name_len] =
'\0';
2819 psymtab_language, objfile);
2828 int name_len = p - namestring;
2831 memcpy (name, namestring, name_len);
2832 name[name_len] =
'\0';
2850 psymtab_language, objfile);
2893 _(
"unknown symbol descriptor `%c'"), p[1]);
2906 ssymnum, dependency_list,
2907 dependencies_used, textlow_not_set);
2915 XCOFF_DATA (objfile)->toc_offset = toc_offset;
2944 file_ptr symtab_offset;
2945 file_ptr stringtab_offset;
2951 symfile_bfd = abfd = objfile->
obfd;
2954 num_symbols = bfd_get_symcount (abfd);
2955 symtab_offset = obj_sym_filepos (abfd);
2956 stringtab_offset = symtab_offset +
2957 num_symbols * coff_data (abfd)->local_symesz;
2963 if (num_symbols > 0)
2970 struct bfd_section *secp;
2971 bfd_size_type length;
2972 bfd_byte *debugsec = NULL;
2974 secp = bfd_get_section_by_name (abfd,
".debug");
2977 length = bfd_section_size (abfd, secp);
2982 if (!bfd_get_full_section_contents (abfd, secp, &debugsec))
2984 error (
_(
"Error reading .debug section of `%s': %s"),
2985 name, bfd_errmsg (bfd_get_error ()));
2989 info->
debugsec = (
char *) debugsec;
2995 val = bfd_seek (abfd, symtab_offset,
SEEK_SET);
2997 error (
_(
"Error reading symbols from %s: %s"),
2998 name, bfd_errmsg (bfd_get_error ()));
2999 size = coff_data (abfd)->local_symesz * num_symbols;
3003 val = bfd_bread (info->
symtbl, size, abfd);
3045 const char *first_section_name;
3063 && strcmp (first_section_name,
".text") != 0)
3067 && strcmp (first_section_name,
".data") != 0)
3071 && strcmp (first_section_name,
".bss") != 0)
3075 && strcmp (first_section_name,
".rodata") != 0)
3111 asection *sect = bfd_get_section_by_name (abfd,
".ldinfo");
3119 for (offset = 0; offset < bfd_get_section_size (sect);)
3125 if (!bfd_get_section_contents (abfd, sect, buf, offset, 4))
3127 next = bfd_get_32 (abfd, buf);
3135 return n_entries - 1;
3144 asection *sect = bfd_get_section_by_name (abfd,
".loader");
3157 if (!bfd_get_section_contents (abfd, sect, buf, 16, 4))
3159 l_nimpid = bfd_get_32 (abfd, buf);
3164 return l_nimpid - 1;
3183 xcoff_objfile_data_key = register_objfile_data_with_cleanup (NULL,
struct psymbol_allocation_list static_psymbols
void discard_psymtab(struct objfile *, struct partial_symtab *)
void stabsread_new_init(void)
int dwarf2_has_info(struct objfile *objfile, const struct dwarf2_debug_sections *names)
void common_block_end(struct objfile *objfile)
static struct partial_symtab * xcoff_start_psymtab(struct objfile *objfile, const char *filename, int first_symnum, struct partial_symbol **global_syms, struct partial_symbol **static_syms)
#define SECT_OFF_TEXT(objfile)
static void allocate_include_entry(void)
void dwarf2_build_frame_info(struct objfile *objfile)
struct linetable_entry item[1]
static int compare_lte(const void *, const void *)
int gdb_bfd_section_index(bfd *abfd, asection *section)
void add_symbol_to_list(struct symbol *symbol, struct pending **listhead)
struct _inclTable InclTable
struct bfd_section * the_bfd_section
void warning(const char *fmt,...)
struct psymbol_allocation_list global_psymbols
static int secnum_to_section(int, struct objfile *)
void set_last_source_file(const char *name)
struct ui_file * gdb_stdout
#define SYMBOL_SET_LINKAGE_NAME(symbol, linkage_name)
const struct objfile_type * objfile_type(struct objfile *objfile)
struct compunit_symtab * end_symtab(CORE_ADDR end_addr, int section)
void add_symtab_fns(enum bfd_flavour flavour, const struct sym_fns *sf)
static void find_linenos(struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
EXTERN struct pending * file_symbols
static int xcoff_get_core_n_import_files(bfd *abfd)
static void record_include_begin(struct coff_symbol *)
static struct symbol * process_xcoff_symbol(struct coff_symbol *, struct objfile *)
initialize_file_ftype _initialize_xcoffread
struct symfile_segment_data * default_symfile_segments(bfd *abfd)
static void function_outside_compilation_unit_complaint(const char *arg1)
void initialize_objfile_symbol(struct symbol *sym)
void dwarf2_build_psymtabs(struct objfile *objfile)
static InclTable * inclTable
struct type * nodebug_data_symbol
static int static_block_section
static int static_block_base
struct minimal_symbol * prim_record_minimal_symbol_and_info(const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int section, struct objfile *objfile)
EXTERN int context_stack_depth
static char * coff_getfilename(union internal_auxent *, struct objfile *)
CORE_ADDR xcoff_get_toc_offset(struct objfile *objfile)
static void xcoff_new_init(struct objfile *)
void free_pending_blocks(void)
static CORE_ADDR read_symbol_nvalue(int)
#define INITIAL_STABVECTOR_LENGTH
void printf_filtered(const char *format,...)
EXTERN struct subfile * current_subfile
struct obstack objfile_obstack
static void find_targ_sec(bfd *, asection *, void *)
static void xcoff_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
void common_block_start(char *name, struct objfile *objfile)
static void xcoff_initial_scan(struct objfile *, int)
static void eb_complaint(int arg1)
static struct linetable * arrange_linetable(struct linetable *)
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
EXTERN unsigned int symnum
#define SYMBOL_ACLASS_INDEX(symbol)
static struct objfile * this_symtab_objfile
#define SYMBOL_VALUE_ADDRESS(symbol)
static enum language psymtab_language
void dwarf2_free_objfile(struct objfile *objfile)
CORE_ADDR gdbarch_addr_bits_remove(struct gdbarch *gdbarch, CORE_ADDR addr)
#define SYMBOL_DOMAIN(symbol)
void initialize_file_ftype(void)
EXTERN struct pending * global_symbols
struct pending_block * old_blocks
struct partial_symbol ** next
void scan_file_globals(struct objfile *objfile)
static const struct objfile_data * xcoff_objfile_data_key
#define XCOFF_DATA(objfile)
void init_psymbol_list(struct objfile *, int)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
struct partial_symtab * start_psymtab_common(struct objfile *, const char *, CORE_ADDR, struct partial_symbol **, struct partial_symbol **)
static void record_include_end(struct coff_symbol *)
static void swap_sym(struct internal_syment *symbol, union internal_auxent *aux, const char **name, char **raw, unsigned int *symnump, struct objfile *objfile)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
static void read_symbol(struct internal_syment *, int)
#define SECT_OFF_DATA(objfile)
void buildsym_new_init(void)
void complaint(struct complaints **complaints, const char *fmt,...)
#define SYMBOL_DUP(SYMBOL1, SYMBOL2)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
#define ANOFFSET(secoff, whichone)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
EXTERN struct pending * local_symbols
struct obj_section * sections
static void xcoff_secnum_to_sections(int n_scnum, struct objfile *objfile, asection **bfd_sect, int *secnum)
static CORE_ADDR cur_src_end_addr
#define complete_symtab(name, start_addr)
#define next_symbol_text(objfile)
struct symbol * define_symbol(CORE_ADDR valu, char *string, int desc, int type, struct objfile *objfile)
struct context_stack * pop_context(void)
#define SYMNAME_ALLOC(NAME, ALLOCED)
const char * get_last_source_file(void)
static int startswith(const char *string, const char *pattern)
struct cleanup * make_cleanup_discard_minimal_symbols(void)
static void xcoff_symfile_finish(struct objfile *)
void wrap_here(char *indent)
static void xcoff_free_info(struct objfile *objfile, void *arg)
int number_of_dependencies
const char * objfile_name(const struct objfile *objfile)
struct compunit_symtab * start_symtab(struct objfile *objfile, const char *name, const char *comp_dir, CORE_ADDR start_addr)
void * read_symtab_private
static void init_stringtab(bfd *, file_ptr, struct objfile *)
static void ef_complaint(int arg1)
struct partial_symtab * allocate_psymtab(const char *, struct objfile *) ATTRIBUTE_NONNULL(1)
static unsigned int first_fun_line_offset
void init_minimal_symbol_collection(void)
file_ptr max_lineno_offset
void add_psymbol_to_list(const char *, int, int, domain_enum, enum address_class, struct psymbol_allocation_list *, long, CORE_ADDR, enum language, struct objfile *)
static void xcoff_symfile_init(struct objfile *)
EXTERN struct pending_stabs * global_stabs
PTR xrealloc(PTR ptr, size_t size)
static void record_minimal_symbol(const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int n_scnum, struct objfile *objfile)
static struct coff_symbol fcn_cs_saved
const char const char int
void sort_pst_symbols(struct objfile *, struct partial_symtab *)
static void enter_line_range(struct subfile *, unsigned, unsigned, CORE_ADDR, CORE_ADDR, unsigned *)
static void xcoff_read_symtab(struct partial_symtab *self, struct objfile *objfile)
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
static void process_linenos(CORE_ADDR, CORE_ADDR)
static void bf_notfound_complaint(void)
static unsigned local_symesz
static struct partial_symtab * xcoff_end_psymtab(struct objfile *objfile, struct partial_symtab *pst, const char **include_list, int num_includes, int capping_symbol_number, struct partial_symtab **dependency_list, int number_dependencies, int textlow_not_set)
enum language deduce_language_from_filename(const char *filename)
int xcoff_get_n_import_files(bfd *abfd)
struct partial_symtab ** dependencies
struct ui_file * gdb_stderr
void record_debugformat(const char *format)
struct complaints * symfile_complaints
const char * gdbarch_static_transform_name(struct gdbarch *gdbarch, const char *name)
file_ptr min_lineno_offset
const struct quick_symbol_functions psym_functions
void really_free_pendings(void *dummy)
#define INITIAL_INCLUDE_TABLE_LENGTH
record_line_ftype record_line
EXTERN CORE_ADDR last_source_start_addr
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
static struct partial_symtab * this_symtab_psymtab
void start_subfile(const char *name)
static int read_symbol_lineno(int)
struct type * nodebug_text_symbol
struct partial_symbol ** list
void(* read_symtab)(struct partial_symtab *, struct objfile *)
EXTERN char *(* next_symbol_text_func)(struct objfile *)
static CORE_ADDR first_object_file_end
#define SYMBOL_TYPE(symbol)
struct context_stack * push_context(int desc, CORE_ADDR valu)
static asection * secnum_to_bfd_section(int, struct objfile *)
void stabsread_init(void)
#define SYMBOL_SECTION(symbol)
struct compunit_symtab * compunit_symtab
struct section_offsets * section_offsets
void gdb_flush(struct ui_file *file)
int gdbarch_static_transform_name_p(struct gdbarch *gdbarch)
static char * xcoff_next_symbol_text(struct objfile *)
EXTERN int within_function
void install_minimal_symbols(struct objfile *objfile)
static void read_xcoff_symtab(struct objfile *, struct partial_symtab *)
static void aix_process_linenos(struct objfile *objfile)
struct linetable * line_vector
static void xcoff_psymtab_to_symtab_1(struct objfile *objfile, struct partial_symtab *pst)
void error(const char *fmt,...)
static void scan_xcoff_symtab(struct objfile *)
void do_cleanups(struct cleanup *old_chain)
struct block * finish_block(struct symbol *symbol, struct pending **listhead, struct pending_block *old_blocks, CORE_ADDR start, CORE_ADDR end)