* syms.c: Fix comments so that `make info' works.
[platform/upstream/binutils.git] / bfd / ChangeLog
1 Fri Jul 14 13:13:55 1995  Ian Lance Taylor  <ian@cygnus.com>
2
3         * syms.c: Fix comments so that `make info' works.
4
5         * elf32-mips.c (mips_elf_find_nearest_line): Set SEC_HAS_CONTENTS
6         in .mdebug section, in case backend linker has cleared it.
7
8 Fri Jul 14 11:58:34 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
9
10         * elf32-ppc.c (ppc_elf_addr16_ha_inner): Rewrite to take just one
11         argument, the final relocated address.
12         (ppc_elf_addr16_ha_inner): Adjust ppc_elf_addr16_ha_inner caller.
13         (ppc_elf_relocate_section): Ditto.
14
15 Thu Jul 13 17:22:03 1995  Jeff Law  (law@snake.cs.utah.edu)
16
17         * som.c (hppa_som_gen_reloc_type): Choose a reasonable field
18         selector relocation for the difference of two symbols.
19
20 Thu Jul 13 10:33:25 1995  Ian Lance Taylor  <ian@cygnus.com>
21
22         * aoutx.h (NAME(aout,slurp_reloc_table)): Cast argument to size_t
23         for malloc.
24         * coff-mips.c (mips_relocate_section): Likewise, for memmove.
25         (mips_relax_section): Likewise, for malloc.
26         * cofflink.c (process_embedded_commands): Likewise.
27         (_bfd_coff_final_link): Likewise.
28         * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
29         (ecoff_final_link_debug_accumulate): Likewise.
30         (ecoff_indirect_link_order): Likewise, for memcpy and malloc.
31         (ecoff_reloc_link_order): Likewise, for malloc.
32         * ecofflink.c (ecoff_align_debug): Likewise, for memset.
33         (ecoff_write_symhdr): Likewise, for malloc.
34         * elf32-hppa.c (elf32_hppa_read_symext_info): Likewise.
35         * elf.c (assign_file_positions_except_relocs): Likewise, for
36         qsort.
37         * elf32-mips.c (mips_elf_read_ecoff_info): Likewise, for malloc.
38         * elfcode.h (elf_slurp_reloc_table): Likewise.
39         * elfcore.h (elf_corefile_note): Likewise.
40         * elflink.h (elf_link_add_object_symbols): Likewise.
41         (elf_link_read_relocs): Likewise.
42         (NAME(bfd_elf,size_dynamic_sections)): Likewise, for memset.
43         * i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
44         * ieee.c (do_with_relocs): Likewise.
45         * linker.c (default_indirect_link_order): Likewise, for malloc.
46         * nlmcode.h (nlm_object_p): Likewise.
47         (nlm_write_object_contents): Likewise.
48         * oasys.c (oasys_set_section_contents): Likewise, for memcpy.
49         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise,
50         for malloc.
51         * section.c (bfd_get_section_contents): Likewise, for memcpy.
52         * srec.c (srec_get_section_contents): Likewise.
53         (srec_set_section_contents): Likewise.
54         * sunos.c (bfd_sunos_size_dynamic_sections): Likewise, for
55         realloc and memset.
56         (sunos_scan_relocs): Likewise, for malloc.
57         (sunos_scan_dynamic_symbol): Likewise, for realloc.
58         * syms.c (_bfd_generic_read_minisymbols): Likewise, for malloc.
59         * versados.c (versados_get_section_contents): Likewise, for
60         memcpy.
61
62         * libbfd.c (real_read): Add prototype.  Change argument types from
63         int to size_t.
64         (bfd_read): Cast real_read argument to size_t, not int.
65         (bfd_write): Cast fwrite argument to size_t, not int.
66
67         * elf64-gen.c (elf_info_to_howto): Fix definition for recent elf.c
68         changes.
69
70         * configure.in: Fix typo: change {$enableval} to ${enableval}.
71         * configure: Rebuild.
72
73         * Makefile.in (BFD32_BACKENDS): Add elflink.o.
74
75         * targets.c (bfd_target): Add fields _read_minisymbols and
76         _minisymbol_to_symbol.
77         (BFD_JUMP_TABLE_SYMBOLS): Add _read_minisymbols and
78         _minisymbol_to_symbol.
79         (bfd_read_minisymbols): Define.
80         (bfd_minisymbol_to_symbol): Define.
81         * syms.c (_bfd_generic_read_minisymbols): Define.
82         (_bfd_generic_minisymbol_to_symbol): Define.
83         * libbfd-in.h (_bfd_nosymbols_read_minisymbols): Define.
84         (_bfd_nosymbols_minisymbol_to_symbol): Define.
85         (_bfd_generic_read_minisymbols): Declare.
86         (_bfd_generic_minisymbol_to_symbol): Declare.
87         * bfd-in2.h: Rebuild.
88         * libbfd.h: Rebuild.
89         * aoutx.h (MINISYM_THRESHOLD): Define.
90         (NAME(aout,read_minisymbols)): New function.
91         (NAME(aout,minisymbol_to_symbol)): New function.
92         * libaout.h (NAME(aout,read_minisymbols)): Declare.
93         (NAME(aout,minisymbol_to_symbol)): Declare.
94         * aout-target.h (MY_read_minisymbols): Define.
95         (MY_minisymbol_to_symbol): Define.
96         * All targets: Define read_minisymbols and minisymbol_to_symbol.
97
98 Wed Jul 12 17:55:55 1995  Ken Raeburn  <raeburn@cygnus.com>
99
100         * elflink.h (elf_link_add_object_symbols): Cast return value from
101         bfd_alloc.
102
103         * elfcode.h (size_info): Don't use "&" before function names.
104
105 Wed Jul 12 00:16:48 1995  Ken Raeburn  <raeburn@kr-pc.cygnus.com>
106
107         * libelf.h (elf_backend_data): Use unsigned, not unsigned char,
108         for bitfields.
109
110 Tue Jul 11 15:19:53 1995  Ian Lance Taylor  <ian@cygnus.com>
111
112         * elf.c (bfd_section_from_shdr): In case SHT_REL[A], only get the
113         BFD section for the sh_link section if it is a SYMTAB section.
114
115         * aoutx.h (NAME(aout,link_add_symbols)): Don't bother to check
116         that archives hold a.out objects.
117         * cf-i386lynx.c (coff_bfd_link_add_symbols): Don't define.
118         (lynx_link_add_symbols): Remove.
119         * cf-m68klynx.c (coff_bfd_link_add_symbols): Don't define.
120         (lynx_link_add_symbols): Remove.
121         * elflink.h (elf_bfd_link_add_symbols): Don't bother to check that
122         archives hold ELF objects.
123
124         * archive.c (bfd_generic_archive_p): If the archive has a map, and
125         the target was defaulted, but the first object in the archive can
126         not be matched with that target, then return a bad format error.
127
128         * elf64-sparc.c (elf_sparc_howto_table): Set howto for WDISP16 to
129         elf64_wdisp16_reloc.
130         (elf64_wdisp16_reloc): New static function.
131         (elf64_sparc_relocate_section): New static function.
132         (elf_backend_relocate_section): Define.
133
134         * libelf.h (struct elf_size_info): Change type of last argument to
135         swap_symbol_out from char * to PTR.
136         (bfd_elf32_swap_symbol_out): Update declaration.
137         (bfd_elf64_swap_symbol_out): Likewise.
138         * elfcode.h (elf_swap_symbol_out): Change type of cdst from char *
139         to PTR.
140         * elf.c (swap_out_syms): Cast to PTR, not char *, when calling
141         swap_symbol_out routine.
142         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Likewise.
143         (elf_link_output_sym): Likewise.
144         (elf_link_output_extsym): Likewise.
145         * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Likewise.
146
147 Tue Jul 11 12:29:49 1995  Rick Sladkey  <jrs@world.std.com>
148
149         * elf.c (_bfd_elf_find_nearest_line): Handle the simple case where
150         there is no debugging information.
151
152 Mon Jul 10 11:45:55 1995  Ken Raeburn  <raeburn@cygnus.com>
153
154         * makefile.dos (OBJS): Add binary.o and tekhex.o.  From DJ
155         Delorie.
156
157 Mon Jul 10 11:09:58 1995  Ian Lance Taylor  <ian@cygnus.com>
158
159         * linker.c (set_symbol_from_hash): bfd_link_hash_new case: Don't
160         abort; it can happen for constructor symbols when not building
161         constructors.
162
163         * coff-i960.c (coff_i960_relocate): Correct typo: use ! on strcmp,
164         not on string.
165         * cofflink.c (_bfd_coff_generic_relocate_section): Remove unused
166         local i.
167         * coff-arm.c (coff_arm_rtype_to_howto): Don't declare.
168         (PCRELOFFSET): Define if not already defined.
169         * Makefile.in: Rebuild dependencies.
170         (BFD32_BACKENDS): Add coff-arm.o
171         (CFILES): Add coff-arm.c, pe-arm.c, pei-arm.c.
172
173         * aoutx.h (NAME(aout,link_hash_table_create)): Allocate hash table
174         using bfd_alloc, not malloc.
175         * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
176         * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
177         * i386linux.c (linux_link_hash_table_create): Likewise.
178         * linker.c (_bfd_generic_link_hash_table_create): Likewise.
179         * sunos.c (sunos_link_hash_table_create): Likewise.
180
181         Based on patches from Eric Youngdale <eric@aib.com>:
182         * elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic,
183         output a DT_SYMBOLIC dynamic entry.
184         (elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT
185         entry for a locally defined symbol.
186         * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn
187         about undefined symbols, and fill in the GOT entry for a symbol
188         defined in a regular object file.
189         (elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
190         reloc rather than a GLOB_DAT reloc for a symbol defined in a
191         regular object file.
192         * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn
193         about undefined symbols, and fill in the GOT entry for a symbol
194         defined in a regular object file.
195         (elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
196         reloc rather than a GLOB_DAT reloc for a symbol defined in a
197         regular object file.
198         * elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do
199         warn about undefined symbols, and fill in the GOT entry for a
200         symbol defined in a regular object file.
201         (elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a
202         RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined
203         in a regular object file.
204
205         * config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS.
206         Correct elements to be actual BFD vector names.
207
208         * Makefile.in (Makefile): Don't depend upon @frags@.
209         (config.status): Depend upon @frags@.
210
211 Fri Jul  7 17:36:44 1995  Ian Lance Taylor  <ian@cygnus.com>
212
213         * coffgen.c (coff_renumber_symbols): Sort defined symbols that are
214         neither BSF_FUNCTION not BSF_NOT_AT_END just before undefined
215         symbols.
216         * coffcode.h (coff_slurp_symbol_table): Set BSF_FUNCTION as well
217         as BSF_NOT_AT_END.
218
219 Fri Jul  7 17:16:15 1995  Ken Raeburn  <raeburn@cygnus.com>
220
221         * Makefile.in (do_mostlyclean): Remove config.log.
222         (do_distclean): Remove config.cache.
223
224 Thu Jul  6 14:37:43 1995  Ian Lance Taylor  <ian@cygnus.com>
225
226         * elf32-i386.c (elf_i386_relocate_section): Revert May 24 patch.
227         Don't copy PC32 reloc against section into shared object.
228
229         * Makefile.in: Rebuild dependencies.
230         (CFILES): Added elflink.c.
231         (Makefile): Depend upon config.status, not configure.in.
232         (config.status): New target; depend upon configure configure.host
233         and config.bfd.
234
235 Wed Jul  5 20:17:14 1995  Ken Raeburn  <raeburn@cygnus.com>
236
237         * elfcore.h, elflink.h, elfcode.h, elf.c, elflink.c: Moved some
238         primarily size-independent code from elfcode.h to elf.c and new
239         file elflink.c; moved out other core- or linker-related routines
240         into other new .h files for clarity.  Renamed many routines to
241         start with bfd_elf or _bfd_elf.  Added a structure of
242         size-dependent but target-independent info to elfcode.h.
243         * Makefile.in: Build elflink.o.  Update dependencies.
244         * libelf.h: Updated some declarations.  Added a definition for the
245         new structure in elfcode.h.  Added more fields to elf backend data
246         structure.
247         * elfxx-target.h: Refer to the appropriate size-dependent info.
248         * elf32-*.c: Changed some function names.  Moved common
249         create_dynamic_sections code from m68k, sparc, and i386 support
250         into elflink.c.  Define some new macros to fill in new fields of
251         back end data.  Also clean up some "gcc -Wall" warnings regarding
252         unused or uninitialized variables.
253
254         * Makefile.in (BFD_LIBS): No, don't put elflink.o here.
255         * configure.in: Include it here whenever elf.o is specified.
256
257 Wed Jul  5 10:31:47 1995  Ian Lance Taylor  <ian@cygnus.com>
258
259         * elf32-mips.c (mips_elf_object_p): Unconditionally set
260         elf_bad_symtab, since sometimes the symbol table is messed up and
261         the last symbol is global.
262
263         * ecoff.c (_bfd_ecoff_bfd_is_local_label): New function.
264         * libecoff.h (_bfd_ecoff_bfd_is_local_label): Declare.
265         * elf32-mips.c (mips_elf_is_local_label): New static function.
266         (bfd_elf32_bfd_is_local_label): Define.
267
268         * configure.in: Use $ac_config_sub, not $configsub.
269         * configure: Likewise.
270
271         Permit --enable-targets=ieee:
272         * config.bfd (*-*-ieee*): New target.
273         * config/ieee.mt: New file.
274
275 Wed Jul  5 04:16:35 1995  Ken Raeburn  <raeburn@kr-pc.cygnus.com>
276
277         * config/i386aix.mh (HDEFINES): Remove -DFASCIST_FDOPEN.
278
279         Autoconfiscation:
280         * configure.in, Makefile.in, doc/Makefile.in: Switch from Cygnus
281         configure to autoconf ways of processing --enable arguments,
282         setting up symlinks, incorporating makefile fragments, printing
283         messages at configuration time, setting variables in Makefile.
284         Deleted some unused variables.  Check for ranlib via autoconf.
285         For now, configure script removes doc/config.status.
286         * configure: New file.
287         * dep-in.sed: Use @SRCDIR@ instead of @srcdir@, so Makefile.in
288         line doesn't get broken by configure.
289         * doc/configure.in: Removed.
290
291 Tue Jul  4 12:22:21 1995  Ian Lance Taylor  <ian@cygnus.com>
292
293         * archive.c (_bfd_construct_extended_name_table): If
294         BFD_TRADITIONAL_FORMAT is set, limit the length of all file names
295         to ar_max_namelen.
296         (bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call
297         bfd_bsd_truncate_arname.
298         (_bfd_write_archive_contents): Revert June 1 change.
299
300         * elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide
301         argument.
302         * bfd-in.h (bfd_elf32_record_link_assignment): Update prototype.
303         (bfd_elf64_record_link_assignment): Likewise.
304         * bfd-in2.h: Rebuild.
305
306         * libelf.h (struct elf_link_hash_table): Add needed field.  Remove
307         saw_needed field.
308         * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
309         is an empty string, don't make a DT_NEEDED entry in the output
310         file.  Record all DT_NEEDED entries found in input dynamic
311         objects.
312         (elf_link_output_extsym): Don't check saw_needed when issuing
313         warnings.
314         * elf.c (_bfd_elf_link_hash_table_init): Initialize needed, not
315         saw_needed.
316         (bfd_elf_get_needed_list): New function.
317         * bfd-in.h (struct bfd_elf_link_needed_list): Define.
318         (bfd_elf_get_needed_list): Define.
319         * bfd-in2.h: Rebuild.
320
321         * ecoff.c (_bfd_ecoff_find_nearest_line): Also initialize
322         find_buffer and fdrtab_len fields of newly allocated
323         find_line_info structure.
324
325 Mon Jul  3 17:03:52 1995  Jeff Law  (law@snake.cs.utah.edu)
326
327         * som.c (hppa_som_gen_reloc_type): New argument "sym_diff",
328         nonzero when we're generating relocations for an expression
329         using the difference of two symbols.  All callers changed.
330         Handle difference of symbols for both R_HPPA and R_COMPLEX
331         cases.
332         (som_write_fixups): Handle R_COMP1, R_COMP2 and R_CODE_EXPR
333         fixups.
334
335 Mon Jul  3 13:55:18 1995  Steve Chamberlain  <sac@slash.cygnus.com>
336
337         * config.bfd (win32): New configuration.
338         * configure.host (pe): Changed to i386win32.
339         * config/i386pe.mh: Deleted.
340         * config/i386win32.mh: New file.
341
342 Mon Jul  3 11:30:45 1995  Ian Lance Taylor  <ian@cygnus.com>
343
344         * ecoff.c (_bfd_ecoff_find_nearest_line): If we allocate
345         find_line_info, clear the fdrtab field.
346
347         * targets.c (enum bfd_flavour): Add bfd_target_msdos_flavour here,
348         rather than in bfd-in2.h.
349
350         * bfd.c (enum bfd_error): Define bfd_error_no_armap.
351         (bfd_errmsgs): Add string for bfd_error_no_armap.
352         * bfd-in2.h: Rebuild.
353         * ecoff.c (ecoff_link_add_archive_symbols): If an archive has no
354         armap, set bfd_error_no_armap rather than bfd_error_no_symbols.
355         * elfcode.h (elf_link_add_archive_symbols): Likewise.
356         * linker.c (_bfd_generic_link_add_archive_symbols): Likewise.
357
358         * elfcode.h (elf_link_add_object_symbols): Permit common and
359         indirect symbols in weakdefs BFD_ASSERT.
360         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Simplify
361         BFD_ASSERT to permit some legal, but odd, cases.
362         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
363         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
364
365         * Makefile.in: Rebuild dependencies.
366         (BFD32_BACKENDS): Add versados.o.
367         (CFILES): Add pe-i386.c, pei-i386.c, and versados.c.
368 start-sanitize-arc
369         (elf32-arc.o): New target.  This target should be removed when
370         elf32-arc.c can be added to CFILES, after which the automatic
371         dependency building will handle it.
372 end-sanitize-arc
373
374 Sun Jul  2 17:49:32 1995  Ian Lance Taylor  <ian@cygnus.com>
375
376         * cofflink.c (_bfd_coff_generic_relocate_section): Cast base_file
377         to FILE * before using it.
378         * stab-syms.c: Revert yesterday's patch.
379
380 Sat Jul  1 12:10:42 1995  Fred Fish  <fnf@cygnus.com>
381
382         * stab-syms.c (stdio.h):  Include prior to libaout.h, which
383         includes bfdlink.h, which now uses FILE.
384
385 Sat Jul  1 00:11:08 1995  Ken Raeburn  <raeburn@cygnus.com>
386
387         * elfxx-target.h: New file.
388
389         * libelf.h (struct elf_backend_data): Remove elf_64_p field.
390         * elfxx-target.h (elfNN_bed): Don't set it.
391
392         * elf32-target.h, elf64-target.h: Deleted.
393         * Makefile.in (elf32-target.h, elf64-target.h): Build them from
394         elfxx-target.h.
395
396 Fri Jun 30 16:07:18 1995  Steve Chamberlain  <sac@slash.cygnus.com>
397
398         * cofflink.c (_bfd_coff_generic_relocate_section): Compare
399         the full text of .reloc or .edata section names.
400
401 Fri Jun 30 15:47:37 1995  Fred Fish  <fnf@cygnus.com>
402
403         * cofflink.c (_bfd_coff_generic_relocate_section):
404         Remove extra '+'.
405
406 Thu Jun 29 17:24:52 1995  Steve Chamberlain  <sac@slash.cygnus.com>
407
408         * coff-h8300.c (COFF_LONG_FILENAMES): Define.
409
410 Wed Jun 28 18:04:42 1995  Steve Chamberlain  <sac@slash.cygnus.com>
411
412         * Makefile.in: versados.o is now conditionally built.
413         * coffcode.h (add_data_entry): New function.
414         (coff_write_object_contents): Clean up. Calculate
415         data entries.
416         * cofflink.c (_bfd_coff_generic_relocate_section):
417         .reloc and .edata sections are IMAGE_BASED too.
418         If there's a base_file then write out base information.
419         * configure.host (i386-*-pe): New.
420         * syms.c (coff_section_type): Only scan prefixes.
421         * targets.c (bfd_target_vector): Versados is now conditionally
422         built.
423         * config/m68k-coff.mt: Build versados.o
424         * hosts/i386pe.h: New file.
425
426 Mon Jun 26 13:53:49 1995  Jeff Law  (law@snake.cs.utah.edu)
427
428         * elf32-hpa.c (elf32_hppa_relocate_section): Close comment before
429         R_PARISC_DPREL21L handling.
430
431 Thu Jun 22 19:28:36 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
432
433         Sun May  7 11:53:41 MDT 1995  Bryan Ford  <baford@cs.utah.edu>
434
435         * config/i386-moss.mt: created.
436
437 Thu Jun 22 08:56:10 1995  Steve Chamberlain  <sac@slash.cygnus.com>
438
439         * reloc.c (bfd_perform_relocation): Add case for -ve words.
440
441 Wed Jun 21 13:13:49 1995  Jeff Law  (law@snake.cs.utah.edu)
442
443         * elf32-hppa.c (elf32_hppa_relocate_section): Don't try to apply a
444         relocation against an undefined symbols.
445
446 Wed Jun 21 10:16:10 1995  Steve Chamberlain  <sac@slash.cygnus.com>
447
448         * versados.c: Second pass/rewrite.
449
450 Mon Jun 19 08:40:45 1995  Steve Chamberlain  <sac@slash.cygnus.com>
451
452         * syms.c (coff_section_type): Compare only the front part
453         of a section name.
454
455 Sat Jun 17 09:40:44 1995  Jeff Law  (law@snake.cs.utah.edu)
456
457         * elf32-hppa.c (elf32_hppa_size_stubs): Set the size of the stub
458         section if we get an error.
459
460         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Don't mess
461         with the operands of an R_PARISC_DPREL21L relocation if the insn
462         is not "addil <symbol>,%r27".
463
464 Fri Jun 16 15:04:47 1995  Stan Shebs  <shebs@andros.cygnus.com>
465
466         * bfd-in.h (NT_subsystem, NT_stack_heap): Declare but don't
467         define.
468         * bfd-in2.h: Rebuilt.
469         * bfd.c (NT_subsystem, NT_stack_heap): Define.
470
471 Fri Jun 16 00:07:25 1995  Jeff Law  (law@snake.cs.utah.edu)
472
473         * elf32-hppa.c (elf32_hppa_bfd_link_link_relocate): Use the right
474         type field (there are two!) when checking to see if $global$ is
475         defined.
476
477 Thu Jun 15 14:03:47 1995  Stan Shebs  <shebs@andros.cygnus.com>
478
479         * bfd-in.h, bfd-in2.h (bfd_boolean): Rename bfd_true, bfd_false
480         to bfd_tttrue, bfd_fffalse so as not to conflict with functions.
481         * coffswap.h (coff_swap_scnhdr_out): Remove version that was
482         hacked for MPW C.
483         * mpw-config.in: Set shell vars instead of pasting to makefile
484         for each configuration, edit coffswap.h to make MPW C not choke.
485         (i386-unknown-coff, sh-hitachi-hms): Recognize.
486         * mpw-make.in (BFD_LIBS): Add versados.c.o.
487
488         * versados.c (versados_scan): Properly cast results from bfd_alloc.
489
490 Wed Jun 14 15:27:32 1995  Steve Chamberlain  <sac@slash.cygnus.com>
491
492         * cofflink.c (process_embedded_commands): New function
493         reads and handles .drectve sections for PE.
494         (coff_link_input_bfd): Call new function if PE.
495
496 Mon Jun 12 12:09:39 1995  Jeff Law  (law@snake.cs.utah.edu)
497
498         * bfd-in.h (bfd_set_section_vma): Case true to a boolean.
499         (bfd_set_cacheable): Likewise.
500         * bfd-in2.h: Rebuilt.
501
502 Fri Jun  9 12:20:28 1995  Steve Chamberlain  <sac@rtl.cygnus.com>
503
504         * elfcode.h (elf_sort_hdrs): Rewrite to be symmetrical.
505
506 Fri Jun  9 12:49:00 1995  Jeff Law  (law@snake.cs.utah.edu)
507
508         * targets.c: Add copy_private_symbol_data and link_split_section
509         to the target vector.
510         * libbfd-in.h (_bfd_generic_bfd_copy_private_symbol_data): Define.
511         (_bfd_nolink_bfd_link_split_section): Likewise.
512         (bfd_generic_link_split_section): Declare.
513         * syms.c (bfd_copy_private_symbol_data): Define.
514         * linker.c (bf_link_split_section): Likewise.
515         * som.c (som_bfd_copy_private_symbol_data): New function
516         (som_bfd_link_split_section): Likewise.
517         * All other targets updated with default versions of new routines.
518
519         * Take out my braindamaged bfd_true/bfd_false changes from earlier
520         today.  Replace with just:
521         * bfd-in.h: (TRUE_FALSE_ALREADY_DEFINED): Define this if
522         compiling with g++-2.6 or later.
523         * bfd-in2.h: Rebuilt.
524
525 Fri Jun  9 07:54:29 1995  Steve Chamberlain  <sac@slash.cygnus.com>
526
527         * versados.c (struct esd, get_4): Lint; use unsigned chars.
528
529         * coff-i960.c (coff_i960_relocate):  Compare output section names
530         when converting for vxworks.
531
532 Wed Jun  7 19:01:30 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
533
534         * elfcode.h (elf_fake_sections): Permit .scommon or COMMON
535         sections as random SHT_NOBITS sections, in case a linker script is
536         strange.
537
538 Tue Jun  6 17:29:32 1995  Steve Chamberlain  <sac@slash.cygnus.com>
539
540         * bfd-in.h (NT_subsystem, NT_stack_heap): Moved from pe.h
541         * coff-i386.c (coff_i386_rtype_to_howto): Get PE relocs right.
542         * coffcode.h (coff_mkobject): Set pe tdata bit when using PE.
543         * cofflink.c (COFF_WITH_PE code): Test on obj_pe bit rather
544         than conditional compile.
545         * configure.in: Fix PE dependencies.
546         * libcoff-in.h (obj_pe): New.
547         (coff_tdata): Added pe entry.
548         * libcoff.h: Regenerated.
549
550 Mon Jun  5 09:07:13 1995  Steve Chamberlain  <sac@slash.cygnus.com>
551
552         * coff-a29k.c (coff_a29k_adjust_symndx): Completely parenthesize
553         macro.
554
555 Mon Jun  5 02:15:20 1995  Ken Raeburn  <raeburn@kr-laptop.cygnus.com>
556
557         Linker support for m68k-elf from Andreas Schwab
558         <schwab@issan.informatik.uni-dortmund.de>:
559         * elfcode.h (elf_link_add_object_symbols): Check for NULL when
560         looping through the symbol hashes.
561         (elf_bfd_final_link): When looking for _init and _fini don't use
562         the symbol if it is imported from another object.
563         * elf32-m68k.c: Relocation type changed from REL to RELA.  Regular
564         and dynamic linking support functions added, similar to other elf
565         targets.
566
567         * config.bfd (i[345]86-*-gnu*): Use ELF configuration.
568
569 Fri Jun  2 18:54:59 1995  Steve Chamberlain  <sac@slash.cygnus.com>
570
571         * versados.c: New file.
572         * bfd-in2.h (struct _bfd): New field.
573         * bfd.c (struct _bfd): New field.
574         * configure.in (versados_vec): New field.
575         * targets.c (bfd_flavor): Added versados.
576
577 Thu Jun  1 13:51:49 1995  Steve Chamberlain  <sac@slash.cygnus.com>
578
579         * coffcode.h (sec_to_styp_flags, styp_to_sec_flags, 
580         coff_new_section_hook):  Any section that starts ".stab"
581         is now marked as debugging.
582
583 Thu Jun  1 16:15:16 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
584
585         * archive.c (_bfd_write_archive_contents): Disable extended name
586         table until it can be made optional, so that native AR has half a
587         chance on SunOS and HP/UX.
588
589         * linker.c (_bfd_generic_link_output_symbols, case
590         bfd_link_hash_indirect): Add cast to correct pointer types.
591
592 Sat May 27 21:37:31 1995  J.T. Conklin  <jtc@rtl.cygnus.com>
593
594         * config.bfd (m68k-bull-sysv*): Added strip_underscore=yes.
595           (m68k-est-coff): Removed.  target does not effect object format.
596
597 Wed May 24 10:52:01 1995  Steve Chamberlain  <sac@slash.cygnus.com>
598
599         * linker.c (_bfd_generic_link_output_symbols): Cope with
600         indirect symbols.
601
602         * elf32-i386.c (elf_i386_relocate_section): Give error
603         message when linking to a shared reloc which isn't there.
604
605 Wed May 24 10:40:00 1995  Steve Chamberlain  <sac@slash.cygnus.com>
606
607         Support for ARM-PE.
608
609         * Makefile.in, coffcode.h, config.bfd, configure.in, pe-arm.c,
610          pei-arm.c, coff-arm.c, reloc.c, targets.c, config/arm-pe.mt:
611          Support for ARM COFF/PE.
612
613 Tue May 23 19:24:58 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
614
615         * bfd.c (bfd_get_relocated_section_contents): Now a function,
616         tries calling routine from input bfd target vector for
617         bfd_indirect_link_order.  Put a declaration into the header file.
618         * bfd-in2.h: Regenerated.
619         * elf32-mips.c (gprel16_with_gp): New function, split out from
620         mips_elf_gprel16_reloc.
621         (mips_elf_gprel16_reloc): Call it.  If output bfd target vector
622         isn't elf flavoured, abort, since it's assumed to be elf in some
623         of this code, including the code that looks up the gp value.
624         (elf32_mips_get_relocated_section_contents): New function,
625         modified from bfd_generic_get_relocated_section_contents to deal
626         with passing gp to gprel16_with_gp.
627         (bfd_elf32_bfd_get_relocated_section_contents): New macro.
628         * elf32-target.h (bfd_elf32_bfd_get_relocated_section_contents):
629         Don't define if already defined.
630
631 Tue May 23 15:58:15 1995  Jeff Law  (law@snake.cs.utah.edu)
632
633         * Makefile.in: Install bfdlink.h too.
634
635 Sun May 21 22:25:09 1995  Jeff Law  (law@snake.cs.utah.edu)
636
637         * elf32-hppa.c (elf32_hppa_relocate_section): Handle undefined and
638         notsupported return codes from final_link_relocate (used when
639         $global$ is undefined or nonexistant).
640         (elf32_hppa_bfd_link_link_relocate): If $global$ exists, but is
641         not defined,then return bfd_reloc_undefined.
642
643 Fri May 19 10:00:14 1995  Steve Chamberlain  <sac@rtl.cygnus.com>
644
645         * coffswap.h: (IMAGE_BASE): Define to 0 if not.
646
647 Thu May 18 04:24:01 1995  Ken Raeburn  <raeburn@kr-laptop.cygnus.com>
648
649         Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
650
651         * aoutx.h (aout_link_input_section_standard): If defined, call
652         MY_relocatable_reloc before doing a partial relocation.
653
654         * aout-arm.c: (WRITE_HEADERS): Delete.
655         (NAME): Define version to override default in aoutx.h
656         (MY(howto_table)): Reformat.  Alter some entries slightly.
657         (RELOC_ARM_BITS_NEG_{BIG,LITTLE}): Define.
658         (MY(reloc_howto), MY(put_reloc), MY(relocatable_reloc)): New functions.
659         (MY_reloc_howto, MY_put_reloc, MY_relocatable_reloc): Define.
660         (MY(fix_pcrel_26)): Renamed from aoutarm_fix_pcrel_26, return
661         bfd_reloc_ok not bfd_reloc_continue.
662         (MY(fix_pcrel_26_done)): Likewise.
663         (MY(bfd_reloc_type_lookup)): Renamed from aoutarm_reloc_type_lookup.
664         (MY_bfd_link_hash_table_create, MY_bfd_link_add_symbols,
665         MY_bfd_final_link): Delete.
666         (MY_swap_std_reloc_in, MY_swap_std_reloc_out, MY_get_section_contents):
667         Define.
668         (aoutx.h): Include it.
669         (MY(swap_std_reloc_{in,out})): New functions.
670         Use RELOC_ARM_BITS_NEG_{BIG,LITTLE} to extract negative reloc bit.
671         (aoutarm_squirt_out_relocs): Delete.
672  
673         From: David Taylor (dtaylor@armltd.co.uk)
674         * config/arm[lb]-aout.mt: New files.
675         * aout-arm.c: New file.
676         * config.bfd: Handle arm{,e[lb]}-*-aout
677         * configure.in: Add vetor for aout_arm_{big,little}_vec.
678         * reloc.c: New relocation types for the ARM.
679         * targets.c (aout_arm_{big,little}_vec): declare.
680
681 Tue May 16 10:29:51 1995  Jim Kingdon  <kingdon@deneb.cygnus.com>
682
683         * libbfd.c (bfd_stat): If bfd_cache_lookup returns an error,
684         return an error to the caller.  Call bfd_set_error on errors.
685
686 Tue May 16 14:44:45 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
687
688         * libcoff-in.h (coff_renumber_symbols): Modified prototypes in
689         accordance with 11 May libcoff.h change.
690
691 Thu May 11 16:43:14 1995  Steve Chamberlain  <sac@slash.cygnus.com>
692
693         tekhex.c (first_phase): Understand type 0 symbols.
694         (tekhex_write_object_contents): Fix typo in final record.
695
696 Thu May 11 16:43:14 1995  Steve Chamberlain  <sac@slash.cygnus.com>
697
698         * coff-i960.c (optcall_callback): don't try and optimize
699         undefined refs. 
700         (coff_write_relocs): Search for broken relocs on the way
701         out and fix them up.
702         (coff_renumber_symbols): Calculate and return index of
703         first undefined symbol.
704         (coff_write_object_contents): Call coff_renumber_symbols 
705         and coff_write_relocs with the new args.
706         * libcoff.h: (coff_renumber_symbols, coff_renumber_symbols):
707         Modified prototypes.
708
709 Thu May 11 16:43:14 1995  Steve Chamberlain  <sac@slash.cygnus.com>
710                           Tom Griest <griest@cs.yale.edu>
711
712         Initial support for PE format. 
713         
714         * Makefile.in, targets.c, configure.in, config.bfd:
715         Add support for i386-*-winnt and i386-*-pe.
716         * archive.c (do_slurp_coff_armap):  Understand NTPE format
717         archives.
718         (_bfd_slurp_extended_name_table): Turn \ in a filename
719         into /.
720         * bfd-in.h (bfd_link_subsystem, _bfd_link_stack_heap): New.
721         * coff-i386.c  (howto_table): Conditionalize PCRELOFFSET.
722         * coffcode.h (IMAGE_BASE): New.
723         (coff_compute_section_file_positions): Throw away .junk
724         sections for PE, align symbols.
725         (coff_write_object_contents): Throw away .junk sections
726         for PE. Remember info on .idata and .rsrc sections.
727         Fill in the PE header.
728         (coff_slurp_symbol_table): PE uses C_SECTION class.
729         * cofflink.c (_bfd_coff_final_link): Keep PE info up to date.
730         (_bfd_coff_generic_relocate_section): Cope with PE relocs.
731         * coffswap.h (coff_swap_{aout/file/scn/sym}hdr_{in/out}): 
732         New code for PE headers.
733
734 Tue May  9 17:01:38 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
735
736         * config.bfd: Add little endian PowerPC support.
737         * configure.in: Ditto.
738         * targets.c: Ditto.
739         * config/ppcle-elf.mt: New file, for little endian PowerPC
740         support.
741         * config/ppc-elf.mt: Add little endian powerpc to the BFD
742         selection vectors.
743         * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Complain if
744         linking a different endian object than we expect.
745         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define, to provide little
746         endian support.
747
748 Tue May  2 16:32:24 1995  Jeff Law  (law@snake.cs.utah.edu)
749
750         * config.bfd (hppa*-*-lites*): Treat just like hppa*-*-*elf*.
751
752 Tue Apr 25 19:38:43 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
753
754         * coffgen.c (make_a_section_from_file): Initialize lma same as
755         vma.
756
757 Tue Apr 25 11:03:21 1995  Jason Molenda  (crash@phydeaux.cygnus.com)
758
759         * hosts/std-host.h: #include ansidecl.h 'cause PTR is used in
760         std-host.h.
761
762 Mon Apr 24 23:56:44 1995  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
763
764         * hosts/i386linux.h (HAVE_PROCFS): Don't define it.  Added lengthy
765         comment explaining why.
766
767 Mon Apr 24 10:34:02 1995  Michael Meissner  <meissner@cygnus.com>
768
769         * hosts/i386linux.h (HAVE_PROCFS): If NO_PROCFS is defined, don't
770         define HAVE_PROCFS.
771
772 Mon Apr 24 08:33:12 1995  Michael Meissner  <meissner@cygnus.com>
773
774         * elf32-ppc.c (ppc_elf_relocate_section): Do not continue
775         processing unknown symbols to prevent a cascade of errors.
776
777 Fri Apr 21 12:48:48 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
778
779         Patches from H.J. Lu for Linux ELF core file support.
780         * elfcode.h (elf_core_file_matches_executable_p) [HAVE_PROCFS]:
781         Use prpsinfo_t instead of struct prpsinfo, for consistency.
782         * hosts/i386linux.h (HAVE_PROCFS): Define.
783
784 Thu Apr 20 09:07:39 1995  Steve Chamberlain  <sac@slash.cygnus.com>
785
786         * linker.c (link_action): Do the right thing when a undefined
787         strong symbol appears after an undefined weak symbol.
788
789 Fri Apr 14 16:51:17 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
790
791         * elf32-ppc.c (ppc_elf_relocate_section): New function to relocate
792         a whole section for the linker, bypassing bfd_perform_relocation.
793         (ppc_elf_reloc_type_lookup): New function to map the BFD
794         enumeration code into a howto structure.
795         (ppc_elf_howto_raw): Rename from ppc_elf_howto_table.
796         (ppc_elf_howto_table): New array that maps PowerPC relocation
797         numbers to howto structures without a linear search.  Change from
798         using bfd_elf_generic_reloc to use ppc_elf_std_reloc.
799         (ppc_elf_howto_init): Initialize ppc_elf_howto_table from
800         ppc_elf_howto_raw.
801         (ppc_elf_reloc_type_lookup): Use a case statement instead of a
802         loop.
803         (ppc_elf_std_reloc): Replacement for bfd_elf_generic_reloc.
804         (ppc_elf_unsupported_reloc): Print a real error message, instead
805         of calling abort.
806         (ppc_elf_addr16_ha_inner): Abstract getting adjustment from
807         ppc_elf_addr16_ha_reloc, so ppc_elf_relocate_section can use it
808         too.
809         (ppc_elf_addr16_ha_reloc): Call it.
810         (ppc_elf_got16_inner): Abstract getting adjustment from
811         ppc_elf_got16_reloc, so ppc_elf_relocate_section can use it too.
812         (ppc_elf_got16_reloc): Call it.
813         (ppc_elf_info_to_howto): Rename from powerpc_info_to_howto.
814
815         * elfcode.h (elf_symbol_from_bfd_symbol): Omit space in debugging
816         output.
817         (elf_symbol_flags): Add debug function to decode flags so that
818         defining DEBUG to be 4 will compile again.
819         (elf_debug_section): Fix typo in debug output.
820
821 Fri Apr 14 16:03:04 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
822
823         * config.bfd: Add m68*-*-elf*.
824         * elf32-m68k.c: Filled out implementation, except for dynamic
825         linking support.
826         * reloc.c (enum bfd_reloc_code_real): Added *_GOT_PCREL, *_GOTOFF,
827         *_PLT_PCREL, *_PLTOFF, *_68K_* relocations for ELF.
828         * libbfd.h, bfd-in2.h: Regenerated.
829
830 Thu Apr 13 14:28:04 1995  Torbjorn Granlund  <tege@adder.cygnus.com>
831
832         * coff-m68k.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from
833         1 to 2.
834         (bfd_target): Change minimum section alignment from 1 to 2.
835
836 Wed Apr 12 12:40:04 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
837
838         * aoutx.h (machine_type, case bfd_arch_mips): Treat R8000 like
839         R6000 and R4000 for now.
840
841 Tue Apr  4 12:28:25 1995  Stan Shebs  <shebs@andros.cygnus.com>
842
843         * mpw-config.in: New file, MPW version of configure.in.
844         * mpw-make.in: New file, MPW version of Makefile.in.
845         * hosts/mpw.h: New file, MPW host definitions.
846         * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_in) [MPW_C]:
847         Alternate versions without ECOFF_64 that chokes MPW C.
848         * coffswap.h (coff_swap_scnhdr_out): Add alternative version with
849         partly-expanded macros.
850
851 Thu Mar 30 14:56:21 1995  Ian Lance Taylor  <ian@cygnus.com>
852
853         * reloc.c (bfd_perform_relocation): Don't bother to check for
854         overflow if the symbol is undefined.
855
856 Thu Mar 30 14:32:26 1995  H.J. Lu (hjl@nynexst.com)
857
858         * config.bfd: Change linux to default to elf.  Using
859         i[345]86-*-linuxaout will build a library which defaults to a.out.
860         * config/i386-laout.mt: Rename from old config/i386-linux.mt.
861         * config/i386-linux.mt: Rename from old config/i386-lelf.mt.
862         Comment out EXTRALIBS.
863         * config/i386-lelf.mt: Remove.
864
865 Wed Mar 29 12:01:30 1995  Ian Lance Taylor  <ian@cygnus.com>
866
867         * coff-i960.c (coff_i960_relocate): Cache the section symbol in
868         the used_by_bfd field of the section, to avoid looping for each
869         reloc.
870
871         * cpu-h8500.c (arch_info_struct): Change name from "H8/300" to
872         "h8300" for consistency with other cpu-* files.
873
874 Tue Mar 28 15:14:11 1995  Ian Lance Taylor  <ian@cygnus.com>
875
876         * bout.c (b_out_canonicalize_reloc): Handle SEC_CONSTRUCTOR
877         sections.
878         (b_out_get_reloc_upper_bound): Likewise.
879
880         * linker.c (generic_link_add_symbol_list): Skip constructor
881         symbols which the main linker code did not do anything with.
882         (_bfd_generic_link_output_symbols): Use udata.p if it is set,
883         rather than looking the symbol up in the hash table.  Just pass
884         through constructor symbols for which udata.p is not set.  If the
885         linker defined the symbol, clear the constructor flag.
886
887 Tue Mar 21 10:50:32 1995  Jeff Law  (law@snake.cs.utah.edu)
888
889         * som.c (som_set_reloc_info): Sign extend constants from
890         R_DATA_OVERRIDE fixups.
891         * libhppa.h (sign_extend): Renamed from sign_ext.  Fix.
892         (low_sign_extend): Likewise.
893
894 Mon Mar 20 22:39:10 1995  Jeff Law  (law@snake.cs.utah.edu)
895
896         * som.c (som_slurp_symbol_table): Tighten test to determine
897         what symbols are section symbols.
898
899 Sat Mar 18 01:54:45 1995  Ian Lance Taylor  <ian@cygnus.com>
900
901         * elfcode.h (elf_bfd_link_add_symbols): An empty archive is OK.
902
903 Fri Mar 17 16:29:02 1995  Jeff Law  (law@snake.cs.utah.edu)
904
905         * som.c (som_bfd_copy_private_section_data): Just return true when
906         either the input or output section isn't attached to a SOM BFD.
907         (som_bfd_copy_private_bfd_data): Similarly for BFD private data.
908
909 Fri Mar 17 11:50:34 1995  Ian Lance Taylor  <ian@cygnus.com>
910
911         * elfcode.h (elf_link_add_object_symbols): Check whether a dynamic
912         object has already been included, and ignore it the second time.
913
914 Wed Mar 15 11:56:40 1995  Ian Lance Taylor  <ian@cygnus.com>
915
916         * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT13 from
917         complain_overflow_bitfield to complain_overflow_signed.
918
919         * libelf.h (bfd_elf32__write_relocs): Don't declare.
920         (bfd_elf64__write_relocs): Don't declare.
921
922 Tue Mar 14 05:54:33 1995  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
923
924         * stab-syms.c (aout_stab_name): Moved aout_stab_names to be local
925         to this function.  Recoded function to stop using table, to
926         improve performance (on i486-netbsd host).  Left old version
927         intact under "#if 0" for further performance testing.
928
929 Mon Mar 13 13:48:49 1995  Ian Lance Taylor  <ian@cygnus.com>
930
931         * elfcode.h (write_relocs): Make static.  Use PTR argument as a
932         pointer to a boolean variable set to true if something fails.
933         Cast to PTR rather than void *.
934         (sym_is_global): Rewrite for clarity.
935         (map_program_segments): If the program header size is too small,
936         call _bfd_error_handler and return failure rather than aborting.
937         (NAME(bfd_elf,write_object_contents)): Pass boolean variable when
938         calling write_relocs.
939         (elf_symbol_from_bfd_symbol): Use BFD_ASSERT rather than abort.
940         (struct elf_info_failed): Define.
941         (NAME(bfd_elf,size_dynamic_sections)): Declare variables in inner
942         blocks.  Pass elf_info_failed structure when calling
943         elf_export_symbol and elf_adjust_dynamic_symbol.
944         (elf_export_symbol): Treat data argument as elf_info_failed rather
945         than bfd_link_info.  Set failed field on error.
946         (elf_adjust_dynamic_symbol): Likewise.
947         (struct elf_finfo_failed): Define.
948         (elf_bfd_final_link): Pass elf_finfo_failed structure when calling
949         elf_link_output_extsym.  Use BFD_ASSERT rather than abort.
950         (elf_link_output_extsym): Treat data argument as elf_finfo_failed
951         rather than elf_final_link_info.  Set failed field on error.
952         (elf_link_input_bfd): Use BFD_ASSERT rather than abort.
953         (elf_reloc_link_order): Likewise.
954
955         * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Only write
956         out PLTRELSZ, PLTREL and JMPREL relocs if there is a .rela.plt
957         section.  Solaris 2.4 apparently does not handle empty reloc
958         information correctly.
959
960         * archive.c (bsd_write_armap): Cast getuid and getgid results to
961         long, and print with %ld.
962
963 start-sanitize-arc
964 Sun Mar 12 05:22:10 1995  Doug Evans  <dje@chestnut.cygnus.com>
965
966         * elf32-arc.c (elf_arc_howto_table): Relocs with implicit addends
967         don't work too well with zero src_masks.  Correct values.
968 end-sanitize-arc
969
970 Fri Mar 10 16:41:05 1995  Ian Lance Taylor  <ian@cygnus.com>
971
972         * aoutx.h (translate_to_native_sym_flags): Always use the output
973         section if it is not NULL.
974
975 Thu Mar  9 15:06:25 1995  Ian Lance Taylor  <ian@cygnus.com>
976
977         * coffswap.h (coff_swap_scnhdr_out): If the line number count or
978         the reloc count does not fit, print an error and return 0.
979         * coffcode.h (coff_write_object_contents): Check return value of
980         coff_swap_scnhdr_out.
981         * ecoff.c (_bfd_ecoff_write_object_contents): Check return value
982         of bfd_coff_swap_scnhdr_out.
983
984         * bfd.c: Include <stdarg.h> or <varargs.h>, depending upon
985         ANSI_PROTOTYPES.
986         (bfd_error_handler_type): New global type.
987         (_bfd_error_program_name): New static variable.
988         (_bfd_default_error_handler): New static function.
989         (_bfd_error_handler): New BFD private global variable.
990         (bfd_set_error_handler): New globally visible function.
991         (bfd_set_error_program_name): New globally visible function.
992         * libbfd-in.h (_bfd_error_handler): Declare.
993         * bfd-in2.h, libbfd.h: Rebuild.
994
995         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter,
996         and use it instead of bfd_get_symcount.  Check r_index after
997         setting r_extern based on whether this is a base relative reloc.
998         (NAME(aout,swap_std_reloc_IN)): Add symcount parameter, and use it
999         instead of bfd_get_symcount.
1000         (NAME(aout,slurp_reloc_table)): Pass bfd_get_symcount to reloc
1001         swap routines.
1002         * libaout.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter
1003         to declaration.
1004         (NAME(aout,swap_std_reloc_in)): Likewise.
1005         * sunos.c (sunos_canonicalize_dynamic_reloc): Pass
1006         info->dynsym_count to reloc swap routines.
1007         * aout-ns32k.c (MY_swap_std_reloc_in): Add symcount parameter.
1008         * hp300hpux.c (MY(swap_std_reloc_in)): Likewise.
1009         (MY(slurp_reloc_table)): Pass bfd_get_symcount to reloc swap
1010         routine.
1011         * i386lynx.c (NAME(lynx,swap_ext_reloc_in)): Add symcount
1012         parameter.
1013         (NAME(lynx,swap_std_reloc_in)): Likewise.
1014         (NAME(lynx,slurp_reloc_table)): Pass bfd_get_symcount to reloc
1015         swap routines.
1016
1017 Thu Mar  9 12:04:05 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
1018
1019         * bfd.c (bfd_merge_private_bfd_data): New function vector to be
1020         called by the linker to merge any private bfd data of the input
1021         files and the output file.  Used by the PowerPC ELF support to
1022         check whether -mrelocatable is used for all modules.
1023         (bfd_set_private_flags): New function vector to be called by the
1024         assembler to set private flags.  Used by the PowerPC ELF support
1025         to set that a particular object file was assembled with the
1026         -mrelocatable option.
1027
1028         * targets.c (BFD_JUMP_TABLE_COPY): Add intiialization of the
1029         bfd_merge_private_bfd_data and bfd_set_private_flags function
1030         vectors.
1031
1032         * bfd-in2.h, libbfd-in.h: Rebuild with bfd.c and targets.c
1033         changes.
1034
1035         * elf32-ppc.c (ppc_elf_set_private_flags): New function to set the
1036         ELF e_flags field.
1037         (ppc_elf_copy_private_bfd_data): Copy the e_flags field from the
1038         input file to the output file.
1039         (ppc_elf_merge_private_bfd_data): Check for a mismatch between the
1040         e_flags field of all of the linker input files.
1041
1042         * libelf.h (elf_obj_tdata): Add ppc_flags_init field so that the
1043         PowerPC support can check if compataible e_flags are present.
1044
1045         * aout-target.h: Add NOP for the bfd_merge_private_bfd_data
1046         and bfd_set_private_flags function vectors.
1047         * coffcode.h: Ditto.
1048         * elf32-target.h: Ditto.
1049         * elf64-target.h: Ditto.
1050         * libbfd.h: Ditto.
1051         * libecoff.h: Ditto.
1052         * som.c: Ditto.
1053
1054 Wed Mar  8 00:53:54 1995  Ian Lance Taylor  <ian@cygnus.com>
1055
1056         * cpu-mips.c (arch_info_struct): Add mips:8000 entry.
1057
1058         * elfcode.h (swap_out_syms): Mark an undefined BSF_WEAK symbol as
1059         STB_WEAK rather than STB_GLOBAL.
1060
1061 start-sanitize-arc
1062 Tue Mar  7 20:34:43 1995  Doug Evans  <dje@chestnut.cygnus.com>
1063
1064         * configure.in (SELECT_VECS): Split bfd_elf32_arc_vec into big/little.
1065         * targets.c (bfd_target_vector): Likewise.
1066         * elf32-arc.c (TARGET_BIG_SYM): Define.
1067         (TARGET_BIG_NAME): Define.
1068         * config/arc-elf.mt (DEFAULT_VECTOR): Set to bfd_elf32_littlearc_vec.
1069         (SELECT_VECS): Add bfd_elf32_bigarc_vec.
1070 end-sanitize-arc
1071
1072 Tue Mar  7 12:23:47 1995  Ian Lance Taylor  <ian@cygnus.com>
1073
1074         * coffcode.h (bfd_coff_backend_data): Add new field
1075         _bfd_coff_adjust_symndx.
1076         (bfd_coff_adjust_symndx): Define.
1077         (coff_adjust_symndx): Define as NULL if not already defined.
1078         (bfd_coff_std_swap_table): Initialize new field to
1079         coff_adjust_symndx.
1080         * cofflink.c (coff_link_input_bfd): Call coff_adjust_symndx if it
1081         is defined.
1082         * coff-a29k.c (coff_a29k_adjust_symndx): New static function.
1083         (coff_adjust_symndx): Define before including coffcode.h.
1084         * libcoff.h: Rebuild.
1085
1086         * format.c (bfd_check_format_matches): Skip binary_vec when
1087         searching through bfd_target_vector.
1088
1089         * elfcode.h (elf_sort_hdrs): Check SHT_NOBITS before checking
1090         sh_size.
1091
1092 Mon Mar  6 23:31:36 1995  Doug Evans  <dje@chestnut.cygnus.com>
1093
1094         * elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after
1095         !SHT_NOBITS ones.
1096
1097 Mon Mar  6 09:53:08 1995  Jeff Law  (law@snake.cs.utah.edu)
1098
1099         * cpu-hppa.c (arch_info_struct): Support both PA1.0 and PA1.1
1100         machine types.
1101         (bfd_hppa_arch): Link in both PA1.0 and PA1.1 architecture info
1102         structures.
1103         * libhppa.h (enum pa_arch): New enumeration to describe the
1104         different variants of the PA architecture.
1105         * som.c (som_object_setup): Use new enumeration to set machine
1106         type.
1107         (som_finish_writing): If the machine type is PA1.1, then use the
1108         PA1.1 machine identifier in the output file.
1109
1110 Thu Mar  2 15:58:24 1995  Ian Lance Taylor  <ian@cygnus.com>
1111
1112         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Treat the index of a
1113         base relative reloc as an index into the symbol table, regardless
1114         of the setting of r_extern.
1115         (NAME(aout,swap_std_reloc_in)): Likewise.
1116
1117         * aoutx.h (NAME(aout,set_section_contents)): Double check that the
1118         caller is writing to a valid section.
1119
1120 Thu Mar  2 14:37:57 1995  Bryan Ford  <baford@cs.utah.edu>
1121
1122         * binary.c: Add support for reading binary files.  Loads the raw
1123         contents of the file into a data section and wraps some symbols
1124         around it.  The symbols `_binary_<filename>_start' and
1125         `_binary_<filename>_end' indicate the start and end of the data,
1126         while `_binary_<filename>_size' is an absolute symbol whose value
1127         is the size of the data.  <filename> is the name of the binary
1128         input file, with all non-alphanumeric characters converted to
1129         underscores.
1130
1131         * archures.c (bfd_arch_get_compatible): Assume users knows what
1132         they're doing if one of the architectures is bfd_arch_unknown.
1133
1134 Wed Mar  1 17:30:46 1995  Michael Meissner  <meissner@cygnus.com>
1135
1136         * elf32-ppc.c (elf_powerpc_howto_table): For relocation
1137         R_PPC_GOT16, change complain_on_overflow to be
1138         complain_overflow_signed.
1139
1140 Wed Mar  1 11:52:55 1995  Jason Molenda  <crash@phydeaux.cygnus.com>
1141
1142         * configure.host: Recognize powerpc-*-aix*.
1143
1144 Wed Mar  1 11:57:39 1995  Ian Lance Taylor  <ian@cygnus.com>
1145
1146         * coff-i960.c (COFF_PAGE_SIZE): Define.
1147
1148         * configure.in: Rewrite output of TDEFAULTS to avoid relying on
1149         semantics of single quotes in parameter substitution.
1150
1151 Tue Feb 28 12:53:09 1995  Ian Lance Taylor  <ian@cygnus.com>
1152
1153         * elfcode.h (elf_sort_hdrs): Sort empty sections before non-empty
1154         sections, if they have the same VMA.
1155
1156         * config.bfd (i[345]86-*-linuxelf*): New target.  Use i386-lelf.
1157         (i[345]86-*-gnuelf*): New target.  Use i386-gelf.
1158         * config/i386-lelf.mt: New file.
1159         * config/i386-gelf.mt: New file.
1160
1161 Mon Feb 27 12:58:25 1995  Kung Hsu  <kung@mexican.cygnus.com>
1162
1163         * config.bfd: add a29k-*-vxworks configuration.
1164
1165 Wed Feb 22 14:40:26 1995  Ian Lance Taylor  <ian@cygnus.com>
1166
1167         * libaout.h (NAME(aout,slurp_reloc_table)): Change declaration to
1168         use reloc_howto_type rather than const struct reloc_howto_struct.
1169
1170 Tue Feb 21 18:19:22 1995  Ian Lance Taylor  <ian@cygnus.com>
1171
1172         * bout.c (b_out_slurp_reloc_table): Don't return an error if asked
1173         for relocations for the .bss section.
1174
1175 Tue Feb 21 15:13:05 1995  Jeff Law  (law@snake.cs.utah.edu)
1176
1177         * som.c (som_bfd_ar_write_symbol_stuff): Handle objects with odd
1178         lengths.
1179
1180 Fri Feb 17 12:34:36 1995  Michael Meissner  <meissner@cygnus.com>
1181
1182         * elf32-ppc.c (ppc_elf_got16_reloc): Make GOT style relocs add
1183         32768, so the GOT pointer can point to 16384 pointers, instead of
1184         8192.
1185
1186 Fri Feb 17 11:45:38 1995  Ian Lance Taylor  <ian@cygnus.com>
1187
1188         * hosts/sysv4.h: Include <unistd.h>, <stdlib.h>, and <time.h>.
1189         Only define SEEK_SET and SEEK_CUR if they are not already defined.
1190         Remove all external function declarations.
1191
1192         * syms.c (bfd_decode_symclass): Return 'W' for a weak symbol.
1193
1194         * coffgen.c (coff_real_object_p): Set start address and flags
1195         before calling coff_mkobject_hook.  Restore them on failure.
1196         * ecoff.c (_bfd_ecoff_mkobject_hook): If not ECOFF_AOUT_ZMAGIC,
1197         clear D_PAGED.
1198
1199         * coffgen.c: Reindented.
1200
1201 Thu Feb 16 14:37:23 1995  Doug Evans  <dje@cygnus.com>
1202
1203         * reloc.c (bfd_perform_relocation): Don't use bitpos in overflow
1204         calculations.
1205         (bfd_install_relocation): Likewise.
1206
1207 Thu Feb 16 13:22:29 1995  Ian Lance Taylor  <ian@cygnus.com>
1208
1209         * hosts/std-host.h: Remove all function declarations which return
1210         int or void, except the one for free.
1211
1212 Wed Feb 15 14:54:18 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
1213
1214         * elf32-ppc.c (elf_powerpc_howto_table): Use a destination mask of
1215         0xffffffff for R_PPC_REL32, not 0.
1216         (powerpc_reloc_map): Add low 16 bit, high 16 bit, and high 16 bit
1217         adjusted relocations.
1218
1219 Tue Feb 14 17:47:17 1995  Ian Lance Taylor  <ian@cygnus.com>
1220
1221         * elf32-mips.c (struct mips_elf_find_line): Define.
1222         (mips_elf_find_nearest_line): New static function.
1223         (bfd_elf32_find_nearest_line): Define.
1224         * libelf.h (struct elf_obj_tdata): Add find_line_info field.
1225
1226         * ecoff.c (_bfd_ecoff_swap_tir_in): Move to ecofflink.c.
1227         (_bfd_ecoff_swap_tir_out): Likewise.
1228         (_bfd_ecoff_swap_rndx_in): Likewise.
1229         (_bfd_ecoff_swap_rndx_out): Likewise.
1230         (cmp_fdrtab_entry): Likewise.
1231         (mk_fdrtab): Likewise.
1232         (lookup): Likewise.
1233         (_bfd_ecoff_find_nearest_line): Just call _bfd_ecoff_locate_line
1234         to do most of the work.  Allocate find_line_info if necessary.
1235         * ecofflink.c: Include "aout/stab_gnu.h".
1236         (_bfd_ecoff_swap_tir_in): Move in from ecoff.c.
1237         (_bfd_ecoff_swap_tir_out): Likewise.
1238         (_bfd_ecoff_swap_rndx_in): Likewise.
1239         (_bfd_ecoff_swap_rndx_out): Likewise.
1240         (cmp_fdrtab_entry): Likewise.  Use PTR instead of void *.
1241         (mk_fdrtab): Move in from ecoff.c.  Add debug_info, debug_swap,
1242         and line_info arguments, and use them instead of ecoff_data.
1243         (fdrtab_lookup): Move in from lookup in ecoff.c.  Remove abfd
1244         argument, add line_info argument.  Use it instead of ecoff_data.
1245         (_bfd_ecoff_locate_line): New function, mostly from the old
1246         _bfd_ecoff_find_nearest_line in ecoff.c.
1247         * libecoff.h (ecoff_data_type): Remove find_buffer, fdrtab_len and
1248         fdrtab fields, replacing them find_line_info field.
1249         (_bfd_ecoff_swap_tir_in): Declare.
1250         (_bfd_ecoff_swap_tir_out): Declare.
1251         (_bfd_ecoff_swap_rndx_in): Declare.
1252         (_bfd_ecoff_swap_rndx_out): Declare.
1253         * libbfd-in.h (_bfd_ecoff_locate_line): Declare.
1254         * libbfd.h: Rebuild.
1255         * configure.in: Don't use ecoff.o for bfd_elf32_bigmips_vec or
1256         bfd_elf32_littlemips_vec.
1257         * Makefile.in: Rebuild dependencies.
1258
1259 Tue Feb 14 14:04:22 1995  Michael Meissner  <meissner@tiktok.cygnus.com>
1260
1261         * libelf.h (elf_backend_data): Add fields elf_machine_alt1 and
1262         elf_machine_alt2 which provide alternate versions of the machine
1263         code.
1264
1265         * elf32-ppc.c (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Define to
1266         recognize old versions of the PowerPC machine code.
1267
1268         * elf32-target.h (elf32_bed): Initialize alternate machine code
1269         fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2.
1270
1271         * elf64-target.h (elf64_bed): Initialize alternate machine code
1272         fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2.
1273
1274         * elfcode.h (elf_object_p, elf_core_file_p): In addition to the
1275         main machine code field, check the two alternate machine code
1276         fields.
1277
1278 Tue Feb 14 12:46:48 1995  Ian Lance Taylor  <ian@cygnus.com>
1279
1280         * aoutf1.h (MACHTYPE_OK): Don't define if already defined.  Don't
1281         accept M_SPARC if bfd_arch_sparc is not in the list of supported
1282         architectures, and don't accept a 680x0 machine type if
1283         bfd_arch_m68k is not in the list of supported architectures.
1284         * aout0.c (MACHTYPE_OK): Define.
1285
1286 Mon Feb 13 23:25:38 1995  Ian Lance Taylor  <ian@cygnus.com>
1287
1288         * aoutx.h (NAME(aout,swap_ext_reloc_in)): Don't return a pointer
1289         to garbage if the symbol index is out of range.
1290         (NAME(aout,swap_std_reloc_in)): Likewise.
1291
1292 start-sanitize-arc
1293 Mon Feb 13 09:35:30 1995  Doug Evans  <dje@canuck.cygnus.com>
1294
1295         * elf32-arc.c (reloc_type): New type R_ARC_B26.
1296         (elf_arc_howto_table): Likewise.
1297         * reloc.c (BFD_RELOC_ARC_B26): Likewise.
1298
1299 Thu Feb  9 17:31:40 1995  Doug Evans  <dje@canuck.cygnus.com>
1300
1301         * archures (bfd_mach_arc_base): #define.
1302         (bfd_mach_arc_host, bfd_mach_arc_graphics, bfd_mach_arc_audio): Ditto.
1303         * cpu-arc.c (arch_info_struct): Define entries for each cpu variant.
1304         (bfd_arc_arch): Link each one in.
1305         (arc_get_mach): New function.
1306         * elf32-arc.c (arc_info_to_howto_rel): Renamed from arc_info_to_howto.
1307         (elf_info_to_howto_rel): Update.
1308         (arc_elf_object_p, arc_elf_final_write_processing): New functions.
1309         (elf_backend_object_p): Define.
1310         (elf_backend_final_write_processing): Define.
1311         (USE_REL): Define.
1312 end-sanitize-arc
1313
1314 Thu Feb  9 18:36:52 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
1315
1316         * Makefile.in (BFD32_BACKENDS): Add i386msdos.o.
1317
1318 Thu Feb  9 12:02:35 1995  Ian Lance Taylor  <ian@cygnus.com>
1319
1320         * i386linux.c (NEEDS_SHRLIB): Define.
1321         (linux_tally_symbols): Crash if a NEEDS_SHRLIB symbol is
1322         undefined.  From hjl@nynexst.com (H.J. Lu).
1323
1324 Wed Feb  8 17:26:00 1995  Ian Lance Taylor  <ian@cygnus.com>
1325
1326         * linker.c (generic_link_check_archive_element): Allocate common
1327         symbol information structure.  Don't bother to check for common
1328         symbol size overflow.
1329         (_bfd_generic_link_add_one_symbol): Likewise.
1330         * aoutx.h (aout_link_check_ar_symbols): Likewise.
1331         * linker.c (generic_link_check_archive_element): Adjust references
1332         to common symbol information for new structure.
1333         (_bfd_generic_link_add_one_symbol): Likewise.
1334         * aoutx.h (aout_link_check_ar_symbols): Likewise.
1335         (aout_link_add_symbols): Likewise.
1336         * ecoff.c (ecoff_link_add_externals): Likewise.
1337         * elfcode.h (elf_link_add_object_symbols): Likewise.
1338         (elf_link_output_extsym): Likewise.
1339         * sunos.c (sunos_add_one_symbol): Likewise.
1340
1341 Wed Feb  8 09:53:42 1995  Doug Evans  <dje@canuck.cygnus.com>
1342
1343         * elfcode.h (elf_sort_hdrs): Put SHT_NOBITS sections after !SHT_NOBITS.
1344
1345 Tue Feb  7 16:27:33 1995  Jeff Law  (law@snake.cs.utah.edu)
1346
1347         * som.c (som_bfd_find_nearest_line): Just return false, don't
1348         abort.
1349
1350 Tue Feb  7 14:43:33 1995  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
1351
1352         * ecoff.c: Reformatted some comments and brace constructs in
1353         recent changes to GNU style.
1354         (cmp_fdrtab_entry, mk_fdrtab, lookup): Use old-style function
1355         definitions.
1356
1357 Tue Feb  7 14:21:28 1995  Ian Lance Taylor  <ian@cygnus.com>
1358
1359         * ecoffswap.h (ecoff_swap_pdr_in): Zero out intern before setting
1360         any of the fields.
1361
1362 Mon Feb  6 20:01:24 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
1363
1364         Sat Feb  4 14:20:24 1995  David Mosberger-Tang  <davidm@piston.cs.arizona.edu>
1365
1366         * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_out): added
1367         internalizing/externalizing new "prof" field.
1368
1369         * libecoff.h (ecoff_tdata): added fdrtab.
1370
1371         * ecoff.c (_bfd_ecoff_find_nearest_line): Fixed.
1372
1373 Mon Feb  6 14:25:24 1995  Ian Lance Taylor  <ian@cygnus.com>
1374
1375         * libelf.h (struct elf_link_hash_table): Add saw_needed field.
1376         * elfcode.h (elf_link_add_object_symbols): Set saw_needed if
1377         DT_NEEDED seen in .dynamic section.
1378         (elf_link_output_extsym): Warn if an undefined symbol is
1379         only referenced from a dynamic object, and not making a shared
1380         object, and saw_needed is false.
1381         * elf.c (_bfd_elf_link_hash_table_init): Initialize saw_needed.
1382
1383         * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Don't define.
1384         * elfcode.h (elf_link_add_object_symbols): Don't clear or set
1385         ELF_LINK_HASH_DEFINED_WEAK.
1386         (elf_link_output_extsym): Don't check ELF_LINK_HASH_DEFINED_WEAK.
1387
1388         Distinguish a weak defined symbol from a regular defined symbol.
1389         * linker.c (enum link_action): Add DEFW.
1390         (link_action): Add bfd_link_hash_defweak column.
1391         (_bfd_generic_link_add_one_symbol): Add DEFW case.  Handle
1392         bfd_link_hash_defweak in a few other cases.
1393         * Many files (bfd_link_hash_undefweak): Renamed from
1394         bfd_link_hash_weak.
1395         * aoutx.h (aout_link_write_symbols): Handle bfd_link_hash_defweak.
1396         (aout_link_write_other_symbol): Likewise.
1397         (aout_link_input_section_std): Likewise.
1398         (aout_link_input_section_ext): Likewise.
1399         * bout.c (get_value): Likewise.
1400         * coff-a29k.c (coff_a29k_relocate_section): Likewise.
1401         * coff-alpha.c (alpha_convert_external_reloc): Likewise.
1402         (alpha_relocate_section): Likewise.
1403         * coff-mips.c (mips_relocate_section): Likewise.
1404         (mips_relax_section): Likewise.
1405         (bfd_mips_ecoff_create_embedded_relocs): Likewise.
1406         * cofflink.c (coff_write_global_sym): Likewise.
1407         (_bfd_coff_generic_relocate_section): Likewise.
1408         * ecoff.c (ecoff_link_add_externals): Likewise.
1409         (ecoff_link_write_external): LIkewise.
1410         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
1411         (elf32_hppa_size_stubs): Likewise.
1412         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
1413         (elf_i386_relocate_section): Likewise.
1414         (elf_i386_finish_dynamic_symbol): Likewise.
1415         * elf32-mips.c (mips_elf_output_extsym): Likewise.
1416         (mips_elf_relocate_section): Likewise.
1417         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
1418         (elf32_sparc_relocate_section): Likewise.
1419         * elfcode.h (elf_link_add_object_symbols): Likewise.
1420         (elf_adjust_dynamic_symbol): Likewise.
1421         (elf_bfd_final_link): Likewise.
1422         (elf_link_output_extsym): Likewise.
1423         * i386linux.c (linux_add_one_symbol): Likewise.
1424         (linux_tally_symbols): Likewise.
1425         (linux_finish_dynamic_link): Likewise.
1426         * linker.c (_bfd_generic_link_output_symbols): Likewise.
1427         (set_symbol_from_hash): Likewise.
1428         * reloc16.c (bfd_coff_reloc16_get_value): Likewise.
1429         (bfd_perform_slip): Likewise.
1430         * sunos.c (sunos_add_one_symbol): Likewise.
1431         (sunos_scan_std_relocs): Likewise.
1432         (sunos_scan_ext_relocs): Likewise.
1433         (sunos_scan_dynamic_symbol): Likewise.
1434         (sunos_write_dynamic_symbol): Likewise.
1435
1436 Mon Feb  6 03:20:17 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
1437
1438         Changes from Bryan Ford, baford@schirf.cs.utah.edu:
1439         * config.bfd (i[345]86-*-msdos*): New target.
1440         * configure.in (i386msdos_vec): Handle it.
1441         * i386msdos.c: New file.
1442         * config/i386-msdos.mt: New file.
1443         * bfd.c (enum bfd_error): Added new value bfd_error_file_too_big.
1444         (bfd_errmsgs): Added string to table.
1445         * libaout.h (reloc_type-lookup): Declare it.
1446         * targets.c (enum bfd_flavour): Added bfd_target_msdos_flavour.
1447         (i386msdos_vec): Declare.
1448         (bfd_target_vector): Add it to the list.
1449         * bfd-in2.h: Regenerated.
1450
1451 Wed Feb  1 01:32:14 1995  Jeff Law  (law@snake.cs.utah.edu)
1452
1453         * som.c (som_set_reloc_info, case R_DATA_ONE_SYMBOL): If there's
1454         nothing in R_DATA_OVERRIDE, then try to find the addend in the
1455         section's contents.
1456         (som_write_fixups): Ignore the addend in a R_DATA_ONE_SYMBOL fixup.
1457
1458         * som.c (som_object_setup): More heruistics to detect the
1459         braindamaged HP OSF1 linker. 
1460         (setup_sections): Don't forget to free subspace_sections if we get
1461         an error.
1462         (som_slurp_string_table): Allocate strings on this bfd's obstack
1463         rather than directly out of the heap.
1464         (som_slurp_symbol_table): Likewise for the saved copy of the
1465         canonical symbols.
1466         (som_slurp_reloc_table): Likewise for the saved copy of the
1467         canonical relocations.  Free the native relocations when we're
1468         done with them.
1469
1470 Tue Jan 31 21:53:28 1995  Doug Evans  <dje@canuck.cygnus.com>
1471
1472         * libelf.h (struct elf_obj_tdata): New member program_header_size.
1473         * elfcode.h (get_program_header_size): New parameters sorted_hdrs,
1474         count, and maxpagesize.  All callers updated.
1475         If sorted_hdrs is non-NULL, use it to compute the number of segments.
1476         Save result in case called again.
1477         (assign_file_positions_except_relocs): Sort headers before calling
1478         get_program_header_size.
1479
1480 Tue Jan 31 15:27:53 1995  Ian Lance Taylor  <ian@cygnus.com>
1481
1482         * elfcode.h (map_program_segments): Add sorted_hdrs parameter.
1483         Search through it rather than through unsorted section headers.
1484         (assign_file_positions_except_relocs): Pass sorted_hdrs to
1485         map_program_segments.
1486
1487 Mon Jan 30 22:04:53 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
1488
1489         * ecoff.c (_bfd_ecoff_find_nearest_line): Fix problems in range
1490         checking.  Expect argument OFFSET to be section-relative.  From
1491         David Mosberger-Tang, davidm@piston.cs.arizona.edu.
1492
1493 Mon Jan 30 11:22:11 1995  Ian Lance Taylor  <ian@cygnus.com>
1494
1495         * elfcode.h (NAME(bfd_elf,record_link_assignment)): Don't do
1496         anything if we are not linking an ELF file.
1497         (NAME(bfd_elf,size_dynamic_sections)): Likewise.
1498
1499 Sat Jan 28 12:48:57 1995  Jeff Law  (law@snake.cs.utah.edu)
1500
1501         * som.c (compare_subspaces): New function to sort subspaces by
1502         their location in the object file.
1503         (setup_sections): When computing the index for each subspace,
1504         handle case where setup_sections reads the subspaces in a
1505         different order that they appear in the object file.
1506         (som_is_space): Also examine the output section for the containing
1507         section.
1508         (som_is_subspace, som_is_container): Likewise.
1509         (som_begin_writing): Don't prepare or write fixups here.  When
1510         writing the symbol strings, use the unsorted symbol table.
1511         (som_write_object_contents): Don't write the symbol table here.
1512         (som_finish_writing): Prepare and write the fixups here.  Likewise
1513         for the symbol table.
1514         (som_bfd_derive_misc_symbol_info): Undefined symbols always have
1515         type SS_UNSAT regardless of BSF_EXPORT.
1516         (som_set_reloc_info): Unpack and attach argument location
1517         information for R_PCREL_CALL and R_ABS_CALL relocations.
1518
1519         * som.c (som_object_setup): New heuristic to determine if the
1520         entry and flags fields are switched in the exec header.
1521
1522 Sat Jan 28 00:16:01 1995  Ian Lance Taylor  <ian@cygnus.com>
1523
1524         * elfcode.h (elf_link_add_object_symbols): Use *sym_hash instead
1525         of h if we might not be doing an ELF link.
1526
1527 Fri Jan 27 16:13:42 1995  Ian Lance Taylor  <ian@cygnus.com>
1528
1529         * elf32-mips.c (mips_elf_final_link): If the size of an input
1530         .reginfo section is zero, force it to the correct size, since the
1531         linker emulation code may have clobbered it.
1532
1533         * elfcode.h (elf_sort_hdrs): Correct SHF_ALLOC test.
1534         (assign_file_positions_except_relocs): Free sorted_hdrs.
1535
1536 Thu Jan 26 09:00:12 1995  Steve Chamberlain  <sac@splat>
1537
1538         * srec.c (srec_set_section_contents): Fix off by
1539         one end address calculation.
1540
1541         * config.bfd: (m68*-est-coff): New configuration.
1542
1543 Thu Jan 26 11:39:21 1995  Ian Lance Taylor  <ian@cygnus.com>
1544
1545         * elfcode.h (elf_link_add_object_symbols): Only examine weakdef if
1546         we are using an ELF hash table.
1547
1548         * aoutx.h (NAME(aout,some_aout_object_p)): Always set EXEC_P if
1549         the start address is in the .text section, even if STAT_FOR_EXEC
1550         is set.  Just use STAT_FOR_EXEC as an additional test.
1551
1552 Thu Jan 26 11:12:54 1995  Michael Meissner  <meissner@cygnus.com>
1553
1554         * elfcode.h (prep_headers): Use EM_PPC instead of
1555         EM_CYGNUS_POWERPC.
1556
1557         * elf32-ppc.c (reloc_type): Add all System V.4 and eABI
1558         relocations currently defined.
1559         (powerpc_reloc_map): Adjust to new relocation names.
1560         (elf_powerpc_howto_table): Add most of the new relocations.
1561         (ELF_MACHINE_CODE): Use EM_PPC instead of EM_CYGNUS_POWERPC.
1562
1563         * config.bfd: Add support for powerpc-*-eabi.
1564
1565         * config/ppc-elf.mt: Add rs6000 architecture support to the
1566         PowerPC.  Also add XCOFF support.
1567
1568 Wed Jan 25 23:26:13 1995  Ian Lance Taylor  <ian@cygnus.com>
1569
1570         * coff-sh.c (CALC_ADDEND): Don't define.
1571         (coff_sh_relocate_section): Remove.
1572         (coff_relocate_section): Use _bfd_coff_generic_relocate_section.
1573
1574 Tue Jan 24 14:22:47 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1575
1576         * elf32-mips.c (mips_elf_output_extsym): Set the value of the
1577         ECOFF symbol from the hash table entry.
1578
1579 Mon Jan 23 14:53:35 1995  Steve Chamberlain  <sac@splat>
1580
1581         * coff-sh.c (coff_sh_relocate_section):  Don't subtract
1582         vma twice.
1583
1584 Mon Jan 23 13:33:18 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1585
1586         * coff-sh.c (sh_reloc): Don't ignore the previous contents of an
1587         R_SH_IMM32 reloc.
1588
1589         * config.bfd (i[345]86-*-gnu*): Set bfd_name to i386-gnu.
1590         * config/i386-gnu.mt: New file.  Include ELF support.
1591
1592         * opncls.c (bfd_openstreamr): Call bfd_cache_init.
1593
1594 Fri Jan 20 11:44:45 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1595
1596         * sunos.c (sunos_add_one_symbol): Only set the sunos specific
1597         fields if we are doing a sunos link.
1598
1599 Wed Jan 18 12:28:17 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1600
1601         * cpu-h8300.c (h8300_info_struct): Change name from "H8/300" to
1602         "h8300" for consistency with other cpu-* files.
1603         (h8300h_info_struct): Change name from "H8/300H" to "h8300h".
1604         * coff-h8300.c (special): Remove unused variable diff.
1605
1606 Tue Jan 17 10:52:32 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1607
1608         * bfd-in.h (bfd_byte, reloc_howto_type): Define here, not...
1609         * reloc.c (bfd_byte, reloc_howto_type): here.
1610         * Changed all occurrences of ``const struct reloc_howto_struct''
1611         to be ``reloc_howto_type'' instead.
1612         * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
1613
1614         * opncls.c (bfd_openstreamr): New function.
1615         * bfd-in2.h: Rebuilt.
1616
1617         * elf32-mips.c (enum reloc_type): Define new relocs used on Irix.
1618         (elf_mips_howto_table): Add entries for new relocs.
1619         (mips_elf_section_from_shdr): Handle SHT_MIPS_MSYM,
1620         SHT_MIPS_DWARF, and SHT_MIPS_EVENTS.
1621         (mips_elf_fake_sections): Handle sections named .msym, .debug_*
1622         and .MIPS.events.*.
1623
1624         * srec.c (srec_init): Remove unused local variable i.
1625
1626 Sat Jan 14 19:09:48 1995  Steve Chamberlain  <sac@jonny>
1627
1628         * archures.c, Makefile.in, targets.c, bfd-in2.h, coffcode.h,
1629         config.bfd, configure.in, config/w65.mt: Initial support for the W65.
1630
1631 Sun Jan 15 13:57:45 1995  Steve Chamberlain  <sac@splat>
1632
1633         * opncls.c (bfd_fdopenr): Configure for WIN32.
1634
1635 Thu Jan 12 16:30:47 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
1636
1637         * Makefile.in (diststuff): Include `headers'.
1638
1639         * sunos.c (m68k_plt_first_entry, sparc_plt_first_entry): Now
1640         const.
1641         * tekhex.c (digs): Ditto.
1642         * elf32-i386.c (elf_i386_plt0_entry, elf_i386_plt_entry): Ditto.
1643
1644         * srec.c, tekhex.c: Include libiberty.h.  Delete static array
1645         hex_value and replace references to it with references to
1646         hex_init, hex_p, and hex_value.
1647         * Makefile.in: Updated dependencies.
1648
1649         * archures.c (archures_init_table): Now const.
1650         (bfd_arch_init): Adjusted type of local var `ptable'.
1651 start-sanitize-rce
1652
1653         * Makefile.in (ALL_MACHINES): Include cpu-rce.o.
1654         (BFD32_BACKENDS): Include aout-rce.o.
1655 end-sanitize-rce
1656 start-sanitize-arc
1657
1658         * Makefile.in (ALL_MACHINES): Include cpu-arc.o.
1659         (BFD32_BACKENDS): Include elf32-arc.o.
1660 end-sanitize-arc
1661
1662 Thu Jan 12 09:33:24 1995  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
1663
1664         * hosts/symmetry.h:  Redefine `shared' to enable compilation
1665         with the native Dynix cc compiler.
1666         * i386dynix.c:  Include aoutx.h instead of using routines
1667         from aout32.c.
1668
1669 Wed Jan 11 21:31:41 1995  Ken Raeburn  <raeburn@cujo.cygnus.com>
1670
1671         * reloc.c (reloc_howto_type): Make typedef include `const'.
1672         * aout-ns32k.c, aoutx.h, bout.c, cf-m68klynx.c, coff-i386.c,
1673         coff-i960.c, coff-m68k.c, cofflink.c, cpu-ns32k.c, ecoff.c,
1674         elf32-hppa.c, elf32-i386.c, elf32-mips.c, elf32-sparc.c,
1675         elfcode.h, libbfd-in.h, linker.c, mipsbsd.c, nlm32-ppc.c, oasys.c,
1676         reloc.c, som.c: Don't use `const' in combination with
1677         `reloc_howto_type'.
1678 start-sanitize-arc
1679         * elf32-arc.c: Ditto.
1680 end-sanitize-arc
1681         * bfd-in2.h, libbfd.h: Regenerated.
1682
1683         * ecoff.c (ecoff_type_to_string): Local variable `buffer1' doesn't
1684         need to be static.
1685
1686 Wed Jan 11 14:36:41 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1687
1688         * sunos.c (sunos_add_one_symbol): Don't core dump if a multiple
1689         definition of an absolute symbol is encountered.
1690
1691         * linker.c (_bfd_generic_link_add_one_symbol): Ignore
1692         redefinitions of an absolute symbol to the same value.
1693
1694 Mon Jan  9 15:51:32 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1695
1696         * elfcode.h (elf_link_add_object_symbols): It's reasonable for no
1697         flags to be set, so don't insist otherwise.
1698
1699 Fri Jan  6 16:39:40 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1700
1701         * elfcode.h (elf_slurp_symbol_table): Don't set BSF_GLOBAL for an
1702         undefined or common symbol.
1703         (elf_link_add_object_symbols): Likewise.
1704
1705 Wed Jan  4 14:14:05 1995  Jeff Law  (law@snake.cs.utah.edu)
1706
1707         * som.c (bfd_section_from_som_symbol): Only return sections which
1708         correspond to subspaces.
1709
1710         * som.c (som_begin_writing): Don't forget to bump the
1711         total_subspaces when writing the unloadable subspaces.
1712
1713 Wed Dec 28 20:54:47 1994  Jeff Law  (law@snake.cs.utah.edu)
1714
1715         * som.c (som_write_fixups): Use SEC_HAS_CONTENTS to identify
1716         bss-like sections.
1717         (som_get_section_contents): Likewise.
1718         (som_set_section_contents): Likewise.
1719
1720 Tue Dec 27 14:03:47 1994  Jeff Law  (law@snake.cs.utah.edu)
1721
1722         * som.c (setup_sections): Turn off SEC_HAS_CONTENTS for bss-like
1723         sections.
1724
1725 Tue Dec 20 15:30:12 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
1726
1727         * coffgen.c (bfd_debug_section): Deleted.
1728         (coff_section_from_bfd_index): Return absolute section for debug
1729         symbol.
1730         (coff_write_symbol): Set BSF_DEBUGGING for C_FILE symbols.  If
1731         BSF_DEBUGGING is set, set section to N_DEBUG.
1732         (coff_bfd_make_debug_symbol): Use absolute section.
1733
1734         * elfcode.h (assign_file_positions_except_relocs): In assertion,
1735         force all values to the same type.
1736
1737 Tue Dec 20 11:11:58 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
1738
1739         * coff-h8300.c (howto_table): All relocs get a special function.
1740         (special): Never do anything when linking -r.
1741
1742 Tue Dec 20 13:58:01 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1743
1744         * i386linux.c (linux_add_one_symbol): Don't do anything Linux
1745         specific if this is not a Linux hash table.  From Eric Youngdale
1746         <eric@aib.com>.
1747
1748         Patches from kkojima@mix.or.jp (Kazumoto Kojima):
1749         * mipsbsd.c (mips_howto_table_ext): Change sizes of memory relocs
1750         apply to from two bytes to four bytes.
1751         * MY(reloc_howto_type_lookup): Handle BFD_RELOC_CTOR.
1752
1753         * elf32-i386.c (elf_i386_relocate_section): Correct and expand the
1754         list of cases for which relocation need not be computed.
1755         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1756
1757 start-sanitize-arc
1758 Tue Dec 20 09:01:01 1994  Doug Evans  <dje@canuck.cygnus.com>
1759
1760         * elf32-arc.c (elf_arc_howto_table, R_ARC_B22_PCREL): Value is
1761         right-shifted 2 bits.  Fix dst_mask.
1762 end-sanitize-arc
1763
1764 Mon Dec 19 23:09:16 1994  Jeff Law  (law@snake.cs.utah.edu)
1765
1766         * elf32-hppa.c (elf32_hppa_read_symext_info): Delete do_locals and
1767         do_globals arguments, always read symbol extension information for
1768         globals and locals.  All callers changed.
1769         (elf32_hppa_size_stubs): Rework to only read symbol extension
1770         information once for each input bfd.  10% improvement in linker
1771         performance.
1772
1773 Fri Dec 16 12:28:46 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1774
1775         * elfcode.h (elf_section_from_bfd_section): Check
1776         bfd_is_abs_section, etc., only after checking for the section in
1777         the BFD and after calling the backend routine.
1778
1779 Wed Dec 14 20:21:58 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1780
1781         * elfcode.h (elf_map_symbols): Only use section symbols whose
1782         value is the start of the section, checking output_offset when
1783         using output_section.  When creating a new symbol, set the value
1784         to 0, since BFD symbol values are section relative.
1785
1786 Tue Dec 13 13:31:06 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1787
1788         * cpu-z8k.c (arch_info_struct): Make z8002 the default
1789         architecture.
1790
1791 Fri Dec  9 12:43:05 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1792
1793         * elfcode.h (elf_bfd_link_add_symbols): If the first object in the
1794         archive is not an ELF object, pass the archive to the add_symbols
1795         entry point appropriate for the first object.  From Eric Youngdale
1796         <eric@aib.com>.
1797         * aoutx.h (NAME(aout,link_add_symbols)): Similar change if the
1798         first object is not an a.out object.
1799
1800         * elf32-i386.c (elf_i386_relocate_section): Don't compute
1801         relocation in cases where we won't use it.
1802         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1803
1804 Thu Dec  8 14:19:41 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
1805
1806         * pc532-mach.c (NAME): Define to use ns32kaout prefix.
1807         * ns32knetbsd.c (NAME): Ditto.
1808         (ns32kaout_32_get_section_contents): Define to standard aout-32
1809         version.
1810
1811 Fri Dec  2 13:56:49 1994  Ian Lance Taylor  <ian@rtl.cygnus.com>
1812
1813         * coff-mips.c (mips_read_relocs): New static function, broken out
1814         of mips_relax_section.
1815         (mips_relax_section): Call mips_read_relocs.
1816         (bfd_mips_ecoff_create_embedded_relocs): New function.
1817         * bfd-in.h (bfd_mnips_ecoff_create_embedded_relocs): Declare.
1818         * bfd-in2.h: Rebuild.
1819
1820 Wed Nov 30 14:12:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1821
1822         * coff-sh.c: Use _bfd_dummy_target instead of no_archive.
1823
1824 start-sanitize-arc
1825 Tue Nov 29 17:14:21 1994  Doug Evans  <dje@canuck.cygnus.com>
1826
1827         * archures.c: Initial support for the ARC.
1828         * reloc.c, targets.c, config.bfd, configure.in, elfcode.h: Likewise.
1829         * bfd-in2.h: Regenerated.
1830         * libbfd.h: Likewise.
1831         * config/arc-elf.mt: New file.
1832 end-sanitize-arc
1833
1834 Tue Nov 29 14:00:19 1994  J.T. Conklin  <jtc@.rtl.cygnus.com>
1835
1836         * config.bfd (i[345]86-*-freebsd*): Use i386-bsd as bfd_name.
1837         * configure.host (i[345]86-*-freebsd*): Use i386bsd as my_host.
1838
1839 Mon Nov 28 15:36:04 1994  J.T. Conklin  (jtc@phishhead.cygnus.com)
1840
1841         * config/m68k-nbsd.mt (DEFAULT_VECTOR): set to m68knetbsd_vec.
1842         * Makefile.in: Rebuilt dependancies.
1843           (CFILES): Added m68knetbsd.c.
1844           (HFILES): Added netbsd.h.
1845
1846 Wed Nov 23 19:21:41 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
1847
1848         * coff-sh.c (shlcoff_vec): New target vector.
1849         (no_archive): New function.
1850         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Handle
1851         little endian SH.
1852         * configure.in: Handle shl.
1853         * targets.c (bfd_target_vector): Add shlcoff_vec.
1854         * config/sh-coff.mt (SELECT_VECS): Handle shl_coff_vec.
1855
1856 Wed Nov 23 10:50:13 1994  Jeff Law  (law@snake.cs.utah.edu)
1857
1858         * elfcode.h (write_relocs): Do not subtract the section's vma from
1859         the reloc's offset when writing .o's.  Instead add the section's
1860         vma to the reloc's offset when writing an executable or shared
1861         library.
1862
1863 Tue Nov 22 23:34:37 1994  Jeff Law  (law@snake.cs.utah.edu)
1864
1865         * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Do not add
1866         input_section->vma to the relocation's offset.
1867
1868 Mon Nov 21 12:37:25 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1869
1870         * srec.c (srec_get_reloc_upper_bound): Define.
1871         (srec_canonicalize_reloc): Define.
1872         (srec_bfd_reloc_type_lookup): Define.
1873         (srec_vec, symbolsrec_vec): Use BFD_JUMP_TABLE_RELOCS (srec).
1874
1875 Sat Nov 19 03:10:51 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
1876
1877         * configure.host (i[345]86-*-solaris*):  Use solaris2 to
1878         enable extraction of procfs info from core file for GDB.
1879
1880 Thu Nov 17 17:37:39 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
1881
1882         * reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL.
1883         * bfd-in2.h, libbfd.h: Rebuilt.
1884
1885 Thu Nov 17 13:12:08 1994  Jeff Law  (law@snake.cs.utah.edu)
1886
1887         * bfd/elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the
1888         vma from the output_section containing $global$ when computing
1889         global_vlaue.
1890
1891 Thu Nov 17 14:29:13 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1892
1893         * archive.c (_bfd_write_archive_contents): Round up the archive
1894         header size of the extended name table to an even number.
1895
1896 Wed Nov 16 16:08:06 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
1897
1898         * coff-sh.c: Deleted some code that was commented out or inside
1899         "#if 0".
1900         (COFF_LONG_FILENAMES): Define.
1901
1902         * cpu-sh.c (arch_info_struct): Convert name to lowercase, for
1903         consistency with other architectures.
1904
1905 Sat Nov 12 23:50:10 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1906
1907         * elfcode.h (elf_export_symbol): Also export symbols which are
1908         referenced by a regular file.
1909
1910 Fri Nov 11 14:29:31 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1911
1912         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add
1913         export_dynamic argument, and handle it.
1914         (elf_export_symbol): New function.
1915         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
1916         (bfd_elf64_size_dynamic_sections): Update declaration.
1917         * bfd-in2.h: Rebuild.
1918
1919 Fri Nov 11 10:35:33 1994  Jeff Law  (law@snake.cs.utah.edu)
1920
1921         * hpux-core.c (hpux_core_struct): Delete handles for the
1922         data, reg and stack sections.  They're never used.  Delete
1923         accessor macros.
1924         (make_bfd_asection): Use bfd_make_section_anyway since debugging
1925         cores from dynamic executables may have several sections with the
1926         same logical name.
1927         (hpux_core_core_file_p): Don't save handles to data, reg and
1928         stack sections.  Handle CORE_TEXT, CORE_MMF and CORE_SHM.
1929
1930 Tue Nov  8 13:03:30 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1931
1932         * bout.c (callj_callback): Add new argument shrinking.  Change all
1933         callers.  Handle relocs against section symbols correctly.  If not
1934         shrinking, don't subtract out dstidx; the subtraction is already
1935         in the object file.
1936
1937 Sun Nov  6 12:52:00 1994  Jeff Law  (law@snake.cs.utah.edu)
1938
1939         * som.h: Conditionally include <shl.h> and <dl.h>.
1940
1941 Thu Nov  3 18:19:13 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
1942
1943         * Makefile.in (ALL_MACHINES): Include m68knetbsd.o.
1944
1945         * config/i386linux.mh (EXTRALIBS): Include -lm.
1946
1947         Patches from DJ Delorie:
1948         * coff-go32.c: Replacement file, uses coff-i386.c with minor
1949         changes.
1950         * coff-i386.c (TARGET_UNDERSCORE): allow other files to override
1951         underscore also
1952         * makefile.dos: del ctor.o, add cofflink.o and elf32.o
1953
1954         * aoutx.h (adjust_o_magic): If user set data section vma, use it
1955         to determine the default bss vma.  Patch from Takada Hiroaki,
1956         hiro@is.s.u-tokyo.ac.jp.
1957         (machine_type, case bfd_arch_vax): Set *unknown to false.  Patch
1958         from John David Anglin <dave@hiauly1.hia.nrc.ca>.
1959
1960         * configure.in (tb): Rename ns32knetbsd_vec to pc532netbsd_vec,
1961         since that's what it's called.
1962
1963 Wed Nov  2 15:24:51 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1964
1965         * archive.c (normalize): Change to take a BFD as an argument.
1966         Change VMS version to use bfd_alloc rather than malloc, so that we
1967         don't lose the memory forever.
1968         (_bfd_construct_extended_name_table): Check the name of an archive
1969         entry which is not being extended, and correct it if it is wrong.
1970         This is necessary in case the archive was constructed by another
1971         program which put an entry in the extended name table which we
1972         don't plan to put in ourselves.  From jjc@jclark.com (James
1973         Clark).
1974         (bfd_dont_truncate_arname): Check return value of normalize.
1975
1976 Mon Oct 31 14:19:08 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
1977
1978         * elf32-hppa.c (ELF32_PARISC_SX_SIZE): Define.
1979         (ELF32_PARISC_SX_GET, ELF32_PARISC_SX_PUT): Define.
1980         (symextn_entry): Don't define.
1981         (symext_chain_size): Change type to bfd_size_type.
1982         (symextn_contents): Change type to bfd_byte *.
1983         (elf32_hppa_backend_begin_write_processing): Use
1984         ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS).
1985         (elf32_hppa_size_symext): Likewise.  Also, change type of sizep to
1986         bfd_size_type *.
1987         (elf_hppa_tc_make_sections): Cast symextn_contents assignment to
1988         bfd_byte *.  Use ELF32_PARISC_SX_PUT instead of direct assignment.
1989         (elf32_hppa_backend_symbol_table_processing): Use
1990         ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS).  Use
1991         ELF32_PARISC_SX_GET insetad of direct assignment.
1992         (elf32_hppa_read_symext_info): Change type of contents, and its
1993         assignment cast, to bfd_byte *.  Use ELF32_PARISC_SX_SIZE instead
1994         of sizeof (symextn_entry).  Use symext_entryS instead of
1995         symextn_entry.  Use ELF32_PARISC_SX_GET instead of direct
1996         assignment.
1997
1998         * archive.c (bfd_dont_truncate_arname): Add the ar padding
1999         character, if there is room for it, even if the name is the
2000         maximum length.
2001
2002         * elfcode.h (assign_file_positions_except_relocs): Sort the ELF
2003         headers by section address when assigning file positions.
2004         (elf_sort_hdrs): New static function.
2005
2006 Sun Oct 30 18:56:58 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2007
2008         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Create DT_INIT
2009         and DT_FINI dynamic entries based on the existence of _init and
2010         _fini symbols, not on the .init and .fini sections.  This is
2011         compatible with some SVR4 linkers.
2012         (elf_bfd_final_link): Corresponding change.
2013
2014 Sat Oct 29 12:18:10 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2015
2016         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't move a
2017         symbol with a PLT entry into the .plt section if it is defined in
2018         a regular file.
2019         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
2020
2021         * linker.c (_bfd_generic_link_add_archive_symbols): It's not an
2022         error if an empty archive has no symbol table.
2023         * ecoff.c (ecoff_link_add_archive_symbols): Likewise.
2024         * elfcode.h (elf_link_add_archive_symbols): Likewise.
2025
2026 Fri Oct 28 10:08:41 1994  J.T. Conklin  (jtc@rtl.cygnus.com)
2027
2028         NetBSD/m68k support, based on work by mikeb@snow.datametrics.com: 
2029         * config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name.
2030         * configure.in (m68knetbsd_vec): Added.
2031         * targets.c (bfd_m68knetbsd_vec): Added.
2032         * hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files.
2033         * Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c.
2034
2035         miscellaneous cleanup required by all netbsd targets, based on work 
2036         by Andrew Cagney <cagney@highland.com.au>:
2037         * netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR,
2038           N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed.  Generic a.out
2039           definitions work.
2040         * i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed.
2041           (MY(write_object_contents)): Use NetBSD's magic numbers
2042
2043 Thu Oct 27 16:59:52 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2044
2045         * libelf.h (struct bfd_elf_section_data): Add field dynindx.
2046         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Don't finalize
2047         the .dynsym, .dynstr or .hash sections until after the backend
2048         size_dynamic_sections routine, so that it can add dynamic symbols
2049         if it wants to.
2050         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't define the
2051         symbol to be in the .plt section when generating a shared library
2052         if it is a defined symbol.
2053         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
2054         (elf32_sparc_size_dynamic_sections): When generating a shared
2055         library, allocate space for a dynamic symbol for each output
2056         section, storing the index in the dynindx field of the ELF section
2057         data.  Adjust the other dynindx fields to account for this.
2058         (elf32_sparc_adjust_dynindx): New static function.
2059         (elf32_sparc_relocate_section): When copying a reloc into a shared
2060         library, use the original addend as appropriate.  Convert an
2061         R_SPARC_32 reloc into an R_SPARC_RELATIVE reloc.  Use the dynamic
2062         symbol index of the output section, not the normal symbol index.
2063         (elf32_sparc_finish_dynamic_sections): Don't die if a section does
2064         not exist when setting the value of the dynamic tags.  Write out
2065         a dynamic symbol for each output section.
2066
2067 Wed Oct 26 01:15:51 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2068
2069         * aoutx.h (aout_link_input_section): Don't bother to read or write
2070         the relocs if there aren't any.
2071
2072 Tue Oct 25 11:44:38 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2073
2074         * Makefile.in (ALL_MACHINES): Add tekhex.o.
2075         * targets.c (bfd_target_vector): If SELECT_VECS is not defined,
2076         include tekhex_vec.
2077         * tekhex.c (NIBBLE, ISHEX): Cast array arguments to unsigned char.
2078         (getvalue, getsym, out): Likewise.
2079         (find_chunk): Remove unused variable s.
2080         (first_phase): Remove unused variable s.
2081         (pass_over): Remove unused variable address.
2082         (tekhex_object_p): Remove unused variable section.
2083         (move_section_contents): Change return type from boolean to void.
2084         (tekhex_write_object_contents): Remove unused variables tdata and
2085         list.
2086
2087         * linker.c (enum link_action): Add CIND.
2088         (link_action): Change COMMON_ROW\indr from MDEF to CREF.  Change
2089         INDR_ROW\common from MDEF to CIND.
2090         (_bfd_generic_link_add_one_symbol): In CREF case, handle an
2091         existing symbol which is indirect rather than defined.  Add new
2092         CIND case.
2093
2094 Mon Oct 24 15:33:16 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2095
2096         Change S-record backend to use multiple sections to handle gaps in
2097         file.
2098         * srec.c (srec_data_list_struct): Move field next from last place
2099         to first.  Change type of data to bfd_byte *.
2100         (struct srec_symbol): Define.
2101         (tdata_type): Remove done_symbol_read, count, strings, symbol_idx,
2102         string_size, string_idx.  Change type of symbols to struct
2103         srec_symbol *.  Add symtail and csymbols.
2104         (low, high): Remove.
2105         (size_symbols, fillup_symbols, size_srec, fillup): Remove.
2106         (white, skipwhite, pass_over, object_p): Remove.
2107         (srec_mkobject): Call srec_init.  Adjust tdata initialization for
2108         field changes.
2109         (srec_get_byte, srec_bad_byte): New static functions.
2110         (srec_new_symbol, srec_scan): New static functions.
2111         (srec_object_p): Change type of b to bfd_byte.  Explicitly set
2112         wrong_format error.  Call srec_mkobject and srec_scan instead of
2113         object_p.
2114         (symbolsrec_object_p): Likewise.  Also, change b to be only two
2115         bytes.
2116         (srec_read_section): New static function.
2117         (srec_get_section_contents): Call srec_read_section rather than
2118         pass_over.  Handle zero length section correctly.
2119         (set_set_arch_mach): Change from function to macro.
2120         (srec_set_section_contents): Change data to bfd_byte *.
2121         (srec_write_record): Change data, end and src to bfd_byte *.
2122         (srec_write_header): Change buffer and dst to bfd_byte *.
2123         (srec_write_section): Change location to bfd_byte *.
2124         (srec_write_terminator): Change buffer to bfd_byte *.
2125         (srec_get_symtab_upper_bound): Don't call
2126         srec_get_section_contents.
2127         (srec_get_symtab): Rewrite.
2128
2129         * ecoff.c (ecoff_set_symbol_info): Set udata.i to 0, not NULL.
2130
2131 Fri Oct 21 16:43:13 1994  J.T. Conklin  (jtc@phishhead.cygnus.com)
2132
2133         * libaout.h (machine_type): added M_68K_NETBSD and M_SPARC_NETBSD.
2134         * i386netbsd.c, ns32knetbsd.c, sparcnetbsd.c: removed RCS Id's.
2135           changed how PAGE_SIZE and SEGMENT_SIZE are defined so they are
2136           consistant with each other.
2137         * netbsd.h (N_HEADER_IN_TEXT, TEXT_START_ADDR): NetBSD fits its
2138           header into the start of its text segment.
2139
2140 Fri Oct 21 17:13:07 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2141
2142         * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add case for
2143         _construct_extended_name_table.
2144         (bfd_target): Add _bfd_construct_extended_name_table.
2145         * archive.c (_bfd_archive_bsd_construct_extended_name_table): New
2146         function.
2147         (_bfd_archive_coff_construct_extended_name_table): New function.
2148         (_bfd_construct_extended_name_table): Renamed by adding a leading
2149         underscore, and made externally visible.  Added trailing_slash
2150         argument, and used it instead of elf_style.  Changed type of
2151         tablen to bfd_size_type *.
2152         (_bfd_write_archive_contents): Use BFD_SEND to call
2153         construct_extended_name_table.  Use the returned name.
2154         * libbfd-in.h (_bfd_construct_extended_name_table): Declare.
2155         (_bfd_noarchive_construct_extended_name_table): Define.
2156         (_bfd_archive_bsd_construct_extended_name_table): Declare.
2157         (_bfd_archive_coff_construct_extended_name_table): Declare.
2158         * bfd-in2.h: Rebuild.
2159         * libbfd.h: Rebuild.
2160         * som.c (som_construct_extended_name_table): New static function.
2161         * aout-target.h (MY_construct_extended_name_table): Define.
2162         * coff-rs6000.c (rs6000coff_construct_extended_name_table):
2163         Define.
2164         * ieee.c (ieee_construct_extended_name_table): Define.
2165         * libecoff.h (_bfd_ecoff_construct_extended_name_table): Define.
2166         * oasys.c (oasys_construct_extended_name_table): Define.
2167
2168         Fix the ELF linker to not require an interpreter if no dynamic
2169         objects were seen, even when linking PIC code.
2170         * libelf.h (ELF_LINK_HASH_NEEDS_PLT): Define.
2171         (struct elf_link_hash_table): Add field dynamic_sections_created.
2172         * elfcode.h (elf_link_record_dynamic_symbol): Create dynstr if it
2173         doesn't already exist.
2174         (elf_link_add_object_symbols): Create dynamic sections based on
2175         dynamic_sections_created field, not dynobj field.  Don't bother to
2176         set dynobj.
2177         (elf_link_create_dynamic_sections): If dynamic sections were
2178         already created, don't do anything.  If dynobj is already set, use
2179         it; otherwise, set it to the bfd argument.  Don't initialize
2180         dynsymcount.  Only create dynstr if it does not exist.  Set
2181         dynamic_sections_created to true.
2182         (NAME(bfd_elf,size_dynamic_sections)): Skip most of this function
2183         if no dynamic objects were seen.
2184         (elf_adjust_dynamic_symbol): If a symbol has the
2185         ELF_LINK_HASH_NEEDS_PLT flag set, let the backend adjust it.
2186         (elf_bfd_final_link): Change most decisions based on dynobj to
2187         check dynamic_sections_created instead.
2188         (elf_link_output_extsym): Only handle dynamic symbols if a dynamic
2189         object was seen.
2190         * elf.c (_bfd_elf_link_hash_table_init): Initialize new field
2191         dynamic_sections_created.  Set dynsymcount to 1, not 0.
2192         * elf32-i386.c (elf_i386_create_dynamic_sections): Call
2193         elf_i386_create_got_section rather than creating the .got and
2194         .got.plt sections.
2195         (elf_i386_create_got_section): New static function.
2196         (elf_i386_check_relocs): Just call elf_i386_create_got_section if
2197         a GOT table is needed, not bfd_elf32_link_create_dynamic_sections.
2198         Only create the .rel.got section, and only make space for a reloc,
2199         for a global symbol or when generating a shared object.  For a
2200         R_386_PLT32 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag.
2201         (elf_i386_adjust_dynamic_symbol): Rework initial assertion to
2202         permit ELF_LINK_HASH_NEEDS_PLT non dynamic symbols.  Create a
2203         procedure linkage table entry for such symbols.  But, if no
2204         dynamic objects were seen, never create a PLT entry.
2205         (elf_i386_size_dynamic_sections): If no dynamic objects were seen,
2206         skip most of this function, and force the size of the .rel.got
2207         section to zero.
2208         (elf_i386_relocate_section): For a R_386_GOT32 reloc against a global
2209         symbol when no dynamic object was seen, initialize the contents of
2210         the .got section.  For a R_386_GOT32 against a local symbol, only
2211         create a R_386_RELATIVE reloc when generating a shared object.
2212         Treat a R_386_PLT32 reloc against a symbol for which we did not
2213         create a PLT entry as a R_386_PC32 reloc.
2214         (elf_i386_finish_dynamic_sections): Only fiddle with the dynamic
2215         entries and the PLT if we saw a dynamic object.
2216         * elf32-sparc.c (elf_sparc_howto_table): Fix R_SPARC_PC22 by
2217         setting rightshift to 10.  Fix R_SPARC_WPLT20 by setting
2218         rightshift to 2, size to 2, bitsize to 30, and dst_mask to
2219         0x3fffffff.
2220         (elf32_sparc_create_dynamic_sections): Don't set the size of the
2221         .plt section.  Call elf32_sparc_create_got_section rather than
2222         creating the .got section.
2223         (elf32_sparc_check_relocs): Call elf32_sparc_create_got_section if
2224         a GOT table is needed, not bfd_elf32_link_create_dynamic_sections.
2225         Only create the .rela.got section, and only make space for a
2226         reloc, for a global symbol or when generating a shared object.
2227         Set the alignment of the .rela.got section to 2.  For a
2228         R_SPARC_WPLT30 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag.
2229         (elf32_sparc_adjust_dynamic_symbol): Rework initial assertion to
2230         permit ELF_LINK_HASH_NEDS_PLT non dynamic symbols.  Create a
2231         procedure linkage table for such symbols.  But, if no dynamic
2232         objects were seen, never create a PLT entry.  Initialize the size
2233         of the .plt section.
2234         (elf32_sparc_size_dynamic_sections): If no dynamic objects were
2235         seen, skip most of this function, and force the size of the
2236         .rela.got section to zero.  Strip empty reloc sections, and strip
2237         an empty .plt section.
2238         (elf32_sparc_relocate_section): For a GOT reloc against a global
2239         symbol when no dynamic object was seen, initialize the contents of
2240         the .got section.  For a GOT reloc against a local symbol, only
2241         create a R_SPARC_RELATIVE reloc when generating a shared object.
2242         Treat a R_SPARC_WPLT30 reloc against a symbol for which we did not
2243         create a PLT entry as a R_SPARC_WDISP30 reloc.
2244         (elf32_sparc_finish_dynamic_sections): Only fiddle with the
2245         dynamic entries and the PLT if we saw a dynamic object.
2246
2247 Thu Oct 20 13:28:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2248
2249         * elfcode.h (elf_map_symbols): Don't worry about section symbols
2250         in a section not owned by any BFD.
2251         (elf_section_from_bfd_section): Separate out loop which calls
2252         backend routine.  Check bfd_section and call the backend routine
2253         even for a section not owned by any BFD.
2254         * elf32-mips.c (mips_elf_section_from_bfd_section): Handle
2255         .acommon section.
2256
2257 Wed Oct 19 13:28:29 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2258
2259         * coffgen.c (coff_print_symbol): Make names for section number and
2260         storage class slightly more verbose.  It's not clear how many
2261         characters I can justify using up, but before this change they
2262         both were abbreviated "sc" which is (IMHO) clearly unacceptable.
2263
2264 Wed Oct 19 01:26:39 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2265
2266         * binary.c (binary_set_section_contents): Set the base file
2267         position from the lowest section VMA, not the start address.
2268
2269         * aoutx.h (NAME(aout,slurp_symbol_table)): Don't return an error
2270         if there are no symbols.
2271         * coffgen.c (coff_get_normalized_symtab): Likewise.
2272         * hp300hpux.c (MY(slurp_symbol_table)): Likewise.
2273
2274 Tue Oct 18 12:56:43 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2275
2276         * aout-target.h (MY_bfd_copy_private_section_data): Only copy
2277         subformat to another bfd_target_aout_flavour file.
2278
2279         * binary.c: New file for raw binary output format.
2280         * Makefile.in (BFD_LIBS): Add binary.o.
2281         (CFILES): Add binary.c.
2282         * targets.c (binary_vec): Declare.
2283         (bfd_target_vector): Include binary_vec.
2284
2285         * srec.c (tdata_type): Add field tail.
2286         (srec_mkobject): Initialize tail.
2287         (srec_set_section_contents): Sort S record list by address.
2288
2289 Mon Oct 17 11:38:16 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2290
2291         * elfcode.h (elf_map_symbols): Sort the symbols into a new array,
2292         rather than messing with Elf_Sym_Extra.  Store the symbol index in
2293         the udata.i field.
2294         (swap_out_syms): Use outbound_syms as a pointer rather than as an
2295         array.  Don't worry about elf_sym_num.
2296         * libelf.h (struct elf_sym_extra): Don't define.
2297         (Elf_Sym_Extra): Don't define.
2298         (struct elf_obj_tdata): Remove sym_extra field.
2299         (elf_sym_extra): Don't define.
2300         * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Use
2301         udata.i rather than elf_sym_extra array.
2302
2303         * syms.c (asymbol): Change udata field into a union.
2304         * bfd-in2.h: Rebuild.
2305         * aoutx.h (NAME(aout,translate_symbol_table)): Use udata.p rather
2306         than just udata.
2307         * bout.c (perform_slip): Likewise.
2308         * hp300hpux.c (MY(slurp_symbol_table)): Likewise.
2309         * ieee.c (ieee_slurp_external_symbols): Likewise.
2310         * linker.c (generic_link_add_symbol_list): Likewise.
2311         (default_indirect_link_order): Likewise.
2312         * oasys.c (oasys_slurp_symbol_table): Likewise.
2313         * reloc16.c (bfd_perform_slip): Likewise.
2314         * srec.c (fillup_symbols): Likewise.
2315         * coffcode.h (get_index): Use udata.i rather than just udata.
2316         (coff_slurp_symbol_table): Likewise.
2317         * coffgen.c (set_index): Likewise.
2318         * ecoff.c (ecoff_set_symbol_info): Likewise.
2319         * elfcode.h (elf_symbol_from_bfd_symbol): Likewise.
2320         * libecoff.h (ecoff_get_sym_index, ecoff_set_sym_index): Likewise.
2321         * som.c (compare_syms): Likewise.
2322         (som_prep_for_fixups): Likewise.
2323         (som_write_fixups): Likewise.
2324
2325         Use a hash table when writing out ELF symbol names.
2326         * elfcode.h (elf_stringtab_init): New static function.
2327         (bfd_new_strtab, bfd_add_to_strtab, bfd_add_2_to_strtab): Remove.
2328         Change all callers to use elf_stringtab_init or
2329         _bfd_stringtab_add, and get stringtab lengths using
2330         _bfd_stringtab_size.
2331         (elf_fake_sections): Change ignored argument to pointer to
2332         boolean, and set the boolean to true if an error occurs.  If an
2333         error has already occurred, don't do anything.
2334         (assign_section_numbers): Just set sh_size, not contents.
2335         (elf_compute_section_file_positions): Pass the address of a
2336         boolean to elf_fake_sections.  Pass the address of a
2337         bfd_strtab_hash to swap_out_syms.  Write out the .strtab section.
2338         (prep_headers): Change shstrtab to bfd_strtab_hash.
2339         (swap_out_syms): Take a pointer to a bfd_strtab_hash as an
2340         argument.  Set it to the symbol names.
2341         (NAME(bfd_elf,write_object_contents)): Write out the section
2342         header names using _bfd_stringtab_emit.
2343         (elf_debug_section): Remove first argument; get the section name
2344         via the bfd_section pointer.  Change caller.
2345         (elf_bfd_final_link): Write out the symbol names using
2346         _bfd_stringtab_emit.  Likewise for the .dynstr section contents.
2347         Free the symbol names at the end of the function.
2348         (elf_link_input_bfd): Remove the last argument, output_names,
2349         from relocate_section.  Save the old symbol contents before
2350         calling elf_link_output_sym, and restore them afterward.
2351         * libelf.h (struct elf_link_hash_table): Change dynstr field to
2352         struct bfd_strtab_hash.
2353         (struct elf_backend_data): Remove last argument, output_names,
2354         from elf_backend_relocate_section field.
2355         (struct strtab): Don't define.
2356         (struct elf_obj_tdata): Change strtab_ptr field to struct
2357         bfd_strtab_hash.
2358         * elf32-hppa.c (elf32_hppa_relocate_section): Remove last
2359         argument, output_names.
2360         * elf32-i386.c (elf_i386_relocate_section): Likewise.
2361         * elf32-mips.c (mips_elf_relocate_section): Likewise.
2362         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2363
2364         * libbfd-in.h (DEFAULT_STRING_SPACE_SIZE): Don't define.
2365         (bfd_add_to_string_table): Don't declare.
2366         * libbfd.h: Rebuild.
2367         * libbfd.c (bfd_add_to_string_table): Remove.
2368
2369         * elfcode.h (elf_swap_shdr_in): Use bfd_section, not rawdata.
2370         Clear contents field.
2371         (bfd_section_from_shdr): In SHT_STRTAB case, check bfd_section,
2372         not rawdata.  Don't set rawdata if e_shstrndx.  Use bfd_section
2373         rather than rawdata in commented out code.  In SHT_REL[A] case,
2374         don't bother to check elf_section_data of section returned by
2375         section_from_elf_index.
2376         (elf_fake_sections): Set bfd_section, not rawdata.  Don't set
2377         size.
2378         (elf_map_symbols): Don't set elf_num_section_syms.  Don't create
2379         section symbols that already exist.
2380         (assign_file_position_for_section): Use bfd_section, not rawdata.
2381         (section_from_elf_index): Just check bfd_section field.
2382         (elf_section_from_bfd_section): Likewise.
2383         (elf_debug_section): Don't print rawdata, contents, or size.
2384         (elf_link_add_object_symbols): Don't error out if
2385         section_from_elf_index returns NULL.
2386         (elf_bfd_final_link): Check return value from
2387         section_from_elf_index against NULL, not bfd_is_abs_section.
2388         (elf_link_input_bfd): Don't check section_from_elf_index return
2389         value.
2390         * libelf.h (struct elf_obj_tdata): Remove num_section_syms field.
2391         (elf_num_section_syms): Don't define.
2392         * elf.c (elf_get_str_section): Store section contents in contents
2393         field rather than rawdata field.
2394         (elf_string_from_elf_section): Likewise.
2395         (_bfd_elf_make_section_from_shdr): Store BFD section pointer in
2396         bfd_section field rather than rawdata field.
2397         * elf32-hppa.c (elf32_hppa_read_symext_info): Use bfd_section
2398         rather than rawdata.
2399         (elf32_hppa_size_stubs): Likewise.
2400         (elf32_hppa_backend_symbol_table_processing): Don't set
2401         symextn_hdr->size; just use sh_size.
2402         * elf32-mips.c (mips_elf_final_write_processing): Use bfd_section
2403         rathern than rawdata.
2404         (mips_elf_section_from_shdr): Likewise.
2405         (mips_elf_section_processing): Likewise.
2406         (mips_elf_section_from_bfd_section): Remove rawdata check.
2407
2408         * srec.c (pass_over): Set the start address for S7, S8 or S9.
2409
2410 Fri Oct 14 19:15:46 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
2411
2412         * VERSION: Updated to 2.5.
2413
2414 Fri Oct 14 11:07:50 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2415
2416         * bfd.c (bfd_scan_vma): Cast end to be non const before passing it
2417         to strtoul.
2418
2419 Thu Oct 13 14:40:41 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2420
2421         * bfd.c (bfd_scan_vma): Pass end argument on to strtoul.
2422
2423 Wed Oct 12 16:46:43 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
2424
2425         * opncls.c (bfd_realloc): Deleted, since it's broken and fixing it
2426         would make it slow.  Besides, it isn't used much.
2427         * elfcode.h (elf_map_symbols): Always allocate new storage for the
2428         symbol table.
2429
2430 Wed Oct 12 11:54:37 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2431
2432         * ecoff.c (ecoff_set_symbol_info): Mark local stProc, stLabel or
2433         stabs symbols as BSF_DEBUGGING.
2434
2435         * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Make
2436         str1 and str2 const pointers.
2437
2438         * Makefile.in (INSTALL): Use top level install.sh script.
2439         * config/README (INSTALL): Remove.
2440         * config/delta88.mh (INSTALL): Remove.
2441         * config/i386v4.mh (INSTALL): Remove.
2442         * config/irix4.mh (INSTALL): Remove.
2443         * config/irix5.mh (INSTALL): Remove.
2444         * config/ncrt3000.mh (INSTALL): Remove.
2445
2446 Tue Oct 11 13:57:56 1994  Eric Youngdale  (eric@andante.aib.com)
2447
2448         * elf32-i386.c (elf_i386_check_relocs): Make sure that a symbol
2449         with a global offset table entry or a procedure linkage table
2450         entry is added to the dynamic symbol table.
2451         * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
2452         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): If a symbol has
2453         already gotten a procedure linkage table entry, change the
2454         definition to the PLT entry.
2455         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
2456
2457 Tue Oct 11 17:12:00 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2458
2459         * lynx-core.c (lynx_core_file_p): SPARC Lynx appears to start
2460         dumping the .data section in a core file at a page boundary.
2461
2462 Mon Oct 10 16:24:44 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
2463
2464         * cofflink.c (_bfd_coff_final_link): Cast argument to bfd_h_put_32
2465         to correct type.
2466         (coff_read_string_table): Cast argument to bfd_h_get_32 to correct
2467         type.
2468         * elfcode.h (elf_link_output_extsym): Cast argument to
2469         bfd_elf_hash to correct type.
2470
2471         * elf32-sparc.c (elf_sparc_howto_table): The PC10, PC22, and
2472         WPLT30 relocations are PC-relative.
2473
2474 Thu Oct  6 12:57:26 1994  Richard Earnshaw (rwe@pegasus.esprit.ec.org)
2475
2476         * aoutx.h (adjust_o_magic): Correctly initialize vma if the vma of
2477         the text section was user-defined.
2478
2479 Wed Oct  5 14:42:12 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2480
2481         * archive.c (bfd_construct_extended_name_table): SVR4 uses slash
2482         newline at the end of the file name, not just newline.
2483
2484 Tue Oct  4 11:23:12 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2485
2486         * ecoff.c (_bfd_ecoff_new_section_hook): Default section alignment
2487         power to 4, rather than using align_power_min.
2488
2489         * coffcode.h (coff_new_section_hook): Don't use align_power_min;
2490         use COFF_DEFAULT_SECTION_ALIGNMENT_POWER instead.  Force the .stab
2491         and .stabstr sections to be aligned to no more than 2.  Remove
2492         COFF_SPARC special cases.
2493         * coff-a29k.c: Define COFF_DEFAULT_SECTION_ALIGNMENT_POWER.
2494         * coff-apollo.c, coff-go32.c, coff-h8300.c: Likewise.
2495         * coff-h8500.c, coff-i386.c, coff-i960.c, coff-m68k.c: Likewise.
2496         * coff-m88k.c, coff-rs6000.c, coff-sh.c, coff-sparc.c: Likewise.
2497         * coff-we32k.c, coff-z8k.c: Likewise.
2498
2499         * configure.in: Use ${config_shell} when running config.bfd.
2500
2501         * cofflink.c (coff_link_input_bfd): Don't try to convert a long
2502         filename if the offset field is zero.
2503
2504         * elfcode.h (swap_out_syms): If the alignment of a common symbol
2505         was not set, use a sensible default rather than zero.
2506
2507 Mon Oct  3 16:04:29 1994  H.J. Lu (hjl@nynexst.com)
2508
2509         * opncls.c (bfd_close): Honor umask when setting execution bits.
2510         (bfd_close_all_done): Likewise.
2511
2512 Mon Oct  3 04:41:49 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2513
2514         * rs6000-core.c (rs6000coff_core_p):  Set SEC_HAS_CONTENTS flag
2515         for .stack and .ldinfo sections. Cast coredata.c_tab to a
2516         file_ptr to avoid warnings from gcc.
2517
2518 Fri Sep 30 13:11:38 1994  Ian Lance Taylor  <ian@sanguine.cygnus.com>
2519
2520         * elfcode.h (elf_bfd_final_link): Remove assertion when a non
2521         SEC_IN_MEMORY section is found in dynobj.  This can happen when
2522         linking PIC compiled code.
2523
2524 Thu Sep 29 15:21:44 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
2525
2526         * reloc.c (bfd_install_relocation): Change type of "data" to
2527         bfd_byte *, to go along with yesterday's change.
2528
2529         * elf.c (bfd_elf_print_symbol): Moved here from elf_print_symbol
2530         in elfcode.h.  (case bfd_print_symbol_all): Print symbol's size
2531         field, except for common symbols; print their alignment.
2532         * elfcode.h (elf_print_symbol): Deleted.
2533         * libelf.h (bfd_elf_print_symbol): Declare.
2534         (bfd_elf{32,64}_print_symbol): Replace declarations with macros.
2535
2536         * syms.c (bfd_print_symbol_vandf): Show BSF_LOCAL and BSF_GLOBAL
2537         in one column.  Use the column freed up to show BSF_FUNCTION and
2538         BSF_FILE.
2539
2540 Thu Sep 29 12:29:01 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2541
2542         * syms.c (stt): Add .rdata and .rodata.
2543
2544 Wed Sep 28 13:35:05 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2545
2546         * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte *
2547         before trying to add values to it.
2548
2549 Tue Sep 27 16:47:58 1994  Ken Raeburn  <raeburn@cujo.cygnus.com>
2550
2551         * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Cast
2552         return value from elf_sym_extra.
2553         (elf32_hppa_build_stubs): Cast return value from bfd_zalloc.
2554         (elf32_hppa_size_stubs): Cast return value from malloc.
2555
2556         * gen-aout.c (main): Declare and initialize "arch".
2557
2558         * cofflink.c (coff_link_add_symbols): Cast return value of
2559         bfd_hash_allocate.
2560
2561         * riscix.c (riscix_callback): Use PARAMS macro in prototype.
2562
2563         * reloc.c (bfd_install_relocation): New function, mostly copied
2564         from bfd_perform_relocation, adjusted for the assembler's needs.
2565         * bfd-in2.h: Regenerated.
2566
2567 Mon Sep 26 11:00:14 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2568
2569         * elfcode.h (assign_file_positions_except_relocs): Align the
2570         section VMA and the file position even if D_PAGED is not set.
2571
2572         * bfd-in.h (bfd_seek): Change declaration to not mark fp const.
2573         * bfd-in2.h: Rebuild.
2574         * libbfd.c (bfd_seek): Don't mark parameters const, to avoid
2575         conflicts with declaration.
2576
2577 Fri Sep 23 15:15:31 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2578
2579         * elfcode.h (map_program_segments): Don't abort if we allocated
2580         too much space for the program header, only if we allocated too
2581         little.
2582         (assign_file_positions_except_relocs): Similar change.
2583
2584 Tue Sep 20 13:17:07 1994  J.T. Conklin  (jtc@phishhead.cygnus.com)
2585
2586         * libaout.h: Fix comment.
2587         * ns32knbsd.h: Changed M_NS32K_NETBSD to M_532_NETBSD to match
2588           libaout.h.
2589
2590 Tue Sep 20 15:23:21 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2591
2592         * Makefile.in: Rebuilt dependencies.
2593         (BFD32_BACKENDS): Add sparcnetbsd.o.
2594         (CFILES): Add ns32knetbsd.c and sparcnetbsd.c.
2595         * targets.c: ns32knetbsd_vec was renamed to pc532netbsd_vec.
2596
2597         * coff-sh.c (rtype2howto): Remove; unused.
2598         (coff_sh_relocate_section): Remove unused local variable rstat.
2599         (reloc_processing): Comment out; unused.
2600
2601 Fri Sep 16 12:12:27 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2602
2603         * aoutx.h (aout_link_write_other_symbol): If h->indx is -2, then
2604         always write it out even if it would normally be stripped.
2605         (aout_link_input_section_std): If we find a reloc against a
2606         stripped global symbol, force it to be written out rather than
2607         merely calling unattached_reloc.
2608         (aout_link_input_section_ext): Likewise.
2609         (aout_link_reloc_link_order): Likewise.
2610
2611 Wed Sep 14 15:37:19 1994  Jeff Law  (law@snake.cs.utah.edu)
2612
2613         * som.h (struct somdata): New field sorted_syms.
2614         (obj_som_sorted_syms): Accessor macro.
2615         * som.c (som_object_setup): Initialize sorted_syms to NULL.
2616         (som_prep_for_fixups): Sort a copy of the BFD's symbol table;
2617         store the sorted symbol table in sorted_syms.
2618         (som_write_fixups): Initalize tmp_reloc to NULL to make GCC happy.
2619         (som_begin_writing): Similarly for exec_header.  Pass the sorted
2620         symbol table to som_write_symbol_strings.
2621         (som_build_and_write_symbol_table): Use the sorted symbols rather
2622         than the canonical symbol table.
2623
2624         * som.h (som_symbol_type): Add "stringtab_offset" field.
2625         * som.c (som_write_symbol_strings): Use "stringtab_offset"
2626         rather than destroying the "name" field in the BFD symbol.
2627         (som_build_and_write_symbol_table): Likewise.
2628
2629 Wed Sep 14 15:06:55 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2630
2631         * aoutx.h (aout_link_write_symbols): Rename skip_indirect to
2632         skip_next.  If we find an N_WARNING symbol which has already been
2633         written out, set skip_next.
2634
2635         * libecoff.h (struct ecoff_tdata): Add field find_buffer.
2636         * ecoff.c: Include aout/stab_gnu.h.
2637         (ecoff_find_nearest_line): Handle stabs debugging information.
2638
2639         * elfcode.h (elf_link_output_extsym): Keep a symbol marked as weak
2640         even if it is referenced by another object.
2641
2642 Tue Sep 13 17:57:00 1994  Jeff Law  (law@snake.cs.utah.edu)
2643
2644         * som.c (som_fixup_formats): Case R_ENTRY (0xb3), set both
2645         'T' and 'U' to grab all the unwind information.
2646         (som_set_reloc_info): Make 'U' unwind bits persist across
2647         multiple SOM relocations.  Set the addend field of an R_ENTRY
2648         relocation to the value in 'T'; set the addend field on an
2649         R_EXIT relocation to the value in 'U'.
2650
2651         * som.h (som_symbol_type): Delete unwind field.
2652
2653         * som.c (som_write_fixups): For R_ENTRY fixups, get 32bits of
2654         unwind information from the addend field of the R_ENTRY, get the
2655         other 32bits from the addend field of the R_EXIT.
2656         (bfd_som_attach_unwind_info): Delete function and all references.
2657
2658         * som.h (som_symbol_type): Delete unused a.out-related fields.
2659
2660         * som.c (bfd_section_from_som_symbol): Use bfd_abs_section_ptr
2661         instead of &bfd_abs_section.
2662
2663         * som.c (som_object_setup): Handle exec_entry and exec_flags being
2664         switched in executables created by the OSF1 linker.
2665         (som_write_fixups): Handle R_EXIT just like the R_{F,L,R}SEL
2666         fixups.  Support R_ALT_ENTRY (handle just like R_EXIT).
2667
2668 Tue Sep 13 16:04:07 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
2669
2670         * cofflink.c (coff_link_input_bfd): syment_base is unsigned
2671         so can't compare -ve numbers with it.
2672
2673 Mon Sep 12 20:31:17 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
2674
2675         * configure.in (shcoff_vec): Use cofflink.o now.
2676         * coff-sh.c: Rewritten to use new fast coff backend.
2677
2678 Tue Sep 13 16:23:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2679
2680         * aoutx.h (NAME(aout,final_link)): Don't assume that all the input
2681         files are a.out.
2682
2683 Tue Sep 13 11:09:39 1994  J.T. Conklin  (jtc@rtl.cygnus.com)
2684
2685         * configure.host (sparc-*-netbsd): use sparcnbsd.
2686           (ns32k-*-netbsd): use ns32knbsd.
2687
2688         * hosts/{nbsd,i386nbsd,ns32knbsd,sparcnbsd}.h: New files, NetBSD
2689           host support.
2690
2691         * sparcnetbsd.c: New file, adds support for NetBSD/sparc.
2692         * config/sparc-nbsd.mt: Likewise.
2693
2694         * netbsd.h: New file, definitions common to all netbsd ports.
2695         * i386netbsd.c: Use it.
2696         * ns32knetbsd.c: Use it.
2697
2698         * Makefile.in, configure.in, targets.c, config/i386-nbsd.mt,
2699           config/ns32k-nbsd.mt: canonicalize netbsd targets to conform to
2700           file/variable naming conventions.
2701         * i386netbsd.c: New file, renamed from netbsd386.c.
2702         * ns32knetbsd.c: New file, renamed from netbsd532.c.
2703         
2704 Mon Sep 12 21:56:20 1994  Jeff Law  (law@snake.cs.utah.edu)
2705
2706         * som.c (som_reloc_skip): Correct off-by-one error for 4-byte
2707         R_NO_RELOCATION fixups.
2708         (bfd_section_from_som_symbol): Return the absolute section if the
2709         symbol isn't contained in any section in the output file.
2710         (som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are
2711         not function symbols (they are magic code labels which *can* be the
2712         targets of cross space branches).  $START$ is not a section symbol.
2713
2714 Mon Sep 12 11:43:08 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2715
2716         * coff-alpha.c (ecoffalpha_little_vec): Add SEC_CODE and SEC_DATA
2717         to section_flags.
2718         * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
2719
2720         * elfcode.h (swap_out_syms): Set the type of an undefined symbol
2721         to STT_FUNC if the BSF_FUNCTION flag is set.
2722
2723         * cofflink.c (coff_link_input_bfd): If r_symndx is -1, don't
2724         change it.
2725         (_bfd_coff_generic_relocate_section): If r_symndx is -1, it is an
2726         absolute reloc.  Don't dump core using r_symndx as an array index.
2727         * cf-m68klynx.c (coff_bfd_link_add_symbols): Define.
2728         (lynx_link_add_symbols): New static function (copy of function in
2729         coff-i386.c).
2730         (coff_m68k_lynxrtype_to_howto): sym argument may be NULL.
2731         * coff-i386.c (coff_i386_rtype_to_howto): Likewise.
2732         * coff-a29k.c (coff_a29k_relocate_section): Handle an r_symndx
2733         value of -1, meaning an absolute reloc.
2734
2735         * ctor.c: Remove; obsolete.
2736         * Makefile.in: Rebuild dependencies.
2737         (BFD_LIBS): Remove ctor.o.
2738         (CFILES): Remove ctor.c.
2739         * libbfd.h: Rebuild.
2740
2741 Mon Sep 12 01:58:47 1994  Jeff Law  (law@snake.cs.utah.edu)
2742
2743         * elf32-hppa.c (elf32_hppa_relocate_section): If there was a link
2744         error of some sort (for example, undefined symbols), then do not
2745         apply any relocs, just notify the user of the errors.
2746         (elf32_hppa_backend_begin_write_processing): Do not build a symbol
2747         extension section for an executable (it's useless).
2748         (elf32_hppa_link_output_symbol_hook): Do nothing if there was a
2749         link error of some sort (for example, undefined symbols).
2750         (elf32_hppa_read_symext_info): Kludge.  Turn off SEC_HAS_CONTENTS
2751         for all the input symbol extension sections to keep the generic
2752         BFD code happy.  Temporarily turn it on to read the contents of
2753         the symbol extension section.
2754
2755 Sun Sep 11 21:58:59 1994  Jeff Law  (law@snake.cs.utah.edu)
2756
2757         * config/hppaosf.mh (RANLIB): Do not set.
2758         * config/hppabsd.mh (RANLIB): Likewise.
2759
2760 Sun Sep 11 22:50:49 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2761
2762         * cf-i386lynx.c: Remove #if 0 code.
2763         (i386_lynxos_coff_object_p): Remove unused function.
2764         (coff_bfd_link_add_symbols): Define.
2765         (lynx_link_add_symbols): New static function.
2766         * coffcode.h (coff_bfd_link_hash_table_create): If
2767         coff_relocate_section is defined, only define this if not already
2768         defined.
2769         (coff_bfd_link_add_symbols, coff_bfd_final_link): Likewise.
2770
2771         * linker.c (_bfd_generic_final_link): Handle
2772         bfd_indirect_link_order explicitly, rather than via
2773         _bfd_default_link_order.
2774         (set_symbol_from_hash): New static function, broken out of
2775         _bfd_generic_link_write_global_symbol.
2776         (_bfd_generic_link_write_global_symbol): Symbol setting code moved
2777         to set_symbol_from_hash; call it.
2778         (default_indirect_link_order): Add generic_linker argument.
2779         Change all callers.  If false, set the generic symbols based on
2780         the hash table entries.
2781
2782 Fri Sep  9 11:51:49 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2783
2784         * coffgen.c (coff_get_symtab): Reindented.  Removed commented out
2785         call to bfd_constructor_entry.
2786
2787         Convert m68k COFF to use new COFF backend linker.
2788         * coff-m68k.c (coff_relocate_section): Define.
2789         * cf-m68klynx.c (coff_rtype_to_howto): Define.
2790         (coff_m68k_lynx_rtype_to_howto): New static function.
2791         * configure.in (m68kcoff_vec): Build cofflink.o.
2792         (m68kcoffun_vec, m68klynx_coff_vec): Likewise.
2793
2794 Thu Sep  8 16:20:38 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
2795
2796         * coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE): Flag
2797         overflows correctly.
2798
2799 Wed Sep  7 19:01:42 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2800
2801         * libelf.h (struct elf_backend_data): Change second argument of
2802         elf_backend_final_write_processing hook to boolean.
2803         (struct elf_obj_tdata): Add linker field.
2804         * elfcode.h (NAME(bfd_elf,write_object_contents)): Pass value of
2805         tdata linker field to final_write_processing, rather than NULL.
2806         (elf_bfd_final_link): Don't call final_write_processing hook.  Set
2807         tdata linker field to true.
2808         * elf32-mips.c (mips_elf_final_write_processing): Change type of
2809         second argument to boolean.
2810         * elf32-hppa.c (elf32_hppa_backend_final_write_processing):
2811         Likewise.
2812
2813         * coff-go32.c (RTYPE2HOWTO): Fully parenthesize arguments.
2814         * coff-i960.c (RTYPE2HOWTO): Likewise.
2815         * coff-m88k.c (RTYPE2HOWTO): Likewise.
2816         * coff-we32k.c (RTYPE2HOWTO): Likewise.
2817
2818         Make i386 COFF use new COFF backend linker.
2819         * coff-i386.c (RTYPE2HOWTO): Fully parenthesize arguments.
2820         (coff_relocate_section): Define.
2821         (coff_i386_rtype_to_howto): New function.
2822         * configure.in (i386coff_vec): Use cofflink.o.
2823         (i386lynx_coff_vec): Likewise.
2824
2825         * coffcode.h (bfd_coff_backend_data): Add new field
2826         _bfd_coff_rtype_to_howto.
2827         (bfd_coff_rtype_to_howto): Define.
2828         (coff_rtype_to_howto): Define to use RTYPE2HOWTO, if not already
2829         defined.
2830         (bfd_coff_std_swap_table): Initialize new field.
2831         * cofflink.c (_bfd_coff_final_link): Allocate section_count + 1
2832         section_info structures, since the target_index is 1 based.
2833         (coff_link_input_bfd): Set *secpp to bfd_com_section_ptr for a
2834         common symbol.  Adjust rel_hash by the output reloc count.
2835         (_bfd_coff_generic_relocate_section): New function.
2836         * libcoff-in.h (_bfd_coff_generic_relocate_section): Declare.
2837         * libcoff.h: Rebuild.
2838         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
2839         * coff-mips.c (mips_ecoff_backend_data): Likewise.
2840
2841 Tue Sep  6 23:28:52 1994  Jeff Law  (law@snake.cs.utah.edu)
2842
2843         * som.c (som_bfd_derive_misc_symbol_info): Treat undefined code
2844         symbols and undefined symbols which no type in the same manner
2845         if the associated BFD symbol has BSF_FUNCTION set.  For a defined
2846         symbol which no type, select a SOM type based on the flags of the
2847         section containing the symbol.
2848         (som_slurp_symbol_type): Set BSF_FUNCTION for undefined ST_STUB
2849         or ST_CODE symbols (importing a non-function code symbol is
2850         meaningless in SOM).
2851         (som_set_reloc_info): Don't set "offset" to the section's vma; it
2852         should always start at zero.
2853
2854 Tue Sep  6 14:51:11 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2855
2856         Add new style linker support to COFF backend.  a29k only for now.
2857         * cofflink.c: New file.
2858         * libcoff-in.h: Include bfdlink.h.
2859         (obj_coff_external_syms, obj_coff_strings): Define accessor macro.
2860         (obj_coff_sym_hashes): Define accessor macro.
2861         (struct coff_tdata): Add fields external_syms, strings, and
2862         sym_hashes.
2863         (struct coff_link_hash_entry): Define.
2864         (struct coff_link_hash_table): Define.
2865         (coff_link_hash_lookup, coff_link_hash_traverse): Define.
2866         (coff_hash_table): Define.
2867         (_bfd_coff_link_hash_table_create): Declare.
2868         (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare.
2869         * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz,
2870         _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global,
2871         _bfd_coff_compute_section_file_positions,
2872         _bfd_coff_relocate_section.
2873         (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define.
2874         (bfd_coff_sym_is_global): Define.
2875         (bfd_coff_compute_section_file_positions): Define.
2876         (bfd_coff_relocate_section): Define.
2877         (coff_mkobject_hook): Initialize obj_raw_syment_count and
2878         obj_conv_table_size.
2879         (coff_compute_section_file_positions): Set target_index of all
2880         sections.  Set output_has_begun field.
2881         (coff_write_object_contents): Don't set target_index; now done by
2882         coff_compute_section_file_positions.  Remove obsolete handling of
2883         scn_base and data_base.  Don't bother to check that target_index
2884         is positive, since it always is.  Remove use of pad, which is
2885         always zero.  Check obj_raw_syment_count, not bfd_get_symcount,
2886         for the number of symbols, but only write them out if
2887         bfd_get_symcount is non-zero.  Don't check obj_raw_syment_count
2888         until after coff_write_symbols is called.
2889         (coff_slurp_symbol_table): Use obj_raw_syment_count, not
2890         bfd_get_symcount for the number of symbols.  Don't set
2891         obj_conv_table_size.
2892         (coff_sym_is_global): New static function or macro.
2893         (coff_slurp_reloc_table): Call coff_swap_reloc_in, not
2894         bfd_swap_reloc_in.
2895         (coff_bfd_link_hash_table_create): If coff_relocate_section is
2896         defined, define as _bfd_coff_link_hash_table_create.
2897         (coff_bfd_link_add_symbols): Similar change.
2898         (coff_bfd_final_link): Similar change.
2899         (coff_relocate_section): Define as NULL if not defined.
2900         (bfd_coff_std_swap_table): Initialize new fields.
2901         * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count
2902         and obj_conv_table_size here.
2903         (coff_count_linenumbers): Reindent.  If bfd_get_symcount is zero,
2904         add up the line numbers from the sections.
2905         (coff_write_symbols): Set obj_raw_syment_count, not
2906         bfd_get_symcount.
2907         (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx
2908         field.
2909         (coff_get_normalized_symtab): Use obj_raw_syment_count, not
2910         bfd_get_symcount.
2911         (coff_print_symbol): If auxp->fix_end, print x_endndx value.
2912         * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in.
2913         Reindent.  Change argument type to  PTR.
2914         * coff-a29k.c (coff_a29k_relocate_section): New static function.
2915         (coff_relocate_section): Define.
2916         * configure.in (a29kcoff_big_vec): Compile cofflink.o.
2917         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields.
2918         * coff-mips.c (mips_ecoff_backend_data): Likewise.
2919         * libcoff.h: Rebuilt.
2920         * Makefile.in: Rebuilt dependencies.
2921         (BFD32_BACKENDS): Add cofflink.o.
2922         (CFILES): Add cofflink.c.
2923
2924 Tue Sep  6 14:00:45 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
2925
2926         * coffgen.c (coff_print_symbol, case bfd_symbol_print_all): Check
2927         for section symbol, and print its aux fields with appropriate
2928         labels.
2929
2930         * Makefile.in (ALL_MACHINES): Added cpu-arm.o.
2931
2932 Sun Sep 04 17:58:10 1994  Richard Earnshaw (rwe@pegasus.esprit.ec.org)
2933
2934         * aoutx.h (NAME(aout,machine_type)): Recognize the ARM processor.
2935         * archures.c, config.bfd, configure.host, libaout.h, reloc.c,
2936         targets.c: Add support for the ARM.
2937         * cpu-arm.c, riscix.c, config/riscix.mh, config/riscix.mt: New files.
2938
2939         * aoutx.h (add_to_stringtable): Check that str isn't a NULL pointer.
2940
2941 Fri Sep  2 14:10:30 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
2942
2943         * reloc.c (enum bfd_reloc_code_real): Rewrote definition to use
2944         new "chew" commands for simultaneous definition of enumerator and
2945         enumerator name table.
2946         (bfd_get_reloc_code_name): New function, for retrieving a symbolic
2947         name associated with an enumerator.
2948         * libbfd.h, bfd-in2.h: Regenerated.
2949
2950 Tue Aug 30 21:24:54 1994  Jeff Law  (law@snake.cs.utah.edu)
2951
2952         * som.c (som_write_fixups, case R_ENTRY): Handle case where no
2953         unwind descriptor information is available.
2954
2955 Tue Aug 30 11:43:30 1994  Eric Youngdale  (ericy@cais.cais.com)
2956
2957         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add soname
2958         argument, and use it to set DT_SONAME dynamic entry.
2959         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
2960         (bfd_elf64_size_dynamic_sections): Update prototype.
2961         * bfd-in2.h: Rebuilt.
2962
2963 Fri Aug 26 15:47:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2964
2965         * coffgen.c (coff_real_object_p): Set obj_raw_syment_count.
2966         (coff_get_normalized_symtab): Verify obj_raw_syment_count, rather
2967         than setting it.
2968
2969 Thu Aug 25 10:44:53 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2970
2971         * archive.c (bsd_write_armap): Remove host dependencies.
2972
2973         * aoutx.h (add_to_stringtab): Check for _bfd_stringtab_add error
2974         before adding BYTES_IN_WORD.
2975
2976         * coffgen.c (coff_find_nearest_line): Look for the best C_FILE,
2977         not merely the first.
2978
2979         * coffgen.c (coff_write_alien_symbol): If we are not using the
2980         symbol, clear the name so that it is not put in the string table.
2981         From Antti.Miettinen@ntc.nokia.com.
2982
2983 Wed Aug 24 11:49:19 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
2984
2985         * coffgen.c (coff_print_symbol): Cast pointer different to long
2986         and use %ld to print it.
2987         * osf-core.c (osf_core_core_file_p): Remove unused variable
2988         dseccnt.
2989         * ecoffswap.h (ecoff_swap_ext_out): If ECOFF_64, clear remaining
2990         bytes in bits2.
2991
2992         * configure.host, config.bfd: Change i[34]86 to i[345]86.
2993         * coffgen.c (coff_real_object_p): Set obj_conv_table_size here,
2994         rather than waiting until coff_slurp_symbol_table.
2995         (coff_write_alien_symbol): Just ignore BSF_DEBUGGING symbols.
2996         From Antti.Miettinen@ntc.nokia.com.
2997
2998         * section.c (bfd_make_section_anyway): Fix failure check of
2999         bfd_make_empty_symbol.  From Antti.Miettinen@ntc.nokia.com.
3000
3001         * aoutx.h (translate_to_native_sym_flags): Use the output_section
3002         (and output_offset) if there is one.
3003
3004         * aoutx.h (aout_link_check_archive_element): Discard the symbols
3005         if the archive element was not needed.
3006
3007         * aoutx.h (aout_get_external_symbols): Ensure that a zero string
3008         index yields an empty string.
3009         (aout_link_write_symbols): If info->keep_memory is false, use name
3010         from original hash table entry, not from entry in *sym_hash.
3011
3012         * aoutx.h (struct aout_final_link_info): Add fields contents,
3013         relocs, symbol_map and output_syms.
3014         (NAME(aout,final_link)): Work out the largest section size, reloc
3015         size, and number of symbols.  Use them to preallocate buffers that
3016         are large enough for all cases.
3017         (aout_link_input_bfd): Use preallocated symbol_map.
3018         (aout_link_write_symbols): Remove symbol_map argument; use
3019         preallocated symbol_map instead.  Change all callers.  Use
3020         preallocated output_syms.
3021         (aout_link_input_section): Remove symbol_map argument.  Change all
3022         callers.  Use preallocated contents and relocs.
3023         (aout_link_input_section_std): Remove symbol_map argument; use
3024         preallocated symbol_map instead.  Change all callers.
3025         (aout_link_input_section_ext): Likewise.
3026
3027 Tue Aug 23 10:51:09 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3028
3029         * archive.c (_bfd_write_archive_contents): Don't update the
3030         symbol map timestamp if there is no symbol map.  From
3031         schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
3032
3033 Mon Aug 22 12:26:42 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3034
3035         * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add _update_armap_timestamp.
3036         (bfd_target): Add field _bfd_update_armap_timestamp.
3037         * bfd.c (bfd_update_armap_timestamp): Define.
3038         * bfd-in2.h: Rebuilt.
3039         * libbfd-in.h (_bfd_noarchive_update_armap_timestamp): Define.
3040         (_bfd_archive_bsd_update_armap_timestamp): Declare.
3041         (_bfd_archive_coff_update_armap_timestamp): Define.
3042         * libbfd.h: Rebuilt.
3043         * archive.c (_bfd_write_archive_contents): Call
3044         bfd_update_armap_timestamp instead of checking for a BSD archive
3045         and calling bsd_update_armap_timestamp.
3046         (_bfd_archive_bsd_update_armap_timestamp): Rename from
3047         _bsd_update_armap_timestamp.  Don't assume that armap_datepos is
3048         already set.
3049         * aout-target.h (MY_update_armap_timestamp): Define if not already
3050         defined.
3051         * coff-rs6000.c (rs6000coff_update_armap_timestamp): Define.
3052         * ieee.c (ieee_update_armap_timestamp): Define.
3053         * libecoff.h (_bfd_ecoff_update_armap_timestamp): Define.
3054         * oasys.c (oasys_update_armap_timestamp): Define.
3055         * som.c (som_update_armap_timestamp): Define.
3056
3057         * hash.c: Copy string hash functions from aoutx.h.
3058         * aoutx.h: String hash functions moved to hash.c.  Retain
3059         simplified versions of add_to_stringtab and emit_stringtab.
3060         Change all callers to use new function and structure names.
3061         * libbfd-in.h (_bfd_stringtab_init, _bfd_stringtab_free): Declare.
3062         (_bfd_stringtab_size, _bfd_stringtab_add): Declare.
3063         (_bfd_stringtab_emit): Declare.
3064         * libbfd.h: Rebuilt.
3065
3066 Mon Aug 22 10:49:37 1994  Eric Youngdale  (ericy@cais.cais.com)
3067
3068         * i386linux.c (linux_add_one_symbol): Create a fixup for any
3069         defined absolute symbol, not just GOT or PLT symbols.
3070         (linux_tally_symbols): Correct handling of references to defined
3071         symbols.
3072
3073 Thu Aug 18 16:29:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3074
3075         Get ld -x -r to handle a.out set symbols correctly.
3076         * aoutx.h (adjust_o_magic): If the .bss VMA was set outside of
3077         BFD, pad the .data section up to the VMA of the .bss section.
3078         (aout_link_add_symbols): If a set symbol does not get modified,
3079         treat it as a local symbol.
3080         (aout_link_write_symbols): Set the value of set symbols
3081         correctly.  Don't discard set symbols even if discarding local
3082         symbols.
3083         (aout_link_write_other_symbol): Don't abort on bfd_link_hash_new,
3084         since it can now happen for set symbols.
3085
3086         * elfcode.h (elf_fake_sections): Just check for ".rela" and
3087         ".rel", not ".rela." and ".rel."; make this work by checking
3088         use_rela_p.
3089         * elf32-i386.c (elf_i386_check_relocs): Just check for ".rel", not
3090         ".rel."
3091         (elf_i386_size_dynamic_sections): Likewise.
3092         (elf_i386_relocate_section): Likewise.
3093         * elf32-sparc.c (elf32_sparc_check_relocs): Just check for
3094         ".rela", not ".rela."
3095         (elf32_sparc_size_dynamic_sections): Likewise.
3096         (elf32_sparc_relocate_section): Likewise.
3097
3098 Wed Aug 17 16:54:18 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3099
3100         * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
3101         PASS to the old value + 1.
3102
3103         * coffgen.c (coff_get_normalized_symtab): If a C_FILE symbol has
3104         no aux entries, use the symbol name as the file name.
3105         (coff_find_nearest_line): Look for the right C_FILE symbol, rather
3106         than always using the first one.  If there is a debugging symbol
3107         after a function symbol, skip it.  Add the section VMA to the line
3108         offset, since it was subtracted out in coff_slurp_line_table.
3109
3110 Tue Aug 16 16:53:00 1994  Jeff Law  (law@snake.cs.utah.edu)
3111
3112         * som.c (som_prep_headers): If writing some form of an executable,
3113         allocate and attach an exec header to the BFD private data.
3114         (som_begin_writing): Don't fill fields of the exec header based
3115         on BFD private data here (like the exec flags).  Do not write
3116         the exec header here.
3117         (som_write_headers): Instead do it here.
3118         * som.h (struct somdata): New field "exec_hdr" for the executable
3119         file header.
3120         (obj_som_exec_hdr): New accessor macro.
3121
3122 Tue Aug 16 00:12:31 1994  Eric Youngdale  (ericy@cais.cais.com)
3123
3124         * i386linux.c (linux_link_create_dynamic_sections): Create section
3125         named .linux-dynamic, not .dynamic.
3126         (linux_add_one_symbol): Use .linux-dynamic, not .dynamic.
3127         (bfd_linux_size_dynamic_sections): Likewise.
3128         (linux_finish_dynamic_link): Likewise.
3129
3130 Mon Aug 15 12:16:56 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3131
3132         * coffgen.c (STRING_SIZE_SIZE): Define.
3133         (coff_fix_symbol_name): Use STRING_SIZE_SIZE, not 4.
3134         (coff_write_symbols, build_string_table): Likewise.
3135         (coff_get_normalized_symtab): Likewise.
3136
3137         * libcoff-in.h (obj_symbol_slew): Don't define.
3138         (struct coff_tdata): Remove unused fields index_slew, raw_linenos,
3139         and flags.
3140         * libcoff.h: Rebuilt.
3141         * coffcode.h (coff_mkobject): Don't initialize raw_linenos.
3142         (coff_mkobject_hook): Don't initialize flags.
3143
3144         * aout-target.h (MY_zmagic_contiguous): Define as 0 if not already
3145         defined.
3146         (MY(backend_data)): Use MY_zmagic_contiguous, not hardcoded 0.
3147         * i386linux.c (MY_zmagic_contiguous): Define.
3148
3149         * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a
3150         shared object has SHF_ALLOC set, create a BFD section for it.
3151         (elf_section_from_bfd_section): There may be a BFD section for a
3152         SHT_SYMTAB section.
3153
3154         * coffcode.h (styp_to_sec_flags): Add name argument.  If no flags
3155         are recognized, chose section flags based on the name.
3156         (bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add
3157         name argument.
3158         (bfd_coff_styp_to_sec_flags_hook): Add name argument.
3159         (coff_compute_section_file_positions): Don't adjust the section
3160         position by COFF_PAGE_SIZE unless SEC_ALLOC is set.
3161         * libcoff.h: Rebuilt.
3162         * coffgen.c (make_a_section_from_file): Pass section name to
3163         bfd_coff_styp_to_sec_flags_hook.
3164         * ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name
3165         argument.
3166         * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to
3167         prototype.
3168
3169 Fri Aug 12 11:22:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3170
3171         * elfcode.h (section_from_elf_index): Correct check for invalid
3172         section index.
3173
3174         * elfcode.h (elf_link_add_object_symbols): If there is no symbol
3175         table, try using the dynamic symbol table.  From Eric Youngdale
3176         <ericy@cais.cais.com>.
3177
3178         * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4.
3179         The linker depends upon configuring for solaris2.
3180         * hosts/solaris2.h: New file; include hosts/sysv4.h.
3181         * config/solaris2.mh: New file; copy of config/sysv4.mh.
3182
3183 Wed Aug 10 13:09:38 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3184
3185         * aoutx.h (adjust_z_magic): Make sure data section is padded to
3186         page boundary when the VMA is set by the calling program.  From
3187         Eric Youngdale <ericy@cais.cais.com>.
3188
3189 Mon Aug  8 17:18:49 1994  Stan Shebs  (shebs@andros.cygnus.com)
3190
3191         Update to ns32k support, from Ian Dall (dall@hfrd.dsto.gov.au).
3192         * aout-ns32k.c: Add declarations that were in aout-ns32k.h, change
3193         declarations to traditional form.
3194         (MY_reloc_howto, MY_put_reloc): Change from macro to function.
3195         (ns32k_relocate_contents): New function.
3196         * aout-ns32k.h: Remove.
3197         * cpu-ns32k.c: Add declarations that were in aout-ns32k.h, change
3198         declarations to traditional form.
3199         (ns32k_final_link_relocate): Call ns32k_relocate_contents.
3200         * netbsd532.c: Reformat to standards, add copyright notice.
3201         (ARCH): Don't define.
3202         (aout-ns32k.h): Don't include.
3203         * pc532-mach.c: Ditto.
3204
3205 Mon Aug  8 17:55:52 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3206
3207         * coff-i960.c (coff_i960_relocate): Don't try to convert relocs
3208         against common symbols.
3209
3210 Sat Aug  6 22:27:30 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3211
3212         * irix-core.c (irix_core_core_file_p):  Ignore sections that
3213         are not contained in the core file.
3214
3215 Thu Aug  4 11:32:23 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3216
3217         * coff-m68k.c (m68k_reloc_type_lookup): New function.
3218         (coff_bfd_reloc_type_lookup): Define.
3219         * cf-m68klynx.c (_bfd_m68kcoff_reloc_type_lookup): Define.
3220
3221         * elfcode.h (elf_bfd_final_link): Force the vma of sections which
3222         do not have SEC_ALLOC set to be 0.  This is needed to handle
3223         relocs against debugging sections.
3224
3225 Wed Aug  3 16:45:41 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3226
3227         * coff-i960.c (coff_i960_relocate): Rewrote to change relocs
3228         against locally defined symbols into relocs against section
3229         symbols, for VxWorks 5.1.
3230
3231 Wed Aug  3 10:34:37 1994  Eric Youngdale  (ericy@cais.cais.com)
3232
3233         * i386linux.c (linux_add_one_symbol): Only handle
3234         SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set.  Set hashp
3235         for a GOT or PLT symbol.  Set jump field of fixup for a PLT symbol.
3236         (linux_tally_symbols): Check section of real symbol.  When looking
3237         for a builtin fixup, check builtin and jump flags.  Create no more
3238         than one fixup, and always create one if the real symbol is in the
3239         absolute section.  Only strip absolute symbols.
3240
3241 Wed Aug  3 05:08:24 1994  D. V. Henkel-Wallace  (gumby@cygnus.com)
3242
3243         * coffcode.h (coff_write_object_contents): set internal_a.magic to
3244         LYNXCOFFMAGIC whenever 68k, SPARC or i386 LynxOS
3245         (yes, they have the same magic number!)
3246
3247 Tue Aug  2 10:43:21 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3248
3249         * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test
3250         in aoutx.h work correctly.
3251
3252         * coff-i960.c (coff_i960_relocate): New function.
3253         (howto_rellong, howto_iprmed): Use it as special_function.
3254
3255         * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek,
3256         bfd_tell, bfd_flush, and bfd_stat from here...
3257         * bfd-in.h: ...to here, to make them visible to programs which
3258         know more about the object file format than BFD does.
3259         * libbfd.h, bfd-in2.h: Rebuilt.
3260
3261 Mon Aug  1 17:55:53 1994  Fred Fish  (fnf@cygnus.com)
3262
3263         * ptrace-core.c (ptrace_unix_core_file_p):  Convert zalloc usage
3264         to bfd_zalloc.
3265
3266 Mon Aug  1 12:04:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3267
3268         * elf64-sparc.c (ELF_MAXPAGESIZE): Define.
3269
3270         ELF linker patches from Eric Youngdale <ericy@cais.cais.com>.
3271         * elfcode.h (elf_link_create_dynamic_sections): Set type of
3272         _DYNAMIC to STT_OBJECT.
3273         (NAME(bfd_elf,record_link_assignment)): Always create hash table
3274         entry.  Set type to STT_OBJECT.
3275         (elf_link_output_extsym): Don't set type of weak defined symbol to
3276         STB_WEAK if symbol was referenced.
3277         (map_program_segments): Check DYNAMIC as well as EXEC_P.
3278         (assign_file_positions_except_relocs): Likewise.
3279         * elf32-i386.c (elf_i386_create_dynamic_sections): Set type of
3280         _GLOBAL_OFFSET_TABLE to STT_OBJECT.
3281         (elf_i386_check_relocs): Ignore local PLT32 relocs.
3282         (elf_i386_relocate_section): Treat local PLT32 relocs as PC32.
3283
3284         * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol
3285         handling again.
3286
3287         * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
3288         if there aren't any.
3289
3290         * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
3291         * hosts/solaris2.h: Remove.
3292         * config/solaris2.mh: Remove.
3293
3294 Sun Jul 31 14:27:04 1994  Jeff Law  (law@snake.cs.utah.edu)
3295
3296         * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which
3297         HPPA ELF spec the code implements.
3298
3299 Tue Jul 26 17:38:01 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3300
3301         * cpu-i960.c (MAX_ARCH): New macro.
3302         (compatible): Use it in computing array bounds.  Put comma after
3303         last entry in array, for regularity.
3304         (arch_info_struct): Adjust spacing for easier reading.
3305
3306         * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use
3307         HOWTO macro.
3308
3309         start-sanitize-i960xl
3310         * cpu-i960.c (XL): Define as bfd_mach_i960_xl.
3311         (scan_960_mach): Recognize xl machine.
3312         (MAX_ARCH): Define to be XL.
3313         (compatible): Add XL row to array.
3314         (arch_info_struct): Add XL entry.
3315
3316         * archures.c (bfd_mach_i960_xl): New macro.
3317         * bfd-in2.h: Regenerated.
3318
3319         * coffcode.h (coff_set_arch_mach_hook): For F_I960XL, set machine
3320         to bfd_mach_i960_xl.
3321         (coff_set_flags): For bfd_mach_i960_xl, set F_I960XL.
3322         end-sanitize-i960xl
3323
3324 Tue Jul 26 11:04:00 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3325
3326         * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak
3327         symbol, correct check to see whether the equivalent normal symbol
3328         was referenced.
3329
3330         Add support for creating shared libraries under i386 ELF and SPARC
3331         ELF.  Based on patches by Eric Youngdale <ericy@cais.cais.com>.
3332         * libelf.h (struct elf_link_hash_entry): Remove copy_offset field.
3333         Add got_offset and plt_offset fields.
3334         (ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define.
3335         (ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define.
3336         (ELF_LINK_HASH_NEEDS_COPY): Define.
3337         (struct elf_backend_data): Add check_relocs field.
3338         (struct bfd_elf_section_data): Change relocs from PTR to
3339         Elf_Internal_Rela *.
3340         (struct elf_obj_tdata): Add local_got_offsets field.
3341         (elf_local_got_offsets): Define accessor macro.
3342         (bfd_elf32_link_create_dynamic_sections): Declare.
3343         (bfd_elf32_link_record_dynamic_symbol): Declare.
3344         (bfd_elf64_link_create_dynamic_sections): Declare.
3345         (bfd_elf64_link_record_dynamic_symbol): Declare.
3346         * elfcode.h (elf_slurp_reloc_table): Don't use the section data
3347         relocs field.
3348         (elf_link_record_dynamic_symbol): Make globally visible.  Use
3349         macro to rename to NAME(bfd_elf,link_record_dynamic_symbol).
3350         (elf_link_add_object_symbols): If creating a shared library, put
3351         make all local symbols dynamic.  Don't bother with the
3352         DYNAMIC_MULTIPLE flags.  Call the check_relocs backend function if
3353         it is defined.
3354         (elf_link_create_dynamic_sections): Make globally visible.  Use
3355         macro to rename to NAME(bfd_elf,link_create_dynamic_sections).  If
3356         creating a shared library, make sure that _DYNAMIC is added as a
3357         dynamic symbol.
3358         (elf_link_read_relocs): New function.
3359         (NAME(bfd_elf,record_link_assignment)): If creating a shared
3360         library, always create symbols, and always make them dynamic.
3361         (elf_bfd_final_link): Permit creation of shared libraries.
3362         (elf_link_input_bfd): Use elf_link_read_relocs to get the relocs.
3363         * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize
3364         copy_offset.  Initialize got_offset and plt_offset.
3365         * elf32-target.h (elf_backend_check_relocs): Define as 0 if not
3366         defined.
3367         (elf32_bed): Initialize check_relocs field.
3368         * elf64-target.h (elf_backend_check_relocs): Define as 0 if not
3369         defined.
3370         (elf64_bed): Initialize check_relocs field.
3371         * elf32-i386.c (elf_howto_table): Change R_386_PLT32 and
3372         R_386_GOTPC to be pc_relative and pcrel_offset.
3373         (elf_i386_pic_plt0_entry): Define.
3374         (elf_i386_pic_plt_entry): Define.
3375         (elf_i386_create_dynamic_sections): Create a .got.plt section, and
3376         define _GLOBAL_OFFSET_TABLE_ at the start of it.  If creating a
3377         shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
3378         dynamic symbol.  Don't create .rel.bss if creating a shared
3379         library.
3380         (elf_i386_check_relocs): New function.
3381         (elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the
3382         symbol already has one.  When making a PLT entry, set plt_offset.
3383         Don't create a copy reloc when creating a shared library.  Don't
3384         set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
3385         (elf_i386_allocate_dynamic_section): Remove.
3386         (elf_i386_size_dynamic_sections): Look through all the sections
3387         rather than assuming we know their names.  Remove any empty reloc
3388         or plt sections.  Only add a DT_DEBUG entry if not creating a
3389         shared library.  Only add a DT_PLTGOT entry if there is a PLT.
3390         Add a DT_TEXTREL entry if required.
3391         (elf_i386_relocate_section): Permit undefined symbols when
3392         creating a shared library.  Handle the special relocation types
3393         specially.
3394         (elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset
3395         is set.  If creating a shared library, produce a PIC PLT entry.
3396         Only mark a PLT symbol as undefined if it was not defined by a
3397         regular object file.  Create a GOT entry if got_offset is set.
3398         Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
3399         (elf_i386_finish_dynamic_sections): Change the handling of
3400         DT_RELSZ to simply subtract out the size of .rel.plt.  If creating
3401         a shared library, produce PIC PLT code.
3402         (elf_backend_check_relocs): Define.
3403         * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10,
3404         R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow.
3405         (elf32_sparc_create_dynamic_sections): If creating a shared
3406         library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
3407         dynamic symbol, and set the type to STT_OBJECT.  Likewise for
3408         _PROCEDURE_LINKAGE_TABLE_.  Don't create .rel.bss if creating a
3409         shared library.
3410         (elf32_sparc_check_relocs): New function.
3411         (elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the
3412         symbol already has one.  When making a PLT entry, set plt_offset.
3413         Don't create a copy reloc when creating a shared library.  Don't
3414         set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
3415         (elf32_sparc_allocate_dynamic_section): Remove.
3416         (elf32_sparc_size_dynamic_sections): Look through all the sections
3417         rather than assuming we know their names.  Only add a DT_DEBUG
3418         entry if not creating a shared library.  Add a DT_TEXTREL entry if
3419         required.
3420         (elf32_sparc_relocate_section): Permit undefined symbols when
3421         creating a shared library.  Handle the special relocation types
3422         specially.
3423         (elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset
3424         is set.  Only mark a PLT symbol as undefined if it was not defined
3425         by a regular object file.  Create a GOT entry if got_offset is
3426         set.  Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
3427         (elf32_sparc_finish_dynamic_sections): Store dynobj in a local
3428         variable.
3429         (elf_backend_check_relocs): Define.
3430
3431 Mon Jul 25 12:21:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
3432
3433         * configure.in (pc532mach_vec): Change to pc532machaout_vec.
3434         * config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name.
3435         * Makefile.in (ALL_MACHINES): Add cpu-ns32k.o.
3436         (BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o,
3437         pc532-mach.o.
3438         * targets.c (pc532machaout_vec): Use instead of pc532mach_vec.
3439         * config/pc532-mach.mt (DEFAULT_VECTOR): Ditto.
3440         (SELECT_VECS): Remove.
3441         * config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt.
3442         * config/ns32k-netbsd.mt: Remove, name too long.
3443
3444 Fri Jul 22 11:07:14 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3445
3446         * linker.c (generic_link_check_archive_element): When changing a
3447         symbol to common, set the alignment.
3448         (_bfd_generic_link_add_one_symbol): When creating a common symbol,
3449         set the alignment.
3450         * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to
3451         common, set the alignment.
3452         (aout_link_add_symbols): Restrict the alignment of a common symbol
3453         to the alignment power given by the architecture.
3454         * libelf.h (struct elf_link_hash_entry): Remove align field.  Add
3455         copy_offset field.
3456         * elfcode.h (elf_link_add_object_symbols): Store alignment in
3457         new bfd_link_hash_entry field, not in elf_link_hash_entry field.
3458         (elf_link_output_extsym): Similar change when getting alignment.
3459         * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align.  Do
3460         initialize copy_offset.
3461         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset
3462         field rather than align field.  Get alignment using bfd_log2
3463         rather than switch.
3464         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
3465         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset,
3466         not align.
3467         * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise.
3468
3469         * aoutx.h (NAME(aout,some_aout_object_p)): Just check
3470         STAT_FOR_EXEC, don't check MACH.
3471         * m88kmach3.c (MACH): Don't define.
3472         * config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC.
3473         * config/m88k-mach3.mt (TDEFINES): Likewise.
3474         * config/mips-mach3.mt (TDEFINES): Likewise.
3475
3476 Thu Jul 21 17:24:31 1994  Stan Shebs  (shebs@andros.cygnus.com)
3477
3478         * i386mach3.c: Reverted to version from before Jul 5 1994 changes.
3479
3480 Thu Jul 21 12:26:01 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3481
3482         * reloc.c (struct reloc_howto_struct): Remove special_function1.
3483         It's the wrong way to do things.
3484         (HOWTO): Change accordingly.
3485         (HOWTO2): Remove.
3486         (_bfd_final_link_relocate): Remove references to
3487         special_function1.
3488         * bfd-in2.h: Rebuilt.
3489         * aoutx.h (aout_link_input_section_std): Remove references to
3490         special_function1.
3491         (aout_link_reloc_link_order): Likewise.
3492
3493 Wed Jul 20 15:46:44 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3494
3495         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
3496         argument.  If it is not NULL, use it to set DT_RPATH.
3497         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
3498         (bfd_elf64_size_dynamic_sections): Likewise.
3499         * bfd-in2.h: Rebuilt.
3500
3501 Sat Jul 16 21:10:39 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3502
3503         * elfcode.h (elf_get_dynamic_symtab_upper_bound): If there is no
3504         dynamic symtab, return error.
3505
3506         * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define.
3507         * elfcode.h (elf_link_add_object_symbols): If symbol is defined as
3508         weak, set ELF_LINK_HASH_DEFINED_WEAK.
3509         (elf_link_output_extsym): If symbol is defined as weak, mark it
3510         STB_WEAK.
3511
3512         * libelf.h (struct bfd_elf_section_data): Add relocs field.
3513         (shdr_name): Remove; unused.
3514         * elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL
3515         and RELA relocs.  Free up the unswapped relocs.  Permit the relocs
3516         to be cached in the section_data.  Correct the reloc address.
3517         (elf_slurp_reloca_table): Remove.
3518         (elf_canonicalize_reloc): Rewrote.
3519         (elf_link_input_bfd): Permit the relocs to be cached in the
3520         section data.
3521
3522 Sat Jul 16 13:55:38 1994  Stan Shebs  (shebs@andros.cygnus.com)
3523
3524         * config.bfd (m88*-harris-cxux*): Recognize.
3525         * hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define.
3526
3527         * configure.host (m68*-atari-sysv4*): New host.
3528         (m68*-cbm-sysv4*): Use m68kv4 instead of amix.
3529         * hosts/amix.h: Remove.
3530         * hosts/m68kv4.h: New file, was amix.h.
3531
3532 Thu Jul 14 15:12:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3533
3534         * reloc.c (enum bfd_reloc_code_real, bfd_type, struct
3535         reloc_howto_struct, reloc_howto_type, HOWTO, HOWTO2): Copied
3536         changes over from bfd-in2.h so they get generated properly next
3537         time someone runs "make headers".
3538         * bfd-in2.h: Rebuilt.
3539
3540         * targets.c (netbsd532_vec, pc532mach_vec): Declare const.
3541         (m88kmach3_vec): Restore deleted declaration.
3542
3543         * configure.in: Alphabetize target vector names.
3544
3545         * config/pc532mach.mh: New file.
3546         (HDEPFILES, HDEFINES): Define here.
3547         * config/pc532-mach.mt (HDEPFILES, HDEFINES): Deleted.
3548         * config/ns32k-netbsd.mt (HDEPFILES, HDEFINES): Deleted.
3549
3550         Sun Jul 10 00:04:20 1994  Ian Dall  (dall@hfrd.dsto.gov.au)
3551
3552         * pc532-mach.c: New File. pc532-mach a.out format.
3553
3554         * netbsd532.c: New file. pc532-netbsd532 a.out format.
3555
3556         * hosts/pc532mach.h: New file. pc532-mach host support.
3557
3558         * cpu-ns32k.c: New file. ns32k support cpu specific code rather
3559         than format specific code.
3560
3561         * config/pc532-mach.mt: New file. Support for pc532-mach target.
3562
3563         * config/ns32k-netbsd.mt: New file. Support for netbsd532 target.
3564
3565         * aout-ns32k.c, aout-ns32k.h: New files supporting aout format for
3566         ns32k series. 
3567
3568         * targets.c: Add netbsd532_vec and pc532machaout_vec into
3569         bfd_target_vector array. Move netbsd386_vec to alphabetic order
3570         location.
3571
3572         * reloc.c (_bfd_final_link_relocate) Add support for
3573         special_function1 in howto.
3574
3575         * libaout.h: add M_NS32032, M_NS32532, M_532_NETBSD entries in
3576         machine_type enum.
3577
3578         * configure.in: add pc532mach_vec and netbsd532_vec entries.
3579
3580         * config.bfd: add pc532mach host entries. Use for both
3581         ns32k-pc532-mach and ns32k-pc532-netbsd.
3582
3583         * config.bfd: it doesn't work to use i386-mach3 for ns32k*-*-mach.
3584         add ns32k-pc532-mach* and ns32k-*-netbsd* entries.
3585
3586         * bfd-in2.h: Add ns32k specific relocations to bfd_reloc_code_real
3587         enum.
3588
3589         * bfd-in2.h: Add special_function1 to struct howto. Change HOWTO
3590         and NEWHOWTO macros to make special_function1 NULL. Neww HOWTO2
3591         macro.
3592
3593         * bfd-in2.h: Split definition of struct reloc_howto_struct
3594         and corresponding typedef into two statements.
3595
3596         * bfd-in2.h: Add entry bfd_arch_ns32k to bfd_architecture enum.
3597
3598         * archures.c: Add bfd_ns32k_arch prototype, and entry in
3599         archures_init_table. 
3600
3601         * aoutx.h (aout_link_reloc_link_order): Allow for target dependent
3602         MY_put_reloc macro. Allow for target dependent special_function1
3603         to apply the relocation. 
3604
3605         * aoutx.h (aout_link_input_section_std): Allow for target
3606         dependent determination of reloc howto. Allow for target dependent
3607         special_function1 to apply the relocation.
3608
3609         * aoutx.h (get_reloc_upper_bound): Detect bss and return 0.
3610
3611         * aoutx.h (slurp_reloc_table): Detect bss and succesfully read
3612         zero reloc entries.
3613
3614         * aoutx.h (machine_type): Add bfd_arch_ns32k case.
3615
3616         * aoutx.h: Stat to determine executable status if STAT_FOR_EXEC
3617         is defined (not just MACH). Use fstat instead of stat and check
3618         for fstat error.
3619
3620         * aoutx.h: Allow target dependent swap_std_reloc_{in,out}.
3621
3622         * aoutx.h: Allow CTORS reloc info to be in target dependent reloc
3623         table.
3624
3625         * aout-target.h: Apply SWAP_MAGIC (if defined) after
3626         swap_exec_header_in, otherwise we have magic in the wrong order.
3627
3628 Thu Jul 14 11:47:27 1994  Stan Shebs  (shebs@andros.cygnus.com)
3629
3630         * coff-sparc.c (sparccoff_vec): Have leading underscores.
3631
3632 Tue Jul 12 12:08:10 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3633
3634         * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c,
3635         hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c,
3636         rs6000-core.c, trad-core.c:  Remove SEC_ALLOC flag from .reg
3637         sections, .reg sections are not allocated and contain debug
3638         information only.
3639         * osf-core.c (make_bfd_asection, osf_core_core_file_p):  Use
3640         bfd_make_section_anyway instead of building unique section names.
3641
3642 Tue Jul 12 11:41:22 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3643
3644         * libelf.h (bfd_elf32_swap_symbol_in): Declare.
3645         (bfd_elf32_swap_symbol_out): Declare.
3646         (bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare.
3647         * elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast.
3648
3649         * aout-encap.c (ARCH): Don't define.  Obsolete.
3650         * aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise.
3651         * i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise.
3652         * i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise.
3653         * newsos3.c, sparclynx.c, sunos.c: Likewise.
3654
3655 Mon Jul 11 20:08:23 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3656
3657         * section.c (STD_SECTION): Make the sixth argument boolean, not
3658         the seventh.  From gary@tuva.pacsemi.oz.au (gary kopff).
3659
3660 Sun Jul 10 09:12:02 1994  D. V. Henkel-Wallace  (gumby@cygnus.com)
3661
3662         * aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE
3663         in order not to collide with LynxOS's definition of FREE in
3664         /usr/include/sys/proc.h
3665
3666 Thu Jul  7 14:18:06 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3667
3668         * reloc.c (bfd_perform_relocation): Don't clobber the relocation
3669         value for coff-Intel-little or coff-Intel-big.  Hack upon hack.
3670
3671 Thu Jul  7 10:10:34 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3672
3673         * aoutx.h (howto_table_std):  Add entry for GOT relocations
3674         which are present in sun3 shared libraries, to avoid assertions
3675         when reading the dynamic relocations.
3676
3677 Thu Jul  7 10:19:20 1994  Jeff Law  (law@snake.cs.utah.edu)
3678
3679         * som.h (R_HPPA_COMPLEX): Fix dumb typo. 
3680
3681 Wed Jul  6 19:21:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3682
3683         * hosts/sysv4.h (qsort, strtol): Don't declare.
3684
3685         * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook
3686         if it is NULL.
3687
3688         * elf32-mips.c (mips_elf_final_write_processing): Add ignored info
3689         argument to correspond to recent libelf.h change.
3690
3691 Wed Jul  6 00:48:57 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3692
3693         * coff-alpha.c (alpha_ecoff_mkobject_hook):  New hook to
3694         additionally copy object type information from the alpha file
3695         header to the BFD flags.
3696         (alpha_ecoff_backend_data):  Use it.
3697         (ecoffalpha_little_vec):  Add DYNAMIC to object_flags.
3698         * aout64.c:  Fix typo in conditional QMAGIC definition.
3699
3700 Wed Jul  6 00:13:17 1994  Jeff Law  (law@snake.cs.utah.edu)
3701
3702         * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the
3703         value of clicksz to help weed out non HPPA BSD core files.
3704
3705 Tue Jul  5 13:26:02 1994  Stan Shebs  (shebs@andros.cygnus.com)
3706
3707         Mach 3 support.
3708         * config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*):
3709         New targets.
3710         * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize
3711         "mach3" instead of "mach".
3712         (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts.
3713         * targets.c (m88kmach3_vec): New target vector.
3714         (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but
3715         inside #if 0.
3716         * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by
3717         checking for execute permission, instead of looking at entry
3718         point.
3719         * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR,
3720         N_SHARED_LIB, don't include aout/*.h files, etc.
3721         * m88kmach3.c: New file, m88k Mach 3 target.
3722         * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target
3723         makefile fragments.
3724         * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh:
3725         New files, host makefile fragments.
3726         * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions.
3727
3728 Tue Jul  5 13:56:52 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3729
3730         * elfcode.h (swap_out_syms): Get alignment of common symbol from
3731         st_value field of saved ELF symbol information, if there is any.
3732
3733 Mon Jul  4 19:13:32 1994  Jeff Law  (law@snake.cs.utah.edu)
3734
3735         * som.h (R_HPPA_COMPLEX): Define.
3736         * elf32-hppa.h (R_HPPA_COMPLEX): Define.
3737         (elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17.
3738
3739 Fri Jul  1 12:07:41 1994  Jeff Law  (law@snake.cs.utah.edu)
3740
3741         * Support code for enabling the new style linker for PA ELF.
3742         * elfcode.h (swap_symbol_in, swap_symbol_out): Externalize.
3743         (elf_compute_section_file_positions): Pass link_info to
3744         the begin_write_processing hook.
3745         (bfd_elf_write_object_contents): Pass NULL for new link_info
3746         argument to final_write_processing hook.
3747         (elf_link_output_sym): Accept new "input_section" argument for
3748         the symbols's input section.  All callers changed.  Call the
3749         link_output_symbol_hook if it's defined.
3750         (elf_bfd_final_link): Call the final_write_processing hook if
3751         it's defined.
3752         * libelf.h (elf_backend_link_output_symbol_hook): Declare.
3753         (elf_backend_begin_write_processing): Add new "info" argument.
3754         (elf_backend_final_write_processing): Likewise.
3755         * elf32-target.h (elf_backend_link_output_symbol_hook): Provide
3756         a default definition.
3757         (elf32_bed): Add elf_backend_link_output_symbol_hook.
3758         * elf64-target.h: Likewise.
3759         
3760         * Major rework of the PA ELF code.  Uses the new style BFD
3761         linker, major cleanups.
3762         * hppa_stubs.h: Rewrite from scratch.  Much smaller and simpler.
3763         * elf32-hppa.h: Delete all symbol extension related code.
3764         (hppa_look_for_stubs_in_section): Delete decl.
3765         (elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls.
3766         * elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h
3767         into elf32-hppa.c.  Do not include aout64.h.
3768         (typdef hppa_stub_type): Delete.
3769         (elf32_hppa_stub_name_list_struct): Delete.
3770         (elf32_hppa_stub_description_struct): Delete.
3771         (arg_reloc_type): Use simpler enumerations.  All references changed.
3772         (arg_location, arg_reloc_relocation): Likewise.
3773         (elf32_hppa_symextn_map_struct): Delete.
3774         (get_symbol_value): Delete.
3775         (elf32_hppa_get_sym_extn): Delete.
3776         (find_stubs, new_stubs, type_of_mismatch): Delete.
3777         (find_stub_by_name, add_stub_by_name): Delete.
3778         (hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete.
3779         (hppa_elf_arg_reloc_needed): Renamed.  Simplify.
3780         (hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete.
3781         (hppa_elf_long_branch_needed_p): Delete.
3782         (hppa_look_for_stubs_in_section): Delete.
3783         (hppa_elf_get_section_contents): Delete.
3784         (elf32_hppa_backend_symbol_processing): Delete.
3785         (elf32_hppa_backend_section_processing): Delete.
3786         (elf32_hppa_backend_section_from_shdr): Delete.
3787         (elf32_hppa_backend_fake_sections): Delete.
3788         (elf32_hppa_backend_section_from_bfd_section): Delete.
3789         (NEW_INSTRUCTION): Delete.
3790         (CURRENT_STUB_OFFSET): Delete.
3791         (elf32_hppa_relocate_section): New function.
3792         (elf32_hppa_bfd_final_link_relocate): New function.
3793         (elf32_hppa_size_symext): New function.
3794         (elf32_hppa_link_output_symbol_hook): New function.
3795         (elf32_hppa_read_symext_info): New function.
3796         (elf32_hppa_add_symbol_hook): New function.
3797         (elf32_hppa_name_of_stub): New function.
3798         (elf32_hppa_size_of_stub): New function.
3799         (elf32_hppa_build_one_sub): New function.
3800         (elf32_hppa_build_stubs): New function.
3801         (elf32_hppa_size_stubs): New function.
3802         (linker, stub and argument hash tables): Add appropriate
3803         structures, definitions and functions to implement all three
3804         hash tables.
3805         (hppa_elf_relocate_insn): Don't need argument location information
3806         in this function.
3807         (add_entry_to_symext_chain): Accept a symbol's argument location
3808         information rather than the symbol itself.  All callers changed.
3809         (hppa_elf_gen_reloc_type): Simplify.
3810         (hppa_elf_set_section_contents): Stub section is no longer special.
3811         (hppa_elf_reloc): Greatly simplify.
3812         (elf32_hppa_begin_write_processing): Accept link_info argument.
3813         Handle being called from the BFD backend linker.
3814         (elf32_hppa_final_write_processing): Likewise.
3815         (elf_hppa_tc_make_sections): No longer call stub_finish.
3816         
3817 Mon Jun 27 18:07:06 1994  Steve Chamberlain  (sac@cirdan.cygnus.com)
3818
3819         * section.c (bfd_get_section_contents): Put in parens to get
3820         precedence right.
3821
3822 Sun Jun 26 18:08:29 1994  Jeff Law  (law@snake.cs.utah.edu)
3823
3824         * libelf.h (relocate_section): New argument "output_names" added
3825         to prototype.
3826         * elfcode.h (elf_link_input_bfd): New argument "output_names"
3827         added to prototype of relocate_section.  Pass the output symbol
3828         names to relocate_section.
3829         * elf32-i386.c (elf_i386_relocate_section): Use "output_names" to
3830         determine the name of a local symbol.
3831         * elf32-mips.c (mips_elf_relocate_section): Likewise.
3832         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
3833
3834 Fri Jun 24 08:15:42 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3835
3836         Add Solaris BCP (the part of Solaris which allows it to run
3837         SunOS4 a.out files) core file handling.
3838         * aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp):
3839         New structure and its swap in function.
3840         (internal_sunos_core):  New member c_data_addr, to receive the
3841         start address of the data section in the core file.
3842         (swapcore_sun3, swapcore_sparc, sunos4_core_file_p):  Use it.
3843         (sunos4_core_file_p):  Recognize Solaris BCP core file.
3844         (sunos4_core_file_matches_executable_p):  Always indicate match
3845         for Solaris BCP core files.
3846
3847 Thu Jun 23 15:31:28 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3848
3849         Preliminary support for generating shared libraries, from Eric
3850         Youngdale <ericy@cais.cais.com>.
3851         * elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN.
3852         (elf_link_add_object_symbols): If generating a shared library,
3853         create dynamic sections for first input BFD with the right format.
3854         (elf_link_create_dynamic_sections): Don't create .interp section
3855         if creating a shared library.
3856         (elf_link_input_bfd): Skip dynamic sections in input file.
3857         (elf_bfd_final_link): If creating a shared library, it's OK for
3858         dynobj to have sections which are not SEC_IN_MEMORY.
3859         * elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp
3860         section if not creating a shared library.
3861         * elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise.
3862
3863         * elfcode.h (elf_object_p): Don't set DYNAMIC just because there
3864         is an SHT_DYNAMIC section.
3865
3866         * cf-i386lynx.c (i386coff_vec): Don't include DYNAMIC in
3867         object_flags.
3868         * coff-sparc.c (sparccoff_vec): Likewise.
3869         * hppabsd-core.c (hppabsd_core_vec): Likewise.
3870
3871         * aoutx.h (NAME(aout,some_aout_object_p)): Don't set SEC_RELOC
3872         just because DYNAMIC is set.
3873
3874 Thu Jun 23 12:53:41 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
3875
3876         * configure.in: Change --with-targets to --enable-targets and
3877         --with-64-bit-bfd to --enable-64-bit-bfd.
3878         * Makefile.in, mpw-make.in, targets.c: Change comments.
3879
3880 Wed Jun 22 17:59:59 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3881
3882         * config.bfd (powerpc-*-elf*): New target, just like
3883         powerpc-*-sysv4*.
3884
3885         * linker.c (FAIL): Undefine macro before defining as enum.
3886
3887 Wed Jun 22 10:52:47 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3888
3889         * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
3890         pass from abfd->archive_pass, and save it there as well.
3891
3892         * hash.c (bfd_hash_allocate): Don't call bfd_set_error if
3893         obstack_alloc returns NULL unless the size is non-zero.
3894
3895         * linker.c (archive_hash_allocate): Define.
3896         (_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate
3897         rather than obstack_alloc, for clarity.
3898
3899         * elfcode.h (elf_get_reloc_upper_bound): Correct.
3900
3901         * aout64.c (BMAGIC, QMAGIC): Define if not already defined.  From
3902         Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
3903
3904         Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
3905         * libaout.h (struct aoutdata): Add field zmagic_disk_block_size.
3906         * aout-target.h (MY(callback)): Only set alignment according to
3907         architecture if the section sizes are aligned to that alignment,
3908         for backward compatibility.
3909         (MY(set_sizes)): Initialize zmagic_disk_block_size field.
3910         * aoutx.h (adjust_z_magic): Set ztih if using q_magic_format.  Set
3911         text section filepos to zmagic_disk_block_size if not ztih.  Use a
3912         different padding algorithm if not ztih.
3913         * i386linux.c (MY_text_includes_header): Don't define.
3914
3915         * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN
3916         symbols; don't look them up in the hash table.  From
3917         ralphc@pyramid.com (Ralph Campbell).
3918
3919 Tue Jun 21 11:47:20 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3920
3921         * coff-go32.c (go32coff_archive_p): Remove unused function.
3922
3923         * section.c (bfd_abs_section): Make const.
3924         (bfd_abs_section_ptr, bfd_is_abs_section): Define.
3925         (bfd_und_section): Make const.
3926         (bfd_und_section_ptr, bfd_is_und_section): Define.
3927         (bfd_com_section): Make const.
3928         (bfd_com_section_ptr): Define.
3929         (bfd_ind_section): Make const.
3930         (bfd_ind_section_ptr, bfd_is_ind_section): Define.
3931         (bfd_abs_symbol, bfd_com_symbol): Make const.
3932         (bfd_und_symbol, bfd_ind_symbol): Likewise.
3933         (global_syms): Cast initialization of section field.
3934         (STD_SECTION): Define as const, and cast initializations.
3935         * bfd-in2.h: Rebuilt.
3936         * Many files: Change uses of bfd_abs_section, etc., to use
3937         bfd_abs_section_ptr or bfd_is_abs_section, etc.
3938
3939 Mon Jun 20 11:06:27 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
3940
3941         * Many files: change all bfd_target vectors to be const.  Change
3942         all uses of bfd_target * to be const bfd_target *.  Change
3943         bfd_target_vector and bfd_default_vector arrays to be const
3944         bfd_target * const *.
3945
3946         * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c,
3947         elf32-mips.c: Renamed all externally visible ECOFF routines which
3948         are local to BFD to start with _bfd_ecoff instead of just ecoff.
3949
3950         * ecoff.c (ecoff_swap_tir_in): Change input argument to const.
3951         (ecoff_swap_tir_out): Likewise.
3952         (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
3953         (ecoff_slurp_symbolic_info): Add new arguments to correspond to
3954         read_debug_info entry point in ecoff_debug_swap structure.
3955         Change all calls.
3956         * libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
3957         * ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
3958         (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
3959         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new
3960         ecoff_debug_swap fields.
3961         * coff-mips.c (mips_ecoff_backend_data): Likewise.
3962         * elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
3963         (mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
3964         fields.
3965         * configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
3966         ecofflink.o.
3967         (bfd_elf32_littlemips_vec): Likewise.
3968         (ecoff_big_vec, ecoff_little_vec): Likewise.
3969         (ecoffalpha_little_vec): Likewise.
3970         * Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
3971         (BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
3972
3973         * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
3974         when computing reloc sizes.  From Eric Youngdale
3975         <ericy@cais.cais.com>.
3976         * elfcode.h (elf_bfd_final_link): Don't try to compute maximum
3977         reloc count or size for a non-ELF file.
3978
3979         * mipsbsd.c (MY_final_link_callback): Define to avoid warning.
3980
3981         * hp300hpux.c (MY_final_link_callback): Define to avoid warning.
3982         (BMAGIC, QMAGIC): Define; used by aoutx.h.
3983         (MY(slurp_symbol_table)): Change translate_from_native_sym_flags
3984         calls to use new parameters.
3985
3986 Fri Jun 17 14:45:32 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3987
3988         * aout-target.h (MY(callback)): Set the alignments of the text,
3989         data and bss sections after determining the architecture.
3990
3991         * sunos.c (sunos_add_one_symbol): Treat a common symbol from a
3992         dynamic object as being in the .bss section of the object, rather
3993         than as being undefined.
3994
3995 Fri Jun 17 11:16:50 1994  Jeff Law  (law@snake.cs.utah.edu)
3996
3997         * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE.
3998
3999         * elf32-hppa.h (elf_hppa_final_processing): Delete decl.
4000
4001 Thu Jun 16 23:36:23 1994  Jeff Law  (law@snake.cs.utah.edu)
4002
4003         * elfcode.h (elf_link_input_bfd): Don't try to read local symbols
4004         if there aren't any in the input file.
4005
4006 Thu Jun 16 14:25:22 1994  Eric Youngdale  (ericy@cais.cais.com)
4007
4008         * i386linux.c: Many new functions and definitions for linker
4009         support for Linux shared libraries.
4010         * bfd-in.h (bfd_linux_size_dynamic_sections): Declare.
4011         * bfd-in2.h: Rebuild.
4012
4013 Thu Jun 16 14:23:46 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4014
4015         * config.bfd: If second argument is ``_'', then, instead of
4016         echoing config file name, echo whether target uses leading
4017         underscores on symbol names.  Add appropriate settings to
4018         different cases.  Used by binutils/configure.in to set default for
4019         c++filt.
4020
4021         * elfcode.h (elf_bfd_final_link): If trying to generate a shared
4022         object, warn and return false.
4023
4024         * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects
4025         and treat them as OMAGIC.
4026
4027 Wed Jun 15 18:02:21 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4028
4029         Enable sparc v9 support for release.  Note that this is still a
4030         work in progress, pending release of an ABI specification.
4031         * config.bfd, configure.in: Include sparc v9 elf config.
4032         * elfcode.h (prep_headers): Handle sparc v9 (64 bit).
4033         * reloc.c (bfd_reloc_code_real): New reloc types.
4034         * elf64-sparc.c: Implement elf64-sparc target.
4035         * Makefile.in, targets.c: Updated.
4036
4037 Wed Jun 15 01:34:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4038
4039         * libelf.h (struct elf_obj_tdata): New field dt_needed_name.
4040         (elf_dt_needed_name): New accessor macro.
4041         * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
4042         is set, use that instead of the filename for the DT_NEEDED dynamic
4043         entry.
4044         * elf.c (bfd_elf_set_dt_needed_name): New function.
4045         * bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
4046         * bfd-in2.h: Rebuilt.
4047
4048         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
4049         argument, and set it to the .interp section.
4050         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
4051         (bfd_elf64_size_dynamic_sections): Likewise.
4052         * bfd-in2.h: Rebuilt.
4053
4054         * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare
4055         field of the reloc rather than letting it be garbage.
4056
4057         * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as
4058         __.SYMDEF; the former was used in old Linux archives.  From
4059         jrs@world.std.com (Rick Sladkey).
4060
4061         * i386linux.c (i386linux_write_object_contents): Define; like
4062         MY(write_object_contents) in aout-target.h, but set MACHTYPE to
4063         M_386.  From jrs@world.std.com (Rick Sladkey).
4064         (MY_write_object_contents): Define.
4065
4066         * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols
4067         as N_DATA symbols.
4068         (aout_link_add_symbols): Likewise.
4069
4070         * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash
4071         tables.
4072         (struct stringtab_entry, struct stringtab_data): Remove.
4073         (HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove.
4074         (struct strtab_hash_entry, struct strtab_hash): Define.
4075         (strtab_hash_newfunc, strtab_hash_lookup): Define.
4076         (stringtab_free, emit_stringtab): Define.
4077         (stringtab_init, add_to_stringtab): Rewrite.
4078         (NAME(aout,write_syms)): Use new stringtab code.
4079         (struct aout_final_link_info, NAME(aout,final_link)): Likewise.
4080         (aout_link_write_symbols, aout_link_write_other_symbol): Likewise.
4081
4082         * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to
4083         request BFD to write object in the traditional format, whatever
4084         that means for the particular backend.
4085         * bfd-in2.h: Rebuilt.
4086
4087         * hash.c (bfd_hash_allocate): If obstack_alloc fails, set
4088         bfd_error_no_memory.
4089
4090 Tue Jun 14 13:00:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4091
4092         * libaout.h (struct aoutdata): Add q_magic_format to subformat
4093         enum.
4094         * aout-target.h (MY_bfd_copy_private_bfd_data): Define as function
4095         if not already defined.  Copy subformat information.
4096         (MY_text_includes_header): Define as 0 if not already defined.
4097         (MY(backend_data)): Use MY_text_includes_header rather than 0.
4098         (MY_final_link_callback): Rename from final_link_callback, and
4099         define only if MY_final_link_callback is not already defined.
4100         (MY_bfd_final_link): Rename use of final_link_callback to
4101         MY_final_link_callback.
4102         * aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like
4103         ZMAGIC, but set the subformat to q_magic_format.  Abort if the
4104         magic number if not recognized.
4105         (adjust_z_magic): Use QMAGIC if q_magic_format.
4106         * i386linux.c (MY_text_includes_header): Define as 1.
4107         (i386linux_bfd_final_link): New static function.
4108         (MY_bfd_final_link): Define as i386linux_bfd_final_link.
4109
4110         * aoutx.h (translate_to_native_sym_flags): Check both section and
4111         output_section against sections of abfd.
4112
4113         * libecoff.h (struct ecoff_link_hash_entry): Change type of
4114         written from boolean to char.  Add new field small.
4115         * ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0
4116         rather than false.  Initialize small to 0.
4117         (ecoff_link_add_externals): If ECOFF type is scSUndefined, set
4118         small.  If small is set, and hash table type is common, force the
4119         symbol into a section named SCOMMON and change the ECOFF type from
4120         scCommon to scSCommon.
4121         (ecoff_link_write_external): Set written to 1 rather than true.
4122         * coff-mips.c (mips_relocate_section): Correct JMPADDR reloc
4123         overflow check to consider section VMA of input file.
4124
4125 Mon Jun 13 14:20:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4126
4127         * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a
4128         machine type of 68000.
4129         * aoutx.h (NAME(aout,machine_type)): Add new argument unknown.
4130         Set *unknown to true if machine type is really unknown, as opposed
4131         to M_UNKNOWN for the 68000.
4132         (NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call
4133         accordingly.
4134         * libaout.h (NAME(aout,machine_type)): Add new argument to
4135         prototype.
4136
4137 Sun Jun 12 20:21:03 1994  Jeff Law  (law@snake.cs.utah.edu)
4138
4139         * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID
4140         or HIUX_AUX_ID.
4141         (som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID.
4142         (som_write_armap): Use CPU_PA_RISC1_0 as the magic number.  Note
4143         som.c is careful to always define CPU_PA_RISC1_0.
4144
4145 Sat Jun 11 16:32:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4146
4147         Add weak symbols as an extension to a.out.
4148         * aoutx.h (sym_in_text_section): Don't define.
4149         (sym_in_data_section, sym_in_bss_section): Likewise.
4150         (sym_is_undefined, sym_is_global_defn): Likewise.
4151         (sym_is_debugger_info, sym_is_fortrancommon): Likewise.
4152         (sym_is_absolute, sym_is_indirect): Likewise.
4153         (translate_from_native_sym_flags): Rewrite for clarity.  Rearrange
4154         arguments and change caller.  Handle weak symbols.
4155         (translate_to_native_sym_flags): Likewise.
4156         (aout_link_check_ar_symbols): Don't ignore weak symbols.  Pull
4157         object in from archive if a weak defintion is found for an
4158         existing undefined symbol.
4159         (aout_link_add_symbols): Put all cases in switch.  Set flags of an
4160         undefined symbol to 0.  Handle weak symbols.
4161         (aout_link_write_symbols): Handle weak symbols.
4162         (aout_link_write_other_symbol): Likewise.
4163         (aout_link_input_section_std): Likewise.
4164         (aout_link_input_section_ext): Likewise.
4165         * sunos.c (sunos_write_dynamic_symbol): Likewise.
4166
4167 Fri Jun 10 13:25:13 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4168
4169         * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
4170         (NAME(aout,get_reloc_upper_bound)): Likewise.
4171
4172         * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR.
4173         * linker.c (_bfd_generic_link_write_global_symbol): Don't assume
4174         the section of a common symbol is not NULL.
4175
4176 Wed Jun  8 23:15:53 1994  Stu Grossman  (grossman@cygnus.com)
4177
4178         * nlmcode.h (nlm_object_p):  Set EXEC_P and start address for GDB.
4179
4180 Wed Jun  8 23:57:34 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4181
4182         * aoutx.h (aout_get_external_symbols): Don't try to read the
4183         strings if there are no symbols.
4184         (aout_link_write_other_symbol): Use the output section when
4185         working out the type.
4186
4187 Tue Jun  7 13:25:08 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4188
4189         * elfcode.h (assign_section_numbers): Put shstrtab, symtab and
4190         strtab sections at end of file.  Avoids bug in some versions of
4191         SVR4 strip.  From Eric Youngdale <eric@tantalus.nrl.navy.mil>.
4192
4193         * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined,
4194         set SEC_DEBUGGING for STYP_INFO sections.
4195         (coff_compute_section_file_positions): If COFF_PAGE_SIZE is
4196         defined, and D_PAGED is set, set the file position equal to the
4197         section VMA modulo COFF_PAGE_SIZE.
4198         * coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED.
4199         * coff-i386.c: Set D_PAGED in BFD target.
4200         (COFF_PAGE_SIZE): Define.
4201         * coff-m68k.c, coff-sparc.c: Likewise.
4202
4203 Mon Jun  6 10:57:28 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4204
4205         * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section
4206         into a BFD section just because SHF_ALLOC is set; require that it
4207         not use the normal symbol table.
4208         (elf_section_from_bfd_section): Corresponding change.
4209
4210         Better indirect and warning symbol handling inspired by Stuart
4211         Quick <stuck@cs.man.ac.uk>.
4212         * linker.c (enum link_action): Add REF, MIND, CWARN, REFC.
4213         (link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT
4214         to REF.  Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to
4215         REFC.  Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF.
4216         Change DEFW_ROW/indr from CYCLE to NOACT.  Change INDR_ROW/indr
4217         from MDEF to MIND.  Change INDR_ROW/warn from WARNC to CYCLE.
4218         Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN.  Change
4219         WARN_ROW/com from MWARN to WARN.  Change WARN_ROW/warn from NOACT
4220         to CYCLE.  Change SET_ROW/warn from WARNC to CYCLE>
4221         (_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and
4222         REFC.  If a new indirect symbol has been referenced, push the
4223         reference down to the symbol it points to.  FIx handling of WARN.
4224         * aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't
4225         clobber e_type of next symbol.
4226         (translate_to_native_sym_flags): Likewise.
4227         (aout_link_write_symbols): Loop on bfd_link_hash_warning as well
4228         as bfd_link_hash_indirect.
4229
4230         * libaout.h (struct aout_link_hash_entry): New field written.
4231         * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written.
4232         (aout_link_write_symbols): Use written, not root.written.
4233         (aout_link_write_other_symbol): Likewise.
4234         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
4235         * libecoff.h (struct ecoff_link_hash_entry): New field written.
4236         * ecoff.c (ecoff_link_hash_newfunc): Initialize written.
4237         (ecoff_link_write_external): use written, not root.written.
4238         * genlink.h (struct generic_link_hash_entry): New field written.
4239         * linker.c (_bfd_link_hash_newfunc): Don't initialize written.
4240         (generic_link_hash_newfunc): Initialize written.
4241         (_bfd_generic_link_output_symbols): Use written, not root.written.
4242         (_bfd_generic_link_write_global_symbol): Likewise.
4243         (_bfd_generic_reloc_link_order): Likewise.
4244
4245         * libecoff.h (ecoff_data_type): Add linker field.
4246         * ecoff.c (ecoff_write_object_contents): Check new tdata linker
4247         field, rather than outsymbols being non-NULL, to decide whether to
4248         output the symbols and relocs.
4249         (ecoff_bfd_final_link): Set new tdata linker field to true.
4250
4251         * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy
4252         data to a non-ECOFF file.
4253
4254         * libbfd-in.h: Add warning that libbfd.h is a generated file.
4255         * libbfd.h: Rebuilt.
4256
4257 Sun Jun  5 15:02:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4258
4259         Changes to support ELF strip and objcopy on dynamically linked
4260         files.
4261         * elfcode.h (elf_fake_sections): Add prototype.
4262         (bfd_section_from_shdr): Make a BFD section from an SHT_HASH
4263         section, and from an SHT_DYNSYM section, and from the dynamic
4264         string table section.
4265         (elf_object_p): Set D_PAGED if there is a program header.
4266         (elf_make_sections): Remove.
4267         (fix_up_strtabs): Remove.
4268         (elf_fake_sections): Rewrite.  Now sets sh_entsize.
4269         (assign_section_numbers): Rewrite.  Now sets sh_link and sh_info
4270         for all sections.
4271         (elf_compute_section_file_positions):  Don't call obsolete
4272         functions elf_make_sections or fix_up_strtabs.
4273         (swap_out_syms): Set sh_addralign to FILE_ALIGN rather than 4.
4274         (NAME(bfd_elf,write_object_contents)): Permit writing DYNAMIC
4275         objects.
4276         (elf_section_from_bfd_section): Treat SHT_DYNSYM like other normal
4277         sections.  If an SHT_REL or SHT_RELA section is allocated or uses
4278         an unusual symbol table, permit a BFD section to map to it.
4279         Permit most SHT_STRTAB sections to have a BFD section mapped to
4280         them.
4281         (elf_bfd_final_link): Don't set sh_link, sh_info or sh_entsize
4282         fields of dynamic sections here; do it in assign_section_numbers.
4283         * elf32-target.h, elf64-target.h: Add D_PAGED to permitted object
4284         flags.
4285
4286         * elf.c (_bfd_elf_make_section_from_shdr): Only set SEC_DATA if
4287         SEC_LOAD is set, rather than checking SEC_ALLOC.
4288
4289         * libbfd-in.h (bfd_realloc): Change last arg to "size_t size".
4290
4291 Fri Jun  3 10:58:02 1994  Jeff Law  (law@snake.cs.utah.edu)
4292
4293         * som.c (som_write_object_contents): Don't compute the file header's
4294         checksum here.
4295         (som_write_headers): Instead do it here.
4296
4297         * libbfd.h (bfd_realloc): Change last arg to "size_t size".
4298
4299 Thu Jun  2 17:39:22 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4300
4301         * hosts/sun3.h: Include <stdlib.h>.  Don't declare free, exit or
4302         getenv.
4303
4304         Add linker support for SunOS shared libraries.
4305         * sunos.c: Include bfdlink.h.  Add many new functions and
4306         definitions for SunOS shared library support.
4307         * bfd-in.h (bfd_sunos_record_link_assignment): Declare.
4308         (bfd_sunos_size_dynamic_sections): Declare.
4309         * bfd-in2.h: Rebuilt.
4310         * aoutx.h (struct aout_link_hash_entry): Move to libaout.h.
4311         (struct aout_link_hash_table): Likewise.
4312         (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
4313         (aout_hash_table): Likewise.
4314         (NAME(aout,link_hash_newfunc)): Rename from aout_link_hash_newfunc
4315         and make externally visible.
4316         (NAME(aout,link_hash_table_init)): New function.
4317         (NAME(aout,link_hash_table_create)): Call
4318         NAME(aout,link_hash_table_init), not _bfd_link_hash_table_init.
4319         (aout_link_add_symbols): Don't fail if no symbols.  If it exists,
4320         call add_dynamic_symbols backend entry point for dynamic objects.
4321         Use add_one_symbol backend entry point if it exists.
4322         (NAME(aout,final_link)): Call finish_dynamic_link backend entry
4323         point, if it exists.
4324         (aout_link_input_bfd): For a dynamic object, call
4325         link_dynamic_object backend entry point, if it exists.
4326         (aout_link_write_other_symbol): Call write_dynamic_symbol backend
4327         entry point, if it exists.
4328         (aout_link_input_section): Don't read the relocs if they have
4329         already been read.
4330         (aout_link_input_section_std): When doing a final link, for a
4331         reloc against an external symbol, call check_dynamic_reloc backend
4332         entry point, if it exists.
4333         (aout_link_input_section_ext): Likewise.
4334         * libaout.h: Protect against multiple inclusion.  Include
4335         bfdlink.h.
4336         (struct aout_link_hash_entry): Move in from aoutx.h.
4337         (struct aout_link_hash_table): Likewise.
4338         (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
4339         (aout_hash_table): Likewise.
4340         (struct aout_backend_data): Add fields add_dynamic_symbols,
4341         add_one_symbol, link_dynamic_object, write_dynamic_symbol,
4342         check_dynamic_reloc, and finish_dynamic_link.
4343         (struct aout_section_data_struct): Define new structure.
4344         (aout_section_data): Define new accessor macro.
4345         (NAME(aout,link_hash_newfunc)): Declare.
4346         (NAME(aout,link_hash_table_init)): Declare.
4347         * aoutf1.h (sunos4_aout_backend): Initialize new aout_backend_data
4348         fields.
4349         * aout-target.h (MY(backend_data)): Likewise.
4350         * i386aout.c (MY(backend_data)): Likewise.
4351         * i386mach3.c (MY(backend_data)): Likewise.
4352         * mipsbsd.c (MY(backend_data)): Likewise.
4353         * sparclynx.c (sparclynx_aout_backend): Likewise.
4354
4355         * aoutx.h (NAME(aout,slurp_symbol_table)): Don't zero out cached
4356         until we know it is non-NULL.
4357         (aout_link_write_symbols): Don't skip a warning symbol even if it
4358         has already been written out.  If skipping an indirect symbol,
4359         skip the next symbol as well.
4360
4361 Wed Jun  1 14:37:50 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4362
4363         * hosts/sun3.h: Don't declare qsort, malloc or realloc.
4364
4365 Thu May 26 13:56:03 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4366
4367         * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer
4368         to char pointer to avoid compiler warnings.
4369
4370         * dep-in.sed: Remove spaces before colons.
4371
4372         Merged changes back in from FSF gas release 2.3:
4373
4374         * Makefile.in (stmp-bfd.h): Wrap `if' block around grep
4375         invocation, to avoid a bug in BSD 4.4 make.
4376
4377         From Ralph Campbell:
4378         * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an
4379         error.
4380         (mips_fix_hi16_s): Ditto.
4381
4382         Fri May 13 21:21:00 1994  DJ Delorie (dj@ctron.com)
4383
4384         * makefile.dos: define a default target, or archives won't work
4385           due to multiple matches.
4386
4387         Wed May 11 22:32:00 1994  DJ Delorie (dj@ctron.com)
4388
4389         * configure.bat: update for latest files
4390         * makefile.dos: update for correct targets and sources
4391         * coff-go32.c: [new] go32's COFF format (i386coff with underscores)
4392         * targets.c: add go32coff target
4393         * makefile.in: add coff-go32.c support
4394
4395 Thu May 26 10:10:21 1994  Jeff Law  (law@snake.cs.utah.edu)
4396
4397         * som.c (som_prep_headers): Do not set the system_id here, private
4398         bfd data has not been copied yet.
4399         (som_write_headers): Instead do it here.
4400
4401 Tue May 24 16:17:18 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4402
4403         Make MIPS ELF use new ELF backend linker.  No shared library
4404         support yet.
4405         * elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function.
4406         (bfd_mips_elf32_swap_gptab_out): New function.
4407         (mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab.
4408         (mips_elf_final_write_processing): Set sh_info field for .gptab.*
4409         sections.
4410         (mips_elf_fake_sections): Set sh_entsize for .gptab.* sections.
4411         (mips_elf_read_ecoff_info): Read and free external symbols last,
4412         not first, for clarity.
4413         (struct mips_elf_link_hash_entry): Define new structure.
4414         (struct mips_elf_link_hash_table): Define new structure.
4415         (mips_elf_link_hash_lookup): Define new macro.
4416         (mips_elf_link_hash_traverse): Define new macro.
4417         (mips_elf_hash_table): Define new macro.
4418         (mips_elf_link_hash_newfunc): New static function.
4419         (mips_elf_link_hash_table_create): New static function.
4420         (mips_elf_add_symbol_hook): New static function.
4421         (struct extsym_info): Define new structure.
4422         (mips_elf_get_extr, mips_elf_set_index): Remove.
4423         (mips_elf_output_extsym): New static function.
4424         (gptab_compare): New static function.
4425         (mips_elf_final_link): Rewrite to use ELF backend linker, and to
4426         merge gptab information in input files.
4427         (mips_elf_relocate_hi16): New static function.
4428         (mips_elf_relocate_section): New static function.
4429         (bfd_elf32_bfd_link_hash_table_create): Define as macro before
4430         including elf32-target.h.
4431         (elf_backend_relocate_section): Likewise.
4432         (elf_backend_add_symbol_hook): Likewise.
4433         * elf.c (_bfd_elf_link_hash_newfunc): Rename from
4434         elf_link_hash_newfunc and make globally visible.  Change caller.
4435         (_bfd_elf_link_hash_table_init): New function, broken out of
4436         _bfd_elf_link_hash_table_create.
4437         (_bfd_elf_link_hash_table_create): Use
4438         _bfd_elf_link_hash_table_init.
4439         * libelf.h (struct elf_obj_tdata): Add new field bad_symtab.
4440         (elf_bad_symtab): Define new accessor macro.
4441         (_bfd_elf_link_hash_newfunc): Declare.
4442         (_bew_elf_link_hash_table_init): Declare.
4443         * elfcode.h (elf_object_p): Call backend object_p hook after
4444         swapping in all the section headers.
4445         (map_program_segments): Correct typo: Internal for External.
4446         (elf_link_add_object_symbols): If elf_bad_symtab is set, read all
4447         the symbols.  Skip STB_LOCAL symbols rather than giving an error.
4448         (elf_bfd_final_link): If elf_bad_symtab is set, allocate space for
4449         all symbols, not just locals.
4450         (elf_link_output_extsym): Only skip a symbol not mentioned by a
4451         regular file if it is mentioned by a dynamic object.
4452         (elf_link_input_bfd): If elf_bad_symtab is set, read all the
4453         symbols.
4454
4455 Fri May 20 13:38:23 1994  Jeff Law  (law@snake.cs.utah.edu)
4456
4457         * som.c (som_set_reloc_info): Do not set any relocation info
4458         for SOM fixups which are never passed to BFD.
4459
4460 Fri May 20 11:57:05 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4461
4462         * coff-mips.c (mips_relocate_section): Add MIPS_R_JMPADDR overflow
4463         checking.
4464
4465         * elf32-i386.c (elf_i386_size_dynamic_sections): Add DT_DEBUG to
4466         the dynamic linking information for the benefit of the debugger.
4467         From Peter Schauer.
4468         * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
4469
4470         * elf.c (_bfd_elf_make_section_from_shdr): New function, based on
4471         code repeated three times in bfd_section_from_shdr in elfcode.h.
4472         * libelf.h (_bfd_elf_make_section_from_shdr): Declare.
4473         * elfcode.h (bfd_section_from_shdr): Use new function
4474         _bfd_elf_make_section_from_shdr to create BFD sections.  If a
4475         reloc section does not use the main symbol table, or it is part of
4476         the process image, treat it as a normal section, not relocs.
4477         * elf32-mips.c (mips_elf_section_from_shdr): Use new function
4478         _bfd_elf_make_section_from_shdr.
4479
4480 Thu May 19 11:37:11 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4481
4482         * elf32-target.h, elf64-target.h: Change ar_max_namelen value from
4483         15 to 14 to match SVR4 ar.
4484
4485         Add support for ELF shared libraries.  Loosely based on work by
4486         Eric Youngdale <ericy@cais.com>.
4487         * libelf.h (struct elf_backend_data): Add new fields for dynamic
4488         linking: elf_backend_create_dynamic_sections,
4489         elf_backend_adjust_dynamic_symbol,
4490         elf_backend_size_dynamic_sections,
4491         elf_backend_finish_dynamic_symbol,
4492         elf_backend_finish_dynamic_sections.
4493         (struct elf_link_hash_entry): Change type of align field to
4494         bfd_size_type.  Add fields dynindx, dynstr_index, weakdef,
4495         elf_link_hash_flags.
4496         (struct elf_link_hash_table): Add fields dynobj, dynsymcount,
4497         dynstr, bucketcount.
4498         (bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
4499         (bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
4500         (bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
4501         (bfd_elf32_add_dynamic_entry): Declare.
4502         (bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
4503         (bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
4504         (bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
4505         (bfd_elf64_add_dynamic_entry): Declare.
4506         * elfcode.h (Elf_External_Dyn): Define.
4507         (elf_swap_reloc_in): Define as macro using NAME.  Make externally
4508         visible.
4509         (elf_swap_reloc_out): Likewise.
4510         (elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
4511         (elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
4512         and as new externally visible function.
4513         (elf_fake_sections): Set section type of dynamic sections based on
4514         section names.
4515         (elf_write_phdrs): Remove.
4516         (assign_file_position_for_section): Add new align argument.
4517         Change all callers.
4518         (get_program_header_size): New static function.
4519         (struct seg_info): Remove.
4520         (map_program_segments): Completely rewrite.
4521         (assign_file_positions_except_relocs): Completely rewrite.
4522         (assign_file_positions_for_relocs): Don't set a file position for
4523         sections which already have one.  Don't bother to align the file
4524         position here.
4525         (section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
4526         section types.
4527         (elf_section_from_bfd_section): Likewise.
4528         (elf_slurp_symbol_table): If section_from_elf_index fails, just
4529         use bfd_abs_section rather than returning an error.
4530         (elf_sizeof_headers): Make useful.
4531         (elf_link_record_dynamic_symbol): New static function.
4532         (elf_link_add_object_symbols): Handle dynamic objects.
4533         (elf_link_create_dynamic_sections): New static function.
4534         (elf_add_dynamic_entry): Define as macro using NAME and as new
4535         externally visible function.
4536         (NAME(bfd_elf,record_link_assignment)): New function.
4537         (elf_buckets): New static variable.
4538         (NAME(bfd_elf,size_dynamic_sections)): New function.
4539         (struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
4540         (elf_bfd_final_link): Handle dynamic linking.  Create a section
4541         symbol for all ELF sections, not all BFD sections.  Store section
4542         symbol index in target_index field, not index field.  Traverse
4543         over global symbols even if stripping.
4544         (elf_link_output_extsym): Output dynamic symbols.  Mark symbols
4545         defined by dynamic objects as undefined.
4546         (elf_link_input_bfd): Ignore dynamic objects.  Use target_index
4547         field for section relocs, and make sure it is set.
4548         (elf_reloc_link_order): Use target_index field for section relocs,
4549         and make sure it is set.
4550         * elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
4551         weakdef and elf_link_hash_flags fields.
4552         (_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
4553         dynstr and bucketcount fields.
4554         * elf32-target.h: Initialize new dynamic linking fields.
4555         * elf64-target.h: Likewise.  
4556         * elf32-i386.c: New functions for dynamic linking support.
4557         * elf32-sparc.c: Likewise.
4558         * bfd-in.h (bfd_elf32_record_link_assignment): Declare.
4559         (bfd_elf64_record_link_assignment): Declare.
4560         (bfd_elf32_size_dynamic_sections): Declare.
4561         (bfd_elf64_size_dynamic_sections): Declare.
4562         * bfd-in2.h: Rebuilt.
4563
4564 Wed May 18 08:29:04 1994  Ian Lance Taylor  (ian@cygnus.com)
4565
4566         * som.c: Don't include <sys/dir.h> or <sys/user.h>.
4567         (som_reloc_queue_find): Call memcmp instead of bcmp.
4568         (som_bfd_reloc_type_lookup): Change first argument to bfd *.
4569         (compare_syms): Change types of arguments to const void *.
4570         (bfd_section_from_som_symbol): Removed unused local found.
4571         (som_write_armap): Add elength, map, orl_count and int arguments.
4572         (som_write_armap): Use %ld and cast to long for getuid result.
4573
4574 Wed May 18 09:09:32 1994  Jeff Law  (law@snake.cs.utah.edu)
4575
4576         * elf32-hppa.h (R_HPPA_ABS_CALL): Define.
4577         * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle absolute calls.
4578
4579         * som.h (R_HPPA_ABS_CALL): Define.
4580         * som.c (hppa_som_gen_reloc_type): Delete complex relocation types.
4581
4582 Tue May 17 19:33:12 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4583
4584         * coff-i960.c (icoff_little_vec, icoff_big_vec): Indicate leading
4585         underscore, for compatibility with Intel tool chain (gnu960v2).
4586
4587 Mon May 16 10:09:22 1994  Jeff Law  (law@snake.cs.utah.edu)
4588
4589         * bfd-in2.h: Rebuilt.
4590
4591         * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
4592         likewise for other PA specific sections.
4593         (hppa_elf_relocate_unwind_table): Delete unused
4594         function.
4595         (elf_hppa_howto_table): Completely new table based on 94-02-02
4596         draft PA ELF spec.  Change relocation tags appropriately
4597         throughout elf32-hppa.c
4598         (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
4599         spec.
4600         (hppa_elf_reloc): Likewise.
4601         (hppa_look_for_stubs_in_section): Likewise
4602         (ELF_MACHINE_CODE): Change to EM_PARISC.
4603         * elf32-hppa.h: Include "elf/hppa.h".  Change relocation tags 
4604         appropriately throughout elf32-hppa.h.
4605         (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
4606         spec.
4607         (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
4608         * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
4609         * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
4610         * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.
4611
4612         * libhppa.h (hppa_field_adjust): Avoid adding constant_value into
4613         the final value twice for LR and RR field selectors.
4614
4615 Sat May 14 09:09:19 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4616
4617         * aoutx.h (add_to_stringtab): Use BFD_ASSERT not assert.  This
4618         avoids __eprintf troubles.
4619
4620 Fri May 13 10:51:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4621
4622         * bout.c (b_out_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR.
4623
4624         * config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and
4625         ecoff_little_vec since Irix 5 supports ECOFF executables.
4626
4627 Wed May 11 00:31:57 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4628
4629         * ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr
4630         correctly.
4631
4632         * Makefile.in (stmp-bfd.h): Use || instead of ; to force SunOS
4633         make to invoke the shell.
4634
4635 Tue May 10 14:23:43 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4636
4637         * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from
4638         SEC_SHARED_LIBRARY for clarity.  Changed all uses.
4639         * bfd-in2.h: Rebuilt.
4640         * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is
4641         set, set STYP_NOLOAD.
4642         * coffgen.c (coff_section_from_bfd_index): Don't get an assertion
4643         failure because of a bad shared library.
4644
4645 Mon May  9 18:53:40 1994  Bill Cox  (bill@rtl.cygnus.com)
4646
4647         * linker.c: Add missing comment terminator.
4648
4649 Mon May  9 11:53:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4650
4651         * linker.c (_bfd_generic_link_add_one_symbol): If hashp and *hashp
4652         are not NULL, assume the caller has already looked up the symbol
4653         in the hash table and has stored the entry in *hashp.
4654         (generic_link_add_symbol_list): Set h to NULL before calling
4655         _bfd_generic_link_add_one_symbol.
4656         * ecoff.c (ecoff_link_add_externals): Likewise.
4657
4658         * elfcode.h (assign_file_positions_except_relocs): Don't require
4659         page shared between .data and .bss segments to contain zeroes.
4660
4661         * elfcode.h: Include bfdlink.h.  Added several new functions to do
4662         linking.
4663         (ELF_R_TYPE): Define.
4664         (bfd_add_to_strtab): Return unsigned long.  Change check for
4665         realloc failure.
4666         (elf_fake_sections): Check return value of bfd_add_to_strtab.
4667         (elf_compute_section_file_positions): Add link_info argument.
4668         Call elf_backend_begin_write_processing hook and prep_headers
4669         here.  Only call swap_out_syms if link_info is NULL.  Set up
4670         .shstrtab section here.  Pass dosyms argument to
4671         assign_file_positions_except_relocs.  Set output_has_begun flag.
4672         (assign_file_positions_for_symtab_and_strtabs): Add dosyms
4673         argument, and use it to control setting .symtab and .strtab file
4674         positions.
4675         (assign_file_positions_except_relocs): Add dosyms argument, and
4676         pass it on.
4677         (prep_headers): Check return value of bfd_add_to_strtab.
4678         (swap_out_syms): Likewise.  Also, don't set up .shstrtab here.
4679         (NAME(bfd_elf,write_object_contents)): Some calls moved into
4680         elf_compute_section_file_positions.
4681         (elf_set_section_contents): Likewise.
4682         (elf_slurp_symbol_table): SHN_LORESERV corrected to SHN_LORESERVE.
4683         * libelf.h: Include bfdlink.h.
4684         (struct elf_backend_data): Add fields collect,
4685         elf_add_symbol_hook, elf_backend_relocate_section.
4686         (struct bfd_elf_section_data): Add field rel_hashes.
4687         (struct elf_obj_tdata): Remove fields internal_syms and symbols.
4688         Add field sym_hashes.
4689         (obj_symbols, obj_internal_syms): Remove definitions.
4690         (elf_sym_hashes): Define.
4691         (struct elf_link_hash_entry): Define.
4692         (struct elf_link_hash_table): Define.
4693         (elf_link_hash_lookup): Define.
4694         (elf_link_hash_traverse): Define.
4695         (elf_hash_table): Define.
4696         (_bfd_elf_link_hash_table_create): Declare.
4697         (bfd_elf32_bfd_link_add_symbols): Declare.
4698         (bfd_elf32_bfd_final_link): Declare.
4699         (bfd_elf64_bfd_link_add_symbols): Declare.
4700         (bfd_elf64_bfd_final_link): Declare.
4701         * elf.c: Include bfdlink.h.
4702         (elf_link_hash_newfunc): New function.
4703         (_bfd_elf_link_hash_table_create): New function.
4704         * elf32-target.h (elf_backend_relocate_section): If not defined,
4705         define as 0 and use generic linker.  Otherwise, use ELF backend
4706         linker.
4707         (elf_backend_collect): If not defined, define as false.
4708         (elf_backend_add_symbol_hook): If not defined, define as 0.
4709         (elf32_bed): Initialize new fields.
4710         * elf64-target.h: Same changes as elf32-target.h.
4711         * elf32-i386.c: Include bfdlink.h.
4712         (elf_i386_relocate_section): New function.
4713         (elf_backend_relocate_section): Define.
4714         * elf32-sparc.c: Include bfdlink.h.
4715         (elf_info_to_howto): Change type of dst from Elf32_Internal_Rela
4716         to Elf_Internal_Rela (they're the same type anyhow).
4717         (elf_sparc_relocate_section): New function.
4718         (elf_backend_relocate_section): Define.
4719         * elf32-mips.c (elf_backend_collect): Define.
4720
4721         * Makefile.in (stmp-bfd.h): Avoid useless make error message in a
4722         different way; touch takes a numeric argument on some systems.
4723
4724 Fri May  6 13:34:14 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4725
4726         * nlmcode.h (nlm_swap_auxiliary_headers_in): Rework custom header
4727         handling for latest suggested format.
4728         (nlm_swap_auxiliary_headers_out): Likewise.
4729         (nlm_compute_section_file_positions): Likewise.
4730
4731 Fri May  6 11:11:50 1994  D. V. Henkel-Wallace  (gumby@rtl.cygnus.com)
4732
4733         * config.bfd: handle erricsson config (for OSE).
4734
4735 Thu May  5 15:40:47 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4736
4737         Patches from Ralph Campbell:
4738         * mipsbsd.c (mips_fix_jmp_addr): New function.
4739         (mips_fix_hi16_s): Use bfd_is_com_section.
4740         (mips_howto_table_ext): Call mips_fix_jmp_addr for MIPS_RELOC_JMP.
4741
4742 Fri May  6 11:48:55 1994  Steve Chamberlain  (sac@cygnus.com)
4743
4744         * config/go32.mh: XX support.
4745
4746         From bill
4747         * Makefile.in: Build sysdep.h without causing worrying but
4748         harmless error message.
4749
4750 Wed May  4 11:09:53 1994  Ian Lance Taylor  (ian@cygnus.com)
4751
4752         Changed m68k-aout to set flags to 0; m68k-sunos still uses 1.
4753         * aout0.c: New file.
4754         * targets.c (aout0_big_vec): Declare.
4755         (bfd_target_vector): Add aout0_big_vec.
4756         * config.bfd (m68*-*-aout*): Use m68k-0aout, not m68k-aout.
4757         * config/m68k-aout.mt (SELECT_VECS): Removed.
4758         * config/m68k-0aout.mt: New file.
4759         * configure.in (aout0_big_vec): New target vector: use aout0.o,
4760         aout32.o and stab-syms.o.
4761         * Makefile.in: Rebuilt dependencies.
4762         (BFD32_BACKENDS): Add aout0.o.
4763         (CFILES): Add aout0.c.
4764
4765         * libaout.h (struct aout_backend_data): Add field exec_hdr_flags.
4766         * aout-target.h (MY_exec_hdr_flags): If not defined, define as 0.
4767         MY(backend_data): Initialize exec_hdr_flags field.
4768         * aoutf1.h (sunos_32_set_arch_mach): Make static.
4769         (aout32_sunos4_write_object_contents): Set flags from backend
4770         info.
4771         (MY_exec_hdr_flags): If not defined, define as 1.
4772         (sunos4_aout_backend): Initialize exec_hdr_flags field.
4773         * aout-encap.c (encap_write_object_contents): Set flags from
4774         backend info.
4775         (MY_exec_hdr_flags): Define as N_FLAGS_COFF_ENCAPSULATE.
4776         * hp300hpux.c (MY_exec_hdr_flags): Define as 0x2.
4777         (MY(write_object_contents)): Set flags from backend info.
4778         * i386aout.c (MY(backend_data)): Initialize exec_hdr_flags field.
4779         * i386mach3.c (MY(backend_data)): Likewise.
4780         * mipsbsd.c (MY(backend_data)): Likewise.
4781         * sparclynx.c (NAME(aout,sparclynx_write_object_contents)): Set
4782         flags from backend info.
4783         (sparclynx_aout_backend): Initialize exec_hdr_flags field.
4784
4785 Wed May  4 02:56:00 1994  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
4786
4787         * config.bfd (i386-*-gnu*): Treat like i386-*-mach*.
4788         (m68*-apollo-*): Treat all Apollo configs the same, don't handle
4789         BSD specially.
4790
4791 Tue May  3 19:43:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4792
4793         * cache.c: Rewrote to work correctly.
4794         * libbfd.h: Rebuilt.
4795         * opncls.c (bfd_cache_init, bfd_open_file): Don't declare.
4796         (bfd_fdopenr): Check return value of bfd_cache_init.
4797
4798 Fri Apr 29 15:08:23 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4799
4800         * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by
4801         enumerating them, since the reloc type can not serve as an index
4802         into the m68k COFF howto_table.
4803
4804 Fri Apr 29 09:42:39 1994  Steve Chamberlain  (sac@cygnus.com)
4805
4806         * config.bfd (*-go32): Changed to coff.
4807         * coff-h8300.c (JMPL1): Get HOWTO right for 24bit branches.
4808         * srec.c (srec_write_symbols): Write out the correct number of
4809         symbols and don't stick in extra nulls.
4810
4811 Tue Apr 26 15:07:24 1994  Stan Shebs  (shebs@andros.cygnus.com)
4812
4813         * cf-sparclynx.c (LYNXOS, COFF_LONG_FILENAMES): Define.
4814         * coff-sparc.c (BADMAG): Recognize LYNXCOFFMAGIC.
4815         (COFF_SPARC): Define.
4816         * coffcode.h (coff_new_section_hook): If COFF_SPARC, set alignment
4817         power of data and bss sections to 3.
4818         * hosts/lynx.h (__LYNXOS): Define.
4819
4820 Tue Apr 26 15:04:26 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4821
4822         * elf32-hppa.c (hppa_elf_reloc): Adjust the addend of relocations
4823         against section symbols to avoid losing during ld -r.
4824
4825 Tue Apr 26 12:16:41 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4826
4827         * elfcode.h (shstrtab_length_fixed): Remove useless static
4828         variable.
4829         (struct elf_sect_data): Remove unused structure.
4830         (elf_object_p): Free memory if error occurs.  Check return value
4831         of bfd_default_set_arch_mach.  If elf_get_str_section fails,
4832         preserve error code rather than setting wrong_format.
4833         (null_shdr): Remove static variable.
4834         (assign_section_numbers): Remove shstrtab_length_fixed assignment.
4835         Allocate first section header on BFD obstack rather than using
4836         null_shdr.
4837         (bfd_prpsinfo): Remove unused local variable newsect.
4838
4839 Mon Apr 25 15:31:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4840
4841         * elfcode.h (write_relocs): Undo patch of Apr 10; breaks Solaris.
4842
4843         * elfcode.h (bfd_section_from_shdr): Use bfd_make_section_anyway
4844         to create sections.  Check return value of recursive calls.
4845         (bfd_section_from_phdr): Check return value of bfd_make_section.
4846         (elf_symbol_from_bfd_symbol): Likewise.
4847         (elf_object_p): Check return value of bfd_section_from_shdr.
4848         (section_from_elf_index): Likewise.
4849         (elf_slurp_symbol_table): Check return value of
4850         section_from_elf_index.
4851         (bfd_prstatus): Return boolean value.  Check return value of
4852         bfd_make_section.
4853         (bfd_fpregset): Likewise.
4854         (bfd_prpsinfo): Return boolean value.
4855         (elf_corefile_note): Check return values of bfd_prstatus,
4856         bfd_fpregset, and bfd_prpsinfo.
4857         (elf_core_file_p): Check return value of elf_corefile_note.
4858
4859 Fri Apr 22 11:08:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4860
4861         Get rid of the ECOFF .reginfo section hack.
4862         * ecoff.c (ecoff_mkobject_hook): Don't create a .reginfo section.
4863         (ecoff_new_section_hook): Don't handle the .reginfo section.
4864         (ecoff_sizeof_headers): Likewise.
4865         (ecoff_get_section_contents): Likewise.
4866         (ecoff_compute_section_file_positions): Likewise.
4867         (ecoff_compute_reloc_file_positions): Likewise.
4868         (ecoff_set_section_contents): Likewise.
4869         (ecoff_write_object_contents): Likewise.
4870         (ecoff_bfd_final_link): Likewise.
4871         (ecoff_bfd_copy_private_bfd_data): Copy the GP value and the
4872         register masks.
4873         (bfd_ecoff_get_gp_value): New function.
4874         (bfd_ecoff_set_gp_value): New function.
4875         (bfd_ecoff_set_regmasks): New function.
4876         * bfd-in.h (bfd_ecoff_get_gp_value): Declare.
4877         (bfd_ecoff_set_gp_value): Declare.
4878         (bfd_ecoff_set_regmasks): Declare.
4879         * bfd-in2.h: Rebuilt.
4880
4881         Fix ECOFF objcopy to actually copy debugging information.
4882         * ecoff.c (ecoff_bfd_copy_private_bfd_data): New function.
4883         (ecoff_get_extr): Assume that any ECOFF symbol with local clear is
4884         an external symbol, rather than checking the symbol flags.  Only
4885         check the flags for non-ECOFF symbols.
4886         * ecofflink.c (bfd_ecoff_debug_externals): Don't crash if the
4887         output_section field of the symbol section is NULL.
4888         * libecoff.h (ecoff_bfd_copy_private_bfd_data): Declare as
4889         function rather than defining as macro.
4890
4891         * ieee.c (ieee_object_p): Set bfd_error_got_wrong_format if
4892         appropriate.
4893
4894         * targets.c (bfd_target_vector): Add bfd_elf32_powerpc_vec.
4895
4896         * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of
4897         bfd_default_set_arch_mach.  Accept bfd_arch_m68k as well as
4898         bfd_arch_unknown.
4899         * coffcode.h (coff_set_arch_mach): Check return value of
4900         bfd_default_set_arch_mach.
4901         * elfcode.h (elf_set_arch_mach): Don't check a list of ELF
4902         architectures, just see if the desired architecture matches what
4903         the ELF backend permits.
4904
4905         * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to
4906         SH_ARCH_MAGIC to match change in coff/sh.h.
4907         (coff_set_flags): Likewise.
4908
4909         Follow convention in which each NLM header has an 8 byte stamp
4910         followed by a four byte length.
4911         * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr
4912         to nlm_cygnus_ext_header, and change type to
4913         Nlm_Internal_Cygnus_Ext_Header.
4914         (nlm_cygnus_ext_header): Rename from nlm_cygnus_section_header.
4915         * nlmcode.h (nlm_swap_auxiliary_headers_in): Use CyGnUsEx instead
4916         of CyGnUsSeCs.  Rename from cygnus_section to cygnus_ext.  Require
4917         length word to be 8.
4918         (nlm_swap_auxiliary_headers_out): Rename from cygnus_section to
4919         cygnus_ext.  Set length word to 8.
4920         (nlm_compute_section_file_positions): Rename from cygnus_section
4921         to cygnus_ext.
4922
4923 Thu Apr 21 22:54:22 1994  Stu Grossman  (grossman at cygnus.com)
4924
4925         * nlmcode.h (nlm_swap_auxiliary_headers_in):  Keep section table
4926         (from CyGnUsSeCs) in more permanent memory to keep section names
4927         from getting trashed.
4928
4929 Thu Apr 21 09:29:37 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4930
4931         * libelf.h (elf_obj_tdata):  Add members for dynamic symbol table
4932         handling.
4933         * elfcode.h (bfd_section_from_shdr):  Handle dynamic symbol table.
4934         * elfcode.h (elf_slurp_symbol_table):  Take additional parameter
4935         to select static or dynamic symbol table and return number of
4936         symbols slurped or -1 on error.
4937         * elfcode.h (elf_get_symtab):  Set bfd symcount from
4938         elf_slurp_symbol_table result.
4939         * elfcode.h (elf_get_dynamic_symtab_upper_bound,
4940         elf_canonicalize_dynamic_symtab):  New functions to handle dynamic
4941         symbol table.
4942         * elf32-target.h, elf64-target.h (BFD_JUMP_TABLE_DYNAMIC):
4943         Change to handle dynamic symbol table, provide default definitions
4944         for dynamic relocs.
4945         * aoutx.h (howto_table_std, NAME(aout,swap_std_reloc_out),
4946         NAME(aout,swap_std_reloc_in), aout_link_input_section_std,
4947         aout_link_reloc_link_order):  Handle r_jmptable and r_relative
4948         relocations.
4949
4950 Thu Apr 21 11:58:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4951
4952         Clean up uses of _bfd_dummy_target (from Peter Schauer).
4953         * libbfd.c (_bfd_dummy_target): Set bfd_error_wrong_format.
4954         * nlm-target.h (nlm_core_file_p): Define as _bfd_dummy_target, not
4955         NULL.
4956         * srec.c (srec_vec): Use _bfd_dummy_target, not NULL, in
4957         _bfd_check_format.
4958         (symbolsrec_vec): Likewise.
4959         * tekhex.c (tekhex_vec): Likewise.
4960
4961         * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr
4962         field.
4963         (nlm_cygnus_section_header): New accessor macro.
4964         * nlmcode.h (nlm_object_p): Free new tdata structure if failure.
4965         Add fixed sections before swapping in auxiliary headers.  After
4966         adding sections, treat errors as real, not as wrong format.
4967         (nlm_swap_auxiliary_headers_in): Swap in the sections header; add
4968         sections to the BFD for each section it describes.
4969         (nlm_swap_auxiliary_headers_out): Swap out the sections header.
4970         (nlm_compute_section_file_positions): Account for the size of the
4971         sections header.
4972
4973 Wed Apr 20 16:45:51 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4974
4975         * coff-sparc.c (sparccoff_vec): Change minimum alignment power to
4976         2, so that stab sections can be multiples of 4 bytes only.
4977
4978         * hosts/i386aix.h: Changes to avoid prototypes conflicts with the
4979         ones defined in stdlib.h.  (From Minh Tran-Le.)
4980
4981 Wed Apr 20 14:15:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4982
4983         * nlm32-ppc.c: Complete rewrite for new version of PowerPC
4984         NetWare.  Old code still present, but ifdeffed out.
4985
4986         * nlmcode.h (nlm_swap_auxiliary_headers_in): Don't assume a
4987         particular format for the customer header.  Allocate a block of
4988         memory and read it into that.
4989         (nlm_swap_auxiliary_headers_out): Write out the block of memory.
4990         (nlm_compute_section_file_positions): Include length of customer
4991         header when computing its size.
4992
4993 Mon Apr 18 14:27:17 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4994
4995         * som.c (som_prep_headers): Get the space's number from the
4996         backend private section data rather than target_index.
4997         (bfd_som_set_section_attributes): Store the space's number
4998         in the backend private section data rather than target_index.
4999
5000         * som.h (som_copyable_section_data_struct): Add space_number.
5001
5002 Fri Apr 15 12:22:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5003
5004         * coff-a29k.c (reloc_processing): Always set the address of a
5005         R_IHCONST reloc to that of the immediately preceding R_IHIHALF.
5006         gas does this anyhow, but some other assemblers seem to leave
5007         garbage in the R_IHCONST address field.
5008
5009         * bfd/archive.c: Consistently use ARFMAG; from
5010         schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
5011         (_bfd_write_archive_contents): Use ARFMAG rather than '`' and
5012         '\012'.
5013         (bsd_write_armap): Likewise.
5014         (coff_write_armap): Likewise.
5015
5016         * coff-mips.c (mips_relocate_section): When relaxing, adjust local
5017         relocs against the .text section as required.
5018         * ecofflink.c (bfd_ecoff_debug_accumulate): When relaxing, adjust
5019         PDR addresses as required.
5020
5021         * ecoff.c (ecoff_emit_aggregate): Take fdr argument.  Map fdr
5022         index through rfd map if it exists.  Check for a couple of cases
5023         which gdb handles specially.  Change all callers.
5024         (ecoff_type_to_string): Take fdr argument rather than aux_ptr and
5025         bigendian argument.  Change all callers.
5026         (ecoff_print_symbol): Handle stStruct, stUnion and stEnum.
5027
5028 Thu Apr 14 13:05:10 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5029
5030         * coff-mips.c (mips_howto_table): Add dummy entries to account for
5031         numbering changes in include/coff/mips.h.  Add entries for
5032         MIPS_R_RELHI and MIPS_R_RELLO.
5033         (mips_ecoff_swap_reloc_in): Handle an extra bit for the reloc type
5034         when little endian.  Treat internal MIPS_R_RELLO or MIPS_R_RELHI
5035         relocs like MIPS_R_SWITCH, and convert r_offset from 24 to 32
5036         bits.
5037         (mips_ecoff_swap_reloc_out): Likewise.
5038         (mips_adjust_reloc_in): Handle internal MIPS_R_RELLO or
5039         MIPS_R_RELHI relocs like MIPS_R_SWITCH.
5040         (mips_adjust_reloc_out): Likewise.
5041         (mips_relhi_addr, mips_relhi_addend): New static variables.
5042         (mips_relhi_reloc, mips_rello_reloc): New functions.
5043         (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_PCREL_HI16_S into
5044         MIPS_R_RELHI and turn BFD_RELOC_PCREL_LO16 into MIPS_R_RELLO.
5045         (mips_relocate_hi): Rename from mips_relocate_refhi, and add pcrel
5046         argument.  Changed all callers.
5047         (mips_relocate_section): Rename got_reflo to got_lo and
5048         reflo_int_rel to lo_int_rel.  Handle MIPS_R_RELLO and MIPS_R_RELHI
5049         relocs.
5050         (mips_relax_section): Adjust MIPS_R_RELHI/MIPS_R_RELLO pairs when
5051         expanding a PC relative call.
5052
5053         * reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S
5054         and BFD_RELOC_PCREL_LO16.
5055         * bfd-in2.h: Rebuilt.
5056
5057 Wed Apr 13 11:50:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
5058
5059         * coff-sparc.c (sparccoff_vec): Set minimum alignment power to 3.
5060
5061 Tue Apr 12 13:36:20 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5062
5063         * som.c (som_write_fixups): Always emit at least
5064         one relocation for any non-bss section.
5065
5066 Mon Apr 11 14:41:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5067
5068         * elfcode.h (assign_file_positions_except_relocs): Don't require
5069         the file alignment to correspond to the page size when linking
5070         with -N.
5071
5072 Sun Apr 10 01:02:24 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5073
5074         * elfcode.h (write_relocs): For rela relocations, adjust the
5075         addend for relocations involving section symbols to account
5076         for the lossage of 1:1 mapping from input section symbols to
5077         output section symbols.
5078
5079 Fri Apr  8 12:22:02 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5080
5081         * aoutx.h (NAME(aout,make_sections)): New function.
5082         (NAME(aout,some_aout_object_p)): Call NAME(aout,make_sections)
5083         rather than making sections inline.
5084         (NAME(aout,mkobject)): Don't make any sections.
5085         (NAME(aout,adjust_sizes_and_vmas)): Call NAME(aout,make_sections).
5086         (NAME(aout,final_link)): Don't dereference obj_textsec (abfd) or
5087         obj_datasec (abfd) if they are NULL.
5088         * libaout.h (NAME(aout,make_sections)): Declare.
5089         * bout.c (b_out_mkobject): Don't make any sections.
5090         (b_out_write_object_contents): Call aout_32_make_sections.
5091         (b_out_set_section_contents): Likewise.
5092         * i386os9k.c (os9k_mkobject): Don't make any sections.
5093         (os9k_write_object_contents): Call aout_32_make_sections.
5094         (os9k_set_section_contents): Likewise.
5095
5096         * aoutx.h (NAME(aout,new_section_hook)): Don't set N_EXT in target
5097         index.
5098
5099 Wed Apr  6 20:44:56 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
5100
5101         * config.bfd, configure.host:  Add mips-*-sysv4* support.
5102
5103 Thu Apr  7 14:23:05 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5104
5105         * coff-mips.c (mips_howto_table): Add entry for MIPS_R_SWITCH.
5106         (mips_ecoff_swap_reloc_in): For MIPS_R_SWTICH, copy r_symndx into
5107         r_offset and set r_symndx to RELOC_SECTION_TEXT.
5108         (mips_ecoff_swap_reloc_out): For MIPS_R_SWITCH, get the r_symndx
5109         value from the r_offset field.
5110         (mips_adjust_reloc_in): Maximum r_type value is now MIPS_R_SWITCH.
5111         For MIPS_R_SWITCH, copy the r_offset field into the addend field.
5112         (mips_adjust_reloc_out): For MIPS_R_SWITCH, copy the addend field
5113         into the r_offset field.
5114         (mips_switch_reloc): New function.
5115         (mips_bfd_reloc_type_lookup): Translate BFD_RELOC_GPREL32 into
5116         MIPS_R_SWITCH.
5117         (mips_relocate_section): Handle MIPS_R_SWITCH.
5118         (mips_relax_section): Adjust MIPS_R_SWITCH offset if necessary.
5119
5120 Thu Apr  7 11:10:51 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5121
5122         * elfcode.h (elf_set_section_contents): Support calling the backend
5123         function elf_backend_begin_write_processing when just beginning to
5124         write an object file.
5125
5126         * libelf.h (elf_backend_begin_write_processing): Declare.
5127
5128         * elf{32,64}-target.h (elf_backend_begin_write_processing): Provide
5129         a default definition.
5130         (elf{32,64}_bed): Add elf_backend_begin_write_processing.
5131         
5132         * elf32-hppa.h (elf_hppa_tc_symbol): Delete extern declaration.
5133         (elf_hppa_tc_make_sections): Likewise.
5134
5135         * elf32-hppa.c (symext_chain_built): Delete.
5136         (symext_chain_size): Renamed from symextn_contents_real_size.
5137         (elf32_hppa_backend_{begin,final}_write_processing): New functions.
5138         (add_entry_to_symext_chain): New function.
5139         (hppa_elf_set_section_contents): Ignore writes to the symbol extension
5140         section until it's been rebuilt internally.
5141         (hppa_elf_get_section_contents): Symbol extension section is no
5142         longer special.
5143         (elf_backend_{begin,final}_write_processing): Define.
5144         (elf_hppa_tc_make_sections): Simplify now that much code has
5145         migrated into elf32_hppa_backend_{being,final}_write_processing.
5146
5147 Wed Apr  6 17:24:14 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5148
5149         Add new target vectors to read the dynamic symbols and dynamic
5150         relocs.  Change a.out to use these rather than reading the dynamic
5151         symbols and relocs along with the normal symbols and relocs.
5152         * targets.c (bfd_target): Add fields
5153         _bfd_get_dynamic_symtab_upper_bound,
5154         _bfd_canonicalize_dynamic_symtab,
5155         _bfd_get_dynamic_reloc_upper_bound,
5156         _bfd_canonicalize_dynamic_reloc.
5157         (BFD_JUMP_TABLE_DYNAMIC): Define.
5158         * libbfd-in.h (_bfd_nodynamic_get_dynamic_symtab_upper_bound):
5159         Define.
5160         (_bfd_nodynamic_canonicalize_dynamic_symtab): Define.
5161         (_bfd_nodynamic_get_dynamic_reloc_upper_bound): Define.
5162         (_bfd_nodynamic_canonicalize_dynamic_reloc): Define.
5163         * bfd.c (bfd_get_dynamic_symtab_upper_bound): Define.
5164         (bfd_canonicalize_dynamic_symtab): Define.
5165         (bfd_get_dynamic_reloc_upper_bound): Define.
5166         (bfd_canonicalize_dynamic_reloc): Define.
5167         * sunos.c (MY_read_dynamic_symbols): Don't define.
5168         (MY_read_dynamic_relocs): Don't define.
5169         (MY_get_dynamic_symtab_upper_bound): Define.
5170         (MY_canonicalize_dynamic_symtab): Define.
5171         (MY_get_dynamic_reloc_upper_bound): Define.
5172         (MY_canonicalize_dynamic_reloc): Define.
5173         (struct sunos_dynamic_info): Change type of dynsym_count and
5174         dynrel_count to long.  Add fields canonical_dynsym and
5175         canonical_dynrel.
5176         (sunos_read_dynamic_info): Check that BFD had DYNAMIC flag set.
5177         Clear info->canonical_dynsym and info->canonical_dynrel.
5178         (MY(read_dynamic_symbols)): Removed.
5179         (MY(read_dynamic_relocs)): Removed.
5180         (sunos_get_dynamic_symtab_upper_bound): New function.
5181         (sunos_canonicalize_dynamic_symtab): New function.
5182         (sunos_get_dynamic_reloc_upper_bound): New function.
5183         (sunos_canonicalize_dynamic_reloc): New function.
5184         * libaout.h: Declare struct reloc_ext_external and
5185         reloc_std_external to avoid prototype problems.
5186         (struct aout_backend_data): Remove fields read_dynamic_symbols and
5187         read_dynamic_relocs.
5188         (NAME(aout,translate_symbol_table)): Declare.
5189         (NAME(aout,swap_ext_reloc_in)): Declare.
5190         (NAME(aout,swap_std_reloc_in)): Declare.
5191         * aoutx.h (NAME(aout,translate_symbol_table)): Renamed from
5192         translate_symbol_table and made non-static.  Changed all callers.
5193         (NAME(aout,slurp_symbol_table)): Don't read dynamic symbols.
5194         (NAME(aout,slurp_reloc_table)): Don't read dynamic relocs.
5195         (NAME(aout,get_reloc_upper_bound)): Don't count dynamic relocs.
5196         * aoutf1.h (aout_32_sunos4_write_object_contents): Don't bother to
5197         remove dynamic symbols and relocs.  They will no longer be
5198         present.
5199         (MY_read_dynamic_symbols): Don't define.
5200         (MY_read_dynamic_relocs): Don't define.
5201         (sunos4_aout_backend): Don't initialize dynamic entry points.
5202         * aout-target.h (MY_read_dynamic_symbols): Don't define.
5203         (MY_read_dynamic_relocs): Don't define.
5204         (MY(backend_data)): Don't initialize dynamic entry points.
5205         (MY_get_dynamic_symtab_upper_bound): If not defined, define to
5206         _bfd_nodynamic version.
5207         (MY_canonicalize_dynamic_symtab): Likewise.
5208         (MY_get_dynamic_reloc_upper_bound): Likewise.
5209         (MY_canonicalize_dynamic_reloc): Likewise.
5210         * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector.
5211         * bfd-in2.h: Rebuilt.
5212         * libbfd.h: Rebuilt.
5213
5214         * cf-m68klynx.c: Include sysdep.h.
5215
5216         * hp300hpux.c: Removed some spaces in uses of NAME to avoid
5217         problems with traditional C compilers.
5218
5219         * targets.c (bfd_target): Rearranged fields in target vector.
5220         Removed _bfd_debug_info_start, _bfd_debug_info_end and
5221         _bfd_debug_info_accumulate, which were never used.
5222         (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
5223         (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
5224         (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
5225         (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
5226         * All backends: Changed to use the new BFD_JUMP_TABLE_* macros
5227         rather than the single JUMP_TABLE macro.  Removed many of the
5228         weird macro definitions needed to support the monolithic
5229         JUMP_TABLE.
5230         * bfd-in.h (JUMP_TABLE): Removed.
5231         * libbfd-in.h: Define a bunch of macros, and declare a few
5232         functions, for use with the new BFD_JUMP_TABLE_* macros.
5233         * libbfd.c (_bfd_dummy_new_section_hook): Removed.
5234         (bfd_false): Set bfd_error_invalid_operation.
5235         (bfd_nullvoidptr): Likewise.
5236         (bfd_n1): New function.
5237         (_bfd_nocore_core_file_matches_executable_p): Renamed from
5238         _bfd_dummy_core_file_matches_executable_p.
5239         (_bfd_nocore_core_file_failing_command): Similar rename.  Set
5240         bfd_error_invalid_operation.
5241         (_bfd_nocore_core_file_failing_signal): Likewise.
5242         (_bfd_generic_get_section_contents): Renamed from
5243         bfd_generic_get_section_contents.  Changed all callers.
5244         (_bfd_generic_set_section_contents): Similar rename.
5245         * ieee.c: #if 0 out ieee_bfd_debug_info_start,
5246         ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate.  They
5247         were never called.
5248         * bfd-in2.h: Rebuilt.
5249         * libbfd.h: Rebuilt.
5250
5251 Tue Apr  5 22:10:04 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5252
5253         * Crude support for examining dynamic libraries.
5254         * som.c (som_object_setup): Set DYNAMIC flag for SHL_MAGIC and
5255         DL_MAGIC objects.
5256         (som_prep_headers): Preserve the system_id for DYNAMIC objects.
5257         Use SHL_MAGIC as the magic number of the DYNAMIC flag is set.
5258         Write exec headers for DYNAMIC objects.
5259         (som_begin_writing): DYNAMIC objects have the same alignment
5260         restrictions as D_PAGED objects.
5261         (bfd_section_from_som_symbol): Treat DYNAMIC objects like EXEC_P
5262         objects.
5263         (object_flags): Add DYNAMIC.
5264
5265 Tue Apr  5 17:48:52 1994  Stan Shebs  (shebs@andros.cygnus.com)
5266
5267         * i386lynx.c, sparclynx.c (NAME): Remove embedded whitespace in
5268         macro uses, confuses some non-ANSI compilers.
5269
5270 Tue Apr  5 15:50:01 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5271
5272         * som.c (som_bfd_free_cached_info): Add missing PARAMS decl.
5273         Don't free anything if we don't have a bfd_object.
5274         (som_close_and_cleanup): Call som_bfd_free_cached_info.
5275
5276 Tue Apr  5 11:22:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5277
5278         * elf32-mips.c (mips_elf_final_link): Don't remove empty sections.
5279         It turns out not to be required on Irix 5, and it causes problems
5280         if the sections happen to contain symbols.
5281
5282         * elfcode.h (write_shdrs_and_ehdr): Correct bfd_write check.
5283
5284         * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if
5285         section->relocation is NULL; malloc might have returned NULL when
5286         given a zero size if there were no relocations.
5287         * bout.c (b_out_canonicalize_reloc): Likewise.
5288         * coffcode.h (coff_canonicalize_reloc): Likewise.
5289         * ecoff.c (ecoff_canonicalize_reloc): Likewise.
5290         * elfcode.h (elf_canonicalize_reloc): Likewise.
5291         * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
5292         * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
5293         * nlmcode.h (nlm_canonicalize_reloc): Likewise.
5294         * som.c (som_canonicalize_reloc): Likewise.
5295         * hp300hpux.c (MY(slurp_reloc_table)): Likewise.  Also, if malloc
5296         returns NULL, don't report an error if we asked for zero bytes.
5297         * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns
5298         NULL, don't report an error if we asked for zero bytes.
5299         * nlmcode.h (nlm_slurp_reloc_fixups): Likewise.
5300
5301 Mon Apr  4 15:30:49 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5302
5303         * aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything
5304         if we don't have a bfd_object.
5305
5306         Made sure that every call to bfd_read, bfd_write, and bfd_seek
5307         checks the return value and handled bfd_error correctly.  These
5308         changes are not itemised.  Also:
5309         * aoutx.h (emit_strtab): Change return type to boolean, and return
5310         errors.
5311         (NAME(aout,write_syms)): Check emit_strtab return value.
5312         (NAME(aout,final_link)): Likewise.
5313         * coffcode.h (coff_write_relocs): Change return type to boolean,
5314         and return errors.
5315         (coff_write_object_contents): Check coff_write_relocs return
5316         value.
5317         * i386os9k.c (os9k_swap_exec_header_in): Change return type to
5318         boolean.
5319         (os9k_object_p): Check os9k_swap_exec_header_in return value.
5320         * oasys.c (oasys_read_record): Change return type to boolean.
5321         (oasys_slurp_symbol_table: Check oasys_read_record return value.
5322         (oasys_object_p, oasys_slurp_section_data): Likewise.
5323         (oasys_write_record): Change return type to boolean.
5324         (oasys_write_syms): Likewise.  Also, check oasys_write_record
5325         return value.
5326         (oasys_write_sections): Check oasys_write_record return value.
5327         (oasys_write_header): Change return type to boolean.  Check
5328         oasys_write_record return value.
5329         (oasys_write_end, oasys_write_data): Likewise.
5330         (oasys_write_object_contents): Check return values of
5331         oasys_write_header, oasys_write_syms, oasys_write_data, and
5332         oasys_write_end.
5333         * srec.c (srec_write_record): Change return type to boolean.
5334         (srec_write_header): Likewise.  Also, check srec_write_record
5335         return value.
5336         (srec_write_section, srec_write_terminator): Likewise.
5337         (srec_write_symbols): Change return type to boolean.
5338         (internal_srec_write_object_contents): Check return value of
5339         srec_write_symbols, srec_write_header, srec_write_section, and
5340         srec_write_terminator.
5341
5342         * Makefile.in: Rebuilt dependencies.
5343
5344 Mon Apr  4 10:56:45 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
5345
5346         * aix386-core.c (aix386_bfd_is_local_label):  Correct cast from
5347         asection to asymbol.
5348         * ptrace-core.c (ptrace_unix_bfd_is_local_label):  Correct cast from
5349         bfd to asymbol.
5350         * trad-core.c (trad_unix_bfd_is_local_label):  Correct cast from
5351         asection to asymbol.
5352
5353 Sun Apr  3 18:27:29 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5354
5355         * som.c (som_slurp_string_table): Use malloc to allocate space
5356         for the cached copy of the native string table.
5357         (som_slurp_symbol_table): Likewise for the native symbol table.
5358         (som_slurp_reloc_table): Likewise for the native and generic
5359         relocation tables.
5360         (som_bfd_free_cached_info): Free the cached native strings,
5361         symbols, and relocations.  Also free the canonical cached
5362         relocations.
5363
5364 Fri Apr  1 12:40:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5365
5366         * aoutx.h (aout_link_write_symbols): If keep_memory is false, make
5367         sure the symbol name is stored in permanent memory before adding
5368         it to the string table.
5369
5370         * archive.c (_bfd_write_archive_contents): Once we've found an
5371         object, don't bother to look for more when deciding whether to
5372         build a map.
5373         (compute_and_write_armap): After adding the symbols for a BFD,
5374         call bfd_free_cached_info on it.
5375
5376         Add bfd_free_cached_info support to a.out backends.
5377         * aoutx.h (aout_get_external_symbols): Renamed from
5378         aout_link_get_symbols.  Read strings even if symbols have been
5379         read.  Store string size in obj_aout_string_size.
5380         (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to
5381         read the symbols.  Allocate the cached symbols with malloc, not
5382         bfd_alloc.
5383         (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with
5384         malloc, not bfd_alloc.
5385         (NAME(aout,bfd_free_cached_info)): New function; free cached
5386         symbols and relocs.
5387         * libaout.h (struct aoutdata): Add external_string_size field.
5388         (obj_aout_external_string_size): New accessor macro.
5389         (NAME(aout,close_and_cleanup)): Don't declare.
5390         (NAME(aout,bfd_free_cached_info)): Declare.
5391         (aout_32_close_and_cleanup): Don't define.
5392         (aout_64_close_and_cleanup): Don't define.
5393         * aout-target.h (MY_bfd_free_cached_info): If not already defined,
5394         define as NAME(aout,free_cached_info).
5395         (MY_close_and_cleanup): If not already defined, define as
5396         MY_bfd_free_cached_info.
5397         * aout-adobe.c (aout_32_close_and_cleanup): Define.
5398         (aout_32_bfd_free_cached_info): Don't define.
5399         * bout.c (aout_32_close_and_cleanup): Define.
5400         (aout_32_bfd_free_cached_info): Don't define.
5401         * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true.
5402         (MY_close_and_cleanup): Don't define.
5403         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached
5404         relocs with malloc, not bfd_alloc.
5405         * i386os9k.c (aout_32_close_and_cleanup): Define.
5406         (aout_32_bfd_free_cached_info): Don't define.
5407
5408         Add a new entry point to free memory cached by a BFD.
5409         * targets.c (bfd_target): Add _bfd_free_cached_info field.
5410         * bfd.c (bfd_free_cached_info): Define.
5411         * bfd-in.h (JUMP_TABLE): Add _bfd_free_cached_info.
5412         * bfd-in2.h: Rebuilt.
5413         * All backends: Initialize bfd_free_cached_info entry point to
5414         bfd_true.
5415
5416         * elf32-hppa.c (elf_hppa_reloc_type_lookup): Correct type of
5417         first, unused, argument.
5418         (hppa_elf_is_local_label): Declare instead of
5419         som_bfd_is_local_label.
5420
5421         * coff-a29k.c (a29k_reloc): Add reloc_entry->address to value of
5422         absolute R_IREL reloc.
5423
5424 Thu Mar 31 11:52:15 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5425
5426         Added some support for Irix 4 shared libraries.
5427         * ecoff.c (ecoff_new_section_hook): Set SEC_SHARED_LIBRARY for a
5428         .lib section.
5429         (ecoff_sec_to_styp_flags): Set SEC_SHARED_LIBRARY if
5430         STYP_ECOFF_LIB bit is set.
5431         (ecoff_compute_section_file_positions): Round the contents of a
5432         .lib section up to the next page boundary.
5433         (ecoff_set_section_contents): If we see a .lib section, increment
5434         the vma by one to count the number of shared libraries we have.
5435         (ecoff_write_object_contents): Don't crash if we see a
5436         STYP_ECOFF_LIB section, and don't adjust text_start or data_start
5437         or bss_size either.
5438
5439         * coffcode.h (CALC_ADDEND): Change to fetch original symbol value
5440         from original BFD, rather than using value of current BFD symbol.
5441         Needed for new linker.
5442         * coff-sparc.c (CALC_ADDEND): Likewise.
5443
5444         * ecoff.c (ecoff_write_object_contents): Set the text_start and
5445         data_start entries in the optional header correctly even if a text
5446         or data section starts at location zero.
5447
5448         * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef
5449         and raeburn).
5450         * bfd-in2.h: Rebuilt.
5451
5452         * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol
5453         name.
5454         * nlm32-alpha.c (nlm_alpha_read_import): Likewise.
5455         * nlm32-sparc.c (nlm_sparc_read_import): Likewise.
5456
5457         * coffgen.c (coff_write_symbol): Reindented.  Changed to return
5458         boolean, and changed written to unsigned int *.  Check error
5459         returns from called functions.
5460         (coff_write_alien_symbol): Likewise.
5461         (coff_write_native_symbol): Likewise.
5462         (coff_write_symbols): Likewise.  Reworked checks on whether to
5463         write symbol name to string table for clarity and to avoid core
5464         dumping when given a non COFF symbol.
5465         * libcoff-in.h (coff_write_symbols): Declare as returning boolean.
5466         * libcoff.h: Rebuilt.
5467         * coffcode.h (coff_write_object_contents): Check return value of
5468         coff_write_symbols.
5469
5470 Wed Mar 30 16:25:41 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5471
5472         Changes to let BFD return an error indication from
5473         get_symtab_upper_bound, bfd_canonicalize_symtab,
5474         bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc.  They now
5475         return long instead of unsigned int, and use -1 to indicate an
5476         error.  Along the way, rename get_symtab_upper_bound to
5477         bfd_get_symtab_upper_bound.
5478         * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
5479         errors.
5480         (bfd_canonicalize_reloc): Likewise.
5481         * syms.c (bfd_get_symtab_upper_bound): Renamed from
5482         get_symtab_upper_bound.
5483         * targets.c (bfd_target): Renamed _get_symtab_upper_bound to
5484         _bfd_get_symtab_upper_bound, and changed it and
5485         _bfd_canonicalize_symtab and _get_reloc_upper_bound and
5486         _bfd_canonicalize_reloc to all return long.
5487         * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
5488         (NAME(aout,canonicalize_reloc)): Likewise.
5489         (NAME(aout,get_reloc_upper_bound)): Likewise.
5490         (NAME(aout,get_symtab_upper_bound)): Likewise.
5491         * bout.c (b_out_canonicalize_reloc): Likewise.
5492         (b_out_get_reloc_upper_bound): Likewise.
5493         * coffcode.h (coff_canonicalize_reloc): Likewise.
5494         * coffgen.c (coff_get_symtab_upper_bound): Likewise.
5495         (coff_get_symtab): Likewise.
5496         (coff_get_reloc_upper_bound): Likewise.
5497         * ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
5498         (ecoff_get_symtab): Likewise.
5499         (ecoff_canonicalize_reloc): Likewise.
5500         * elfcode.h (elf_get_symtab_upper_bound): Likewise.
5501         (elf_get_reloc_upper_bound): Likewise.
5502         (elf_canonicalize_reloc): Likewise.
5503         (elf_get_symtab): Likewise.
5504         * hp300hpux.c (MY(get_symtab)): Likewise.
5505         (MY(get_symtab_upper_bound)): Likewise.
5506         (MY(canonicalize_reloc)): Likewise.
5507         * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
5508         * ieee.c (ieee_slurp_external_symbols): Change return type to
5509         boolean.  Check for errors from get_symbol.
5510         (ieee_slurp_symbol_table): Change return type to boolean.  Check
5511         for errors from ieee_slurp_external_symbols.
5512         (ieee_get_symtab_upper_bound): Return long, and -1 on errors.
5513         (ieee_get_symtab): Likewise.
5514         (ieee_get_reloc_upper_bound): Likewise.
5515         (ieee_canonicalize_reloc): Likewise.
5516         * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
5517         * nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
5518         (nlm_get_symtab): Likewise.
5519         (nlm_get_reloc_upper_bound): Likewise.
5520         (nlm_canonicalize_reloc): Likewise.
5521         * oasys.c (oasys_get_symtab_upper_bound): Likewise.
5522         (oasys_get_symtab): Likewise.
5523         (oasys_get_reloc_upper_bound): Likewise.
5524         (oasys_canonicalize_reloc): Likewise.
5525         * som.c (som_get_symtab_upper_bound): Likewise.
5526         (som_get_symtab): Likewise.
5527         (som_get_reloc_upper_bound): Likewise.
5528         (som_canonicalize_reloc): Likewise.
5529         * srec.c (srec_get_symtab_upper_bound): Likewise.
5530         (srec_get_symtab): Likewise.
5531         (srec_get_reloc_upper_bound): Define as bfd_0l.
5532         (srec_canonicalize_reloc): Likewise.
5533         * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
5534         (tekhex_get_symtab_upper_bound): Likewise.
5535         (tekhex_get_reloc_upper_bound): Define as bfd_0l.
5536         (tekhex_canonicalize_reloc): Likewise.
5537         * libaout.h (NAME(aout,get_symtab_upper_bound)): Change
5538         declaration to return long.
5539         (NAME(aout,get_symtab)): Likewise.
5540         (NAME(aout,canonicalize_reloc)): Likewise.
5541         (NAME(aout,get_reloc_upper_bound)): Likewise.
5542         * libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
5543         (coff_get_symtab): Likewise.
5544         (coff_get_reloc_upper_bound): Likewise.
5545         * libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
5546         (ecoff_get_symtab): Likewise.
5547         (ecoff_canonicalize_reloc): Likewise.
5548         * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
5549         (bfd_elf32_get_symtab): Likewise.
5550         (bfd_elf32_get_reloc_upper_bound): Likewise.
5551         (bfd_elf32_canonicalize_reloc): Likewise.
5552         (bfd_elf64_get_symtab_upper_bound): Likewise.
5553         (bfd_elf64_get_symtab): Likewise.
5554         (bfd_elf64_get_reloc_upper_bound): Likewise.
5555         (bfd_elf64_canonicalize_reloc): Likewise.
5556         * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
5557         (nlmNAME(get_symtab)): Likewise.
5558         (nlmNAME(get_reloc_upper_bound)): Likewise.
5559         (nlmNAME(canonicalize_reloc)): Likewise.
5560         * archive.c (compute_and_write_armap): Use error_return and
5561         no_memory_return labels rather than freeing information in various
5562         places.  Change storage, symcount and src_count to long.  Check
5563         errors from bfd_get_symtab_upper_bound and
5564         bfd_canonicalize_symtab.
5565         * bout.c (b_out_relax_section): Change reloc_size to long.  Check
5566         for errors from bfd_get_reloc_upper_bound and
5567         bfd_canonicalize_reloc.
5568         (b_out_get_relocated_section_contents): Likewise.
5569         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
5570         Likewise.
5571         * elf32-mips.c: Likewise.
5572         * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
5573         (hppa_look_for_stubs_in_section): Check for errors from
5574         bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
5575         bfd_canonicalize_reloc.
5576         * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
5577         from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
5578         * linker.c (generic_link_read_symbols): Likewise.
5579         (_bfd_generic_final_link): Check for errors from
5580         bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
5581         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
5582         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
5583         (bfd_coff_reloc16_get_relocated_section_contents): Likewise.
5584         * libbfd.c (bfd_0l): New function.
5585         * libbfd-in.h (bfd_0l): Declare.
5586         * aix386-core.c: Change get_symtab_upper_bound, get_symtab,
5587         get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
5588         than bfd_0u.
5589         * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
5590         * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
5591         * bfd-in2.h: Rebuilt.
5592         * libbfd.h: Rebuilt.
5593         * libcoff.h: Rebuilt.
5594
5595         * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
5596         temp and name.
5597
5598 Wed Mar 30 08:33:04 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
5599
5600         * hosts/dpx2.h: Define POSIX_UTIME.
5601
5602 Wed Mar 30 00:31:49 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
5603
5604         * i386dynix.c, config/i386-dynix.mt:  New files, handling Dynix
5605         variant of a.out.
5606         * configure.in, config.bfd:  Use them for Dynix.
5607         * Makefile.in:  Add dependencies for i386dynix.o. 
5608         * targets.c:  Add definition for i386dynix_vec.
5609         * hosts/symmetry.h:  Do not define TRAD_CORE_USER_OFFSET for Dynix.
5610         Define HOST_DATA_START_ADDR and TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
5611         for Dynix. Remove inclusion of dynix3.h, Dynix bfd is now handled by
5612         i386dynix.c
5613
5614 Mon Mar 28 12:53:27 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5615
5616         * Makefile.in (BFD32_BACKENDS): Add coff-sparc.o.
5617
5618         * coffcode.h (coff_set_flags): Handle bfd_arch_powerpc like
5619         bfd_arch_rs6000.
5620
5621         * config.bfd (powerpc-*-aix*): New target; use rs6000.mt.
5622         * config/rs6000.mt (SELECT_ARCHITECTURES): Add bfd_powerpc_arch.
5623
5624         * aoutx.h (translate_from_native_sym_flags): Set SEC_RELOC flag
5625         for generated constructor section.
5626
5627 Sun Mar 27 16:25:22 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5628
5629         * som.c (som_begin_writing): New approach at dealing with holes
5630         in executables left by the HP linker.  Does not rely on subspace
5631         alignments as subspaces are *NOT* guaranteed to be properly
5632         aligned in an executable (can you believe that!).
5633
5634 Sat Mar 26 10:25:43 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5635
5636         * som.c (som_get_section_contents): New function.  Do not try
5637         to actually read data from a section that doesn't have either
5638         SEC_LOAD or SEC_DEBUGGING set (eg $BSS$) just return true.
5639
5640         * libbfd.c (bfd_read): Set bfd_error as appropriate for a short
5641         read. (bfd_error_system_call or bfd_error_file_truncated).
5642
5643         * som.c: Do not blindly set bfd_error_system_call after a
5644         failing bfd_read, bfd_write, or bfd_seek.  In a few places
5645         (like som_object_p) override the error status set by bfd_read.
5646
5647         * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise.
5648         * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise.
5649         * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise.
5650         * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise.
5651
5652         * som.c: Check return values from several bfd_{seek,read,write}
5653         calls that we just assumed were not failing.
5654
5655 Fri Mar 25 11:44:06 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
5656
5657         * hosts/sysv4.h (HAVE_PROCFS): Add comments about ptx4.
5658         * config/sysv4.mh: Add comment.
5659         * config/symmetry.mh: Change comment.
5660         * configure.host: Use sysv4, not symmetry, for i[34]86-sequent-sysv4*.
5661
5662 Fri Mar 25 17:10:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5663
5664         Changes to support linker relaxing of embedded MIPS PIC code to
5665         use a five instruction sequence for function calls which are out of
5666         range of the bal instruction.
5667         * libecoff.h (struct ecoff_section_tdata): Define.
5668         (ecoff_section_data): Define.
5669         (ecoff_bfd_relax_section): Don't define.
5670         * ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free
5671         the debugging information if it has already been read.
5672         (ecoff_indirect_link_order): Handle _cooked_size being different
5673         from _raw_size.  Don't reread the contents or the relocs if they
5674         have already been read in.
5675         * coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from
5676         18 to 16.
5677         (PCREL16_EXPANSION_ADJUSTMENT): Define.
5678         (mips_relocate_refhi): Take adjust argument.
5679         (mips_relocate_section): Handle reloc offsets stored in section
5680         used_by_bfd field.  Call mips_relax_pcrel16 to handle details of
5681         expanding an out of range PCREL16.  Keep trace of adjustments
5682         required by expansions.  Set s and unset h when converting a reloc
5683         from undefined to section.  Change handling of PC relative relocs:
5684         if against a section, they are correct in the object file, if
5685         against an external symbol they are pcrel_offset.
5686         (mips_relax_section): New function.
5687         (mips_relax_pcrel16): New function.
5688         (ecoff_bfd_relax_section): Define.
5689         * coff-alpha.c (ecoff_bfd_relax_section): Define.
5690         * ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments
5691         built by mips_relax_section when writing out addresses.
5692         * elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field.
5693
5694         * aoutx.h (NAME(aout,find_nearest_line)): The caller expects
5695         functionname_ptr to be set to a symbol name, so prepend
5696         symbol_leading_char.
5697
5698 Thu Mar 24 11:33:46 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
5699
5700         * coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info
5701         for 16bit relative branches.
5702         * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on
5703         overflow.
5704
5705 Thu Mar 24 09:21:13 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5706
5707         * som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects.
5708         (som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise.
5709
5710 Wed Mar 23 14:29:31 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
5711
5712         * netbsd386.c (N_SET_FLAGS): Delete the old definition.
5713
5714 Wed Mar 23 14:58:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5715
5716         Clean up the relaxing code for the new linker.
5717         * targets.c (_bfd_relax_section): Take boolean *again argument
5718         rather than asymbol list.
5719         * bfd.c (bfd_relax_section): Change name of fourth argument from
5720         symbols to again.
5721         * reloc.c (bfd_generic_relax_section): Take boolean *again
5722         argument rather than asymbol list.  Always return true.
5723         * bout.c: Include genlink.h.
5724         (aligncode, perform_slip): Declare.
5725         (perform_slip): Take BFD argument rather than asymbol list.
5726         Changed all callers.  Get the symbols from the BFD.  Change the
5727         hash table entry value as well as the symbol value.
5728         (abs32code): Take BFD argument rather than asymbol list.  Changed
5729         all callers.
5730         (aligncode): Likewise.
5731         (b_out_relax_section): Take boolean *again argument rather than
5732         asymbol list.  Only return false if an error occurred.  Set *again
5733         to false.  Get symbols from BFD.
5734         * reloc16.c: Include genlink.h.
5735         (bfd_perform_slip): Take BFD argument rather than asymbol list.
5736         Get the symbols from the BFD.  Change the hash table entry value
5737         as well as the symbol value.
5738         (bfd_coff_reloc16_relax_section): Take boolean *again argument
5739         rather than asymbol list.  Only return false if an error occurred.
5740         Set *again to false.  Get symbols from BFD.
5741         * coffcode.h (bfd_coff_backend_data): Change
5742         _bfd_coff_reloc16_estimate to take BFD argument rather than
5743         asymbol list.
5744         (bfd_coff_reloc16_estimate): Corresponding change.
5745         (dummy_reloc16_estimate): Corresponding change.
5746         * libcoff-in.h (bfd_coff_reloc16_relax_section): Change
5747         declaration to take boolean * rather than asymbol list.
5748         (bfd_perform_slip): Change declaration to take BFD rather than
5749         asymbol list.
5750         * coff-h8300.c (h300_reloc16_estimate): Take BFD argument rather
5751         than asymbol list.  Changed calls to bfd_perform_slip.
5752         * bfd-in2.h: Rebuilt.
5753         * libbfd.h: Rebuilt.
5754         * libcoff.h: Rebuilt.
5755         * Makefile.in: Rebuilt dependencies.
5756
5757         * genlink.h (_bfd_generic_link_get_symbols): Define.
5758         (_bfd_generic_link_get_symcount): Define.
5759         * linker.c (generic_link_read_symbols): New function.
5760         (generic_link_add_object_symbols): Use it.  Use
5761         _bfd_generic_link_get_symbols and _bfd_generic_link_get_symcount
5762         to get the symbols from the BFD.
5763         (generic_link_check_archive_element): Likewise.
5764         (_bfd_generic_final_link): Likewise.
5765         (_bfd_generic_link_output_symbols): Likewise.
5766         (default_indirect_link_order): Likewise.
5767         (generic_link_add_symbol_list): Store pointer to hash table entry
5768         in asymbol udata field.
5769
5770 Tue Mar 22 13:09:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5771
5772         * coff-mips.c (mips_howto_table): Add entry for new MIPS_R_PCREL16
5773         reloc, used in embedded PIC code.
5774         (mips_adjust_reloc_in): Change sanity check to permit new reloc.
5775         (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_16_PCREL_S2 into
5776         MIPS_R_PCREL16.
5777
5778         * elf32-mips.c (mips_elf_final_link): Account for link_order
5779         relocs when allocating space for relocations.  Set SEC_RELOC flag
5780         for any section which has relocs.  Handle link_order relocs in
5781         link_order loop.  Use _bfd_generic_link_add_symbols_collect for
5782         add_symbls entry point.
5783
5784         * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before
5785         counting relocs.  Set SEC_RELOC flag for any section which has
5786         relocs.
5787
5788         * linker.c (_bfd_default_link_order): Handle bfd_data_link_order.
5789
5790         * linker.c (_bfd_generic_link_add_symbols): Just call
5791         generic_link_add_symbols.
5792         (_bfd_generic_link_add_symbols_collect): New function, like
5793         _bfd_generic_link_add_symbols but also collect constructors and
5794         destructors by name as collect2 does.
5795         (generic_link_add_symbols): New function, like old
5796         _bfd_generic_link_add_symbols but with collect argument.
5797         (generic_link_add_object_symbols): Take collect argument.
5798         (generic_link_check_archive_element_no_collect): New function.
5799         (generic_link_check_archive_element_collect): New function.
5800         (generic_link_check_archive_element): Take collect argument.
5801         (generic_link_add_symbol_list): Take collect argument.
5802         (_bfd_generic_link_add_one_symbol): Rename constructor argument to
5803         collect.
5804         * libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare.
5805         * libbfd.h: Rebuilt.
5806
5807 Tue Mar 22 10:04:00 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5808
5809         * archive.c (bfd_construct_extended_name_table): Use ar_padchar
5810         for first character in an extended name.
5811         (_bfd_write_archive_contents): If ar_padchar == '/', then use
5812         "//" as the name of the special archive member holding the
5813         extended name table.
5814
5815 Mon Mar 21 12:28:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5816
5817         Support for link_order types which generate relocs in order to
5818         support -Ur in the linker.
5819         * linker.c (generic_link_add_symbol_list): Remove bitsize argument
5820         from call to _bfd_generic_link_add_one_symbol.
5821         (_bfd_generic_link_add_one_symbol): Remove bitsize argument.
5822         Don't pass bitsize to constructor call back.  Pass BFD_RELOC_CTOR
5823         instead of bitsize to add_to_set call back.
5824         (_bfd_generic_final_link): Account for link_order relocs when
5825         allocating space for relocations.  Handle them in link_order loop.
5826         (_bfd_generic_reloc_link_order): New function.
5827         (_bfd_default_link_order): If a reloc_link_order is seen here,
5828         abort.
5829         (_bfd_count_link_order_relocs): New function.
5830         * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize
5831         argument from declaration.
5832         (_bfd_generic_reloc_link_order): Declare.
5833         (_bfd_count_link_order_relocs): Declare.
5834         * libbfd.h: Rebuilt.
5835         * aoutx.h (aout_link_add_symbols): Remove bitsize argument from
5836         call to _bfd_generic_link_add_one_symbol.
5837         (NAME(aout,final_link)): Account for link_order relocs when
5838         allocating space for relocations.  Handle them after handling all
5839         input BFDs.
5840         (aout_link_reloc_link_order): New function.
5841         * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from
5842         call to _bfd_generic_link_add_one_symbol.
5843         (ecoff_bfd_final_link): Account for link_order relocs when
5844         allocating space for relocations.  Handle them in link_order loop.
5845         (ecoff_link_write_external): Set the storage class of a defined
5846         linker created symbol based on the section it is in.  Correct
5847         bfd_link_hash_weak case to use .sc rather than .st.
5848         (ecoff_reloc_link_order): New function.
5849         * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle
5850         BFD_RELOC_CTOR.
5851         * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise.
5852
5853         * sunos.c (sunos_read_dynamic_info): Remove unused locals dynsym
5854         and buf.
5855
5856         * cisco-core.c (cisco_core_file_p): Only pass one argument to
5857         bfd_zmalloc.  Free a pointer, not a union.
5858         (cisco_bfd_is_local_label): Correct cast from asection to asymbol.
5859
5860 Sun Mar 20 09:24:36 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5861
5862         * bfd/som.c (som_begin_writing): Fix thinko (off by one error).
5863
5864         * som.c (bfd_section_from_som_symbol): Only to do the value
5865         comparison for function symbols within executables.
5866
5867         * som.c (bfd_section_from_som_symbol): Renamed from
5868         som_section_from_subspace_index.  Pass in a native SOM symbol.
5869         For executables, iterate through the sections to find out
5870         which contains the symbol's address rather than using the
5871         symbol_info field.  (symbol_info has a different meaning for
5872         dynamicly linked executables.)
5873
5874         * trad-core.c (trad_unix_core_file_p): Don't pass abfd to
5875         bfd_zmalloc.
5876
5877         * som.c (som_begin_writing): Fix braino (one call to align
5878         space/subspace data was done unconditionally rather than
5879         just for executables.)
5880
5881         * som.c (som_begin_writing): Align text in all executables to
5882         make HPUX kernel happy.  Fixes strip/objcopy for shared
5883         executables.
5884
5885 Sat Mar 19 07:06:59 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5886
5887         * som.c (som_begin_writing): Account for alignment needs of
5888         subspaces too when writing executables.  Never request a negative
5889         bss size.  Fixes some problems with demand paged executables,
5890         still having problems with pure executables and shared executables.
5891
5892 Fri Mar 18 19:12:47 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
5893
5894         * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not
5895         bfd_zalloc for rawptr, because later on we may call free, not
5896         bfd_release, on it.
5897
5898         * bfd.c (struct _bfd): Add cisco_core_struct to tdata union.
5899         * libbfd.c (bfd_read, bfd_seek): Add comments regarding errors.
5900         * cisco-core.c: New file.
5901         * Makefile.in: Change accordingly.
5902         * configure.in: Recognize cisco_core_vec.
5903         * config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec.
5904         * targets.c: Add cisco_core_vec.
5905         * bfd-in2.h: Rebuilt.
5906
5907 Fri Mar 18 18:13:49 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
5908
5909         * som.h (som_copyable_section_data_struct): New structure
5910         containing all the private section information which needs
5911         to be copied from input section to output section during
5912         objcopy or strip.
5913         (som_section_data_struct): Remove several fields now in
5914         som_copyable_section_data_struct.  Make the space and 
5915         subspace dictionaries be pointers (to save space when
5916         only reading objects).
5917
5918         * som.c (bfd_som_set_section_attributes): Now returns a boolean;
5919         some references changed.  Allocate a copyable data stucture if
5920         none exists.  Store info into the copyable data structure.
5921         (bfd_som_set_subsection_attributes): Likewise.
5922         (som_is_space, som_is_subspace, som_is_container): New functions.
5923         Use these instead of directly accessing private data.
5924         (som_prep_headers): Allocate space and subspace headers here.
5925         Fill in some fields in the space/subspace headers from the
5926         copyable data.
5927         (som_bfd_copy_private_section_data): Only copy the stuff
5928         that we really need to make objcopy and strip work.  Allocate
5929         the copy_data structure for the output bfd before copying.
5930
5931         * som.h (struct som_exec_data): New structure to hold exec
5932         info that must be preserved when running objcopy/strip.
5933         (struct somdata): Add new "exec_data" field and accessor
5934         macro.  Add some comments on how the various fields are used.
5935         (som_section_data_struct): Make is_space and is_subspace bitfields.
5936         Delete unused subspace_index.  All references now use the
5937         target_index field within the section structure itself.
5938
5939         * som.c (make_unique_section): Delete unused declaration.
5940         (som_bfd_copy_private_bfd_data): New function.
5941         (som_object_setup): Allocate space for and save exec information
5942         that needs to be copied during objcopy/strip.
5943         (som_mkobject): Do not allocate space for a file header here.
5944         It is not used when only reading SOM objects.
5945         (som_prep_headers): Allocate space for and attach a file header
5946         to the output bfd.  For executables, use the saved system_id
5947         value rather than trying to guess the right value.  Do not abort
5948         wwhen setting file_hdr->entry* for executables.
5949         (som_begin_writing): For executables, set the exec_entry and
5950         exec_flags fields.
5951         (som_copy_private_backend_section_data): Always return a value.
5952
5953         * libhppa.h (PA_PAGESIZE): Define.
5954
5955         * som.c (SOM_ALIGN): Define.
5956         (som_begin_writing): If writing an executable, initialize all
5957         fields in the exec header to zero.  Update fields in the exec
5958         header as sizes of loadable subspaces are computed.  Carefully
5959         preserve alignments when building executables.  Actually write the
5960         exec after all the fields are filled in.
5961
5962         * Better long-filename handling.  Reads SOM ABI compliant extended
5963         names, but doesn't quite write compliant extended names yet.
5964         * som.c (som_slurp_extended_name_table): Delete function.  The
5965         generic code will handle things correctly.
5966         (som_slurp_armap): Seek to the beginning of the next member.
5967         (normalize): New function.
5968         (som_bfd_ar_write_symbol_stuff): Take the size of the extended
5969         name table into account when computing the file offsets in the
5970         SOM dictionary.  Make sure to align to an even boundary.
5971         (som_write_armap): Initialize the checksum to zero.
5972         (ar_maxchars): Fix.  Opps.
5973
5974 Fri Mar 18 20:35:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
5975
5976         * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit
5977         machine.  Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13.
5978
5979 Thu Mar 17 18:26:46 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
5980
5981         * bfd-in.h (BFD_VERSION): Use @VERSION@.
5982         * Makefile.in (bfd.h): Replace it with contents of VERSION file.
5983         * bfd-in2.h: Regenerated.
5984
5985         * trad-core.c (trad_unix_bfd_is_local_label): Fixed typo where
5986         this was also named trad_unix_bfd_copy_private_bfd_data.
5987
5988 Thu Mar 17 10:37:07 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
5989
5990         * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c,
5991         elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0)
5992         returns NULL, it is not an error.  It's possible that some of
5993         these checks are not necessary (because the size can never be
5994         zero), but putting in the checks is the conservative thing to do
5995         in light of the fact that some of these malloc calls replaced
5996         unchecked alloca calls, in which a zero argument would work fine.
5997
5998 Thu Mar 17 11:44:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5999
6000         * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove
6001         duplicate definition.
6002         (osf_core_bfd_is_local_label): Define.
6003
6004         * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail
6005         if malloc (0) fails.  bfd_canonicalize_reloc returning 0 is not a
6006         failure indication, it merely means there are no relocs.
6007
6008         * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space
6009         after NAME, since SunOS /bin/cc can't handle it.
6010
6011 Wed Mar 16 16:43:33 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
6012
6013         * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field.
6014         From sukes@glue.umd.edu (Tasuki Hirata).
6015
6016 Wed Mar 16 07:55:54 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
6017
6018         * aoutf1.h (4 places): Use a simple #if on ARCH_SIZE, rather than
6019         all that convoluted stuff with NAME, CAT3, etc.  The convoluted
6020         stuff broke for SunOS4 /bin/cc (due to DEFUN elimination, I guess).
6021
6022 Wed Mar 16 00:02:05 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6023
6024         * som.c (som_prep_for_fixups): Detect section symbols based
6025         on either the lack of private data or the symbol flags.  Do not
6026         munge section symbol names anymore -- they no longer confuse GDB.
6027         (som_begin_writing): Leave space for an exec header if writing
6028         an executable.
6029         (som_slurp_symbol_table): Recognize both forms of section symbol
6030         names "L$0\002" and "$<FOO>$".  Change the name of "L$0\002"
6031         section symbols to be the name of the section they represent.
6032         Debugging  symbols begin with "L$0\001", not just "L$".
6033
6034 Tue Mar 15 22:58:28 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6035
6036         * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
6037
6038         * bfd-in.h (JUMP_TABLE): Add new entries to the jump table
6039         for bfd_copy_private_section_data, bfd_copy_private_bfd_data,
6040         and bfd_is_local_label.
6041
6042         * targets.c: Add new entries to the bfd_target structure.
6043         
6044         * bfd.c (bfd_copy_private_bfd_data): New definition.
6045
6046         * section.c (bfd_copy_private_section_data): New definition.
6047
6048         * syms.c (bfd_is_local_label): New definition.
6049
6050         * libbfd-in.h (bfd_generic_is_local_label): Declare.
6051
6052         * libbfd.c (bfd_generic_is_local_label): New function.
6053
6054         * *-core.c: Provide default definitions for new functions in
6055         the target vector which all point to bfd_false.
6056
6057         * aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c
6058         libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c
6059         Default new vectors for copying private backend data to bfd_true.
6060         Default new vector for determining if a symbol is a local label
6061         to bfd_generic_is_local_label.
6062
6063         * som.c (som_bfd_copy_private_section_data): New function.
6064         (som_bfd_is_local_label): New function.
6065         (som_bfd_copy_private_bfd_data): For now default to bfd_true.
6066
6067         * elf32-hppa.c (hppa_elf_is_local_label): New function.
6068
6069 Tue Mar 15 23:55:47 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6070
6071         * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table.
6072
6073 Tue Mar 15 04:41:13 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
6074
6075         * Most files:
6076         Replace DEFUN and DEFUN_VOID with K&R-style function definition.
6077         Indent some of them to GNU standards.
6078
6079         * aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
6080         cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
6081         elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
6082         libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
6083         Update copyright years.
6084
6085 Mon Mar 14 11:41:23 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6086
6087         * som.c (som_prep_for_fixups): A relocation involving the section
6088         symbol for the *ABS* section is really a relocation involving
6089         no symbol.
6090         (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for
6091         undefined symbols.  Correctly distinguish between debugger symbols
6092         and section symbols.
6093
6094         * som (setup_sections): Set SEC_DEBUGGING and the section attributes
6095         for spaces and subspaces.
6096
6097         * som.c (som_bfd_count_ar_symbols): Fix typo.
6098
6099         * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and
6100         HAS_RELOC based on the object's magic number.
6101         (make_unique_section): Delete function.  BFD and its users are
6102         prepared to handle multiple sections with the same name.
6103         (setup_sections): Allocate space on the BFD's obstack to hold
6104         section names.  Use bfd_make_setion_anyway rather than the
6105         obsolete make_unique_section.
6106         (som_prep_headers): Choose the correct SOM magic number based
6107         on the BFD's flags.
6108         (som_bfd_fill_in_ar_symbols): Return false, not NULL on error.
6109
6110 Sat Mar 12 09:46:09 1994  Ian Lance Taylor  (ian@cygnus.com)
6111
6112         * elf32-ppc.c: Renamed from elf32-powerpc.c.
6113         * nlm32-ppc.c: Renamed from nlm32-powerpc.c.
6114         * Makefile.in, configure.in: Corresponding changes.
6115
6116 Fri Mar 11 22:27:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6117
6118         * elf32-powerpc.c: Extensive changes to update to preliminary ABI.
6119
6120 Fri Mar 11 00:34:59 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
6121
6122         * sunos.c (sunos_read_dynamic_info):  Assume that dynamic info
6123         is always located at the start of the data section to allow
6124         recovery of the dynamic info from a stripped executable.
6125         * ecoff.c (ecoff_styp_to_sec_flags):  Handle STYP_PDATA, STYP_XDATA
6126         and STYP_COMMENT.
6127
6128 Wed Mar  9 17:17:53 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
6129
6130         * libbfd-in.h: Remove alloca cruft.  It was missing some necessary
6131         cruft (like the #pragma alloca for AIX).
6132         In addition to that problem, the C alloca calls xmalloc, which
6133         means checking for being out of memory can't work right.  The
6134         following changes remove all uses of alloca from BFD.
6135         * hosts/solaris2.h: Remove alloca cruft.
6136         * som.c: Replace alloca with a fixed size auto array.
6137         * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c,
6138         ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c,
6139         sunos.c: Replace alloca with malloc and appropriate error checking and
6140         freeing.
6141         * linker.c: Replace alloca with obstack_alloc.
6142         * libbfd.h: Rebuilt.
6143
6144 Tue Mar  8 12:10:38 1994  Ian Lance Taylor  (ian@cygnus.com)
6145
6146         * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like
6147         MIPS_R_GPREL.
6148
6149 Sat Mar  5 14:08:54 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
6150
6151         * elf32-hppa.h, elfcode.h:  Replace uses of Elf*_Half, Elf*_Word,
6152         Elf*_Off typedefs by their expansion, the typedefs have been
6153         removed from include/elf/internal.h.
6154         * elfcode.h (bfd_section_from_shdr):  Handle SHT_DYNAMIC section like
6155         SHT_PROGBITS section.
6156
6157 Thu Mar  3 20:03:39 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6158
6159         * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD.
6160
6161 Wed Mar  2 13:28:06 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
6162
6163         * configure.host: Recognize i[34]86-sequent-*.
6164
6165         * trad-core.c (trad_unix_core_file_p): A non-zero, not zero,
6166         return from bfd_seek indicates an error.
6167         New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace
6168         TRAD_CORE_STACK_OFFSET.
6169         * hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and
6170         TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET.
6171
6172 Wed Mar  2 11:57:03 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6173
6174         * som.[ch]: Do not include libhppa.h in som.c, instead include
6175         it in som.h.
6176
6177         * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead
6178         include it in elf32-hppa.h.
6179
6180         * som.c (log2): Return -1 on error rather than aborting.
6181         (setup_sections): Bubble up an error from log2.
6182
6183         * Changes to make HP C compiler happy in both traditional
6184         and ANSI mode.
6185         * som.c (hppa_som_gen_reloc_type): Use correct enum type for
6186         field parameter.
6187         (bfd_som_set_section_attributes): Use unsigned int rather than
6188         unsigned char to avoid GNU-C extensions.
6189         (bfd_som_attach_aux_hdr): Return a boolean to indicate success
6190         or failure rather than aborting on failure.
6191
6192         * som.h (bfd_som_set_section_attributes): Fix prototype to match
6193         som.c changes.
6194         (bfd_som_attach_aux_hdr): Add prototype.
6195         (hppa_som-gen_reloc_type): Likewise.
6196
6197         * elf32-hppa.c: Add a couple casts to make HP compiler happy.
6198         (hppa_look_for_stubs_in_section): Do not return false on failure
6199         until rest of code is ready to handle it.  Abort for now.
6200
6201 Tue Mar  1 18:33:59 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
6202
6203         * bfd-in2.h: Rebuilt.
6204
6205 Tue Mar  1 13:06:53 1994  Kung Hsu  (kung@mexican.cygnus.com)
6206
6207         * i386os9k.c: use new functions bfd_set_error and bfd_get_error.
6208         * Makefile.in: delete an extra blank.
6209         * configure.in : Add i396os9k_vec.
6210
6211 Mon Feb 28 15:41:01 1994  Kung Hsu  (kung@mexican.cygnus.com)
6212
6213         * config.bfd : Add i386-os9k.
6214         * config/i386-os9k.mt : Newly add os9k target makefile.
6215
6216         * i386os9k.c : new file to handle os9k format bfd.
6217         * Makefile.in : Handle new file i386os9k.c
6218         * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec.
6219         * cache.c : Initialize cache_sentinel to 0.
6220
6221 Sun Feb 27 16:30:55 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6222
6223         * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch
6224         action in case where caller specified no argument relocation.
6225         (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr
6226         right in the original relocation and the stub's relocation.
6227
6228         * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo.  Delete
6229         unused symbols argument.
6230
6231         * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather
6232         than asymbol * for original target symbol.  All callers changed.
6233         Set reloc->sym_ptr_ptr appropriately.
6234         (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly.
6235         (hppa_elf_look_for_stubs_in_section): No longer need symbols
6236         argument.  Use the output symbols when canonicalizing the relocs,
6237         creating them if necessary.
6238
6239         * linker.c (_bfd_generic_link_output_symbols): Do not
6240         rebuild/clobber the output symbols if they already exist.
6241
6242 Sun Feb 27 15:22:36 1994  Stan Shebs  (shebs@andros.cygnus.com)
6243
6244         * targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that
6245         check all the pointer dereferences.  Enabled via DEBUG_BFD_SEND.
6246         * bfd-in2.h: Rebuilt.
6247
6248         * srec.c (hex_value): Always set to a size of 256 bytes.
6249         (srec_init): Cosmetic changes.
6250
6251 Sun Feb 27 11:18:47 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6252
6253         * elf32-hppa.c: Second half of major cleanup.  More comments,
6254         PARAMize and staticize rest of functions.  Delete unused
6255         functions.  Delete unused/unnecessary arguments to some functions.
6256         Group static vars together.  Abort for bad errors until we have
6257         error code propogation working.  Work on spacing and indention.
6258         Add FIXMEs for unresolved problems.  Use enums rather than
6259         #defines for lots of things.  Merge two functions which build
6260         linker stubs into a single function (so they can easily share a
6261         ton of common code).
6262
6263 Sat Feb 26 10:00:45 1994  Ian Lance Taylor  (ian@cygnus.com)
6264
6265         * reloc.c (_bfd_relocate_contents): Adjust handling of overflow to
6266         avoid depending upon right shifts of signed numbers, and to
6267         correct handling of src_mask with lower bits zero.
6268
6269         * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc.
6270         * ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise.
6271         * elf32-i386.c: Likewise.
6272         * elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old
6273         #if 0 code.
6274         (elf_write_phdrs): Make i unsigned.
6275         (map_program_segments): Make i and n_left unsigned.
6276         (assign_file_positions_except_relocs): Make i unsigned.
6277         (write_shdrs_and_ehdr): Make count unsigned.
6278         (assign_file_positions_for_relocs): Make i unsigned.
6279         (NAME(bfd,elf_write_object_contents)): Make count unsigned.
6280         (section_from_elf_index): Make index argument unsigned.
6281
6282 Fri Feb 25 21:34:58 1994  Ian Lance Taylor  (ian@cygnus.com)
6283
6284         * elfcode.h: Don't include assert.h.
6285         (swap_out_syms): Use BFD_ASSERT rather than assert.
6286
6287         * linker.c (_bfd_generic_link_write_global_symbol): Add missing
6288         break in switch.
6289
6290         * hosts/i386v4.h (qsort, strtol): Remove incorrect and useless
6291         declarations.
6292
6293 Fri Feb 25 16:35:57 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6294
6295         * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c.
6296
6297         * elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments.
6298         (elf_hppa_tc_make_sections): Likewise.
6299         (elf_hppa_final_processing): Add extern decl.
6300
6301         * elf32-hppa.c: First half of major cleanup.  Add/cleanup lots of
6302         comments.  PARAMize some static functions.  Delete unused functions.
6303         Delete unused/unnecessary arguments to many functions.  Group
6304         static vars together.  Collapse common case statements together
6305         in many places.  Use default case when possible instead of listing
6306         each case separately.  Abort for bad errors until we get error
6307         code propogation working.  Work on spacing and indention problems.
6308         Add FIXMEs for some unresolved problems.  Delete hopelessly broken 
6309         COMPLEX relocation support (it's never used anyway).
6310         (hppa_elf_rebuild_insn): Delete.  Moved into libhppa.h.
6311         (elf_hppa_tc_symbol): Accept and use new arguments (symext chains).
6312         (elf_hppa_tc_make_sections): Likewise.
6313
6314         * format.c (bfd_check_format_matches): Initialize matching_vector
6315         to keep gcc -Wall quiet.
6316
6317         * elfcode.h (elf_slurp_reloca_table): Fix typo.
6318
6319         * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)"
6320         not "sizeof (som_symbol_type *)".
6321
6322         * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)"
6323         not "sizeof (asymbol").  Opps.
6324
6325 Fri Feb 25 13:19:04 1994  Ted Lemon  (mellon@pepper.ncd.com)
6326
6327         * bfd.c (bfd_get_gp_size): Can't return gp value on an archive.
6328         (bfd_set_gp_size):  Can't set gp value on an archive.
6329
6330 Fri Feb 25 12:57:00 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
6331
6332         * srec.c (pass_over): Don't skip too many characters when
6333         end of line seen.
6334
6335 Fri Feb 25 11:41:57 1994  Ian Lance Taylor  (ian@cygnus.com)
6336
6337         * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte
6338         boundary.
6339
6340 Thu Feb 24 07:13:22 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6341
6342         * som.c (som_bfd_derive_misc_symbol_info): Derive symbol_info
6343         field for absolute symbols in the same manner as undefined
6344         and common symbols.
6345
6346 Thu Feb 24 04:29:19 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
6347
6348         * elfcode.h (elf_core_file_p):  Check for core file e_machine match
6349         like in elf_object_p.
6350
6351 Wed Feb 23 18:28:37 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6352
6353         * elfcode.h (alloca): Delete declaration.
6354
6355         * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic
6356         number rather than HP9000S800_ID.  Note som.c is careful
6357         to make sure CPU_PA_RISC1_0 is always defined.
6358
6359 Mon Feb 21 10:12:02 1994  Stan Shebs  (shebs@andros.cygnus.com)
6360
6361         * Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply
6362         flags to explicit compile actions.
6363
6364 Mon Feb 21 09:50:06 1994  Ian Lance Taylor  (ian@lisa.cygnus.com)
6365
6366         * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here.
6367         * ecoff.c (ecoff_write_object_contents): Make sure .bss section
6368         ends on a page boundary if there is no symbol table.
6369         (ecoff_bfd_final_link): Don't set symhdr->magic here.
6370
6371         * hosts/hp300.h: Include <stdlib.h>; don't declare free.
6372
6373         * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca
6374         rather than an array of variable size.
6375         (som_bfd_fill_in_ar_symbols): Likewise.
6376         (som_bfd_ar_write_symbol_stuff): Likewise.
6377
6378         * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift
6379         operation to avoid OSF 1.3 cc bug.
6380         * ecoff.c (ecoff_write_object_contents): Make text_size, data_size
6381         and bss_size bfd_size_type instead of unsigned long.  Make
6382         text_start and data_start bfd_vma instead of unsigned long.
6383         * ecofflink.c (ecoff_add_string): Remove incorrect cast of return
6384         value.
6385
6386 Sun Feb 20 16:06:54 1994  Ian Lance Taylor  (ian@lisa.cygnus.com)
6387
6388         * linker.c (_bfd_generic_link_add_archive_symbols): Consider
6389         symbols in the order they appear in the archive map.
6390
6391 Sat Feb 19 03:17:32 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
6392
6393         * coff-alpha.c (reloc_nil):  Add forward declaration, add missing
6394         error_message argument.
6395         * coff-sparc.c (bfd_coff_generic_reloc):  Add forward declaration,
6396         add missing error_message argument.
6397         * mipsbsd.c (mips_fix_hi16_s):  Add forward declaration, add missing
6398         error_message argument.
6399
6400 Fri Feb 18 11:41:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6401
6402         Support for PowerPC NetWare.
6403         * nlm32-powerpc.c: New file.
6404         * config.bfd (powerpc-*-netware*): New target; use ppc-nlm.
6405         * config/ppc-nlm.mt: New file.
6406         * configure.in (nlm32_powerpc_vec): New target vector; use
6407         nlm32-powerpc.o, nlm32.o, nlm.o.
6408         * targets.c (nlm32_powerpc_vec): Declare.
6409         * Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o.
6410         (CFILES): Add nlm32-powerpc.c.
6411
6412         Initial support for PowerPC ELF.  Done without an ABI, and
6413         probably to be changed when I get an ABI.
6414         * config.bfd (powerpc-*-sysv4*): New target; use ppc-elf.
6415         * config/ppc-elf.mt: New file.
6416         * configure.in (bfd_elf32_powerpc_vec): New target vector; use
6417         elf32-powerpc.o, elf32.o, elf.o.
6418         * elf32-powerpc.c: New file.
6419         * elfcode.h (prep_headers): Add bfd_arch_powerpc case.
6420         (elf_set_arch_mach): Likewise.
6421         * targets.c (bfd_elf32_powerpc_vec): Declare.
6422         * Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o.
6423         (CFILES): Add elf32-powerpc.c.
6424         Rebuilt dependencies.
6425
6426 Thu Feb 17 15:29:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6427
6428         * coffgen.c (coff_write_linenumbers): Always return a value.
6429
6430         * elfcode.h (elf_slurp_symbol_table): Handle zero symbols
6431         reasonably.  Allocate x_symp using alloca.
6432
6433         * elfcode.h (map_program_segments): ELF program header entries
6434         must be sorted by load address.  This used to generate the entries
6435         in reverse order.
6436
6437         * section.c (SEC_IN_MEMORY): Define.
6438         (asection): Rename unused field otheruserdata to contents, and
6439         make it char *.
6440         (bfd_make_section_anyway): Initialize contents field to NULL.
6441         (bfd_get_section_contents): If SEC_IN_MEMORY is set, get section
6442         contents from contents field rather than from file.
6443         * bfd-in2.h: Rebuilt.
6444
6445 Thu Feb 17 08:30:53 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
6446
6447         * bfd.c (bfd_get_error, bfd_set_error): New functions.
6448         (bfd_error): Make static.
6449         (bfd_error_type): Renamed from bfd_ec.  Prepend "bfd_error_" to
6450         all values.
6451         * bfd-in2.h: Regenerated.
6452         * aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h, 
6453         aoutf1.h, aoutx.h, archive.c, archures.c, 
6454         bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c, 
6455         coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c, 
6456         ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c, 
6457         elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c, 
6458         i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c, 
6459         lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c, 
6460         nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, 
6461         ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c, 
6462         srec.c, sunos.c, syms.c, targets.c, tekhex.c, 
6463         trad-core.c: Change callers.
6464
6465 Tue Feb 15 22:27:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6466
6467         * som.c: Remove FIXMEs for things which have been dealt with.
6468
6469 Tue Feb 15 19:39:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
6470
6471         * section.c (bfd_get_section_contents): Since this function reads
6472         unrelocated contents, the section's raw size is always the one to
6473         use for bounds checking.
6474
6475         * linker.c (default_indirect_link_order): In assertion, compare
6476         link_order size field against cooked size, not raw size, of input
6477         section.
6478
6479         * bout.c (b_out_get_reloc_upper_bound): For BSS section, just
6480         return 0.
6481         (aligncode): When shrinking, the addend should be set to the
6482         current offset in the section plus the number of bytes of padding
6483         that will actually be retained.
6484         (b_out_relax_section): If a section contains no relocations, don't
6485         bother processing them.
6486         (b_out_get_relocated_section_contents): Set reloc_done.  Assert
6487         that bfd_get_section_contents returns true.  Check that relocs are
6488         properly ordered.
6489         (b_out_get_relocated_section_contents, case ALIGNDONE): Assert
6490         that reloc->addend falls between the current source offset and the
6491         raw size of the input section.
6492
6493         * config.bfd: Support i960 vxworks versions > 5.0 with coff, not
6494         bout.  Default with no version number is still bout.  Support
6495         explicit i960-coff target too.
6496
6497         * bout.c: Changed some indentation, deleted trailing whitespace,
6498         fixed some comments, removed some "#if 1" lines.
6499         (output_addr): New macro.
6500         (calljx_callback, callj_callback, get_value, abs32code, aligncode,
6501         b_out_get_relocated_section_contents): Use it for readability.
6502
6503 Tue Feb 15 09:00:16 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6504
6505         * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM
6506         symbols, not the BFD symbols.
6507         (som_bfd_ar_write_symbol_stuff): Likewise.
6508
6509 Mon Feb 14 22:55:20 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6510
6511         * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't
6512         have any symbols.
6513
6514         * Finish basic read-write support for SOM archive libraries.  Bugs
6515         surely remain as this hasn't been tested all that much.
6516         * som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define.
6517         (struct som_misc_symbol_info): New structure to hold info necessary
6518         to build both normal and library symbol tables.
6519         (som_derive_misc_symbol_info): New function to derive info necessary
6520         to build both normal and library symbol tables.
6521         (som_build_and_write_symbol_table): Use new function to derive misc
6522         symbol information.
6523         (som_slurp_symbol_table): Update backend private data for symbols
6524         appropriately.
6525         (som_bfd_prep_for_ar_write): New function.
6526         (som_bfd_ar_symbol_hash): New function.
6527         (som_bfd_ar_write_symbol_stuff): New function.
6528         (som_write_armap): Flesh out.
6529         (som_vec): Fix ar padding character.
6530
6531         * som.c: Consistently use memset rather than bzero.
6532
6533 Mon Feb 14 17:02:28 1994  Stu Grossman  (grossman at cygnus.com)
6534
6535         * coff-rs6000.c:  Add Lynx core file support, use HOST_AIX, where
6536         appropriate.
6537         * rs6000-core.c:  Use HOST_AIX instead of COREFILES_PLEASE.
6538         * config/rs6000.mh:  Remove defs of ARCHIVES_PLEASE and
6539         COREFILES_PLEASE.
6540         * config/rs6000lynx.mh:  Turn on Lynx core file support.
6541         * hosts/rs6000.h:  #define HOST_AIX.
6542         * hosts/rs6000lynx.h:  Create this to enable Lynx host support.
6543
6544 Sun Feb 13 14:30:00 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6545
6546         * som.h (som_symbol_data): Safely access backend private data
6547         for BFD symbols.  All callers changed.
6548
6549         * Read-only SOM archive support.
6550         * som.c (som_bfd_count_ar_symbols): New helper function.
6551         (som_bfd_fill_in_ar_symbols): New helper function.
6552         (som_slurp_armap): New function to read a SOM LST.
6553
6554         * som.h: Include <lst.h> and <ar.h>.
6555
6556 Sat Feb 12 22:34:14 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6557
6558         * elfcode.h (elf_map_symbols): Fix typo.
6559         (write_object_contents): Check return values from prep_headers and
6560         elf_compute_section_file_positions.
6561         (set_section_contents): Likewise.
6562
6563 Fri Feb 11 16:56:50 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
6564
6565         * archive.c (normalize) [VMS]: Call malloc, not bfd_xmalloc.
6566         (bfd_construct_extended_name_table): Check result of normalize.
6567
6568 Tue Feb  8 08:57:31 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
6569
6570         Make all callers of malloc or realloc (including via obstacks)
6571         check the result for NULL.  Most set bfd_error to no_memory and
6572         return in that case; a few are harder to fix, and are marked
6573         with "FIXME <return type>".
6574
6575         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub
6576         hppa_elf_build_long_branch_stub):  Check bfd_make_empty_symbol return.
6577         * linker.c (_bfd_generic_link_output_symbols
6578         _bfd_generic_link_write_global_symbol): Ditto
6579         * section.c (bfd_make_section_anyway): Ditto.
6580
6581         * tekhex.c (find_chunk tekhex_mkobject): Check bfd_alloc.
6582         (first_phase): Ditto.  FIXME void
6583         (tekhex_make_empty_symbol): Check bfd_zalloc.
6584
6585         * sunos.c (sunos_read_dynamic_info): Check bfd_zalloc.
6586         (MY(read_dynamic_symbols) MY(read_dynamic_relocs)): Check bfd_alloc.
6587
6588         * stringhash.c (_bfd_stringtab_hash_newfunc): Check bfd_hash_allocate.
6589
6590         * srec.c: Indent.
6591         (fillup_symbols): Check bfd_alloc.  FIXME void
6592         (srec_mkobject srec_get_section_contents
6593         srec_set_section_contents): Check bfd_alloc. 
6594         (srec_make_empty_symbol): Check bfd_zalloc.
6595
6596         * som.c (hppa_som_gen_reloc_type): Check bfd_alloc_by_size_t.
6597         (make_unique_section): Check bfd_alloc.
6598         (som_new_section_hook): Check bfd_zalloc.
6599         (bfd_som_attach_aux_hdr): Ditto.  FIXME void
6600
6601         * rs6000-core.c (rs6000coff_core_p): Check bfd_zalloc.
6602
6603         * osf-core.c (osf_core_make_empty_symbol): Check bfd_zalloc.
6604         (osf_core_core_file_p): Check bfd_alloc.
6605
6606         * oasys.c (oasys_slurp_symbol_table oasys_archive_p
6607         oasys_mkobject oasys_object_p oasys_new_section_hook
6608         oasys_set_section_contents): Check bfd_alloc.
6609         (oasys_slurp_section_data): Check bfd_zalloc and bfd_alloc.
6610         (oasys_make_empty_symbol): Check bfd_zalloc.
6611
6612         * nlmcode.h (nlm_make_empty_symbol): Check bfd_zalloc.
6613         (nlm_slurp_symbol_table): Check bfd_zalloc and bfd_alloc.
6614
6615         * nlm32-sparc.c (nlm_sparc_read_import): Check bfd_alloc.
6616
6617         * nlm32-i386.c (nlm_i386_read_import): Check bfd_alloc.
6618
6619         * nlm32-alpha.c (nlm_alpha_read_import): Check bfd_alloc.
6620
6621         * linker.c (_bfd_link_hash_newfunc
6622         (generic_link_hash_newfunc
6623         (archive_hash_newfunc
6624         (_bfd_generic_link_add_one_symbol): Check bfd_hash_allocate.
6625         (_bfd_generic_final_link
6626         (_bfd_generic_link_output_symbols
6627         (default_indirect_link_order): Check bfd_alloc.
6628         (bfd_new_link_order): Check bfd_alloc_by_size_t.
6629
6630         * irix-core.c (irix_core_make_empty_symbol): Check bfd_zalloc.
6631
6632         * ieee.c: Indent.
6633         (read_id get_symbol get_section_entry ieee_archive_p ieee_object_p
6634         ieee_slurp_section_data ieee_new_section_hook): Check bfd_alloc.
6635         (do_one): Check bfd_alloc.  Return a boolean.
6636         (ieee_slurp_section_data): Check it.
6637         (init_for_output): Check bfd_alloc.  Return a boolean.
6638         (ieee_set_section_contents): Check it.
6639         (do_with_relocs):  Check bfd_alloc.  Return a boolean.
6640         (ieee_bfd_debug_info_accumulate): Ditto.  FIXME void.
6641         (ieee_mkobject): Check bfd_zalloc.
6642         (ieee_make_empty_symbol): Check bfd_zmalloc.
6643
6644         * hpux-core.c (hpux_core_make_empty_symbol): Check
6645         bfd_zalloc.
6646
6647         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Check
6648         bfd_zalloc.
6649         (hppabsd_core_core_file_p): Check bfd_zalloc.
6650
6651         * hp300hpux.c (MY(slurp_symbol_table)): Check bfd_alloc.
6652
6653         * elfcode.h (elf_new_section_hook): Check bfd_alloc.
6654         (bfd_section_from_phdr): Ditto.
6655         (write_relocs): Ditto.  FIXME void
6656         (elf_map_symbols assign_section_numbers map_program_segments):
6657         Ditto.  Return a boolean. 
6658         (swap_out_syms): Ditto.  Check elf_map_symbols.
6659         (elf_slurp_symbol_table): Check bfd_zalloc.
6660         (elf_slurp_reloca_table): Check bfd_alloc.
6661         (elf_slurp_reloc_table): Ditto.
6662         (elf_compute_section_file_positions): Check assign_section_numbers.
6663         (assign_file_positions_except_relocs): Return a boolean.
6664         Check map_program_segments.
6665         (elf_compute_section_file_positions): Check it.
6666
6667         * elf32-mips.c (mips_elf_final_link): Check bfd_alloc.
6668
6669         * elf32-hppa.c (hppa_elf_stub_branch_reloc): Check bfd_zmalloc and
6670         realloc. 
6671         (hppa_elf_stub_reloc): Ditto.
6672         (hppa_elf_build_arg_reloc_stub): Check bfd_zalloc.
6673         (hppa_elf_build_long_branch_stub): Ditto.
6674         (elf32_hppa_backend_symbol_table_processing): Ditto.
6675
6676         * ecoff.c (ecoff_set_symbol_info): Check bfd_alloc.  Return a boolean.
6677         (ecoff_slurp_symbol_table): Check it.
6678         (ecoff_slurp_armap): Check bfd_alloc.
6679         (ecoff_write_armap): Check bfd_zalloc.
6680         (ecoff_link_hash_newfunc): Check bfd_hash_allocate and
6681         _bfd_link_hash_newfunc. 
6682         (ecoff_link_add_externals): Check bfd_alloc.
6683
6684         * ctor.c (bfd_constructor_entry): Check bfd_alloc.
6685
6686         * coffgen.c (coff_real_object_p): Check bfd_alloc.
6687         (coff_renumber_symbols): Check bfd_alloc_by_size_t.  Return a boolean.
6688         (coff_write_symbol): Check bfd_alloc.  FIXME int
6689         (coff_write_linenumbers): Check bfd_alloc.  Return a boolean.
6690         (coff_section_symbol): Check bfd_alloc_by_size_t.
6691         (coff_get_normalized_symtab): Check bfd_alloc.
6692         (coff_bfd_make_debug_symbol): Check bfd_zalloc.
6693         * libcoff-in.h: Change decls of coff_renumber_symbols,
6694         coff_write_linenumbers.
6695         * libcoff.h: Rebuilt.
6696         * coffcode.h (coff_write_object_contents): Check
6697         coff_renumber_symbols, coff_write_linenumbers.
6698
6699         * coffcode.h: Indent.
6700         (coff_add_missing_symbols): Check bfd_alloc_by_size_t.  Return a
6701         boolean. 
6702         (coff_write_object_contents): Check it.
6703
6704         * coff-alpha.c (alpha_relocate_section): Check bfd_alloc.
6705         * coff-mips.c (mips_relocate_section): Ditto.
6706
6707         * archive.c (bfd_slurp_bsd_armap_f2): Check bfd_alloc value.
6708         (do_slurp_bsd_armap): Ditto.
6709         (compute_and_write_armap): Check bfd_realloc value.
6710
6711         * aoutx.h (translate_from_native_sym_flags): Check bfd_alloc
6712         return value.  Return boolean value.
6713         (NAME(aout,make_empty_symbol)): Check bfd_zalloc return value.
6714         (NAME(aout,slurp_symbol_table)): Check bf_alloc and bfd_zalloc
6715         return value.
6716         (add_to_stringtab): Ditto.  FIXME void
6717         (aout_link_hash_newfunc): Check bfd_hash_allocate return value.
6718         (aout_link_add_symbols): Check bfd_alloc value.
6719         (translate_symbol_table): Check translate_from_native_sym_flags.
6720         * hp300hpux.c (MY(slurp_symbol_table)): Ditto.
6721         * aoutx.h (aout_link_hash_newfunc): Check _bfd_link_hash_newfunc.
6722
6723         * opncls.c (bfd_zalloc bfd_realloc): Check result of bfd_alloc.
6724
6725         * opncls.c (obstack_chunk_alloc): Define as malloc, not
6726         bfd_xmalloc_by_size_t. 
6727         (_bfd_new_bfd): Check obstack_begin for 0 return.
6728
6729         * ieee.c (obstack_chunk_alloc): Define as malloc, not
6730         bfd_xmalloc_by_size_t. 
6731         (ieee_archive_p): Check obstack_begin for 0 return and
6732         obstack_finish for NULL return.
6733
6734         * hash.c (obstack_chunk_alloc): Define as malloc, not
6735         bfd_xmalloc_by_size_t. 
6736         (bfd_hash_table_init_n): Check obstack_begin for 0 return and
6737         obstack_finish for NULL return.
6738         (bfd_hash_lookup): Check obstack_alloc for NULL return.
6739
6740         * ecofflink.c (obstack_chunk_alloc): Define as malloc, not
6741         bfd_xmalloc_by_size_t. 
6742         bfd_ecoff_debug_accumulate
6743         bfd_ecoff_debug_accumulate_other): Check obstack_alloc.
6744         (add_file_shuffle add_memory_shuffle): Check obstack_alloc for
6745         NULL return.  Return boolean, not void.
6746         (bfd_ecoff_debug_init): Check obstack_begin for 0 return.
6747         (bfd_ecoff_debug_accumulate): Check add_file_shuffle
6748         and add_memory_shuffle return. 
6749         (string_hash_newfunc): Check bfd_hash_allocate and bfd_hash_newfunc.
6750         (bfd_ecoff_debug_accumulate): Check bfd_alloc.
6751         (ecoff_add_string): Check add_memory_shuffle return.
6752
6753         * libbfd-in.h (xmalloc, bfd_xmalloc, bfd_xmalloc_by_size_t):
6754         Remove decls. 
6755         * libbfd.h: Rebuilt.
6756
6757 Fri Feb 11 15:35:32 1994  Stu Grossman  (grossman at cygnus.com)
6758
6759         * configure.host:  Add Lynx/rs6000 support.
6760         * config/i386-nlm.mt:  Enable a.out file support.
6761         * config/rs6000lynx.mh:  Lynx/rs6000 host support.
6762
6763 Fri Feb 11 17:25:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6764
6765         * archive.c (compute_and_write_armap): Rewrite somewhat to improve
6766         memory usage.
6767
6768 Fri Feb 11 13:10:42 1994  Stan Shebs  (shebs@andros.cygnus.com)
6769
6770         * archive.c: Change all references to '\n' in archive magic
6771         to '\012', for greater portability.
6772         * ecoff.c (ecoff_write_armap): Ditto.
6773
6774 Thu Feb 10 12:58:48 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6775
6776         * aoutx.h (aout_link_write_other_symbol): Check strip settings to
6777         see whether symbol should be output.
6778         * genlink.h (struct generic_write_global_symbol_info): Added info
6779         field.
6780         * linker.c (_bfd_generic_final_link): Initialize wginfo.info.
6781         (_bfd_generic_link_write_global_symbol): Check strip settings to
6782         see whether symbol should be output.
6783         * elf32-mips.c (mips_elf_final_link): Initialize wginfo.info.
6784
6785 Wed Feb  9 21:34:58 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6786
6787         * som.c (som_reloc_queue_find): Do not examine a NULL queue entry.
6788
6789         * som.c: Cast return values from BFD memory allocation routines to
6790         avoid warnings from the HP compiler.
6791
6792 Wed Feb  9 12:55:02 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6793
6794         * coff-alpha.c (alpha_relocate_section): Accept a LITERAL
6795         reloc on an "ldl" instruction too.
6796
6797         * archive.c (bfd_ar_hdr_from_filesystem): Cast status elements
6798         when passing them to sprintf.  Use %ld instead of %d.
6799
6800         * coff-rs6000.c (rs6000coff_mkarchive): Return false.
6801         (rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used.
6802         Also removed unused variable namelen.
6803         (rs6000coff_write_armap): Declare orl_count and stridx parameters.
6804
6805 Tue Feb  8 18:00:34 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6806
6807         * libbfd-in.h (xmalloc): Don't declare parameter type, to avoid
6808         conflicts.
6809         * libbfd.h: Rebuilt.
6810
6811 Tue Feb  8 15:55:50 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
6812
6813         * coff-alpha.c (reloc_nil): New function.
6814         (alpha_howto_table): Use it as special_function to prevent certain
6815         relocs from being adjusted by bfd_perform_relocation.  IGNORE
6816         reloc should be partial_inplace.
6817         (alpha_ecoff_get_relocated_section_contents): Accept a LITERAL
6818         reloc on an "ldl" instruction too.
6819
6820 Tue Feb  8 00:32:28 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
6821
6822         * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub,
6823         hppa_elf_build_long_branch_stub):  Cast to char * instead of int
6824         before performing pointer arithmetic.
6825
6826 Mon Feb  7 20:56:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
6827
6828         * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this
6829         configuration.
6830         (hppa*-*-*elf*): This configuration used hppa-elf now.
6831
6832         * som.c: This file is also used for HOST_HPPAOSF.
6833
6834         * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF.
6835
6836         * hosts/hppaosf.h: New host configuration file.
6837
6838         * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as
6839         BSD handles both SOM and ELF object files.
6840
6841         * config/hppaosf.mh (HDEFINES): Delete.  No longer needed.
6842         (RANLIB): Doesn't do anything, define it to be "echo".
6843
6844         * config/hppaosf.mt: New target makefile fragment for a PA running
6845         OSF1.
6846
6847 Mon Feb  7 15:02:06 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6848
6849         * archures.c (enum bfd_architecture): Added bfd_arch_powerpc.
6850         (archures_init_table): If SELECT_ARCHITECTURES is not defined,
6851         added bfd_powerpc_arch.
6852         * bfd-in2.h: Rebuilt.
6853         * cpu-powerpc.c: New file.
6854         * Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c.
6855         Rebuilt dependencies.
6856
6857         * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power
6858         of an SHT_STRTAB section from sh_addr and sh_addralign, rather
6859         than just setting them to zero.
6860
6861 Sun Feb  6 20:04:10 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
6862
6863         * elfcode.h (prep_headers, swap_out_syms): Check for NULL return
6864         from bfd_new_strtab. 
6865         (elf_compute_section_file_positions): Check for false return from
6866         swap_out_syms. 
6867
6868         * linker.c (default_indirect_link_order): Check for NULL return
6869         from bfd_get_relocated_section_contents.
6870
6871         * syms.c: Make example application in doc call xmalloc, not
6872         bfd_xmalloc. 
6873
6874         * aoutx.h (NAME(aout,slurp_symbol_table),
6875         aout_link_get_symbols, NAME(aout,link_hash_table_create)):
6876         * bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs):
6877         * ecoff.c (ecoff_bfd_link_hash_table_create): 
6878         * ecofflink.c (bfd_ecoff_debug_init): 
6879         * format.c (bfd_check_format_matches): 
6880         * linker.c (_bfd_generic_link_hash_table_create): 
6881         (_bfd_generic_final_link): 
6882         * reloc16.c (bfd_coff_reloc16_relax_section): 
6883         (bfd_coff_reloc16_get_relocated_section_contents): 
6884         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): 
6885         * elf32-mips.c (mips_elf_final_link): 
6886         * elfcode.h (bfd_new_strtab): 
6887         (bfd_add_2_to_strtab): 
6888         (elf_slurp_symbol_table): 
6889         (elf_corefile_note): 
6890         * libbfd.c (bfd_zmalloc): 
6891         Use malloc and check the result, instead of bfd_xmalloc.
6892
6893 Sat Feb  5 12:39:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
6894
6895         * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*.
6896
6897 Sat Feb  5 05:32:44 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
6898
6899         * srec.c (srec_write_record):  Put CONST keyword for "src" before
6900         "unsigned", some compilers don't like it after "unsigned".
6901         * libcoff.h, libcoff-in.h (bfd_perform_slip):  Rename "value" to
6902         "val" in prototype declaration because some compilers don't like
6903         arguments whose names are the same as types.
6904
6905 Sat Feb  5 01:14:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6906
6907         * aoutx.h (aout_link_check_ar_symbols): Correct test for whether
6908         object file defines symbol.  Also, if skipping a symbol, skip the
6909         second symbol of a N_WARNING or N_INDR symbol as well.
6910
6911 Fri Feb  4 23:55:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6912
6913         Add basic support for writing RS/6000 XCOFF files.
6914         * coff-rs6000.c (dummy_reloc): Removed.
6915         (rs6000coff_howto_table): Defined XCOFF relocs.
6916         (RTYPE2HOWTO): Defined to use rs6000coff_rtype2howto.
6917         (rs6000coff_rtype2howto): New function.
6918         (coff_bfd_reloc_type_lookup): Defined to use
6919         rs6000coff_reloc_type_lookup. 
6920         (rs6000coff_reloc_type_lookup): New function.
6921         (SELECT_RELOC): Defined to set r_type and r_size fields.
6922         (COFF_LONG_FILENAMES): Defined.
6923         * coffcode.h (combined_entry_type): Changed fix_tag and fix_end
6924         fields to bitfields.  Added fields fix_value and fix_scnlen.
6925         (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than
6926         STYP_INFO for the type of a section named .debug.
6927         (coff_add_missing_symbols): Don't define if RS6000COFF_C.
6928         (coff_write_object_contents): If RS6000COFF_C, don't call
6929         coff_add_missing_symbols.
6930         (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux
6931         entry has type STY_LD change the x_scnlen into a pointer to a
6932         symbol and set fix_scnlen.  Also, for a C_BSTAT symbol, change the
6933         value into a pointer to a symbol and set fix_value.
6934         * libcoff.h: Rebuilt.
6935         * coffgen.c (coff_mangle_symbols): Reindent.  If fix_value is set,
6936         get the symbol offset. Likewise for fix_scnlen.
6937         (string_size): Change type to bfd_size_type.
6938         (debug_string_size, debug_string_section): New static variables.
6939         (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true,
6940         write the symbol name into the .debug section; assume that the
6941         section has already been created with the right size.
6942         (coff_write_symbols): Initialize debug_string_size to 0.  If
6943         bfd_coff_symname_in_debug returns true, don't put symbol name in
6944         usual string table.  After writing out all symbols, if
6945         debug_string_size is not 0, check that it matches the size of the
6946         .debug section.
6947         (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen
6948         fields.  If the string offset is 0, always use an empty string as
6949         the name.
6950         (coff_make_empty_symbol): Zero out the symbol structure.
6951         * reloc.c (bfd_perform_relocation): Work around one gross hack
6952         with another: actually look at the target name to avoid the broken
6953         COFF check.
6954         (bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26,
6955         BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16.
6956         * bfd-in2.h: Rebuilt.
6957
6958 Fri Feb  4 17:28:32 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
6959
6960         * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
6961         (bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
6962         * libbfd-in.h: Define them as macros calling xmalloc and declare
6963         xmalloc. 
6964         * libbfd.h: Rebuilt.
6965
6966 Thu Feb  3 16:49:35 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6967
6968         * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined
6969         symbol has a value in the ECOFF symbol but not in the BFD symbol,
6970         keep the value in the ECOFF symbol.  This helps gas.
6971
6972         * linker.c (_bfd_generic_link_output_symbols,
6973         _bfd_generic_link_write_global_symbol): Don't require that all
6974         references to a common symbol be themselves common symbols.
6975
6976         * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF.
6977
6978 Wed Feb  2 20:37:19 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
6979
6980         * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h,
6981         sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT.
6982         * bfd-in2.h: Rebuilt.
6983
6984 Wed Feb  2 12:30:13 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
6985
6986         * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type
6987         and size correctly.
6988         (coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to
6989         x_csect.x_scnlen.l to match change in coff/internal.h.
6990         (coff_swap_aux_out): Likewise.
6991
6992         * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c
6993         (alpha_ecoff_backend_data): Change casts of aux_in and aux_out
6994         fields to match yesterday's changes.
6995
6996         * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass
6997         in the internal_reloc itself, not the type.
6998         * coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c,
6999         coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed
7000         definition of SELECT_RELOC accordingly.
7001
7002 Tue Feb  1 12:05:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7003
7004         * coffcode.h (bfd_coff_backend_data): Added new arguments to
7005         _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number
7006         and number of aux entries.
7007         (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed
7008         accordingly.
7009         * libcoff.h: Rebuilt.
7010         * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new
7011         arguments.  If RS6000COFF_C, only treat C_EXT and C_HIDEXT
7012         specially if this is the last aux entry.
7013         * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass
7014         new arguments to swap_aux functions.
7015
7016 Sun Jan 30 15:14:36 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
7017
7018         * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros
7019         (only testing for m68k and vax at the moment); do verify that the
7020         preprocessor didn't trash the arch name inside the string version.
7021         Don't print out "pagesize =" line that prevents output from
7022         compiling.  Derive BYTES_IN_WORD and ARCH values from sizeof
7023         results.
7024         * Makefile.in (aout-params.h): Pass gen-aout a dummy target name.
7025         (check, installcheck): Identify directory in "no testsuites"
7026         message.
7027
7028 Sun Jan 30 13:25:28 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7029
7030         * aoutx.h (aout_link_write_symbols): Write out correct value for
7031         object file symbol.
7032
7033 Fri Jan 28 18:34:05 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
7034
7035         * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define
7036         KERNBASE, so hard-code 0x80000000 instead.
7037
7038 Thu Jan 27 13:54:08 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7039
7040         * linker.c (generic_link_add_symbol_list): If symbol is common,
7041         set the BSF_OLD_COMMON flag.
7042
7043 Wed Jan 26 13:47:15 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7044
7045         * format.c (bfd_check_format_matches): Put the new entry in the
7046         correct element of matching_vector.
7047
7048 Tue Jan 25 11:43:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
7049
7050         * som.c, som.h (bfd_som_set_section_attributes,
7051         bfd_som_set_subsection_attributes): Change parameters from char
7052         to int.  Following a prototype with an old-style function definition
7053         in the presence of widened parameters is a GCC-ism not supported
7054         by the HP compiler in ANSI mode.
7055
7056 Tue Jan 25 11:46:46 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7057
7058         * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2.
7059
7060         * hp300hpux.c (MY(write_object_contents)): Write out the symbols
7061         before writing out the relocs, so that the right symbol indices
7062         are used.
7063
7064         * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not
7065         try to overlay the internal carsyms on the external symdefs.  That
7066         can not work if the size of a host pointer is larger than 4 bytes.
7067
7068         * format.c (bfd_check_format_matches): Cast result of
7069         bfd_xmalloc_by_size_t.
7070         * opncls.c (_bfd_new_bfd): Avoid ANSI C prototype.
7071
7072         * archive.c: Reindented to GNU standards.
7073
7074 Mon Jan 24 14:41:23 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7075
7076         * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add
7077         "_bfd_" to function names.
7078         * archive.c (_bfd_create_empty_archive_element_shell),
7079         libbfd-in.h: Change callers.
7080
7081         * libbfd.c (bfd_zmalloc): Renamed from zalloc.
7082         * libbfd.c (bfd_add_to_string_table),
7083         trad-core.c (trad_unix_core_file_p),
7084         targets.c (bfd_target_list),
7085         ptrace-core.c (ptrace_unix_core_file_p),
7086         opncls.c (new_bfd), libbfd-in.h,
7087         ieee.c (ieee_make_empty_symbol),
7088         elf32-hppa.c (hppa_elf_stub_branch_reloc),
7089         (hppa_elf_stub_reloc): Change callers.
7090         * libbfd.h: Regenerated.
7091
7092         * archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name.
7093         (_bfd_get_elt_at_filepos), 
7094         coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h:
7095         Change callers.
7096
7097         * format.c (bfd_check_format_matches), libbfd-in.h, targets.c,
7098         elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector
7099         and default_vector to bfd_default_vector.
7100         * libbfd.h: Regenerated.
7101
7102         * format.c (bfd_check_format_matches): New function.
7103         (bfd_check_format): Call it.
7104         (bfd_matching_formats): Function removed.
7105         * targets.c: Replace the vector added on Jan 21 with a count of
7106         entries in default_vector.
7107         * bfd-in2.h: Regenerated.
7108
7109 Mon Jan 24 12:38:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7110
7111         * coff-alpha.c (alpha_ecoff_object_p): New function.  Set size of
7112         .pdata section based on lnnoptr field, not section header.
7113         (alpha_relocate_section): Don't bother to check if r_symndx >= 0,
7114         since it is unsigned.
7115         (ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than
7116         coff_object_p.
7117         * ecoff.c (ecoff_new_section_hook): Set alignment_power field of
7118         .pdata section to 3.
7119         (ecoff_compute_section_file_positions): Save the size of the
7120         .pdata section in the line_filepos field, and actually align the
7121         .pdata section to an alignment power of 4.
7122         (ecoff_compute_reloc_file_positions): Set output_has_begun after
7123         calling ecoff_compute_section_file_positions.
7124         (ecoff_write_object_contents): Set s_lnnoptr for the .pdata
7125         section from the line_filepos field.  Set vstamp for the optional
7126         header from the vstamp of the symbolic header.
7127         (ecoff_bfd_final_link): Set vstamp of the symbolic header to the
7128         vstamp used by the first object file in the link.
7129
7130         * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align.
7131
7132         * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
7133         for a created common section.
7134         (_bfd_generic_link_add_one_symbol): Likewise.
7135
7136         * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to
7137         get the index of a common section, rather than always using
7138         SHN_COMMON (MIPS has multiple common sections).
7139
7140         * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =).
7141
7142         * bfd/aoutx.h (aout_link_input_section_std,
7143         aout_link_input_section_ext): Pass additional arguments to
7144         reloc_overflow callback.
7145         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents,
7146         alpha_relocat_section): Likewise.
7147         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
7148         * coff-h8500.c (extra_case): Likewise.
7149         * coff-mips.c (mips_relocate_section): Likewise.
7150         * coff-z8k.c (extra_case): Likewise.
7151         * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
7152         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
7153
7154         * bout.c (calljx_callback, callj_callback): Use get_value to get
7155         the symbol value and check for undefined symbols.
7156         (get_value): If the symbol is undefined, look it up in the linker
7157         hash table.
7158         (b_out_get_relocated_section_contents): For PCREL24 and PCREL13
7159         use get_value to get the symbol value and check for undefined
7160         symbols.
7161         * reloc16.c (bfd_coff_reloc16_get_value): If the symbol is
7162         undefined, look it up in the linker hash table.
7163
7164         * aoutx.h (translate_symbol_table): The string index 0 has a
7165         special meaning for normal symbols, but not for dynamic symbols.
7166
7167 Sat Jan 22 12:26:01 1994  Stu Grossman  (grossman at cygnus.com)
7168
7169         * sparclynx.c:  Setup appropriate macros to enable core file
7170         support.
7171
7172 Fri Jan 21 16:25:35 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7173
7174         * targets.c: Add a vector of matching format names.
7175         * format.c (bfd_matching_formats): New function to return it.
7176         (bfd_check_format): Set it.
7177         * bfd-in2.h: Regenerated.
7178
7179         * bfd-in.h: Remove decls of bfd_ec type and error printing functions.
7180         Remove decl of type symclass; wasn't used.
7181         * bfd.c: Document error handling, including code fragments
7182         containing the error decls that were in bfd-in.h.
7183         Remove DEFUNs.
7184         * bfd-in2.h: Regenerated.
7185
7186 Fri Jan 21 14:11:16 1994  Sean Fagan  (sef@cygnus.com)
7187
7188         * nlmcode.h, liblnm.h, nlm32-alpha.c nlm32-i386.c nlm32-sparc.c:
7189         The sparc (and possibly other?) NLM format requires a different
7190         way to write exports, so add a write_export field to the backend
7191         data (and set it to NULL for everything but the sparc).
7192
7193 Fri Jan 21 14:11:16 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
7194
7195         * sunos.c (MY(read_dynamic_relocs)): Compare info->dynrel with NULL,
7196         not (struct external_nlist *) NULL.  info->dynrel is a PTR, not
7197         a struct external_nlist *.
7198
7199 Fri Jan 21 09:29:01 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7200
7201         * bfd.c: Remove error strings for errors removed below.
7202         * aoutx.h (translate_to_native_sym_flags), bfd-in.h (bfd_ec),
7203         oasys.c (oasys_write_sections): Rename
7204         bfd_error_nonrepresentable_section to nonrepresentable_section.
7205         None of the other bfd error names start with "bfd_error".
7206         Remove errors symbol_not_found and no_relocation_info, which seem
7207         to be unused.
7208         * bfd-in2.h: Regenerated.
7209
7210 Fri Jan 21 01:11:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7211
7212         * bfd.c (bfd_get_gp_size): Added support for ELF.
7213
7214         * syms.c (BSF_DYNAMIC): New symbol flag.
7215         (bfd_print_symbol_vandf): Print it.
7216         * bfd-in2.h: Rebuilt.
7217         * libaout.h (struct aout_backend_data): New read_dynamic_symbols
7218         and read_dynamic_relocs fields.
7219         (struct aoutdata): New dynamic_info field.
7220         (obj_aout_dynamic_info): New accessor macro.
7221         * sunos.c (struct sunos_dynamic_info): New structure.
7222         (sunos_read_dynamic_info, MY(read_dynamic_symbols),
7223         MY(read_dynamic_relocs)): New functions to read dynamic symbols
7224         and relocs.
7225         * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
7226         dynamically linked, set SEC_RELOC for both the .text and .data
7227         sections.
7228         (translate_from_native_sym_flags): Don't set BSF_LOCAL for an
7229         undefined symbol.
7230         (translate_symbol_table): New function, split out of
7231         slurp_symbol_table; set the BSF_DYNAMIC flag appropriately.
7232         (NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any.
7233         (NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any.
7234         (NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in
7235         return value.
7236         * aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write
7237         out dynamic symbols or relocs against reloc symbols, since they
7238         are already in the .text section and we wouldn't know where to
7239         write them anyhow.
7240         (sunos4_aout_backend): Initialize read_dynamic_symbols and
7241         read_dynamic_relocs fields.
7242         * aout-target.h (MY(backend_data)): Initialize
7243         read_dynamic_symbols and read_dynamic_relocs fields.
7244
7245 Thu Jan 20 20:57:27 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
7246
7247         * hosts/alphaosf.h (uint64e_type, uint64_type, int64_type): Delete
7248         typedefs, since HOST_64_BIT will take care of defining them in
7249         bfd.h.
7250
7251 Wed Jan 19 17:28:59 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
7252
7253         * config/alphaosf.mh (HDEFINES): Don't define HOST_64_BIT here;
7254         that's dealt with elsewhere.
7255         * hosts/alphaosf.h (sprintf_vma, fprintf_vma): New macros.
7256         (uint64_typeHIGH, uint64_typeLOW): Comment with HOST_64_BIT so
7257         they get copied to bfd.h.
7258
7259         * reloc.c (enum bfd_reloc_code_real): Add some Alpha relocation
7260         types.  Reorganized some of the existing ones.
7261         * coff-alpha.c (alpha_howto_table): Construct 64-bit negative one
7262         values in case of compilation on a 32-bit machine.  Fix pcrel
7263         fields of some reloc types.
7264         (alpha_bfd_reloc_type_lookup): Handle more relocation types.
7265
7266         * bfd-in.h (uint64_typeHIGH, uint64_typeLOW): Supply default
7267         definitions when not defined, regardless of whether uint64_type is
7268         a defined macro or not.
7269         (fprintf_vma, sprintf_vma): Define only if fprintf_vma is not
7270         already defined.
7271
7272 Wed Jan 19 00:02:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7273
7274         * aoutx.h (translate_to_native_sym_flags): Set the type of a
7275         BSF_WARNING symbol to N_WARNING.
7276
7277 Tue Jan 18 16:43:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7278
7279         * aoutx.h (aout_link_add_symbols): Increment sym_hash as well as p
7280         for an indirect or warning symbol.
7281         (aout_link_write_symbols): Update sym_hash with the target of an
7282         indirect or warning symbol.  If an indirect symbol is defined,
7283         output the calculated value and don't output the target symbol.
7284
7285 Tue Jan 18 03:54:59 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7286
7287         * aoutx.h (translate_from_native_sym_flags): Give warning symbols
7288         an (unused) nonzero section value, needed for check below.
7289
7290 Mon Jan 17 15:12:07 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7291
7292         * aoutx.h (translate_from_native_sym_flags,
7293         aout_link_add_symbols): Treat N_SET[ABDT] | N_EXT like
7294         N_SET[ABDT].
7295
7296 Fri Jan 14 16:45:43 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7297
7298         * elfcode.h (elf_object_p): If there is a SHT_DYNAMIC section, set
7299         the DYNAMIC flag for the BFD.
7300         (NAME(bfd_elf,write_object_contents)): Don't try to write out a
7301         BFD with the DYNAMIC flag set, since we don't generate the program
7302         header table correctly.
7303
7304 Fri Jan 14 01:04:36 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
7305
7306         * elfcode.h (elf_slurp_symbol_table):  Free x_symp at the end
7307         of the function to avoid storage leak.
7308
7309 Thu Jan 13 23:07:32 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7310
7311         * ecoff.c (ecoff_link_write_external): An ifd can be -1.
7312
7313 Thu Jan 13 12:33:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
7314
7315         * som.c (som_set_reloc_info): Provide a default symbol for
7316         relocations which don't actually have an associated symbol.
7317
7318         * som.c (hppa_som_reloc): Add new "error message" argument.
7319
7320 Wed Jan 12 13:36:43 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
7321
7322         Enable gdb to write to core files on more core file readers.
7323         * libbfd.c (bfd_generic_set_section_contents):  Remove range check
7324         for section size, it is already done in bfd_set_section_contents
7325         with bfd_get_section_size_now.
7326         * aix386-core.c, hppabsd-core.c, hpux-core.c, irix-core.c,
7327         osf-core.c, ptrace-core.c, trad-core.c (*_set_section_contents):
7328         Use bfd_generic_set_section_contents instead of bfd_false.
7329
7330 Wed Jan 12 15:31:57 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7331
7332         * linker.c: Added initial documentation.
7333
7334         * linker.c (default_indirect_link_order): Don't expect space for
7335         output relocations if there aren't any input relocations.
7336
7337 Tue Jan 11 14:37:12 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7338
7339         * aoutx.h (NAME(aout,final_link)): Set a_entry before computing
7340         file offsets.
7341
7342         * elfcode.h (swap_out_syms): A common symbol is STT_OBJECT, not
7343         STT_NOTYPE.
7344
7345 Tue Jan 11 09:10:56 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
7346
7347         * config.bfd: Use ELF, not COFF for m88*-*-dgux*.
7348         Combine m88k-*-* and m88110-*-* cases into m88*-*-*.
7349
7350 Tue Jan 11 00:07:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7351
7352         * ecofflink.c: Extensive changes to compress and merge debugging
7353         information, and to write some of out directly rather than saving
7354         it in memory.  Several new functions and structures, and new
7355         arguments to existing functions.
7356         * ecoff.c (ecoff_compute_reloc_file_positions): Compute
7357         sym_filepos as well.
7358         (ecoff_get_extr): Use ifdmap instead of ifdbase.
7359         (ecoff_write_object_contents): Don't compute sym_filepos here.
7360         Only output symbols if outsymbols is not NULL.
7361         (ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and
7362         bfd_ecoff_debug functions.  Write out debugging information here.
7363         (ecoff_final_link_debug_accumulate): Adjust for changes in
7364         bfd_ecoff_debug functions.
7365         (ecoff_link_write_external): Use ifdmap rather than ifdbase.
7366         * elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols
7367         first, to put them in the first memory buffer.  Clear fdr field.
7368         (mips_elf_get_extr): Use pointer to unswapped external symbol.
7369         (mips_elf_final_link): Adjust for changes in bfd_ecoff functions.
7370         Preserve .text, .data and .bss even if they are empty.  Save
7371         pointer to unswapped external symbol rather than copying it.
7372         Don't free up the external symbols.
7373         * libelf.h (elf_symbol_type): Change mips_extr to PTR.
7374         * bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare.
7375         (bfd_ecoff_debug_accumulate): Update declaration.
7376         (bfd_ecoff_debug_accumulate_other): Rename declaration from
7377         bfd_ecoff_debug_link_other and update.
7378         (bfd_ecoff_write_accumulated_debug): Declare.
7379         * bfd-in2.h: Rebuilt.
7380         * Makefile.in: Rebuilt dependencies.
7381
7382 Mon Jan 10 20:46:53 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
7383
7384         * Makefile.in (install): Remove "@" which follows a backslash.  In
7385         this position it just causes errors, not suppresses echoes.
7386
7387 Mon Jan 10 09:06:21 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
7388
7389         * som.c (hppa_som_gen_reloc_type): Fix handling of LT and RT
7390         field selectors.
7391
7392 Sun Jan  9 04:32:25 1994  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
7393
7394         * config/i386-netbsd.mt (SELECT_VECS): Include i386bsd_vec.
7395
7396 Fri Jan  7 10:27:27 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
7397
7398         * aoutx.h (adjust_z_magic): Don't merge the start of bss with the
7399         end of data if they are not contiguous.
7400
7401         * aoutf1.h (sunos4_aout_backend): Comment the fields' meanings.
7402
7403 Fri Jan  7 15:40:16 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7404
7405         * ecoff.c (ecoff_mkobject_hook): Don't set SEC_SHARED_LIBRARY flag
7406         for .reginfo section here.
7407         (ecoff_new_section_hook): Set it here instead.
7408
7409 Fri Jan  7 10:29:27 1994  Stan Shebs  (shebs@andros.cygnus.com)
7410
7411         * bfd-in.h: (bfd_boolean): Add workaround for systems that also
7412         define true and false as enums.
7413         (ALMOST_STDC): Add as alternative to __STDC__.
7414         * bfd-in2.h: Rebuilt.
7415         * syms.c (bfd_print_symbol_vandf): Convert a PTR to FILE*.
7416
7417 Thu Jan  6 14:24:44 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7418
7419         * aoutx.h (translate_to_native_sym_flags): Catch the case where
7420         there is no output section.
7421
7422 Thu Jan  6 14:37:42 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7423
7424         * nlmcode.h (nlm_object_p): If we can't read the fixed header,
7425         count it as a wrong format error, not a system call error, since
7426         the object file might simply be too small.
7427
7428         * targets.c (target_vector): Added nlm32_alpha_vec inside #ifdef
7429         BFD64.
7430         * Makefile.in (BFD32_BACKENDS): Remove nlm32-alpha.o.
7431         (BFD64_BACKENDS): Add nlm32-alpha.o.  It depends on 64 bit
7432         support, even though it is for an Alpha in 32 bit mode.
7433         * configure.in (nlm32_alpha_vec): Set target64 to true.
7434
7435         * nlm32-gen.c, nlm64-gen.c: Removed.  All nlm targets are
7436         different, so there is no point to providing a generic one.
7437         * libnlm.h: Don't bother to check for nlm_backend(bfd) being NULL
7438         in the backend accessor macros; that should no longer be possible.
7439         * targets.c (target_vector): Removed nlm32_big_generic_vec,
7440         nlm64_big_generic_vec, nlm64_little_generic_vec.
7441         * configure.in (nlm32_big_generic_vec, nlm32_little_generic_vec,
7442         nlm64_big_generic_vec, nlm64_little_generic_vec): Removed.
7443         * Makefile.in: Rebuilt dependencies, and
7444         (BFD32_BACKENDS): Removed nlm32-gen.o.
7445         (BFD64_BACKENDS): Removed nlm64-gen.o.
7446         (CFILES): Removed nlm32-gen.c and nlm64-gen.c.
7447
7448         * hp300hpux.c (ARCH_SIZE): Define before including aoutx.h.
7449
7450         * linker.c (_bfd_generic_link_add_one_symbol): Add constructor and
7451         bitsize arguments.  Changed all callers (aoutx.h).
7452         * libbfd-in.h (_bfd_generic_link_add_one_symbol): Add constructor
7453         and bitsize arguments to declaration.
7454         * libbfd.h: Rebuilt.
7455
7456         * ecoff.c: First cut at new style of linker backend for
7457         ECOFF--added a bunch of functions.  Also:
7458         (ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata.
7459         (ecoff_slurp_symbolic_header): New function.
7460         (ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header.
7461         (ecoff_compute_reloc_file_positions): New function.
7462         (ecoff_set_section_contents): Get out quickly if count is zero.
7463         Check errors better.
7464         (ecoff_write_object_contents): Put .xdata section in data segment.
7465         Call ecoff_compute_reloc_file_positions.  Don't output relocs or
7466         external symbols if outsymbols is NULL.
7467         (ecoff_bfd_final_link): Completely rewritten.
7468         * libecoff.h: Include bfdlink.h.
7469         (struct ecoff_backend_data): Add relocate_section field.
7470         (ecoff_data_type): Add sym_hashes and symndx_to_section fields.
7471         (struct ecoff_link_hash_entry): Define.
7472         (struct ecoff_link_hash_table): Define.
7473         (ecoff_bfd_link_add_symbols): Declare as function, not macro.
7474         (ecoff_bfd_link_hash_table_create): Likewise.
7475         * ecofflink.c (bfd_ecoff_debug_one_external): New function.
7476         (bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external.
7477         * bfd-in.h (bfd_ecoff_debug_one_external): Declare.
7478         * bfd-in2.h: Rebuilt.
7479         * coff-alpha.c (alpha_howto_table): Mark BRADDR as
7480         partial_inplace, and set the src_mask to 0x1fffff.
7481         (alpha_ecoff_get_relocated_section_contents): Remove unused
7482         variable gp_warned.
7483         (alpha_convert_external_reloc): New static function.
7484         (alpha_relocate_section): New static function.
7485         (alpha_ecoff_backend_data): Initialize relocate_section field.
7486         * coff-mips.c (mips_relocate_refhi): New static function.
7487         (mips_relocate_section): New static function.
7488         (mips_ecoff_backend_data): Initialize relocate_section field.
7489
7490         * reloc.c (_bfd_relocate_contents): Corrected signed overflow
7491         checking when there is an addend.
7492
7493         * aoutx.h (NAME(aout,final_link)): Don't abort when trying to link
7494         a non a.out file, just pass it to _bfd_default_link_order.
7495         (aout_link_input_section_std): When doing a final PC relative link
7496         against a section symbol, subtract the VMA of the input section.
7497         (aout_link_input_section_ext): Likewise.
7498
7499         * linker.c (default_indirect_link_order): Renamed from
7500         _bfd_generic_indirect_link_order and made static.
7501         (_bfd_generic_final_link): Don't switch on link_order type, just
7502         call _bfd_default_link_order.
7503         (_bfd_default_link_order): Handle bfd_indirect_link_order type.
7504         * genlink.h: Removed declaration of
7505         _bfd_generic_indirect_link_order.
7506         * elf32-mips.c (mips_elf_final_link): Don't switch on link_order
7507         type, just call _bfd_default_link_order.
7508
7509 Tue Jan  4 21:23:37 1994  Ian Lance Taylor  (ian@cygnus.com)
7510
7511         * linker.c (generic_link_check_archive_element): Base the name of
7512         the created common section on the name of the section the symbol
7513         came from.
7514         (_bfd_generic_link_add_one_symbol): (case BIG): A common symbol
7515         must have a section, so don't bother to create one.
7516
7517 Mon Jan  3 15:32:16 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7518
7519         * aout-target.h (MY(vec)): Add DYNAMIC to mask of object flags.
7520         * aoutf1.h (NAME(aout,sunos4_write_object_contents)):
7521         If the DYNAMIC flag is set, set it in the exec header.
7522         * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
7523         dynamically linked, set the DYNAMIC flag in the BFD.
7524         * libaout.h (N_SET_DYNAMIC): New macro.
7525         (N_DYNAMIC): Add missing 0 in mask.
7526
7527 Mon Jan  3 11:41:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7528
7529         * ecoff.c (ecoff_get_extr): Don't output section symbols as
7530         external symbols.
7531
7532         * bfd-in.h, hash.c: Change bfd_hash_allocate argument from size_t
7533         to unsigned int, because size_t may not be defined in bfd.h.
7534         * bfd-in2.h: Rebuilt.
7535
7536         * bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
7537         be a const pointer.
7538         * bfd-in2.h: Rebuilt.
7539         * libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
7540         be a const pointer.
7541         * targets.c (bfd_target): Change swap function pointers
7542         accordingly.
7543         * archive.c (do_slurp_coff_armap): Change swap accordingly.
7544         * aix386-core.c: Change NO_GET and NO_GETS accordingly.
7545         * hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
7546         ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
7547         accordingly.
7548
7549         * libbfd-in.h (struct artdata): Added tdata field.
7550         (_bfd_add_bfd_to_archive_cache): Declare.
7551         (_bfd_get_elt_at_filepos): Declare.
7552         (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
7553         * libbfd.h: Rebuilt.
7554         * archive.c: Cleaned up some more.
7555         (_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize
7556         pointer elements of artdata.
7557         (_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache.
7558         (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
7559         (_bfd_get_elt_at_filepos): Renamed from get_elt_at_filepos.
7560         (get_extended_arelt_filename, bfd_construct_extended_name_table,
7561         bfd_ar_hdr_from_filesystem, compute_and_write_armap): Made static.
7562         * ecoff.c: Some comment changes.
7563         (ecoff_slurp_armap): Handle rename of snarf_ar_hdr.  Set
7564         ardata->tdata to raw_armap.
7565         (ecoff_archive_p): Initialize pointer elements of artdata.
7566         * coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of
7567         add_bfd_to_cache.
7568
7569         * hash.c: Added some documentation.
7570
7571 Mon Jan  3 11:09:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
7572
7573         * aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC,
7574         and do the swapping here rather than calling ntohl from the N_*
7575         macros.  This cleans up assumptions about the size of a host long,
7576         the existence to ntohl, etc.
7577
7578 Sat Jan  1 13:50:05 1994  Rob Savoye  (rob@darkstar.cygnus.com)
7579
7580         * config.bfd: Add support for VSTa micro-kernel. It currently uses
7581         i386-aout.
7582
7583 Sat Jan  1 10:18:54 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
7584
7585         * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value.
7586         * i386mach3.c (SEGMENT_SIZE): Fix value.
7587
7588 Fri Dec 31 16:23:43 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7589
7590         Minor cleanups suggested by CodeCenter.
7591         * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c,
7592         linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as
7593         appropriate.
7594         * aoutx.h (struct external_exec): Removed unnecessary declaration.
7595         (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL.
7596         (adjust_z_magic): Removed useless variable data_vma.
7597         (stringtab_init): Initialize hash_zero.
7598         (add_to_stringtab): Removed unused fourth argument.
7599         (NAME(aout,swap_std_reloc_out)): Removed useless variable
7600         r_addend.
7601         (aout_link_input_section): Added some casts.
7602         * archive.c (get_extended_arelt_filename, do_slurp_coff_armap,
7603         bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap):
7604         Minor code rewriting to make it more C like.
7605         (do_slurp_bsd_armap): Added some casts.
7606         * ecoff.c (ecoff_write_object_contents): Removed useless variable
7607         scn_base.
7608         (ecoff_write_armap): Added some casts.  Use "" rather than "\0".
7609         * ecofflink.c (bfd_ecoff_write_debug): Added a cast.
7610         * libaout.h (struct internal_exec): Removed unnecessary
7611         declaration.
7612         * linker.c (_bfd_generic_indirect_link_order): Added a cast.
7613         * opncls.c (new_bfd): Removed a cast.
7614         * reloc.c (bfd_generic_get_relocated_section_contents): Added
7615         some casts.
7616         * srec.c (internal_srec_write_object_contents): Removed useless
7617         variable bytes_written.
7618
7619 Fri Dec 31 11:46:13 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
7620
7621         * i386mach3.c (N_TXTADDR): Don't define after all.
7622         (TEXT_START_ADDR): Don't include exec header size in value.
7623
7624 Thu Dec 30 15:47:54 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
7625
7626         * i386mach3.c (N_TXTADDR): Define.
7627
7628 Thu Dec 30 13:37:24 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7629
7630         Extensive changes to move the bulk of the linker into BFD so that
7631         more efficient backend code can be written for specific object
7632         files.  Only existing efficient backend is a.out.
7633         * seclet.c, seclet.h: Removed.
7634         * hash.c, linker.c, genlink.h: New files.
7635         * bfd-in.h: Removed bfd_error_vector.  Declared hash table
7636         structures and functions.
7637         (JUMP_TABLE): Removed bfd_seclet_link, added
7638         bfd_link_hash_table_create, bfd_link_add_symbols and
7639         bfd_final_link.
7640         * All backends: Changed accordingly.
7641         * bfd-in2.h: Rebuilt.
7642         * bfd.c (struct _bfd): Added link_next and archive_pass fields.
7643         Removed ld_symbols field.
7644         (bfd_nonrepresentable_section, bfd_undefined_symbol,
7645         bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
7646         bfd_error_vector): Removed.
7647         (bfd_default_error_trap, bfd_error_trap,
7648         bfd_error_nonrepresentabltrap): Removed.
7649         (bfd_get_relocated_section_contents): Pass link_info.  Pass
7650         link_order instead of seclet.  Pass symbols.
7651         (bfd_relax_section): Pass link_info.
7652         (bfd_seclet_link): Removed.
7653         (bfd_link_hash_table_create, bfd_link_add_symbols,
7654         bfd_final_link): New macros.
7655         * libbfd-in.h: If __GNUC__ is defined and alloca is not, define
7656         alloca as __builtin_alloca.  Declare internal linking functions.
7657         * libbfd.h: Rebuilt.
7658         * libbfd.c (bfd_seek): Comment out fseek assertion.  It's worked
7659         for months.
7660         * reloc.c (reloc_howto_type): Added error_message argument to
7661         special_function field.  Changed all callers and all definitions.
7662         (bfd_get_reloc_size): Make argument a const pointer.
7663         (bfd_perform_relocation): Add error_message argument to hold
7664         string set if return value if bfd_reloc_dangerous.  Changed all
7665         callers.
7666         (_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
7667         * section.c (asection): Renamed seclets_head and seclets_tail to
7668         link_order_head and link_order_tail.
7669         * targets.c (bfd_target): Replaced seclet argument with link_info
7670         and link_order and symbols arguments in
7671         bfd_get_relocated_section_contents.  Added symbols argument to
7672         bfd_relax_section.  Removed bfd_seclet_link.  Added
7673         bfd_link_hash_table_create, bfd_link_add_symbols and
7674         bfd_final_link.
7675         * libaout.h (struct aoutdata): Added external_syms,
7676         external_sym_count, external_strings, sym_hashes fields.
7677         (obj_aout_external_syms, obj_aout_external_sym_count,
7678         obj_aout_external_strings, obj_aout_sym_hashes): New accessor
7679         macros.
7680         (WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
7681         * aoutx.h: Wrote new back end linker routines.
7682         (translate_to_native_sym_flags): Return boolean value.  Don't use
7683         bfd_error_vector.
7684         (NAME(aout,write_syms)): Return boolean value.  Check return value
7685         of translate_to_native_sym_flags and bfd_write.
7686         * aout-target.h (final_link_callback): New function.
7687         (MY_bfd_final_link): New function.
7688         * aout-adobe.c (aout_adobe_write_object_contents): Check return
7689         value of aout_32_write_syms.
7690         * hp300hpux.c (MY(write_object_contents)): Likewise.
7691         * i386lynx.c (WRITE_HEADERS): Likewise.
7692         * libaout.h (WRITE_HEADERS): Likewise.
7693         * bout.c: Changed functions to use link_info->callbacks rather
7694         than bfd_error_vector, and link_orders rather than seclets.
7695         * coff-alpha.c: Likewise.
7696         * coff-h8300.c: Likewise.
7697         * coff-h8500.c: Likewise.
7698         * coff-sh.c: Likewise.
7699         * coff-z8k.c: Likewise.
7700         * elf32-hppa.c: Likewise.
7701         * reloc16.c: Likewise.
7702         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
7703         up _gp in the hash table rather than in outsymbols.
7704         * coff-a29k.c (a29k_reloc): Pass errors back in new error_message
7705         argument rather than printing them.
7706         * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
7707         link_order arguments rather than seclet.  Changed all uses and
7708         definitions.
7709         (bfd_coff_reloc16_estimate): Pass link_info arguments.  Changed
7710         all uses and definitions.
7711         * libcoff.h: Rebuilt.
7712         * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
7713         not by ECOFF, make it scAbs.
7714         (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
7715         rewritten.
7716         * elf32-mips.c (mips_elf_final_link): Renamed from
7717         mips_elf_seclet_link and rewritten.
7718         * elf32-hppa.c (elf32_hppa_stub_description): Added link_info
7719         field.
7720         (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
7721         hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
7722         Added link_info arguments.  Changed all callers.
7723         * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
7724         not NULL.
7725         * oasys.c (oasys_write_sections): Return boolean value rather than
7726         using bfd_error_vector.
7727         (oasys_write_object_contents): Check return value of
7728         oasys_write_sections.
7729         * hosts/std-host.h: Don't declare qsort or strtol.
7730         * Makefile.in: Rebuild dependencies.
7731         (BFD_LIBS): Removed seclet.o.  Added hash.o and linker.o.
7732         (CFILES): Removed seclet.c.  Added hash.c and linker.c.
7733         (HFILES): Removed seclet.h.  Added genlink.h.
7734
7735 Thu Dec 30 07:41:36 1993  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
7736
7737         * section.c (bfd_get_section_contents):  Return zero filled buffer
7738         if section has no contents.
7739
7740 Tue Dec 28 12:43:54 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7741
7742         * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc,
7743         then skip bfd_perform_relocation even if the addend is non-zero.
7744
7745 Tue Dec 21 09:22:19 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)
7746
7747         * coffcode.h (coff_write_relocs) [SWAP_OUT_RELOC_OFFSET]: Copy
7748         addend to r_offset field.
7749
7750         * Makefile.in (CFILES): Added coff-sparc.c.  Rebuild dependencies.
7751
7752         * coff-sparc.c (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET,
7753         CALC_ADDEND): Define.
7754
7755         * aix386-core.c (aix386_core_file_p): Use cd_regs[0] for computing
7756         the offsetof because AIX /bin/cc does not like to take the address
7757         of an array.  (From Minh Tran-Le.)
7758
7759 Thu Dec 16 13:06:32 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
7760
7761         * Thu Dec 16 15:41:06 1993  Peter Hoogenboom  (hoogen@cs.utah.edu)
7762
7763         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Make sure to copy
7764         the return pointer into %r2 if no jump-in-call-delay-slot
7765         optimization was done.
7766
7767         * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD.
7768
7769 Wed Dec 15 08:04:16 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
7770
7771         * hosts/std-host.h: (time): Don't declare; conflicts on Mach3.
7772
7773         * hosts/i386mach3.h (HOST_PAGE_SIZE): Set to 1 to avoid padding.
7774         (HOST_SEGMENT_SIZE): Set to 0 for same reason.
7775
7776         * i386mach3.c (PAGE_SIZE, SEGMENT_SIZE): Same changes as above.
7777         (TEXT_START_ADDR): Correct.
7778         (MY_backend_data): Define.
7779
7780         * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic):
7781         New functions; code moved from aout_<size>_adjust_sizes_and_vmas.
7782
7783 Tue Dec 14 21:48:33 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
7784
7785         * som.c (som_begin_writing): Fix thinkos in auxiliary header
7786         support.
7787         (bfd_som_attach_aux_hdr): Likewise.
7788
7789 Mon Dec 13 23:34:48 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
7790
7791         * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field
7792         selectors for PIC code.
7793
7794         * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors.
7795         (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL
7796         relocations needed by PIC.
7797
7798 Tue Dec  7 15:47:51 1993  Stu Grossman  (grossman at cygnus.com)
7799
7800         * nlmcode.h:  Fixes to avoid compiler warnings...
7801
7802 Tue Dec  7 15:10:54 1993  Ian Lance Taylor  (ian@cygnus.com)
7803
7804         * libnlm.h (nlm_backend_data): Removed macro definition.
7805         (nlm_alpha_backend_data): Adjusted accordingly.
7806
7807 Sun Dec  5 19:32:08 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
7808
7809         * som.c (som_begin_writing): Flesh out code for handling simple
7810         auxiliary headers.
7811         (bfd_som_attach_aux_hdr): New function.
7812
7813         * som.h (struct somdata): Add fields for attaching version and
7814         copyright headers.  Add accessor macros.
7815
7816         * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected
7817         definitions for old versions of HPUX which fail to define them.
7818         (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT
7819         now that they're safe.  Delete bogus R_STATEMENT relocations.
7820
7821         * som.c (som_hppa_howto_table): Add missing R_END_TRY.  Delete 
7822         extra R_DATA_OVERRIDE.
7823         (hppa_som_gen_reloc_type): Generate a relocation for the rounding
7824         mode selector if needed.
7825         (som_write_fixups): Handle requests for a change in the default
7826         rounding mode.  Rounding modes do not consume input bytes, but
7827         are just markers much like R_ENTRY and R_EXIT.
7828
7829 Sat Dec  4 19:40:32 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
7830
7831         Fri Dec  3 09:55:17 1993  Pete Hoogenboom  (hoogen@cs.utah.edu)
7832
7833         * elf32-hppa.c: (hppa_elf_reloc):  Do not do code reordering when
7834         the branch instruction as originally been nullified.
7835         hppa_elf_reloc):  Avoid useless call to bfd_put_32 () in the
7836         case of no code reordering due to an LDO instruction in the
7837         delay slot of the branch.  Make sure to relocate the correct
7838         instruction.  Do not perform instruction reordering for millicode
7839         calls.
7840         (hppa_elf_build_arg_reloc_stub):  Change the relocation type
7841         to R_HPPA_STUB_CALL_17 when special processing might be needed.
7842         (hppa_elf_build_long_branch_stub): Prevent code reordering on
7843         a call from a linker stub to another linker stub and for millicode
7844         calls.  Do not trash the return register for calls from one linker
7845         stub to a second linker stub.
7846
7847         * elf32-hppa.c: (elf_hppa_howto_table):  PLABEL and DLT
7848         relocations are not pc-relative.
7849
7850         * hppa_stubs.h: (BLE_N_XXX_0_31):  New instruction used in
7851         linker stub code. 
7852         (COPY_2_31):  Likewise.
7853
7854 Fri Dec  3 18:40:58 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7855
7856         * config/solaris2.mh (HDEFINES): Remove -Dconst=
7857         * hosts/solaris.h: If not __GNUC__, define const as empty.
7858
7859 Thu Dec  2 15:43:32 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7860
7861         * ecoff.c: Added various casts for 32/64 bit cross targeting.
7862         (ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo
7863         section so that the linker ignores it.
7864         * ecofflink.c: Added various casts for 32/64 bit cross targeting.
7865         (ecoff_add_bytes): Changed need argument to size_t.
7866         (bfd_ecoff_debug_link_other): Check return value of
7867         ecoff_add_string.
7868
7869         * libbfd-in.h (new_bfd): Use void rather than an empty parameter
7870         list.
7871         * libbfd.h: Rebuilt.
7872
7873         * libnlm.h (struct nlm_obj_tdata): New field backend_data.
7874         (nlm_backend_data, nlm_alpha_backend_data): New accessor macros.
7875         (struct nlm_backend_data): New field no_uninitialized_data.
7876         (nlm_no_uninitialized_data): New accessor macro.
7877         * nlmcode.h (nlm_compute_section_file_positions): Handle
7878         no_uninitialized_data.
7879         (nlm_external_reloc_compare): Sort relocs by address for a
7880         particular symbol, to make the sort more stable.
7881         (nlm_write_object_contents): Cast the arguments to qsort.  Get the
7882         value of a debugging symbol the same way we get the value of a
7883         normal symbol.
7884         * nlm32-alpha.c: Various changes.  Write out GP and .lita relocs.
7885         Set no_uninitialized_data to true.
7886         * nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c
7887         (nlm32_sparc_backend): Set no_uninitialized_data field false.
7888         * nlmswap.h (nlm_swap_fixed_header_out): Zero out destination
7889         before filling it in.
7890
7891 Wed Dec  1 21:47:58 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
7892
7893         * som.c (som_section_type, som_decode_symcalss): New functions.
7894         (som_get_symbol_info): Use them.
7895         (som_slurp_symbol_table): Set the section of common and undefined
7896         symbols correctly.
7897
7898 Wed Dec  1 14:15:10 1993  Ken Raeburn  (raeburn@cygnus.com)
7899
7900         * elfcode.h (write_relocs): Initialize local var LAST_SYM_IDX, to
7901         make gcc happy.
7902
7903         * mipsbsd.c: Changes from Ralph Campbell:
7904         (mips_howto_table_ext): MIPS_RELOC_LO16 should use
7905         complain_overflow_dont.
7906         (aout_mips_*_vec): Make name use "a.out" instead of "aout", to
7907         make gdb happy.
7908
7909         * bfd.c (bfd_errmsgs): Reword invalid-target message.
7910
7911         * config.bfd: For sparc*-*-coff, use sparc-coff.
7912         * configure.in: Handle sparccoff_vec.
7913         * targets.c (sparccoff_vec): Declare.
7914
7915         * reloc.c (bfd_get_reloc_size): New function.
7916         (struct reloc_howto_type): Update documentation of size field.
7917
7918 Wed Dec  1 14:39:05 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7919
7920         * nlm32-alpha.c: New file; preliminary Alpha NetWare support.
7921         * config.bfd (alpha-*-netware*): New target; use alpha-nlm.
7922         * config/alpha-nlm.mt: New file.
7923         * configure.in (nlm32_alpha_vec): New vector; use nlm32-alpha.o,
7924         nlm32.o, and nlm.o.
7925         * Makefile.in (BFD32_BACKENDS): Added nlm32-alpha.o.
7926         (CFILES): Added nlm32-alpha.c.
7927         Rebuilt dependencies.
7928         * targets.c (nlm32_alpha_vec): Declare.
7929
7930         * libnlm.h (struct nlm_backend_data): New fields
7931         optional_prefix_size, nlm_backend_object_p, nlm_write_prefix,
7932         nlm_set_public_section, nlm_get_public_offset.  Removed unused
7933         nlm_write_reloc field.  Changed nlm_write_import to remove
7934         unnecessary symbol argument.  Renamed nlm_write_externals to
7935         nlm_write_external, and changed cound argument from bfd_vma to
7936         bfd_size_type.
7937         (nlm_optional_prefix_size, nlm_backend_object_p_func,
7938         nlm_write_prefix_func, nlm_set_public_section_func,
7939         nlm_get_public_offset_func): New accessor macros.
7940         (nlm_write_reloc_func): Removed.
7941         (nlm_write_external_func): Adjusted for field renaming.
7942         * nlm32-i386.c (nlm_i386_write_import): Renamed from
7943         nlm_i386_write_reloc.  Removed old nlm_i386_write_import which
7944         just called old nlm_i386_write_reloc.
7945         (nlm_i386_write_external): Renamed from nlm_i386_write_externals.
7946         Declared.  Changed second argument from bfd_vma to bfd_size_type.
7947         (nlm32_i386_backend): Adjusted for changes to fields and names.
7948         * nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused,
7949         ifdeffed out code.
7950         (nlm_sparc_write_import): Removed second argument.
7951         (nlm_sparc_write_external): Renamed from
7952         nlm_sparc_write_externals.  Changed second argument from bfd_vma
7953         to bfd_size_type.
7954         (nlm32_sparc_backend): Adjusted for changes to fields and names.
7955         * nlmcode.h: Removed some unused code.
7956         (nlm_object_p): Don't destroy tdata pointer.  Call
7957         backend_object_p function if it exists.
7958         (nlm_slurp_symbol_table): Removed unused variable rcount.  Call
7959         set_public_section_func if it exists instead of checking
7960         NLM_HIBIT.
7961         (nlm_compute_section_file_positions): Account for
7962         optional_prefix_size.
7963         (nlm_write_object_contents): Account for optional_prefix_size.
7964         Removed useless variable write_reloc_func.  Changed declaration
7965         and call of write_import_func.  Call write_prefix_func if it
7966         exists.  Removed unused variables len and temp.  Call
7967         get_public_offset_func if it exists rather than setting NLM_HIBIT.
7968         * nlmswap.h: Declare functions.
7969
7970         * bfd-in.h (uint64_typeLOW, uint64_typeHIGH): Fully parenthesize
7971         for clarity.
7972         (fprintf_vma, sprintf_vma): Use %lx, not %x.
7973         * bfd-in2.h: Rebuilt.
7974         * hosts/alphaosf.h (uint64_typeLOW, uint64_typeHIGH): Cast results
7975         to unsigned long.
7976
7977         * config.bfd: Don't set target64 here, as the setting is ignored.
7978         * configure.in (ecoffalpha_little_vec): Set target64.
7979
7980         * config/alphaosf.mt (TDEFINES): Removed; setting host parameters
7981         in TDEFINES is wrong.
7982
7983         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
7984         Remove unused variable output_section.
7985
7986 Tue Nov 30 16:45:23 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
7987
7988         * irix-core.c: New file for Irix 4 and Irix 5 core support.
7989         Functions taken out of coff-mips.c.  Handle vmap type VMAPFILE.
7990         * coff-mips.c: Irix 4 core file support moved to irix-core.c.
7991         * targets.c: If IRIX_CORE defined, include irix_core_vec in
7992         target_vector.
7993         * config/irix4.mh (HDEFINES): Add -DIRIX_CORE.
7994         (HDEPFILES): Define to be irix-core.o.
7995         * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE.
7996         (HDEPFILES): Define to be irix-core.o.
7997         * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o.  Removed
7998         sco-core.o, which no longer exists.
7999         (CFILES): Added all *-core.c files.
8000         Rebuilt dependencies.
8001
8002 Wed Nov 24 02:02:41 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8003
8004         * elfcode.h (map_program_segments): Restore check of file_size !=
8005         mem_size, but only if SHT_PROGBITS.
8006
8007         * ecofflink.c: New file to hold ECOFF debug information linking
8008         routines.
8009         * ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
8010         ecoff_add_string, ecoff_get_debug): Removed.  Functionality now in
8011         ecofflink.c.
8012         (ecoff_get_extr, ecoff_set_index): New functions.
8013         (ecoff_slurp_symbolic_info): Don't save raw_size.
8014         (ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
8015         (ecoff_compute_section_file_positions): Don't set EXEC_P just
8016         because there is a start address.
8017         (ecoff_write_object_contents): Handle external symbols here.  Use
8018         ecofflink.c functions to write out debugging information.
8019         * elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
8020         mips_elf_set_index): New functions.
8021         (mips_elf_seclet_link): Discard empty sections, the .options
8022         section and .gptab sections.  Handle linking .mdebug section.
8023         * libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
8024         * libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
8025         * bfd-in.h: Added prototypes for routines in ecofflink.c (some are
8026         called by gas, so they are public).
8027         * bfd-in2.h: Rebuilt.
8028         * Makefile.in (BFD_LIBS): Added ecofflink.o.
8029         (CFILES): Added ecofflink.c.
8030         (ecofflink.o): New target.  Rebuilt dependencies.
8031
8032 Mon Nov 22 22:26:42 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8033
8034         * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as
8035         a valid magic number if it's been defined.
8036
8037 Mon Nov 22 14:17:36 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8038
8039         * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker
8040         no longer requires it.
8041         (ecoff_bfd_seclet_link, ecoff_sizeof_headers,
8042         ecoff_write_object_contents): Don't treat .scommon section
8043         specially.
8044
8045 Mon Nov 22 10:54:27 1993  Fred Fish  (fnf@cygnus.com)
8046
8047         Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner):
8048         * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
8049         * bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
8050         * bfd/ptrace-core.c:  New file for dealing with core files with
8051         start with the ptrace_user structure found on BCS compliant systems.
8052         * bfd/targets.c (ptrace_core_vec):  New vector.
8053
8054 Mon Nov 22 02:33:12 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8055
8056         * Minimal support for reading SOM fixup streams.  Allows
8057         objdump -r to do something reasonable.
8058         * som.c (som_get_reloc_upper_bound): Implement.
8059         (som_canonicalize_reloc): Implement.
8060         (som_set_reloc_info, som_slurp_reloc_table): New functions.
8061
8062 Sun Nov 21 13:46:55 1993  Ken Raeburn  (raeburn@cambridge.cygnus.com)
8063
8064         * hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define.
8065         * hosts/sparclynx.h: Include lynx.h instead of duplicating it.
8066
8067 Fri Nov 19 14:34:04 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8068
8069         * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift
8070         signed_value before sign extending it.  Don't subtract out
8071         reloc_entry->address.  This makes it compatible with what gas is
8072         generating.
8073
8074         * elfcode.h (elf_fake_sections): Accept .sbss as the name for a
8075         SHT_NOBITS sections.
8076         (map_program_segments): Don't leave the loop after the first
8077         SHT_NOBITS section.
8078         (assign_file_positions_except_relocs): Only force sh_offset and
8079         sh_addr to match modulo maxpagesize for a section which is not
8080         SHT_NOBITS.  Changed the method used to force page alignment after
8081         a SHT_NOBITS section to only do it for the last such consecutive
8082         section, and to really force page alignment.
8083
8084 Fri Nov 19 04:02:01 1993  Ken Raeburn  (raeburn@cambridge.cygnus.com)
8085
8086         * coffcode.h (coff_slurp_symbol_table): Print more verbose message
8087         in the case of an unknown (or unhandled) storage class.
8088
8089         * config/i386-lynx.mt (TDEFINES): FPRINTF_ALREADY_DECLARED should
8090         not be defined here, since it is a host attribute, not a target
8091         one.
8092         * config/m68k-lynx.mt, config/sparc-lynx.mt: Ditto.
8093
8094         * coffcode.h (coff_bfd_reloc_type_lookup): Don't define if already
8095         defined.
8096
8097         * coff-sparc.c: Define some relocations, based on ELF relocations.
8098         (enum reloc_type, bfd_coff_generic_reloc, coff_sparc_howto_table,
8099         struct coff_reloc_map, sparc_reloc_map,
8100         coff_sparc_reloc_type_lookup): Borrowed from elf32-sparc.c and
8101         elf.c, renamed.
8102         (coff_bfd_reloc_type_lookup): Define to be coff_sparc_reloc_....
8103         (rtype2howto): Index into coff_sparc_howto_table using
8104         dst->r_type.
8105
8106 Thu Nov 18 11:45:39 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8107
8108         * config.bfd (mips*-*-irix5*): New target; use mipsbelf.
8109         * configure.host (mips-sgi-irix5*) New host; use irix5 (no
8110         hosts/irix5.h created; just use std-host.h).
8111         * config/irix5.mh: New file; like irix4.mh, but don't use -G or
8112         -lmalloc.
8113         * Makefile.in: Rebuilt dependencies.
8114
8115         * ecoffswap.h: Changed type of internal pointers for swap out
8116         functions to const *.
8117
8118         * elf32-mips.c (mips_elf_got16_reloc): New function.  Handle GOT16
8119         correctly for assembler, but linker support not implemented.
8120         (elf_mips_howto_table): Use mips_elf_got16_reloc for GOT16.
8121         (mips_elf_sym_is_global): New function; at least on Irix 5, all
8122         non section symbols are considered global.
8123         (elf_backend_sym_is_global): Define.
8124         (mips_elf_final_write_processing): New function.  Set the MIPS
8125         architecture level correctly.
8126         (elf_backend_final_write_processing): Define.
8127         (mips_elf_section_from_shdr): Handle SHT_MIPS_OPTIONS.
8128         (mips_elf_fake_sections): Set entsize of .mdebug or .reginfo
8129         section to 1.  Handle .options section.
8130         (mips_elf_acom_section, mips_elf_acom_symbol,
8131         mips_elf_acom_symbol_ptr): New static variables, used to build a
8132         generic .acommon section to hold SHN_MIPS_ACOMMON symbols.
8133         (mips_elf_symbol_processing): Handle SHN_MIPS_ACOMMON symbols by
8134         putting them all in a global .acommon section.
8135
8136         * elfcode.h (bfd_section_from_shdr): Don't dump core if target
8137         section has no ELF section data.
8138         (elf_make_sections): Set addralign of reloc section to 4.
8139         (elf_fake_sections): Likewise.
8140         (map_program_segments): Don't consider section 0.
8141         (assign_file_positions_except_relocs): Don't consider section 0.
8142         In the main loop, skip the symtab and strtab sections, since their
8143         positions are set elsewhere.
8144         (swap_out_syms): Set addralign of symtab section to 4.  Set
8145         addralign of strtab sections to 1.
8146         (assign_file_positions_for_relocs): Don't consider section 0.
8147         (write_object_contents): Don't write out section 0.
8148
8149         * libelf.h (struct elf_backend_data): Added fields
8150         elf_backend_sym_is_global and elf_backend_final_write_processing.
8151         * elf32-target.h (elf32_bed): Added corresponding initializers.
8152         * elf64-target.h (elf64_bed): Likewise.
8153         * elfcode.h (sym_is_global): Take abfd argument.  Call
8154         elf_backend_sym_is_global if it is not NULL.
8155         (elf_map_symbols): Pass abfd to sym_is_global.
8156         (write_object_contents): Call elf_backend_final_write_processing
8157         if it is defined.
8158
8159 Wed Nov 17 18:43:28 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8160
8161         * libecoff.h: Include coff/ecoff.h.
8162         (struct ecoff_backend_data): Move external debugging information
8163         fields into a single field pointing to an ecoff_debug_swap
8164         structure.
8165         (ecoff_data_type): Move debugging information fields into a single
8166         field pointing to an ecoff_debug_info structure.
8167         * coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes.
8168
8169 Wed Nov 17 17:38:58 1993  Sean Eric Fagan  (sef@cygnus.com)
8170
8171         * nlmswap.h: New file to swap fixed header.  Included by NLM
8172         backends.
8173         * libnlm.h (struct reloc_and_sec): Define.
8174         (struct nlm_backend_data): Add fields fixed_header_size,
8175         nlm_read_import, nlm_write_import, nlm_swap_fhdr_in,
8176         nlm_swap_fhdr_out.
8177         (nlm_fixed_header_size, nlm_read_import_func,
8178         nlm_write_import_func, nlm_swap_fixed_header_in_func,
8179         nlm_swap_fixed_header_out_func, nlm_write_external_func): New
8180         accessor macros.
8181         * nlmcode.h: Use new functions.
8182         * nlm32-i386.c: Provide new functions.
8183         * nlm32-sparc.c: New file; SPARC NLM backend.
8184
8185 Wed Nov 17 13:56:10 1993  Stan Shebs  (shebs@rtl.cygnus.com)
8186
8187         * i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore
8188         garbage bits appearing in the upper end of symbolnums.
8189
8190         * config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED.
8191
8192 Tue Nov 16 17:03:41 1993  Stu Grossman  (grossman at cygnus.com)
8193
8194         * lynx-core.c (lynx_core_file_p):  Change bfd_zalloc to bfd_alloc.
8195         * m68klynx.c:  Define core file macros.
8196         * hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h:  Move all
8197         non-architecture specific stuff into lynx.h.
8198
8199 Tue Nov 16 15:45:54 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
8200
8201         * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and
8202         change PAGE_SIZE to 4096.
8203
8204 Mon Nov 15 11:48:08 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)
8205
8206         * Makefile.in (diststuff): New target.
8207
8208         * VERSION: Updated.
8209
8210 Sun Nov 14 23:33:01 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8211
8212         * som.c (som_object_setup): Do not create dummy ".text", ".data",
8213         and ".bss" sections.
8214         (setup_sections): Do not set SEC_HAS_CONTENTS if a section's size
8215         is zero.  Recognize BSS type sections and turn off SEC_LOAD and
8216         SEC_DATA (so binutils/size works).  Set the correct value for
8217         a section's _raw_size.
8218         (som_slurp_symbol_table): Program entry points, and millicode are
8219         also functions.  Mark them as such.  Also mark L$* symbols as
8220         debugging symbols.
8221
8222         * bfd-in2.h: Rebuilt.
8223
8224 Sat Nov 13 15:27:15 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8225
8226         * som.c (som_bfd_reloc_type_lookup): Add missing prototype.  Returns
8227         a pointer to constant data.  Delete bogus #define which made the 
8228         function useless.
8229
8230         * som.c (som_prep_for_fixups): New function.
8231         (som_write_fixups): New function.
8232         (som_write_space_strings): New function.
8233         (som_write_symbol_strings): New function.
8234         (som_begin_writing): New function.
8235
8236 Fri Nov 12 15:29:36 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8237
8238         * som.c (som_write_object_contents): Do not abort.  Flesh out.
8239         (som_set_section_contents): Do not abort.  Flesh out.
8240
8241         * som.c (som_write_headers): New function.
8242         (som_prep_headers): New function.
8243         (som_build_and_write_symbol_table): New function.
8244
8245         * som.c (som_sizeof_headers): Add missing prototype.
8246         (som_set_arch_mach): Do not abort.
8247
8248         * som.c (som_count_spaces): New function.
8249         (som_count_subspaces): New function.
8250         (compare_syms): New function.
8251         (som_compute_checksum): New function.
8252
8253         * som.c (hppa_som_gen_reloc_type): New function.
8254         (som_bfd_reloc_type_lookup): New function.
8255
8256         * som.c (try_prev_fixup): New function.
8257         (som_reloc_skip): New function.
8258         (som_reloc_addend): New function.
8259         (som_reloc_call): New function.
8260
8261         * som.c (som_initialize_reloc_queue): New function.
8262         (som_reloc_queue_insert): Likewise.
8263         (som_reloc_queue_fix): Likewise.
8264         (som_reloc_queue_find): Likewise.
8265
8266         * som.c (som_hppa_howto_table): SOM howto relocation table.
8267         (hppa_som_reloc): New function.
8268
8269         * som.c (struct reloc_queue): New structure to keep track of
8270         the last four multibyte relocations emitted.
8271         (enum pa_symbol_type): Type to fully describe the symbol types
8272         associated with .import/.export assembler directives.
8273
8274         * som.c: Include libhppa.h
8275
8276         * som.c (bfd_som_set_section_attributes): New function.
8277         (bfd_som_set_subsection_attributes): Likewise.
8278         (bfd_som_set_symboL_type): Likewise.
8279         (bfd_som_attach_unwind_info): Likewise.
8280         * som.h: Declare new exported functions.
8281
8282         * som.h (struct som_symbol): Add new fields to hold additional
8283         information needed to build/write symbol tables and fixup streams.
8284         (struct som_section_data_struct): Add new fields to hold additional
8285         information needed to build/write space and subspace headers.
8286         (som_symbol_data): New accessor macro for SOM symbol information.
8287         (R_HPPA_*): Basic relocation types to be used by the assembler.
8288
8289 Fri Nov 12 11:00:28 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
8290
8291         * trad-core.c (trad_unix_core_file_p): If new hook
8292         TRAD_CORE_ALLOW_ANY_EXTRA_SIZE defined, then skip the check for the
8293         corefile being too big.
8294         * hosts/i386sco.h: Define it.
8295
8296 Thu Nov 11 15:16:28 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8297
8298         * bfd.c (struct _bfd): Add hppabsd_core_data.
8299         * targets.c (target_vector): Add hppabsd_core_vec.
8300         * hpux-core.c (hpux_core_core_file_p): Fail if an unknown core
8301         section is encountered during core section scanning.
8302         * hppabsd-core.c: New file.
8303         * config/hppabsd.mh: Enable HPPA BSD core files.
8304
8305         * elf32-hppa.c (hppa_elf_reloc): Remove DEFUN crud.  Remove code
8306         which is either commented out or ifdef'd out.  Add, update and
8307         clean comments.  Fix various indention and spacing problems.  Handle
8308         problems related to using "ble" to jump to a stub rather than "bl"
8309         (%r31 is trashed by "ble", but not by "bl").
8310         (NEW_INSTRUCTION): Put inside curly braces.
8311         (CURRENT_STUB_OFFSET): Fix indention problems.
8312         (hppa_elf_build_arg_reloc_stub): Fix indention and spacing problems.
8313         Add, update and clean comments.  Handle "ble" %r31 lossage problems.
8314         (hppa_elf_build_long_branch_stub): Likewise.
8315         (hppa_look_for_stubs_in_section): Likewise.
8316         (hppa_elf_stub_check): Remove obsolete function.
8317
8318         * hppa_stubs.h: Add new instructions to deal with %r31 lossage
8319         problems.  Delete unused instructions.
8320         
8321 Tue Nov  9 11:40:27 1993  Stan Shebs  (shebs@rtl.cygnus.com)
8322
8323         * m68klynx.c (TARGET_IS_BIG_ENDIAN_P): Define.
8324
8325 Tue Nov  9 11:26:05 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8326
8327         * elfcode.h (elf_object_p): Rather than looking through an array
8328         of architectures, get the ELF EM_xxx code from the backend
8329         information.  Let the generic ELF target match any EM_xxx code not
8330         matched by another ELF target.  Call elf_backend_object_p to let
8331         the backend do more checks and set global information.
8332         * libelf.h (struct elf_backend_data): Added elf_machine_code and
8333         elf_backend_object_p fields.
8334         (struct bfd_elf_arch_map): Removed.
8335         (bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare.
8336         * elf32-target.h, elf64-target.h: Initialize elf_machine_code
8337         field with ELF_MACHINE_CODE.  Initialize elf_backend_object_p
8338         field with elf_backend_object_p (if it is defined).
8339         * elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c,
8340         elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c,
8341         elf64-gen.c (ELF_MACHINE_CODE): Defined.
8342         * elf32-mips.c: Include ecoffswap.h to get ECOFF swapping
8343         routines.
8344         (mips_elf_object_p): Set the right machine number.
8345         (mips_elf_ecoff_debug_swap): Defined.
8346         (elf_backend_object_p): Defined to be mips_elf_object_p.
8347         (elf_backend_ecoff_debug_swap): Defined to be
8348         mips_elf_ecoff_debug_swap.
8349         * elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed.
8350
8351         * libbfd-in.h (target_vector, default_vector): Declare.
8352         * libbfd.h: Rebuilt.
8353         * format.c (target_vector, default_vector): Don't declare.
8354
8355         * elf32-mips.c (elf_mips_howto_table): Don't complain on overflow
8356         for R_MIPS_26.  Correct overflow detection requires matching the
8357         upper four bits of the destination against the PC.  From Ted Lemon
8358         <mellon@pepper.ncd.com>.
8359
8360         * bout.c (b_out_reloc_type_lookup): Return type should point to
8361         const data.
8362         * coff-i960.c (coff_i960_reloc_type_lookup): Likewise.
8363         * elf32-hppa.c (elf_hppa_reloc_type_lookup): Likewise.
8364         * mipsbsd.c (MY(reloc_howto_type_lookup)): Likewise.
8365         * coff-i386.c (coff_i386_reloc): Made howto const.
8366         * oasys.c (oasys_write_data): Made how const.
8367
8368         * libelf.h: Added some comments.
8369         (struct elf_backend_data): Added elf_backend_ecoff_debug_swap
8370         field.  Removed unused write_relocs field.
8371         * elf32-target.h: Adjusted elf_backend_data initialization
8372         accordingly.
8373         * elf64-target.h: Corrected elf_backend_data initialization to
8374         fill in all fields and to set elf_64_p to 1.
8375
8376 Mon Nov  8 18:13:14 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8377
8378         * elfcode.h (bfd_section_from_shdr): Remove duplicate assignment
8379         to filepos in SHT_STRTAB case.
8380         (assign_file_position_for_section): Set BFD section filepos as
8381         well as ELF section sh_offset.
8382
8383         * reloc.c: Use const instead of CONST.
8384         (bfd_perform_relocation): Make variable howto a const pointer.
8385         * bfd-in2.h, libbfd.h: Rebuilt.
8386
8387 Mon Nov  8 12:19:15 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
8388
8389         * Makefile.in (realclean): Don't remove generated headers.  Reverts
8390         change of 2 Jul 1993.
8391
8392 Mon Nov  8 06:08:31 1993  D. V. Henkel-Wallace  (gumby@cirdan.cygnus.com)
8393
8394         * configure.bfd: make unixware equivalent to sysv4.
8395
8396         * config/i386-nlm.mt: bring in elf config; make it the default.
8397
8398 Sun Nov  7 20:21:38 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8399
8400         * libbfd.c (bfd_put_8): Add parens around reference to "val"
8401         argument.
8402
8403 Fri Nov  5 21:45:09 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
8404
8405         * hosts/i386mach3.h (HOST_SEGMENT_SIZE),
8406         i386mach3.c (SEGMENT_SIZE, TEXT_START_ADDR): Correct values (?).
8407
8408 Fri Nov  5 15:17:57 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8409
8410         * coffcode.h (coff_write_object_contents): Zero out internal_a.
8411
8412 Fri Nov  5 10:41:07 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
8413
8414         * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coffcode.h,
8415         core.c, ctor.c, format.c, init.c, libbfd.c, opncls.c, reloc.c,
8416         section.c, syms.c, targets.c:
8417         Doc cleanup (spelling, punctuation, grammar, formatting).
8418         * bfd-in2.h, libbfd.h: Rebuild.
8419
8420 Thu Nov  4 14:46:14 1993  John Gilmore  (gnu@rtl.cygnus.com)
8421
8422         * bfd-in.h (bfd_get_cacheable, bfd_set_cacheable):  New accessors.
8423         * bfd.c, opncls.c:  Improve comments on file descriptor cacheing.
8424
8425 Thu Nov  4 08:54:30 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
8426
8427         * From Pete Hoogenboom (hoogen@cs.utah.edu)
8428         * elf32-hppa.c (hppa_elf_get_section_contents): Fix logic error
8429         in last change.  Always rebuild symbol extension section the first
8430         time though if output sections exist (fixes ld -r problems).
8431
8432 Thu Nov 04 08:08:46 1993  Jeffrey Wheat  (cassidy@cygnus.com)
8433
8434         * Makefile.in: Add .PHONY for check and installcheck rules.
8435
8436 Tue Nov  2 14:42:27 1993  Bill Cox (bill@tarkas.cygnus.com)
8437
8438         * libbfd-in.h (artdata): Use long, not time_t for portability, at
8439           least to HPUX.  File below is a derived file.
8440
8441 Tue Nov  2 14:42:27 1993  Bill Cox (bill@tarkas.cygnus.com)
8442
8443         * libbfd.h (artdata): Use long, not time_t for portability, at
8444           least to HPUX.
8445
8446 Tue Nov  2 09:32:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
8447
8448         * config.bfd: Use bigmips for mips*-*-bsd*.
8449
8450 Mon Nov  1 14:30:09 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
8451
8452         * elfcode.h (elf_slurp_reloca_table, elf_slurp_reloc_table):
8453         Handle symbol number of zero.
8454
8455         * reloc.c (enum bfd_reloc_code_real): Added
8456         BFD_RELOC_MIPS_LITERAL, BFD_RELOC_MIPS_GOT16,
8457         BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GPREL32.
8458         * bfd-in2.h: Rebuilt.
8459         * coff-mips.c (mips_bfd_reloc_type_lookup): Handle
8460         BFD_RELOC_MIPS_LITERAL.
8461         * elf32-mips.c (mips_reloc_map): Handle new relocs.
8462         (mips_elf_hi16_reloc, mips_elf_lo16_reloc): Rearrange _gp_disp
8463         checks slightly.
8464
8465         * aout-target.h (MY_bfd_debug_info_start, MY_bfd_debug_info_end,
8466         MY_bfd_debug_info_accumulat [sic]): Remove unused definitions.
8467         (MY_bfd_get_relocated_section_contents, MY_bfd_relax_section,
8468         MY_bfd_seclet_link): Define.
8469         (MY_bfd_reloc_type_lookup): Rename from
8470         MY_reloc_howto_type_lookup.
8471         (MY_bfd_make_debug_symbol): Rename from MY_make_debug_symbol.
8472         (MY(vec)): Use JUMP_TABLE rather than listing functions.
8473         * hp300hpux.c (MY_get_symtab, MY_get_symtab_upper_bound,
8474         MY_canonicalize_reloc, MY_write_object_contents): Don't define in
8475         terms of MY, because that causes a recusive invocation of CAT when
8476         expanded within JUMP_TABLE, and ANSI compilers don't expand
8477         recursive macros.
8478         * mipsbsd.c (MY_bfd_reloc_type_lookup): Rename from
8479         MY_reloc_howto_type_lookup, and don't define in terms of MY.
8480         (MY_canonicalize_reloc): Don't define in terms of MY.
8481         (aout_mips_little_vec, aout_mips_big_vec): Use JUMP_TABLE rather
8482         than listing functions.
8483
8484 Mon Nov  1 09:12:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
8485
8486         * config.bfd: Use m68k-elf for m68*-*-sysv4*.
8487
8488 See file ChangeLog.1
8489
8490 \f
8491 Local Variables:
8492 mode: indented-text
8493 left-margin: 8
8494 fill-column: 74
8495 version-control: never
8496 End: