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