Lines Matching refs:abfd

55 #define nlm_swap_fixed_header_in(abfd,src,dst) \  argument
56 (nlm_swap_fixed_header_in_func (abfd)) (abfd, src, dst)
57 #define nlm_swap_fixed_header_out(abfd,src,dst) \ argument
58 (nlm_swap_fixed_header_out_func (abfd)) (abfd, src, dst)
75 nlm_swap_variable_header_in (bfd *abfd) in nlm_swap_variable_header_in() argument
81 amt = sizeof (nlm_variable_header (abfd)->descriptionLength); in nlm_swap_variable_header_in()
82 if (bfd_bread ((void *) &nlm_variable_header (abfd)->descriptionLength, in nlm_swap_variable_header_in()
83 amt, abfd) != amt) in nlm_swap_variable_header_in()
85 amt = nlm_variable_header (abfd)->descriptionLength + 1; in nlm_swap_variable_header_in()
86 if (bfd_bread ((void *) nlm_variable_header (abfd)->descriptionText, in nlm_swap_variable_header_in()
87 amt, abfd) != amt) in nlm_swap_variable_header_in()
92 if (bfd_bread ((void *) temp, amt, abfd) != amt) in nlm_swap_variable_header_in()
94 nlm_variable_header (abfd)->stackSize = get_word (abfd, (bfd_byte *) temp); in nlm_swap_variable_header_in()
98 if (bfd_bread ((void *) temp, amt, abfd) != amt) in nlm_swap_variable_header_in()
100 nlm_variable_header (abfd)->reserved = get_word (abfd, (bfd_byte *) temp); in nlm_swap_variable_header_in()
103 amt = sizeof (nlm_variable_header (abfd)->oldThreadName); in nlm_swap_variable_header_in()
104 if (bfd_bread ((void *) nlm_variable_header (abfd)->oldThreadName, in nlm_swap_variable_header_in()
105 amt, abfd) != amt) in nlm_swap_variable_header_in()
109 amt = sizeof (nlm_variable_header (abfd)->screenNameLength); in nlm_swap_variable_header_in()
110 if (bfd_bread ((void *) & nlm_variable_header (abfd)->screenNameLength, in nlm_swap_variable_header_in()
111 amt, abfd) != amt) in nlm_swap_variable_header_in()
113 amt = nlm_variable_header (abfd)->screenNameLength + 1; in nlm_swap_variable_header_in()
114 if (bfd_bread ((void *) nlm_variable_header (abfd)->screenName, in nlm_swap_variable_header_in()
115 amt, abfd) != amt) in nlm_swap_variable_header_in()
119 amt = sizeof (nlm_variable_header (abfd)->threadNameLength); in nlm_swap_variable_header_in()
120 if (bfd_bread ((void *) & nlm_variable_header (abfd)->threadNameLength, in nlm_swap_variable_header_in()
121 amt, abfd) != amt) in nlm_swap_variable_header_in()
123 amt = nlm_variable_header (abfd)->threadNameLength + 1; in nlm_swap_variable_header_in()
124 if (bfd_bread ((void *) nlm_variable_header (abfd)->threadName, in nlm_swap_variable_header_in()
125 amt, abfd) != amt) in nlm_swap_variable_header_in()
133 add_bfd_section (bfd *abfd, in add_bfd_section() argument
141 newsect = bfd_make_section (abfd, name); in add_bfd_section()
164 nlm_swap_auxiliary_headers_in (bfd *abfd) in nlm_swap_auxiliary_headers_in() argument
172 position = bfd_tell (abfd); in nlm_swap_auxiliary_headers_in()
174 if (bfd_bread ((void *) tempstr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
176 if (bfd_seek (abfd, position, SEEK_SET) != 0) in nlm_swap_auxiliary_headers_in()
183 if (bfd_bread ((void *) &thdr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
185 memcpy (nlm_version_header (abfd)->stamp, thdr.stamp, in nlm_swap_auxiliary_headers_in()
187 nlm_version_header (abfd)->majorVersion = in nlm_swap_auxiliary_headers_in()
188 get_word (abfd, (bfd_byte *) thdr.majorVersion); in nlm_swap_auxiliary_headers_in()
189 nlm_version_header (abfd)->minorVersion = in nlm_swap_auxiliary_headers_in()
190 get_word (abfd, (bfd_byte *) thdr.minorVersion); in nlm_swap_auxiliary_headers_in()
191 nlm_version_header (abfd)->revision = in nlm_swap_auxiliary_headers_in()
192 get_word (abfd, (bfd_byte *) thdr.revision); in nlm_swap_auxiliary_headers_in()
193 nlm_version_header (abfd)->year = in nlm_swap_auxiliary_headers_in()
194 get_word (abfd, (bfd_byte *) thdr.year); in nlm_swap_auxiliary_headers_in()
195 nlm_version_header (abfd)->month = in nlm_swap_auxiliary_headers_in()
196 get_word (abfd, (bfd_byte *) thdr.month); in nlm_swap_auxiliary_headers_in()
197 nlm_version_header (abfd)->day = in nlm_swap_auxiliary_headers_in()
198 get_word (abfd, (bfd_byte *) thdr.day); in nlm_swap_auxiliary_headers_in()
205 if (bfd_bread ((void *) &thdr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
207 memcpy (nlm_extended_header (abfd)->stamp, thdr.stamp, in nlm_swap_auxiliary_headers_in()
209 nlm_extended_header (abfd)->languageID = in nlm_swap_auxiliary_headers_in()
210 get_word (abfd, (bfd_byte *) thdr.languageID); in nlm_swap_auxiliary_headers_in()
211 nlm_extended_header (abfd)->messageFileOffset = in nlm_swap_auxiliary_headers_in()
212 get_word (abfd, (bfd_byte *) thdr.messageFileOffset); in nlm_swap_auxiliary_headers_in()
213 nlm_extended_header (abfd)->messageFileLength = in nlm_swap_auxiliary_headers_in()
214 get_word (abfd, (bfd_byte *) thdr.messageFileLength); in nlm_swap_auxiliary_headers_in()
215 nlm_extended_header (abfd)->messageCount = in nlm_swap_auxiliary_headers_in()
216 get_word (abfd, (bfd_byte *) thdr.messageCount); in nlm_swap_auxiliary_headers_in()
217 nlm_extended_header (abfd)->helpFileOffset = in nlm_swap_auxiliary_headers_in()
218 get_word (abfd, (bfd_byte *) thdr.helpFileOffset); in nlm_swap_auxiliary_headers_in()
219 nlm_extended_header (abfd)->helpFileLength = in nlm_swap_auxiliary_headers_in()
220 get_word (abfd, (bfd_byte *) thdr.helpFileLength); in nlm_swap_auxiliary_headers_in()
221 nlm_extended_header (abfd)->RPCDataOffset = in nlm_swap_auxiliary_headers_in()
222 get_word (abfd, (bfd_byte *) thdr.RPCDataOffset); in nlm_swap_auxiliary_headers_in()
223 nlm_extended_header (abfd)->RPCDataLength = in nlm_swap_auxiliary_headers_in()
224 get_word (abfd, (bfd_byte *) thdr.RPCDataLength); in nlm_swap_auxiliary_headers_in()
225 nlm_extended_header (abfd)->sharedCodeOffset = in nlm_swap_auxiliary_headers_in()
226 get_word (abfd, (bfd_byte *) thdr.sharedCodeOffset); in nlm_swap_auxiliary_headers_in()
227 nlm_extended_header (abfd)->sharedCodeLength = in nlm_swap_auxiliary_headers_in()
228 get_word (abfd, (bfd_byte *) thdr.sharedCodeLength); in nlm_swap_auxiliary_headers_in()
229 nlm_extended_header (abfd)->sharedDataOffset = in nlm_swap_auxiliary_headers_in()
230 get_word (abfd, (bfd_byte *) thdr.sharedDataOffset); in nlm_swap_auxiliary_headers_in()
231 nlm_extended_header (abfd)->sharedDataLength = in nlm_swap_auxiliary_headers_in()
232 get_word (abfd, (bfd_byte *) thdr.sharedDataLength); in nlm_swap_auxiliary_headers_in()
233 nlm_extended_header (abfd)->sharedRelocationFixupOffset = in nlm_swap_auxiliary_headers_in()
234 get_word (abfd, (bfd_byte *) thdr.sharedRelocationFixupOffset); in nlm_swap_auxiliary_headers_in()
235 nlm_extended_header (abfd)->sharedRelocationFixupCount = in nlm_swap_auxiliary_headers_in()
236 get_word (abfd, (bfd_byte *) thdr.sharedRelocationFixupCount); in nlm_swap_auxiliary_headers_in()
237 nlm_extended_header (abfd)->sharedExternalReferenceOffset = in nlm_swap_auxiliary_headers_in()
238 get_word (abfd, (bfd_byte *) thdr.sharedExternalReferenceOffset); in nlm_swap_auxiliary_headers_in()
239 nlm_extended_header (abfd)->sharedExternalReferenceCount = in nlm_swap_auxiliary_headers_in()
240 get_word (abfd, (bfd_byte *) thdr.sharedExternalReferenceCount); in nlm_swap_auxiliary_headers_in()
241 nlm_extended_header (abfd)->sharedPublicsOffset = in nlm_swap_auxiliary_headers_in()
242 get_word (abfd, (bfd_byte *) thdr.sharedPublicsOffset); in nlm_swap_auxiliary_headers_in()
243 nlm_extended_header (abfd)->sharedPublicsCount = in nlm_swap_auxiliary_headers_in()
244 get_word (abfd, (bfd_byte *) thdr.sharedPublicsCount); in nlm_swap_auxiliary_headers_in()
245 nlm_extended_header (abfd)->sharedDebugRecordOffset = in nlm_swap_auxiliary_headers_in()
246 get_word (abfd, (bfd_byte *) thdr.sharedDebugRecordOffset); in nlm_swap_auxiliary_headers_in()
247 nlm_extended_header (abfd)->sharedDebugRecordCount = in nlm_swap_auxiliary_headers_in()
248 get_word (abfd, (bfd_byte *) thdr.sharedDebugRecordCount); in nlm_swap_auxiliary_headers_in()
249 nlm_extended_header (abfd)->SharedInitializationOffset = in nlm_swap_auxiliary_headers_in()
250 get_word (abfd, (bfd_byte *) thdr.sharedInitializationOffset); in nlm_swap_auxiliary_headers_in()
251 nlm_extended_header (abfd)->SharedExitProcedureOffset = in nlm_swap_auxiliary_headers_in()
252 get_word (abfd, (bfd_byte *) thdr.SharedExitProcedureOffset); in nlm_swap_auxiliary_headers_in()
253 nlm_extended_header (abfd)->productID = in nlm_swap_auxiliary_headers_in()
254 get_word (abfd, (bfd_byte *) thdr.productID); in nlm_swap_auxiliary_headers_in()
255 nlm_extended_header (abfd)->reserved0 = in nlm_swap_auxiliary_headers_in()
256 get_word (abfd, (bfd_byte *) thdr.reserved0); in nlm_swap_auxiliary_headers_in()
257 nlm_extended_header (abfd)->reserved1 = in nlm_swap_auxiliary_headers_in()
258 get_word (abfd, (bfd_byte *) thdr.reserved1); in nlm_swap_auxiliary_headers_in()
259 nlm_extended_header (abfd)->reserved2 = in nlm_swap_auxiliary_headers_in()
260 get_word (abfd, (bfd_byte *) thdr.reserved2); in nlm_swap_auxiliary_headers_in()
261 nlm_extended_header (abfd)->reserved3 = in nlm_swap_auxiliary_headers_in()
262 get_word (abfd, (bfd_byte *) thdr.reserved3); in nlm_swap_auxiliary_headers_in()
263 nlm_extended_header (abfd)->reserved4 = in nlm_swap_auxiliary_headers_in()
264 get_word (abfd, (bfd_byte *) thdr.reserved4); in nlm_swap_auxiliary_headers_in()
265 nlm_extended_header (abfd)->reserved5 = in nlm_swap_auxiliary_headers_in()
266 get_word (abfd, (bfd_byte *) thdr.reserved5); in nlm_swap_auxiliary_headers_in()
270 amt = sizeof (nlm_copyright_header (abfd)->stamp); in nlm_swap_auxiliary_headers_in()
271 if (bfd_bread ((void *) nlm_copyright_header (abfd)->stamp, in nlm_swap_auxiliary_headers_in()
272 amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
274 if (bfd_bread ((void *) &(nlm_copyright_header (abfd) in nlm_swap_auxiliary_headers_in()
276 (bfd_size_type) 1, abfd) != 1) in nlm_swap_auxiliary_headers_in()
279 amt = nlm_copyright_header (abfd)->copyrightMessageLength + 1; in nlm_swap_auxiliary_headers_in()
280 if (bfd_bread ((void *) nlm_copyright_header (abfd)->copyrightMessage, in nlm_swap_auxiliary_headers_in()
281 amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
295 if (bfd_bread ((void *) thdr.stamp, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
299 if (bfd_bread ((void *) thdr.length, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
301 hdrLength = get_word (abfd, (bfd_byte *) thdr.length); in nlm_swap_auxiliary_headers_in()
308 if (bfd_bread ((void *) thdr.dataOffset, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
310 dataOffset = get_word (abfd, (bfd_byte *) thdr.dataOffset); in nlm_swap_auxiliary_headers_in()
317 if (bfd_bread ((void *) thdr.dataLength, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
319 dataLength = get_word (abfd, (bfd_byte *) thdr.dataLength); in nlm_swap_auxiliary_headers_in()
326 if (bfd_bread ((void *) dataStamp, amt, abfd) != amt) in nlm_swap_auxiliary_headers_in()
339 hdr = bfd_alloc (abfd, hdrLength); in nlm_swap_auxiliary_headers_in()
342 if (bfd_bread (hdr, hdrLength, abfd) != hdrLength) in nlm_swap_auxiliary_headers_in()
357 pos = bfd_tell (abfd); in nlm_swap_auxiliary_headers_in()
358 if (bfd_seek (abfd, dataOffset, SEEK_SET) != 0) in nlm_swap_auxiliary_headers_in()
360 contents = bfd_alloc (abfd, dataLength); in nlm_swap_auxiliary_headers_in()
363 if (bfd_bread (contents, dataLength, abfd) != dataLength) in nlm_swap_auxiliary_headers_in()
365 if (bfd_seek (abfd, pos, SEEK_SET) != 0) in nlm_swap_auxiliary_headers_in()
368 memcpy (nlm_cygnus_ext_header (abfd), "CyGnUsEx", 8); in nlm_swap_auxiliary_headers_in()
369 nlm_cygnus_ext_header (abfd)->offset = dataOffset; in nlm_swap_auxiliary_headers_in()
370 nlm_cygnus_ext_header (abfd)->length = dataLength; in nlm_swap_auxiliary_headers_in()
402 filepos = H_GET_32 (abfd, p); in nlm_swap_auxiliary_headers_in()
404 size = H_GET_32 (abfd, p); in nlm_swap_auxiliary_headers_in()
407 newsec = bfd_make_section_anyway (abfd, name); in nlm_swap_auxiliary_headers_in()
420 memcpy (nlm_custom_header (abfd)->stamp, thdr.stamp, in nlm_swap_auxiliary_headers_in()
422 nlm_custom_header (abfd)->hdrLength = hdrLength; in nlm_swap_auxiliary_headers_in()
423 nlm_custom_header (abfd)->dataOffset = dataOffset; in nlm_swap_auxiliary_headers_in()
424 nlm_custom_header (abfd)->dataLength = dataLength; in nlm_swap_auxiliary_headers_in()
425 memcpy (nlm_custom_header (abfd)->dataStamp, dataStamp, in nlm_swap_auxiliary_headers_in()
427 nlm_custom_header (abfd)->hdr = hdr; in nlm_swap_auxiliary_headers_in()
437 nlm_object_p (bfd *abfd) in nlm_object_p() argument
439 struct nlm_obj_tdata *preserved_tdata = nlm_tdata (abfd); in nlm_object_p()
450 backend_object_p = nlm_backend_object_p_func (abfd); in nlm_object_p()
453 if (!(*backend_object_p) (abfd)) in nlm_object_p()
458 amt = nlm_fixed_header_size (abfd); in nlm_object_p()
463 if (bfd_bread ((void *) x_fxdhdr, amt, abfd) != amt) in nlm_object_p()
474 new_tdata = bfd_zalloc (abfd, amt); in nlm_object_p()
478 nlm_tdata (abfd) = new_tdata; in nlm_object_p()
480 i_fxdhdrp = nlm_fixed_header (abfd); in nlm_object_p()
481 nlm_swap_fixed_header_in (abfd, x_fxdhdr, i_fxdhdrp); in nlm_object_p()
487 signature = nlm_signature (abfd); in nlm_object_p()
503 if (!nlm_swap_variable_header_in (abfd)) in nlm_object_p()
516 if (!add_bfd_section (abfd, NLM_CODE_NAME, in nlm_object_p()
521 || !add_bfd_section (abfd, NLM_INITIALIZED_DATA_NAME, in nlm_object_p()
526 || !add_bfd_section (abfd, NLM_UNINITIALIZED_DATA_NAME, in nlm_object_p()
532 if (!nlm_swap_auxiliary_headers_in (abfd)) in nlm_object_p()
535 if (nlm_fixed_header (abfd)->numberOfRelocationFixups != 0 in nlm_object_p()
536 || nlm_fixed_header (abfd)->numberOfExternalReferences != 0) in nlm_object_p()
537 abfd->flags |= HAS_RELOC; in nlm_object_p()
538 if (nlm_fixed_header (abfd)->numberOfPublics != 0 in nlm_object_p()
539 || nlm_fixed_header (abfd)->numberOfDebugRecords != 0 in nlm_object_p()
540 || nlm_fixed_header (abfd)->numberOfExternalReferences != 0) in nlm_object_p()
541 abfd->flags |= HAS_SYMS; in nlm_object_p()
543 arch = nlm_architecture (abfd); in nlm_object_p()
545 bfd_default_set_arch_mach (abfd, arch, (unsigned long) 0); in nlm_object_p()
547 abfd->flags |= EXEC_P; in nlm_object_p()
548 bfd_get_start_address (abfd) = nlm_fixed_header (abfd)->codeStartOffset; in nlm_object_p()
550 return abfd->xvec; in nlm_object_p()
555 nlm_tdata (abfd) = preserved_tdata; in nlm_object_p()
557 bfd_release (abfd, new_tdata); in nlm_object_p()
568 nlm_swap_variable_header_out (bfd *abfd) in nlm_swap_variable_header_out() argument
574 amt = sizeof (nlm_variable_header (abfd)->descriptionLength); in nlm_swap_variable_header_out()
575 if (bfd_bwrite (& nlm_variable_header (abfd)->descriptionLength, amt, in nlm_swap_variable_header_out()
576 abfd) != amt) in nlm_swap_variable_header_out()
578 amt = nlm_variable_header (abfd)->descriptionLength + 1; in nlm_swap_variable_header_out()
579 if (bfd_bwrite ((void *) nlm_variable_header (abfd)->descriptionText, amt, in nlm_swap_variable_header_out()
580 abfd) != amt) in nlm_swap_variable_header_out()
584 put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->stackSize, temp); in nlm_swap_variable_header_out()
586 if (bfd_bwrite (temp, amt, abfd) != amt) in nlm_swap_variable_header_out()
590 put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->reserved, temp); in nlm_swap_variable_header_out()
592 if (bfd_bwrite (temp, amt, abfd) != amt) in nlm_swap_variable_header_out()
596 amt = sizeof (nlm_variable_header (abfd)->oldThreadName); in nlm_swap_variable_header_out()
597 if (bfd_bwrite (nlm_variable_header (abfd)->oldThreadName, amt, in nlm_swap_variable_header_out()
598 abfd) != amt) in nlm_swap_variable_header_out()
602 amt = sizeof (nlm_variable_header (abfd)->screenNameLength); in nlm_swap_variable_header_out()
603 if (bfd_bwrite (& nlm_variable_header (abfd)->screenNameLength, amt, in nlm_swap_variable_header_out()
604 abfd) != amt) in nlm_swap_variable_header_out()
606 amt = nlm_variable_header (abfd)->screenNameLength + 1; in nlm_swap_variable_header_out()
607 if (bfd_bwrite (nlm_variable_header (abfd)->screenName, amt, abfd) != amt) in nlm_swap_variable_header_out()
611 amt = sizeof (nlm_variable_header (abfd)->threadNameLength); in nlm_swap_variable_header_out()
612 if (bfd_bwrite (& nlm_variable_header (abfd)->threadNameLength, amt, in nlm_swap_variable_header_out()
613 abfd) != amt) in nlm_swap_variable_header_out()
615 amt = nlm_variable_header (abfd)->threadNameLength + 1; in nlm_swap_variable_header_out()
616 if (bfd_bwrite (nlm_variable_header (abfd)->threadName, amt, abfd) != amt) in nlm_swap_variable_header_out()
639 nlm_swap_auxiliary_headers_out (bfd *abfd) in nlm_swap_auxiliary_headers_out() argument
644 if (find_nonzero (nlm_version_header (abfd), in nlm_swap_auxiliary_headers_out()
650 put_word (abfd, (bfd_vma) nlm_version_header (abfd)->majorVersion, in nlm_swap_auxiliary_headers_out()
652 put_word (abfd, (bfd_vma) nlm_version_header (abfd)->minorVersion, in nlm_swap_auxiliary_headers_out()
654 put_word (abfd, (bfd_vma) nlm_version_header (abfd)->revision, in nlm_swap_auxiliary_headers_out()
656 put_word (abfd, (bfd_vma) nlm_version_header (abfd)->year, in nlm_swap_auxiliary_headers_out()
658 put_word (abfd, (bfd_vma) nlm_version_header (abfd)->month, in nlm_swap_auxiliary_headers_out()
660 put_word (abfd, (bfd_vma) nlm_version_header (abfd)->day, in nlm_swap_auxiliary_headers_out()
662 if (bfd_bwrite ((void *) &thdr, (bfd_size_type) sizeof (thdr), abfd) in nlm_swap_auxiliary_headers_out()
671 if (find_nonzero (nlm_copyright_header (abfd), in nlm_swap_auxiliary_headers_out()
678 if (bfd_bwrite ((void *) thdr.stamp, amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
681 nlm_copyright_header (abfd)->copyrightMessageLength; in nlm_swap_auxiliary_headers_out()
683 if (bfd_bwrite ((void *) thdr.copyrightMessageLength, amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
686 amt = nlm_copyright_header (abfd)->copyrightMessageLength + 1; in nlm_swap_auxiliary_headers_out()
687 if (bfd_bwrite ((void *) nlm_copyright_header (abfd)->copyrightMessage, in nlm_swap_auxiliary_headers_out()
688 amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
693 if (find_nonzero (nlm_extended_header (abfd), in nlm_swap_auxiliary_headers_out()
699 put_word (abfd, in nlm_swap_auxiliary_headers_out()
700 (bfd_vma) nlm_extended_header (abfd)->languageID, in nlm_swap_auxiliary_headers_out()
702 put_word (abfd, in nlm_swap_auxiliary_headers_out()
703 (bfd_vma) nlm_extended_header (abfd)->messageFileOffset, in nlm_swap_auxiliary_headers_out()
705 put_word (abfd, in nlm_swap_auxiliary_headers_out()
706 (bfd_vma) nlm_extended_header (abfd)->messageFileLength, in nlm_swap_auxiliary_headers_out()
708 put_word (abfd, in nlm_swap_auxiliary_headers_out()
709 (bfd_vma) nlm_extended_header (abfd)->messageCount, in nlm_swap_auxiliary_headers_out()
711 put_word (abfd, in nlm_swap_auxiliary_headers_out()
712 (bfd_vma) nlm_extended_header (abfd)->helpFileOffset, in nlm_swap_auxiliary_headers_out()
714 put_word (abfd, in nlm_swap_auxiliary_headers_out()
715 (bfd_vma) nlm_extended_header (abfd)->helpFileLength, in nlm_swap_auxiliary_headers_out()
717 put_word (abfd, in nlm_swap_auxiliary_headers_out()
718 (bfd_vma) nlm_extended_header (abfd)->RPCDataOffset, in nlm_swap_auxiliary_headers_out()
720 put_word (abfd, in nlm_swap_auxiliary_headers_out()
721 (bfd_vma) nlm_extended_header (abfd)->RPCDataLength, in nlm_swap_auxiliary_headers_out()
723 put_word (abfd, in nlm_swap_auxiliary_headers_out()
724 (bfd_vma) nlm_extended_header (abfd)->sharedCodeOffset, in nlm_swap_auxiliary_headers_out()
726 put_word (abfd, in nlm_swap_auxiliary_headers_out()
727 (bfd_vma) nlm_extended_header (abfd)->sharedCodeLength, in nlm_swap_auxiliary_headers_out()
729 put_word (abfd, in nlm_swap_auxiliary_headers_out()
730 (bfd_vma) nlm_extended_header (abfd)->sharedDataOffset, in nlm_swap_auxiliary_headers_out()
732 put_word (abfd, in nlm_swap_auxiliary_headers_out()
733 (bfd_vma) nlm_extended_header (abfd)->sharedDataLength, in nlm_swap_auxiliary_headers_out()
735 put_word (abfd, in nlm_swap_auxiliary_headers_out()
736 (bfd_vma) nlm_extended_header (abfd)->sharedRelocationFixupOffset, in nlm_swap_auxiliary_headers_out()
738 put_word (abfd, in nlm_swap_auxiliary_headers_out()
739 (bfd_vma) nlm_extended_header (abfd)->sharedRelocationFixupCount, in nlm_swap_auxiliary_headers_out()
741 put_word (abfd, in nlm_swap_auxiliary_headers_out()
742 (bfd_vma) nlm_extended_header (abfd)->sharedExternalReferenceOffset, in nlm_swap_auxiliary_headers_out()
744 put_word (abfd, in nlm_swap_auxiliary_headers_out()
745 (bfd_vma) nlm_extended_header (abfd)->sharedExternalReferenceCount, in nlm_swap_auxiliary_headers_out()
747 put_word (abfd, in nlm_swap_auxiliary_headers_out()
748 (bfd_vma) nlm_extended_header (abfd)->sharedPublicsOffset, in nlm_swap_auxiliary_headers_out()
750 put_word (abfd, in nlm_swap_auxiliary_headers_out()
751 (bfd_vma) nlm_extended_header (abfd)->sharedPublicsCount, in nlm_swap_auxiliary_headers_out()
753 put_word (abfd, in nlm_swap_auxiliary_headers_out()
754 (bfd_vma) nlm_extended_header (abfd)->sharedDebugRecordOffset, in nlm_swap_auxiliary_headers_out()
756 put_word (abfd, in nlm_swap_auxiliary_headers_out()
757 (bfd_vma) nlm_extended_header (abfd)->sharedDebugRecordCount, in nlm_swap_auxiliary_headers_out()
759 put_word (abfd, in nlm_swap_auxiliary_headers_out()
760 (bfd_vma) nlm_extended_header (abfd)->SharedInitializationOffset, in nlm_swap_auxiliary_headers_out()
762 put_word (abfd, in nlm_swap_auxiliary_headers_out()
763 (bfd_vma) nlm_extended_header (abfd)->SharedExitProcedureOffset, in nlm_swap_auxiliary_headers_out()
765 put_word (abfd, in nlm_swap_auxiliary_headers_out()
766 (bfd_vma) nlm_extended_header (abfd)->productID, in nlm_swap_auxiliary_headers_out()
768 put_word (abfd, in nlm_swap_auxiliary_headers_out()
769 (bfd_vma) nlm_extended_header (abfd)->reserved0, in nlm_swap_auxiliary_headers_out()
771 put_word (abfd, in nlm_swap_auxiliary_headers_out()
772 (bfd_vma) nlm_extended_header (abfd)->reserved1, in nlm_swap_auxiliary_headers_out()
774 put_word (abfd, in nlm_swap_auxiliary_headers_out()
775 (bfd_vma) nlm_extended_header (abfd)->reserved2, in nlm_swap_auxiliary_headers_out()
777 put_word (abfd, in nlm_swap_auxiliary_headers_out()
778 (bfd_vma) nlm_extended_header (abfd)->reserved3, in nlm_swap_auxiliary_headers_out()
780 put_word (abfd, in nlm_swap_auxiliary_headers_out()
781 (bfd_vma) nlm_extended_header (abfd)->reserved4, in nlm_swap_auxiliary_headers_out()
783 put_word (abfd, in nlm_swap_auxiliary_headers_out()
784 (bfd_vma) nlm_extended_header (abfd)->reserved5, in nlm_swap_auxiliary_headers_out()
786 if (bfd_bwrite ((void *) &thdr, (bfd_size_type) sizeof (thdr), abfd) in nlm_swap_auxiliary_headers_out()
792 if (find_nonzero (nlm_custom_header (abfd), in nlm_swap_auxiliary_headers_out()
799 ds = find_nonzero (nlm_custom_header (abfd)->dataStamp, in nlm_swap_auxiliary_headers_out()
800 sizeof (nlm_custom_header (abfd)->dataStamp)); in nlm_swap_auxiliary_headers_out()
803 + nlm_custom_header (abfd)->hdrLength); in nlm_swap_auxiliary_headers_out()
804 put_word (abfd, hdrLength, thdr.length); in nlm_swap_auxiliary_headers_out()
805 put_word (abfd, (bfd_vma) nlm_custom_header (abfd)->dataOffset, in nlm_swap_auxiliary_headers_out()
807 put_word (abfd, (bfd_vma) nlm_custom_header (abfd)->dataLength, in nlm_swap_auxiliary_headers_out()
811 BFD_ASSERT (nlm_custom_header (abfd)->hdrLength == 0); in nlm_swap_auxiliary_headers_out()
813 if (bfd_bwrite ((void *) &thdr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
818 memcpy (thdr.dataStamp, nlm_custom_header (abfd)->dataStamp, in nlm_swap_auxiliary_headers_out()
821 if (bfd_bwrite ((void *) &thdr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
823 amt = nlm_custom_header (abfd)->hdrLength; in nlm_swap_auxiliary_headers_out()
824 if (bfd_bwrite (nlm_custom_header (abfd)->hdr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
830 if (find_nonzero (nlm_cygnus_ext_header (abfd), in nlm_swap_auxiliary_headers_out()
836 put_word (abfd, (bfd_vma) 2 * NLM_TARGET_LONG_SIZE + 8, in nlm_swap_auxiliary_headers_out()
838 put_word (abfd, (bfd_vma) nlm_cygnus_ext_header (abfd)->offset, in nlm_swap_auxiliary_headers_out()
840 put_word (abfd, (bfd_vma) nlm_cygnus_ext_header (abfd)->length, in nlm_swap_auxiliary_headers_out()
844 if (bfd_bwrite ((void *) &thdr, amt, abfd) != amt) in nlm_swap_auxiliary_headers_out()
861 nlm_get_symtab_upper_bound (bfd *abfd) in nlm_get_symtab_upper_bound() argument
867 i_fxdhdrp = nlm_fixed_header (abfd); in nlm_get_symtab_upper_bound()
895 nlm_slurp_symbol_table (bfd *abfd) in nlm_slurp_symbol_table() argument
908 if (nlm_get_symbols (abfd) != NULL) in nlm_slurp_symbol_table()
919 abfd->symcount = 0; in nlm_slurp_symbol_table()
920 i_fxdhdrp = nlm_fixed_header (abfd); in nlm_slurp_symbol_table()
927 if (bfd_seek (abfd, i_fxdhdrp->publicsOffset, SEEK_SET) != 0) in nlm_slurp_symbol_table()
931 sym = bfd_zalloc (abfd, amt); in nlm_slurp_symbol_table()
934 nlm_set_symbols (abfd, sym); in nlm_slurp_symbol_table()
940 set_public_section_func = nlm_set_public_section_func (abfd); in nlm_slurp_symbol_table()
942 while (abfd->symcount < symcount) in nlm_slurp_symbol_table()
945 if (bfd_bread ((void *) &symlength, amt, abfd) != amt) in nlm_slurp_symbol_table()
948 sym->symbol.the_bfd = abfd; in nlm_slurp_symbol_table()
949 sym->symbol.name = bfd_alloc (abfd, amt + 1); in nlm_slurp_symbol_table()
952 if (bfd_bread ((void *) sym->symbol.name, amt, abfd) != amt) in nlm_slurp_symbol_table()
957 if (bfd_bread ((void *) temp, amt, abfd) != amt) in nlm_slurp_symbol_table()
960 sym->symbol.value = get_word (abfd, temp); in nlm_slurp_symbol_table()
965 if (! (*set_public_section_func) (abfd, sym)) in nlm_slurp_symbol_table()
975 bfd_get_section_by_name (abfd, NLM_CODE_NAME); in nlm_slurp_symbol_table()
979 bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME); in nlm_slurp_symbol_table()
982 abfd->symcount++; in nlm_slurp_symbol_table()
990 if (bfd_seek (abfd, i_fxdhdrp->debugInfoOffset, SEEK_SET) != 0) in nlm_slurp_symbol_table()
994 while (abfd->symcount < symcount) in nlm_slurp_symbol_table()
997 if (bfd_bread ((void *) &symtype, amt, abfd) != amt) in nlm_slurp_symbol_table()
1000 if (bfd_bread ((void *) temp, amt, abfd) != amt) in nlm_slurp_symbol_table()
1003 if (bfd_bread ((void *) &symlength, amt, abfd) != amt) in nlm_slurp_symbol_table()
1006 sym->symbol.the_bfd = abfd; in nlm_slurp_symbol_table()
1007 sym->symbol.name = bfd_alloc (abfd, amt + 1); in nlm_slurp_symbol_table()
1010 if (bfd_bread ((void *) sym->symbol.name, amt, abfd) != amt) in nlm_slurp_symbol_table()
1015 sym->symbol.value = get_word (abfd, temp); in nlm_slurp_symbol_table()
1019 bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME); in nlm_slurp_symbol_table()
1024 bfd_get_section_by_name (abfd, NLM_CODE_NAME); in nlm_slurp_symbol_table()
1030 abfd->symcount++; in nlm_slurp_symbol_table()
1037 read_import_func = nlm_read_import_func (abfd); in nlm_slurp_symbol_table()
1040 if (bfd_seek (abfd, i_fxdhdrp->externalReferencesOffset, SEEK_SET) != 0) in nlm_slurp_symbol_table()
1044 while (abfd->symcount < symcount) in nlm_slurp_symbol_table()
1046 if (! (*read_import_func) (abfd, sym)) in nlm_slurp_symbol_table()
1049 abfd->symcount++; in nlm_slurp_symbol_table()
1060 nlm_canonicalize_symtab (bfd *abfd, asymbol **alocation) in nlm_canonicalize_symtab() argument
1065 if (! nlm_slurp_symbol_table (abfd)) in nlm_canonicalize_symtab()
1067 symbase = nlm_get_symbols (abfd); in nlm_canonicalize_symtab()
1068 while (counter < bfd_get_symcount (abfd)) in nlm_canonicalize_symtab()
1075 return bfd_get_symcount (abfd); in nlm_canonicalize_symtab()
1081 nlm_make_empty_symbol (bfd *abfd) in nlm_make_empty_symbol() argument
1084 nlm_symbol_type *new = bfd_zalloc (abfd, amt); in nlm_make_empty_symbol()
1088 new->symbol.the_bfd = abfd; in nlm_make_empty_symbol()
1105 nlm_print_symbol (bfd *abfd, in nlm_print_symbol() argument
1120 bfd_print_symbol_vandf (abfd, (void *) file, symbol); in nlm_print_symbol()
1142 nlm_slurp_reloc_fixups (bfd *abfd) in nlm_slurp_reloc_fixups() argument
1149 if (nlm_relocation_fixups (abfd) != NULL) in nlm_slurp_reloc_fixups()
1151 read_func = nlm_read_reloc_func (abfd); in nlm_slurp_reloc_fixups()
1155 if (bfd_seek (abfd, nlm_fixed_header (abfd)->relocationFixupOffset, in nlm_slurp_reloc_fixups()
1159 count = nlm_fixed_header (abfd)->numberOfRelocationFixups; in nlm_slurp_reloc_fixups()
1161 rels = bfd_alloc (abfd, amt); in nlm_slurp_reloc_fixups()
1163 secs = bfd_alloc (abfd, amt); in nlm_slurp_reloc_fixups()
1166 nlm_relocation_fixups (abfd) = rels; in nlm_slurp_reloc_fixups()
1167 nlm_relocation_fixup_secs (abfd) = secs; in nlm_slurp_reloc_fixups()
1173 if (! (*read_func) (abfd, NULL, secs, rels)) in nlm_slurp_reloc_fixups()
1175 nlm_relocation_fixups (abfd) = NULL; in nlm_slurp_reloc_fixups()
1176 nlm_relocation_fixup_secs (abfd) = NULL; in nlm_slurp_reloc_fixups()
1191 nlm_get_reloc_upper_bound (bfd *abfd, asection *sec) in nlm_get_reloc_upper_bound() argument
1198 if (nlm_read_reloc_func (abfd) == NULL) in nlm_get_reloc_upper_bound()
1201 if ((bfd_get_section_flags (abfd, sec) & (SEC_CODE | SEC_DATA)) == 0) in nlm_get_reloc_upper_bound()
1204 syms = nlm_get_symbols (abfd); in nlm_get_reloc_upper_bound()
1207 if (! nlm_slurp_symbol_table (abfd)) in nlm_get_reloc_upper_bound()
1209 syms = nlm_get_symbols (abfd); in nlm_get_reloc_upper_bound()
1212 ret = nlm_fixed_header (abfd)->numberOfRelocationFixups; in nlm_get_reloc_upper_bound()
1214 count = bfd_get_symcount (abfd); in nlm_get_reloc_upper_bound()
1227 nlm_canonicalize_reloc (bfd *abfd, in nlm_canonicalize_reloc() argument
1238 rels = nlm_relocation_fixups (abfd); in nlm_canonicalize_reloc()
1241 if (! nlm_slurp_reloc_fixups (abfd)) in nlm_canonicalize_reloc()
1243 rels = nlm_relocation_fixups (abfd); in nlm_canonicalize_reloc()
1245 secs = nlm_relocation_fixup_secs (abfd); in nlm_canonicalize_reloc()
1248 count = nlm_fixed_header (abfd)->numberOfRelocationFixups; in nlm_canonicalize_reloc()
1259 count = bfd_get_symcount (abfd); in nlm_canonicalize_reloc()
1306 nlm_compute_section_file_positions (bfd *abfd) in nlm_compute_section_file_positions() argument
1317 if (abfd->output_has_begun) in nlm_compute_section_file_positions()
1321 bss_sec = bfd_get_section_by_name (abfd, NLM_UNINITIALIZED_DATA_NAME); in nlm_compute_section_file_positions()
1324 if (!add_bfd_section (abfd, NLM_UNINITIALIZED_DATA_NAME, in nlm_compute_section_file_positions()
1328 bss_sec = bfd_get_section_by_name (abfd, NLM_UNINITIALIZED_DATA_NAME); in nlm_compute_section_file_positions()
1331 abfd->output_has_begun = TRUE; in nlm_compute_section_file_positions()
1334 sofar = nlm_optional_prefix_size (abfd) + nlm_fixed_header_size (abfd); in nlm_compute_section_file_positions()
1337 sofar += (sizeof (nlm_variable_header (abfd)->descriptionLength) in nlm_compute_section_file_positions()
1338 + nlm_variable_header (abfd)->descriptionLength + 1 in nlm_compute_section_file_positions()
1341 + sizeof (nlm_variable_header (abfd)->oldThreadName) in nlm_compute_section_file_positions()
1342 + sizeof (nlm_variable_header (abfd)->screenNameLength) in nlm_compute_section_file_positions()
1343 + nlm_variable_header (abfd)->screenNameLength + 1 in nlm_compute_section_file_positions()
1344 + sizeof (nlm_variable_header (abfd)->threadNameLength) in nlm_compute_section_file_positions()
1345 + nlm_variable_header (abfd)->threadNameLength + 1); in nlm_compute_section_file_positions()
1348 if (find_nonzero (nlm_version_header (abfd), in nlm_compute_section_file_positions()
1351 if (find_nonzero (nlm_extended_header (abfd), in nlm_compute_section_file_positions()
1354 if (find_nonzero (nlm_copyright_header (abfd), in nlm_compute_section_file_positions()
1357 + nlm_copyright_header (abfd)->copyrightMessageLength + 1); in nlm_compute_section_file_positions()
1358 if (find_nonzero (nlm_custom_header (abfd), in nlm_compute_section_file_positions()
1361 + nlm_custom_header (abfd)->hdrLength); in nlm_compute_section_file_positions()
1362 if (find_nonzero (nlm_cygnus_ext_header (abfd), in nlm_compute_section_file_positions()
1379 for (sec = abfd->sections; sec != NULL; sec = sec->next) in nlm_compute_section_file_positions()
1385 f = bfd_get_section_flags (abfd, sec); in nlm_compute_section_file_positions()
1389 if (bfd_get_section_vma (abfd, sec) < text_low) in nlm_compute_section_file_positions()
1390 text_low = bfd_get_section_vma (abfd, sec); in nlm_compute_section_file_positions()
1397 if (bfd_get_section_vma (abfd, sec) < data_low) in nlm_compute_section_file_positions()
1398 data_low = bfd_get_section_vma (abfd, sec); in nlm_compute_section_file_positions()
1411 nlm_set_text_low (abfd, text_low); in nlm_compute_section_file_positions()
1412 nlm_set_data_low (abfd, data_low); in nlm_compute_section_file_positions()
1414 if (nlm_no_uninitialized_data (abfd)) in nlm_compute_section_file_positions()
1429 nlm_fixed_header (abfd)->codeImageOffset = text_ptr; in nlm_compute_section_file_positions()
1430 nlm_fixed_header (abfd)->codeImageSize = text; in nlm_compute_section_file_positions()
1431 nlm_fixed_header (abfd)->dataImageOffset = data_ptr; in nlm_compute_section_file_positions()
1432 nlm_fixed_header (abfd)->dataImageSize = data; in nlm_compute_section_file_positions()
1433 nlm_fixed_header (abfd)->uninitializedDataSize = bss; in nlm_compute_section_file_positions()
1435 for (sec = abfd->sections; sec != NULL; sec = sec->next) in nlm_compute_section_file_positions()
1439 f = bfd_get_section_flags (abfd, sec); in nlm_compute_section_file_positions()
1458 nlm_fixed_header (abfd)->relocationFixupOffset = other_ptr; in nlm_compute_section_file_positions()
1462 sym_ptr_ptr = bfd_get_outsymbols (abfd); in nlm_compute_section_file_positions()
1468 sym_end = sym_ptr_ptr + bfd_get_symcount (abfd); in nlm_compute_section_file_positions()
1491 if (nlm_no_uninitialized_data (abfd)) in nlm_compute_section_file_positions()
1497 nlm_fixed_header (abfd)->uninitializedDataSize += add; in nlm_compute_section_file_positions()
1511 nlm_set_section_contents (bfd *abfd, in nlm_set_section_contents() argument
1517 if (! abfd->output_has_begun in nlm_set_section_contents()
1518 && ! nlm_compute_section_file_positions (abfd)) in nlm_set_section_contents()
1533 mangle_relocs_func = nlm_mangle_relocs_func (abfd); in nlm_set_section_contents()
1536 if (!(*mangle_relocs_func) (abfd, section, location, in nlm_set_section_contents()
1542 if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 in nlm_set_section_contents()
1543 || bfd_bwrite (location, count, abfd) != count) in nlm_set_section_contents()
1599 nlm_write_object_contents (bfd *abfd) in nlm_write_object_contents() argument
1612 fixed_header = bfd_malloc (nlm_fixed_header_size (abfd)); in nlm_write_object_contents()
1616 if (! abfd->output_has_begun in nlm_write_object_contents()
1617 && ! nlm_compute_section_file_positions (abfd)) in nlm_write_object_contents()
1621 pos = nlm_optional_prefix_size (abfd) + nlm_fixed_header_size (abfd); in nlm_write_object_contents()
1622 if (bfd_seek (abfd, pos, SEEK_SET) != 0) in nlm_write_object_contents()
1624 if (! nlm_swap_variable_header_out (abfd) in nlm_write_object_contents()
1625 || ! nlm_swap_auxiliary_headers_out (abfd)) in nlm_write_object_contents()
1633 if (bfd_tell (abfd) > nlm_fixed_header (abfd)->codeImageOffset) in nlm_write_object_contents()
1640 if (bfd_seek (abfd, nlm_fixed_header (abfd)->relocationFixupOffset, in nlm_write_object_contents()
1647 write_import_func = nlm_write_import_func (abfd); in nlm_write_object_contents()
1654 for (sec = abfd->sections; sec != NULL; sec = sec->next) in nlm_write_object_contents()
1663 if ((bfd_get_section_flags (abfd, sec) & (SEC_CODE | SEC_DATA)) == 0) in nlm_write_object_contents()
1686 if (! (*write_import_func) (abfd, sec, rel)) in nlm_write_object_contents()
1693 nlm_fixed_header (abfd)->numberOfRelocationFixups = internal_reloc_count; in nlm_write_object_contents()
1700 external_relocs = bfd_alloc (abfd, amt); in nlm_write_object_contents()
1704 for (sec = abfd->sections; sec != NULL; sec = sec->next) in nlm_write_object_contents()
1737 nlm_fixed_header (abfd)->externalReferencesOffset = bfd_tell (abfd); in nlm_write_object_contents()
1758 if (! (*nlm_write_external_func (abfd)) (abfd, cnt, sym, in nlm_write_object_contents()
1765 nlm_fixed_header (abfd)->numberOfExternalReferences = c; in nlm_write_object_contents()
1768 sym_ptr_ptr = bfd_get_outsymbols (abfd); in nlm_write_object_contents()
1776 nlm_fixed_header (abfd)->publicsOffset = bfd_tell (abfd); in nlm_write_object_contents()
1777 get_public_offset_func = nlm_get_public_offset_func (abfd); in nlm_write_object_contents()
1778 write_export_func = nlm_write_export_func (abfd); in nlm_write_object_contents()
1780 sym_end = sym_ptr_ptr + bfd_get_symcount (abfd); in nlm_write_object_contents()
1800 offset = (*get_public_offset_func) (abfd, sym); in nlm_write_object_contents()
1808 offset -= nlm_get_text_low (abfd); in nlm_write_object_contents()
1814 offset -= nlm_get_data_low (abfd); in nlm_write_object_contents()
1827 if (! (*write_export_func) (abfd, sym, offset)) in nlm_write_object_contents()
1833 if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd) in nlm_write_object_contents()
1835 || bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len) in nlm_write_object_contents()
1838 put_word (abfd, offset, temp); in nlm_write_object_contents()
1839 if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) in nlm_write_object_contents()
1844 nlm_fixed_header (abfd)->numberOfPublics = c; in nlm_write_object_contents()
1852 if (nlm_fixed_header (abfd)->debugInfoOffset == (file_ptr) - 1) in nlm_write_object_contents()
1854 nlm_fixed_header (abfd)->debugInfoOffset = 0; in nlm_write_object_contents()
1855 nlm_fixed_header (abfd)->numberOfDebugRecords = 0; in nlm_write_object_contents()
1859 nlm_fixed_header (abfd)->debugInfoOffset = bfd_tell (abfd); in nlm_write_object_contents()
1861 sym_ptr_ptr = bfd_get_outsymbols (abfd); in nlm_write_object_contents()
1862 sym_end = sym_ptr_ptr + bfd_get_symcount (abfd); in nlm_write_object_contents()
1886 offset -= nlm_get_text_low (abfd); in nlm_write_object_contents()
1892 offset -= nlm_get_data_low (abfd); in nlm_write_object_contents()
1899 if (bfd_bwrite (&type, (bfd_size_type) sizeof (bfd_byte), abfd) in nlm_write_object_contents()
1903 put_word (abfd, offset, temp); in nlm_write_object_contents()
1904 if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), abfd) in nlm_write_object_contents()
1909 if ((bfd_bwrite (&len, (bfd_size_type) sizeof (bfd_byte), abfd) in nlm_write_object_contents()
1911 || bfd_bwrite (sym->name, (bfd_size_type) len, abfd) != len) in nlm_write_object_contents()
1914 nlm_fixed_header (abfd)->numberOfDebugRecords = c; in nlm_write_object_contents()
1920 last = bfd_tell (abfd); in nlm_write_object_contents()
1921 if (nlm_fixed_header (abfd)->codeImageOffset == 0) in nlm_write_object_contents()
1922 nlm_fixed_header (abfd)->codeImageOffset = last; in nlm_write_object_contents()
1923 if (nlm_fixed_header (abfd)->dataImageOffset == 0) in nlm_write_object_contents()
1924 nlm_fixed_header (abfd)->dataImageOffset = last; in nlm_write_object_contents()
1925 if (nlm_fixed_header (abfd)->customDataOffset == 0) in nlm_write_object_contents()
1926 nlm_fixed_header (abfd)->customDataOffset = last; in nlm_write_object_contents()
1927 if (nlm_fixed_header (abfd)->moduleDependencyOffset == 0) in nlm_write_object_contents()
1928 nlm_fixed_header (abfd)->moduleDependencyOffset = last; in nlm_write_object_contents()
1929 if (nlm_fixed_header (abfd)->relocationFixupOffset == 0) in nlm_write_object_contents()
1930 nlm_fixed_header (abfd)->relocationFixupOffset = last; in nlm_write_object_contents()
1931 if (nlm_fixed_header (abfd)->externalReferencesOffset == 0) in nlm_write_object_contents()
1932 nlm_fixed_header (abfd)->externalReferencesOffset = last; in nlm_write_object_contents()
1933 if (nlm_fixed_header (abfd)->publicsOffset == 0) in nlm_write_object_contents()
1934 nlm_fixed_header (abfd)->publicsOffset = last; in nlm_write_object_contents()
1935 if (nlm_fixed_header (abfd)->debugInfoOffset == 0) in nlm_write_object_contents()
1936 nlm_fixed_header (abfd)->debugInfoOffset = last; in nlm_write_object_contents()
1940 memcpy (nlm_fixed_header (abfd)->signature, nlm_signature (abfd), in nlm_write_object_contents()
1942 nlm_fixed_header (abfd)->version = NLM_HEADER_VERSION; in nlm_write_object_contents()
1943 nlm_fixed_header (abfd)->codeStartOffset = in nlm_write_object_contents()
1944 (bfd_get_start_address (abfd) in nlm_write_object_contents()
1945 - nlm_get_text_low (abfd)); in nlm_write_object_contents()
1950 nlm_fixed_header (abfd)->exitProcedureOffset -= nlm_get_text_low (abfd); in nlm_write_object_contents()
1951 if (nlm_fixed_header (abfd)->checkUnloadProcedureOffset != 0) in nlm_write_object_contents()
1952 nlm_fixed_header (abfd)->checkUnloadProcedureOffset -= in nlm_write_object_contents()
1953 nlm_get_text_low (abfd); in nlm_write_object_contents()
1955 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) in nlm_write_object_contents()
1958 write_prefix_func = nlm_write_prefix_func (abfd); in nlm_write_object_contents()
1961 if (! (*write_prefix_func) (abfd)) in nlm_write_object_contents()
1965 BFD_ASSERT ((bfd_size_type) bfd_tell (abfd) in nlm_write_object_contents()
1966 == nlm_optional_prefix_size (abfd)); in nlm_write_object_contents()
1968 nlm_swap_fixed_header_out (abfd, nlm_fixed_header (abfd), fixed_header); in nlm_write_object_contents()
1969 if (bfd_bwrite (fixed_header, nlm_fixed_header_size (abfd), abfd) in nlm_write_object_contents()
1970 != nlm_fixed_header_size (abfd)) in nlm_write_object_contents()