* coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE): Flag overflows
[platform/upstream/binutils.git] / bfd / ChangeLog
1 Thu Sep  8 16:20:38 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
2
3         * coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE):  Flag overflows
4         correctly.
5
6 Wed Sep  7 19:01:42 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
7
8         * libelf.h (struct elf_backend_data): Change second argument of
9         elf_backend_final_write_processing hook to boolean.
10         (struct elf_obj_tdata): Add linker field.
11         * elfcode.h (NAME(bfd_elf,write_object_contents)): Pass value of
12         tdata linker field to final_write_processing, rather than NULL.
13         (elf_bfd_final_link): Don't call final_write_processing hook.  Set
14         tdata linker field to true.
15         * elf32-mips.c (mips_elf_final_write_processing): Change type of
16         second argument to boolean.
17         * elf32-hppa.c (elf32_hppa_backend_final_write_processing):
18         Likewise.
19
20         * coff-go32.c (RTYPE2HOWTO): Fully parenthesize arguments.
21         * coff-i960.c (RTYPE2HOWTO): Likewise.
22         * coff-m88k.c (RTYPE2HOWTO): Likewise.
23         * coff-we32k.c (RTYPE2HOWTO): Likewise.
24
25         Make i386 COFF use new COFF backend linker.
26         * coff-i386.c (RTYPE2HOWTO): Fully parenthesize arguments.
27         (coff_relocate_section): Define.
28         (coff_i386_rtype_to_howto): New function.
29         * configure.in (i386coff_vec): Use cofflink.o.
30         (i386lynx_coff_vec): Likewise.
31
32         * coffcode.h (bfd_coff_backend_data): Add new field
33         _bfd_coff_rtype_to_howto.
34         (bfd_coff_rtype_to_howto): Define.
35         (coff_rtype_to_howto): Define to use RTYPE2HOWTO, if not already
36         defined.
37         (bfd_coff_std_swap_table): Initialize new field.
38         * cofflink.c (_bfd_coff_final_link): Allocate section_count + 1
39         section_info structures, since the target_index is 1 based.
40         (coff_link_input_bfd): Set *secpp to bfd_com_section_ptr for a
41         common symbol.  Adjust rel_hash by the output reloc count.
42         (_bfd_coff_generic_relocate_section): New function.
43         * libcoff-in.h (_bfd_coff_generic_relocate_section): Declare.
44         * libcoff.h: Rebuild.
45         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
46         * coff-mips.c (mips_ecoff_backend_data): Likewise.
47
48 Tue Sep  6 23:28:52 1994  Jeff Law  (law@snake.cs.utah.edu)
49
50         * som.c (som_bfd_derive_misc_symbol_info): Treat undefined code
51         symbols and undefined symbols which no type in the same manner
52         if the associated BFD symbol has BSF_FUNCTION set.  For a defined
53         symbol which no type, select a SOM type based on the flags of the
54         section containing the symbol.
55         (som_slurp_symbol_type): Set BSF_FUNCTION for undefined ST_STUB
56         or ST_CODE symbols (importing a non-function code symbol is
57         meaningless in SOM).
58         (som_set_reloc_info): Don't set "offset" to the section's vma; it
59         should always start at zero.
60
61 Tue Sep  6 14:51:11 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
62
63         Add new style linker support to COFF backend.  a29k only for now.
64         * cofflink.c: New file.
65         * libcoff-in.h: Include bfdlink.h.
66         (obj_coff_external_syms, obj_coff_strings): Define accessor macro.
67         (obj_coff_sym_hashes): Define accessor macro.
68         (struct coff_tdata): Add fields external_syms, strings, and
69         sym_hashes.
70         (struct coff_link_hash_entry): Define.
71         (struct coff_link_hash_table): Define.
72         (coff_link_hash_lookup, coff_link_hash_traverse): Define.
73         (coff_hash_table): Define.
74         (_bfd_coff_link_hash_table_create): Declare.
75         (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare.
76         * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz,
77         _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global,
78         _bfd_coff_compute_section_file_positions,
79         _bfd_coff_relocate_section.
80         (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define.
81         (bfd_coff_sym_is_global): Define.
82         (bfd_coff_compute_section_file_positions): Define.
83         (bfd_coff_relocate_section): Define.
84         (coff_mkobject_hook): Initialize obj_raw_syment_count and
85         obj_conv_table_size.
86         (coff_compute_section_file_positions): Set target_index of all
87         sections.  Set output_has_begun field.
88         (coff_write_object_contents): Don't set target_index; now done by
89         coff_compute_section_file_positions.  Remove obsolete handling of
90         scn_base and data_base.  Don't bother to check that target_index
91         is positive, since it always is.  Remove use of pad, which is
92         always zero.  Check obj_raw_syment_count, not bfd_get_symcount,
93         for the number of symbols, but only write them out if
94         bfd_get_symcount is non-zero.  Don't check obj_raw_syment_count
95         until after coff_write_symbols is called.
96         (coff_slurp_symbol_table): Use obj_raw_syment_count, not
97         bfd_get_symcount for the number of symbols.  Don't set
98         obj_conv_table_size.
99         (coff_sym_is_global): New static function or macro.
100         (coff_slurp_reloc_table): Call coff_swap_reloc_in, not
101         bfd_swap_reloc_in.
102         (coff_bfd_link_hash_table_create): If coff_relocate_section is
103         defined, define as _bfd_coff_link_hash_table_create.
104         (coff_bfd_link_add_symbols): Similar change.
105         (coff_bfd_final_link): Similar change.
106         (coff_relocate_section): Define as NULL if not defined.
107         (bfd_coff_std_swap_table): Initialize new fields.
108         * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count
109         and obj_conv_table_size here.
110         (coff_count_linenumbers): Reindent.  If bfd_get_symcount is zero,
111         add up the line numbers from the sections.
112         (coff_write_symbols): Set obj_raw_syment_count, not
113         bfd_get_symcount.
114         (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx
115         field.
116         (coff_get_normalized_symtab): Use obj_raw_syment_count, not
117         bfd_get_symcount.
118         (coff_print_symbol): If auxp->fix_end, print x_endndx value.
119         * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in.
120         Reindent.  Change argument type to  PTR.
121         * coff-a29k.c (coff_a29k_relocate_section): New static function.
122         (coff_relocate_section): Define.
123         * configure.in (a29kcoff_big_vec): Compile cofflink.o.
124         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields.
125         * coff-mips.c (mips_ecoff_backend_data): Likewise.
126         * libcoff.h: Rebuilt.
127         * Makefile.in: Rebuilt dependencies.
128         (BFD32_BACKENDS): Add cofflink.o.
129         (CFILES): Add cofflink.c.
130
131 Tue Sep  6 14:00:45 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
132
133         * coffgen.c (coff_print_symbol, case bfd_symbol_print_all): Check
134         for section symbol, and print its aux fields with appropriate
135         labels.
136
137         * Makefile.in (ALL_MACHINES): Added cpu-arm.o.
138
139 Sun Sep 04 17:58:10 1994  Richard Earnshaw (rwe@pegasus.esprit.ec.org)
140
141         * aoutx.h (NAME(aout,machine_type)): Recognize the ARM processor.
142         * archures.c, config.bfd, configure.host, libaout.h, reloc.c,
143         targets.c: Add support for the ARM.
144         * cpu-arm.c, riscix.c, config/riscix.mh, config/riscix.mt: New files.
145
146         * aoutx.h (add_to_stringtable): Check that str isn't a NULL pointer.
147
148 Fri Sep  2 14:10:30 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
149
150         * reloc.c (enum bfd_reloc_code_real): Rewrote definition to use
151         new "chew" commands for simultaneous definition of enumerator and
152         enumerator name table.
153         (bfd_get_reloc_code_name): New function, for retrieving a symbolic
154         name associated with an enumerator.
155         * libbfd.h, bfd-in2.h: Regenerated.
156
157 Tue Aug 30 21:24:54 1994  Jeff Law  (law@snake.cs.utah.edu)
158
159         * som.c (som_write_fixups, case R_ENTRY): Handle case where no
160         unwind descriptor information is available.
161
162 Tue Aug 30 11:43:30 1994  Eric Youngdale  (ericy@cais.cais.com)
163
164         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add soname
165         argument, and use it to set DT_SONAME dynamic entry.
166         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
167         (bfd_elf64_size_dynamic_sections): Update prototype.
168         * bfd-in2.h: Rebuilt.
169
170 Fri Aug 26 15:47:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
171
172         * coffgen.c (coff_real_object_p): Set obj_raw_syment_count.
173         (coff_get_normalized_symtab): Verify obj_raw_syment_count, rather
174         than setting it.
175
176 Thu Aug 25 10:44:53 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
177
178         * archive.c (bsd_write_armap): Remove host dependencies.
179
180         * aoutx.h (add_to_stringtab): Check for _bfd_stringtab_add error
181         before adding BYTES_IN_WORD.
182
183         * coffgen.c (coff_find_nearest_line): Look for the best C_FILE,
184         not merely the first.
185
186         * coffgen.c (coff_write_alien_symbol): If we are not using the
187         symbol, clear the name so that it is not put in the string table.
188         From Antti.Miettinen@ntc.nokia.com.
189
190 Wed Aug 24 11:49:19 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
191
192         * coffgen.c (coff_print_symbol): Cast pointer different to long
193         and use %ld to print it.
194         * osf-core.c (osf_core_core_file_p): Remove unused variable
195         dseccnt.
196         * ecoffswap.h (ecoff_swap_ext_out): If ECOFF_64, clear remaining
197         bytes in bits2.
198
199         * configure.host, config.bfd: Change i[34]86 to i[345]86.
200
201         * coffgen.c (coff_real_object_p): Set obj_conv_table_size here,
202         rather than waiting until coff_slurp_symbol_table.
203         (coff_write_alien_symbol): Just ignore BSF_DEBUGGING symbols.
204         From Antti.Miettinen@ntc.nokia.com.
205
206         * section.c (bfd_make_section_anyway): Fix failure check of
207         bfd_make_empty_symbol.  From Antti.Miettinen@ntc.nokia.com.
208
209         * aoutx.h (translate_to_native_sym_flags): Use the output_section
210         (and output_offset) if there is one.
211
212         * aoutx.h (aout_link_check_archive_element): Discard the symbols
213         if the archive element was not needed.
214
215         * aoutx.h (aout_get_external_symbols): Ensure that a zero string
216         index yields an empty string.
217         (aout_link_write_symbols): If info->keep_memory is false, use name
218         from original hash table entry, not from entry in *sym_hash.
219
220         * aoutx.h (struct aout_final_link_info): Add fields contents,
221         relocs, symbol_map and output_syms.
222         (NAME(aout,final_link)): Work out the largest section size, reloc
223         size, and number of symbols.  Use them to preallocate buffers that
224         are large enough for all cases.
225         (aout_link_input_bfd): Use preallocated symbol_map.
226         (aout_link_write_symbols): Remove symbol_map argument; use
227         preallocated symbol_map instead.  Change all callers.  Use
228         preallocated output_syms.
229         (aout_link_input_section): Remove symbol_map argument.  Change all
230         callers.  Use preallocated contents and relocs.
231         (aout_link_input_section_std): Remove symbol_map argument; use
232         preallocated symbol_map instead.  Change all callers.
233         (aout_link_input_section_ext): Likewise.
234
235 Tue Aug 23 10:51:09 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
236
237         * archive.c (_bfd_write_archive_contents): Don't update the
238         symbol map timestamp if there is no symbol map.  From
239         schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
240
241 Mon Aug 22 12:26:42 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
242
243         * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add _update_armap_timestamp.
244         (bfd_target): Add field _bfd_update_armap_timestamp.
245         * bfd.c (bfd_update_armap_timestamp): Define.
246         * bfd-in2.h: Rebuilt.
247         * libbfd-in.h (_bfd_noarchive_update_armap_timestamp): Define.
248         (_bfd_archive_bsd_update_armap_timestamp): Declare.
249         (_bfd_archive_coff_update_armap_timestamp): Define.
250         * libbfd.h: Rebuilt.
251         * archive.c (_bfd_write_archive_contents): Call
252         bfd_update_armap_timestamp instead of checking for a BSD archive
253         and calling bsd_update_armap_timestamp.
254         (_bfd_archive_bsd_update_armap_timestamp): Rename from
255         _bsd_update_armap_timestamp.  Don't assume that armap_datepos is
256         already set.
257         * aout-target.h (MY_update_armap_timestamp): Define if not already
258         defined.
259         * coff-rs6000.c (rs6000coff_update_armap_timestamp): Define.
260         * ieee.c (ieee_update_armap_timestamp): Define.
261         * libecoff.h (_bfd_ecoff_update_armap_timestamp): Define.
262         * oasys.c (oasys_update_armap_timestamp): Define.
263         * som.c (som_update_armap_timestamp): Define.
264
265         * hash.c: Copy string hash functions from aoutx.h.
266         * aoutx.h: String hash functions moved to hash.c.  Retain
267         simplified versions of add_to_stringtab and emit_stringtab.
268         Change all callers to use new function and structure names.
269         * libbfd-in.h (_bfd_stringtab_init, _bfd_stringtab_free): Declare.
270         (_bfd_stringtab_size, _bfd_stringtab_add): Declare.
271         (_bfd_stringtab_emit): Declare.
272         * libbfd.h: Rebuilt.
273
274 Mon Aug 22 10:49:37 1994  Eric Youngdale  (ericy@cais.cais.com)
275
276         * i386linux.c (linux_add_one_symbol): Create a fixup for any
277         defined absolute symbol, not just GOT or PLT symbols.
278         (linux_tally_symbols): Correct handling of references to defined
279         symbols.
280
281 Thu Aug 18 16:29:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
282
283         Get ld -x -r to handle a.out set symbols correctly.
284         * aoutx.h (adjust_o_magic): If the .bss VMA was set outside of
285         BFD, pad the .data section up to the VMA of the .bss section.
286         (aout_link_add_symbols): If a set symbol does not get modified,
287         treat it as a local symbol.
288         (aout_link_write_symbols): Set the value of set symbols
289         correctly.  Don't discard set symbols even if discarding local
290         symbols.
291         (aout_link_write_other_symbol): Don't abort on bfd_link_hash_new,
292         since it can now happen for set symbols.
293
294         * elfcode.h (elf_fake_sections): Just check for ".rela" and
295         ".rel", not ".rela." and ".rel."; make this work by checking
296         use_rela_p.
297         * elf32-i386.c (elf_i386_check_relocs): Just check for ".rel", not
298         ".rel."
299         (elf_i386_size_dynamic_sections): Likewise.
300         (elf_i386_relocate_section): Likewise.
301         * elf32-sparc.c (elf32_sparc_check_relocs): Just check for
302         ".rela", not ".rela."
303         (elf32_sparc_size_dynamic_sections): Likewise.
304         (elf32_sparc_relocate_section): Likewise.
305
306 Wed Aug 17 16:54:18 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
307
308         * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
309         PASS to the old value + 1.
310
311         * coffgen.c (coff_get_normalized_symtab): If a C_FILE symbol has
312         no aux entries, use the symbol name as the file name.
313         (coff_find_nearest_line): Look for the right C_FILE symbol, rather
314         than always using the first one.  If there is a debugging symbol
315         after a function symbol, skip it.  Add the section VMA to the line
316         offset, since it was subtracted out in coff_slurp_line_table.
317
318 Tue Aug 16 16:53:00 1994  Jeff Law  (law@snake.cs.utah.edu)
319
320         * som.c (som_prep_headers): If writing some form of an executable,
321         allocate and attach an exec header to the BFD private data.
322         (som_begin_writing): Don't fill fields of the exec header based
323         on BFD private data here (like the exec flags).  Do not write
324         the exec header here.
325         (som_write_headers): Instead do it here.
326         * som.h (struct somdata): New field "exec_hdr" for the executable
327         file header.
328         (obj_som_exec_hdr): New accessor macro.
329
330 Tue Aug 16 00:12:31 1994  Eric Youngdale  (ericy@cais.cais.com)
331
332         * i386linux.c (linux_link_create_dynamic_sections): Create section
333         named .linux-dynamic, not .dynamic.
334         (linux_add_one_symbol): Use .linux-dynamic, not .dynamic.
335         (bfd_linux_size_dynamic_sections): Likewise.
336         (linux_finish_dynamic_link): Likewise.
337
338 Mon Aug 15 12:16:56 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
339
340         * coffgen.c (STRING_SIZE_SIZE): Define.
341         (coff_fix_symbol_name): Use STRING_SIZE_SIZE, not 4.
342         (coff_write_symbols, build_string_table): Likewise.
343         (coff_get_normalized_symtab): Likewise.
344
345         * libcoff-in.h (obj_symbol_slew): Don't define.
346         (struct coff_tdata): Remove unused fields index_slew, raw_linenos,
347         and flags.
348         * libcoff.h: Rebuilt.
349         * coffcode.h (coff_mkobject): Don't initialize raw_linenos.
350         (coff_mkobject_hook): Don't initialize flags.
351
352         * aout-target.h (MY_zmagic_contiguous): Define as 0 if not already
353         defined.
354         (MY(backend_data)): Use MY_zmagic_contiguous, not hardcoded 0.
355         * i386linux.c (MY_zmagic_contiguous): Define.
356
357         * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a
358         shared object has SHF_ALLOC set, create a BFD section for it.
359         (elf_section_from_bfd_section): There may be a BFD section for a
360         SHT_SYMTAB section.
361
362         * coffcode.h (styp_to_sec_flags): Add name argument.  If no flags
363         are recognized, chose section flags based on the name.
364         (bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add
365         name argument.
366         (bfd_coff_styp_to_sec_flags_hook): Add name argument.
367         (coff_compute_section_file_positions): Don't adjust the section
368         position by COFF_PAGE_SIZE unless SEC_ALLOC is set.
369         * libcoff.h: Rebuilt.
370         * coffgen.c (make_a_section_from_file): Pass section name to
371         bfd_coff_styp_to_sec_flags_hook.
372         * ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name
373         argument.
374         * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to
375         prototype.
376
377 Fri Aug 12 11:22:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
378
379         * elfcode.h (section_from_elf_index): Correct check for invalid
380         section index.
381
382         * elfcode.h (elf_link_add_object_symbols): If there is no symbol
383         table, try using the dynamic symbol table.  From Eric Youngdale
384         <ericy@cais.cais.com>.
385
386         * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4.
387         The linker depends upon configuring for solaris2.
388         * hosts/solaris2.h: New file; include hosts/sysv4.h.
389         * config/solaris2.mh: New file; copy of config/sysv4.mh.
390
391 Wed Aug 10 13:09:38 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
392
393         * aoutx.h (adjust_z_magic): Make sure data section is padded to
394         page boundary when the VMA is set by the calling program.  From
395         Eric Youngdale <ericy@cais.cais.com>.
396
397 Mon Aug  8 17:18:49 1994  Stan Shebs  (shebs@andros.cygnus.com)
398
399         Update to ns32k support, from Ian Dall (dall@hfrd.dsto.gov.au).
400         * aout-ns32k.c: Add declarations that were in aout-ns32k.h, change
401         declarations to traditional form.
402         (MY_reloc_howto, MY_put_reloc): Change from macro to function.
403         (ns32k_relocate_contents): New function.
404         * aout-ns32k.h: Remove.
405         * cpu-ns32k.c: Add declarations that were in aout-ns32k.h, change
406         declarations to traditional form.
407         (ns32k_final_link_relocate): Call ns32k_relocate_contents.
408         * netbsd532.c: Reformat to standards, add copyright notice.
409         (ARCH): Don't define.
410         (aout-ns32k.h): Don't include.
411         * pc532-mach.c: Ditto.
412
413 Mon Aug  8 17:55:52 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
414
415         * coff-i960.c (coff_i960_relocate): Don't try to convert relocs
416         against common symbols.
417
418 Sat Aug  6 22:27:30 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
419
420         * irix-core.c (irix_core_core_file_p):  Ignore sections that
421         are not contained in the core file.
422
423 Thu Aug  4 11:32:23 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
424
425         * coff-m68k.c (m68k_reloc_type_lookup): New function.
426         (coff_bfd_reloc_type_lookup): Define.
427         * cf-m68klynx.c (_bfd_m68kcoff_reloc_type_lookup): Define.
428
429         * elfcode.h (elf_bfd_final_link): Force the vma of sections which
430         do not have SEC_ALLOC set to be 0.  This is needed to handle
431         relocs against debugging sections.
432
433 Wed Aug  3 16:45:41 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
434
435         * coff-i960.c (coff_i960_relocate): Rewrote to change relocs
436         against locally defined symbols into relocs against section
437         symbols, for VxWorks 5.1.
438
439 Wed Aug  3 10:34:37 1994  Eric Youngdale  (ericy@cais.cais.com)
440
441         * i386linux.c (linux_add_one_symbol): Only handle
442         SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set.  Set hashp
443         for a GOT or PLT symbol.  Set jump field of fixup for a PLT symbol.
444         (linux_tally_symbols): Check section of real symbol.  When looking
445         for a builtin fixup, check builtin and jump flags.  Create no more
446         than one fixup, and always create one if the real symbol is in the
447         absolute section.  Only strip absolute symbols.
448
449 Wed Aug  3 05:08:24 1994  D. V. Henkel-Wallace  (gumby@cygnus.com)
450
451         * coffcode.h (coff_write_object_contents): set internal_a.magic to
452         LYNXCOFFMAGIC whenever 68k, SPARC or i386 LynxOS
453         (yes, they have the same magic number!)
454
455 Tue Aug  2 10:43:21 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
456
457         * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test
458         in aoutx.h work correctly.
459
460         * coff-i960.c (coff_i960_relocate): New function.
461         (howto_rellong, howto_iprmed): Use it as special_function.
462
463         * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek,
464         bfd_tell, bfd_flush, and bfd_stat from here...
465         * bfd-in.h: ...to here, to make them visible to programs which
466         know more about the object file format than BFD does.
467         * libbfd.h, bfd-in2.h: Rebuilt.
468
469 Mon Aug  1 17:55:53 1994  Fred Fish  (fnf@cygnus.com)
470
471         * ptrace-core.c (ptrace_unix_core_file_p):  Convert zalloc usage
472         to bfd_zalloc.
473
474 Mon Aug  1 12:04:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
475
476         * elf64-sparc.c (ELF_MAXPAGESIZE): Define.
477
478         ELF linker patches from Eric Youngdale <ericy@cais.cais.com>.
479         * elfcode.h (elf_link_create_dynamic_sections): Set type of
480         _DYNAMIC to STT_OBJECT.
481         (NAME(bfd_elf,record_link_assignment)): Always create hash table
482         entry.  Set type to STT_OBJECT.
483         (elf_link_output_extsym): Don't set type of weak defined symbol to
484         STB_WEAK if symbol was referenced.
485         (map_program_segments): Check DYNAMIC as well as EXEC_P.
486         (assign_file_positions_except_relocs): Likewise.
487         * elf32-i386.c (elf_i386_create_dynamic_sections): Set type of
488         _GLOBAL_OFFSET_TABLE to STT_OBJECT.
489         (elf_i386_check_relocs): Ignore local PLT32 relocs.
490         (elf_i386_relocate_section): Treat local PLT32 relocs as PC32.
491
492         * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol
493         handling again.
494
495         * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
496         if there aren't any.
497
498         * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
499         * hosts/solaris2.h: Remove.
500         * config/solaris2.mh: Remove.
501
502 Sun Jul 31 14:27:04 1994  Jeff Law  (law@snake.cs.utah.edu)
503
504         * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which
505         HPPA ELF spec the code implements.
506
507 Tue Jul 26 17:38:01 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
508
509         * cpu-i960.c (MAX_ARCH): New macro.
510         (compatible): Use it in computing array bounds.  Put comma after
511         last entry in array, for regularity.
512         (arch_info_struct): Adjust spacing for easier reading.
513
514         * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use
515         HOWTO macro.
516
517         start-sanitize-i960xl
518         * cpu-i960.c (XL): Define as bfd_mach_i960_xl.
519         (scan_960_mach): Recognize xl machine.
520         (MAX_ARCH): Define to be XL.
521         (compatible): Add XL row to array.
522         (arch_info_struct): Add XL entry.
523
524         * archures.c (bfd_mach_i960_xl): New macro.
525         * bfd-in2.h: Regenerated.
526
527         * coffcode.h (coff_set_arch_mach_hook): For F_I960XL, set machine
528         to bfd_mach_i960_xl.
529         (coff_set_flags): For bfd_mach_i960_xl, set F_I960XL.
530         end-sanitize-i960xl
531
532 Tue Jul 26 11:04:00 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
533
534         * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak
535         symbol, correct check to see whether the equivalent normal symbol
536         was referenced.
537
538         Add support for creating shared libraries under i386 ELF and SPARC
539         ELF.  Based on patches by Eric Youngdale <ericy@cais.cais.com>.
540         * libelf.h (struct elf_link_hash_entry): Remove copy_offset field.
541         Add got_offset and plt_offset fields.
542         (ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define.
543         (ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define.
544         (ELF_LINK_HASH_NEEDS_COPY): Define.
545         (struct elf_backend_data): Add check_relocs field.
546         (struct bfd_elf_section_data): Change relocs from PTR to
547         Elf_Internal_Rela *.
548         (struct elf_obj_tdata): Add local_got_offsets field.
549         (elf_local_got_offsets): Define accessor macro.
550         (bfd_elf32_link_create_dynamic_sections): Declare.
551         (bfd_elf32_link_record_dynamic_symbol): Declare.
552         (bfd_elf64_link_create_dynamic_sections): Declare.
553         (bfd_elf64_link_record_dynamic_symbol): Declare.
554         * elfcode.h (elf_slurp_reloc_table): Don't use the section data
555         relocs field.
556         (elf_link_record_dynamic_symbol): Make globally visible.  Use
557         macro to rename to NAME(bfd_elf,link_record_dynamic_symbol).
558         (elf_link_add_object_symbols): If creating a shared library, put
559         make all local symbols dynamic.  Don't bother with the
560         DYNAMIC_MULTIPLE flags.  Call the check_relocs backend function if
561         it is defined.
562         (elf_link_create_dynamic_sections): Make globally visible.  Use
563         macro to rename to NAME(bfd_elf,link_create_dynamic_sections).  If
564         creating a shared library, make sure that _DYNAMIC is added as a
565         dynamic symbol.
566         (elf_link_read_relocs): New function.
567         (NAME(bfd_elf,record_link_assignment)): If creating a shared
568         library, always create symbols, and always make them dynamic.
569         (elf_bfd_final_link): Permit creation of shared libraries.
570         (elf_link_input_bfd): Use elf_link_read_relocs to get the relocs.
571         * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize
572         copy_offset.  Initialize got_offset and plt_offset.
573         * elf32-target.h (elf_backend_check_relocs): Define as 0 if not
574         defined.
575         (elf32_bed): Initialize check_relocs field.
576         * elf64-target.h (elf_backend_check_relocs): Define as 0 if not
577         defined.
578         (elf64_bed): Initialize check_relocs field.
579         * elf32-i386.c (elf_howto_table): Change R_386_PLT32 and
580         R_386_GOTPC to be pc_relative and pcrel_offset.
581         (elf_i386_pic_plt0_entry): Define.
582         (elf_i386_pic_plt_entry): Define.
583         (elf_i386_create_dynamic_sections): Create a .got.plt section, and
584         define _GLOBAL_OFFSET_TABLE_ at the start of it.  If creating a
585         shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
586         dynamic symbol.  Don't create .rel.bss if creating a shared
587         library.
588         (elf_i386_check_relocs): New function.
589         (elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the
590         symbol already has one.  When making a PLT entry, set plt_offset.
591         Don't create a copy reloc when creating a shared library.  Don't
592         set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
593         (elf_i386_allocate_dynamic_section): Remove.
594         (elf_i386_size_dynamic_sections): Look through all the sections
595         rather than assuming we know their names.  Remove any empty reloc
596         or plt sections.  Only add a DT_DEBUG entry if not creating a
597         shared library.  Only add a DT_PLTGOT entry if there is a PLT.
598         Add a DT_TEXTREL entry if required.
599         (elf_i386_relocate_section): Permit undefined symbols when
600         creating a shared library.  Handle the special relocation types
601         specially.
602         (elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset
603         is set.  If creating a shared library, produce a PIC PLT entry.
604         Only mark a PLT symbol as undefined if it was not defined by a
605         regular object file.  Create a GOT entry if got_offset is set.
606         Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
607         (elf_i386_finish_dynamic_sections): Change the handling of
608         DT_RELSZ to simply subtract out the size of .rel.plt.  If creating
609         a shared library, produce PIC PLT code.
610         (elf_backend_check_relocs): Define.
611         * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10,
612         R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow.
613         (elf32_sparc_create_dynamic_sections): If creating a shared
614         library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
615         dynamic symbol, and set the type to STT_OBJECT.  Likewise for
616         _PROCEDURE_LINKAGE_TABLE_.  Don't create .rel.bss if creating a
617         shared library.
618         (elf32_sparc_check_relocs): New function.
619         (elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the
620         symbol already has one.  When making a PLT entry, set plt_offset.
621         Don't create a copy reloc when creating a shared library.  Don't
622         set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
623         (elf32_sparc_allocate_dynamic_section): Remove.
624         (elf32_sparc_size_dynamic_sections): Look through all the sections
625         rather than assuming we know their names.  Only add a DT_DEBUG
626         entry if not creating a shared library.  Add a DT_TEXTREL entry if
627         required.
628         (elf32_sparc_relocate_section): Permit undefined symbols when
629         creating a shared library.  Handle the special relocation types
630         specially.
631         (elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset
632         is set.  Only mark a PLT symbol as undefined if it was not defined
633         by a regular object file.  Create a GOT entry if got_offset is
634         set.  Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
635         (elf32_sparc_finish_dynamic_sections): Store dynobj in a local
636         variable.
637         (elf_backend_check_relocs): Define.
638
639 Mon Jul 25 12:21:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
640
641         * configure.in (pc532mach_vec): Change to pc532machaout_vec.
642         * config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name.
643         * Makefile.in (ALL_MACHINES): Add cpu-ns32k.o.
644         (BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o,
645         pc532-mach.o.
646         * targets.c (pc532machaout_vec): Use instead of pc532mach_vec.
647         * config/pc532-mach.mt (DEFAULT_VECTOR): Ditto.
648         (SELECT_VECS): Remove.
649         * config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt.
650         * config/ns32k-netbsd.mt: Remove, name too long.
651
652 Fri Jul 22 11:07:14 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
653
654         * linker.c (generic_link_check_archive_element): When changing a
655         symbol to common, set the alignment.
656         (_bfd_generic_link_add_one_symbol): When creating a common symbol,
657         set the alignment.
658         * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to
659         common, set the alignment.
660         (aout_link_add_symbols): Restrict the alignment of a common symbol
661         to the alignment power given by the architecture.
662         * libelf.h (struct elf_link_hash_entry): Remove align field.  Add
663         copy_offset field.
664         * elfcode.h (elf_link_add_object_symbols): Store alignment in
665         new bfd_link_hash_entry field, not in elf_link_hash_entry field.
666         (elf_link_output_extsym): Similar change when getting alignment.
667         * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align.  Do
668         initialize copy_offset.
669         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset
670         field rather than align field.  Get alignment using bfd_log2
671         rather than switch.
672         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
673         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset,
674         not align.
675         * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise.
676
677         * aoutx.h (NAME(aout,some_aout_object_p)): Just check
678         STAT_FOR_EXEC, don't check MACH.
679         * m88kmach3.c (MACH): Don't define.
680         * config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC.
681         * config/m88k-mach3.mt (TDEFINES): Likewise.
682         * config/mips-mach3.mt (TDEFINES): Likewise.
683
684 Thu Jul 21 17:24:31 1994  Stan Shebs  (shebs@andros.cygnus.com)
685
686         * i386mach3.c: Reverted to version from before Jul 5 1994 changes.
687
688 Thu Jul 21 12:26:01 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
689
690         * reloc.c (struct reloc_howto_struct): Remove special_function1.
691         It's the wrong way to do things.
692         (HOWTO): Change accordingly.
693         (HOWTO2): Remove.
694         (_bfd_final_link_relocate): Remove references to
695         special_function1.
696         * bfd-in2.h: Rebuilt.
697         * aoutx.h (aout_link_input_section_std): Remove references to
698         special_function1.
699         (aout_link_reloc_link_order): Likewise.
700
701 Wed Jul 20 15:46:44 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
702
703         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
704         argument.  If it is not NULL, use it to set DT_RPATH.
705         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
706         (bfd_elf64_size_dynamic_sections): Likewise.
707         * bfd-in2.h: Rebuilt.
708
709 Sat Jul 16 21:10:39 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
710
711         * elfcode.h (elf_get_dynamic_symtab_upper_bound): If there is no
712         dynamic symtab, return error.
713
714         * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define.
715         * elfcode.h (elf_link_add_object_symbols): If symbol is defined as
716         weak, set ELF_LINK_HASH_DEFINED_WEAK.
717         (elf_link_output_extsym): If symbol is defined as weak, mark it
718         STB_WEAK.
719
720         * libelf.h (struct bfd_elf_section_data): Add relocs field.
721         (shdr_name): Remove; unused.
722         * elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL
723         and RELA relocs.  Free up the unswapped relocs.  Permit the relocs
724         to be cached in the section_data.  Correct the reloc address.
725         (elf_slurp_reloca_table): Remove.
726         (elf_canonicalize_reloc): Rewrote.
727         (elf_link_input_bfd): Permit the relocs to be cached in the
728         section data.
729
730 Sat Jul 16 13:55:38 1994  Stan Shebs  (shebs@andros.cygnus.com)
731
732         * config.bfd (m88*-harris-cxux*): Recognize.
733         * hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define.
734
735         * configure.host (m68*-atari-sysv4*): New host.
736         (m68*-cbm-sysv4*): Use m68kv4 instead of amix.
737         * hosts/amix.h: Remove.
738         * hosts/m68kv4.h: New file, was amix.h.
739
740 Thu Jul 14 15:12:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
741
742         * reloc.c (enum bfd_reloc_code_real, bfd_type, struct
743         reloc_howto_struct, reloc_howto_type, HOWTO, HOWTO2): Copied
744         changes over from bfd-in2.h so they get generated properly next
745         time someone runs "make headers".
746         * bfd-in2.h: Rebuilt.
747
748         * targets.c (netbsd532_vec, pc532mach_vec): Declare const.
749         (m88kmach3_vec): Restore deleted declaration.
750
751         * configure.in: Alphabetize target vector names.
752
753         * config/pc532mach.mh: New file.
754         (HDEPFILES, HDEFINES): Define here.
755         * config/pc532-mach.mt (HDEPFILES, HDEFINES): Deleted.
756         * config/ns32k-netbsd.mt (HDEPFILES, HDEFINES): Deleted.
757
758         Sun Jul 10 00:04:20 1994  Ian Dall  (dall@hfrd.dsto.gov.au)
759
760         * pc532-mach.c: New File. pc532-mach a.out format.
761
762         * netbsd532.c: New file. pc532-netbsd532 a.out format.
763
764         * hosts/pc532mach.h: New file. pc532-mach host support.
765
766         * cpu-ns32k.c: New file. ns32k support cpu specific code rather
767         than format specific code.
768
769         * config/pc532-mach.mt: New file. Support for pc532-mach target.
770
771         * config/ns32k-netbsd.mt: New file. Support for netbsd532 target.
772
773         * aout-ns32k.c, aout-ns32k.h: New files supporting aout format for
774         ns32k series. 
775
776         * targets.c: Add netbsd532_vec and pc532machaout_vec into
777         bfd_target_vector array. Move netbsd386_vec to alphabetic order
778         location.
779
780         * reloc.c (_bfd_final_link_relocate) Add support for
781         special_function1 in howto.
782
783         * libaout.h: add M_NS32032, M_NS32532, M_532_NETBSD entries in
784         machine_type enum.
785
786         * configure.in: add pc532mach_vec and netbsd532_vec entries.
787
788         * config.bfd: add pc532mach host entries. Use for both
789         ns32k-pc532-mach and ns32k-pc532-netbsd.
790
791         * config.bfd: it doesn't work to use i386-mach3 for ns32k*-*-mach.
792         add ns32k-pc532-mach* and ns32k-*-netbsd* entries.
793
794         * bfd-in2.h: Add ns32k specific relocations to bfd_reloc_code_real
795         enum.
796
797         * bfd-in2.h: Add special_function1 to struct howto. Change HOWTO
798         and NEWHOWTO macros to make special_function1 NULL. Neww HOWTO2
799         macro.
800
801         * bfd-in2.h: Split definition of struct reloc_howto_struct
802         and corresponding typedef into two statements.
803
804         * bfd-in2.h: Add entry bfd_arch_ns32k to bfd_architecture enum.
805
806         * archures.c: Add bfd_ns32k_arch prototype, and entry in
807         archures_init_table. 
808
809         * aoutx.h (aout_link_reloc_link_order): Allow for target dependent
810         MY_put_reloc macro. Allow for target dependent special_function1
811         to apply the relocation. 
812
813         * aoutx.h (aout_link_input_section_std): Allow for target
814         dependent determination of reloc howto. Allow for target dependent
815         special_function1 to apply the relocation.
816
817         * aoutx.h (get_reloc_upper_bound): Detect bss and return 0.
818
819         * aoutx.h (slurp_reloc_table): Detect bss and succesfully read
820         zero reloc entries.
821
822         * aoutx.h (machine_type): Add bfd_arch_ns32k case.
823
824         * aoutx.h: Stat to determine executable status if STAT_FOR_EXEC
825         is defined (not just MACH). Use fstat instead of stat and check
826         for fstat error.
827
828         * aoutx.h: Allow target dependent swap_std_reloc_{in,out}.
829
830         * aoutx.h: Allow CTORS reloc info to be in target dependent reloc
831         table.
832
833         * aout-target.h: Apply SWAP_MAGIC (if defined) after
834         swap_exec_header_in, otherwise we have magic in the wrong order.
835
836 Thu Jul 14 11:47:27 1994  Stan Shebs  (shebs@andros.cygnus.com)
837
838         * coff-sparc.c (sparccoff_vec): Have leading underscores.
839
840 Tue Jul 12 12:08:10 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
841
842         * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c,
843         hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c,
844         rs6000-core.c, trad-core.c:  Remove SEC_ALLOC flag from .reg
845         sections, .reg sections are not allocated and contain debug
846         information only.
847         * osf-core.c (make_bfd_asection, osf_core_core_file_p):  Use
848         bfd_make_section_anyway instead of building unique section names.
849
850 Tue Jul 12 11:41:22 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
851
852         * libelf.h (bfd_elf32_swap_symbol_in): Declare.
853         (bfd_elf32_swap_symbol_out): Declare.
854         (bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare.
855         * elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast.
856
857         * aout-encap.c (ARCH): Don't define.  Obsolete.
858         * aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise.
859         * i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise.
860         * i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise.
861         * newsos3.c, sparclynx.c, sunos.c: Likewise.
862
863 Mon Jul 11 20:08:23 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
864
865         * section.c (STD_SECTION): Make the sixth argument boolean, not
866         the seventh.  From gary@tuva.pacsemi.oz.au (gary kopff).
867
868 Sun Jul 10 09:12:02 1994  D. V. Henkel-Wallace  (gumby@cygnus.com)
869
870         * aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE
871         in order not to collide with LynxOS's definition of FREE in
872         /usr/include/sys/proc.h
873
874 Thu Jul  7 14:18:06 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
875
876         * reloc.c (bfd_perform_relocation): Don't clobber the relocation
877         value for coff-Intel-little or coff-Intel-big.  Hack upon hack.
878
879 Thu Jul  7 10:10:34 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
880
881         * aoutx.h (howto_table_std):  Add entry for GOT relocations
882         which are present in sun3 shared libraries, to avoid assertions
883         when reading the dynamic relocations.
884
885 Thu Jul  7 10:19:20 1994  Jeff Law  (law@snake.cs.utah.edu)
886
887         * som.h (R_HPPA_COMPLEX): Fix dumb typo. 
888
889 Wed Jul  6 19:21:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
890
891         * hosts/sysv4.h (qsort, strtol): Don't declare.
892
893         * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook
894         if it is NULL.
895
896         * elf32-mips.c (mips_elf_final_write_processing): Add ignored info
897         argument to correspond to recent libelf.h change.
898
899 Wed Jul  6 00:48:57 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
900
901         * coff-alpha.c (alpha_ecoff_mkobject_hook):  New hook to
902         additionally copy object type information from the alpha file
903         header to the BFD flags.
904         (alpha_ecoff_backend_data):  Use it.
905         (ecoffalpha_little_vec):  Add DYNAMIC to object_flags.
906         * aout64.c:  Fix typo in conditional QMAGIC definition.
907
908 Wed Jul  6 00:13:17 1994  Jeff Law  (law@snake.cs.utah.edu)
909
910         * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the
911         value of clicksz to help weed out non HPPA BSD core files.
912
913 Tue Jul  5 13:26:02 1994  Stan Shebs  (shebs@andros.cygnus.com)
914
915         Mach 3 support.
916         * config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*):
917         New targets.
918         * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize
919         "mach3" instead of "mach".
920         (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts.
921         * targets.c (m88kmach3_vec): New target vector.
922         (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but
923         inside #if 0.
924         * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by
925         checking for execute permission, instead of looking at entry
926         point.
927         * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR,
928         N_SHARED_LIB, don't include aout/*.h files, etc.
929         * m88kmach3.c: New file, m88k Mach 3 target.
930         * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target
931         makefile fragments.
932         * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh:
933         New files, host makefile fragments.
934         * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions.
935
936 Tue Jul  5 13:56:52 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
937
938         * elfcode.h (swap_out_syms): Get alignment of common symbol from
939         st_value field of saved ELF symbol information, if there is any.
940
941 Mon Jul  4 19:13:32 1994  Jeff Law  (law@snake.cs.utah.edu)
942
943         * som.h (R_HPPA_COMPLEX): Define.
944         * elf32-hppa.h (R_HPPA_COMPLEX): Define.
945         (elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17.
946
947 Fri Jul  1 12:07:41 1994  Jeff Law  (law@snake.cs.utah.edu)
948
949         * Support code for enabling the new style linker for PA ELF.
950         * elfcode.h (swap_symbol_in, swap_symbol_out): Externalize.
951         (elf_compute_section_file_positions): Pass link_info to
952         the begin_write_processing hook.
953         (bfd_elf_write_object_contents): Pass NULL for new link_info
954         argument to final_write_processing hook.
955         (elf_link_output_sym): Accept new "input_section" argument for
956         the symbols's input section.  All callers changed.  Call the
957         link_output_symbol_hook if it's defined.
958         (elf_bfd_final_link): Call the final_write_processing hook if
959         it's defined.
960         * libelf.h (elf_backend_link_output_symbol_hook): Declare.
961         (elf_backend_begin_write_processing): Add new "info" argument.
962         (elf_backend_final_write_processing): Likewise.
963         * elf32-target.h (elf_backend_link_output_symbol_hook): Provide
964         a default definition.
965         (elf32_bed): Add elf_backend_link_output_symbol_hook.
966         * elf64-target.h: Likewise.
967         
968         * Major rework of the PA ELF code.  Uses the new style BFD
969         linker, major cleanups.
970         * hppa_stubs.h: Rewrite from scratch.  Much smaller and simpler.
971         * elf32-hppa.h: Delete all symbol extension related code.
972         (hppa_look_for_stubs_in_section): Delete decl.
973         (elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls.
974         * elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h
975         into elf32-hppa.c.  Do not include aout64.h.
976         (typdef hppa_stub_type): Delete.
977         (elf32_hppa_stub_name_list_struct): Delete.
978         (elf32_hppa_stub_description_struct): Delete.
979         (arg_reloc_type): Use simpler enumerations.  All references changed.
980         (arg_location, arg_reloc_relocation): Likewise.
981         (elf32_hppa_symextn_map_struct): Delete.
982         (get_symbol_value): Delete.
983         (elf32_hppa_get_sym_extn): Delete.
984         (find_stubs, new_stubs, type_of_mismatch): Delete.
985         (find_stub_by_name, add_stub_by_name): Delete.
986         (hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete.
987         (hppa_elf_arg_reloc_needed): Renamed.  Simplify.
988         (hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete.
989         (hppa_elf_long_branch_needed_p): Delete.
990         (hppa_look_for_stubs_in_section): Delete.
991         (hppa_elf_get_section_contents): Delete.
992         (elf32_hppa_backend_symbol_processing): Delete.
993         (elf32_hppa_backend_section_processing): Delete.
994         (elf32_hppa_backend_section_from_shdr): Delete.
995         (elf32_hppa_backend_fake_sections): Delete.
996         (elf32_hppa_backend_section_from_bfd_section): Delete.
997         (NEW_INSTRUCTION): Delete.
998         (CURRENT_STUB_OFFSET): Delete.
999         (elf32_hppa_relocate_section): New function.
1000         (elf32_hppa_bfd_final_link_relocate): New function.
1001         (elf32_hppa_size_symext): New function.
1002         (elf32_hppa_link_output_symbol_hook): New function.
1003         (elf32_hppa_read_symext_info): New function.
1004         (elf32_hppa_add_symbol_hook): New function.
1005         (elf32_hppa_name_of_stub): New function.
1006         (elf32_hppa_size_of_stub): New function.
1007         (elf32_hppa_build_one_sub): New function.
1008         (elf32_hppa_build_stubs): New function.
1009         (elf32_hppa_size_stubs): New function.
1010         (linker, stub and argument hash tables): Add appropriate
1011         structures, definitions and functions to implement all three
1012         hash tables.
1013         (hppa_elf_relocate_insn): Don't need argument location information
1014         in this function.
1015         (add_entry_to_symext_chain): Accept a symbol's argument location
1016         information rather than the symbol itself.  All callers changed.
1017         (hppa_elf_gen_reloc_type): Simplify.
1018         (hppa_elf_set_section_contents): Stub section is no longer special.
1019         (hppa_elf_reloc): Greatly simplify.
1020         (elf32_hppa_begin_write_processing): Accept link_info argument.
1021         Handle being called from the BFD backend linker.
1022         (elf32_hppa_final_write_processing): Likewise.
1023         (elf_hppa_tc_make_sections): No longer call stub_finish.
1024         
1025 Mon Jun 27 18:07:06 1994  Steve Chamberlain  (sac@cirdan.cygnus.com)
1026
1027         * section.c (bfd_get_section_contents): Put in parens to get
1028         precedence right.
1029
1030 Sun Jun 26 18:08:29 1994  Jeff Law  (law@snake.cs.utah.edu)
1031
1032         * libelf.h (relocate_section): New argument "output_names" added
1033         to prototype.
1034         * elfcode.h (elf_link_input_bfd): New argument "output_names"
1035         added to prototype of relocate_section.  Pass the output symbol
1036         names to relocate_section.
1037         * elf32-i386.c (elf_i386_relocate_section): Use "output_names" to
1038         determine the name of a local symbol.
1039         * elf32-mips.c (mips_elf_relocate_section): Likewise.
1040         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1041
1042 Fri Jun 24 08:15:42 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
1043
1044         Add Solaris BCP (the part of Solaris which allows it to run
1045         SunOS4 a.out files) core file handling.
1046         * aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp):
1047         New structure and its swap in function.
1048         (internal_sunos_core):  New member c_data_addr, to receive the
1049         start address of the data section in the core file.
1050         (swapcore_sun3, swapcore_sparc, sunos4_core_file_p):  Use it.
1051         (sunos4_core_file_p):  Recognize Solaris BCP core file.
1052         (sunos4_core_file_matches_executable_p):  Always indicate match
1053         for Solaris BCP core files.
1054
1055 Thu Jun 23 15:31:28 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
1056
1057         Preliminary support for generating shared libraries, from Eric
1058         Youngdale <ericy@cais.cais.com>.
1059         * elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN.
1060         (elf_link_add_object_symbols): If generating a shared library,
1061         create dynamic sections for first input BFD with the right format.
1062         (elf_link_create_dynamic_sections): Don't create .interp section
1063         if creating a shared library.
1064         (elf_link_input_bfd): Skip dynamic sections in input file.
1065         (elf_bfd_final_link): If creating a shared library, it's OK for
1066         dynobj to have sections which are not SEC_IN_MEMORY.
1067         * elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp
1068         section if not creating a shared library.
1069         * elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise.
1070
1071         * elfcode.h (elf_object_p): Don't set DYNAMIC just because there
1072         is an SHT_DYNAMIC section.
1073
1074         * cf-i386lynx.c (i386coff_vec): Don't include DYNAMIC in
1075         object_flags.
1076         * coff-sparc.c (sparccoff_vec): Likewise.
1077         * hppabsd-core.c (hppabsd_core_vec): Likewise.
1078
1079         * aoutx.h (NAME(aout,some_aout_object_p)): Don't set SEC_RELOC
1080         just because DYNAMIC is set.
1081
1082 Thu Jun 23 12:53:41 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
1083
1084         * configure.in: Change --with-targets to --enable-targets and
1085         --with-64-bit-bfd to --enable-64-bit-bfd.
1086         * Makefile.in, mpw-make.in, targets.c: Change comments.
1087
1088 Wed Jun 22 17:59:59 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1089
1090         * config.bfd (powerpc-*-elf*): New target, just like
1091         powerpc-*-sysv4*.
1092
1093         * linker.c (FAIL): Undefine macro before defining as enum.
1094
1095 Wed Jun 22 10:52:47 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
1096
1097         * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
1098         pass from abfd->archive_pass, and save it there as well.
1099
1100         * hash.c (bfd_hash_allocate): Don't call bfd_set_error if
1101         obstack_alloc returns NULL unless the size is non-zero.
1102
1103         * linker.c (archive_hash_allocate): Define.
1104         (_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate
1105         rather than obstack_alloc, for clarity.
1106
1107         * elfcode.h (elf_get_reloc_upper_bound): Correct.
1108
1109         * aout64.c (BMAGIC, QMAGIC): Define if not already defined.  From
1110         Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
1111
1112         Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
1113         * libaout.h (struct aoutdata): Add field zmagic_disk_block_size.
1114         * aout-target.h (MY(callback)): Only set alignment according to
1115         architecture if the section sizes are aligned to that alignment,
1116         for backward compatibility.
1117         (MY(set_sizes)): Initialize zmagic_disk_block_size field.
1118         * aoutx.h (adjust_z_magic): Set ztih if using q_magic_format.  Set
1119         text section filepos to zmagic_disk_block_size if not ztih.  Use a
1120         different padding algorithm if not ztih.
1121         * i386linux.c (MY_text_includes_header): Don't define.
1122
1123         * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN
1124         symbols; don't look them up in the hash table.  From
1125         ralphc@pyramid.com (Ralph Campbell).
1126
1127 Tue Jun 21 11:47:20 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
1128
1129         * coff-go32.c (go32coff_archive_p): Remove unused function.
1130
1131         * section.c (bfd_abs_section): Make const.
1132         (bfd_abs_section_ptr, bfd_is_abs_section): Define.
1133         (bfd_und_section): Make const.
1134         (bfd_und_section_ptr, bfd_is_und_section): Define.
1135         (bfd_com_section): Make const.
1136         (bfd_com_section_ptr): Define.
1137         (bfd_ind_section): Make const.
1138         (bfd_ind_section_ptr, bfd_is_ind_section): Define.
1139         (bfd_abs_symbol, bfd_com_symbol): Make const.
1140         (bfd_und_symbol, bfd_ind_symbol): Likewise.
1141         (global_syms): Cast initialization of section field.
1142         (STD_SECTION): Define as const, and cast initializations.
1143         * bfd-in2.h: Rebuilt.
1144         * Many files: Change uses of bfd_abs_section, etc., to use
1145         bfd_abs_section_ptr or bfd_is_abs_section, etc.
1146
1147 Mon Jun 20 11:06:27 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
1148
1149         * Many files: change all bfd_target vectors to be const.  Change
1150         all uses of bfd_target * to be const bfd_target *.  Change
1151         bfd_target_vector and bfd_default_vector arrays to be const
1152         bfd_target * const *.
1153
1154         * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c,
1155         elf32-mips.c: Renamed all externally visible ECOFF routines which
1156         are local to BFD to start with _bfd_ecoff instead of just ecoff.
1157
1158         * ecoff.c (ecoff_swap_tir_in): Change input argument to const.
1159         (ecoff_swap_tir_out): Likewise.
1160         (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
1161         (ecoff_slurp_symbolic_info): Add new arguments to correspond to
1162         read_debug_info entry point in ecoff_debug_swap structure.
1163         Change all calls.
1164         * libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
1165         * ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
1166         (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
1167         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new
1168         ecoff_debug_swap fields.
1169         * coff-mips.c (mips_ecoff_backend_data): Likewise.
1170         * elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
1171         (mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
1172         fields.
1173         * configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
1174         ecofflink.o.
1175         (bfd_elf32_littlemips_vec): Likewise.
1176         (ecoff_big_vec, ecoff_little_vec): Likewise.
1177         (ecoffalpha_little_vec): Likewise.
1178         * Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
1179         (BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
1180
1181         * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
1182         when computing reloc sizes.  From Eric Youngdale
1183         <ericy@cais.cais.com>.
1184         * elfcode.h (elf_bfd_final_link): Don't try to compute maximum
1185         reloc count or size for a non-ELF file.
1186
1187         * mipsbsd.c (MY_final_link_callback): Define to avoid warning.
1188
1189         * hp300hpux.c (MY_final_link_callback): Define to avoid warning.
1190         (BMAGIC, QMAGIC): Define; used by aoutx.h.
1191         (MY(slurp_symbol_table)): Change translate_from_native_sym_flags
1192         calls to use new parameters.
1193
1194 Fri Jun 17 14:45:32 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1195
1196         * aout-target.h (MY(callback)): Set the alignments of the text,
1197         data and bss sections after determining the architecture.
1198
1199         * sunos.c (sunos_add_one_symbol): Treat a common symbol from a
1200         dynamic object as being in the .bss section of the object, rather
1201         than as being undefined.
1202
1203 Fri Jun 17 11:16:50 1994  Jeff Law  (law@snake.cs.utah.edu)
1204
1205         * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE.
1206
1207         * elf32-hppa.h (elf_hppa_final_processing): Delete decl.
1208
1209 Thu Jun 16 23:36:23 1994  Jeff Law  (law@snake.cs.utah.edu)
1210
1211         * elfcode.h (elf_link_input_bfd): Don't try to read local symbols
1212         if there aren't any in the input file.
1213
1214 Thu Jun 16 14:25:22 1994  Eric Youngdale  (ericy@cais.cais.com)
1215
1216         * i386linux.c: Many new functions and definitions for linker
1217         support for Linux shared libraries.
1218         * bfd-in.h (bfd_linux_size_dynamic_sections): Declare.
1219         * bfd-in2.h: Rebuild.
1220
1221 Thu Jun 16 14:23:46 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1222
1223         * config.bfd: If second argument is ``_'', then, instead of
1224         echoing config file name, echo whether target uses leading
1225         underscores on symbol names.  Add appropriate settings to
1226         different cases.  Used by binutils/configure.in to set default for
1227         c++filt.
1228
1229         * elfcode.h (elf_bfd_final_link): If trying to generate a shared
1230         object, warn and return false.
1231
1232         * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects
1233         and treat them as OMAGIC.
1234
1235 Wed Jun 15 18:02:21 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1236
1237         Enable sparc v9 support for release.  Note that this is still a
1238         work in progress, pending release of an ABI specification.
1239         * config.bfd, configure.in: Include sparc v9 elf config.
1240         * elfcode.h (prep_headers): Handle sparc v9 (64 bit).
1241         * reloc.c (bfd_reloc_code_real): New reloc types.
1242         * elf64-sparc.c: Implement elf64-sparc target.
1243         * Makefile.in, targets.c: Updated.
1244
1245 Wed Jun 15 01:34:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1246
1247         * libelf.h (struct elf_obj_tdata): New field dt_needed_name.
1248         (elf_dt_needed_name): New accessor macro.
1249         * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
1250         is set, use that instead of the filename for the DT_NEEDED dynamic
1251         entry.
1252         * elf.c (bfd_elf_set_dt_needed_name): New function.
1253         * bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
1254         * bfd-in2.h: Rebuilt.
1255
1256         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
1257         argument, and set it to the .interp section.
1258         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
1259         (bfd_elf64_size_dynamic_sections): Likewise.
1260         * bfd-in2.h: Rebuilt.
1261
1262         * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare
1263         field of the reloc rather than letting it be garbage.
1264
1265         * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as
1266         __.SYMDEF; the former was used in old Linux archives.  From
1267         jrs@world.std.com (Rick Sladkey).
1268
1269         * i386linux.c (i386linux_write_object_contents): Define; like
1270         MY(write_object_contents) in aout-target.h, but set MACHTYPE to
1271         M_386.  From jrs@world.std.com (Rick Sladkey).
1272         (MY_write_object_contents): Define.
1273
1274         * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols
1275         as N_DATA symbols.
1276         (aout_link_add_symbols): Likewise.
1277
1278         * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash
1279         tables.
1280         (struct stringtab_entry, struct stringtab_data): Remove.
1281         (HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove.
1282         (struct strtab_hash_entry, struct strtab_hash): Define.
1283         (strtab_hash_newfunc, strtab_hash_lookup): Define.
1284         (stringtab_free, emit_stringtab): Define.
1285         (stringtab_init, add_to_stringtab): Rewrite.
1286         (NAME(aout,write_syms)): Use new stringtab code.
1287         (struct aout_final_link_info, NAME(aout,final_link)): Likewise.
1288         (aout_link_write_symbols, aout_link_write_other_symbol): Likewise.
1289
1290         * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to
1291         request BFD to write object in the traditional format, whatever
1292         that means for the particular backend.
1293         * bfd-in2.h: Rebuilt.
1294
1295         * hash.c (bfd_hash_allocate): If obstack_alloc fails, set
1296         bfd_error_no_memory.
1297
1298 Tue Jun 14 13:00:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1299
1300         * libaout.h (struct aoutdata): Add q_magic_format to subformat
1301         enum.
1302         * aout-target.h (MY_bfd_copy_private_bfd_data): Define as function
1303         if not already defined.  Copy subformat information.
1304         (MY_text_includes_header): Define as 0 if not already defined.
1305         (MY(backend_data)): Use MY_text_includes_header rather than 0.
1306         (MY_final_link_callback): Rename from final_link_callback, and
1307         define only if MY_final_link_callback is not already defined.
1308         (MY_bfd_final_link): Rename use of final_link_callback to
1309         MY_final_link_callback.
1310         * aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like
1311         ZMAGIC, but set the subformat to q_magic_format.  Abort if the
1312         magic number if not recognized.
1313         (adjust_z_magic): Use QMAGIC if q_magic_format.
1314         * i386linux.c (MY_text_includes_header): Define as 1.
1315         (i386linux_bfd_final_link): New static function.
1316         (MY_bfd_final_link): Define as i386linux_bfd_final_link.
1317
1318         * aoutx.h (translate_to_native_sym_flags): Check both section and
1319         output_section against sections of abfd.
1320
1321         * libecoff.h (struct ecoff_link_hash_entry): Change type of
1322         written from boolean to char.  Add new field small.
1323         * ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0
1324         rather than false.  Initialize small to 0.
1325         (ecoff_link_add_externals): If ECOFF type is scSUndefined, set
1326         small.  If small is set, and hash table type is common, force the
1327         symbol into a section named SCOMMON and change the ECOFF type from
1328         scCommon to scSCommon.
1329         (ecoff_link_write_external): Set written to 1 rather than true.
1330         * coff-mips.c (mips_relocate_section): Correct JMPADDR reloc
1331         overflow check to consider section VMA of input file.
1332
1333 Mon Jun 13 14:20:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1334
1335         * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a
1336         machine type of 68000.
1337         * aoutx.h (NAME(aout,machine_type)): Add new argument unknown.
1338         Set *unknown to true if machine type is really unknown, as opposed
1339         to M_UNKNOWN for the 68000.
1340         (NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call
1341         accordingly.
1342         * libaout.h (NAME(aout,machine_type)): Add new argument to
1343         prototype.
1344
1345 Sun Jun 12 20:21:03 1994  Jeff Law  (law@snake.cs.utah.edu)
1346
1347         * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID
1348         or HIUX_AUX_ID.
1349         (som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID.
1350         (som_write_armap): Use CPU_PA_RISC1_0 as the magic number.  Note
1351         som.c is careful to always define CPU_PA_RISC1_0.
1352
1353 Sat Jun 11 16:32:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1354
1355         Add weak symbols as an extension to a.out.
1356         * aoutx.h (sym_in_text_section): Don't define.
1357         (sym_in_data_section, sym_in_bss_section): Likewise.
1358         (sym_is_undefined, sym_is_global_defn): Likewise.
1359         (sym_is_debugger_info, sym_is_fortrancommon): Likewise.
1360         (sym_is_absolute, sym_is_indirect): Likewise.
1361         (translate_from_native_sym_flags): Rewrite for clarity.  Rearrange
1362         arguments and change caller.  Handle weak symbols.
1363         (translate_to_native_sym_flags): Likewise.
1364         (aout_link_check_ar_symbols): Don't ignore weak symbols.  Pull
1365         object in from archive if a weak defintion is found for an
1366         existing undefined symbol.
1367         (aout_link_add_symbols): Put all cases in switch.  Set flags of an
1368         undefined symbol to 0.  Handle weak symbols.
1369         (aout_link_write_symbols): Handle weak symbols.
1370         (aout_link_write_other_symbol): Likewise.
1371         (aout_link_input_section_std): Likewise.
1372         (aout_link_input_section_ext): Likewise.
1373         * sunos.c (sunos_write_dynamic_symbol): Likewise.
1374
1375 Fri Jun 10 13:25:13 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1376
1377         * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
1378         (NAME(aout,get_reloc_upper_bound)): Likewise.
1379
1380         * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR.
1381         * linker.c (_bfd_generic_link_write_global_symbol): Don't assume
1382         the section of a common symbol is not NULL.
1383
1384 Wed Jun  8 23:15:53 1994  Stu Grossman  (grossman@cygnus.com)
1385
1386         * nlmcode.h (nlm_object_p):  Set EXEC_P and start address for GDB.
1387
1388 Wed Jun  8 23:57:34 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1389
1390         * aoutx.h (aout_get_external_symbols): Don't try to read the
1391         strings if there are no symbols.
1392         (aout_link_write_other_symbol): Use the output section when
1393         working out the type.
1394
1395 Tue Jun  7 13:25:08 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1396
1397         * elfcode.h (assign_section_numbers): Put shstrtab, symtab and
1398         strtab sections at end of file.  Avoids bug in some versions of
1399         SVR4 strip.  From Eric Youngdale <eric@tantalus.nrl.navy.mil>.
1400
1401         * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined,
1402         set SEC_DEBUGGING for STYP_INFO sections.
1403         (coff_compute_section_file_positions): If COFF_PAGE_SIZE is
1404         defined, and D_PAGED is set, set the file position equal to the
1405         section VMA modulo COFF_PAGE_SIZE.
1406         * coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED.
1407         * coff-i386.c: Set D_PAGED in BFD target.
1408         (COFF_PAGE_SIZE): Define.
1409         * coff-m68k.c, coff-sparc.c: Likewise.
1410
1411 Mon Jun  6 10:57:28 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1412
1413         * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section
1414         into a BFD section just because SHF_ALLOC is set; require that it
1415         not use the normal symbol table.
1416         (elf_section_from_bfd_section): Corresponding change.
1417
1418         Better indirect and warning symbol handling inspired by Stuart
1419         Quick <stuck@cs.man.ac.uk>.
1420         * linker.c (enum link_action): Add REF, MIND, CWARN, REFC.
1421         (link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT
1422         to REF.  Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to
1423         REFC.  Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF.
1424         Change DEFW_ROW/indr from CYCLE to NOACT.  Change INDR_ROW/indr
1425         from MDEF to MIND.  Change INDR_ROW/warn from WARNC to CYCLE.
1426         Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN.  Change
1427         WARN_ROW/com from MWARN to WARN.  Change WARN_ROW/warn from NOACT
1428         to CYCLE.  Change SET_ROW/warn from WARNC to CYCLE>
1429         (_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and
1430         REFC.  If a new indirect symbol has been referenced, push the
1431         reference down to the symbol it points to.  FIx handling of WARN.
1432         * aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't
1433         clobber e_type of next symbol.
1434         (translate_to_native_sym_flags): Likewise.
1435         (aout_link_write_symbols): Loop on bfd_link_hash_warning as well
1436         as bfd_link_hash_indirect.
1437
1438         * libaout.h (struct aout_link_hash_entry): New field written.
1439         * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written.
1440         (aout_link_write_symbols): Use written, not root.written.
1441         (aout_link_write_other_symbol): Likewise.
1442         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
1443         * libecoff.h (struct ecoff_link_hash_entry): New field written.
1444         * ecoff.c (ecoff_link_hash_newfunc): Initialize written.
1445         (ecoff_link_write_external): use written, not root.written.
1446         * genlink.h (struct generic_link_hash_entry): New field written.
1447         * linker.c (_bfd_link_hash_newfunc): Don't initialize written.
1448         (generic_link_hash_newfunc): Initialize written.
1449         (_bfd_generic_link_output_symbols): Use written, not root.written.
1450         (_bfd_generic_link_write_global_symbol): Likewise.
1451         (_bfd_generic_reloc_link_order): Likewise.
1452
1453         * libecoff.h (ecoff_data_type): Add linker field.
1454         * ecoff.c (ecoff_write_object_contents): Check new tdata linker
1455         field, rather than outsymbols being non-NULL, to decide whether to
1456         output the symbols and relocs.
1457         (ecoff_bfd_final_link): Set new tdata linker field to true.
1458
1459         * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy
1460         data to a non-ECOFF file.
1461
1462         * libbfd-in.h: Add warning that libbfd.h is a generated file.
1463         * libbfd.h: Rebuilt.
1464
1465 Sun Jun  5 15:02:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1466
1467         Changes to support ELF strip and objcopy on dynamically linked
1468         files.
1469         * elfcode.h (elf_fake_sections): Add prototype.
1470         (bfd_section_from_shdr): Make a BFD section from an SHT_HASH
1471         section, and from an SHT_DYNSYM section, and from the dynamic
1472         string table section.
1473         (elf_object_p): Set D_PAGED if there is a program header.
1474         (elf_make_sections): Remove.
1475         (fix_up_strtabs): Remove.
1476         (elf_fake_sections): Rewrite.  Now sets sh_entsize.
1477         (assign_section_numbers): Rewrite.  Now sets sh_link and sh_info
1478         for all sections.
1479         (elf_compute_section_file_positions):  Don't call obsolete
1480         functions elf_make_sections or fix_up_strtabs.
1481         (swap_out_syms): Set sh_addralign to FILE_ALIGN rather than 4.
1482         (NAME(bfd_elf,write_object_contents)): Permit writing DYNAMIC
1483         objects.
1484         (elf_section_from_bfd_section): Treat SHT_DYNSYM like other normal
1485         sections.  If an SHT_REL or SHT_RELA section is allocated or uses
1486         an unusual symbol table, permit a BFD section to map to it.
1487         Permit most SHT_STRTAB sections to have a BFD section mapped to
1488         them.
1489         (elf_bfd_final_link): Don't set sh_link, sh_info or sh_entsize
1490         fields of dynamic sections here; do it in assign_section_numbers.
1491         * elf32-target.h, elf64-target.h: Add D_PAGED to permitted object
1492         flags.
1493
1494         * elf.c (_bfd_elf_make_section_from_shdr): Only set SEC_DATA if
1495         SEC_LOAD is set, rather than checking SEC_ALLOC.
1496
1497         * libbfd-in.h (bfd_realloc): Change last arg to "size_t size".
1498
1499 Fri Jun  3 10:58:02 1994  Jeff Law  (law@snake.cs.utah.edu)
1500
1501         * som.c (som_write_object_contents): Don't compute the file header's
1502         checksum here.
1503         (som_write_headers): Instead do it here.
1504
1505         * libbfd.h (bfd_realloc): Change last arg to "size_t size".
1506
1507 Thu Jun  2 17:39:22 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1508
1509         * hosts/sun3.h: Include <stdlib.h>.  Don't declare free, exit or
1510         getenv.
1511
1512         Add linker support for SunOS shared libraries.
1513         * sunos.c: Include bfdlink.h.  Add many new functions and
1514         definitions for SunOS shared library support.
1515         * bfd-in.h (bfd_sunos_record_link_assignment): Declare.
1516         (bfd_sunos_size_dynamic_sections): Declare.
1517         * bfd-in2.h: Rebuilt.
1518         * aoutx.h (struct aout_link_hash_entry): Move to libaout.h.
1519         (struct aout_link_hash_table): Likewise.
1520         (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
1521         (aout_hash_table): Likewise.
1522         (NAME(aout,link_hash_newfunc)): Rename from aout_link_hash_newfunc
1523         and make externally visible.
1524         (NAME(aout,link_hash_table_init)): New function.
1525         (NAME(aout,link_hash_table_create)): Call
1526         NAME(aout,link_hash_table_init), not _bfd_link_hash_table_init.
1527         (aout_link_add_symbols): Don't fail if no symbols.  If it exists,
1528         call add_dynamic_symbols backend entry point for dynamic objects.
1529         Use add_one_symbol backend entry point if it exists.
1530         (NAME(aout,final_link)): Call finish_dynamic_link backend entry
1531         point, if it exists.
1532         (aout_link_input_bfd): For a dynamic object, call
1533         link_dynamic_object backend entry point, if it exists.
1534         (aout_link_write_other_symbol): Call write_dynamic_symbol backend
1535         entry point, if it exists.
1536         (aout_link_input_section): Don't read the relocs if they have
1537         already been read.
1538         (aout_link_input_section_std): When doing a final link, for a
1539         reloc against an external symbol, call check_dynamic_reloc backend
1540         entry point, if it exists.
1541         (aout_link_input_section_ext): Likewise.
1542         * libaout.h: Protect against multiple inclusion.  Include
1543         bfdlink.h.
1544         (struct aout_link_hash_entry): Move in from aoutx.h.
1545         (struct aout_link_hash_table): Likewise.
1546         (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
1547         (aout_hash_table): Likewise.
1548         (struct aout_backend_data): Add fields add_dynamic_symbols,
1549         add_one_symbol, link_dynamic_object, write_dynamic_symbol,
1550         check_dynamic_reloc, and finish_dynamic_link.
1551         (struct aout_section_data_struct): Define new structure.
1552         (aout_section_data): Define new accessor macro.
1553         (NAME(aout,link_hash_newfunc)): Declare.
1554         (NAME(aout,link_hash_table_init)): Declare.
1555         * aoutf1.h (sunos4_aout_backend): Initialize new aout_backend_data
1556         fields.
1557         * aout-target.h (MY(backend_data)): Likewise.
1558         * i386aout.c (MY(backend_data)): Likewise.
1559         * i386mach3.c (MY(backend_data)): Likewise.
1560         * mipsbsd.c (MY(backend_data)): Likewise.
1561         * sparclynx.c (sparclynx_aout_backend): Likewise.
1562
1563         * aoutx.h (NAME(aout,slurp_symbol_table)): Don't zero out cached
1564         until we know it is non-NULL.
1565         (aout_link_write_symbols): Don't skip a warning symbol even if it
1566         has already been written out.  If skipping an indirect symbol,
1567         skip the next symbol as well.
1568
1569 Wed Jun  1 14:37:50 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1570
1571         * hosts/sun3.h: Don't declare qsort, malloc or realloc.
1572
1573 Thu May 26 13:56:03 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1574
1575         * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer
1576         to char pointer to avoid compiler warnings.
1577
1578         * dep-in.sed: Remove spaces before colons.
1579
1580         Merged changes back in from FSF gas release 2.3:
1581
1582         * Makefile.in (stmp-bfd.h): Wrap `if' block around grep
1583         invocation, to avoid a bug in BSD 4.4 make.
1584
1585         From Ralph Campbell:
1586         * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an
1587         error.
1588         (mips_fix_hi16_s): Ditto.
1589
1590         Fri May 13 21:21:00 1994  DJ Delorie (dj@ctron.com)
1591
1592         * makefile.dos: define a default target, or archives won't work
1593           due to multiple matches.
1594
1595         Wed May 11 22:32:00 1994  DJ Delorie (dj@ctron.com)
1596
1597         * configure.bat: update for latest files
1598         * makefile.dos: update for correct targets and sources
1599         * coff-go32.c: [new] go32's COFF format (i386coff with underscores)
1600         * targets.c: add go32coff target
1601         * makefile.in: add coff-go32.c support
1602
1603 Thu May 26 10:10:21 1994  Jeff Law  (law@snake.cs.utah.edu)
1604
1605         * som.c (som_prep_headers): Do not set the system_id here, private
1606         bfd data has not been copied yet.
1607         (som_write_headers): Instead do it here.
1608
1609 Tue May 24 16:17:18 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1610
1611         Make MIPS ELF use new ELF backend linker.  No shared library
1612         support yet.
1613         * elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function.
1614         (bfd_mips_elf32_swap_gptab_out): New function.
1615         (mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab.
1616         (mips_elf_final_write_processing): Set sh_info field for .gptab.*
1617         sections.
1618         (mips_elf_fake_sections): Set sh_entsize for .gptab.* sections.
1619         (mips_elf_read_ecoff_info): Read and free external symbols last,
1620         not first, for clarity.
1621         (struct mips_elf_link_hash_entry): Define new structure.
1622         (struct mips_elf_link_hash_table): Define new structure.
1623         (mips_elf_link_hash_lookup): Define new macro.
1624         (mips_elf_link_hash_traverse): Define new macro.
1625         (mips_elf_hash_table): Define new macro.
1626         (mips_elf_link_hash_newfunc): New static function.
1627         (mips_elf_link_hash_table_create): New static function.
1628         (mips_elf_add_symbol_hook): New static function.
1629         (struct extsym_info): Define new structure.
1630         (mips_elf_get_extr, mips_elf_set_index): Remove.
1631         (mips_elf_output_extsym): New static function.
1632         (gptab_compare): New static function.
1633         (mips_elf_final_link): Rewrite to use ELF backend linker, and to
1634         merge gptab information in input files.
1635         (mips_elf_relocate_hi16): New static function.
1636         (mips_elf_relocate_section): New static function.
1637         (bfd_elf32_bfd_link_hash_table_create): Define as macro before
1638         including elf32-target.h.
1639         (elf_backend_relocate_section): Likewise.
1640         (elf_backend_add_symbol_hook): Likewise.
1641         * elf.c (_bfd_elf_link_hash_newfunc): Rename from
1642         elf_link_hash_newfunc and make globally visible.  Change caller.
1643         (_bfd_elf_link_hash_table_init): New function, broken out of
1644         _bfd_elf_link_hash_table_create.
1645         (_bfd_elf_link_hash_table_create): Use
1646         _bfd_elf_link_hash_table_init.
1647         * libelf.h (struct elf_obj_tdata): Add new field bad_symtab.
1648         (elf_bad_symtab): Define new accessor macro.
1649         (_bfd_elf_link_hash_newfunc): Declare.
1650         (_bew_elf_link_hash_table_init): Declare.
1651         * elfcode.h (elf_object_p): Call backend object_p hook after
1652         swapping in all the section headers.
1653         (map_program_segments): Correct typo: Internal for External.
1654         (elf_link_add_object_symbols): If elf_bad_symtab is set, read all
1655         the symbols.  Skip STB_LOCAL symbols rather than giving an error.
1656         (elf_bfd_final_link): If elf_bad_symtab is set, allocate space for
1657         all symbols, not just locals.
1658         (elf_link_output_extsym): Only skip a symbol not mentioned by a
1659         regular file if it is mentioned by a dynamic object.
1660         (elf_link_input_bfd): If elf_bad_symtab is set, read all the
1661         symbols.
1662
1663 Fri May 20 13:38:23 1994  Jeff Law  (law@snake.cs.utah.edu)
1664
1665         * som.c (som_set_reloc_info): Do not set any relocation info
1666         for SOM fixups which are never passed to BFD.
1667
1668 Fri May 20 11:57:05 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1669
1670         * coff-mips.c (mips_relocate_section): Add MIPS_R_JMPADDR overflow
1671         checking.
1672
1673         * elf32-i386.c (elf_i386_size_dynamic_sections): Add DT_DEBUG to
1674         the dynamic linking information for the benefit of the debugger.
1675         From Peter Schauer.
1676         * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
1677
1678         * elf.c (_bfd_elf_make_section_from_shdr): New function, based on
1679         code repeated three times in bfd_section_from_shdr in elfcode.h.
1680         * libelf.h (_bfd_elf_make_section_from_shdr): Declare.
1681         * elfcode.h (bfd_section_from_shdr): Use new function
1682         _bfd_elf_make_section_from_shdr to create BFD sections.  If a
1683         reloc section does not use the main symbol table, or it is part of
1684         the process image, treat it as a normal section, not relocs.
1685         * elf32-mips.c (mips_elf_section_from_shdr): Use new function
1686         _bfd_elf_make_section_from_shdr.
1687
1688 Thu May 19 11:37:11 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1689
1690         * elf32-target.h, elf64-target.h: Change ar_max_namelen value from
1691         15 to 14 to match SVR4 ar.
1692
1693         Add support for ELF shared libraries.  Loosely based on work by
1694         Eric Youngdale <ericy@cais.com>.
1695         * libelf.h (struct elf_backend_data): Add new fields for dynamic
1696         linking: elf_backend_create_dynamic_sections,
1697         elf_backend_adjust_dynamic_symbol,
1698         elf_backend_size_dynamic_sections,
1699         elf_backend_finish_dynamic_symbol,
1700         elf_backend_finish_dynamic_sections.
1701         (struct elf_link_hash_entry): Change type of align field to
1702         bfd_size_type.  Add fields dynindx, dynstr_index, weakdef,
1703         elf_link_hash_flags.
1704         (struct elf_link_hash_table): Add fields dynobj, dynsymcount,
1705         dynstr, bucketcount.
1706         (bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
1707         (bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
1708         (bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
1709         (bfd_elf32_add_dynamic_entry): Declare.
1710         (bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
1711         (bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
1712         (bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
1713         (bfd_elf64_add_dynamic_entry): Declare.
1714         * elfcode.h (Elf_External_Dyn): Define.
1715         (elf_swap_reloc_in): Define as macro using NAME.  Make externally
1716         visible.
1717         (elf_swap_reloc_out): Likewise.
1718         (elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
1719         (elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
1720         and as new externally visible function.
1721         (elf_fake_sections): Set section type of dynamic sections based on
1722         section names.
1723         (elf_write_phdrs): Remove.
1724         (assign_file_position_for_section): Add new align argument.
1725         Change all callers.
1726         (get_program_header_size): New static function.
1727         (struct seg_info): Remove.
1728         (map_program_segments): Completely rewrite.
1729         (assign_file_positions_except_relocs): Completely rewrite.
1730         (assign_file_positions_for_relocs): Don't set a file position for
1731         sections which already have one.  Don't bother to align the file
1732         position here.
1733         (section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
1734         section types.
1735         (elf_section_from_bfd_section): Likewise.
1736         (elf_slurp_symbol_table): If section_from_elf_index fails, just
1737         use bfd_abs_section rather than returning an error.
1738         (elf_sizeof_headers): Make useful.
1739         (elf_link_record_dynamic_symbol): New static function.
1740         (elf_link_add_object_symbols): Handle dynamic objects.
1741         (elf_link_create_dynamic_sections): New static function.
1742         (elf_add_dynamic_entry): Define as macro using NAME and as new
1743         externally visible function.
1744         (NAME(bfd_elf,record_link_assignment)): New function.
1745         (elf_buckets): New static variable.
1746         (NAME(bfd_elf,size_dynamic_sections)): New function.
1747         (struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
1748         (elf_bfd_final_link): Handle dynamic linking.  Create a section
1749         symbol for all ELF sections, not all BFD sections.  Store section
1750         symbol index in target_index field, not index field.  Traverse
1751         over global symbols even if stripping.
1752         (elf_link_output_extsym): Output dynamic symbols.  Mark symbols
1753         defined by dynamic objects as undefined.
1754         (elf_link_input_bfd): Ignore dynamic objects.  Use target_index
1755         field for section relocs, and make sure it is set.
1756         (elf_reloc_link_order): Use target_index field for section relocs,
1757         and make sure it is set.
1758         * elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
1759         weakdef and elf_link_hash_flags fields.
1760         (_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
1761         dynstr and bucketcount fields.
1762         * elf32-target.h: Initialize new dynamic linking fields.
1763         * elf64-target.h: Likewise.  
1764         * elf32-i386.c: New functions for dynamic linking support.
1765         * elf32-sparc.c: Likewise.
1766         * bfd-in.h (bfd_elf32_record_link_assignment): Declare.
1767         (bfd_elf64_record_link_assignment): Declare.
1768         (bfd_elf32_size_dynamic_sections): Declare.
1769         (bfd_elf64_size_dynamic_sections): Declare.
1770         * bfd-in2.h: Rebuilt.
1771
1772 Wed May 18 08:29:04 1994  Ian Lance Taylor  (ian@cygnus.com)
1773
1774         * som.c: Don't include <sys/dir.h> or <sys/user.h>.
1775         (som_reloc_queue_find): Call memcmp instead of bcmp.
1776         (som_bfd_reloc_type_lookup): Change first argument to bfd *.
1777         (compare_syms): Change types of arguments to const void *.
1778         (bfd_section_from_som_symbol): Removed unused local found.
1779         (som_write_armap): Add elength, map, orl_count and int arguments.
1780         (som_write_armap): Use %ld and cast to long for getuid result.
1781
1782 Wed May 18 09:09:32 1994  Jeff Law  (law@snake.cs.utah.edu)
1783
1784         * elf32-hppa.h (R_HPPA_ABS_CALL): Define.
1785         * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle absolute calls.
1786
1787         * som.h (R_HPPA_ABS_CALL): Define.
1788         * som.c (hppa_som_gen_reloc_type): Delete complex relocation types.
1789
1790 Tue May 17 19:33:12 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1791
1792         * coff-i960.c (icoff_little_vec, icoff_big_vec): Indicate leading
1793         underscore, for compatibility with Intel tool chain (gnu960v2).
1794
1795 Mon May 16 10:09:22 1994  Jeff Law  (law@snake.cs.utah.edu)
1796
1797         * bfd-in2.h: Rebuilt.
1798
1799         * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
1800         likewise for other PA specific sections.
1801         (hppa_elf_relocate_unwind_table): Delete unused
1802         function.
1803         (elf_hppa_howto_table): Completely new table based on 94-02-02
1804         draft PA ELF spec.  Change relocation tags appropriately
1805         throughout elf32-hppa.c
1806         (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
1807         spec.
1808         (hppa_elf_reloc): Likewise.
1809         (hppa_look_for_stubs_in_section): Likewise
1810         (ELF_MACHINE_CODE): Change to EM_PARISC.
1811         * elf32-hppa.h: Include "elf/hppa.h".  Change relocation tags 
1812         appropriately throughout elf32-hppa.h.
1813         (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
1814         spec.
1815         (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
1816         * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
1817         * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
1818         * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.
1819
1820         * libhppa.h (hppa_field_adjust): Avoid adding constant_value into
1821         the final value twice for LR and RR field selectors.
1822
1823 Sat May 14 09:09:19 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
1824
1825         * aoutx.h (add_to_stringtab): Use BFD_ASSERT not assert.  This
1826         avoids __eprintf troubles.
1827
1828 Fri May 13 10:51:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1829
1830         * bout.c (b_out_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR.
1831
1832         * config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and
1833         ecoff_little_vec since Irix 5 supports ECOFF executables.
1834
1835 Wed May 11 00:31:57 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1836
1837         * ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr
1838         correctly.
1839
1840         * Makefile.in (stmp-bfd.h): Use || instead of ; to force SunOS
1841         make to invoke the shell.
1842
1843 Tue May 10 14:23:43 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1844
1845         * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from
1846         SEC_SHARED_LIBRARY for clarity.  Changed all uses.
1847         * bfd-in2.h: Rebuilt.
1848         * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is
1849         set, set STYP_NOLOAD.
1850         * coffgen.c (coff_section_from_bfd_index): Don't get an assertion
1851         failure because of a bad shared library.
1852
1853 Mon May  9 18:53:40 1994  Bill Cox  (bill@rtl.cygnus.com)
1854
1855         * linker.c: Add missing comment terminator.
1856
1857 Mon May  9 11:53:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1858
1859         * linker.c (_bfd_generic_link_add_one_symbol): If hashp and *hashp
1860         are not NULL, assume the caller has already looked up the symbol
1861         in the hash table and has stored the entry in *hashp.
1862         (generic_link_add_symbol_list): Set h to NULL before calling
1863         _bfd_generic_link_add_one_symbol.
1864         * ecoff.c (ecoff_link_add_externals): Likewise.
1865
1866         * elfcode.h (assign_file_positions_except_relocs): Don't require
1867         page shared between .data and .bss segments to contain zeroes.
1868
1869         * elfcode.h: Include bfdlink.h.  Added several new functions to do
1870         linking.
1871         (ELF_R_TYPE): Define.
1872         (bfd_add_to_strtab): Return unsigned long.  Change check for
1873         realloc failure.
1874         (elf_fake_sections): Check return value of bfd_add_to_strtab.
1875         (elf_compute_section_file_positions): Add link_info argument.
1876         Call elf_backend_begin_write_processing hook and prep_headers
1877         here.  Only call swap_out_syms if link_info is NULL.  Set up
1878         .shstrtab section here.  Pass dosyms argument to
1879         assign_file_positions_except_relocs.  Set output_has_begun flag.
1880         (assign_file_positions_for_symtab_and_strtabs): Add dosyms
1881         argument, and use it to control setting .symtab and .strtab file
1882         positions.
1883         (assign_file_positions_except_relocs): Add dosyms argument, and
1884         pass it on.
1885         (prep_headers): Check return value of bfd_add_to_strtab.
1886         (swap_out_syms): Likewise.  Also, don't set up .shstrtab here.
1887         (NAME(bfd_elf,write_object_contents)): Some calls moved into
1888         elf_compute_section_file_positions.
1889         (elf_set_section_contents): Likewise.
1890         (elf_slurp_symbol_table): SHN_LORESERV corrected to SHN_LORESERVE.
1891         * libelf.h: Include bfdlink.h.
1892         (struct elf_backend_data): Add fields collect,
1893         elf_add_symbol_hook, elf_backend_relocate_section.
1894         (struct bfd_elf_section_data): Add field rel_hashes.
1895         (struct elf_obj_tdata): Remove fields internal_syms and symbols.
1896         Add field sym_hashes.
1897         (obj_symbols, obj_internal_syms): Remove definitions.
1898         (elf_sym_hashes): Define.
1899         (struct elf_link_hash_entry): Define.
1900         (struct elf_link_hash_table): Define.
1901         (elf_link_hash_lookup): Define.
1902         (elf_link_hash_traverse): Define.
1903         (elf_hash_table): Define.
1904         (_bfd_elf_link_hash_table_create): Declare.
1905         (bfd_elf32_bfd_link_add_symbols): Declare.
1906         (bfd_elf32_bfd_final_link): Declare.
1907         (bfd_elf64_bfd_link_add_symbols): Declare.
1908         (bfd_elf64_bfd_final_link): Declare.
1909         * elf.c: Include bfdlink.h.
1910         (elf_link_hash_newfunc): New function.
1911         (_bfd_elf_link_hash_table_create): New function.
1912         * elf32-target.h (elf_backend_relocate_section): If not defined,
1913         define as 0 and use generic linker.  Otherwise, use ELF backend
1914         linker.
1915         (elf_backend_collect): If not defined, define as false.
1916         (elf_backend_add_symbol_hook): If not defined, define as 0.
1917         (elf32_bed): Initialize new fields.
1918         * elf64-target.h: Same changes as elf32-target.h.
1919         * elf32-i386.c: Include bfdlink.h.
1920         (elf_i386_relocate_section): New function.
1921         (elf_backend_relocate_section): Define.
1922         * elf32-sparc.c: Include bfdlink.h.
1923         (elf_info_to_howto): Change type of dst from Elf32_Internal_Rela
1924         to Elf_Internal_Rela (they're the same type anyhow).
1925         (elf_sparc_relocate_section): New function.
1926         (elf_backend_relocate_section): Define.
1927         * elf32-mips.c (elf_backend_collect): Define.
1928
1929         * Makefile.in (stmp-bfd.h): Avoid useless make error message in a
1930         different way; touch takes a numeric argument on some systems.
1931
1932 Fri May  6 13:34:14 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1933
1934         * nlmcode.h (nlm_swap_auxiliary_headers_in): Rework custom header
1935         handling for latest suggested format.
1936         (nlm_swap_auxiliary_headers_out): Likewise.
1937         (nlm_compute_section_file_positions): Likewise.
1938
1939 Fri May  6 11:11:50 1994  D. V. Henkel-Wallace  (gumby@rtl.cygnus.com)
1940
1941         * config.bfd: handle erricsson config (for OSE).
1942
1943 Thu May  5 15:40:47 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1944
1945         Patches from Ralph Campbell:
1946         * mipsbsd.c (mips_fix_jmp_addr): New function.
1947         (mips_fix_hi16_s): Use bfd_is_com_section.
1948         (mips_howto_table_ext): Call mips_fix_jmp_addr for MIPS_RELOC_JMP.
1949
1950 Fri May  6 11:48:55 1994  Steve Chamberlain  (sac@cygnus.com)
1951
1952         * config/go32.mh: XX support.
1953
1954         From bill
1955         * Makefile.in: Build sysdep.h without causing worrying but
1956         harmless error message.
1957
1958 Wed May  4 11:09:53 1994  Ian Lance Taylor  (ian@cygnus.com)
1959
1960         Changed m68k-aout to set flags to 0; m68k-sunos still uses 1.
1961         * aout0.c: New file.
1962         * targets.c (aout0_big_vec): Declare.
1963         (bfd_target_vector): Add aout0_big_vec.
1964         * config.bfd (m68*-*-aout*): Use m68k-0aout, not m68k-aout.
1965         * config/m68k-aout.mt (SELECT_VECS): Removed.
1966         * config/m68k-0aout.mt: New file.
1967         * configure.in (aout0_big_vec): New target vector: use aout0.o,
1968         aout32.o and stab-syms.o.
1969         * Makefile.in: Rebuilt dependencies.
1970         (BFD32_BACKENDS): Add aout0.o.
1971         (CFILES): Add aout0.c.
1972
1973         * libaout.h (struct aout_backend_data): Add field exec_hdr_flags.
1974         * aout-target.h (MY_exec_hdr_flags): If not defined, define as 0.
1975         MY(backend_data): Initialize exec_hdr_flags field.
1976         * aoutf1.h (sunos_32_set_arch_mach): Make static.
1977         (aout32_sunos4_write_object_contents): Set flags from backend
1978         info.
1979         (MY_exec_hdr_flags): If not defined, define as 1.
1980         (sunos4_aout_backend): Initialize exec_hdr_flags field.
1981         * aout-encap.c (encap_write_object_contents): Set flags from
1982         backend info.
1983         (MY_exec_hdr_flags): Define as N_FLAGS_COFF_ENCAPSULATE.
1984         * hp300hpux.c (MY_exec_hdr_flags): Define as 0x2.
1985         (MY(write_object_contents)): Set flags from backend info.
1986         * i386aout.c (MY(backend_data)): Initialize exec_hdr_flags field.
1987         * i386mach3.c (MY(backend_data)): Likewise.
1988         * mipsbsd.c (MY(backend_data)): Likewise.
1989         * sparclynx.c (NAME(aout,sparclynx_write_object_contents)): Set
1990         flags from backend info.
1991         (sparclynx_aout_backend): Initialize exec_hdr_flags field.
1992
1993 Wed May  4 02:56:00 1994  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
1994
1995         * config.bfd (i386-*-gnu*): Treat like i386-*-mach*.
1996         (m68*-apollo-*): Treat all Apollo configs the same, don't handle
1997         BSD specially.
1998
1999 Tue May  3 19:43:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2000
2001         * cache.c: Rewrote to work correctly.
2002         * libbfd.h: Rebuilt.
2003         * opncls.c (bfd_cache_init, bfd_open_file): Don't declare.
2004         (bfd_fdopenr): Check return value of bfd_cache_init.
2005
2006 Fri Apr 29 15:08:23 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2007
2008         * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by
2009         enumerating them, since the reloc type can not serve as an index
2010         into the m68k COFF howto_table.
2011
2012 Fri Apr 29 09:42:39 1994  Steve Chamberlain  (sac@cygnus.com)
2013
2014         * config.bfd (*-go32): Changed to coff.
2015         * coff-h8300.c (JMPL1): Get HOWTO right for 24bit branches.
2016         * srec.c (srec_write_symbols): Write out the correct number of
2017         symbols and don't stick in extra nulls.
2018
2019 Tue Apr 26 15:07:24 1994  Stan Shebs  (shebs@andros.cygnus.com)
2020
2021         * cf-sparclynx.c (LYNXOS, COFF_LONG_FILENAMES): Define.
2022         * coff-sparc.c (BADMAG): Recognize LYNXCOFFMAGIC.
2023         (COFF_SPARC): Define.
2024         * coffcode.h (coff_new_section_hook): If COFF_SPARC, set alignment
2025         power of data and bss sections to 3.
2026         * hosts/lynx.h (__LYNXOS): Define.
2027
2028 Tue Apr 26 15:04:26 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2029
2030         * elf32-hppa.c (hppa_elf_reloc): Adjust the addend of relocations
2031         against section symbols to avoid losing during ld -r.
2032
2033 Tue Apr 26 12:16:41 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2034
2035         * elfcode.h (shstrtab_length_fixed): Remove useless static
2036         variable.
2037         (struct elf_sect_data): Remove unused structure.
2038         (elf_object_p): Free memory if error occurs.  Check return value
2039         of bfd_default_set_arch_mach.  If elf_get_str_section fails,
2040         preserve error code rather than setting wrong_format.
2041         (null_shdr): Remove static variable.
2042         (assign_section_numbers): Remove shstrtab_length_fixed assignment.
2043         Allocate first section header on BFD obstack rather than using
2044         null_shdr.
2045         (bfd_prpsinfo): Remove unused local variable newsect.
2046
2047 Mon Apr 25 15:31:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2048
2049         * elfcode.h (write_relocs): Undo patch of Apr 10; breaks Solaris.
2050
2051         * elfcode.h (bfd_section_from_shdr): Use bfd_make_section_anyway
2052         to create sections.  Check return value of recursive calls.
2053         (bfd_section_from_phdr): Check return value of bfd_make_section.
2054         (elf_symbol_from_bfd_symbol): Likewise.
2055         (elf_object_p): Check return value of bfd_section_from_shdr.
2056         (section_from_elf_index): Likewise.
2057         (elf_slurp_symbol_table): Check return value of
2058         section_from_elf_index.
2059         (bfd_prstatus): Return boolean value.  Check return value of
2060         bfd_make_section.
2061         (bfd_fpregset): Likewise.
2062         (bfd_prpsinfo): Return boolean value.
2063         (elf_corefile_note): Check return values of bfd_prstatus,
2064         bfd_fpregset, and bfd_prpsinfo.
2065         (elf_core_file_p): Check return value of elf_corefile_note.
2066
2067 Fri Apr 22 11:08:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2068
2069         Get rid of the ECOFF .reginfo section hack.
2070         * ecoff.c (ecoff_mkobject_hook): Don't create a .reginfo section.
2071         (ecoff_new_section_hook): Don't handle the .reginfo section.
2072         (ecoff_sizeof_headers): Likewise.
2073         (ecoff_get_section_contents): Likewise.
2074         (ecoff_compute_section_file_positions): Likewise.
2075         (ecoff_compute_reloc_file_positions): Likewise.
2076         (ecoff_set_section_contents): Likewise.
2077         (ecoff_write_object_contents): Likewise.
2078         (ecoff_bfd_final_link): Likewise.
2079         (ecoff_bfd_copy_private_bfd_data): Copy the GP value and the
2080         register masks.
2081         (bfd_ecoff_get_gp_value): New function.
2082         (bfd_ecoff_set_gp_value): New function.
2083         (bfd_ecoff_set_regmasks): New function.
2084         * bfd-in.h (bfd_ecoff_get_gp_value): Declare.
2085         (bfd_ecoff_set_gp_value): Declare.
2086         (bfd_ecoff_set_regmasks): Declare.
2087         * bfd-in2.h: Rebuilt.
2088
2089         Fix ECOFF objcopy to actually copy debugging information.
2090         * ecoff.c (ecoff_bfd_copy_private_bfd_data): New function.
2091         (ecoff_get_extr): Assume that any ECOFF symbol with local clear is
2092         an external symbol, rather than checking the symbol flags.  Only
2093         check the flags for non-ECOFF symbols.
2094         * ecofflink.c (bfd_ecoff_debug_externals): Don't crash if the
2095         output_section field of the symbol section is NULL.
2096         * libecoff.h (ecoff_bfd_copy_private_bfd_data): Declare as
2097         function rather than defining as macro.
2098
2099         * ieee.c (ieee_object_p): Set bfd_error_got_wrong_format if
2100         appropriate.
2101
2102         * targets.c (bfd_target_vector): Add bfd_elf32_powerpc_vec.
2103
2104         * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of
2105         bfd_default_set_arch_mach.  Accept bfd_arch_m68k as well as
2106         bfd_arch_unknown.
2107         * coffcode.h (coff_set_arch_mach): Check return value of
2108         bfd_default_set_arch_mach.
2109         * elfcode.h (elf_set_arch_mach): Don't check a list of ELF
2110         architectures, just see if the desired architecture matches what
2111         the ELF backend permits.
2112
2113         * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to
2114         SH_ARCH_MAGIC to match change in coff/sh.h.
2115         (coff_set_flags): Likewise.
2116
2117         Follow convention in which each NLM header has an 8 byte stamp
2118         followed by a four byte length.
2119         * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr
2120         to nlm_cygnus_ext_header, and change type to
2121         Nlm_Internal_Cygnus_Ext_Header.
2122         (nlm_cygnus_ext_header): Rename from nlm_cygnus_section_header.
2123         * nlmcode.h (nlm_swap_auxiliary_headers_in): Use CyGnUsEx instead
2124         of CyGnUsSeCs.  Rename from cygnus_section to cygnus_ext.  Require
2125         length word to be 8.
2126         (nlm_swap_auxiliary_headers_out): Rename from cygnus_section to
2127         cygnus_ext.  Set length word to 8.
2128         (nlm_compute_section_file_positions): Rename from cygnus_section
2129         to cygnus_ext.
2130
2131 Thu Apr 21 22:54:22 1994  Stu Grossman  (grossman at cygnus.com)
2132
2133         * nlmcode.h (nlm_swap_auxiliary_headers_in):  Keep section table
2134         (from CyGnUsSeCs) in more permanent memory to keep section names
2135         from getting trashed.
2136
2137 Thu Apr 21 09:29:37 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2138
2139         * libelf.h (elf_obj_tdata):  Add members for dynamic symbol table
2140         handling.
2141         * elfcode.h (bfd_section_from_shdr):  Handle dynamic symbol table.
2142         * elfcode.h (elf_slurp_symbol_table):  Take additional parameter
2143         to select static or dynamic symbol table and return number of
2144         symbols slurped or -1 on error.
2145         * elfcode.h (elf_get_symtab):  Set bfd symcount from
2146         elf_slurp_symbol_table result.
2147         * elfcode.h (elf_get_dynamic_symtab_upper_bound,
2148         elf_canonicalize_dynamic_symtab):  New functions to handle dynamic
2149         symbol table.
2150         * elf32-target.h, elf64-target.h (BFD_JUMP_TABLE_DYNAMIC):
2151         Change to handle dynamic symbol table, provide default definitions
2152         for dynamic relocs.
2153         * aoutx.h (howto_table_std, NAME(aout,swap_std_reloc_out),
2154         NAME(aout,swap_std_reloc_in), aout_link_input_section_std,
2155         aout_link_reloc_link_order):  Handle r_jmptable and r_relative
2156         relocations.
2157
2158 Thu Apr 21 11:58:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2159
2160         Clean up uses of _bfd_dummy_target (from Peter Schauer).
2161         * libbfd.c (_bfd_dummy_target): Set bfd_error_wrong_format.
2162         * nlm-target.h (nlm_core_file_p): Define as _bfd_dummy_target, not
2163         NULL.
2164         * srec.c (srec_vec): Use _bfd_dummy_target, not NULL, in
2165         _bfd_check_format.
2166         (symbolsrec_vec): Likewise.
2167         * tekhex.c (tekhex_vec): Likewise.
2168
2169         * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr
2170         field.
2171         (nlm_cygnus_section_header): New accessor macro.
2172         * nlmcode.h (nlm_object_p): Free new tdata structure if failure.
2173         Add fixed sections before swapping in auxiliary headers.  After
2174         adding sections, treat errors as real, not as wrong format.
2175         (nlm_swap_auxiliary_headers_in): Swap in the sections header; add
2176         sections to the BFD for each section it describes.
2177         (nlm_swap_auxiliary_headers_out): Swap out the sections header.
2178         (nlm_compute_section_file_positions): Account for the size of the
2179         sections header.
2180
2181 Wed Apr 20 16:45:51 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
2182
2183         * coff-sparc.c (sparccoff_vec): Change minimum alignment power to
2184         2, so that stab sections can be multiples of 4 bytes only.
2185
2186         * hosts/i386aix.h: Changes to avoid prototypes conflicts with the
2187         ones defined in stdlib.h.  (From Minh Tran-Le.)
2188
2189 Wed Apr 20 14:15:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2190
2191         * nlm32-ppc.c: Complete rewrite for new version of PowerPC
2192         NetWare.  Old code still present, but ifdeffed out.
2193
2194         * nlmcode.h (nlm_swap_auxiliary_headers_in): Don't assume a
2195         particular format for the customer header.  Allocate a block of
2196         memory and read it into that.
2197         (nlm_swap_auxiliary_headers_out): Write out the block of memory.
2198         (nlm_compute_section_file_positions): Include length of customer
2199         header when computing its size.
2200
2201 Mon Apr 18 14:27:17 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2202
2203         * som.c (som_prep_headers): Get the space's number from the
2204         backend private section data rather than target_index.
2205         (bfd_som_set_section_attributes): Store the space's number
2206         in the backend private section data rather than target_index.
2207
2208         * som.h (som_copyable_section_data_struct): Add space_number.
2209
2210 Fri Apr 15 12:22:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2211
2212         * coff-a29k.c (reloc_processing): Always set the address of a
2213         R_IHCONST reloc to that of the immediately preceding R_IHIHALF.
2214         gas does this anyhow, but some other assemblers seem to leave
2215         garbage in the R_IHCONST address field.
2216
2217         * bfd/archive.c: Consistently use ARFMAG; from
2218         schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
2219         (_bfd_write_archive_contents): Use ARFMAG rather than '`' and
2220         '\012'.
2221         (bsd_write_armap): Likewise.
2222         (coff_write_armap): Likewise.
2223
2224         * coff-mips.c (mips_relocate_section): When relaxing, adjust local
2225         relocs against the .text section as required.
2226         * ecofflink.c (bfd_ecoff_debug_accumulate): When relaxing, adjust
2227         PDR addresses as required.
2228
2229         * ecoff.c (ecoff_emit_aggregate): Take fdr argument.  Map fdr
2230         index through rfd map if it exists.  Check for a couple of cases
2231         which gdb handles specially.  Change all callers.
2232         (ecoff_type_to_string): Take fdr argument rather than aux_ptr and
2233         bigendian argument.  Change all callers.
2234         (ecoff_print_symbol): Handle stStruct, stUnion and stEnum.
2235
2236 Thu Apr 14 13:05:10 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2237
2238         * coff-mips.c (mips_howto_table): Add dummy entries to account for
2239         numbering changes in include/coff/mips.h.  Add entries for
2240         MIPS_R_RELHI and MIPS_R_RELLO.
2241         (mips_ecoff_swap_reloc_in): Handle an extra bit for the reloc type
2242         when little endian.  Treat internal MIPS_R_RELLO or MIPS_R_RELHI
2243         relocs like MIPS_R_SWITCH, and convert r_offset from 24 to 32
2244         bits.
2245         (mips_ecoff_swap_reloc_out): Likewise.
2246         (mips_adjust_reloc_in): Handle internal MIPS_R_RELLO or
2247         MIPS_R_RELHI relocs like MIPS_R_SWITCH.
2248         (mips_adjust_reloc_out): Likewise.
2249         (mips_relhi_addr, mips_relhi_addend): New static variables.
2250         (mips_relhi_reloc, mips_rello_reloc): New functions.
2251         (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_PCREL_HI16_S into
2252         MIPS_R_RELHI and turn BFD_RELOC_PCREL_LO16 into MIPS_R_RELLO.
2253         (mips_relocate_hi): Rename from mips_relocate_refhi, and add pcrel
2254         argument.  Changed all callers.
2255         (mips_relocate_section): Rename got_reflo to got_lo and
2256         reflo_int_rel to lo_int_rel.  Handle MIPS_R_RELLO and MIPS_R_RELHI
2257         relocs.
2258         (mips_relax_section): Adjust MIPS_R_RELHI/MIPS_R_RELLO pairs when
2259         expanding a PC relative call.
2260
2261         * reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S
2262         and BFD_RELOC_PCREL_LO16.
2263         * bfd-in2.h: Rebuilt.
2264
2265 Wed Apr 13 11:50:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
2266
2267         * coff-sparc.c (sparccoff_vec): Set minimum alignment power to 3.
2268
2269 Tue Apr 12 13:36:20 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2270
2271         * som.c (som_write_fixups): Always emit at least
2272         one relocation for any non-bss section.
2273
2274 Mon Apr 11 14:41:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2275
2276         * elfcode.h (assign_file_positions_except_relocs): Don't require
2277         the file alignment to correspond to the page size when linking
2278         with -N.
2279
2280 Sun Apr 10 01:02:24 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2281
2282         * elfcode.h (write_relocs): For rela relocations, adjust the
2283         addend for relocations involving section symbols to account
2284         for the lossage of 1:1 mapping from input section symbols to
2285         output section symbols.
2286
2287 Fri Apr  8 12:22:02 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2288
2289         * aoutx.h (NAME(aout,make_sections)): New function.
2290         (NAME(aout,some_aout_object_p)): Call NAME(aout,make_sections)
2291         rather than making sections inline.
2292         (NAME(aout,mkobject)): Don't make any sections.
2293         (NAME(aout,adjust_sizes_and_vmas)): Call NAME(aout,make_sections).
2294         (NAME(aout,final_link)): Don't dereference obj_textsec (abfd) or
2295         obj_datasec (abfd) if they are NULL.
2296         * libaout.h (NAME(aout,make_sections)): Declare.
2297         * bout.c (b_out_mkobject): Don't make any sections.
2298         (b_out_write_object_contents): Call aout_32_make_sections.
2299         (b_out_set_section_contents): Likewise.
2300         * i386os9k.c (os9k_mkobject): Don't make any sections.
2301         (os9k_write_object_contents): Call aout_32_make_sections.
2302         (os9k_set_section_contents): Likewise.
2303
2304         * aoutx.h (NAME(aout,new_section_hook)): Don't set N_EXT in target
2305         index.
2306
2307 Wed Apr  6 20:44:56 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2308
2309         * config.bfd, configure.host:  Add mips-*-sysv4* support.
2310
2311 Thu Apr  7 14:23:05 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2312
2313         * coff-mips.c (mips_howto_table): Add entry for MIPS_R_SWITCH.
2314         (mips_ecoff_swap_reloc_in): For MIPS_R_SWTICH, copy r_symndx into
2315         r_offset and set r_symndx to RELOC_SECTION_TEXT.
2316         (mips_ecoff_swap_reloc_out): For MIPS_R_SWITCH, get the r_symndx
2317         value from the r_offset field.
2318         (mips_adjust_reloc_in): Maximum r_type value is now MIPS_R_SWITCH.
2319         For MIPS_R_SWITCH, copy the r_offset field into the addend field.
2320         (mips_adjust_reloc_out): For MIPS_R_SWITCH, copy the addend field
2321         into the r_offset field.
2322         (mips_switch_reloc): New function.
2323         (mips_bfd_reloc_type_lookup): Translate BFD_RELOC_GPREL32 into
2324         MIPS_R_SWITCH.
2325         (mips_relocate_section): Handle MIPS_R_SWITCH.
2326         (mips_relax_section): Adjust MIPS_R_SWITCH offset if necessary.
2327
2328 Thu Apr  7 11:10:51 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2329
2330         * elfcode.h (elf_set_section_contents): Support calling the backend
2331         function elf_backend_begin_write_processing when just beginning to
2332         write an object file.
2333
2334         * libelf.h (elf_backend_begin_write_processing): Declare.
2335
2336         * elf{32,64}-target.h (elf_backend_begin_write_processing): Provide
2337         a default definition.
2338         (elf{32,64}_bed): Add elf_backend_begin_write_processing.
2339         
2340         * elf32-hppa.h (elf_hppa_tc_symbol): Delete extern declaration.
2341         (elf_hppa_tc_make_sections): Likewise.
2342
2343         * elf32-hppa.c (symext_chain_built): Delete.
2344         (symext_chain_size): Renamed from symextn_contents_real_size.
2345         (elf32_hppa_backend_{begin,final}_write_processing): New functions.
2346         (add_entry_to_symext_chain): New function.
2347         (hppa_elf_set_section_contents): Ignore writes to the symbol extension
2348         section until it's been rebuilt internally.
2349         (hppa_elf_get_section_contents): Symbol extension section is no
2350         longer special.
2351         (elf_backend_{begin,final}_write_processing): Define.
2352         (elf_hppa_tc_make_sections): Simplify now that much code has
2353         migrated into elf32_hppa_backend_{being,final}_write_processing.
2354
2355 Wed Apr  6 17:24:14 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2356
2357         Add new target vectors to read the dynamic symbols and dynamic
2358         relocs.  Change a.out to use these rather than reading the dynamic
2359         symbols and relocs along with the normal symbols and relocs.
2360         * targets.c (bfd_target): Add fields
2361         _bfd_get_dynamic_symtab_upper_bound,
2362         _bfd_canonicalize_dynamic_symtab,
2363         _bfd_get_dynamic_reloc_upper_bound,
2364         _bfd_canonicalize_dynamic_reloc.
2365         (BFD_JUMP_TABLE_DYNAMIC): Define.
2366         * libbfd-in.h (_bfd_nodynamic_get_dynamic_symtab_upper_bound):
2367         Define.
2368         (_bfd_nodynamic_canonicalize_dynamic_symtab): Define.
2369         (_bfd_nodynamic_get_dynamic_reloc_upper_bound): Define.
2370         (_bfd_nodynamic_canonicalize_dynamic_reloc): Define.
2371         * bfd.c (bfd_get_dynamic_symtab_upper_bound): Define.
2372         (bfd_canonicalize_dynamic_symtab): Define.
2373         (bfd_get_dynamic_reloc_upper_bound): Define.
2374         (bfd_canonicalize_dynamic_reloc): Define.
2375         * sunos.c (MY_read_dynamic_symbols): Don't define.
2376         (MY_read_dynamic_relocs): Don't define.
2377         (MY_get_dynamic_symtab_upper_bound): Define.
2378         (MY_canonicalize_dynamic_symtab): Define.
2379         (MY_get_dynamic_reloc_upper_bound): Define.
2380         (MY_canonicalize_dynamic_reloc): Define.
2381         (struct sunos_dynamic_info): Change type of dynsym_count and
2382         dynrel_count to long.  Add fields canonical_dynsym and
2383         canonical_dynrel.
2384         (sunos_read_dynamic_info): Check that BFD had DYNAMIC flag set.
2385         Clear info->canonical_dynsym and info->canonical_dynrel.
2386         (MY(read_dynamic_symbols)): Removed.
2387         (MY(read_dynamic_relocs)): Removed.
2388         (sunos_get_dynamic_symtab_upper_bound): New function.
2389         (sunos_canonicalize_dynamic_symtab): New function.
2390         (sunos_get_dynamic_reloc_upper_bound): New function.
2391         (sunos_canonicalize_dynamic_reloc): New function.
2392         * libaout.h: Declare struct reloc_ext_external and
2393         reloc_std_external to avoid prototype problems.
2394         (struct aout_backend_data): Remove fields read_dynamic_symbols and
2395         read_dynamic_relocs.
2396         (NAME(aout,translate_symbol_table)): Declare.
2397         (NAME(aout,swap_ext_reloc_in)): Declare.
2398         (NAME(aout,swap_std_reloc_in)): Declare.
2399         * aoutx.h (NAME(aout,translate_symbol_table)): Renamed from
2400         translate_symbol_table and made non-static.  Changed all callers.
2401         (NAME(aout,slurp_symbol_table)): Don't read dynamic symbols.
2402         (NAME(aout,slurp_reloc_table)): Don't read dynamic relocs.
2403         (NAME(aout,get_reloc_upper_bound)): Don't count dynamic relocs.
2404         * aoutf1.h (aout_32_sunos4_write_object_contents): Don't bother to
2405         remove dynamic symbols and relocs.  They will no longer be
2406         present.
2407         (MY_read_dynamic_symbols): Don't define.
2408         (MY_read_dynamic_relocs): Don't define.
2409         (sunos4_aout_backend): Don't initialize dynamic entry points.
2410         * aout-target.h (MY_read_dynamic_symbols): Don't define.
2411         (MY_read_dynamic_relocs): Don't define.
2412         (MY(backend_data)): Don't initialize dynamic entry points.
2413         (MY_get_dynamic_symtab_upper_bound): If not defined, define to
2414         _bfd_nodynamic version.
2415         (MY_canonicalize_dynamic_symtab): Likewise.
2416         (MY_get_dynamic_reloc_upper_bound): Likewise.
2417         (MY_canonicalize_dynamic_reloc): Likewise.
2418         * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector.
2419         * bfd-in2.h: Rebuilt.
2420         * libbfd.h: Rebuilt.
2421
2422         * cf-m68klynx.c: Include sysdep.h.
2423
2424         * hp300hpux.c: Removed some spaces in uses of NAME to avoid
2425         problems with traditional C compilers.
2426
2427         * targets.c (bfd_target): Rearranged fields in target vector.
2428         Removed _bfd_debug_info_start, _bfd_debug_info_end and
2429         _bfd_debug_info_accumulate, which were never used.
2430         (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
2431         (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
2432         (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
2433         (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
2434         * All backends: Changed to use the new BFD_JUMP_TABLE_* macros
2435         rather than the single JUMP_TABLE macro.  Removed many of the
2436         weird macro definitions needed to support the monolithic
2437         JUMP_TABLE.
2438         * bfd-in.h (JUMP_TABLE): Removed.
2439         * libbfd-in.h: Define a bunch of macros, and declare a few
2440         functions, for use with the new BFD_JUMP_TABLE_* macros.
2441         * libbfd.c (_bfd_dummy_new_section_hook): Removed.
2442         (bfd_false): Set bfd_error_invalid_operation.
2443         (bfd_nullvoidptr): Likewise.
2444         (bfd_n1): New function.
2445         (_bfd_nocore_core_file_matches_executable_p): Renamed from
2446         _bfd_dummy_core_file_matches_executable_p.
2447         (_bfd_nocore_core_file_failing_command): Similar rename.  Set
2448         bfd_error_invalid_operation.
2449         (_bfd_nocore_core_file_failing_signal): Likewise.
2450         (_bfd_generic_get_section_contents): Renamed from
2451         bfd_generic_get_section_contents.  Changed all callers.
2452         (_bfd_generic_set_section_contents): Similar rename.
2453         * ieee.c: #if 0 out ieee_bfd_debug_info_start,
2454         ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate.  They
2455         were never called.
2456         * bfd-in2.h: Rebuilt.
2457         * libbfd.h: Rebuilt.
2458
2459 Tue Apr  5 22:10:04 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2460
2461         * Crude support for examining dynamic libraries.
2462         * som.c (som_object_setup): Set DYNAMIC flag for SHL_MAGIC and
2463         DL_MAGIC objects.
2464         (som_prep_headers): Preserve the system_id for DYNAMIC objects.
2465         Use SHL_MAGIC as the magic number of the DYNAMIC flag is set.
2466         Write exec headers for DYNAMIC objects.
2467         (som_begin_writing): DYNAMIC objects have the same alignment
2468         restrictions as D_PAGED objects.
2469         (bfd_section_from_som_symbol): Treat DYNAMIC objects like EXEC_P
2470         objects.
2471         (object_flags): Add DYNAMIC.
2472
2473 Tue Apr  5 17:48:52 1994  Stan Shebs  (shebs@andros.cygnus.com)
2474
2475         * i386lynx.c, sparclynx.c (NAME): Remove embedded whitespace in
2476         macro uses, confuses some non-ANSI compilers.
2477
2478 Tue Apr  5 15:50:01 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2479
2480         * som.c (som_bfd_free_cached_info): Add missing PARAMS decl.
2481         Don't free anything if we don't have a bfd_object.
2482         (som_close_and_cleanup): Call som_bfd_free_cached_info.
2483
2484 Tue Apr  5 11:22:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2485
2486         * elf32-mips.c (mips_elf_final_link): Don't remove empty sections.
2487         It turns out not to be required on Irix 5, and it causes problems
2488         if the sections happen to contain symbols.
2489
2490         * elfcode.h (write_shdrs_and_ehdr): Correct bfd_write check.
2491
2492         * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if
2493         section->relocation is NULL; malloc might have returned NULL when
2494         given a zero size if there were no relocations.
2495         * bout.c (b_out_canonicalize_reloc): Likewise.
2496         * coffcode.h (coff_canonicalize_reloc): Likewise.
2497         * ecoff.c (ecoff_canonicalize_reloc): Likewise.
2498         * elfcode.h (elf_canonicalize_reloc): Likewise.
2499         * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
2500         * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
2501         * nlmcode.h (nlm_canonicalize_reloc): Likewise.
2502         * som.c (som_canonicalize_reloc): Likewise.
2503         * hp300hpux.c (MY(slurp_reloc_table)): Likewise.  Also, if malloc
2504         returns NULL, don't report an error if we asked for zero bytes.
2505         * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns
2506         NULL, don't report an error if we asked for zero bytes.
2507         * nlmcode.h (nlm_slurp_reloc_fixups): Likewise.
2508
2509 Mon Apr  4 15:30:49 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2510
2511         * aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything
2512         if we don't have a bfd_object.
2513
2514         Made sure that every call to bfd_read, bfd_write, and bfd_seek
2515         checks the return value and handled bfd_error correctly.  These
2516         changes are not itemised.  Also:
2517         * aoutx.h (emit_strtab): Change return type to boolean, and return
2518         errors.
2519         (NAME(aout,write_syms)): Check emit_strtab return value.
2520         (NAME(aout,final_link)): Likewise.
2521         * coffcode.h (coff_write_relocs): Change return type to boolean,
2522         and return errors.
2523         (coff_write_object_contents): Check coff_write_relocs return
2524         value.
2525         * i386os9k.c (os9k_swap_exec_header_in): Change return type to
2526         boolean.
2527         (os9k_object_p): Check os9k_swap_exec_header_in return value.
2528         * oasys.c (oasys_read_record): Change return type to boolean.
2529         (oasys_slurp_symbol_table: Check oasys_read_record return value.
2530         (oasys_object_p, oasys_slurp_section_data): Likewise.
2531         (oasys_write_record): Change return type to boolean.
2532         (oasys_write_syms): Likewise.  Also, check oasys_write_record
2533         return value.
2534         (oasys_write_sections): Check oasys_write_record return value.
2535         (oasys_write_header): Change return type to boolean.  Check
2536         oasys_write_record return value.
2537         (oasys_write_end, oasys_write_data): Likewise.
2538         (oasys_write_object_contents): Check return values of
2539         oasys_write_header, oasys_write_syms, oasys_write_data, and
2540         oasys_write_end.
2541         * srec.c (srec_write_record): Change return type to boolean.
2542         (srec_write_header): Likewise.  Also, check srec_write_record
2543         return value.
2544         (srec_write_section, srec_write_terminator): Likewise.
2545         (srec_write_symbols): Change return type to boolean.
2546         (internal_srec_write_object_contents): Check return value of
2547         srec_write_symbols, srec_write_header, srec_write_section, and
2548         srec_write_terminator.
2549
2550         * Makefile.in: Rebuilt dependencies.
2551
2552 Mon Apr  4 10:56:45 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2553
2554         * aix386-core.c (aix386_bfd_is_local_label):  Correct cast from
2555         asection to asymbol.
2556         * ptrace-core.c (ptrace_unix_bfd_is_local_label):  Correct cast from
2557         bfd to asymbol.
2558         * trad-core.c (trad_unix_bfd_is_local_label):  Correct cast from
2559         asection to asymbol.
2560
2561 Sun Apr  3 18:27:29 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2562
2563         * som.c (som_slurp_string_table): Use malloc to allocate space
2564         for the cached copy of the native string table.
2565         (som_slurp_symbol_table): Likewise for the native symbol table.
2566         (som_slurp_reloc_table): Likewise for the native and generic
2567         relocation tables.
2568         (som_bfd_free_cached_info): Free the cached native strings,
2569         symbols, and relocations.  Also free the canonical cached
2570         relocations.
2571
2572 Fri Apr  1 12:40:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2573
2574         * aoutx.h (aout_link_write_symbols): If keep_memory is false, make
2575         sure the symbol name is stored in permanent memory before adding
2576         it to the string table.
2577
2578         * archive.c (_bfd_write_archive_contents): Once we've found an
2579         object, don't bother to look for more when deciding whether to
2580         build a map.
2581         (compute_and_write_armap): After adding the symbols for a BFD,
2582         call bfd_free_cached_info on it.
2583
2584         Add bfd_free_cached_info support to a.out backends.
2585         * aoutx.h (aout_get_external_symbols): Renamed from
2586         aout_link_get_symbols.  Read strings even if symbols have been
2587         read.  Store string size in obj_aout_string_size.
2588         (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to
2589         read the symbols.  Allocate the cached symbols with malloc, not
2590         bfd_alloc.
2591         (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with
2592         malloc, not bfd_alloc.
2593         (NAME(aout,bfd_free_cached_info)): New function; free cached
2594         symbols and relocs.
2595         * libaout.h (struct aoutdata): Add external_string_size field.
2596         (obj_aout_external_string_size): New accessor macro.
2597         (NAME(aout,close_and_cleanup)): Don't declare.
2598         (NAME(aout,bfd_free_cached_info)): Declare.
2599         (aout_32_close_and_cleanup): Don't define.
2600         (aout_64_close_and_cleanup): Don't define.
2601         * aout-target.h (MY_bfd_free_cached_info): If not already defined,
2602         define as NAME(aout,free_cached_info).
2603         (MY_close_and_cleanup): If not already defined, define as
2604         MY_bfd_free_cached_info.
2605         * aout-adobe.c (aout_32_close_and_cleanup): Define.
2606         (aout_32_bfd_free_cached_info): Don't define.
2607         * bout.c (aout_32_close_and_cleanup): Define.
2608         (aout_32_bfd_free_cached_info): Don't define.
2609         * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true.
2610         (MY_close_and_cleanup): Don't define.
2611         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached
2612         relocs with malloc, not bfd_alloc.
2613         * i386os9k.c (aout_32_close_and_cleanup): Define.
2614         (aout_32_bfd_free_cached_info): Don't define.
2615
2616         Add a new entry point to free memory cached by a BFD.
2617         * targets.c (bfd_target): Add _bfd_free_cached_info field.
2618         * bfd.c (bfd_free_cached_info): Define.
2619         * bfd-in.h (JUMP_TABLE): Add _bfd_free_cached_info.
2620         * bfd-in2.h: Rebuilt.
2621         * All backends: Initialize bfd_free_cached_info entry point to
2622         bfd_true.
2623
2624         * elf32-hppa.c (elf_hppa_reloc_type_lookup): Correct type of
2625         first, unused, argument.
2626         (hppa_elf_is_local_label): Declare instead of
2627         som_bfd_is_local_label.
2628
2629         * coff-a29k.c (a29k_reloc): Add reloc_entry->address to value of
2630         absolute R_IREL reloc.
2631
2632 Thu Mar 31 11:52:15 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2633
2634         Added some support for Irix 4 shared libraries.
2635         * ecoff.c (ecoff_new_section_hook): Set SEC_SHARED_LIBRARY for a
2636         .lib section.
2637         (ecoff_sec_to_styp_flags): Set SEC_SHARED_LIBRARY if
2638         STYP_ECOFF_LIB bit is set.
2639         (ecoff_compute_section_file_positions): Round the contents of a
2640         .lib section up to the next page boundary.
2641         (ecoff_set_section_contents): If we see a .lib section, increment
2642         the vma by one to count the number of shared libraries we have.
2643         (ecoff_write_object_contents): Don't crash if we see a
2644         STYP_ECOFF_LIB section, and don't adjust text_start or data_start
2645         or bss_size either.
2646
2647         * coffcode.h (CALC_ADDEND): Change to fetch original symbol value
2648         from original BFD, rather than using value of current BFD symbol.
2649         Needed for new linker.
2650         * coff-sparc.c (CALC_ADDEND): Likewise.
2651
2652         * ecoff.c (ecoff_write_object_contents): Set the text_start and
2653         data_start entries in the optional header correctly even if a text
2654         or data section starts at location zero.
2655
2656         * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef
2657         and raeburn).
2658         * bfd-in2.h: Rebuilt.
2659
2660         * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol
2661         name.
2662         * nlm32-alpha.c (nlm_alpha_read_import): Likewise.
2663         * nlm32-sparc.c (nlm_sparc_read_import): Likewise.
2664
2665         * coffgen.c (coff_write_symbol): Reindented.  Changed to return
2666         boolean, and changed written to unsigned int *.  Check error
2667         returns from called functions.
2668         (coff_write_alien_symbol): Likewise.
2669         (coff_write_native_symbol): Likewise.
2670         (coff_write_symbols): Likewise.  Reworked checks on whether to
2671         write symbol name to string table for clarity and to avoid core
2672         dumping when given a non COFF symbol.
2673         * libcoff-in.h (coff_write_symbols): Declare as returning boolean.
2674         * libcoff.h: Rebuilt.
2675         * coffcode.h (coff_write_object_contents): Check return value of
2676         coff_write_symbols.
2677
2678 Wed Mar 30 16:25:41 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2679
2680         Changes to let BFD return an error indication from
2681         get_symtab_upper_bound, bfd_canonicalize_symtab,
2682         bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc.  They now
2683         return long instead of unsigned int, and use -1 to indicate an
2684         error.  Along the way, rename get_symtab_upper_bound to
2685         bfd_get_symtab_upper_bound.
2686         * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
2687         errors.
2688         (bfd_canonicalize_reloc): Likewise.
2689         * syms.c (bfd_get_symtab_upper_bound): Renamed from
2690         get_symtab_upper_bound.
2691         * targets.c (bfd_target): Renamed _get_symtab_upper_bound to
2692         _bfd_get_symtab_upper_bound, and changed it and
2693         _bfd_canonicalize_symtab and _get_reloc_upper_bound and
2694         _bfd_canonicalize_reloc to all return long.
2695         * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
2696         (NAME(aout,canonicalize_reloc)): Likewise.
2697         (NAME(aout,get_reloc_upper_bound)): Likewise.
2698         (NAME(aout,get_symtab_upper_bound)): Likewise.
2699         * bout.c (b_out_canonicalize_reloc): Likewise.
2700         (b_out_get_reloc_upper_bound): Likewise.
2701         * coffcode.h (coff_canonicalize_reloc): Likewise.
2702         * coffgen.c (coff_get_symtab_upper_bound): Likewise.
2703         (coff_get_symtab): Likewise.
2704         (coff_get_reloc_upper_bound): Likewise.
2705         * ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
2706         (ecoff_get_symtab): Likewise.
2707         (ecoff_canonicalize_reloc): Likewise.
2708         * elfcode.h (elf_get_symtab_upper_bound): Likewise.
2709         (elf_get_reloc_upper_bound): Likewise.
2710         (elf_canonicalize_reloc): Likewise.
2711         (elf_get_symtab): Likewise.
2712         * hp300hpux.c (MY(get_symtab)): Likewise.
2713         (MY(get_symtab_upper_bound)): Likewise.
2714         (MY(canonicalize_reloc)): Likewise.
2715         * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
2716         * ieee.c (ieee_slurp_external_symbols): Change return type to
2717         boolean.  Check for errors from get_symbol.
2718         (ieee_slurp_symbol_table): Change return type to boolean.  Check
2719         for errors from ieee_slurp_external_symbols.
2720         (ieee_get_symtab_upper_bound): Return long, and -1 on errors.
2721         (ieee_get_symtab): Likewise.
2722         (ieee_get_reloc_upper_bound): Likewise.
2723         (ieee_canonicalize_reloc): Likewise.
2724         * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
2725         * nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
2726         (nlm_get_symtab): Likewise.
2727         (nlm_get_reloc_upper_bound): Likewise.
2728         (nlm_canonicalize_reloc): Likewise.
2729         * oasys.c (oasys_get_symtab_upper_bound): Likewise.
2730         (oasys_get_symtab): Likewise.
2731         (oasys_get_reloc_upper_bound): Likewise.
2732         (oasys_canonicalize_reloc): Likewise.
2733         * som.c (som_get_symtab_upper_bound): Likewise.
2734         (som_get_symtab): Likewise.
2735         (som_get_reloc_upper_bound): Likewise.
2736         (som_canonicalize_reloc): Likewise.
2737         * srec.c (srec_get_symtab_upper_bound): Likewise.
2738         (srec_get_symtab): Likewise.
2739         (srec_get_reloc_upper_bound): Define as bfd_0l.
2740         (srec_canonicalize_reloc): Likewise.
2741         * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
2742         (tekhex_get_symtab_upper_bound): Likewise.
2743         (tekhex_get_reloc_upper_bound): Define as bfd_0l.
2744         (tekhex_canonicalize_reloc): Likewise.
2745         * libaout.h (NAME(aout,get_symtab_upper_bound)): Change
2746         declaration to return long.
2747         (NAME(aout,get_symtab)): Likewise.
2748         (NAME(aout,canonicalize_reloc)): Likewise.
2749         (NAME(aout,get_reloc_upper_bound)): Likewise.
2750         * libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
2751         (coff_get_symtab): Likewise.
2752         (coff_get_reloc_upper_bound): Likewise.
2753         * libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
2754         (ecoff_get_symtab): Likewise.
2755         (ecoff_canonicalize_reloc): Likewise.
2756         * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
2757         (bfd_elf32_get_symtab): Likewise.
2758         (bfd_elf32_get_reloc_upper_bound): Likewise.
2759         (bfd_elf32_canonicalize_reloc): Likewise.
2760         (bfd_elf64_get_symtab_upper_bound): Likewise.
2761         (bfd_elf64_get_symtab): Likewise.
2762         (bfd_elf64_get_reloc_upper_bound): Likewise.
2763         (bfd_elf64_canonicalize_reloc): Likewise.
2764         * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
2765         (nlmNAME(get_symtab)): Likewise.
2766         (nlmNAME(get_reloc_upper_bound)): Likewise.
2767         (nlmNAME(canonicalize_reloc)): Likewise.
2768         * archive.c (compute_and_write_armap): Use error_return and
2769         no_memory_return labels rather than freeing information in various
2770         places.  Change storage, symcount and src_count to long.  Check
2771         errors from bfd_get_symtab_upper_bound and
2772         bfd_canonicalize_symtab.
2773         * bout.c (b_out_relax_section): Change reloc_size to long.  Check
2774         for errors from bfd_get_reloc_upper_bound and
2775         bfd_canonicalize_reloc.
2776         (b_out_get_relocated_section_contents): Likewise.
2777         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
2778         Likewise.
2779         * elf32-mips.c: Likewise.
2780         * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
2781         (hppa_look_for_stubs_in_section): Check for errors from
2782         bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
2783         bfd_canonicalize_reloc.
2784         * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
2785         from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
2786         * linker.c (generic_link_read_symbols): Likewise.
2787         (_bfd_generic_final_link): Check for errors from
2788         bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
2789         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
2790         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
2791         (bfd_coff_reloc16_get_relocated_section_contents): Likewise.
2792         * libbfd.c (bfd_0l): New function.
2793         * libbfd-in.h (bfd_0l): Declare.
2794         * aix386-core.c: Change get_symtab_upper_bound, get_symtab,
2795         get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
2796         than bfd_0u.
2797         * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
2798         * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
2799         * bfd-in2.h: Rebuilt.
2800         * libbfd.h: Rebuilt.
2801         * libcoff.h: Rebuilt.
2802
2803         * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
2804         temp and name.
2805
2806 Wed Mar 30 08:33:04 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2807
2808         * hosts/dpx2.h: Define POSIX_UTIME.
2809
2810 Wed Mar 30 00:31:49 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2811
2812         * i386dynix.c, config/i386-dynix.mt:  New files, handling Dynix
2813         variant of a.out.
2814         * configure.in, config.bfd:  Use them for Dynix.
2815         * Makefile.in:  Add dependencies for i386dynix.o. 
2816         * targets.c:  Add definition for i386dynix_vec.
2817         * hosts/symmetry.h:  Do not define TRAD_CORE_USER_OFFSET for Dynix.
2818         Define HOST_DATA_START_ADDR and TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
2819         for Dynix. Remove inclusion of dynix3.h, Dynix bfd is now handled by
2820         i386dynix.c
2821
2822 Mon Mar 28 12:53:27 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2823
2824         * Makefile.in (BFD32_BACKENDS): Add coff-sparc.o.
2825
2826         * coffcode.h (coff_set_flags): Handle bfd_arch_powerpc like
2827         bfd_arch_rs6000.
2828
2829         * config.bfd (powerpc-*-aix*): New target; use rs6000.mt.
2830         * config/rs6000.mt (SELECT_ARCHITECTURES): Add bfd_powerpc_arch.
2831
2832         * aoutx.h (translate_from_native_sym_flags): Set SEC_RELOC flag
2833         for generated constructor section.
2834
2835 Sun Mar 27 16:25:22 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2836
2837         * som.c (som_begin_writing): New approach at dealing with holes
2838         in executables left by the HP linker.  Does not rely on subspace
2839         alignments as subspaces are *NOT* guaranteed to be properly
2840         aligned in an executable (can you believe that!).
2841
2842 Sat Mar 26 10:25:43 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2843
2844         * som.c (som_get_section_contents): New function.  Do not try
2845         to actually read data from a section that doesn't have either
2846         SEC_LOAD or SEC_DEBUGGING set (eg $BSS$) just return true.
2847
2848         * libbfd.c (bfd_read): Set bfd_error as appropriate for a short
2849         read. (bfd_error_system_call or bfd_error_file_truncated).
2850
2851         * som.c: Do not blindly set bfd_error_system_call after a
2852         failing bfd_read, bfd_write, or bfd_seek.  In a few places
2853         (like som_object_p) override the error status set by bfd_read.
2854
2855         * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise.
2856         * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise.
2857         * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise.
2858         * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise.
2859
2860         * som.c: Check return values from several bfd_{seek,read,write}
2861         calls that we just assumed were not failing.
2862
2863 Fri Mar 25 11:44:06 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2864
2865         * hosts/sysv4.h (HAVE_PROCFS): Add comments about ptx4.
2866         * config/sysv4.mh: Add comment.
2867         * config/symmetry.mh: Change comment.
2868         * configure.host: Use sysv4, not symmetry, for i[34]86-sequent-sysv4*.
2869
2870 Fri Mar 25 17:10:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2871
2872         Changes to support linker relaxing of embedded MIPS PIC code to
2873         use a five instruction sequence for function calls which are out of
2874         range of the bal instruction.
2875         * libecoff.h (struct ecoff_section_tdata): Define.
2876         (ecoff_section_data): Define.
2877         (ecoff_bfd_relax_section): Don't define.
2878         * ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free
2879         the debugging information if it has already been read.
2880         (ecoff_indirect_link_order): Handle _cooked_size being different
2881         from _raw_size.  Don't reread the contents or the relocs if they
2882         have already been read in.
2883         * coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from
2884         18 to 16.
2885         (PCREL16_EXPANSION_ADJUSTMENT): Define.
2886         (mips_relocate_refhi): Take adjust argument.
2887         (mips_relocate_section): Handle reloc offsets stored in section
2888         used_by_bfd field.  Call mips_relax_pcrel16 to handle details of
2889         expanding an out of range PCREL16.  Keep trace of adjustments
2890         required by expansions.  Set s and unset h when converting a reloc
2891         from undefined to section.  Change handling of PC relative relocs:
2892         if against a section, they are correct in the object file, if
2893         against an external symbol they are pcrel_offset.
2894         (mips_relax_section): New function.
2895         (mips_relax_pcrel16): New function.
2896         (ecoff_bfd_relax_section): Define.
2897         * coff-alpha.c (ecoff_bfd_relax_section): Define.
2898         * ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments
2899         built by mips_relax_section when writing out addresses.
2900         * elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field.
2901
2902         * aoutx.h (NAME(aout,find_nearest_line)): The caller expects
2903         functionname_ptr to be set to a symbol name, so prepend
2904         symbol_leading_char.
2905
2906 Thu Mar 24 11:33:46 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
2907
2908         * coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info
2909         for 16bit relative branches.
2910         * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on
2911         overflow.
2912
2913 Thu Mar 24 09:21:13 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2914
2915         * som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects.
2916         (som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise.
2917
2918 Wed Mar 23 14:29:31 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
2919
2920         * netbsd386.c (N_SET_FLAGS): Delete the old definition.
2921
2922 Wed Mar 23 14:58:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2923
2924         Clean up the relaxing code for the new linker.
2925         * targets.c (_bfd_relax_section): Take boolean *again argument
2926         rather than asymbol list.
2927         * bfd.c (bfd_relax_section): Change name of fourth argument from
2928         symbols to again.
2929         * reloc.c (bfd_generic_relax_section): Take boolean *again
2930         argument rather than asymbol list.  Always return true.
2931         * bout.c: Include genlink.h.
2932         (aligncode, perform_slip): Declare.
2933         (perform_slip): Take BFD argument rather than asymbol list.
2934         Changed all callers.  Get the symbols from the BFD.  Change the
2935         hash table entry value as well as the symbol value.
2936         (abs32code): Take BFD argument rather than asymbol list.  Changed
2937         all callers.
2938         (aligncode): Likewise.
2939         (b_out_relax_section): Take boolean *again argument rather than
2940         asymbol list.  Only return false if an error occurred.  Set *again
2941         to false.  Get symbols from BFD.
2942         * reloc16.c: Include genlink.h.
2943         (bfd_perform_slip): Take BFD argument rather than asymbol list.
2944         Get the symbols from the BFD.  Change the hash table entry value
2945         as well as the symbol value.
2946         (bfd_coff_reloc16_relax_section): Take boolean *again argument
2947         rather than asymbol list.  Only return false if an error occurred.
2948         Set *again to false.  Get symbols from BFD.
2949         * coffcode.h (bfd_coff_backend_data): Change
2950         _bfd_coff_reloc16_estimate to take BFD argument rather than
2951         asymbol list.
2952         (bfd_coff_reloc16_estimate): Corresponding change.
2953         (dummy_reloc16_estimate): Corresponding change.
2954         * libcoff-in.h (bfd_coff_reloc16_relax_section): Change
2955         declaration to take boolean * rather than asymbol list.
2956         (bfd_perform_slip): Change declaration to take BFD rather than
2957         asymbol list.
2958         * coff-h8300.c (h300_reloc16_estimate): Take BFD argument rather
2959         than asymbol list.  Changed calls to bfd_perform_slip.
2960         * bfd-in2.h: Rebuilt.
2961         * libbfd.h: Rebuilt.
2962         * libcoff.h: Rebuilt.
2963         * Makefile.in: Rebuilt dependencies.
2964
2965         * genlink.h (_bfd_generic_link_get_symbols): Define.
2966         (_bfd_generic_link_get_symcount): Define.
2967         * linker.c (generic_link_read_symbols): New function.
2968         (generic_link_add_object_symbols): Use it.  Use
2969         _bfd_generic_link_get_symbols and _bfd_generic_link_get_symcount
2970         to get the symbols from the BFD.
2971         (generic_link_check_archive_element): Likewise.
2972         (_bfd_generic_final_link): Likewise.
2973         (_bfd_generic_link_output_symbols): Likewise.
2974         (default_indirect_link_order): Likewise.
2975         (generic_link_add_symbol_list): Store pointer to hash table entry
2976         in asymbol udata field.
2977
2978 Tue Mar 22 13:09:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2979
2980         * coff-mips.c (mips_howto_table): Add entry for new MIPS_R_PCREL16
2981         reloc, used in embedded PIC code.
2982         (mips_adjust_reloc_in): Change sanity check to permit new reloc.
2983         (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_16_PCREL_S2 into
2984         MIPS_R_PCREL16.
2985
2986         * elf32-mips.c (mips_elf_final_link): Account for link_order
2987         relocs when allocating space for relocations.  Set SEC_RELOC flag
2988         for any section which has relocs.  Handle link_order relocs in
2989         link_order loop.  Use _bfd_generic_link_add_symbols_collect for
2990         add_symbls entry point.
2991
2992         * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before
2993         counting relocs.  Set SEC_RELOC flag for any section which has
2994         relocs.
2995
2996         * linker.c (_bfd_default_link_order): Handle bfd_data_link_order.
2997
2998         * linker.c (_bfd_generic_link_add_symbols): Just call
2999         generic_link_add_symbols.
3000         (_bfd_generic_link_add_symbols_collect): New function, like
3001         _bfd_generic_link_add_symbols but also collect constructors and
3002         destructors by name as collect2 does.
3003         (generic_link_add_symbols): New function, like old
3004         _bfd_generic_link_add_symbols but with collect argument.
3005         (generic_link_add_object_symbols): Take collect argument.
3006         (generic_link_check_archive_element_no_collect): New function.
3007         (generic_link_check_archive_element_collect): New function.
3008         (generic_link_check_archive_element): Take collect argument.
3009         (generic_link_add_symbol_list): Take collect argument.
3010         (_bfd_generic_link_add_one_symbol): Rename constructor argument to
3011         collect.
3012         * libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare.
3013         * libbfd.h: Rebuilt.
3014
3015 Tue Mar 22 10:04:00 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3016
3017         * archive.c (bfd_construct_extended_name_table): Use ar_padchar
3018         for first character in an extended name.
3019         (_bfd_write_archive_contents): If ar_padchar == '/', then use
3020         "//" as the name of the special archive member holding the
3021         extended name table.
3022
3023 Mon Mar 21 12:28:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3024
3025         Support for link_order types which generate relocs in order to
3026         support -Ur in the linker.
3027         * linker.c (generic_link_add_symbol_list): Remove bitsize argument
3028         from call to _bfd_generic_link_add_one_symbol.
3029         (_bfd_generic_link_add_one_symbol): Remove bitsize argument.
3030         Don't pass bitsize to constructor call back.  Pass BFD_RELOC_CTOR
3031         instead of bitsize to add_to_set call back.
3032         (_bfd_generic_final_link): Account for link_order relocs when
3033         allocating space for relocations.  Handle them in link_order loop.
3034         (_bfd_generic_reloc_link_order): New function.
3035         (_bfd_default_link_order): If a reloc_link_order is seen here,
3036         abort.
3037         (_bfd_count_link_order_relocs): New function.
3038         * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize
3039         argument from declaration.
3040         (_bfd_generic_reloc_link_order): Declare.
3041         (_bfd_count_link_order_relocs): Declare.
3042         * libbfd.h: Rebuilt.
3043         * aoutx.h (aout_link_add_symbols): Remove bitsize argument from
3044         call to _bfd_generic_link_add_one_symbol.
3045         (NAME(aout,final_link)): Account for link_order relocs when
3046         allocating space for relocations.  Handle them after handling all
3047         input BFDs.
3048         (aout_link_reloc_link_order): New function.
3049         * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from
3050         call to _bfd_generic_link_add_one_symbol.
3051         (ecoff_bfd_final_link): Account for link_order relocs when
3052         allocating space for relocations.  Handle them in link_order loop.
3053         (ecoff_link_write_external): Set the storage class of a defined
3054         linker created symbol based on the section it is in.  Correct
3055         bfd_link_hash_weak case to use .sc rather than .st.
3056         (ecoff_reloc_link_order): New function.
3057         * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle
3058         BFD_RELOC_CTOR.
3059         * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise.
3060
3061         * sunos.c (sunos_read_dynamic_info): Remove unused locals dynsym
3062         and buf.
3063
3064         * cisco-core.c (cisco_core_file_p): Only pass one argument to
3065         bfd_zmalloc.  Free a pointer, not a union.
3066         (cisco_bfd_is_local_label): Correct cast from asection to asymbol.
3067
3068 Sun Mar 20 09:24:36 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3069
3070         * bfd/som.c (som_begin_writing): Fix thinko (off by one error).
3071
3072         * som.c (bfd_section_from_som_symbol): Only to do the value
3073         comparison for function symbols within executables.
3074
3075         * som.c (bfd_section_from_som_symbol): Renamed from
3076         som_section_from_subspace_index.  Pass in a native SOM symbol.
3077         For executables, iterate through the sections to find out
3078         which contains the symbol's address rather than using the
3079         symbol_info field.  (symbol_info has a different meaning for
3080         dynamicly linked executables.)
3081
3082         * trad-core.c (trad_unix_core_file_p): Don't pass abfd to
3083         bfd_zmalloc.
3084
3085         * som.c (som_begin_writing): Fix braino (one call to align
3086         space/subspace data was done unconditionally rather than
3087         just for executables.)
3088
3089         * som.c (som_begin_writing): Align text in all executables to
3090         make HPUX kernel happy.  Fixes strip/objcopy for shared
3091         executables.
3092
3093 Sat Mar 19 07:06:59 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3094
3095         * som.c (som_begin_writing): Account for alignment needs of
3096         subspaces too when writing executables.  Never request a negative
3097         bss size.  Fixes some problems with demand paged executables,
3098         still having problems with pure executables and shared executables.
3099
3100 Fri Mar 18 19:12:47 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3101
3102         * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not
3103         bfd_zalloc for rawptr, because later on we may call free, not
3104         bfd_release, on it.
3105
3106         * bfd.c (struct _bfd): Add cisco_core_struct to tdata union.
3107         * libbfd.c (bfd_read, bfd_seek): Add comments regarding errors.
3108         * cisco-core.c: New file.
3109         * Makefile.in: Change accordingly.
3110         * configure.in: Recognize cisco_core_vec.
3111         * config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec.
3112         * targets.c: Add cisco_core_vec.
3113         * bfd-in2.h: Rebuilt.
3114
3115 Fri Mar 18 18:13:49 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3116
3117         * som.h (som_copyable_section_data_struct): New structure
3118         containing all the private section information which needs
3119         to be copied from input section to output section during
3120         objcopy or strip.
3121         (som_section_data_struct): Remove several fields now in
3122         som_copyable_section_data_struct.  Make the space and 
3123         subspace dictionaries be pointers (to save space when
3124         only reading objects).
3125
3126         * som.c (bfd_som_set_section_attributes): Now returns a boolean;
3127         some references changed.  Allocate a copyable data stucture if
3128         none exists.  Store info into the copyable data structure.
3129         (bfd_som_set_subsection_attributes): Likewise.
3130         (som_is_space, som_is_subspace, som_is_container): New functions.
3131         Use these instead of directly accessing private data.
3132         (som_prep_headers): Allocate space and subspace headers here.
3133         Fill in some fields in the space/subspace headers from the
3134         copyable data.
3135         (som_bfd_copy_private_section_data): Only copy the stuff
3136         that we really need to make objcopy and strip work.  Allocate
3137         the copy_data structure for the output bfd before copying.
3138
3139         * som.h (struct som_exec_data): New structure to hold exec
3140         info that must be preserved when running objcopy/strip.
3141         (struct somdata): Add new "exec_data" field and accessor
3142         macro.  Add some comments on how the various fields are used.
3143         (som_section_data_struct): Make is_space and is_subspace bitfields.
3144         Delete unused subspace_index.  All references now use the
3145         target_index field within the section structure itself.
3146
3147         * som.c (make_unique_section): Delete unused declaration.
3148         (som_bfd_copy_private_bfd_data): New function.
3149         (som_object_setup): Allocate space for and save exec information
3150         that needs to be copied during objcopy/strip.
3151         (som_mkobject): Do not allocate space for a file header here.
3152         It is not used when only reading SOM objects.
3153         (som_prep_headers): Allocate space for and attach a file header
3154         to the output bfd.  For executables, use the saved system_id
3155         value rather than trying to guess the right value.  Do not abort
3156         wwhen setting file_hdr->entry* for executables.
3157         (som_begin_writing): For executables, set the exec_entry and
3158         exec_flags fields.
3159         (som_copy_private_backend_section_data): Always return a value.
3160
3161         * libhppa.h (PA_PAGESIZE): Define.
3162
3163         * som.c (SOM_ALIGN): Define.
3164         (som_begin_writing): If writing an executable, initialize all
3165         fields in the exec header to zero.  Update fields in the exec
3166         header as sizes of loadable subspaces are computed.  Carefully
3167         preserve alignments when building executables.  Actually write the
3168         exec after all the fields are filled in.
3169
3170         * Better long-filename handling.  Reads SOM ABI compliant extended
3171         names, but doesn't quite write compliant extended names yet.
3172         * som.c (som_slurp_extended_name_table): Delete function.  The
3173         generic code will handle things correctly.
3174         (som_slurp_armap): Seek to the beginning of the next member.
3175         (normalize): New function.
3176         (som_bfd_ar_write_symbol_stuff): Take the size of the extended
3177         name table into account when computing the file offsets in the
3178         SOM dictionary.  Make sure to align to an even boundary.
3179         (som_write_armap): Initialize the checksum to zero.
3180         (ar_maxchars): Fix.  Opps.
3181
3182 Fri Mar 18 20:35:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3183
3184         * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit
3185         machine.  Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13.
3186
3187 Thu Mar 17 18:26:46 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3188
3189         * bfd-in.h (BFD_VERSION): Use @VERSION@.
3190         * Makefile.in (bfd.h): Replace it with contents of VERSION file.
3191         * bfd-in2.h: Regenerated.
3192
3193         * trad-core.c (trad_unix_bfd_is_local_label): Fixed typo where
3194         this was also named trad_unix_bfd_copy_private_bfd_data.
3195
3196 Thu Mar 17 10:37:07 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3197
3198         * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c,
3199         elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0)
3200         returns NULL, it is not an error.  It's possible that some of
3201         these checks are not necessary (because the size can never be
3202         zero), but putting in the checks is the conservative thing to do
3203         in light of the fact that some of these malloc calls replaced
3204         unchecked alloca calls, in which a zero argument would work fine.
3205
3206 Thu Mar 17 11:44:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3207
3208         * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove
3209         duplicate definition.
3210         (osf_core_bfd_is_local_label): Define.
3211
3212         * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail
3213         if malloc (0) fails.  bfd_canonicalize_reloc returning 0 is not a
3214         failure indication, it merely means there are no relocs.
3215
3216         * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space
3217         after NAME, since SunOS /bin/cc can't handle it.
3218
3219 Wed Mar 16 16:43:33 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3220
3221         * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field.
3222         From sukes@glue.umd.edu (Tasuki Hirata).
3223
3224 Wed Mar 16 07:55:54 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3225
3226         * aoutf1.h (4 places): Use a simple #if on ARCH_SIZE, rather than
3227         all that convoluted stuff with NAME, CAT3, etc.  The convoluted
3228         stuff broke for SunOS4 /bin/cc (due to DEFUN elimination, I guess).
3229
3230 Wed Mar 16 00:02:05 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3231
3232         * som.c (som_prep_for_fixups): Detect section symbols based
3233         on either the lack of private data or the symbol flags.  Do not
3234         munge section symbol names anymore -- they no longer confuse GDB.
3235         (som_begin_writing): Leave space for an exec header if writing
3236         an executable.
3237         (som_slurp_symbol_table): Recognize both forms of section symbol
3238         names "L$0\002" and "$<FOO>$".  Change the name of "L$0\002"
3239         section symbols to be the name of the section they represent.
3240         Debugging  symbols begin with "L$0\001", not just "L$".
3241
3242 Tue Mar 15 22:58:28 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3243
3244         * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
3245
3246         * bfd-in.h (JUMP_TABLE): Add new entries to the jump table
3247         for bfd_copy_private_section_data, bfd_copy_private_bfd_data,
3248         and bfd_is_local_label.
3249
3250         * targets.c: Add new entries to the bfd_target structure.
3251         
3252         * bfd.c (bfd_copy_private_bfd_data): New definition.
3253
3254         * section.c (bfd_copy_private_section_data): New definition.
3255
3256         * syms.c (bfd_is_local_label): New definition.
3257
3258         * libbfd-in.h (bfd_generic_is_local_label): Declare.
3259
3260         * libbfd.c (bfd_generic_is_local_label): New function.
3261
3262         * *-core.c: Provide default definitions for new functions in
3263         the target vector which all point to bfd_false.
3264
3265         * aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c
3266         libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c
3267         Default new vectors for copying private backend data to bfd_true.
3268         Default new vector for determining if a symbol is a local label
3269         to bfd_generic_is_local_label.
3270
3271         * som.c (som_bfd_copy_private_section_data): New function.
3272         (som_bfd_is_local_label): New function.
3273         (som_bfd_copy_private_bfd_data): For now default to bfd_true.
3274
3275         * elf32-hppa.c (hppa_elf_is_local_label): New function.
3276
3277 Tue Mar 15 23:55:47 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3278
3279         * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table.
3280
3281 Tue Mar 15 04:41:13 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
3282
3283         * Most files:
3284         Replace DEFUN and DEFUN_VOID with K&R-style function definition.
3285         Indent some of them to GNU standards.
3286
3287         * aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
3288         cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
3289         elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
3290         libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
3291         Update copyright years.
3292
3293 Mon Mar 14 11:41:23 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3294
3295         * som.c (som_prep_for_fixups): A relocation involving the section
3296         symbol for the *ABS* section is really a relocation involving
3297         no symbol.
3298         (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for
3299         undefined symbols.  Correctly distinguish between debugger symbols
3300         and section symbols.
3301
3302         * som (setup_sections): Set SEC_DEBUGGING and the section attributes
3303         for spaces and subspaces.
3304
3305         * som.c (som_bfd_count_ar_symbols): Fix typo.
3306
3307         * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and
3308         HAS_RELOC based on the object's magic number.
3309         (make_unique_section): Delete function.  BFD and its users are
3310         prepared to handle multiple sections with the same name.
3311         (setup_sections): Allocate space on the BFD's obstack to hold
3312         section names.  Use bfd_make_setion_anyway rather than the
3313         obsolete make_unique_section.
3314         (som_prep_headers): Choose the correct SOM magic number based
3315         on the BFD's flags.
3316         (som_bfd_fill_in_ar_symbols): Return false, not NULL on error.
3317
3318 Sat Mar 12 09:46:09 1994  Ian Lance Taylor  (ian@cygnus.com)
3319
3320         * elf32-ppc.c: Renamed from elf32-powerpc.c.
3321         * nlm32-ppc.c: Renamed from nlm32-powerpc.c.
3322         * Makefile.in, configure.in: Corresponding changes.
3323
3324 Fri Mar 11 22:27:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3325
3326         * elf32-powerpc.c: Extensive changes to update to preliminary ABI.
3327
3328 Fri Mar 11 00:34:59 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3329
3330         * sunos.c (sunos_read_dynamic_info):  Assume that dynamic info
3331         is always located at the start of the data section to allow
3332         recovery of the dynamic info from a stripped executable.
3333         * ecoff.c (ecoff_styp_to_sec_flags):  Handle STYP_PDATA, STYP_XDATA
3334         and STYP_COMMENT.
3335
3336 Wed Mar  9 17:17:53 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3337
3338         * libbfd-in.h: Remove alloca cruft.  It was missing some necessary
3339         cruft (like the #pragma alloca for AIX).
3340         In addition to that problem, the C alloca calls xmalloc, which
3341         means checking for being out of memory can't work right.  The
3342         following changes remove all uses of alloca from BFD.
3343         * hosts/solaris2.h: Remove alloca cruft.
3344         * som.c: Replace alloca with a fixed size auto array.
3345         * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c,
3346         ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c,
3347         sunos.c: Replace alloca with malloc and appropriate error checking and
3348         freeing.
3349         * linker.c: Replace alloca with obstack_alloc.
3350         * libbfd.h: Rebuilt.
3351
3352 Tue Mar  8 12:10:38 1994  Ian Lance Taylor  (ian@cygnus.com)
3353
3354         * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like
3355         MIPS_R_GPREL.
3356
3357 Sat Mar  5 14:08:54 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3358
3359         * elf32-hppa.h, elfcode.h:  Replace uses of Elf*_Half, Elf*_Word,
3360         Elf*_Off typedefs by their expansion, the typedefs have been
3361         removed from include/elf/internal.h.
3362         * elfcode.h (bfd_section_from_shdr):  Handle SHT_DYNAMIC section like
3363         SHT_PROGBITS section.
3364
3365 Thu Mar  3 20:03:39 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3366
3367         * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD.
3368
3369 Wed Mar  2 13:28:06 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
3370
3371         * configure.host: Recognize i[34]86-sequent-*.
3372
3373         * trad-core.c (trad_unix_core_file_p): A non-zero, not zero,
3374         return from bfd_seek indicates an error.
3375         New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace
3376         TRAD_CORE_STACK_OFFSET.
3377         * hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and
3378         TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET.
3379
3380 Wed Mar  2 11:57:03 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3381
3382         * som.[ch]: Do not include libhppa.h in som.c, instead include
3383         it in som.h.
3384
3385         * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead
3386         include it in elf32-hppa.h.
3387
3388         * som.c (log2): Return -1 on error rather than aborting.
3389         (setup_sections): Bubble up an error from log2.
3390
3391         * Changes to make HP C compiler happy in both traditional
3392         and ANSI mode.
3393         * som.c (hppa_som_gen_reloc_type): Use correct enum type for
3394         field parameter.
3395         (bfd_som_set_section_attributes): Use unsigned int rather than
3396         unsigned char to avoid GNU-C extensions.
3397         (bfd_som_attach_aux_hdr): Return a boolean to indicate success
3398         or failure rather than aborting on failure.
3399
3400         * som.h (bfd_som_set_section_attributes): Fix prototype to match
3401         som.c changes.
3402         (bfd_som_attach_aux_hdr): Add prototype.
3403         (hppa_som-gen_reloc_type): Likewise.
3404
3405         * elf32-hppa.c: Add a couple casts to make HP compiler happy.
3406         (hppa_look_for_stubs_in_section): Do not return false on failure
3407         until rest of code is ready to handle it.  Abort for now.
3408
3409 Tue Mar  1 18:33:59 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
3410
3411         * bfd-in2.h: Rebuilt.
3412
3413 Tue Mar  1 13:06:53 1994  Kung Hsu  (kung@mexican.cygnus.com)
3414
3415         * i386os9k.c: use new functions bfd_set_error and bfd_get_error.
3416         * Makefile.in: delete an extra blank.
3417         * configure.in : Add i396os9k_vec.
3418
3419 Mon Feb 28 15:41:01 1994  Kung Hsu  (kung@mexican.cygnus.com)
3420
3421         * config.bfd : Add i386-os9k.
3422         * config/i386-os9k.mt : Newly add os9k target makefile.
3423
3424         * i386os9k.c : new file to handle os9k format bfd.
3425         * Makefile.in : Handle new file i386os9k.c
3426         * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec.
3427         * cache.c : Initialize cache_sentinel to 0.
3428
3429 Sun Feb 27 16:30:55 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3430
3431         * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch
3432         action in case where caller specified no argument relocation.
3433         (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr
3434         right in the original relocation and the stub's relocation.
3435
3436         * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo.  Delete
3437         unused symbols argument.
3438
3439         * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather
3440         than asymbol * for original target symbol.  All callers changed.
3441         Set reloc->sym_ptr_ptr appropriately.
3442         (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly.
3443         (hppa_elf_look_for_stubs_in_section): No longer need symbols
3444         argument.  Use the output symbols when canonicalizing the relocs,
3445         creating them if necessary.
3446
3447         * linker.c (_bfd_generic_link_output_symbols): Do not
3448         rebuild/clobber the output symbols if they already exist.
3449
3450 Sun Feb 27 15:22:36 1994  Stan Shebs  (shebs@andros.cygnus.com)
3451
3452         * targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that
3453         check all the pointer dereferences.  Enabled via DEBUG_BFD_SEND.
3454         * bfd-in2.h: Rebuilt.
3455
3456         * srec.c (hex_value): Always set to a size of 256 bytes.
3457         (srec_init): Cosmetic changes.
3458
3459 Sun Feb 27 11:18:47 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3460
3461         * elf32-hppa.c: Second half of major cleanup.  More comments,
3462         PARAMize and staticize rest of functions.  Delete unused
3463         functions.  Delete unused/unnecessary arguments to some functions.
3464         Group static vars together.  Abort for bad errors until we have
3465         error code propogation working.  Work on spacing and indention.
3466         Add FIXMEs for unresolved problems.  Use enums rather than
3467         #defines for lots of things.  Merge two functions which build
3468         linker stubs into a single function (so they can easily share a
3469         ton of common code).
3470
3471 Sat Feb 26 10:00:45 1994  Ian Lance Taylor  (ian@cygnus.com)
3472
3473         * reloc.c (_bfd_relocate_contents): Adjust handling of overflow to
3474         avoid depending upon right shifts of signed numbers, and to
3475         correct handling of src_mask with lower bits zero.
3476
3477         * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc.
3478         * ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise.
3479         * elf32-i386.c: Likewise.
3480         * elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old
3481         #if 0 code.
3482         (elf_write_phdrs): Make i unsigned.
3483         (map_program_segments): Make i and n_left unsigned.
3484         (assign_file_positions_except_relocs): Make i unsigned.
3485         (write_shdrs_and_ehdr): Make count unsigned.
3486         (assign_file_positions_for_relocs): Make i unsigned.
3487         (NAME(bfd,elf_write_object_contents)): Make count unsigned.
3488         (section_from_elf_index): Make index argument unsigned.
3489
3490 Fri Feb 25 21:34:58 1994  Ian Lance Taylor  (ian@cygnus.com)
3491
3492         * elfcode.h: Don't include assert.h.
3493         (swap_out_syms): Use BFD_ASSERT rather than assert.
3494
3495         * linker.c (_bfd_generic_link_write_global_symbol): Add missing
3496         break in switch.
3497
3498         * hosts/i386v4.h (qsort, strtol): Remove incorrect and useless
3499         declarations.
3500
3501 Fri Feb 25 16:35:57 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3502
3503         * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c.
3504
3505         * elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments.
3506         (elf_hppa_tc_make_sections): Likewise.
3507         (elf_hppa_final_processing): Add extern decl.
3508
3509         * elf32-hppa.c: First half of major cleanup.  Add/cleanup lots of
3510         comments.  PARAMize some static functions.  Delete unused functions.
3511         Delete unused/unnecessary arguments to many functions.  Group
3512         static vars together.  Collapse common case statements together
3513         in many places.  Use default case when possible instead of listing
3514         each case separately.  Abort for bad errors until we get error
3515         code propogation working.  Work on spacing and indention problems.
3516         Add FIXMEs for some unresolved problems.  Delete hopelessly broken 
3517         COMPLEX relocation support (it's never used anyway).
3518         (hppa_elf_rebuild_insn): Delete.  Moved into libhppa.h.
3519         (elf_hppa_tc_symbol): Accept and use new arguments (symext chains).
3520         (elf_hppa_tc_make_sections): Likewise.
3521
3522         * format.c (bfd_check_format_matches): Initialize matching_vector
3523         to keep gcc -Wall quiet.
3524
3525         * elfcode.h (elf_slurp_reloca_table): Fix typo.
3526
3527         * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)"
3528         not "sizeof (som_symbol_type *)".
3529
3530         * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)"
3531         not "sizeof (asymbol").  Opps.
3532
3533 Fri Feb 25 13:19:04 1994  Ted Lemon  (mellon@pepper.ncd.com)
3534
3535         * bfd.c (bfd_get_gp_size): Can't return gp value on an archive.
3536         (bfd_set_gp_size):  Can't set gp value on an archive.
3537
3538 Fri Feb 25 12:57:00 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
3539
3540         * srec.c (pass_over): Don't skip too many characters when
3541         end of line seen.
3542
3543 Fri Feb 25 11:41:57 1994  Ian Lance Taylor  (ian@cygnus.com)
3544
3545         * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte
3546         boundary.
3547
3548 Thu Feb 24 07:13:22 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3549
3550         * som.c (som_bfd_derive_misc_symbol_info): Derive symbol_info
3551         field for absolute symbols in the same manner as undefined
3552         and common symbols.
3553
3554 Thu Feb 24 04:29:19 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3555
3556         * elfcode.h (elf_core_file_p):  Check for core file e_machine match
3557         like in elf_object_p.
3558
3559 Wed Feb 23 18:28:37 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3560
3561         * elfcode.h (alloca): Delete declaration.
3562
3563         * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic
3564         number rather than HP9000S800_ID.  Note som.c is careful
3565         to make sure CPU_PA_RISC1_0 is always defined.
3566
3567 Mon Feb 21 10:12:02 1994  Stan Shebs  (shebs@andros.cygnus.com)
3568
3569         * Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply
3570         flags to explicit compile actions.
3571
3572 Mon Feb 21 09:50:06 1994  Ian Lance Taylor  (ian@lisa.cygnus.com)
3573
3574         * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here.
3575         * ecoff.c (ecoff_write_object_contents): Make sure .bss section
3576         ends on a page boundary if there is no symbol table.
3577         (ecoff_bfd_final_link): Don't set symhdr->magic here.
3578
3579         * hosts/hp300.h: Include <stdlib.h>; don't declare free.
3580
3581         * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca
3582         rather than an array of variable size.
3583         (som_bfd_fill_in_ar_symbols): Likewise.
3584         (som_bfd_ar_write_symbol_stuff): Likewise.
3585
3586         * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift
3587         operation to avoid OSF 1.3 cc bug.
3588         * ecoff.c (ecoff_write_object_contents): Make text_size, data_size
3589         and bss_size bfd_size_type instead of unsigned long.  Make
3590         text_start and data_start bfd_vma instead of unsigned long.
3591         * ecofflink.c (ecoff_add_string): Remove incorrect cast of return
3592         value.
3593
3594 Sun Feb 20 16:06:54 1994  Ian Lance Taylor  (ian@lisa.cygnus.com)
3595
3596         * linker.c (_bfd_generic_link_add_archive_symbols): Consider
3597         symbols in the order they appear in the archive map.
3598
3599 Sat Feb 19 03:17:32 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3600
3601         * coff-alpha.c (reloc_nil):  Add forward declaration, add missing
3602         error_message argument.
3603         * coff-sparc.c (bfd_coff_generic_reloc):  Add forward declaration,
3604         add missing error_message argument.
3605         * mipsbsd.c (mips_fix_hi16_s):  Add forward declaration, add missing
3606         error_message argument.
3607
3608 Fri Feb 18 11:41:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3609
3610         Support for PowerPC NetWare.
3611         * nlm32-powerpc.c: New file.
3612         * config.bfd (powerpc-*-netware*): New target; use ppc-nlm.
3613         * config/ppc-nlm.mt: New file.
3614         * configure.in (nlm32_powerpc_vec): New target vector; use
3615         nlm32-powerpc.o, nlm32.o, nlm.o.
3616         * targets.c (nlm32_powerpc_vec): Declare.
3617         * Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o.
3618         (CFILES): Add nlm32-powerpc.c.
3619
3620         Initial support for PowerPC ELF.  Done without an ABI, and
3621         probably to be changed when I get an ABI.
3622         * config.bfd (powerpc-*-sysv4*): New target; use ppc-elf.
3623         * config/ppc-elf.mt: New file.
3624         * configure.in (bfd_elf32_powerpc_vec): New target vector; use
3625         elf32-powerpc.o, elf32.o, elf.o.
3626         * elf32-powerpc.c: New file.
3627         * elfcode.h (prep_headers): Add bfd_arch_powerpc case.
3628         (elf_set_arch_mach): Likewise.
3629         * targets.c (bfd_elf32_powerpc_vec): Declare.
3630         * Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o.
3631         (CFILES): Add elf32-powerpc.c.
3632         Rebuilt dependencies.
3633
3634 Thu Feb 17 15:29:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3635
3636         * coffgen.c (coff_write_linenumbers): Always return a value.
3637
3638         * elfcode.h (elf_slurp_symbol_table): Handle zero symbols
3639         reasonably.  Allocate x_symp using alloca.
3640
3641         * elfcode.h (map_program_segments): ELF program header entries
3642         must be sorted by load address.  This used to generate the entries
3643         in reverse order.
3644
3645         * section.c (SEC_IN_MEMORY): Define.
3646         (asection): Rename unused field otheruserdata to contents, and
3647         make it char *.
3648         (bfd_make_section_anyway): Initialize contents field to NULL.
3649         (bfd_get_section_contents): If SEC_IN_MEMORY is set, get section
3650         contents from contents field rather than from file.
3651         * bfd-in2.h: Rebuilt.
3652
3653 Thu Feb 17 08:30:53 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3654
3655         * bfd.c (bfd_get_error, bfd_set_error): New functions.
3656         (bfd_error): Make static.
3657         (bfd_error_type): Renamed from bfd_ec.  Prepend "bfd_error_" to
3658         all values.
3659         * bfd-in2.h: Regenerated.
3660         * aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h, 
3661         aoutf1.h, aoutx.h, archive.c, archures.c, 
3662         bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c, 
3663         coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c, 
3664         ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c, 
3665         elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c, 
3666         i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c, 
3667         lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c, 
3668         nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, 
3669         ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c, 
3670         srec.c, sunos.c, syms.c, targets.c, tekhex.c, 
3671         trad-core.c: Change callers.
3672
3673 Tue Feb 15 22:27:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3674
3675         * som.c: Remove FIXMEs for things which have been dealt with.
3676
3677 Tue Feb 15 19:39:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3678
3679         * section.c (bfd_get_section_contents): Since this function reads
3680         unrelocated contents, the section's raw size is always the one to
3681         use for bounds checking.
3682
3683         * linker.c (default_indirect_link_order): In assertion, compare
3684         link_order size field against cooked size, not raw size, of input
3685         section.
3686
3687         * bout.c (b_out_get_reloc_upper_bound): For BSS section, just
3688         return 0.
3689         (aligncode): When shrinking, the addend should be set to the
3690         current offset in the section plus the number of bytes of padding
3691         that will actually be retained.
3692         (b_out_relax_section): If a section contains no relocations, don't
3693         bother processing them.
3694         (b_out_get_relocated_section_contents): Set reloc_done.  Assert
3695         that bfd_get_section_contents returns true.  Check that relocs are
3696         properly ordered.
3697         (b_out_get_relocated_section_contents, case ALIGNDONE): Assert
3698         that reloc->addend falls between the current source offset and the
3699         raw size of the input section.
3700
3701         * config.bfd: Support i960 vxworks versions > 5.0 with coff, not
3702         bout.  Default with no version number is still bout.  Support
3703         explicit i960-coff target too.
3704
3705         * bout.c: Changed some indentation, deleted trailing whitespace,
3706         fixed some comments, removed some "#if 1" lines.
3707         (output_addr): New macro.
3708         (calljx_callback, callj_callback, get_value, abs32code, aligncode,
3709         b_out_get_relocated_section_contents): Use it for readability.
3710
3711 Tue Feb 15 09:00:16 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3712
3713         * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM
3714         symbols, not the BFD symbols.
3715         (som_bfd_ar_write_symbol_stuff): Likewise.
3716
3717 Mon Feb 14 22:55:20 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3718
3719         * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't
3720         have any symbols.
3721
3722         * Finish basic read-write support for SOM archive libraries.  Bugs
3723         surely remain as this hasn't been tested all that much.
3724         * som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define.
3725         (struct som_misc_symbol_info): New structure to hold info necessary
3726         to build both normal and library symbol tables.
3727         (som_derive_misc_symbol_info): New function to derive info necessary
3728         to build both normal and library symbol tables.
3729         (som_build_and_write_symbol_table): Use new function to derive misc
3730         symbol information.
3731         (som_slurp_symbol_table): Update backend private data for symbols
3732         appropriately.
3733         (som_bfd_prep_for_ar_write): New function.
3734         (som_bfd_ar_symbol_hash): New function.
3735         (som_bfd_ar_write_symbol_stuff): New function.
3736         (som_write_armap): Flesh out.
3737         (som_vec): Fix ar padding character.
3738
3739         * som.c: Consistently use memset rather than bzero.
3740
3741 Mon Feb 14 17:02:28 1994  Stu Grossman  (grossman at cygnus.com)
3742
3743         * coff-rs6000.c:  Add Lynx core file support, use HOST_AIX, where
3744         appropriate.
3745         * rs6000-core.c:  Use HOST_AIX instead of COREFILES_PLEASE.
3746         * config/rs6000.mh:  Remove defs of ARCHIVES_PLEASE and
3747         COREFILES_PLEASE.
3748         * config/rs6000lynx.mh:  Turn on Lynx core file support.
3749         * hosts/rs6000.h:  #define HOST_AIX.
3750         * hosts/rs6000lynx.h:  Create this to enable Lynx host support.
3751
3752 Sun Feb 13 14:30:00 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3753
3754         * som.h (som_symbol_data): Safely access backend private data
3755         for BFD symbols.  All callers changed.
3756
3757         * Read-only SOM archive support.
3758         * som.c (som_bfd_count_ar_symbols): New helper function.
3759         (som_bfd_fill_in_ar_symbols): New helper function.
3760         (som_slurp_armap): New function to read a SOM LST.
3761
3762         * som.h: Include <lst.h> and <ar.h>.
3763
3764 Sat Feb 12 22:34:14 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3765
3766         * elfcode.h (elf_map_symbols): Fix typo.
3767         (write_object_contents): Check return values from prep_headers and
3768         elf_compute_section_file_positions.
3769         (set_section_contents): Likewise.
3770
3771 Fri Feb 11 16:56:50 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3772
3773         * archive.c (normalize) [VMS]: Call malloc, not bfd_xmalloc.
3774         (bfd_construct_extended_name_table): Check result of normalize.
3775
3776 Tue Feb  8 08:57:31 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3777
3778         Make all callers of malloc or realloc (including via obstacks)
3779         check the result for NULL.  Most set bfd_error to no_memory and
3780         return in that case; a few are harder to fix, and are marked
3781         with "FIXME <return type>".
3782
3783         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub
3784         hppa_elf_build_long_branch_stub):  Check bfd_make_empty_symbol return.
3785         * linker.c (_bfd_generic_link_output_symbols
3786         _bfd_generic_link_write_global_symbol): Ditto
3787         * section.c (bfd_make_section_anyway): Ditto.
3788
3789         * tekhex.c (find_chunk tekhex_mkobject): Check bfd_alloc.
3790         (first_phase): Ditto.  FIXME void
3791         (tekhex_make_empty_symbol): Check bfd_zalloc.
3792
3793         * sunos.c (sunos_read_dynamic_info): Check bfd_zalloc.
3794         (MY(read_dynamic_symbols) MY(read_dynamic_relocs)): Check bfd_alloc.
3795
3796         * stringhash.c (_bfd_stringtab_hash_newfunc): Check bfd_hash_allocate.
3797
3798         * srec.c: Indent.
3799         (fillup_symbols): Check bfd_alloc.  FIXME void
3800         (srec_mkobject srec_get_section_contents
3801         srec_set_section_contents): Check bfd_alloc. 
3802         (srec_make_empty_symbol): Check bfd_zalloc.
3803
3804         * som.c (hppa_som_gen_reloc_type): Check bfd_alloc_by_size_t.
3805         (make_unique_section): Check bfd_alloc.
3806         (som_new_section_hook): Check bfd_zalloc.
3807         (bfd_som_attach_aux_hdr): Ditto.  FIXME void
3808
3809         * rs6000-core.c (rs6000coff_core_p): Check bfd_zalloc.
3810
3811         * osf-core.c (osf_core_make_empty_symbol): Check bfd_zalloc.
3812         (osf_core_core_file_p): Check bfd_alloc.
3813
3814         * oasys.c (oasys_slurp_symbol_table oasys_archive_p
3815         oasys_mkobject oasys_object_p oasys_new_section_hook
3816         oasys_set_section_contents): Check bfd_alloc.
3817         (oasys_slurp_section_data): Check bfd_zalloc and bfd_alloc.
3818         (oasys_make_empty_symbol): Check bfd_zalloc.
3819
3820         * nlmcode.h (nlm_make_empty_symbol): Check bfd_zalloc.
3821         (nlm_slurp_symbol_table): Check bfd_zalloc and bfd_alloc.
3822
3823         * nlm32-sparc.c (nlm_sparc_read_import): Check bfd_alloc.
3824
3825         * nlm32-i386.c (nlm_i386_read_import): Check bfd_alloc.
3826
3827         * nlm32-alpha.c (nlm_alpha_read_import): Check bfd_alloc.
3828
3829         * linker.c (_bfd_link_hash_newfunc
3830         (generic_link_hash_newfunc
3831         (archive_hash_newfunc
3832         (_bfd_generic_link_add_one_symbol): Check bfd_hash_allocate.
3833         (_bfd_generic_final_link
3834         (_bfd_generic_link_output_symbols
3835         (default_indirect_link_order): Check bfd_alloc.
3836         (bfd_new_link_order): Check bfd_alloc_by_size_t.
3837
3838         * irix-core.c (irix_core_make_empty_symbol): Check bfd_zalloc.
3839
3840         * ieee.c: Indent.
3841         (read_id get_symbol get_section_entry ieee_archive_p ieee_object_p
3842         ieee_slurp_section_data ieee_new_section_hook): Check bfd_alloc.
3843         (do_one): Check bfd_alloc.  Return a boolean.
3844         (ieee_slurp_section_data): Check it.
3845         (init_for_output): Check bfd_alloc.  Return a boolean.
3846         (ieee_set_section_contents): Check it.
3847         (do_with_relocs):  Check bfd_alloc.  Return a boolean.
3848         (ieee_bfd_debug_info_accumulate): Ditto.  FIXME void.
3849         (ieee_mkobject): Check bfd_zalloc.
3850         (ieee_make_empty_symbol): Check bfd_zmalloc.
3851
3852         * hpux-core.c (hpux_core_make_empty_symbol): Check
3853         bfd_zalloc.
3854
3855         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Check
3856         bfd_zalloc.
3857         (hppabsd_core_core_file_p): Check bfd_zalloc.
3858
3859         * hp300hpux.c (MY(slurp_symbol_table)): Check bfd_alloc.
3860
3861         * elfcode.h (elf_new_section_hook): Check bfd_alloc.
3862         (bfd_section_from_phdr): Ditto.
3863         (write_relocs): Ditto.  FIXME void
3864         (elf_map_symbols assign_section_numbers map_program_segments):
3865         Ditto.  Return a boolean. 
3866         (swap_out_syms): Ditto.  Check elf_map_symbols.
3867         (elf_slurp_symbol_table): Check bfd_zalloc.
3868         (elf_slurp_reloca_table): Check bfd_alloc.
3869         (elf_slurp_reloc_table): Ditto.
3870         (elf_compute_section_file_positions): Check assign_section_numbers.
3871         (assign_file_positions_except_relocs): Return a boolean.
3872         Check map_program_segments.
3873         (elf_compute_section_file_positions): Check it.
3874
3875         * elf32-mips.c (mips_elf_final_link): Check bfd_alloc.
3876
3877         * elf32-hppa.c (hppa_elf_stub_branch_reloc): Check bfd_zmalloc and
3878         realloc. 
3879         (hppa_elf_stub_reloc): Ditto.
3880         (hppa_elf_build_arg_reloc_stub): Check bfd_zalloc.
3881         (hppa_elf_build_long_branch_stub): Ditto.
3882         (elf32_hppa_backend_symbol_table_processing): Ditto.
3883
3884         * ecoff.c (ecoff_set_symbol_info): Check bfd_alloc.  Return a boolean.
3885         (ecoff_slurp_symbol_table): Check it.
3886         (ecoff_slurp_armap): Check bfd_alloc.
3887         (ecoff_write_armap): Check bfd_zalloc.
3888         (ecoff_link_hash_newfunc): Check bfd_hash_allocate and
3889         _bfd_link_hash_newfunc. 
3890         (ecoff_link_add_externals): Check bfd_alloc.
3891
3892         * ctor.c (bfd_constructor_entry): Check bfd_alloc.
3893
3894         * coffgen.c (coff_real_object_p): Check bfd_alloc.
3895         (coff_renumber_symbols): Check bfd_alloc_by_size_t.  Return a boolean.
3896         (coff_write_symbol): Check bfd_alloc.  FIXME int
3897         (coff_write_linenumbers): Check bfd_alloc.  Return a boolean.
3898         (coff_section_symbol): Check bfd_alloc_by_size_t.
3899         (coff_get_normalized_symtab): Check bfd_alloc.
3900         (coff_bfd_make_debug_symbol): Check bfd_zalloc.
3901         * libcoff-in.h: Change decls of coff_renumber_symbols,
3902         coff_write_linenumbers.
3903         * libcoff.h: Rebuilt.
3904         * coffcode.h (coff_write_object_contents): Check
3905         coff_renumber_symbols, coff_write_linenumbers.
3906
3907         * coffcode.h: Indent.
3908         (coff_add_missing_symbols): Check bfd_alloc_by_size_t.  Return a
3909         boolean. 
3910         (coff_write_object_contents): Check it.
3911
3912         * coff-alpha.c (alpha_relocate_section): Check bfd_alloc.
3913         * coff-mips.c (mips_relocate_section): Ditto.
3914
3915         * archive.c (bfd_slurp_bsd_armap_f2): Check bfd_alloc value.
3916         (do_slurp_bsd_armap): Ditto.
3917         (compute_and_write_armap): Check bfd_realloc value.
3918
3919         * aoutx.h (translate_from_native_sym_flags): Check bfd_alloc
3920         return value.  Return boolean value.
3921         (NAME(aout,make_empty_symbol)): Check bfd_zalloc return value.
3922         (NAME(aout,slurp_symbol_table)): Check bf_alloc and bfd_zalloc
3923         return value.
3924         (add_to_stringtab): Ditto.  FIXME void
3925         (aout_link_hash_newfunc): Check bfd_hash_allocate return value.
3926         (aout_link_add_symbols): Check bfd_alloc value.
3927         (translate_symbol_table): Check translate_from_native_sym_flags.
3928         * hp300hpux.c (MY(slurp_symbol_table)): Ditto.
3929         * aoutx.h (aout_link_hash_newfunc): Check _bfd_link_hash_newfunc.
3930
3931         * opncls.c (bfd_zalloc bfd_realloc): Check result of bfd_alloc.
3932
3933         * opncls.c (obstack_chunk_alloc): Define as malloc, not
3934         bfd_xmalloc_by_size_t. 
3935         (_bfd_new_bfd): Check obstack_begin for 0 return.
3936
3937         * ieee.c (obstack_chunk_alloc): Define as malloc, not
3938         bfd_xmalloc_by_size_t. 
3939         (ieee_archive_p): Check obstack_begin for 0 return and
3940         obstack_finish for NULL return.
3941
3942         * hash.c (obstack_chunk_alloc): Define as malloc, not
3943         bfd_xmalloc_by_size_t. 
3944         (bfd_hash_table_init_n): Check obstack_begin for 0 return and
3945         obstack_finish for NULL return.
3946         (bfd_hash_lookup): Check obstack_alloc for NULL return.
3947
3948         * ecofflink.c (obstack_chunk_alloc): Define as malloc, not
3949         bfd_xmalloc_by_size_t. 
3950         bfd_ecoff_debug_accumulate
3951         bfd_ecoff_debug_accumulate_other): Check obstack_alloc.
3952         (add_file_shuffle add_memory_shuffle): Check obstack_alloc for
3953         NULL return.  Return boolean, not void.
3954         (bfd_ecoff_debug_init): Check obstack_begin for 0 return.
3955         (bfd_ecoff_debug_accumulate): Check add_file_shuffle
3956         and add_memory_shuffle return. 
3957         (string_hash_newfunc): Check bfd_hash_allocate and bfd_hash_newfunc.
3958         (bfd_ecoff_debug_accumulate): Check bfd_alloc.
3959         (ecoff_add_string): Check add_memory_shuffle return.
3960
3961         * libbfd-in.h (xmalloc, bfd_xmalloc, bfd_xmalloc_by_size_t):
3962         Remove decls. 
3963         * libbfd.h: Rebuilt.
3964
3965 Fri Feb 11 15:35:32 1994  Stu Grossman  (grossman at cygnus.com)
3966
3967         * configure.host:  Add Lynx/rs6000 support.
3968         * config/i386-nlm.mt:  Enable a.out file support.
3969         * config/rs6000lynx.mh:  Lynx/rs6000 host support.
3970
3971 Fri Feb 11 17:25:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3972
3973         * archive.c (compute_and_write_armap): Rewrite somewhat to improve
3974         memory usage.
3975
3976 Fri Feb 11 13:10:42 1994  Stan Shebs  (shebs@andros.cygnus.com)
3977
3978         * archive.c: Change all references to '\n' in archive magic
3979         to '\012', for greater portability.
3980         * ecoff.c (ecoff_write_armap): Ditto.
3981
3982 Thu Feb 10 12:58:48 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3983
3984         * aoutx.h (aout_link_write_other_symbol): Check strip settings to
3985         see whether symbol should be output.
3986         * genlink.h (struct generic_write_global_symbol_info): Added info
3987         field.
3988         * linker.c (_bfd_generic_final_link): Initialize wginfo.info.
3989         (_bfd_generic_link_write_global_symbol): Check strip settings to
3990         see whether symbol should be output.
3991         * elf32-mips.c (mips_elf_final_link): Initialize wginfo.info.
3992
3993 Wed Feb  9 21:34:58 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3994
3995         * som.c (som_reloc_queue_find): Do not examine a NULL queue entry.
3996
3997         * som.c: Cast return values from BFD memory allocation routines to
3998         avoid warnings from the HP compiler.
3999
4000 Wed Feb  9 12:55:02 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4001
4002         * coff-alpha.c (alpha_relocate_section): Accept a LITERAL
4003         reloc on an "ldl" instruction too.
4004
4005         * archive.c (bfd_ar_hdr_from_filesystem): Cast status elements
4006         when passing them to sprintf.  Use %ld instead of %d.
4007
4008         * coff-rs6000.c (rs6000coff_mkarchive): Return false.
4009         (rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used.
4010         Also removed unused variable namelen.
4011         (rs6000coff_write_armap): Declare orl_count and stridx parameters.
4012
4013 Tue Feb  8 18:00:34 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4014
4015         * libbfd-in.h (xmalloc): Don't declare parameter type, to avoid
4016         conflicts.
4017         * libbfd.h: Rebuilt.
4018
4019 Tue Feb  8 15:55:50 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4020
4021         * coff-alpha.c (reloc_nil): New function.
4022         (alpha_howto_table): Use it as special_function to prevent certain
4023         relocs from being adjusted by bfd_perform_relocation.  IGNORE
4024         reloc should be partial_inplace.
4025         (alpha_ecoff_get_relocated_section_contents): Accept a LITERAL
4026         reloc on an "ldl" instruction too.
4027
4028 Tue Feb  8 00:32:28 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4029
4030         * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub,
4031         hppa_elf_build_long_branch_stub):  Cast to char * instead of int
4032         before performing pointer arithmetic.
4033
4034 Mon Feb  7 20:56:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4035
4036         * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this
4037         configuration.
4038         (hppa*-*-*elf*): This configuration used hppa-elf now.
4039
4040         * som.c: This file is also used for HOST_HPPAOSF.
4041
4042         * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF.
4043
4044         * hosts/hppaosf.h: New host configuration file.
4045
4046         * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as
4047         BSD handles both SOM and ELF object files.
4048
4049         * config/hppaosf.mh (HDEFINES): Delete.  No longer needed.
4050         (RANLIB): Doesn't do anything, define it to be "echo".
4051
4052         * config/hppaosf.mt: New target makefile fragment for a PA running
4053         OSF1.
4054
4055 Mon Feb  7 15:02:06 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4056
4057         * archures.c (enum bfd_architecture): Added bfd_arch_powerpc.
4058         (archures_init_table): If SELECT_ARCHITECTURES is not defined,
4059         added bfd_powerpc_arch.
4060         * bfd-in2.h: Rebuilt.
4061         * cpu-powerpc.c: New file.
4062         * Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c.
4063         Rebuilt dependencies.
4064
4065         * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power
4066         of an SHT_STRTAB section from sh_addr and sh_addralign, rather
4067         than just setting them to zero.
4068
4069 Sun Feb  6 20:04:10 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4070
4071         * elfcode.h (prep_headers, swap_out_syms): Check for NULL return
4072         from bfd_new_strtab. 
4073         (elf_compute_section_file_positions): Check for false return from
4074         swap_out_syms. 
4075
4076         * linker.c (default_indirect_link_order): Check for NULL return
4077         from bfd_get_relocated_section_contents.
4078
4079         * syms.c: Make example application in doc call xmalloc, not
4080         bfd_xmalloc. 
4081
4082         * aoutx.h (NAME(aout,slurp_symbol_table),
4083         aout_link_get_symbols, NAME(aout,link_hash_table_create)):
4084         * bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs):
4085         * ecoff.c (ecoff_bfd_link_hash_table_create): 
4086         * ecofflink.c (bfd_ecoff_debug_init): 
4087         * format.c (bfd_check_format_matches): 
4088         * linker.c (_bfd_generic_link_hash_table_create): 
4089         (_bfd_generic_final_link): 
4090         * reloc16.c (bfd_coff_reloc16_relax_section): 
4091         (bfd_coff_reloc16_get_relocated_section_contents): 
4092         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): 
4093         * elf32-mips.c (mips_elf_final_link): 
4094         * elfcode.h (bfd_new_strtab): 
4095         (bfd_add_2_to_strtab): 
4096         (elf_slurp_symbol_table): 
4097         (elf_corefile_note): 
4098         * libbfd.c (bfd_zmalloc): 
4099         Use malloc and check the result, instead of bfd_xmalloc.
4100
4101 Sat Feb  5 12:39:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4102
4103         * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*.
4104
4105 Sat Feb  5 05:32:44 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4106
4107         * srec.c (srec_write_record):  Put CONST keyword for "src" before
4108         "unsigned", some compilers don't like it after "unsigned".
4109         * libcoff.h, libcoff-in.h (bfd_perform_slip):  Rename "value" to
4110         "val" in prototype declaration because some compilers don't like
4111         arguments whose names are the same as types.
4112
4113 Sat Feb  5 01:14:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4114
4115         * aoutx.h (aout_link_check_ar_symbols): Correct test for whether
4116         object file defines symbol.  Also, if skipping a symbol, skip the
4117         second symbol of a N_WARNING or N_INDR symbol as well.
4118
4119 Fri Feb  4 23:55:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4120
4121         Add basic support for writing RS/6000 XCOFF files.
4122         * coff-rs6000.c (dummy_reloc): Removed.
4123         (rs6000coff_howto_table): Defined XCOFF relocs.
4124         (RTYPE2HOWTO): Defined to use rs6000coff_rtype2howto.
4125         (rs6000coff_rtype2howto): New function.
4126         (coff_bfd_reloc_type_lookup): Defined to use
4127         rs6000coff_reloc_type_lookup. 
4128         (rs6000coff_reloc_type_lookup): New function.
4129         (SELECT_RELOC): Defined to set r_type and r_size fields.
4130         (COFF_LONG_FILENAMES): Defined.
4131         * coffcode.h (combined_entry_type): Changed fix_tag and fix_end
4132         fields to bitfields.  Added fields fix_value and fix_scnlen.
4133         (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than
4134         STYP_INFO for the type of a section named .debug.
4135         (coff_add_missing_symbols): Don't define if RS6000COFF_C.
4136         (coff_write_object_contents): If RS6000COFF_C, don't call
4137         coff_add_missing_symbols.
4138         (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux
4139         entry has type STY_LD change the x_scnlen into a pointer to a
4140         symbol and set fix_scnlen.  Also, for a C_BSTAT symbol, change the
4141         value into a pointer to a symbol and set fix_value.
4142         * libcoff.h: Rebuilt.
4143         * coffgen.c (coff_mangle_symbols): Reindent.  If fix_value is set,
4144         get the symbol offset. Likewise for fix_scnlen.
4145         (string_size): Change type to bfd_size_type.
4146         (debug_string_size, debug_string_section): New static variables.
4147         (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true,
4148         write the symbol name into the .debug section; assume that the
4149         section has already been created with the right size.
4150         (coff_write_symbols): Initialize debug_string_size to 0.  If
4151         bfd_coff_symname_in_debug returns true, don't put symbol name in
4152         usual string table.  After writing out all symbols, if
4153         debug_string_size is not 0, check that it matches the size of the
4154         .debug section.
4155         (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen
4156         fields.  If the string offset is 0, always use an empty string as
4157         the name.
4158         (coff_make_empty_symbol): Zero out the symbol structure.
4159         * reloc.c (bfd_perform_relocation): Work around one gross hack
4160         with another: actually look at the target name to avoid the broken
4161         COFF check.
4162         (bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26,
4163         BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16.
4164         * bfd-in2.h: Rebuilt.
4165
4166 Fri Feb  4 17:28:32 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4167
4168         * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
4169         (bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
4170         * libbfd-in.h: Define them as macros calling xmalloc and declare
4171         xmalloc. 
4172         * libbfd.h: Rebuilt.
4173
4174 Thu Feb  3 16:49:35 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4175
4176         * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined
4177         symbol has a value in the ECOFF symbol but not in the BFD symbol,
4178         keep the value in the ECOFF symbol.  This helps gas.
4179
4180         * linker.c (_bfd_generic_link_output_symbols,
4181         _bfd_generic_link_write_global_symbol): Don't require that all
4182         references to a common symbol be themselves common symbols.
4183
4184         * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF.
4185
4186 Wed Feb  2 20:37:19 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4187
4188         * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h,
4189         sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT.
4190         * bfd-in2.h: Rebuilt.
4191
4192 Wed Feb  2 12:30:13 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4193
4194         * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type
4195         and size correctly.
4196         (coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to
4197         x_csect.x_scnlen.l to match change in coff/internal.h.
4198         (coff_swap_aux_out): Likewise.
4199
4200         * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c
4201         (alpha_ecoff_backend_data): Change casts of aux_in and aux_out
4202         fields to match yesterday's changes.
4203
4204         * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass
4205         in the internal_reloc itself, not the type.
4206         * coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c,
4207         coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed
4208         definition of SELECT_RELOC accordingly.
4209
4210 Tue Feb  1 12:05:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4211
4212         * coffcode.h (bfd_coff_backend_data): Added new arguments to
4213         _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number
4214         and number of aux entries.
4215         (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed
4216         accordingly.
4217         * libcoff.h: Rebuilt.
4218         * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new
4219         arguments.  If RS6000COFF_C, only treat C_EXT and C_HIDEXT
4220         specially if this is the last aux entry.
4221         * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass
4222         new arguments to swap_aux functions.
4223
4224 Sun Jan 30 15:14:36 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4225
4226         * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros
4227         (only testing for m68k and vax at the moment); do verify that the
4228         preprocessor didn't trash the arch name inside the string version.
4229         Don't print out "pagesize =" line that prevents output from
4230         compiling.  Derive BYTES_IN_WORD and ARCH values from sizeof
4231         results.
4232         * Makefile.in (aout-params.h): Pass gen-aout a dummy target name.
4233         (check, installcheck): Identify directory in "no testsuites"
4234         message.
4235
4236 Sun Jan 30 13:25:28 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4237
4238         * aoutx.h (aout_link_write_symbols): Write out correct value for
4239         object file symbol.
4240
4241 Fri Jan 28 18:34:05 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4242
4243         * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define
4244         KERNBASE, so hard-code 0x80000000 instead.
4245
4246 Thu Jan 27 13:54:08 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4247
4248         * linker.c (generic_link_add_symbol_list): If symbol is common,
4249         set the BSF_OLD_COMMON flag.
4250
4251 Wed Jan 26 13:47:15 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4252
4253         * format.c (bfd_check_format_matches): Put the new entry in the
4254         correct element of matching_vector.
4255
4256 Tue Jan 25 11:43:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4257
4258         * som.c, som.h (bfd_som_set_section_attributes,
4259         bfd_som_set_subsection_attributes): Change parameters from char
4260         to int.  Following a prototype with an old-style function definition
4261         in the presence of widened parameters is a GCC-ism not supported
4262         by the HP compiler in ANSI mode.
4263
4264 Tue Jan 25 11:46:46 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4265
4266         * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2.
4267
4268         * hp300hpux.c (MY(write_object_contents)): Write out the symbols
4269         before writing out the relocs, so that the right symbol indices
4270         are used.
4271
4272         * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not
4273         try to overlay the internal carsyms on the external symdefs.  That
4274         can not work if the size of a host pointer is larger than 4 bytes.
4275
4276         * format.c (bfd_check_format_matches): Cast result of
4277         bfd_xmalloc_by_size_t.
4278         * opncls.c (_bfd_new_bfd): Avoid ANSI C prototype.
4279
4280         * archive.c: Reindented to GNU standards.
4281
4282 Mon Jan 24 14:41:23 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4283
4284         * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add
4285         "_bfd_" to function names.
4286         * archive.c (_bfd_create_empty_archive_element_shell),
4287         libbfd-in.h: Change callers.
4288
4289         * libbfd.c (bfd_zmalloc): Renamed from zalloc.
4290         * libbfd.c (bfd_add_to_string_table),
4291         trad-core.c (trad_unix_core_file_p),
4292         targets.c (bfd_target_list),
4293         ptrace-core.c (ptrace_unix_core_file_p),
4294         opncls.c (new_bfd), libbfd-in.h,
4295         ieee.c (ieee_make_empty_symbol),
4296         elf32-hppa.c (hppa_elf_stub_branch_reloc),
4297         (hppa_elf_stub_reloc): Change callers.
4298         * libbfd.h: Regenerated.
4299
4300         * archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name.
4301         (_bfd_get_elt_at_filepos), 
4302         coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h:
4303         Change callers.
4304
4305         * format.c (bfd_check_format_matches), libbfd-in.h, targets.c,
4306         elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector
4307         and default_vector to bfd_default_vector.
4308         * libbfd.h: Regenerated.
4309
4310         * format.c (bfd_check_format_matches): New function.
4311         (bfd_check_format): Call it.
4312         (bfd_matching_formats): Function removed.
4313         * targets.c: Replace the vector added on Jan 21 with a count of
4314         entries in default_vector.
4315         * bfd-in2.h: Regenerated.
4316
4317 Mon Jan 24 12:38:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4318
4319         * coff-alpha.c (alpha_ecoff_object_p): New function.  Set size of
4320         .pdata section based on lnnoptr field, not section header.
4321         (alpha_relocate_section): Don't bother to check if r_symndx >= 0,
4322         since it is unsigned.
4323         (ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than
4324         coff_object_p.
4325         * ecoff.c (ecoff_new_section_hook): Set alignment_power field of
4326         .pdata section to 3.
4327         (ecoff_compute_section_file_positions): Save the size of the
4328         .pdata section in the line_filepos field, and actually align the
4329         .pdata section to an alignment power of 4.
4330         (ecoff_compute_reloc_file_positions): Set output_has_begun after
4331         calling ecoff_compute_section_file_positions.
4332         (ecoff_write_object_contents): Set s_lnnoptr for the .pdata
4333         section from the line_filepos field.  Set vstamp for the optional
4334         header from the vstamp of the symbolic header.
4335         (ecoff_bfd_final_link): Set vstamp of the symbolic header to the
4336         vstamp used by the first object file in the link.
4337
4338         * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align.
4339
4340         * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
4341         for a created common section.
4342         (_bfd_generic_link_add_one_symbol): Likewise.
4343
4344         * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to
4345         get the index of a common section, rather than always using
4346         SHN_COMMON (MIPS has multiple common sections).
4347
4348         * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =).
4349
4350         * bfd/aoutx.h (aout_link_input_section_std,
4351         aout_link_input_section_ext): Pass additional arguments to
4352         reloc_overflow callback.
4353         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents,
4354         alpha_relocat_section): Likewise.
4355         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
4356         * coff-h8500.c (extra_case): Likewise.
4357         * coff-mips.c (mips_relocate_section): Likewise.
4358         * coff-z8k.c (extra_case): Likewise.
4359         * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
4360         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
4361
4362         * bout.c (calljx_callback, callj_callback): Use get_value to get
4363         the symbol value and check for undefined symbols.
4364         (get_value): If the symbol is undefined, look it up in the linker
4365         hash table.
4366         (b_out_get_relocated_section_contents): For PCREL24 and PCREL13
4367         use get_value to get the symbol value and check for undefined
4368         symbols.
4369         * reloc16.c (bfd_coff_reloc16_get_value): If the symbol is
4370         undefined, look it up in the linker hash table.
4371
4372         * aoutx.h (translate_symbol_table): The string index 0 has a
4373         special meaning for normal symbols, but not for dynamic symbols.
4374
4375 Sat Jan 22 12:26:01 1994  Stu Grossman  (grossman at cygnus.com)
4376
4377         * sparclynx.c:  Setup appropriate macros to enable core file
4378         support.
4379
4380 Fri Jan 21 16:25:35 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4381
4382         * targets.c: Add a vector of matching format names.
4383         * format.c (bfd_matching_formats): New function to return it.
4384         (bfd_check_format): Set it.
4385         * bfd-in2.h: Regenerated.
4386
4387         * bfd-in.h: Remove decls of bfd_ec type and error printing functions.
4388         Remove decl of type symclass; wasn't used.
4389         * bfd.c: Document error handling, including code fragments
4390         containing the error decls that were in bfd-in.h.
4391         Remove DEFUNs.
4392         * bfd-in2.h: Regenerated.
4393
4394 Fri Jan 21 14:11:16 1994  Sean Fagan  (sef@cygnus.com)
4395
4396         * nlmcode.h, liblnm.h, nlm32-alpha.c nlm32-i386.c nlm32-sparc.c:
4397         The sparc (and possibly other?) NLM format requires a different
4398         way to write exports, so add a write_export field to the backend
4399         data (and set it to NULL for everything but the sparc).
4400
4401 Fri Jan 21 14:11:16 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4402
4403         * sunos.c (MY(read_dynamic_relocs)): Compare info->dynrel with NULL,
4404         not (struct external_nlist *) NULL.  info->dynrel is a PTR, not
4405         a struct external_nlist *.
4406
4407 Fri Jan 21 09:29:01 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4408
4409         * bfd.c: Remove error strings for errors removed below.
4410         * aoutx.h (translate_to_native_sym_flags), bfd-in.h (bfd_ec),
4411         oasys.c (oasys_write_sections): Rename
4412         bfd_error_nonrepresentable_section to nonrepresentable_section.
4413         None of the other bfd error names start with "bfd_error".
4414         Remove errors symbol_not_found and no_relocation_info, which seem
4415         to be unused.
4416         * bfd-in2.h: Regenerated.
4417
4418 Fri Jan 21 01:11:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4419
4420         * bfd.c (bfd_get_gp_size): Added support for ELF.
4421
4422         * syms.c (BSF_DYNAMIC): New symbol flag.
4423         (bfd_print_symbol_vandf): Print it.
4424         * bfd-in2.h: Rebuilt.
4425         * libaout.h (struct aout_backend_data): New read_dynamic_symbols
4426         and read_dynamic_relocs fields.
4427         (struct aoutdata): New dynamic_info field.
4428         (obj_aout_dynamic_info): New accessor macro.
4429         * sunos.c (struct sunos_dynamic_info): New structure.
4430         (sunos_read_dynamic_info, MY(read_dynamic_symbols),
4431         MY(read_dynamic_relocs)): New functions to read dynamic symbols
4432         and relocs.
4433         * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
4434         dynamically linked, set SEC_RELOC for both the .text and .data
4435         sections.
4436         (translate_from_native_sym_flags): Don't set BSF_LOCAL for an
4437         undefined symbol.
4438         (translate_symbol_table): New function, split out of
4439         slurp_symbol_table; set the BSF_DYNAMIC flag appropriately.
4440         (NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any.
4441         (NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any.
4442         (NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in
4443         return value.
4444         * aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write
4445         out dynamic symbols or relocs against reloc symbols, since they
4446         are already in the .text section and we wouldn't know where to
4447         write them anyhow.
4448         (sunos4_aout_backend): Initialize read_dynamic_symbols and
4449         read_dynamic_relocs fields.
4450         * aout-target.h (MY(backend_data)): Initialize
4451         read_dynamic_symbols and read_dynamic_relocs fields.
4452
4453 Thu Jan 20 20:57:27 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4454
4455         * hosts/alphaosf.h (uint64e_type, uint64_type, int64_type): Delete
4456         typedefs, since HOST_64_BIT will take care of defining them in
4457         bfd.h.
4458
4459 Wed Jan 19 17:28:59 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4460
4461         * config/alphaosf.mh (HDEFINES): Don't define HOST_64_BIT here;
4462         that's dealt with elsewhere.
4463         * hosts/alphaosf.h (sprintf_vma, fprintf_vma): New macros.
4464         (uint64_typeHIGH, uint64_typeLOW): Comment with HOST_64_BIT so
4465         they get copied to bfd.h.
4466
4467         * reloc.c (enum bfd_reloc_code_real): Add some Alpha relocation
4468         types.  Reorganized some of the existing ones.
4469         * coff-alpha.c (alpha_howto_table): Construct 64-bit negative one
4470         values in case of compilation on a 32-bit machine.  Fix pcrel
4471         fields of some reloc types.
4472         (alpha_bfd_reloc_type_lookup): Handle more relocation types.
4473
4474         * bfd-in.h (uint64_typeHIGH, uint64_typeLOW): Supply default
4475         definitions when not defined, regardless of whether uint64_type is
4476         a defined macro or not.
4477         (fprintf_vma, sprintf_vma): Define only if fprintf_vma is not
4478         already defined.
4479
4480 Wed Jan 19 00:02:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4481
4482         * aoutx.h (translate_to_native_sym_flags): Set the type of a
4483         BSF_WARNING symbol to N_WARNING.
4484
4485 Tue Jan 18 16:43:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4486
4487         * aoutx.h (aout_link_add_symbols): Increment sym_hash as well as p
4488         for an indirect or warning symbol.
4489         (aout_link_write_symbols): Update sym_hash with the target of an
4490         indirect or warning symbol.  If an indirect symbol is defined,
4491         output the calculated value and don't output the target symbol.
4492
4493 Tue Jan 18 03:54:59 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4494
4495         * aoutx.h (translate_from_native_sym_flags): Give warning symbols
4496         an (unused) nonzero section value, needed for check below.
4497
4498 Mon Jan 17 15:12:07 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4499
4500         * aoutx.h (translate_from_native_sym_flags,
4501         aout_link_add_symbols): Treat N_SET[ABDT] | N_EXT like
4502         N_SET[ABDT].
4503
4504 Fri Jan 14 16:45:43 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4505
4506         * elfcode.h (elf_object_p): If there is a SHT_DYNAMIC section, set
4507         the DYNAMIC flag for the BFD.
4508         (NAME(bfd_elf,write_object_contents)): Don't try to write out a
4509         BFD with the DYNAMIC flag set, since we don't generate the program
4510         header table correctly.
4511
4512 Fri Jan 14 01:04:36 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4513
4514         * elfcode.h (elf_slurp_symbol_table):  Free x_symp at the end
4515         of the function to avoid storage leak.
4516
4517 Thu Jan 13 23:07:32 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4518
4519         * ecoff.c (ecoff_link_write_external): An ifd can be -1.
4520
4521 Thu Jan 13 12:33:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4522
4523         * som.c (som_set_reloc_info): Provide a default symbol for
4524         relocations which don't actually have an associated symbol.
4525
4526         * som.c (hppa_som_reloc): Add new "error message" argument.
4527
4528 Wed Jan 12 13:36:43 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4529
4530         Enable gdb to write to core files on more core file readers.
4531         * libbfd.c (bfd_generic_set_section_contents):  Remove range check
4532         for section size, it is already done in bfd_set_section_contents
4533         with bfd_get_section_size_now.
4534         * aix386-core.c, hppabsd-core.c, hpux-core.c, irix-core.c,
4535         osf-core.c, ptrace-core.c, trad-core.c (*_set_section_contents):
4536         Use bfd_generic_set_section_contents instead of bfd_false.
4537
4538 Wed Jan 12 15:31:57 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4539
4540         * linker.c: Added initial documentation.
4541
4542         * linker.c (default_indirect_link_order): Don't expect space for
4543         output relocations if there aren't any input relocations.
4544
4545 Tue Jan 11 14:37:12 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4546
4547         * aoutx.h (NAME(aout,final_link)): Set a_entry before computing
4548         file offsets.
4549
4550         * elfcode.h (swap_out_syms): A common symbol is STT_OBJECT, not
4551         STT_NOTYPE.
4552
4553 Tue Jan 11 09:10:56 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4554
4555         * config.bfd: Use ELF, not COFF for m88*-*-dgux*.
4556         Combine m88k-*-* and m88110-*-* cases into m88*-*-*.
4557
4558 Tue Jan 11 00:07:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4559
4560         * ecofflink.c: Extensive changes to compress and merge debugging
4561         information, and to write some of out directly rather than saving
4562         it in memory.  Several new functions and structures, and new
4563         arguments to existing functions.
4564         * ecoff.c (ecoff_compute_reloc_file_positions): Compute
4565         sym_filepos as well.
4566         (ecoff_get_extr): Use ifdmap instead of ifdbase.
4567         (ecoff_write_object_contents): Don't compute sym_filepos here.
4568         Only output symbols if outsymbols is not NULL.
4569         (ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and
4570         bfd_ecoff_debug functions.  Write out debugging information here.
4571         (ecoff_final_link_debug_accumulate): Adjust for changes in
4572         bfd_ecoff_debug functions.
4573         (ecoff_link_write_external): Use ifdmap rather than ifdbase.
4574         * elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols
4575         first, to put them in the first memory buffer.  Clear fdr field.
4576         (mips_elf_get_extr): Use pointer to unswapped external symbol.
4577         (mips_elf_final_link): Adjust for changes in bfd_ecoff functions.
4578         Preserve .text, .data and .bss even if they are empty.  Save
4579         pointer to unswapped external symbol rather than copying it.
4580         Don't free up the external symbols.
4581         * libelf.h (elf_symbol_type): Change mips_extr to PTR.
4582         * bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare.
4583         (bfd_ecoff_debug_accumulate): Update declaration.
4584         (bfd_ecoff_debug_accumulate_other): Rename declaration from
4585         bfd_ecoff_debug_link_other and update.
4586         (bfd_ecoff_write_accumulated_debug): Declare.
4587         * bfd-in2.h: Rebuilt.
4588         * Makefile.in: Rebuilt dependencies.
4589
4590 Mon Jan 10 20:46:53 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4591
4592         * Makefile.in (install): Remove "@" which follows a backslash.  In
4593         this position it just causes errors, not suppresses echoes.
4594
4595 Mon Jan 10 09:06:21 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4596
4597         * som.c (hppa_som_gen_reloc_type): Fix handling of LT and RT
4598         field selectors.
4599
4600 Sun Jan  9 04:32:25 1994  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
4601
4602         * config/i386-netbsd.mt (SELECT_VECS): Include i386bsd_vec.
4603
4604 Fri Jan  7 10:27:27 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
4605
4606         * aoutx.h (adjust_z_magic): Don't merge the start of bss with the
4607         end of data if they are not contiguous.
4608
4609         * aoutf1.h (sunos4_aout_backend): Comment the fields' meanings.
4610
4611 Fri Jan  7 15:40:16 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4612
4613         * ecoff.c (ecoff_mkobject_hook): Don't set SEC_SHARED_LIBRARY flag
4614         for .reginfo section here.
4615         (ecoff_new_section_hook): Set it here instead.
4616
4617 Fri Jan  7 10:29:27 1994  Stan Shebs  (shebs@andros.cygnus.com)
4618
4619         * bfd-in.h: (bfd_boolean): Add workaround for systems that also
4620         define true and false as enums.
4621         (ALMOST_STDC): Add as alternative to __STDC__.
4622         * bfd-in2.h: Rebuilt.
4623         * syms.c (bfd_print_symbol_vandf): Convert a PTR to FILE*.
4624
4625 Thu Jan  6 14:24:44 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4626
4627         * aoutx.h (translate_to_native_sym_flags): Catch the case where
4628         there is no output section.
4629
4630 Thu Jan  6 14:37:42 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4631
4632         * nlmcode.h (nlm_object_p): If we can't read the fixed header,
4633         count it as a wrong format error, not a system call error, since
4634         the object file might simply be too small.
4635
4636         * targets.c (target_vector): Added nlm32_alpha_vec inside #ifdef
4637         BFD64.
4638         * Makefile.in (BFD32_BACKENDS): Remove nlm32-alpha.o.
4639         (BFD64_BACKENDS): Add nlm32-alpha.o.  It depends on 64 bit
4640         support, even though it is for an Alpha in 32 bit mode.
4641         * configure.in (nlm32_alpha_vec): Set target64 to true.
4642
4643         * nlm32-gen.c, nlm64-gen.c: Removed.  All nlm targets are
4644         different, so there is no point to providing a generic one.
4645         * libnlm.h: Don't bother to check for nlm_backend(bfd) being NULL
4646         in the backend accessor macros; that should no longer be possible.
4647         * targets.c (target_vector): Removed nlm32_big_generic_vec,
4648         nlm64_big_generic_vec, nlm64_little_generic_vec.
4649         * configure.in (nlm32_big_generic_vec, nlm32_little_generic_vec,
4650         nlm64_big_generic_vec, nlm64_little_generic_vec): Removed.
4651         * Makefile.in: Rebuilt dependencies, and
4652         (BFD32_BACKENDS): Removed nlm32-gen.o.
4653         (BFD64_BACKENDS): Removed nlm64-gen.o.
4654         (CFILES): Removed nlm32-gen.c and nlm64-gen.c.
4655
4656         * hp300hpux.c (ARCH_SIZE): Define before including aoutx.h.
4657
4658         * linker.c (_bfd_generic_link_add_one_symbol): Add constructor and
4659         bitsize arguments.  Changed all callers (aoutx.h).
4660         * libbfd-in.h (_bfd_generic_link_add_one_symbol): Add constructor
4661         and bitsize arguments to declaration.
4662         * libbfd.h: Rebuilt.
4663
4664         * ecoff.c: First cut at new style of linker backend for
4665         ECOFF--added a bunch of functions.  Also:
4666         (ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata.
4667         (ecoff_slurp_symbolic_header): New function.
4668         (ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header.
4669         (ecoff_compute_reloc_file_positions): New function.
4670         (ecoff_set_section_contents): Get out quickly if count is zero.
4671         Check errors better.
4672         (ecoff_write_object_contents): Put .xdata section in data segment.
4673         Call ecoff_compute_reloc_file_positions.  Don't output relocs or
4674         external symbols if outsymbols is NULL.
4675         (ecoff_bfd_final_link): Completely rewritten.
4676         * libecoff.h: Include bfdlink.h.
4677         (struct ecoff_backend_data): Add relocate_section field.
4678         (ecoff_data_type): Add sym_hashes and symndx_to_section fields.
4679         (struct ecoff_link_hash_entry): Define.
4680         (struct ecoff_link_hash_table): Define.
4681         (ecoff_bfd_link_add_symbols): Declare as function, not macro.
4682         (ecoff_bfd_link_hash_table_create): Likewise.
4683         * ecofflink.c (bfd_ecoff_debug_one_external): New function.
4684         (bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external.
4685         * bfd-in.h (bfd_ecoff_debug_one_external): Declare.
4686         * bfd-in2.h: Rebuilt.
4687         * coff-alpha.c (alpha_howto_table): Mark BRADDR as
4688         partial_inplace, and set the src_mask to 0x1fffff.
4689         (alpha_ecoff_get_relocated_section_contents): Remove unused
4690         variable gp_warned.
4691         (alpha_convert_external_reloc): New static function.
4692         (alpha_relocate_section): New static function.
4693         (alpha_ecoff_backend_data): Initialize relocate_section field.
4694         * coff-mips.c (mips_relocate_refhi): New static function.
4695         (mips_relocate_section): New static function.
4696         (mips_ecoff_backend_data): Initialize relocate_section field.
4697
4698         * reloc.c (_bfd_relocate_contents): Corrected signed overflow
4699         checking when there is an addend.
4700
4701         * aoutx.h (NAME(aout,final_link)): Don't abort when trying to link
4702         a non a.out file, just pass it to _bfd_default_link_order.
4703         (aout_link_input_section_std): When doing a final PC relative link
4704         against a section symbol, subtract the VMA of the input section.
4705         (aout_link_input_section_ext): Likewise.
4706
4707         * linker.c (default_indirect_link_order): Renamed from
4708         _bfd_generic_indirect_link_order and made static.
4709         (_bfd_generic_final_link): Don't switch on link_order type, just
4710         call _bfd_default_link_order.
4711         (_bfd_default_link_order): Handle bfd_indirect_link_order type.
4712         * genlink.h: Removed declaration of
4713         _bfd_generic_indirect_link_order.
4714         * elf32-mips.c (mips_elf_final_link): Don't switch on link_order
4715         type, just call _bfd_default_link_order.
4716
4717 Tue Jan  4 21:23:37 1994  Ian Lance Taylor  (ian@cygnus.com)
4718
4719         * linker.c (generic_link_check_archive_element): Base the name of
4720         the created common section on the name of the section the symbol
4721         came from.
4722         (_bfd_generic_link_add_one_symbol): (case BIG): A common symbol
4723         must have a section, so don't bother to create one.
4724
4725 Mon Jan  3 15:32:16 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4726
4727         * aout-target.h (MY(vec)): Add DYNAMIC to mask of object flags.
4728         * aoutf1.h (NAME(aout,sunos4_write_object_contents)):
4729         If the DYNAMIC flag is set, set it in the exec header.
4730         * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
4731         dynamically linked, set the DYNAMIC flag in the BFD.
4732         * libaout.h (N_SET_DYNAMIC): New macro.
4733         (N_DYNAMIC): Add missing 0 in mask.
4734
4735 Mon Jan  3 11:41:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4736
4737         * ecoff.c (ecoff_get_extr): Don't output section symbols as
4738         external symbols.
4739
4740         * bfd-in.h, hash.c: Change bfd_hash_allocate argument from size_t
4741         to unsigned int, because size_t may not be defined in bfd.h.
4742         * bfd-in2.h: Rebuilt.
4743
4744         * bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
4745         be a const pointer.
4746         * bfd-in2.h: Rebuilt.
4747         * libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
4748         be a const pointer.
4749         * targets.c (bfd_target): Change swap function pointers
4750         accordingly.
4751         * archive.c (do_slurp_coff_armap): Change swap accordingly.
4752         * aix386-core.c: Change NO_GET and NO_GETS accordingly.
4753         * hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
4754         ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
4755         accordingly.
4756
4757         * libbfd-in.h (struct artdata): Added tdata field.
4758         (_bfd_add_bfd_to_archive_cache): Declare.
4759         (_bfd_get_elt_at_filepos): Declare.
4760         (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
4761         * libbfd.h: Rebuilt.
4762         * archive.c: Cleaned up some more.
4763         (_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize
4764         pointer elements of artdata.
4765         (_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache.
4766         (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
4767         (_bfd_get_elt_at_filepos): Renamed from get_elt_at_filepos.
4768         (get_extended_arelt_filename, bfd_construct_extended_name_table,
4769         bfd_ar_hdr_from_filesystem, compute_and_write_armap): Made static.
4770         * ecoff.c: Some comment changes.
4771         (ecoff_slurp_armap): Handle rename of snarf_ar_hdr.  Set
4772         ardata->tdata to raw_armap.
4773         (ecoff_archive_p): Initialize pointer elements of artdata.
4774         * coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of
4775         add_bfd_to_cache.
4776
4777         * hash.c: Added some documentation.
4778
4779 Mon Jan  3 11:09:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4780
4781         * aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC,
4782         and do the swapping here rather than calling ntohl from the N_*
4783         macros.  This cleans up assumptions about the size of a host long,
4784         the existence to ntohl, etc.
4785
4786 Sat Jan  1 13:50:05 1994  Rob Savoye  (rob@darkstar.cygnus.com)
4787
4788         * config.bfd: Add support for VSTa micro-kernel. It currently uses
4789         i386-aout.
4790
4791 Sat Jan  1 10:18:54 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4792
4793         * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value.
4794         * i386mach3.c (SEGMENT_SIZE): Fix value.
4795
4796 Fri Dec 31 16:23:43 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4797
4798         Minor cleanups suggested by CodeCenter.
4799         * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c,
4800         linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as
4801         appropriate.
4802         * aoutx.h (struct external_exec): Removed unnecessary declaration.
4803         (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL.
4804         (adjust_z_magic): Removed useless variable data_vma.
4805         (stringtab_init): Initialize hash_zero.
4806         (add_to_stringtab): Removed unused fourth argument.
4807         (NAME(aout,swap_std_reloc_out)): Removed useless variable
4808         r_addend.
4809         (aout_link_input_section): Added some casts.
4810         * archive.c (get_extended_arelt_filename, do_slurp_coff_armap,
4811         bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap):
4812         Minor code rewriting to make it more C like.
4813         (do_slurp_bsd_armap): Added some casts.
4814         * ecoff.c (ecoff_write_object_contents): Removed useless variable
4815         scn_base.
4816         (ecoff_write_armap): Added some casts.  Use "" rather than "\0".
4817         * ecofflink.c (bfd_ecoff_write_debug): Added a cast.
4818         * libaout.h (struct internal_exec): Removed unnecessary
4819         declaration.
4820         * linker.c (_bfd_generic_indirect_link_order): Added a cast.
4821         * opncls.c (new_bfd): Removed a cast.
4822         * reloc.c (bfd_generic_get_relocated_section_contents): Added
4823         some casts.
4824         * srec.c (internal_srec_write_object_contents): Removed useless
4825         variable bytes_written.
4826
4827 Fri Dec 31 11:46:13 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
4828
4829         * i386mach3.c (N_TXTADDR): Don't define after all.
4830         (TEXT_START_ADDR): Don't include exec header size in value.
4831
4832 Thu Dec 30 15:47:54 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
4833
4834         * i386mach3.c (N_TXTADDR): Define.
4835
4836 Thu Dec 30 13:37:24 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4837
4838         Extensive changes to move the bulk of the linker into BFD so that
4839         more efficient backend code can be written for specific object
4840         files.  Only existing efficient backend is a.out.
4841         * seclet.c, seclet.h: Removed.
4842         * hash.c, linker.c, genlink.h: New files.
4843         * bfd-in.h: Removed bfd_error_vector.  Declared hash table
4844         structures and functions.
4845         (JUMP_TABLE): Removed bfd_seclet_link, added
4846         bfd_link_hash_table_create, bfd_link_add_symbols and
4847         bfd_final_link.
4848         * All backends: Changed accordingly.
4849         * bfd-in2.h: Rebuilt.
4850         * bfd.c (struct _bfd): Added link_next and archive_pass fields.
4851         Removed ld_symbols field.
4852         (bfd_nonrepresentable_section, bfd_undefined_symbol,
4853         bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
4854         bfd_error_vector): Removed.
4855         (bfd_default_error_trap, bfd_error_trap,
4856         bfd_error_nonrepresentabltrap): Removed.
4857         (bfd_get_relocated_section_contents): Pass link_info.  Pass
4858         link_order instead of seclet.  Pass symbols.
4859         (bfd_relax_section): Pass link_info.
4860         (bfd_seclet_link): Removed.
4861         (bfd_link_hash_table_create, bfd_link_add_symbols,
4862         bfd_final_link): New macros.
4863         * libbfd-in.h: If __GNUC__ is defined and alloca is not, define
4864         alloca as __builtin_alloca.  Declare internal linking functions.
4865         * libbfd.h: Rebuilt.
4866         * libbfd.c (bfd_seek): Comment out fseek assertion.  It's worked
4867         for months.
4868         * reloc.c (reloc_howto_type): Added error_message argument to
4869         special_function field.  Changed all callers and all definitions.
4870         (bfd_get_reloc_size): Make argument a const pointer.
4871         (bfd_perform_relocation): Add error_message argument to hold
4872         string set if return value if bfd_reloc_dangerous.  Changed all
4873         callers.
4874         (_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
4875         * section.c (asection): Renamed seclets_head and seclets_tail to
4876         link_order_head and link_order_tail.
4877         * targets.c (bfd_target): Replaced seclet argument with link_info
4878         and link_order and symbols arguments in
4879         bfd_get_relocated_section_contents.  Added symbols argument to
4880         bfd_relax_section.  Removed bfd_seclet_link.  Added
4881         bfd_link_hash_table_create, bfd_link_add_symbols and
4882         bfd_final_link.
4883         * libaout.h (struct aoutdata): Added external_syms,
4884         external_sym_count, external_strings, sym_hashes fields.
4885         (obj_aout_external_syms, obj_aout_external_sym_count,
4886         obj_aout_external_strings, obj_aout_sym_hashes): New accessor
4887         macros.
4888         (WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
4889         * aoutx.h: Wrote new back end linker routines.
4890         (translate_to_native_sym_flags): Return boolean value.  Don't use
4891         bfd_error_vector.
4892         (NAME(aout,write_syms)): Return boolean value.  Check return value
4893         of translate_to_native_sym_flags and bfd_write.
4894         * aout-target.h (final_link_callback): New function.
4895         (MY_bfd_final_link): New function.
4896         * aout-adobe.c (aout_adobe_write_object_contents): Check return
4897         value of aout_32_write_syms.
4898         * hp300hpux.c (MY(write_object_contents)): Likewise.
4899         * i386lynx.c (WRITE_HEADERS): Likewise.
4900         * libaout.h (WRITE_HEADERS): Likewise.
4901         * bout.c: Changed functions to use link_info->callbacks rather
4902         than bfd_error_vector, and link_orders rather than seclets.
4903         * coff-alpha.c: Likewise.
4904         * coff-h8300.c: Likewise.
4905         * coff-h8500.c: Likewise.
4906         * coff-sh.c: Likewise.
4907         * coff-z8k.c: Likewise.
4908         * elf32-hppa.c: Likewise.
4909         * reloc16.c: Likewise.
4910         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
4911         up _gp in the hash table rather than in outsymbols.
4912         * coff-a29k.c (a29k_reloc): Pass errors back in new error_message
4913         argument rather than printing them.
4914         * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
4915         link_order arguments rather than seclet.  Changed all uses and
4916         definitions.
4917         (bfd_coff_reloc16_estimate): Pass link_info arguments.  Changed
4918         all uses and definitions.
4919         * libcoff.h: Rebuilt.
4920         * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
4921         not by ECOFF, make it scAbs.
4922         (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
4923         rewritten.
4924         * elf32-mips.c (mips_elf_final_link): Renamed from
4925         mips_elf_seclet_link and rewritten.
4926         * elf32-hppa.c (elf32_hppa_stub_description): Added link_info
4927         field.
4928         (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
4929         hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
4930         Added link_info arguments.  Changed all callers.
4931         * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
4932         not NULL.
4933         * oasys.c (oasys_write_sections): Return boolean value rather than
4934         using bfd_error_vector.
4935         (oasys_write_object_contents): Check return value of
4936         oasys_write_sections.
4937         * hosts/std-host.h: Don't declare qsort or strtol.
4938         * Makefile.in: Rebuild dependencies.
4939         (BFD_LIBS): Removed seclet.o.  Added hash.o and linker.o.
4940         (CFILES): Removed seclet.c.  Added hash.c and linker.c.
4941         (HFILES): Removed seclet.h.  Added genlink.h.
4942
4943 Thu Dec 30 07:41:36 1993  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4944
4945         * section.c (bfd_get_section_contents):  Return zero filled buffer
4946         if section has no contents.
4947
4948 Tue Dec 28 12:43:54 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4949
4950         * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc,
4951         then skip bfd_perform_relocation even if the addend is non-zero.
4952
4953 Tue Dec 21 09:22:19 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)
4954
4955         * coffcode.h (coff_write_relocs) [SWAP_OUT_RELOC_OFFSET]: Copy
4956         addend to r_offset field.
4957
4958         * Makefile.in (CFILES): Added coff-sparc.c.  Rebuild dependencies.
4959
4960         * coff-sparc.c (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET,
4961         CALC_ADDEND): Define.
4962
4963         * aix386-core.c (aix386_core_file_p): Use cd_regs[0] for computing
4964         the offsetof because AIX /bin/cc does not like to take the address
4965         of an array.  (From Minh Tran-Le.)
4966
4967 Thu Dec 16 13:06:32 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4968
4969         * Thu Dec 16 15:41:06 1993  Peter Hoogenboom  (hoogen@cs.utah.edu)
4970
4971         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Make sure to copy
4972         the return pointer into %r2 if no jump-in-call-delay-slot
4973         optimization was done.
4974
4975         * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD.
4976
4977 Wed Dec 15 08:04:16 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
4978
4979         * hosts/std-host.h: (time): Don't declare; conflicts on Mach3.
4980
4981         * hosts/i386mach3.h (HOST_PAGE_SIZE): Set to 1 to avoid padding.
4982         (HOST_SEGMENT_SIZE): Set to 0 for same reason.
4983
4984         * i386mach3.c (PAGE_SIZE, SEGMENT_SIZE): Same changes as above.
4985         (TEXT_START_ADDR): Correct.
4986         (MY_backend_data): Define.
4987
4988         * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic):
4989         New functions; code moved from aout_<size>_adjust_sizes_and_vmas.
4990
4991 Tue Dec 14 21:48:33 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4992
4993         * som.c (som_begin_writing): Fix thinkos in auxiliary header
4994         support.
4995         (bfd_som_attach_aux_hdr): Likewise.
4996
4997 Mon Dec 13 23:34:48 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4998
4999         * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field
5000         selectors for PIC code.
5001
5002         * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors.
5003         (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL
5004         relocations needed by PIC.
5005
5006 Tue Dec  7 15:47:51 1993  Stu Grossman  (grossman at cygnus.com)
5007
5008         * nlmcode.h:  Fixes to avoid compiler warnings...
5009
5010 Tue Dec  7 15:10:54 1993  Ian Lance Taylor  (ian@cygnus.com)
5011
5012         * libnlm.h (nlm_backend_data): Removed macro definition.
5013         (nlm_alpha_backend_data): Adjusted accordingly.
5014
5015 Sun Dec  5 19:32:08 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5016
5017         * som.c (som_begin_writing): Flesh out code for handling simple
5018         auxiliary headers.
5019         (bfd_som_attach_aux_hdr): New function.
5020
5021         * som.h (struct somdata): Add fields for attaching version and
5022         copyright headers.  Add accessor macros.
5023
5024         * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected
5025         definitions for old versions of HPUX which fail to define them.
5026         (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT
5027         now that they're safe.  Delete bogus R_STATEMENT relocations.
5028
5029         * som.c (som_hppa_howto_table): Add missing R_END_TRY.  Delete 
5030         extra R_DATA_OVERRIDE.
5031         (hppa_som_gen_reloc_type): Generate a relocation for the rounding
5032         mode selector if needed.
5033         (som_write_fixups): Handle requests for a change in the default
5034         rounding mode.  Rounding modes do not consume input bytes, but
5035         are just markers much like R_ENTRY and R_EXIT.
5036
5037 Sat Dec  4 19:40:32 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5038
5039         Fri Dec  3 09:55:17 1993  Pete Hoogenboom  (hoogen@cs.utah.edu)
5040
5041         * elf32-hppa.c: (hppa_elf_reloc):  Do not do code reordering when
5042         the branch instruction as originally been nullified.
5043         hppa_elf_reloc):  Avoid useless call to bfd_put_32 () in the
5044         case of no code reordering due to an LDO instruction in the
5045         delay slot of the branch.  Make sure to relocate the correct
5046         instruction.  Do not perform instruction reordering for millicode
5047         calls.
5048         (hppa_elf_build_arg_reloc_stub):  Change the relocation type
5049         to R_HPPA_STUB_CALL_17 when special processing might be needed.
5050         (hppa_elf_build_long_branch_stub): Prevent code reordering on
5051         a call from a linker stub to another linker stub and for millicode
5052         calls.  Do not trash the return register for calls from one linker
5053         stub to a second linker stub.
5054
5055         * elf32-hppa.c: (elf_hppa_howto_table):  PLABEL and DLT
5056         relocations are not pc-relative.
5057
5058         * hppa_stubs.h: (BLE_N_XXX_0_31):  New instruction used in
5059         linker stub code. 
5060         (COPY_2_31):  Likewise.
5061
5062 Fri Dec  3 18:40:58 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5063
5064         * config/solaris2.mh (HDEFINES): Remove -Dconst=
5065         * hosts/solaris.h: If not __GNUC__, define const as empty.
5066
5067 Thu Dec  2 15:43:32 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5068
5069         * ecoff.c: Added various casts for 32/64 bit cross targeting.
5070         (ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo
5071         section so that the linker ignores it.
5072         * ecofflink.c: Added various casts for 32/64 bit cross targeting.
5073         (ecoff_add_bytes): Changed need argument to size_t.
5074         (bfd_ecoff_debug_link_other): Check return value of
5075         ecoff_add_string.
5076
5077         * libbfd-in.h (new_bfd): Use void rather than an empty parameter
5078         list.
5079         * libbfd.h: Rebuilt.
5080
5081         * libnlm.h (struct nlm_obj_tdata): New field backend_data.
5082         (nlm_backend_data, nlm_alpha_backend_data): New accessor macros.
5083         (struct nlm_backend_data): New field no_uninitialized_data.
5084         (nlm_no_uninitialized_data): New accessor macro.
5085         * nlmcode.h (nlm_compute_section_file_positions): Handle
5086         no_uninitialized_data.
5087         (nlm_external_reloc_compare): Sort relocs by address for a
5088         particular symbol, to make the sort more stable.
5089         (nlm_write_object_contents): Cast the arguments to qsort.  Get the
5090         value of a debugging symbol the same way we get the value of a
5091         normal symbol.
5092         * nlm32-alpha.c: Various changes.  Write out GP and .lita relocs.
5093         Set no_uninitialized_data to true.
5094         * nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c
5095         (nlm32_sparc_backend): Set no_uninitialized_data field false.
5096         * nlmswap.h (nlm_swap_fixed_header_out): Zero out destination
5097         before filling it in.
5098
5099 Wed Dec  1 21:47:58 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5100
5101         * som.c (som_section_type, som_decode_symcalss): New functions.
5102         (som_get_symbol_info): Use them.
5103         (som_slurp_symbol_table): Set the section of common and undefined
5104         symbols correctly.
5105
5106 Wed Dec  1 14:15:10 1993  Ken Raeburn  (raeburn@cygnus.com)
5107
5108         * elfcode.h (write_relocs): Initialize local var LAST_SYM_IDX, to
5109         make gcc happy.
5110
5111         * mipsbsd.c: Changes from Ralph Campbell:
5112         (mips_howto_table_ext): MIPS_RELOC_LO16 should use
5113         complain_overflow_dont.
5114         (aout_mips_*_vec): Make name use "a.out" instead of "aout", to
5115         make gdb happy.
5116
5117         * bfd.c (bfd_errmsgs): Reword invalid-target message.
5118
5119         * config.bfd: For sparc*-*-coff, use sparc-coff.
5120         * configure.in: Handle sparccoff_vec.
5121         * targets.c (sparccoff_vec): Declare.
5122
5123         * reloc.c (bfd_get_reloc_size): New function.
5124         (struct reloc_howto_type): Update documentation of size field.
5125
5126 Wed Dec  1 14:39:05 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5127
5128         * nlm32-alpha.c: New file; preliminary Alpha NetWare support.
5129         * config.bfd (alpha-*-netware*): New target; use alpha-nlm.
5130         * config/alpha-nlm.mt: New file.
5131         * configure.in (nlm32_alpha_vec): New vector; use nlm32-alpha.o,
5132         nlm32.o, and nlm.o.
5133         * Makefile.in (BFD32_BACKENDS): Added nlm32-alpha.o.
5134         (CFILES): Added nlm32-alpha.c.
5135         Rebuilt dependencies.
5136         * targets.c (nlm32_alpha_vec): Declare.
5137
5138         * libnlm.h (struct nlm_backend_data): New fields
5139         optional_prefix_size, nlm_backend_object_p, nlm_write_prefix,
5140         nlm_set_public_section, nlm_get_public_offset.  Removed unused
5141         nlm_write_reloc field.  Changed nlm_write_import to remove
5142         unnecessary symbol argument.  Renamed nlm_write_externals to
5143         nlm_write_external, and changed cound argument from bfd_vma to
5144         bfd_size_type.
5145         (nlm_optional_prefix_size, nlm_backend_object_p_func,
5146         nlm_write_prefix_func, nlm_set_public_section_func,
5147         nlm_get_public_offset_func): New accessor macros.
5148         (nlm_write_reloc_func): Removed.
5149         (nlm_write_external_func): Adjusted for field renaming.
5150         * nlm32-i386.c (nlm_i386_write_import): Renamed from
5151         nlm_i386_write_reloc.  Removed old nlm_i386_write_import which
5152         just called old nlm_i386_write_reloc.
5153         (nlm_i386_write_external): Renamed from nlm_i386_write_externals.
5154         Declared.  Changed second argument from bfd_vma to bfd_size_type.
5155         (nlm32_i386_backend): Adjusted for changes to fields and names.
5156         * nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused,
5157         ifdeffed out code.
5158         (nlm_sparc_write_import): Removed second argument.
5159         (nlm_sparc_write_external): Renamed from
5160         nlm_sparc_write_externals.  Changed second argument from bfd_vma
5161         to bfd_size_type.
5162         (nlm32_sparc_backend): Adjusted for changes to fields and names.
5163         * nlmcode.h: Removed some unused code.
5164         (nlm_object_p): Don't destroy tdata pointer.  Call
5165         backend_object_p function if it exists.
5166         (nlm_slurp_symbol_table): Removed unused variable rcount.  Call
5167         set_public_section_func if it exists instead of checking
5168         NLM_HIBIT.
5169         (nlm_compute_section_file_positions): Account for
5170         optional_prefix_size.
5171         (nlm_write_object_contents): Account for optional_prefix_size.
5172         Removed useless variable write_reloc_func.  Changed declaration
5173         and call of write_import_func.  Call write_prefix_func if it
5174         exists.  Removed unused variables len and temp.  Call
5175         get_public_offset_func if it exists rather than setting NLM_HIBIT.
5176         * nlmswap.h: Declare functions.
5177
5178         * bfd-in.h (uint64_typeLOW, uint64_typeHIGH): Fully parenthesize
5179         for clarity.
5180         (fprintf_vma, sprintf_vma): Use %lx, not %x.
5181         * bfd-in2.h: Rebuilt.
5182         * hosts/alphaosf.h (uint64_typeLOW, uint64_typeHIGH): Cast results
5183         to unsigned long.
5184
5185         * config.bfd: Don't set target64 here, as the setting is ignored.
5186         * configure.in (ecoffalpha_little_vec): Set target64.
5187
5188         * config/alphaosf.mt (TDEFINES): Removed; setting host parameters
5189         in TDEFINES is wrong.
5190
5191         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
5192         Remove unused variable output_section.
5193
5194 Tue Nov 30 16:45:23 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5195
5196         * irix-core.c: New file for Irix 4 and Irix 5 core support.
5197         Functions taken out of coff-mips.c.  Handle vmap type VMAPFILE.
5198         * coff-mips.c: Irix 4 core file support moved to irix-core.c.
5199         * targets.c: If IRIX_CORE defined, include irix_core_vec in
5200         target_vector.
5201         * config/irix4.mh (HDEFINES): Add -DIRIX_CORE.
5202         (HDEPFILES): Define to be irix-core.o.
5203         * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE.
5204         (HDEPFILES): Define to be irix-core.o.
5205         * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o.  Removed
5206         sco-core.o, which no longer exists.
5207         (CFILES): Added all *-core.c files.
5208         Rebuilt dependencies.
5209
5210 Wed Nov 24 02:02:41 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5211
5212         * elfcode.h (map_program_segments): Restore check of file_size !=
5213         mem_size, but only if SHT_PROGBITS.
5214
5215         * ecofflink.c: New file to hold ECOFF debug information linking
5216         routines.
5217         * ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
5218         ecoff_add_string, ecoff_get_debug): Removed.  Functionality now in
5219         ecofflink.c.
5220         (ecoff_get_extr, ecoff_set_index): New functions.
5221         (ecoff_slurp_symbolic_info): Don't save raw_size.
5222         (ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
5223         (ecoff_compute_section_file_positions): Don't set EXEC_P just
5224         because there is a start address.
5225         (ecoff_write_object_contents): Handle external symbols here.  Use
5226         ecofflink.c functions to write out debugging information.
5227         * elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
5228         mips_elf_set_index): New functions.
5229         (mips_elf_seclet_link): Discard empty sections, the .options
5230         section and .gptab sections.  Handle linking .mdebug section.
5231         * libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
5232         * libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
5233         * bfd-in.h: Added prototypes for routines in ecofflink.c (some are
5234         called by gas, so they are public).
5235         * bfd-in2.h: Rebuilt.
5236         * Makefile.in (BFD_LIBS): Added ecofflink.o.
5237         (CFILES): Added ecofflink.c.
5238         (ecofflink.o): New target.  Rebuilt dependencies.
5239
5240 Mon Nov 22 22:26:42 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5241
5242         * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as
5243         a valid magic number if it's been defined.
5244
5245 Mon Nov 22 14:17:36 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5246
5247         * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker
5248         no longer requires it.
5249         (ecoff_bfd_seclet_link, ecoff_sizeof_headers,
5250         ecoff_write_object_contents): Don't treat .scommon section
5251         specially.
5252
5253 Mon Nov 22 10:54:27 1993  Fred Fish  (fnf@cygnus.com)
5254
5255         Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner):
5256         * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
5257         * bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
5258         * bfd/ptrace-core.c:  New file for dealing with core files with
5259         start with the ptrace_user structure found on BCS compliant systems.
5260         * bfd/targets.c (ptrace_core_vec):  New vector.
5261
5262 Mon Nov 22 02:33:12 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5263
5264         * Minimal support for reading SOM fixup streams.  Allows
5265         objdump -r to do something reasonable.
5266         * som.c (som_get_reloc_upper_bound): Implement.
5267         (som_canonicalize_reloc): Implement.
5268         (som_set_reloc_info, som_slurp_reloc_table): New functions.
5269
5270 Sun Nov 21 13:46:55 1993  Ken Raeburn  (raeburn@cambridge.cygnus.com)
5271
5272         * hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define.
5273         * hosts/sparclynx.h: Include lynx.h instead of duplicating it.
5274
5275 Fri Nov 19 14:34:04 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5276
5277         * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift
5278         signed_value before sign extending it.  Don't subtract out
5279         reloc_entry->address.  This makes it compatible with what gas is
5280         generating.
5281
5282         * elfcode.h (elf_fake_sections): Accept .sbss as the name for a
5283         SHT_NOBITS sections.
5284         (map_program_segments): Don't leave the loop after the first
5285         SHT_NOBITS section.
5286         (assign_file_positions_except_relocs): Only force sh_offset and
5287         sh_addr to match modulo maxpagesize for a section which is not
5288         SHT_NOBITS.  Changed the method used to force page alignment after
5289         a SHT_NOBITS section to only do it for the last such consecutive
5290         section, and to really force page alignment.
5291
5292 Fri Nov 19 04:02:01 1993  Ken Raeburn  (raeburn@cambridge.cygnus.com)
5293
5294         * coffcode.h (coff_slurp_symbol_table): Print more verbose message
5295         in the case of an unknown (or unhandled) storage class.
5296
5297         * config/i386-lynx.mt (TDEFINES): FPRINTF_ALREADY_DECLARED should
5298         not be defined here, since it is a host attribute, not a target
5299         one.
5300         * config/m68k-lynx.mt, config/sparc-lynx.mt: Ditto.
5301
5302         * coffcode.h (coff_bfd_reloc_type_lookup): Don't define if already
5303         defined.
5304
5305         * coff-sparc.c: Define some relocations, based on ELF relocations.
5306         (enum reloc_type, bfd_coff_generic_reloc, coff_sparc_howto_table,
5307         struct coff_reloc_map, sparc_reloc_map,
5308         coff_sparc_reloc_type_lookup): Borrowed from elf32-sparc.c and
5309         elf.c, renamed.
5310         (coff_bfd_reloc_type_lookup): Define to be coff_sparc_reloc_....
5311         (rtype2howto): Index into coff_sparc_howto_table using
5312         dst->r_type.
5313
5314 Thu Nov 18 11:45:39 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5315
5316         * config.bfd (mips*-*-irix5*): New target; use mipsbelf.
5317         * configure.host (mips-sgi-irix5*) New host; use irix5 (no
5318         hosts/irix5.h created; just use std-host.h).
5319         * config/irix5.mh: New file; like irix4.mh, but don't use -G or
5320         -lmalloc.
5321         * Makefile.in: Rebuilt dependencies.
5322
5323         * ecoffswap.h: Changed type of internal pointers for swap out
5324         functions to const *.
5325
5326         * elf32-mips.c (mips_elf_got16_reloc): New function.  Handle GOT16
5327         correctly for assembler, but linker support not implemented.
5328         (elf_mips_howto_table): Use mips_elf_got16_reloc for GOT16.
5329         (mips_elf_sym_is_global): New function; at least on Irix 5, all
5330         non section symbols are considered global.
5331         (elf_backend_sym_is_global): Define.
5332         (mips_elf_final_write_processing): New function.  Set the MIPS
5333         architecture level correctly.
5334         (elf_backend_final_write_processing): Define.
5335         (mips_elf_section_from_shdr): Handle SHT_MIPS_OPTIONS.
5336         (mips_elf_fake_sections): Set entsize of .mdebug or .reginfo
5337         section to 1.  Handle .options section.
5338         (mips_elf_acom_section, mips_elf_acom_symbol,
5339         mips_elf_acom_symbol_ptr): New static variables, used to build a
5340         generic .acommon section to hold SHN_MIPS_ACOMMON symbols.
5341         (mips_elf_symbol_processing): Handle SHN_MIPS_ACOMMON symbols by
5342         putting them all in a global .acommon section.
5343
5344         * elfcode.h (bfd_section_from_shdr): Don't dump core if target
5345         section has no ELF section data.
5346         (elf_make_sections): Set addralign of reloc section to 4.
5347         (elf_fake_sections): Likewise.
5348         (map_program_segments): Don't consider section 0.
5349         (assign_file_positions_except_relocs): Don't consider section 0.
5350         In the main loop, skip the symtab and strtab sections, since their
5351         positions are set elsewhere.
5352         (swap_out_syms): Set addralign of symtab section to 4.  Set
5353         addralign of strtab sections to 1.
5354         (assign_file_positions_for_relocs): Don't consider section 0.
5355         (write_object_contents): Don't write out section 0.
5356
5357         * libelf.h (struct elf_backend_data): Added fields
5358         elf_backend_sym_is_global and elf_backend_final_write_processing.
5359         * elf32-target.h (elf32_bed): Added corresponding initializers.
5360         * elf64-target.h (elf64_bed): Likewise.
5361         * elfcode.h (sym_is_global): Take abfd argument.  Call
5362         elf_backend_sym_is_global if it is not NULL.
5363         (elf_map_symbols): Pass abfd to sym_is_global.
5364         (write_object_contents): Call elf_backend_final_write_processing
5365         if it is defined.
5366
5367 Wed Nov 17 18:43:28 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5368
5369         * libecoff.h: Include coff/ecoff.h.
5370         (struct ecoff_backend_data): Move external debugging information
5371         fields into a single field pointing to an ecoff_debug_swap
5372         structure.
5373         (ecoff_data_type): Move debugging information fields into a single
5374         field pointing to an ecoff_debug_info structure.
5375         * coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes.
5376
5377 Wed Nov 17 17:38:58 1993  Sean Eric Fagan  (sef@cygnus.com)
5378
5379         * nlmswap.h: New file to swap fixed header.  Included by NLM
5380         backends.
5381         * libnlm.h (struct reloc_and_sec): Define.
5382         (struct nlm_backend_data): Add fields fixed_header_size,
5383         nlm_read_import, nlm_write_import, nlm_swap_fhdr_in,
5384         nlm_swap_fhdr_out.
5385         (nlm_fixed_header_size, nlm_read_import_func,
5386         nlm_write_import_func, nlm_swap_fixed_header_in_func,
5387         nlm_swap_fixed_header_out_func, nlm_write_external_func): New
5388         accessor macros.
5389         * nlmcode.h: Use new functions.
5390         * nlm32-i386.c: Provide new functions.
5391         * nlm32-sparc.c: New file; SPARC NLM backend.
5392
5393 Wed Nov 17 13:56:10 1993  Stan Shebs  (shebs@rtl.cygnus.com)
5394
5395         * i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore
5396         garbage bits appearing in the upper end of symbolnums.
5397
5398         * config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED.
5399
5400 Tue Nov 16 17:03:41 1993  Stu Grossman  (grossman at cygnus.com)
5401
5402         * lynx-core.c (lynx_core_file_p):  Change bfd_zalloc to bfd_alloc.
5403         * m68klynx.c:  Define core file macros.
5404         * hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h:  Move all
5405         non-architecture specific stuff into lynx.h.
5406
5407 Tue Nov 16 15:45:54 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5408
5409         * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and
5410         change PAGE_SIZE to 4096.
5411
5412 Mon Nov 15 11:48:08 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)
5413
5414         * Makefile.in (diststuff): New target.
5415
5416         * VERSION: Updated.
5417
5418 Sun Nov 14 23:33:01 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5419
5420         * som.c (som_object_setup): Do not create dummy ".text", ".data",
5421         and ".bss" sections.
5422         (setup_sections): Do not set SEC_HAS_CONTENTS if a section's size
5423         is zero.  Recognize BSS type sections and turn off SEC_LOAD and
5424         SEC_DATA (so binutils/size works).  Set the correct value for
5425         a section's _raw_size.
5426         (som_slurp_symbol_table): Program entry points, and millicode are
5427         also functions.  Mark them as such.  Also mark L$* symbols as
5428         debugging symbols.
5429
5430         * bfd-in2.h: Rebuilt.
5431
5432 Sat Nov 13 15:27:15 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5433
5434         * som.c (som_bfd_reloc_type_lookup): Add missing prototype.  Returns
5435         a pointer to constant data.  Delete bogus #define which made the 
5436         function useless.
5437
5438         * som.c (som_prep_for_fixups): New function.
5439         (som_write_fixups): New function.
5440         (som_write_space_strings): New function.
5441         (som_write_symbol_strings): New function.
5442         (som_begin_writing): New function.
5443
5444 Fri Nov 12 15:29:36 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5445
5446         * som.c (som_write_object_contents): Do not abort.  Flesh out.
5447         (som_set_section_contents): Do not abort.  Flesh out.
5448
5449         * som.c (som_write_headers): New function.
5450         (som_prep_headers): New function.
5451         (som_build_and_write_symbol_table): New function.
5452
5453         * som.c (som_sizeof_headers): Add missing prototype.
5454         (som_set_arch_mach): Do not abort.
5455
5456         * som.c (som_count_spaces): New function.
5457         (som_count_subspaces): New function.
5458         (compare_syms): New function.
5459         (som_compute_checksum): New function.
5460
5461         * som.c (hppa_som_gen_reloc_type): New function.
5462         (som_bfd_reloc_type_lookup): New function.
5463
5464         * som.c (try_prev_fixup): New function.
5465         (som_reloc_skip): New function.
5466         (som_reloc_addend): New function.
5467         (som_reloc_call): New function.
5468
5469         * som.c (som_initialize_reloc_queue): New function.
5470         (som_reloc_queue_insert): Likewise.
5471         (som_reloc_queue_fix): Likewise.
5472         (som_reloc_queue_find): Likewise.
5473
5474         * som.c (som_hppa_howto_table): SOM howto relocation table.
5475         (hppa_som_reloc): New function.
5476
5477         * som.c (struct reloc_queue): New structure to keep track of
5478         the last four multibyte relocations emitted.
5479         (enum pa_symbol_type): Type to fully describe the symbol types
5480         associated with .import/.export assembler directives.
5481
5482         * som.c: Include libhppa.h
5483
5484         * som.c (bfd_som_set_section_attributes): New function.
5485         (bfd_som_set_subsection_attributes): Likewise.
5486         (bfd_som_set_symboL_type): Likewise.
5487         (bfd_som_attach_unwind_info): Likewise.
5488         * som.h: Declare new exported functions.
5489
5490         * som.h (struct som_symbol): Add new fields to hold additional
5491         information needed to build/write symbol tables and fixup streams.
5492         (struct som_section_data_struct): Add new fields to hold additional
5493         information needed to build/write space and subspace headers.
5494         (som_symbol_data): New accessor macro for SOM symbol information.
5495         (R_HPPA_*): Basic relocation types to be used by the assembler.
5496
5497 Fri Nov 12 11:00:28 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5498
5499         * trad-core.c (trad_unix_core_file_p): If new hook
5500         TRAD_CORE_ALLOW_ANY_EXTRA_SIZE defined, then skip the check for the
5501         corefile being too big.
5502         * hosts/i386sco.h: Define it.
5503
5504 Thu Nov 11 15:16:28 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5505
5506         * bfd.c (struct _bfd): Add hppabsd_core_data.
5507         * targets.c (target_vector): Add hppabsd_core_vec.
5508         * hpux-core.c (hpux_core_core_file_p): Fail if an unknown core
5509         section is encountered during core section scanning.
5510         * hppabsd-core.c: New file.
5511         * config/hppabsd.mh: Enable HPPA BSD core files.
5512
5513         * elf32-hppa.c (hppa_elf_reloc): Remove DEFUN crud.  Remove code
5514         which is either commented out or ifdef'd out.  Add, update and
5515         clean comments.  Fix various indention and spacing problems.  Handle
5516         problems related to using "ble" to jump to a stub rather than "bl"
5517         (%r31 is trashed by "ble", but not by "bl").
5518         (NEW_INSTRUCTION): Put inside curly braces.
5519         (CURRENT_STUB_OFFSET): Fix indention problems.
5520         (hppa_elf_build_arg_reloc_stub): Fix indention and spacing problems.
5521         Add, update and clean comments.  Handle "ble" %r31 lossage problems.
5522         (hppa_elf_build_long_branch_stub): Likewise.
5523         (hppa_look_for_stubs_in_section): Likewise.
5524         (hppa_elf_stub_check): Remove obsolete function.
5525
5526         * hppa_stubs.h: Add new instructions to deal with %r31 lossage
5527         problems.  Delete unused instructions.
5528         
5529 Tue Nov  9 11:40:27 1993  Stan Shebs  (shebs@rtl.cygnus.com)
5530
5531         * m68klynx.c (TARGET_IS_BIG_ENDIAN_P): Define.
5532
5533 Tue Nov  9 11:26:05 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5534
5535         * elfcode.h (elf_object_p): Rather than looking through an array
5536         of architectures, get the ELF EM_xxx code from the backend
5537         information.  Let the generic ELF target match any EM_xxx code not
5538         matched by another ELF target.  Call elf_backend_object_p to let
5539         the backend do more checks and set global information.
5540         * libelf.h (struct elf_backend_data): Added elf_machine_code and
5541         elf_backend_object_p fields.
5542         (struct bfd_elf_arch_map): Removed.
5543         (bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare.
5544         * elf32-target.h, elf64-target.h: Initialize elf_machine_code
5545         field with ELF_MACHINE_CODE.  Initialize elf_backend_object_p
5546         field with elf_backend_object_p (if it is defined).
5547         * elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c,
5548         elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c,
5549         elf64-gen.c (ELF_MACHINE_CODE): Defined.
5550         * elf32-mips.c: Include ecoffswap.h to get ECOFF swapping
5551         routines.
5552         (mips_elf_object_p): Set the right machine number.
5553         (mips_elf_ecoff_debug_swap): Defined.
5554         (elf_backend_object_p): Defined to be mips_elf_object_p.
5555         (elf_backend_ecoff_debug_swap): Defined to be
5556         mips_elf_ecoff_debug_swap.
5557         * elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed.
5558
5559         * libbfd-in.h (target_vector, default_vector): Declare.
5560         * libbfd.h: Rebuilt.
5561         * format.c (target_vector, default_vector): Don't declare.
5562
5563         * elf32-mips.c (elf_mips_howto_table): Don't complain on overflow
5564         for R_MIPS_26.  Correct overflow detection requires matching the
5565         upper four bits of the destination against the PC.  From Ted Lemon
5566         <mellon@pepper.ncd.com>.
5567
5568         * bout.c (b_out_reloc_type_lookup): Return type should point to
5569         const data.
5570         * coff-i960.c (coff_i960_reloc_type_lookup): Likewise.
5571         * elf32-hppa.c (elf_hppa_reloc_type_lookup): Likewise.
5572         * mipsbsd.c (MY(reloc_howto_type_lookup)): Likewise.
5573         * coff-i386.c (coff_i386_reloc): Made howto const.
5574         * oasys.c (oasys_write_data): Made how const.
5575
5576         * libelf.h: Added some comments.
5577         (struct elf_backend_data): Added elf_backend_ecoff_debug_swap
5578         field.  Removed unused write_relocs field.
5579         * elf32-target.h: Adjusted elf_backend_data initialization
5580         accordingly.
5581         * elf64-target.h: Corrected elf_backend_data initialization to
5582         fill in all fields and to set elf_64_p to 1.
5583
5584 Mon Nov  8 18:13:14 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5585
5586         * elfcode.h (bfd_section_from_shdr): Remove duplicate assignment
5587         to filepos in SHT_STRTAB case.
5588         (assign_file_position_for_section): Set BFD section filepos as
5589         well as ELF section sh_offset.
5590
5591         * reloc.c: Use const instead of CONST.
5592         (bfd_perform_relocation): Make variable howto a const pointer.
5593         * bfd-in2.h, libbfd.h: Rebuilt.
5594
5595 Mon Nov  8 12:19:15 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5596
5597         * Makefile.in (realclean): Don't remove generated headers.  Reverts
5598         change of 2 Jul 1993.
5599
5600 Mon Nov  8 06:08:31 1993  D. V. Henkel-Wallace  (gumby@cirdan.cygnus.com)
5601
5602         * configure.bfd: make unixware equivalent to sysv4.
5603
5604         * config/i386-nlm.mt: bring in elf config; make it the default.
5605
5606 Sun Nov  7 20:21:38 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5607
5608         * libbfd.c (bfd_put_8): Add parens around reference to "val"
5609         argument.
5610
5611 Fri Nov  5 21:45:09 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
5612
5613         * hosts/i386mach3.h (HOST_SEGMENT_SIZE),
5614         i386mach3.c (SEGMENT_SIZE, TEXT_START_ADDR): Correct values (?).
5615
5616 Fri Nov  5 15:17:57 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5617
5618         * coffcode.h (coff_write_object_contents): Zero out internal_a.
5619
5620 Fri Nov  5 10:41:07 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
5621
5622         * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coffcode.h,
5623         core.c, ctor.c, format.c, init.c, libbfd.c, opncls.c, reloc.c,
5624         section.c, syms.c, targets.c:
5625         Doc cleanup (spelling, punctuation, grammar, formatting).
5626         * bfd-in2.h, libbfd.h: Rebuild.
5627
5628 Thu Nov  4 14:46:14 1993  John Gilmore  (gnu@rtl.cygnus.com)
5629
5630         * bfd-in.h (bfd_get_cacheable, bfd_set_cacheable):  New accessors.
5631         * bfd.c, opncls.c:  Improve comments on file descriptor cacheing.
5632
5633 Thu Nov  4 08:54:30 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5634
5635         * From Pete Hoogenboom (hoogen@cs.utah.edu)
5636         * elf32-hppa.c (hppa_elf_get_section_contents): Fix logic error
5637         in last change.  Always rebuild symbol extension section the first
5638         time though if output sections exist (fixes ld -r problems).
5639
5640 Thu Nov 04 08:08:46 1993  Jeffrey Wheat  (cassidy@cygnus.com)
5641
5642         * Makefile.in: Add .PHONY for check and installcheck rules.
5643
5644 Tue Nov  2 14:42:27 1993  Bill Cox (bill@tarkas.cygnus.com)
5645
5646         * libbfd-in.h (artdata): Use long, not time_t for portability, at
5647           least to HPUX.  File below is a derived file.
5648
5649 Tue Nov  2 14:42:27 1993  Bill Cox (bill@tarkas.cygnus.com)
5650
5651         * libbfd.h (artdata): Use long, not time_t for portability, at
5652           least to HPUX.
5653
5654 Tue Nov  2 09:32:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5655
5656         * config.bfd: Use bigmips for mips*-*-bsd*.
5657
5658 Mon Nov  1 14:30:09 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5659
5660         * elfcode.h (elf_slurp_reloca_table, elf_slurp_reloc_table):
5661         Handle symbol number of zero.
5662
5663         * reloc.c (enum bfd_reloc_code_real): Added
5664         BFD_RELOC_MIPS_LITERAL, BFD_RELOC_MIPS_GOT16,
5665         BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GPREL32.
5666         * bfd-in2.h: Rebuilt.
5667         * coff-mips.c (mips_bfd_reloc_type_lookup): Handle
5668         BFD_RELOC_MIPS_LITERAL.
5669         * elf32-mips.c (mips_reloc_map): Handle new relocs.
5670         (mips_elf_hi16_reloc, mips_elf_lo16_reloc): Rearrange _gp_disp
5671         checks slightly.
5672
5673         * aout-target.h (MY_bfd_debug_info_start, MY_bfd_debug_info_end,
5674         MY_bfd_debug_info_accumulat [sic]): Remove unused definitions.
5675         (MY_bfd_get_relocated_section_contents, MY_bfd_relax_section,
5676         MY_bfd_seclet_link): Define.
5677         (MY_bfd_reloc_type_lookup): Rename from
5678         MY_reloc_howto_type_lookup.
5679         (MY_bfd_make_debug_symbol): Rename from MY_make_debug_symbol.
5680         (MY(vec)): Use JUMP_TABLE rather than listing functions.
5681         * hp300hpux.c (MY_get_symtab, MY_get_symtab_upper_bound,
5682         MY_canonicalize_reloc, MY_write_object_contents): Don't define in
5683         terms of MY, because that causes a recusive invocation of CAT when
5684         expanded within JUMP_TABLE, and ANSI compilers don't expand
5685         recursive macros.
5686         * mipsbsd.c (MY_bfd_reloc_type_lookup): Rename from
5687         MY_reloc_howto_type_lookup, and don't define in terms of MY.
5688         (MY_canonicalize_reloc): Don't define in terms of MY.
5689         (aout_mips_little_vec, aout_mips_big_vec): Use JUMP_TABLE rather
5690         than listing functions.
5691
5692 Mon Nov  1 09:12:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5693
5694         * config.bfd: Use m68k-elf for m68*-*-sysv4*.
5695
5696 See file ChangeLog.1
5697
5698 \f
5699 Local Variables:
5700 mode: indented-text
5701 left-margin: 8
5702 fill-column: 74
5703 version-control: never
5704 End: