mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
This commit is contained in:
@@ -372,6 +372,18 @@ struct objfile
|
||||
struct section_offsets *section_offsets;
|
||||
int num_sections;
|
||||
|
||||
/* Indexes in the section_offsets array. These are initialized by the
|
||||
*_symfile_offsets() family of functions (som_symfile_offsets,
|
||||
xcoff_symfile_offsets, default_symfile_offsets). In theory they
|
||||
should correspond to the section indexes used by bfd for the
|
||||
current objfile. The exception to this for the time being is the
|
||||
SOM version. */
|
||||
|
||||
int sect_index_text;
|
||||
int sect_index_data;
|
||||
int sect_index_bss;
|
||||
int sect_index_rodata;
|
||||
|
||||
/* These pointers are used to locate the section table, which
|
||||
among other things, is used to map pc addresses into sections.
|
||||
SECTIONS points to the first entry in the table, and
|
||||
@@ -584,4 +596,20 @@ is_in_import_list PARAMS ((char *, struct objfile *));
|
||||
ALL_OBJFILES (objfile) \
|
||||
ALL_OBJFILE_OSECTIONS (objfile, osect)
|
||||
|
||||
#define SECT_OFF_DATA(objfile) \
|
||||
((objfile->sect_index_data == -1) ? \
|
||||
(internal_error ("sect_index_data not initialized"), -1) : objfile->sect_index_data)
|
||||
|
||||
#define SECT_OFF_RODATA(objfile) \
|
||||
((objfile->sect_index_rodata == -1) ? \
|
||||
(internal_error ("sect_index_rodata not initialized"), -1) : objfile->sect_index_rodata)
|
||||
|
||||
#define SECT_OFF_TEXT(objfile) \
|
||||
((objfile->sect_index_text == -1) ? \
|
||||
(internal_error ("sect_index_text not initialized"), -1) : objfile->sect_index_text)
|
||||
|
||||
#define SECT_OFF_BSS(objfile) \
|
||||
((objfile->sect_index_bss == -1) ? \
|
||||
(internal_error ("sect_index_bss not initialized"), -1) : objfile->sect_index_bss)
|
||||
|
||||
#endif /* !defined (OBJFILES_H) */
|
||||
|
||||
Reference in New Issue
Block a user