1 |
/* BFD backend for CRIS a.out binaries. |
/* BFD backend for CRIS a.out binaries. |
2 |
Copyright 2000, 2001 Free Software Foundation, Inc. |
Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
3 |
Contributed by Axis Communications AB. |
Contributed by Axis Communications AB. |
4 |
Written by Hans-Peter Nilsson. |
Written by Hans-Peter Nilsson. |
5 |
|
|
23 |
functions. Beware; some of the information there is outdated. */ |
functions. Beware; some of the information there is outdated. */ |
24 |
|
|
25 |
#define N_HEADER_IN_TEXT(x) 0 |
#define N_HEADER_IN_TEXT(x) 0 |
|
#define BYTES_IN_WORD 4 |
|
26 |
#define N_TXTOFF(x) 32 |
#define N_TXTOFF(x) 32 |
27 |
#define ENTRY_CAN_BE_ZERO |
#define ENTRY_CAN_BE_ZERO |
28 |
#define TEXT_START_ADDR 0 |
#define TEXT_START_ADDR 0 |
75 |
#define MY_exec_hdr_flags 1 |
#define MY_exec_hdr_flags 1 |
76 |
|
|
77 |
#define MY_write_object_contents MY(write_object_contents) |
#define MY_write_object_contents MY(write_object_contents) |
78 |
static boolean MY(write_object_contents) PARAMS ((bfd *)); |
static bfd_boolean MY(write_object_contents) PARAMS ((bfd *)); |
79 |
|
|
80 |
/* Forward this, so we can use a pointer to it in PARAMS. */ |
/* Forward this, so we can use a pointer to it in PARAMS. */ |
81 |
struct reloc_ext_external; |
struct reloc_ext_external; |
91 |
bfd_size_type)); |
bfd_size_type)); |
92 |
|
|
93 |
#define MY_set_sizes MY(set_sizes) |
#define MY_set_sizes MY(set_sizes) |
94 |
static boolean MY(set_sizes) PARAMS ((bfd *)); |
static bfd_boolean MY(set_sizes) PARAMS ((bfd *)); |
95 |
|
|
96 |
/* To set back reloc_size to ext, we make MY(set_sizes) be called |
/* To set back reloc_size to ext, we make MY(set_sizes) be called |
97 |
through this construct. Note that MY_set_arch_mach is only called |
through this construct. Note that MY_set_arch_mach is only called |
120 |
|
|
121 |
/* We need our own version to set header flags. */ |
/* We need our own version to set header flags. */ |
122 |
|
|
123 |
static boolean |
static bfd_boolean |
124 |
MY(write_object_contents) (abfd) |
MY(write_object_contents) (abfd) |
125 |
bfd *abfd; |
bfd *abfd; |
126 |
{ |
{ |
142 |
|
|
143 |
WRITE_HEADERS (abfd, execp); |
WRITE_HEADERS (abfd, execp); |
144 |
|
|
145 |
return true; |
return TRUE; |
146 |
} |
} |
147 |
|
|
148 |
/* We need our own for these reasons: |
/* We need our own for these reasons: |
248 |
|
|
249 |
if (r_type > 2) |
if (r_type > 2) |
250 |
{ |
{ |
251 |
(*_bfd_error_handler) (_("%s: Invalid relocation type imported: %d"), |
(*_bfd_error_handler) (_("%B: Invalid relocation type imported: %d"), |
252 |
bfd_archive_filename (abfd), r_type); |
abfd, r_type); |
253 |
|
|
254 |
bfd_set_error(bfd_error_wrong_format); |
bfd_set_error (bfd_error_wrong_format); |
255 |
} |
} |
256 |
|
|
257 |
cache_ptr->howto = howto_table_ext + r_type; |
cache_ptr->howto = howto_table_ext + r_type; |
259 |
if (r_extern && r_index > symcount) |
if (r_extern && r_index > symcount) |
260 |
{ |
{ |
261 |
(*_bfd_error_handler) |
(*_bfd_error_handler) |
262 |
(_("%s: Bad relocation record imported: %d"), |
(_("%B: Bad relocation record imported: %d"), abfd, r_index); |
|
bfd_archive_filename (abfd), r_index); |
|
263 |
|
|
264 |
bfd_set_error (bfd_error_wrong_format); |
bfd_set_error (bfd_error_wrong_format); |
265 |
|
|
277 |
"obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing |
"obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing |
278 |
NAME (aout, set_arch_mach) in aoutx. */ |
NAME (aout, set_arch_mach) in aoutx. */ |
279 |
|
|
280 |
static boolean |
static bfd_boolean |
281 |
MY(set_sizes) (abfd) |
MY(set_sizes) (abfd) |
282 |
bfd *abfd; |
bfd *abfd; |
283 |
{ |
{ |
295 |
|
|
296 |
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; |
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; |
297 |
|
|
298 |
return true; |
return TRUE; |
299 |
} |
} |
300 |
|
|
301 |
/* |
/* |