1999-05-03 09:29:11 +02:00
|
|
|
/* SOM object file format.
|
2015-01-01 15:15:26 +01:00
|
|
|
Copyright (C) 1993-2015 Free Software Foundation, Inc.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
This file is part of GAS, the GNU Assembler.
|
|
|
|
|
|
|
|
GAS is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-03 13:01:12 +02:00
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
1999-05-03 09:29:11 +02:00
|
|
|
any later version.
|
|
|
|
|
|
|
|
GAS 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 GAS; see the file COPYING. If not, write to the Free
|
2005-05-05 11:13:19 +02:00
|
|
|
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
|
|
|
|
02110-1301, USA.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
Written by the Center for Software Science at the University of Utah
|
|
|
|
and by Cygnus Support. */
|
|
|
|
|
|
|
|
#ifndef _OBJ_SOM_H
|
|
|
|
#define _OBJ_SOM_H
|
|
|
|
|
|
|
|
#define OBJ_SOM 1
|
|
|
|
|
|
|
|
#include "bfd/som.h"
|
bfd/
2010-06-10 Tristan Gingold <gingold@adacore.com>
* som.c: Can now be compiled on any host.
Include bfd headers instead of system one.
(som_compute_checksum): Parameter is now a pointer to a
som_external_header structure. Adjust.
(struct section_to_type): Field section is now const.
(R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Removed conditional
definition.
(R_LONG_PCREL_MODE, R_N0SEL, R_N1SEL, R_LINETAB): Ditto.
(R_LINETAB_ESC, R_LTP_OVERRIDE, R_COMMENT): Ditto.
(som_swap_clock_in, som_swap_clock_out): New functions.
(som_swap_header_in, som_swap_header_out): Likewise.
(som_swap_space_dictionary_in): Likewise.
(som_swap_space_dictionary_out): Likewise.
(som_swap_subspace_dictionary_in): Likewise.
(som_swap_subspace_dictionary_record_out): Likewise.
(som_swap_aux_id_in, som_swap_aux_id_out): Likewise.
(som_swap_string_auxhdr_out): Likewise.
(som_swap_compilation_unit_out): Likewise.
(som_swap_exec_auxhdr_in): Likewise.
(som_swap_exec_auxhdr_out): Likewise.
(som_swap_lst_header_in): Likewise.
(som_object_setup): Adjust parameter type using bfd types.
(setup_sections): Likewise. Ditto for object file types.
Use intermediate variables for external representation and use the
swap functions to convert.
(som_object_p): Ditto. Remove #ifdef/#endif on always defined
macros.
(som_prep_headers): Likewise.
(som_write_symbol_strings): Likewise.
(som_begin_writing): Likewise.
(som_finish_writing): Likewise.
(som_build_and_write_symbol_table): Likewise.
(bfd_section_from_som_symbol): Likewise.
(som_slurp_symbol_table): Likewise.
(som_bfd_print_private_bfd_data): Likewise.
(bfd_som_attach_aux_hdr): Likewise. Clear the padding.
(bfd_som_attach_compilation_unit): Likewise.
(som_bfd_count_ar_symbols): Likewise.
(som_bfd_fill_in_ar_symbols): Likewise.
(som_slurp_armap): Likewise.
(som_bfd_ar_write_symbol_stuff): Likewise.
(som_write_armap): Likewise. Use _bfd_ar_spacepad instead of
sprintf to write header fields.
* som.h: Include bfd headers instead of system one.
(FILE_HDR_SIZE, AUX_HDR_SIZE): Removed.
(struct somdata): Use bfd structures instead of system ones.
(struct som_section_data_struct): Likewise.
(struct som_subspace_dictionary_record): Removed (now in
include/som/internal.h)
gas/
2010-06-10 Tristan Gingold <gingold@adacore.com>
* config/obj-som.h: Includes som/reloc.h
2010-06-10 10:51:46 +02:00
|
|
|
#include "som/reloc.h"
|
1999-05-03 09:29:11 +02:00
|
|
|
#include "targ-cpu.h"
|
|
|
|
|
|
|
|
#ifndef FALSE
|
|
|
|
#define FALSE 0
|
|
|
|
#define TRUE !FALSE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* should be conditional on address size! */
|
2000-11-28 22:29:02 +01:00
|
|
|
#define som_symbol(asymbol) ((som_symbol_type *) (&(asymbol)->the_bfd))
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2005-03-24 21:40:28 +01:00
|
|
|
extern void som_file_symbol (char *);
|
|
|
|
extern void som_frob_file (void);
|
|
|
|
extern void obj_som_version (int);
|
|
|
|
extern void obj_som_init_stab_section (segT);
|
|
|
|
extern void obj_som_copyright (int);
|
|
|
|
extern void obj_som_compiler (int);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
#define obj_symbol_new_hook(s) {;}
|
|
|
|
|
|
|
|
/* SOM has several attributes for spaces/subspaces which can not
|
|
|
|
be easily expressed in BFD. We use these macros to trigger calls
|
|
|
|
into the SOM BFD backend to set these attributes. */
|
|
|
|
#define obj_set_section_attributes bfd_som_set_section_attributes
|
|
|
|
#define obj_set_subsection_attributes bfd_som_set_subsection_attributes
|
|
|
|
|
|
|
|
/* Likewise for symbol types. */
|
|
|
|
#define obj_set_symbol_type bfd_som_set_symbol_type
|
|
|
|
|
|
|
|
/* Stabs go in a separate sections. GDB expects to find them in sections
|
|
|
|
with the names $GDB_SYMBOLS$ and $GDB_STRINGS$ rather than .stab and
|
|
|
|
.stabstr. */
|
|
|
|
#define SEPARATE_STAB_SECTIONS 1
|
|
|
|
#define STAB_SECTION_NAME "$GDB_SYMBOLS$"
|
|
|
|
#define STAB_STRING_SECTION_NAME "$GDB_STRINGS$"
|
|
|
|
|
|
|
|
/* We use INIT_STAB_SECTION to record the space/subspace relationships
|
|
|
|
for the various debugging sections. */
|
|
|
|
#define INIT_STAB_SECTION(seg) obj_som_init_stab_section (seg)
|
|
|
|
|
|
|
|
/* We'll be updating the magic 1st stab entry once the entire assembly
|
|
|
|
fail has been processed. */
|
|
|
|
#define obj_frob_file() som_frob_file()
|
|
|
|
|
|
|
|
#endif /* _OBJ_SOM_H */
|