167
167
struct bpo_reloc_request *reloc_request;
170
static int mmix_elf_link_output_symbol_hook
171
PARAMS ((struct bfd_link_info *, const char *, Elf_Internal_Sym *,
172
asection *, struct elf_link_hash_entry *));
174
static bfd_reloc_status_type mmix_elf_reloc
175
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
177
static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup
178
PARAMS ((bfd *, bfd_reloc_code_real_type));
180
static void mmix_info_to_howto_rela
181
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
183
static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR));
185
static bfd_boolean mmix_elf_new_section_hook
186
PARAMS ((bfd *, asection *));
188
static bfd_boolean mmix_elf_check_relocs
189
PARAMS ((bfd *, struct bfd_link_info *, asection *,
190
const Elf_Internal_Rela *));
192
static bfd_boolean mmix_elf_check_common_relocs
193
PARAMS ((bfd *, struct bfd_link_info *, asection *,
194
const Elf_Internal_Rela *));
196
static bfd_boolean mmix_elf_relocate_section
197
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
198
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
200
static bfd_reloc_status_type mmix_final_link_relocate
201
(reloc_howto_type *, asection *, bfd_byte *, bfd_vma, bfd_signed_vma,
202
bfd_vma, const char *, asection *, char **);
204
static bfd_reloc_status_type mmix_elf_perform_relocation
205
(asection *, reloc_howto_type *, void *, bfd_vma, bfd_vma, char **);
207
static bfd_boolean mmix_elf_section_from_bfd_section
208
PARAMS ((bfd *, asection *, int *));
210
static bfd_boolean mmix_elf_add_symbol_hook
211
PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
212
const char **, flagword *, asection **, bfd_vma *));
214
static bfd_boolean mmix_elf_is_local_label_name
215
PARAMS ((bfd *, const char *));
217
static int bpo_reloc_request_sort_fn PARAMS ((const PTR, const PTR));
219
static bfd_boolean mmix_elf_relax_section
220
PARAMS ((bfd *abfd, asection *sec, struct bfd_link_info *link_info,
221
bfd_boolean *again));
223
extern bfd_boolean mmix_elf_final_link PARAMS ((bfd *, struct bfd_link_info *));
225
extern void mmix_elf_symbol_processing PARAMS ((bfd *, asymbol *));
171
extern bfd_boolean mmix_elf_final_link (bfd *, struct bfd_link_info *);
173
extern void mmix_elf_symbol_processing (bfd *, asymbol *);
227
175
/* Only intended to be called from a debugger. */
228
176
extern void mmix_dump_bpo_gregs
229
PARAMS ((struct bfd_link_info *, bfd_error_handler_type));
177
(struct bfd_link_info *, bfd_error_handler_type);
232
mmix_set_relaxable_size
233
PARAMS ((bfd *, asection *, void *));
180
mmix_set_relaxable_size (bfd *, asection *, void *);
181
static bfd_reloc_status_type
182
mmix_elf_reloc (bfd *, arelent *, asymbol *, void *,
183
asection *, bfd *, char **);
184
static bfd_reloc_status_type
185
mmix_final_link_relocate (reloc_howto_type *, asection *, bfd_byte *, bfd_vma,
186
bfd_signed_vma, bfd_vma, const char *, asection *,
236
190
/* Watch out: this currently needs to have elements with the same index as
1398
1346
for guidance if you're thinking of copying this. */
1400
1348
static bfd_boolean
1401
mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section,
1402
contents, relocs, local_syms, local_sections)
1403
bfd *output_bfd ATTRIBUTE_UNUSED;
1404
struct bfd_link_info *info;
1406
asection *input_section;
1408
Elf_Internal_Rela *relocs;
1409
Elf_Internal_Sym *local_syms;
1410
asection **local_sections;
1349
mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
1350
struct bfd_link_info *info,
1352
asection *input_section,
1354
Elf_Internal_Rela *relocs,
1355
Elf_Internal_Sym *local_syms,
1356
asection **local_sections)
1412
1358
Elf_Internal_Shdr *symtab_hdr;
1413
1359
struct elf_link_hash_entry **sym_hashes;
2223
2161
symbols, since otherwise having two with the same value would cause
2224
2162
them to be "merged", but with the contents serialized. */
2227
mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
2229
struct bfd_link_info *info ATTRIBUTE_UNUSED;
2230
Elf_Internal_Sym *sym;
2231
const char **namep ATTRIBUTE_UNUSED;
2232
flagword *flagsp ATTRIBUTE_UNUSED;
2234
bfd_vma *valp ATTRIBUTE_UNUSED;
2165
mmix_elf_add_symbol_hook (bfd *abfd,
2166
struct bfd_link_info *info ATTRIBUTE_UNUSED,
2167
Elf_Internal_Sym *sym,
2168
const char **namep ATTRIBUTE_UNUSED,
2169
flagword *flagsp ATTRIBUTE_UNUSED,
2171
bfd_vma *valp ATTRIBUTE_UNUSED)
2236
2173
if (sym->st_shndx == SHN_REGISTER)