Lines Matching refs:abfd

34   PARAMS ((bfd *abfd, asection *input_section, arelent *r,
37 PARAMS ((bfd *abfd, unsigned int slip, asection *input_section,
40 PARAMS ((bfd *abfd, asection *section));
91 bout_swap_exec_header_in (abfd, raw_bytes, execp)
92 bfd *abfd;
99 execp->a_info = H_GET_32 (abfd, bytes->e_info);
100 execp->a_text = GET_WORD (abfd, bytes->e_text);
101 execp->a_data = GET_WORD (abfd, bytes->e_data);
102 execp->a_bss = GET_WORD (abfd, bytes->e_bss);
103 execp->a_syms = GET_WORD (abfd, bytes->e_syms);
104 execp->a_entry = GET_WORD (abfd, bytes->e_entry);
105 execp->a_trsize = GET_WORD (abfd, bytes->e_trsize);
106 execp->a_drsize = GET_WORD (abfd, bytes->e_drsize);
107 execp->a_tload = GET_WORD (abfd, bytes->e_tload);
108 execp->a_dload = GET_WORD (abfd, bytes->e_dload);
119 bout_swap_exec_header_out (abfd, execp, raw_bytes)
120 bfd *abfd;
127 H_PUT_32 (abfd, execp->a_info , bytes->e_info);
128 PUT_WORD (abfd, execp->a_text , bytes->e_text);
129 PUT_WORD (abfd, execp->a_data , bytes->e_data);
130 PUT_WORD (abfd, execp->a_bss , bytes->e_bss);
131 PUT_WORD (abfd, execp->a_syms , bytes->e_syms);
132 PUT_WORD (abfd, execp->a_entry , bytes->e_entry);
133 PUT_WORD (abfd, execp->a_trsize, bytes->e_trsize);
134 PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize);
135 PUT_WORD (abfd, execp->a_tload , bytes->e_tload);
136 PUT_WORD (abfd, execp->a_dload , bytes->e_dload);
144 b_out_object_p (abfd)
145 bfd *abfd;
151 if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt)
158 anexec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
166 bout_swap_exec_header_in (abfd, &exec_bytes, &anexec);
167 return aout_32_some_aout_object_p (abfd, &anexec, b_out_callback);
174 b_out_callback (abfd)
175 bfd *abfd;
177 struct internal_exec *execp = exec_hdr (abfd);
181 bfd_set_arch_mach(abfd,
187 obj_str_filepos (abfd) = N_STROFF (*execp);
188 obj_sym_filepos (abfd) = N_SYMOFF (*execp);
191 obj_textsec (abfd)->alignment_power = execp->a_talign;
192 obj_datasec (abfd)->alignment_power = execp->a_dalign;
193 obj_bsssec (abfd)->alignment_power = execp->a_balign;
196 obj_textsec (abfd)->vma = execp->a_tload;
197 obj_datasec (abfd)->vma = execp->a_dload;
199 obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
200 obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
203 obj_textsec (abfd)->size = execp->a_text;
206 obj_bsssec (abfd)->vma = align_power (bss_start, execp->a_balign);
208 obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
211 obj_textsec (abfd)->filepos = N_TXTOFF(*execp);
212 obj_datasec (abfd)->filepos = N_DATOFF(*execp);
215 obj_textsec (abfd)->rel_filepos = N_TROFF(*execp);
216 obj_datasec (abfd)->rel_filepos = N_DROFF(*execp);
218 adata(abfd).page_size = 1; /* Not applicable. */
219 adata(abfd).segment_size = 1; /* Not applicable. */
220 adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
223 abfd->flags |= BFD_IS_RELAXABLE;
224 return abfd->xvec;
234 b_out_mkobject (abfd)
235 bfd *abfd;
240 rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt);
244 abfd->tdata.bout_data = rawptr;
245 exec_hdr (abfd) = &rawptr->e;
247 obj_textsec (abfd) = (asection *) NULL;
248 obj_datasec (abfd) = (asection *) NULL;
249 obj_bsssec (abfd) = (asection *) NULL;
286 b_out_write_object_contents (abfd)
287 bfd *abfd;
292 if (! aout_32_make_sections (abfd))
295 exec_hdr (abfd)->a_info = BMAGIC;
297 exec_hdr (abfd)->a_text = obj_textsec (abfd)->size;
298 exec_hdr (abfd)->a_data = obj_datasec (abfd)->size;
299 exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->size;
300 exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) * sizeof (struct nlist);
301 exec_hdr (abfd)->a_entry = bfd_get_start_address (abfd);
302 exec_hdr (abfd)->a_trsize = ((obj_textsec (abfd)->reloc_count) *
304 exec_hdr (abfd)->a_drsize = ((obj_datasec (abfd)->reloc_count) *
307 exec_hdr (abfd)->a_talign = obj_textsec (abfd)->alignment_power;
308 exec_hdr (abfd)->a_dalign = obj_datasec (abfd)->alignment_power;
309 exec_hdr (abfd)->a_balign = obj_bsssec (abfd)->alignment_power;
311 exec_hdr (abfd)->a_tload = obj_textsec (abfd)->vma;
312 exec_hdr (abfd)->a_dload = obj_datasec (abfd)->vma;
314 bout_swap_exec_header_out (abfd, exec_hdr (abfd), &swapped_hdr);
317 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
318 || bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt)
322 if (bfd_get_symcount (abfd) != 0)
331 outsyms = bfd_get_outsymbols (abfd);
332 p = outsyms + bfd_get_symcount (abfd);
349 if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
353 if (! aout_32_write_syms (abfd))
356 if (bfd_seek (abfd, (file_ptr) (N_TROFF(*exec_hdr(abfd))), SEEK_SET)
360 if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd)))
362 if (bfd_seek (abfd, (file_ptr) (N_DROFF(*exec_hdr(abfd))), SEEK_SET)
366 if (!b_out_squirt_out_relocs (abfd, obj_datasec (abfd)))
388 calljx_callback (abfd, link_info, reloc_entry, src, dst, input_section)
389 bfd *abfd;
396 int word = bfd_get_32 (abfd, src);
406 int inst = bfd_get_32 (abfd, (bfd_byte *) src-4);
411 bfd_put_32 (abfd, (bfd_vma) inst, (bfd_byte *) dst-4);
419 bfd_put_32 (abfd, (bfd_vma) word, dst);
426 callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
428 bfd *abfd;
437 int word = bfd_get_32 (abfd, (bfd_byte *) data + srcidx);
484 bfd_put_32 (abfd, (bfd_vma) word, (bfd_byte *) data + dstidx);
532 b_out_bfd_reloc_type_lookup (abfd, code)
533 bfd *abfd ATTRIBUTE_UNUSED;
553 b_out_slurp_reloc_table (abfd, asect, symbols)
554 bfd *abfd;
573 if (!aout_32_slurp_symbol_table (abfd))
576 if (asect == obj_datasec (abfd))
578 reloc_size = exec_hdr(abfd)->a_drsize;
582 if (asect == obj_textsec (abfd))
584 reloc_size = exec_hdr(abfd)->a_trsize;
588 if (asect == obj_bsssec (abfd))
598 if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
615 if (bfd_bread ((PTR) relocs, reloc_size, abfd) != reloc_size)
623 if (bfd_header_big_endian (abfd))
651 cache_ptr->address = H_GET_32 (abfd, raw + 0);
654 if (bfd_header_big_endian (abfd))
688 cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr;
689 cache_ptr->addend = - obj_textsec (abfd)->vma;
693 cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr;
694 cache_ptr->addend = - obj_datasec (abfd)->vma;
698 cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr;
699 cache_ptr->addend = - obj_bsssec (abfd)->vma;
703 cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr;
779 b_out_squirt_out_relocs (abfd, section)
780 bfd *abfd;
802 if (bfd_header_big_endian (abfd))
830 H_PUT_32 (abfd, g->address, raw);
885 if (bfd_header_big_endian (abfd))
902 if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize)
916 b_out_canonicalize_reloc (abfd, section, relptr, symbols)
917 bfd *abfd;
938 && ! b_out_slurp_reloc_table (abfd, section, symbols))
952 b_out_get_reloc_upper_bound (abfd, asect)
953 bfd *abfd;
956 if (bfd_get_format (abfd) != bfd_object)
965 if (asect == obj_datasec (abfd))
967 ((exec_hdr(abfd)->a_drsize / sizeof (struct relocation_info))
970 if (asect == obj_textsec (abfd))
972 ((exec_hdr(abfd)->a_trsize / sizeof (struct relocation_info))
975 if (asect == obj_bsssec (abfd))
985 b_out_set_section_contents (abfd, section, location, offset, count)
986 bfd *abfd;
992 if (! abfd->output_has_begun)
995 if (! aout_32_make_sections (abfd))
998 obj_textsec (abfd)->filepos = sizeof (struct internal_exec);
999 obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos
1000 + obj_textsec (abfd)->size;
1004 if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0)
1010 return bfd_bwrite ((PTR) location, count, abfd) == count;
1014 b_out_set_arch_mach (abfd, arch, machine)
1015 bfd *abfd;
1019 bfd_default_set_arch_mach(abfd, arch, machine);
1107 perform_slip (abfd, slip, input_section, value)
1108 bfd *abfd;
1115 s = _bfd_generic_link_get_symbols (abfd);
1151 abs32code (abfd, input_section, r, shrink, link_info)
1152 bfd *abfd;
1177 perform_slip (abfd, 4, input_section, r->address-shrink + 4);
1184 aligncode (abfd, input_section, r, shrink)
1185 bfd *abfd;
1222 perform_slip (abfd, shrink_delta, input_section, r->address - shrink);
1230 b_out_bfd_relax_section (abfd, i, link_info, again)
1231 bfd *abfd;
1277 shrink = aligncode (abfd, input_section, r, shrink);