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