Apply Paul Brook's patch to implement armv6k instructions
[deliverable/binutils-gdb.git] / bfd / xcoff-target.h
CommitLineData
b4911a31 1/* Common definitions for backends based on IBM RS/6000 "XCOFF64" files.
3cac74d0 2 Copyright 2000, 2001, 2002
b4911a31
CP
3 Free Software Foundation, Inc.
4 Contributed by Cygnus Support.
5
6This file is part of BFD, the Binary File Descriptor library.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program; if not, write to the Free Software
20Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21
22/* Internalcoff.h and coffcode.h modify themselves based on this flag. */
23#define RS6000COFF_C 1
24
25#define SELECT_RELOC(internal, howto) \
26 { \
27 internal.r_type = howto->type; \
28 internal.r_size = \
29 ((howto->complain_on_overflow == complain_overflow_signed \
30 ? 0x80 \
31 : 0) \
32 | (howto->bitsize - 1)); \
33 }
34\f
35#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
36
37#define COFF_LONG_FILENAMES
38
39#define NO_COFF_SYMBOLS
40
41#define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst)
42
43#define coff_mkobject _bfd_xcoff_mkobject
44#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
45#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
46#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
47#define coff_relocate_section _bfd_ppc_xcoff_relocate_section
48
49#define CORE_FILE_P _bfd_dummy_target
50
51#define coff_core_file_failing_command _bfd_nocore_core_file_failing_command
52#define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal
53#define coff_core_file_matches_executable_p \
54 _bfd_nocore_core_file_matches_executable_p
55
56#ifdef AIX_CORE
57#undef CORE_FILE_P
58#define CORE_FILE_P rs6000coff_core_p
59extern const bfd_target * rs6000coff_core_p ();
b34976b6 60extern bfd_boolean rs6000coff_core_file_matches_executable_p ();
b4911a31
CP
61
62#undef coff_core_file_matches_executable_p
63#define coff_core_file_matches_executable_p \
64 rs6000coff_core_file_matches_executable_p
65
66extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd));
67#undef coff_core_file_failing_command
68#define coff_core_file_failing_command rs6000coff_core_file_failing_command
69
70extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd));
71#undef coff_core_file_failing_signal
72#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal
b4911a31
CP
73#endif /* AIX_CORE */
74
75#ifdef LYNX_CORE
76
77#undef CORE_FILE_P
78#define CORE_FILE_P lynx_core_file_p
79extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd));
80
b34976b6
AM
81extern bfd_boolean lynx_core_file_matches_executable_p
82 PARAMS ((bfd *core_bfd, bfd *exec_bfd));
b4911a31
CP
83#undef coff_core_file_matches_executable_p
84#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p
85
86extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd));
87#undef coff_core_file_failing_command
88#define coff_core_file_failing_command lynx_core_file_failing_command
89
90extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd));
91#undef coff_core_file_failing_signal
92#define coff_core_file_failing_signal lynx_core_file_failing_signal
93
94#endif /* LYNX_CORE */
95
96#define _bfd_xcoff_bfd_get_relocated_section_contents \
97 coff_bfd_get_relocated_section_contents
98#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section
99#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections
8550eb6e 100#define _bfd_xcoff_bfd_merge_sections coff_bfd_merge_sections
e61463e1 101#define _bfd_xcoff_bfd_discard_group bfd_generic_discard_group
082b7297
L
102#define _bfd_xcoff_section_already_linked \
103 _bfd_generic_section_already_linked
b4911a31
CP
104#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section
105
106/* XCOFF archives do not have anything which corresponds to an
107 extended name table. */
108
109#define _bfd_xcoff_slurp_extended_name_table bfd_false
110#define _bfd_xcoff_construct_extended_name_table \
b34976b6 111 ((bfd_boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
b4911a31
CP
112 bfd_false)
113#define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname
114
115/* We can use the standard get_elt_at_index routine. */
116
117#define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index
118
119/* XCOFF archives do not have a timestamp. */
120
121#define _bfd_xcoff_update_armap_timestamp bfd_true
122
b34976b6
AM
123extern bfd_boolean _bfd_xcoff_mkobject PARAMS ((bfd *));
124extern bfd_boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *));
125extern bfd_boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *));
b4911a31
CP
126extern void _bfd_xcoff_rtype2howto
127 PARAMS ((arelent *, struct internal_reloc *));
128extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup
129 PARAMS ((bfd *, bfd_reloc_code_real_type));
b34976b6 130extern bfd_boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *));
b4911a31
CP
131extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *));
132extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *));
133extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
134extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
b34976b6 135extern bfd_boolean _bfd_xcoff_write_armap
b4911a31 136 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
b34976b6
AM
137extern bfd_boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *));
138extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, bfd_boolean));
b4911a31
CP
139extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR));
140extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR));
141extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
142extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR));
143
144#ifndef coff_SWAP_sym_in
145#define coff_SWAP_sym_in _bfd_xcoff_swap_sym_in
146#define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out
147#define coff_SWAP_aux_in _bfd_xcoff_swap_aux_in
148#define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out
149#endif
150
151#include "coffcode.h"
152
3d855632 153/* The transfer vector that leads the outside world to all of the above. */
b4911a31
CP
154
155const bfd_target TARGET_SYM =
156{
157 TARGET_NAME,
9bd09e22 158 bfd_target_xcoff_flavour,
b4911a31
CP
159 BFD_ENDIAN_BIG, /* data byte order is big */
160 BFD_ENDIAN_BIG, /* header byte order is big */
161
162 (HAS_RELOC | EXEC_P | /* object flags */
163 HAS_LINENO | HAS_DEBUG | DYNAMIC |
164 HAS_SYMS | HAS_LOCALS | WP_TEXT),
165
166 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
167 0, /* leading char */
168 '/', /* ar_pad_char */
169 15, /* ar_max_namelen??? FIXMEmgo */
170
171 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
172 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
173 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
174 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
175 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
176 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
177
178 {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
179 _bfd_xcoff_archive_p, CORE_FILE_P},
180 {bfd_false, coff_mkobject, /* bfd_set_format */
181 _bfd_generic_mkarchive, bfd_false},
182 {bfd_false, coff_write_object_contents, /* bfd_write_contents */
183 _bfd_xcoff_write_archive_contents, bfd_false},
184
185 BFD_JUMP_TABLE_GENERIC (coff),
186 BFD_JUMP_TABLE_COPY (coff),
187 BFD_JUMP_TABLE_CORE (coff),
188 BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff),
189 BFD_JUMP_TABLE_SYMBOLS (coff),
190 BFD_JUMP_TABLE_RELOCS (coff),
191 BFD_JUMP_TABLE_WRITE (coff),
192 BFD_JUMP_TABLE_LINK (_bfd_xcoff),
193 BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff),
194
195 NULL,
3d855632 196
b4911a31
CP
197 COFF_SWAP_TABLE
198};
This page took 0.269919 seconds and 4 git commands to generate.