aboutsummaryrefslogtreecommitdiff
path: root/bfd/som.h
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-03-19 05:06:54 +0000
committerJeff Law <law@redhat.com>1994-03-19 05:06:54 +0000
commit4359a7ef33670fb3637b9962d35a35774aa6845f (patch)
treeef23d41049a0c028ac3c4e790a528afe14b37798 /bfd/som.h
parent08b3c4f997598e020fbd03e176f1ed087e644fd1 (diff)
downloadgdb-4359a7ef33670fb3637b9962d35a35774aa6845f.zip
gdb-4359a7ef33670fb3637b9962d35a35774aa6845f.tar.gz
gdb-4359a7ef33670fb3637b9962d35a35774aa6845f.tar.bz2
* som.h (struct som_exec_data): New structure to hold exec
info that must be preserved when running objcopy/strip. (struct somdata): Add new "exec_data" field and accessor macro. Add some comments on how the various fields are used. (som_section_data_struct): Make is_space and is_subspace bitfields. Delete unused subspace_index. All references now use the target_index field within the section structure itself. * som.c (make_unique_section): Delete unused declaration. (som_bfd_copy_private_bfd_data): New function. (som_object_setup): Allocate space for and save exec information that needs to be copied during objcopy/strip. (som_mkobject): Do not allocate space for a file header here. It is not used when only reading SOM objects. (som_prep_headers): Allocate space for and attach a file header to the output bfd. For executables, use the saved system_id value rather than trying to guess the right value. Do not abort wwhen setting file_hdr->entry* for executables. (som_begin_writing): For executables, set the exec_entry and exec_flags fields. (som_copy_private_backend_section_data): Always return a value.
Diffstat (limited to 'bfd/som.h')
-rw-r--r--bfd/som.h40
1 files changed, 34 insertions, 6 deletions
diff --git a/bfd/som.h b/bfd/som.h
index 38c04bc..5d52c7b 100644
--- a/bfd/som.h
+++ b/bfd/som.h
@@ -1,5 +1,5 @@
/* HP PA-RISC SOM object file format: definitions internal to BFD.
- Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -76,21 +76,49 @@ typedef struct som_symbol
}
som_symbol_type;
+/* A structure containing all the magic information stored in a BFD's
+ private data which needs to be copied during an objcopy/strip run. */
+struct som_exec_data
+ {
+ /* Sort-of a magic number. BSD uses it to distinguish between
+ native executables and hpux executables. */
+ short system_id;
+
+ /* Magic exec flags. These control things like whether or not
+ null pointer dereferencing is allowed and the like. */
+ long exec_flags;
+
+ /* Add more stuff here as needed. Good examples of information
+ we might want to pass would be presumed_dp, entry_* and maybe
+ others from the file header. */
+ };
+
struct somdata
{
+ /* All the magic information about an executable which lives
+ in the private BFD structure and needs to be copied from
+ the input bfd to the output bfd during a objcopy/strip. */
+ struct som_exec_data *exec_data;
+
+ /* These three fields are only used when writing files and are
+ generated from scratch. They need not be copied for objcopy
+ or strip to work. */
struct header *file_hdr;
struct copyright_aux_hdr *copyright_aux_hdr;
struct user_string_aux_hdr *version_aux_hdr;
+
+ /* Pointers to a saved copy of the symbol and string tables. These
+ need not be copied for objcopy or strip to work. */
som_symbol_type *symtab;
char *stringtab;
/* We remember these offsets so that after check_file_format, we have
- no dependencies on the particular format of the exec_hdr. */
+ no dependencies on the particular format of the exec_hdr.
+ These offsets need not be copied for objcopy or strip to work. */
file_ptr sym_filepos;
file_ptr str_filepos;
file_ptr reloc_filepos;
-
unsigned stringtab_size;
};
@@ -113,17 +141,17 @@ struct som_data_struct
struct som_section_data_struct
{
+ unsigned int is_space : 1;
+ unsigned int is_subspace : 1;
unsigned int reloc_size;
char *reloc_stream;
- unsigned int subspace_index;
asection *containing_space;
- int is_space;
struct space_dictionary_record space_dict;
- int is_subspace;
struct subspace_dictionary_record subspace_dict;
};
#define somdata(bfd) ((bfd)->tdata.som_data->a)
+#define obj_som_exec_data(bfd) (somdata(bfd).exec_data)
#define obj_som_file_hdr(bfd) (somdata(bfd).file_hdr)
#define obj_som_copyright_hdr(bfd) (somdata(bfd).copyright_aux_hdr)
#define obj_som_version_hdr(bfd) (somdata(bfd).version_aux_hdr)