mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-11-25 13:09:48 +00:00
fc7233808a
Remove obstack.h to ../include and obstack.c to ../libiberty. Move COFF symbol swapping code to coffswap.c where GDB can call it but it won't be duplicated if we have N different COFF targets. Add support for traditional Unix core files (with a upage). This support is from an Ultrix port, but is probably slightly broken now. Improve bfd_release's of obstack'd items on error returns. gcc -Wall fixes. Handle section alignment slightly better in coff, and comment where it needs more work (on page-aligning virtual vs file addresses for DPAGED). Use set_tdata everywhere that tdata is set, to avoid "cast to the left of assignment" problems with some compilers. Move bfd_alloc, bfd_zalloc, bfd_realloc, and bfd_release into libbfd.h (from bfd.h) since they are internal routines. Remove the redundant suffix "_struct" from struct tags. Set symbol count early in file reading, before slurping in the syms, for GDB's use.
75 lines
1.2 KiB
C
75 lines
1.2 KiB
C
|
|
|
|
typedef struct
|
|
{
|
|
asymbol symbol;
|
|
} oasys_symbol_type;
|
|
|
|
typedef struct oasys_reloc {
|
|
arelent relent;
|
|
struct oasys_reloc *next;
|
|
unsigned int symbol;
|
|
} oasys_reloc_type;
|
|
|
|
|
|
#define oasys_symbol(x) ((oasys_symbol_type *)(x))
|
|
#define oasys_per_section(x) ((oasys_per_section_type *)(x->used_by_bfd))
|
|
|
|
typedef struct oasys_per_section
|
|
{
|
|
asection *section;
|
|
bfd_byte *data;
|
|
bfd_vma offset;
|
|
boolean had_vma;
|
|
oasys_reloc_type **reloc_tail_ptr;
|
|
bfd_vma pc;
|
|
|
|
|
|
file_ptr current_pos;
|
|
unsigned int current_byte;
|
|
boolean initialized;
|
|
} oasys_per_section_type;
|
|
|
|
#define NSECTIONS 10
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
file_ptr file_offset;
|
|
bfd *abfd;
|
|
} oasys_ar_obstack_type;
|
|
|
|
|
|
typedef struct {
|
|
file_ptr pos;
|
|
unsigned int size;
|
|
bfd *abfd;
|
|
char *name;
|
|
|
|
} oasys_module_info_type;
|
|
|
|
typedef struct {
|
|
oasys_module_info_type *module;
|
|
unsigned int module_count;
|
|
unsigned int module_index;
|
|
} oasys_ar_data_type;
|
|
|
|
typedef struct {
|
|
struct obstack oasys_obstack;
|
|
char *strings;
|
|
asymbol *symbols;
|
|
unsigned int symbol_string_length;
|
|
asection *sections[OASYS_MAX_SEC_COUNT];
|
|
file_ptr first_data_record;
|
|
} oasys_data_type;
|
|
|
|
#define oasys_data(abfd) ((oasys_data_type *)((abfd)->tdata))
|
|
#define oasys_ar_data(abfd) ((oasys_ar_data_type *)((abfd)->tdata))
|
|
|
|
|
|
|
|
|
|
|