field.
(nlm_cygnus_section_header): New accessor macro.
* nlmcode.h (nlm_object_p): Free new tdata structure if failure.
Add fixed sections before swapping in auxiliary headers. After
adding sections, treat errors as real, not as wrong format.
(nlm_swap_auxiliary_headers_in): Swap in the sections header; add
sections to the BFD for each section it describes.
(nlm_swap_auxiliary_headers_out): Swap out the sections header.
(nlm_compute_section_file_positions): Account for the size of the
sections header.
optional_prefix_size, nlm_backend_object_p, nlm_write_prefix,
nlm_set_public_section, nlm_get_public_offset. Removed unused
nlm_write_reloc field. Changed nlm_write_import to remove
unnecessary symbol argument. Renamed nlm_write_externals to
nlm_write_external, and changed cound argument from bfd_vma to
bfd_size_type.
(nlm_optional_prefix_size, nlm_backend_object_p_func,
nlm_write_prefix_func, nlm_set_public_section_func,
nlm_get_public_offset_func): New accessor macros.
(nlm_write_reloc_func): Removed.
(nlm_write_external_func): Adjusted for field renaming.
* nlm32-i386.c (nlm_i386_write_import): Renamed from
nlm_i386_write_reloc. Removed old nlm_i386_write_import which
just called old nlm_i386_write_reloc.
(nlm_i386_write_external): Renamed from nlm_i386_write_externals.
Declared. Changed second argument from bfd_vma to bfd_size_type.
(nlm32_i386_backend): Adjusted for changes to fields and names.
* nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused,
ifdeffed out code.
(nlm_sparc_write_import): Removed second argument.
(nlm_sparc_write_external): Renamed from
nlm_sparc_write_externals. Changed second argument from bfd_vma
to bfd_size_type.
(nlm32_sparc_backend): Adjusted for changes to fields and names.
* nlmcode.h: Removed some unused code.
(nlm_object_p): Don't destroy tdata pointer. Call
backend_object_p function if it exists.
(nlm_slurp_symbol_table): Removed unused variable rcount. Call
set_public_section_func if it exists instead of checking
NLM_HIBIT.
(nlm_compute_section_file_positions): Account for
optional_prefix_size.
(nlm_write_object_contents): Account for optional_prefix_size.
Removed useless variable write_reloc_func. Changed declaration
and call of write_import_func. Call write_prefix_func if it
exists. Removed unused variables len and temp. Call
get_public_offset_func if it exists rather than setting NLM_HIBIT.
(nlm_mangle_relocs_func): New macro.
* nlm32-i386.c (nlm_i386_write_reloc): Rewrote correctly.
(nlm_i386_mangle_relocs): New function.
* nlmcode.h (nlm_compute_section_file_positions): Move all common
symbols into the .bss section.
(nlm_set_section_contents): Call the mangle_relocs function.
(nlm_write_object_contents): Treat a reloc against any defined
symbol as an internal reloc. Fix bug in external reloc counting.
Get the offset and debugging type right for .bss symbols. Only
output debugging symbols for defined symbols.