Minor cleanup to make it compile on DECstation.
This commit is contained in:
parent
8c01a0eab1
commit
1e6d5d3023
|
@ -1,13 +1,33 @@
|
||||||
|
/* BFD internal declarations for Oasys file format handling */
|
||||||
|
/* Scrawled by Steve Chamberlain of Cygnus Support. */
|
||||||
|
|
||||||
|
/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of BFD, the Binary File Diddler.
|
||||||
|
|
||||||
|
BFD is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 1, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
BFD is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with BFD; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct _oasys_symbol
|
||||||
{
|
{
|
||||||
asymbol symbol;
|
asymbol symbol;
|
||||||
} oasys_symbol_type;
|
} oasys_symbol_type;
|
||||||
|
|
||||||
typedef struct oasys_reloc {
|
typedef struct _oasys_reloc {
|
||||||
arelent relent;
|
arelent relent;
|
||||||
struct oasys_reloc *next;
|
struct _oasys_reloc *next;
|
||||||
unsigned int symbol;
|
unsigned int symbol;
|
||||||
} oasys_reloc_type;
|
} oasys_reloc_type;
|
||||||
|
|
||||||
|
@ -15,7 +35,7 @@ typedef struct oasys_reloc {
|
||||||
#define oasys_symbol(x) ((oasys_symbol_type *)(x))
|
#define oasys_symbol(x) ((oasys_symbol_type *)(x))
|
||||||
#define oasys_per_section(x) ((oasys_per_section_type *)(x->used_by_bfd))
|
#define oasys_per_section(x) ((oasys_per_section_type *)(x->used_by_bfd))
|
||||||
|
|
||||||
typedef struct oasys_per_section
|
typedef struct _oasys_per_section
|
||||||
{
|
{
|
||||||
asection *section;
|
asection *section;
|
||||||
bfd_byte *data;
|
bfd_byte *data;
|
||||||
|
@ -32,31 +52,26 @@ typedef struct oasys_per_section
|
||||||
|
|
||||||
#define NSECTIONS 10
|
#define NSECTIONS 10
|
||||||
|
|
||||||
|
typedef struct _oasys_ar_obstack {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
file_ptr file_offset;
|
file_ptr file_offset;
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
} oasys_ar_obstack_type;
|
} oasys_ar_obstack_type;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct _oasys_module_info {
|
||||||
file_ptr pos;
|
file_ptr pos;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
} oasys_module_info_type;
|
} oasys_module_info_type;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct _oasys_ar_data {
|
||||||
oasys_module_info_type *module;
|
oasys_module_info_type *module;
|
||||||
unsigned int module_count;
|
unsigned int module_count;
|
||||||
unsigned int module_index;
|
unsigned int module_index;
|
||||||
} oasys_ar_data_type;
|
} oasys_ar_data_type;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct _oasys_data {
|
||||||
struct obstack oasys_obstack;
|
struct obstack oasys_obstack;
|
||||||
char *strings;
|
char *strings;
|
||||||
asymbol *symbols;
|
asymbol *symbols;
|
||||||
|
@ -67,8 +82,3 @@ typedef struct {
|
||||||
|
|
||||||
#define oasys_data(abfd) ((oasys_data_type *)((abfd)->tdata))
|
#define oasys_data(abfd) ((oasys_data_type *)((abfd)->tdata))
|
||||||
#define oasys_ar_data(abfd) ((oasys_ar_data_type *)((abfd)->tdata))
|
#define oasys_ar_data(abfd) ((oasys_ar_data_type *)((abfd)->tdata))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
50
bfd/oasys.c
50
bfd/oasys.c
|
@ -1,18 +1,28 @@
|
||||||
|
/* bfd backend for oasys objects.
|
||||||
|
Written by Steve Chamberlain of Cygnus Support <steve@cygnus.com> */
|
||||||
|
|
||||||
|
/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of BFD, the Binary File Diddler.
|
||||||
|
|
||||||
|
BFD is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 1, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
BFD is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with BFD; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
#define UNDERSCORE_HACK 1
|
#define UNDERSCORE_HACK 1
|
||||||
#define offsetof(type, identifier) (size_t) &(((type *) 0)->identifier)
|
#define offsetof(type, identifier) (size_t) &(((type *) 0)->identifier)
|
||||||
/*
|
|
||||||
|
|
||||||
bfd backend for oasys objects.
|
|
||||||
|
|
||||||
|
|
||||||
Written by Steve Chamberlain
|
|
||||||
steve@cygnus.com
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <ansidecl.h>
|
#include <ansidecl.h>
|
||||||
#include "sysdep.h"
|
#include "sysdep.h"
|
||||||
|
@ -22,11 +32,6 @@
|
||||||
#include "oasys.h"
|
#include "oasys.h"
|
||||||
#include "liboasys.h"
|
#include "liboasys.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DEFUN(oasys_read_record,(abfd, record),
|
DEFUN(oasys_read_record,(abfd, record),
|
||||||
bfd *CONST abfd AND
|
bfd *CONST abfd AND
|
||||||
|
@ -253,7 +258,7 @@ DEFUN(oasys_archive_p,(abfd),
|
||||||
|
|
||||||
oasys_module_table_type record;
|
oasys_module_table_type record;
|
||||||
|
|
||||||
oasys_ar_data(abfd) =ar;
|
set_tdata(abfd, ar);
|
||||||
ar->module = module;
|
ar->module = module;
|
||||||
ar->module_count = header.mod_count;
|
ar->module_count = header.mod_count;
|
||||||
|
|
||||||
|
@ -285,8 +290,8 @@ DEFUN(oasys_mkobject,(abfd),
|
||||||
{
|
{
|
||||||
oasys_data_type *oasys;
|
oasys_data_type *oasys;
|
||||||
|
|
||||||
oasys_data(abfd) =
|
set_tdata (abfd,
|
||||||
(oasys_data_type*)bfd_alloc(abfd, sizeof(oasys_data_type));
|
(oasys_data_type*)bfd_alloc(abfd, sizeof(oasys_data_type)));
|
||||||
oasys = oasys_data(abfd);
|
oasys = oasys_data(abfd);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +304,8 @@ DEFUN(oasys_object_p,(abfd),
|
||||||
oasys_data_type *oasys;
|
oasys_data_type *oasys;
|
||||||
boolean loop = true;
|
boolean loop = true;
|
||||||
boolean had_usefull = false;
|
boolean had_usefull = false;
|
||||||
oasys_data(abfd) = 0;
|
|
||||||
|
set_tdata (abfd, 0);
|
||||||
oasys_mkobject(abfd);
|
oasys_mkobject(abfd);
|
||||||
oasys = oasys_data(abfd);
|
oasys = oasys_data(abfd);
|
||||||
memset((PTR)oasys->sections, 0xff, sizeof(oasys->sections));
|
memset((PTR)oasys->sections, 0xff, sizeof(oasys->sections));
|
||||||
|
|
Loading…
Reference in New Issue