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
This commit is contained in:
Tristan Gingold 2010-06-10 08:51:46 +00:00
parent 820744a571
commit e1f000f69c
5 changed files with 834 additions and 410 deletions

View File

@ -1,3 +1,55 @@
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)
2010-06-10 Tristan Gingold <gingold@adacore.com>
* targets.c (bfd_target_list): Remove hp/ux compiler work-around

1133
bfd/som.c

File diff suppressed because it is too large Load Diff

View File

@ -30,9 +30,9 @@
/* We want reloc.h to provide PA 2.0 defines. */
#define PA_2_0
#include <a.out.h>
#include <lst.h>
#include <ar.h>
#include "som/aout.h"
#include "som/lst.h"
#include "som/internal.h"
/* The SOM BFD backend doesn't currently use anything from these
two include files, but it's likely to need them in the future. */
@ -41,7 +41,7 @@
#include <dl.h>
#endif
#if defined(HOST_HPPABSD) || defined (HOST_HPPAOSF)
#if defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
/* BSD uses a completely different scheme for object file identification.
so for now, define _PA_RISC_ID to accept any random value for a model
number. */
@ -49,9 +49,6 @@
#define _PA_RISC_ID(__m_num) 1
#endif /* HOST_HPPABSD */
#define FILE_HDR_SIZE sizeof (struct header)
#define AUX_HDR_SIZE sizeof (struct som_exec_auxhdr)
typedef struct som_symbol
{
asymbol symbol;
@ -116,11 +113,11 @@ struct somdata
/* 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;
struct som_header *file_hdr;
struct som_string_auxhdr *copyright_aux_hdr;
struct som_string_auxhdr *version_aux_hdr;
struct som_exec_auxhdr *exec_hdr;
COMPUNIT *comp_unit;
struct som_compilation_unit *comp_unit;
/* Pointers to a saved copy of the symbol and string tables. These
need not be copied for objcopy or strip to work. */
@ -144,35 +141,6 @@ struct som_data_struct
struct somdata a;
};
struct som_subspace_dictionary_record
{
int space_index;
unsigned int access_control_bits : 7;
unsigned int memory_resident : 1;
unsigned int dup_common : 1;
unsigned int is_common : 1;
unsigned int is_loadable : 1;
unsigned int quadrant : 2;
unsigned int initially_frozen : 1;
unsigned int is_first : 1;
unsigned int code_only : 1;
unsigned int sort_key : 8;
unsigned int replicate_init : 1;
unsigned int continuation : 1;
unsigned int is_tspecific : 1;
unsigned int is_comdat : 1;
unsigned int reserved : 4;
int file_loc_init_value;
unsigned int initialization_length;
unsigned int subspace_start;
unsigned int subspace_length;
unsigned int reserved2 : 5;
unsigned int alignment :27;
union name_pt name;
int fixup_request_index;
unsigned int fixup_request_quantity;
};
/* Substructure of som_section_data_struct used to hold information
which can't be represented by the generic BFD section structure,
but which must be copied during objcopy or strip. */
@ -216,7 +184,7 @@ struct som_section_data_struct
struct som_copyable_section_data_struct *copy_data;
unsigned int reloc_size;
unsigned char *reloc_stream;
struct space_dictionary_record *space_dict;
struct som_space_dictionary_record *space_dict;
struct som_subspace_dictionary_record *subspace_dict;
};

View File

@ -1,3 +1,7 @@
2010-06-10 Tristan Gingold <gingold@adacore.com>
* config/obj-som.h: Includes som/reloc.h
2010-06-10 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (cpu_arch): Add comment.
@ -6,10 +10,10 @@
2010-06-08 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* config/tc-arm.c (operand_parse_code): Add OP_RRnpctw enum
* config/tc-arm.c (operand_parse_code): Add OP_RRnpctw enum
value.
(parse_operands): Add support for OP_RRnpctw.
(insns): Update floating-point load/store multiples so the
(insns): Update floating-point load/store multiples so the
first register is of type OP_RRnpctw.
2010-06-08 Quentin Neill <quentin.neill@amd.com>

View File

@ -28,6 +28,7 @@
#define OBJ_SOM 1
#include "bfd/som.h"
#include "som/reloc.h"
#include "targ-cpu.h"
#ifndef FALSE