3 * elf32-sh.c (sh_elf_reloc_loop): Fix compile time warning, and
4 remove possibility of infinite loop.
8 * aix386-core.c: Fix formatting.
9 * aout-adobe.c: Likewise.
10 * aout-arm.c: Likewise.
11 * aout-encap.c: Likewise.
12 * aout-ns32k.c: Likewise.
13 * aout-target.h: Likewise.
14 * aout-tic30.c: Likewise.
17 * archive.c: Likewise.
19 * bfd-in2.h: Likewise.
25 * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Don't create
26 pltoff entries for DT_INIT and DT_FINI.
27 (elfNN_ia64_final_link): Don't set DT_INIT/FINI entries.
28 (elfNN_ia64_finish_dynamic_sections): Don't fill in DT_INIT/FINI
33 * elfxx-ia64.c (elfNN_ia64_check_relocs): Handle IPLT relocs.
34 (allocate_dynrel_entries): Likewise.
35 (elfNN_ia64_relocate_section): Likewise. Set REL addends correctly.
36 (set_pltoff_entry): Likewise.
37 (ia64_howto_table): Remove R_IA64_SEGBASE, and R_IA64_EPLT[ML]SB
38 (elfNN_ia64_reloc_type_lookup): Likewise.
39 (elfNN_ia64_install_value): Likewise.
40 (elfNN_ia64_relocate_section): Likewise.
41 * reloc.c (BFD_RELOC_IA64_SEGBASE): Remove.
42 (BFD_RELOC_IA64_EPLTMSB, BFD_RELOC_IA64_EPLTLSB): Remove.
46 * cpu-a29k.c: Fix formatting.
47 * cpu-alpha.c: Likewise.
48 * cpu-arm.c: Likewise.
49 * cpu-avr.c: Likewise.
50 * cpu-d10v.c: Likewise.
51 * cpu-h8500.c: Likewise.
52 * cpu-hppa.c: Likewise.
53 * cpu-i370.c: Likewise.
54 * cpu-i386.c: Likewise.
55 * cpu-i960.c: Likewise.
56 * cpu-ia64-opc.c: Likewise.
57 * cpu-ia64.c: Likewise.
58 * cpu-m32r.c: Likewise.
59 * cpu-m68hc11.c: Likewise.
60 * cpu-m68hc12.c: Likewise.
61 * cpu-m68k.c: Likewise.
62 * cpu-m88k.c: Likewise.
63 * cpu-mips.c: Likewise.
64 * cpu-ns32k.c: Likewise.
66 * cpu-powerpc.c: Likewise.
68 * cpu-sparc.c: Likewise.
69 * cpu-tic54x.c: Likewise.
70 * cpu-v850.c: Likewise.
71 * cpu-vax.c: Likewise.
72 * cpu-w65.c: Likewise.
73 * cpu-we32k.c: Likewise.
74 * cpu-z8k.c: Likewise.
80 * coff-arm.c: Fix formatting.
81 * coff-ppc.c: Likewise.
82 * coff-rs6000.c: Likewise.
83 * coff-sh.c: Likewise.
84 * coff-sparc.c: Likewise.
85 * coff-tic30.c: Likewise.
86 * coff-tic54x.c: Likewise.
87 * coff-tic80.c: Likewise.
88 * coff-w65.c: Likewise.
89 * coff-we32k.c: Likewise.
90 * coff-z8k.c: Likewise.
94 * elf64-alpha.c (elf64_alpha_check_relocs): Create the reloc
95 section with the same ALLOC|LOAD flags as the source section.
99 * elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used
100 by STO_ALPHA constants.
104 * coff-pmac.c: Fix formatting.
105 * coff-ppc.c: Likewise.
109 * elflink.h (elf_link_add_object_symbols): Also add indirect
110 symbols for common symbols with the default version.
114 * section.c (STD_SECTION): Set gc_mark flag.
118 * coff-i960.c: Likewise.
119 * coff-m68k.c: Likewise.
120 * coff-m88k.c: Likewise.
121 * coff-mcore.c: Likewise.
122 * coff-mips.c: Likewise.
126 * elf32-sh.c (sh_elf_relocate_section): Ignore R_SH_NONE relocs.
130 * coff-h8300.c: Fix formatting.
131 * coff-h8500.c: Likewise.
132 * coff-i386.c: Likewise.
133 * coff-i860.c: Likewise.
134 * coff-i960.c: Likewise.
135 * coff-ia64.c: Likewise.
139 * archive.c: Fix formatting.
140 * archures.c: Likewise.
144 * elfxx-ia64.c (elf64_ia64_final_link): New local unwind_output_sec.
145 Set it before bfd_elf64_bfd_final_link call. Use it after the call.
146 * section.c (bfd_set_section_contents): Call memcpy if
147 section->contents set and location not equal to contents plus offset.
151 * bfd-in.h: Fix formatting.
152 * bfd-in2.h: Likewise.
154 * binary.c: Likewise.
156 * coff-a29k.c: Likewise.
157 * coff-alpha.c: Likewise.
158 * coff-apollo.c: Likewise.
159 * coff-aux.c: Likewise.
163 * aix386-core.c: Fix formatting.
164 * aoutf1.h: Likewise.
166 * archures.c: Likewise.
167 * armnetbsd.c: Likewise.
171 * coff-h8300.c (special): Adjust reloc address.
175 * archures.c (bfd_mach_ia64_elf64, bfd_mach_ia64_elf32): Add defines
176 to differentiate elf32 and elf64 on ia64.
177 * bfd-in2.h: Regenerate.
178 * config.bfd: Add target for "ia64*-*-hpux*".
179 * configure.in: Add bfd_elf32_ia64_big_vec to selvecs switch.
180 * configure: Regenerate.
181 * cpu-ia64.c (bfd_ia64_elf32_arch): Add elf32 arch info structure.
182 * targets.c: Add bfd_target bfd_elf32_ia64_big_vec.
184 * Makefile.am: Make elf32-ia64.c and elf64-ia64.c derived objects
185 from elfxx-ia64.c. Add depenency rules for making elf32-ia64.lo.
186 * Makefile.in: Regnerate.
187 * elf64-ia64.c: Deleted.
188 * elfxx-ia64.c: New file, paramaterized version of elf64-ia64.c.
192 * aout-adobe.c: Fix formatting.
193 * aout-arm.c: Likewise.
194 * aout-cris.c: Likewise.
195 * aout-encap.c: Likewise.
196 * aout-ns32k.c: Likewise.
197 * aout-target.h: Likewise.
198 * aout-tic30.c: Likewise.
202 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Always permit
203 BFDs containing no sections to be merged, regardless of their flags.
207 * elf32-arm.h (elf32_arm_relocate_section): Suppress error message
208 if a relocation for an undefined symbol also results in an
213 * config.bfd: Add support for Sun Chorus.
217 * configure.in: Recognize alpha-*-freebsd*.
218 * configure: Regenerate.
222 * srec.c (CHUNK): Rename to DEFAULT_CHUNK.
223 (Chunk): New global variable set by a parameter in objcopy.c.
224 (S3Forced): New global variable set by a parameter in
226 (srec_set_section_contents): If S3Forced is true, always generate
228 (srec_write_section): Use 'Chunk' to limit maximum length of S
233 * config.bfd: Add support for i[3456]86-chaosdev-storm-chaos.
234 * Makefile.in: Regenerate.
235 * bfd-in2.h: Regenerate.
236 * po/bfd.pot: Regenerate.
240 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Only handle
241 EF_SOFT_FLOAT if it is defined.
245 * elf32-arm.h (elf32_arm_copy_private_bfd_data): Don't refuse
246 attempts to mix PIC code with non-PIC, just mark the output as
247 being position dependent.
248 (elf32_arm_merge_private_bfd_data): Likewise. Print an error
249 message for EF_SOFT_FLOAT mismatches. Display diagnostics for
250 all mismatches, not just the first one.
254 * ieee.c (ieee_archive_p): Plug one of many possible
255 memory leaks in error handling.
259 * elf32-sparc.c (elf32_sparc_merge_private_bfd_data,
260 elf32_sparc_object_p, elf32_sparc_final_write_processing):
262 * elf64-sparc.c (sparc64_elf_merge_private_bfd_data,
263 sparc64_elf_object_p): Support v9b.
264 * archures.c: Declare v8plusb and v9b machines.
266 * cpu-sparc.c: Ditto.
270 * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location
273 * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): New macro.
274 (SYMBOL_CALLS_LOCAL): New macro.
275 (ppc_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL.
276 (ppc_elf_check_relocs): Use SYMBOL_REFERENCES_LOCAL.
277 (ppc_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
278 (ppc_elf_relocate_section): Use flag variable to determine
279 whether the relocation refers to a local symbol.
280 Test whether a PLTREL24 reloc will produce a reloc by looking
281 to see whether a PLT entry was made.
285 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make PLT
286 entries that could serve as a definition for a weak symbol.
292 * elf32-mips.c (mips_elf_create_dynamic_relocation): New argument
293 local_p. Add symbol value only for non-R_MIPS_REL32 relocations
294 against local symbols.
295 (_bfd_mips_elf_finish_dynamic_sections): Undo patch from 2000-10-01.
299 * section.c (struct sec): Add kept_section.
300 (struct bfd_comdat_info): Remove sec, we can use above.
301 (STD_SECTION): Add initializer.
302 (bfd_make_section_anyway): Init here too.
304 * bfd-in2.h: Regenerate.
306 * elflink.h (elf_link_add_object_symbols): Remove unnecessary
308 (elf_link_input_bfd): Set all asection->symbol->value's here, and
309 fudge values for discarded link-once section symbols.
311 * elf64-hppa.c: Include alloca-conf.h
315 * elf.c (swap_out_syms): Revert 2000-10-07 changes.
317 * ieee.c (ieee_make_empty_symbol): Oops, bfd_zalloc needs another arg.
321 * ieee.c (ieee_make_empty_symbol): Use bfd_zalloc, not bfd_zmalloc.
325 * section.c (bfd_make_section_anyway): Release newsect ptr when
326 newsect->symbol fails to alloc. Use bfd_release instead of free.
330 * elf64-ia64.c (elf64_ia64_unwind_entry_compare_bfd): New.
331 (elf64_ia64_unwind_entry_compare): New.
332 (elf64_ia64_final_link): Sort the .IA_64.unwind section.
336 * elflink.h (size_dynamic_sections): Don't create various tags if
337 .dynstr is excluded from the link. Don't set first dynsym entry
338 if dynsymcount is zero.
339 (elf_bfd_final_link): Don't try to swap out dynamic syms if
340 .dynsym excluded from the link. Don't try to write any dynamic
341 sections excluded from the link.
343 * elf.c (swap_out_syms): Handle global section symbols.
347 * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs
348 * coffcode.h (coff_set_alignment_hook): read extended reloc count
349 (coff_write_relocs): write extended reloc count
350 (coff_write_object_contents): account for extended relocs
354 * elf-bfd.h (struct elf_backend_data): Add elf_backend_section_flags
356 * elf.c (_bfd_elf_make_section_from_shdr): Call the
357 elf_backend_section_flags function.
358 * elf64-ia64.c (elf64_ia64_section_from_shdr): Delete flag conversion
360 (elf64_ia64_section_flags): New function containing flag conversion
362 (elf_backend_section_flags): Define to elf64_ia64_section_flags.
363 * elfxx-target.h (elf_backend_section_flags): Define.
364 (elfNN_bed): Initialize elf_backend_section_flags field.
368 * elf32-hppa.c (elf32_hppa_check_relocs): Correct call to
369 _bfd_elf32_gc_record_vtable. Correct a comment.
375 * elf32-mips.c (_bfd_mips_elf_finish_dynamic_sections): Mark gld
376 produces binaries with got[1] = 0x80000001 to differenciate them
377 for the dynamic linker from the broken binaries produced by old
382 * elf.c (elfcore_grok_pstatus): Check for size of pxstatus_t.
383 (elfcore_grok_lwpstatus): Check for size of lwpxstatus_t.
384 * configure.in: Add check for pxstatus_t and lwpxstatus_t.
385 * configure: Regenerate.
389 Define two bfd_targets for absence and presence of leading
390 underscore on symbols. Make sure to only link same kind.
391 * elf32-cris.c (cris_elf_object_p,
392 cris_elf_final_write_processing, cris_elf_print_private_bfd_data,
393 cris_elf_merge_private_bfd_data): New.
394 (elf_backend_object_p, elf_backend_final_write_processing,
395 bfd_elf32_bfd_print_private_bfd_data,
396 bfd_elf32_bfd_merge_private_bfd_data): Define.
397 <Target vector definition>: Include elf32-target.h twice with
398 different macro settings:
399 (TARGET_LITTLE_SYM): First as bfd_elf32_cris_vec, then as
400 bfd_elf32_us_cris_vec.
401 (TARGET_LITTLE_NAME): First as "elf32-cris", then "elf32-us-cris".
402 (elf_symbol_leading_char): First as 0, then '_'.
403 (INCLUDED_TARGET_FILE): Define for second include of elf32-target.h.
404 * config.bfd (cris-*-*): Add bfd_elf32_us_cris_vec to targ_selvecs.
405 * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vector.
406 * configure: Regenerate.
407 * targets.c: Declare bfd_elf32_us_cris_vec.
408 * po/bfd.pot: Regenerate.
412 * elf32-arm.h (arm_add_to_rel): Correctly adjust the addend for
413 R_ARM_THM_PC22 relocations.
417 * elflink.h (elf_link_add_object_symbols): Don't bfd_release runpath.
421 * elf.c (elf_fake_sections): Do not mark the section SHT_NOBITS if
422 is has the SEC_HAS_CONTENTS flag set.
427 * aout-cris.c (N_TXTADDR): Define.
431 * som.c: Include alloca-conf.h.
432 * Makefile.am: "make dep-am"
433 * Makefile.in: Regenerate.
437 * elf32-hppa.c (plt_stub): New.
438 (PLT_STUB_ENTRY): Define.
439 (elf32_hppa_link_hash_table): Change multi_subspace to packed
440 boolean. Add need_plt_stub, has_12bit_branch and has_17bit_branch.
441 (elf32_hppa_link_hash_table_create): Init to suit.
442 (elf32_hppa_check_relocs): Set has_12bit_branch and
443 has_17bit_branch as appropriate.
444 (elf32_hppa_adjust_dynamic_symbol): Set need_plt_stub for
446 (elf32_hppa_size_dynamic_sections): Correct setting of reltext.
447 Add space for plt_stub as needed.
448 (elf32_hppa_finish_dynamic_symbol): Point .plt entries for global
449 functions at plt_stub.
450 (elf32_hppa_finish_dynamic_sections): Write plt_stub.
451 (elf32_hppa_create_dynamic_sections): Leave .plt executable.
453 * elf32-hppa.h (elf32_hppa_size_stubs): Add group_size param.
454 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. Use it instead
455 of fixed size, and if negative, disable handling of input sections
456 before stub section. Set up default stub group size depending
457 on detected branch relocs.
458 (hppa_build_one_stub): Use lrsel and rrsel for import stubs to
459 ensure different offsets from sym_value aren't rounded to
460 different 2k blocks. Use lrsel and rrsel for other stubs too for
461 consistency rather than necessity.
462 (elf32_hppa_check_relocs): Handle R_PARISC_DIR14F.
463 (final_link_relocate): Likewise.
464 (elf32_hppa_relocate_section): Likewise.
466 * elf-hppa.h (elf_hppa_howto_table): Add R_PARISC_DIR14F reloc.
467 (_bfd_elf_hppa_gen_reloc_type): Generate them.
468 (elf_hppa_final_link_relocate): Handle them.
469 (elf_hppa_relocate_insn): Likewise.
470 (_bfd_elf_hppa_gen_reloc_type): Add missing e_ldsel and e_rdsel cases.
474 * elfcode.h (elf_object_p): Preserve and clear abfd section
475 information. Restore at error.
479 * peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory
480 is empty, make sure that its rva also 0. NT loader dislikes
485 * som.c (som_bfd_derive_misc_symbol_info): Make weak symbols
490 * elf32-hppa.c (elf32_hppa_check_relocs): Fix weak sym handling in
491 currently unused RELATIVE_DYNAMIC_RELOCS code.
492 (hppa_discard_copies): Likewise.
493 (elf32_hppa_size_stubs): Size `input_list' array correctly. Correct
494 comments. Don't check non-code output sections for stub grouping.
498 * section.c (bfd_get_unique_section_name): Return NULL if
503 * elf32-m68k.c (elf_cpu32_plt0_entry): Change the PLT entry 0
504 instruction sequence to actually work.
505 (elf_m68k_finish_dynamic_sections): Change the patch-in offset
510 * elf32-sh.c (sh_elf_relocate_section): Use
511 _bfd_final_link_relocate to apply the relocation against a section
512 symbol, when doing relocatable links.
516 * elf32-hppa.c (elf32_hppa_stub_hash_entry): Rename input_section
518 (stub_hash_newfunc): Here too.
519 (hppa_add_stub): And here.
520 (elf32_hppa_link_hash_table): Remove stub_section_created,
521 reloc_section_created, first_init_sec and first_fini_sec. Add
523 (elf32_hppa_link_hash_table_create): Init to suit.
524 (hppa_get_stub_entry): Add support for grouping stub sections.
525 (hppa_add_stub): Likewise. Remove sec_count param and init/fini
526 section code. Index stub vars by section->id.
527 (elf32_hppa_size_stubs): Likewise. Remove duplicated function
528 exit paths. Zap allocation of above removed vars. Refine
531 * elf32-hppa.h (elf32_hppa_size_stubs): Add output_bfd param.
532 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
533 (hppa_get_stub_entry): Pass in pointer to elf32_hppa_link_hash_table
534 rather than pointer to bfd_link_info.
535 (hppa_add_stub): Likewise.
536 (final_link_relocate): Likewise.
540 (elf32_hppa_size_stubs): Don't try to build stubs for discarded
545 * elf32-sh.c (ELF_MAXPAGESIZE): Define to 128, to match
546 ld/emulparams/shelf.sh.
550 * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): New function.
551 * bfd-in.h (bfd_m68k_elf32_create_embedded_relocs): Add declaration.
552 * bfd-in2.h: Regenerate.
556 * bfd/elf64-alpha.c (elf64_alpha_relax_with_lituse): ld performs
557 LITUSE relocations incorrectly if -relax is specified on the ld
558 command line and the displacement field of the load or store
563 * elf32-hppa.c (hppa_add_stub): Dont set first_init_sec and
565 (elf32_hppa_size_stubs): Instead correctly find the first .init
566 and .fini section here.
570 * elf32-hppa.c (clobber_millicode_symbols): New function.
571 (elf32_hppa_size_dynamic_sections): Call it.
575 * elf32-hppa.c (elf32_hppa_link_hash_entry): Make pic_call
576 packed. Add plabel, plt_abs packed booleans.
577 (hppa_link_hash_newfunc): Init new fields.
578 (PLABEL_PLT_ENTRY_SIZE): Define.
579 (hppa_stub_name): Use size_t len vars.
580 (hppa_add_stub): Likewise.
581 (elf32_hppa_build_stubs): Likewise.
582 (hppa_build_one_stub): Kill some compiler warnings.
583 (elf32_hppa_check_relocs): Always generate a plt entry for PLABELs
584 if dynamic linking. Munge the local plt offsets into
585 local_got_refcounts. Set h->plabel for all global PLABELs. Use
586 size_t len vars. Add assert for plabel addend.
587 (elf32_hppa_gc_sweep_hook): Sweep local plt entries too.
588 (elf32_hppa_hide_symbol): New function.
589 (elf_backend_hide_symbol): Define.
590 (elf32_hppa_adjust_dynamic_symbol): Don't throw away plt entries
591 with h->plabel set. Don't make plt entries to have dynamic syms
592 when they have been forced local. If plt entry is used by a
593 plabel, make it PLABEL_PLT_ENTRY_SIZE.
594 (elf32_hppa_size_dynamic_sections): Set plt_abs for init fns.
595 Set up .plt offsets for local syms.
596 (elf32_hppa_relocate_section): Initialise plt entries for local
597 syms. Leave weak undefined plabels zero. Make global plabel
598 relocs against function symbol, and leave the addend zero.
599 Use *ABS* DIR32 relocs instead of SEGREL32 for dynamic got relocs.
600 (elf32_hppa_finish_dynamic_symbol): Set up IPLT relocs for
601 non-dynamic syms. Init extra plt for plabels. Use *ABS* DIR32
602 relocs instead of SEGREL32 for dynamic got relocs.
603 (elf32_hppa_finish_dynamic_sections): Reserve one more .got entry.
604 (elf_backend_got_header_size): Adjust.
605 (elf32_hppa_set_gp): Calculate an "ideal" LTP.
607 * elf32-hppa.c (LONG_BRANCH_VIA_PLT): Define.
608 (hppa_type_of_stub): Use it instead of #if 0
609 (hppa_discard_copies): Use it here too.
610 (elf32_hppa_size_dynamic_sections): And here.
612 * elf32-hppa.c (elf32_hppa_link_hash_table): Remove `offset' field.
613 (elf32_hppa_link_hash_table_create): And here.
614 (hppa_build_one_stub): And here. Instead keep track of stub
615 offset using _raw_size.
616 (elf32_hppa_size_stubs): Likewise.
617 (elf32_hppa_build_stubs): Likewise.
618 (hppa_size_one_stub): Likewise. Resize reloc section too.
620 * elf32-hppa.c (hppa_add_stub): Correct first_init_sec and
621 first_fini_sec handling. Don't search for reloc section or set
622 hplink->reloc_section_created here.
623 (elf32_hppa_size_stubs): Instead search for reloc sections, and
624 set reloc_section_created here.
625 (hppa_handle_PIC_calls): Set ELF_LINK_HASH_NEEDS_PLT.
626 (elf32_hppa_size_dynamic_sections): Make a .plt entry for DT_INIT
628 (elf32_hppa_finish_dynamic_sections): Set DT_INIT and DT_FINI.
630 * elf32-hppa.c (hppa_build_one_stub): Replace `elf_hash_table (info)'
631 with `hplink->root.'.
632 (elf32_hppa_check_relocs): Likewise.
633 (elf32_hppa_gc_sweep_hook): Likewise.
634 (elf32_hppa_adjust_dynamic_symbol): Likewise.
635 (hppa_handle_PIC_calls): Likewise.
636 (elf32_hppa_size_dynamic_sections): Likewise.
637 (elf32_hppa_set_gp): Likewise.
638 (elf32_hppa_relocate_section): Likewise.
639 (elf32_hppa_finish_dynamic_symbol): Likewise.
640 (elf32_hppa_finish_dynamic_sections): Likewise.
643 * elf32-hppa.c (hppa_type_of_stub): Generate import stubs for
644 defined weak symbols in shared links.
645 (final_link_relocate): Calls to defined weak symbols in shared
646 objects must go via import stubs, as the target might not be known
651 * elf32-sh.c (sh_elf_howto_table): Moved R_SH_GOT32, R_SH_PLT32,
652 R_SH_COPY, R_SH_GLOB_DAT, R_SH_JMP_SLOT, R_SH_RELATIVE,
653 R_SH_GOTOFF, R_SH_GOTPC) to the range from 160 to 167. Replaced
654 the original entries with EMPTY_HOWTOs, and added new ones to fill
656 (sh_elf_info_to_howto): Make sure the new gap isn't used.
657 (sh_elf_relocate_section): Likewise.
661 * cpu-mips.c (arch_info_struct): Add mips:4K
662 * bfd-in2.h (bfd_mach_mips4K): New define.
663 * archures.c: Add bfd_mach_mips4K to comment.
664 * elf32-mips.c (_bfd_mips_elf_final_write_processing): Return
665 E_MIPS_ARCH_2 for bfd_mach_mips4K.
669 * som.c (som_write_symbol_strings): Do not used fixed buffers,
670 use size_t as a counter.
671 (som_write_space_strings): Similarly.
675 * elf32-i860.c (elf32_i860_relocate_pc26): New function
677 (elf32_i860_relocate_section): Invoke new function from here.
681 * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names
686 * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for
687 target section name instead of dumping core when the target symbol is
692 * riscix.c: Remove DEFUN.
696 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not
697 initialise flags in output bfd if the input bfd is the default
698 architecture with the default flags.
702 * archive.c: Fix formatting.
703 * coff-arm.c: Likewise.
704 * doc/chew.c: Likewise.
708 * section.c (bfd_get_unique_section_name): Put a dot before the
713 * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID.
714 * elf.c: Fix formatting.
718 * config.bfd (sh-*-linux*): Added.
719 * configure.in (bfd_elf32_shlin_vec, bfd_elf32_shblin_vec): New.
720 * targets.c: Declare them.
721 * elf32-sh-lin.c: New file.
722 * Makefile.am: Compile it.
723 * elf32-sh.c: Don't override defines from elf32-sh-lin.c.
724 * configure, Makefile.in: Rebuilt.
728 * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss
729 pseduo-section when determining where the TOC ends.
731 * coff-rs6000.c (_bfd_xcoff_swap_aux_out): Use bfd_h_put_16 to
732 output x_tvndx as it is only two bytes wide.
734 * coff-rs6000.c (xcoff_howto_table): A modifiable branch-absolute
735 reloc is 26 or 32 bits wide.
737 * coff-rs6000.c (_bfd_xcoff_rtype2howto): The bitsize is irrelevant
738 for relocs that don't change anything. Also look at the full
743 * config.bfd (arm*-*-uclinux*): New target.
747 * configure: Rebuilt with new libtool.m4.
751 * section.c (bfd_get_unique_section_name): Avoid c++ reserved
752 word for variable name.
753 * bfd-in2.h: Regenerate.
757 * config.in: Regenerate.
758 * libbfd.h: Regenerate.
759 * po/bfd.pot: Regenerate.
760 * doc/bfdint.texi: Remove CVS date string - it foils compares with
765 * cpu-powerpc.c (arch_info_struct): Added MPC860 Family entry.
769 Shared library and PIC support.
770 * elf32-hppa.c (PLT_ENTRY_SIZE): New.
771 (GOT_ENTRY_SIZE): New.
772 (ELF_DYNAMIC_INTERPRETER): New.
773 (STUB_SUFFIX): Define.
774 (LONG_BRANCH_PIC_IN_SHLIB): Define.
775 (RELATIVE_DYNAMIC_RELOCS): Define.
776 (enum elf32_hppa_stub_type): New.
777 (struct elf32_hppa_stub_hash_entry): Rename offset to
778 stub_offset. Add a number of new fields.
779 (struct elf32_hppa_link_hash_entry): New.
780 (struct elf32_hppa_link_hash_table): Add numerous fields. Remove
782 (elf32_hppa_hash_table): Rename to hppa_link_hash_table.
783 (elf32_hppa_stub_hash_lookup): Rename to hppa_stub_hash_lookup.
784 (elf32_hppa_stub_hash_newfunc): Rename to stub_hash_newfunc. Init
786 (hppa_link_hash_newfunc): New function.
787 (elf32_hppa_link_hash_table_create): Use above function. Init new
789 (elf32_hppa_stub_name): Rename to hppa_stub_name. Pass in reloc
790 instead of addend, and remove sym_name from args. Don't use
791 symbol name for local syms, instead use sym index.
792 (elf32_hppa_size_of_stub): Rename to hppa_type_of_stub, and return
793 stub type rather than size. Pass in hash and handle import stub
794 case. Also pass in reloc instead of offset so we can calculate
795 PCREL22F and PCREL12F branches properly.
796 (elf32_hppa_build_one_stub): Rename to hppa_build_one_stub. Build
797 import and export stubs too.
798 (elf32_hppa_size_one_stub): Rename to hppa_size_one_stub. Handle
799 import and export stub sizing.
800 (elf32_hppa_check_relocs): New function.
801 (elf32_hppa_adjust_dynamic_symbol): New function.
802 (hppa_discard_copies): New function.
803 (elf32_hppa_size_dynamic_sections): New function.
804 (elf_backend_size_dynamic_sections): Define.
805 (elf32_hppa_finish_dynamic_symbol): New function.
806 (elf_backend_finish_dynamic_symbol): Define.
807 (elf32_hppa_size_stubs): Stash params in link hash table, and move
808 some local vars into the link hash table too. For shared links,
809 trundle over function syms, generating export stubs. Handle
810 PCREL22F branches. Break out stub creation code from here..
811 (hppa_add_stub): .. to here. New function.
812 (elf32_hppa_final_link): Rename to elf32_hppa_set_gp, and don't
813 call the bfd linker. Use elf_gp to record global pointer.
814 Calculate a value from sections if $global$ is missing.
815 (bfd_elf32_bfd_final_link): Define as _bfd_elf32_gc_common_final_link.
816 (elf32_hppa_gc_mark_hook): New function.
817 (elf_backend_gc_mark_hook): Define.
818 (elf32_hppa_gc_sweep_hook): New function.
819 (elf_backend_gc_sweep_hook): Define.
820 (elf32_hppa_bfd_final_link_relocate): Rename to final_link_relocate.
821 Add rel to args, and remove howto, input_bfd, offset, addend,
822 sym_name as we can recalculate these locally. Handle calls to
823 dynamic objects, extra PIC relocs, PCREL22F branches. Change
824 handling of undefined weak syms. Check that stubs are in range.
825 Only look for import stubs on PCREL17F and PCREL22F relocs. Add
826 message on hitting a DPREL21L reloc that needs fixing. Subtract
827 off PC for PCREL14F. Break out code that does a stub lookup from
829 (hppa_get_stub_entry): ..to here. New function.
830 (elf32_hppa_relocate_insn): Merge into final_link_relocate.
831 (elf32_hppa_relocate_section): Handle got and plt relocs, dynamic
833 (elf32_hppa_finish_dynamic_sections): New function.
834 (elf_backend_finish_dynamic_sections): Define.
835 (elf_backend_final_write_processing) Define.
836 (hppa_handle_PIC_calls): New function.
837 (elf32_hppa_build_stubs): Call it. Pass link_info to
839 (elf32_hppa_create_dynamic_sections): New function
840 to create .plt and .got then set .plt flags correctly.
841 (elf_backend_create_dynamic_sections): Define.
842 (elf32_hppa_object_p): New function.
843 (elf_backend_object_p): Define.
844 (elf32_hppa_elf_get_symbol_type): New function.
845 (elf_backend_get_symbol_type): Define.
846 (elf_backend_can_gc_sections): Define.
847 (elf_backend_want_got_plt): Define.
848 (elf_backend_plt_alignment): Set to 2.
849 (elf_backend_plt_readonly): Define.
850 (elf_backend_want_plt_sym): Define.
851 (elf_backend_got_header_size): Reserve one entry.
853 * elf32-hppa.h (elf32_hppa_build_stubs): Don't pass stub bfd.
854 (elf32_hppa_size_stubs): Pass in multi_subspace.
855 (elf32_hppa_set_gp): Declare.
857 * section.c (SEC_HAS_GOT_REF): Define new flag for asection.
858 (bfd_get_unique_section_name): New function.
859 * bfd_in2.h: Regenerate.
861 * elf64-hppa.c (elf64_hppa_check_relocs): Handle R_PARISC_PCREL12F.
862 (elf64_hppa_size_dynamic_sections): Remove the FIXME at bfd_zalloc
866 * elf64-hppa.c (elf64_hppa_check_relocs): Fix a warning.
867 (elf64_hppa_mark_exported_functions): Set dyn_h->st_shndx.
868 (elf64_hppa_link_output_symbol_hook): Test dyn_h->st_shndx has
869 been updated in finish_dynamic_symbol before modifying function
872 * elf-hppa.h (elf_hppa_howto_table): Restructure into groups of
873 eight entries. Replace NULL with bfd_elf_generic_reloc. Add
874 R_PARISC_GNU_VTENTRY, R_PARISC_GNU_VTINHERIT and R_PARISC_PCREL12F.
875 (_bfd_elf_hppa_gen_reloc_type): Handle R_PARISC_GNU_VT*. Add some
876 comments. Handle format == 12 for R_HPPA_PCREL_CALL.
877 (elf_hppa_final_link_relocate): Handle R_PARISC_PCREL12F.
878 (elf_hppa_relocate_insn): Likewise. Reformat some comments.
879 (elf_hppa_final_write_processing): Expose it for ARCH_SIZE == 32.
882 * elf-hppa.h (elf_hppa_is_local_label_name): Accept the SysV/ELF
883 style of local labels as well.
887 * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate
888 references to undefined symbols in debugging sections.
892 * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT,
893 BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE,
894 BFD_RELOC_SH_GOTPC): Move them from the MIPS section to the SH
899 * elf32-i860.c (bfd_elf32_bfd_is_local_label_name): Define macro.
900 (elf32_i860_is_local_label_name): New function and prototype.
904 * configure.in: Increase version number to 2.10.91.
905 * configure: Regenerate.
906 * aclocal.m4: Regenerate.
907 * config.in: Regenerate.
908 * po/bfd.pot: Regenerate.
912 * elf.c (_bfd_elf_make_section_from_shdr): Add
913 .gnu.linkobce.wi. to the list of debug section names.
917 * dwarf2.c (find_debug_info): New function: Locate a section
918 containing dwarf2 debug information.
919 (bfd_dwarf2_find_nearest_line): Find all sections containing
920 debug information and include them in the stash.
924 * elf32-sh.c (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT,
925 R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): New.
926 (sh_reloc_map): Add new relocs.
927 (sh_elf_check_relocs, sh_elf_link_hash_newfunc,
928 sh_elf_link_hash_table_create, sh_elf_adjust_dynamic_symbol,
929 sh_elf_size_dynamic_sections, sh_elf_finish_dynamic_symbol,
930 sh_elf_finishe_dynamic_sections, sh_elf_discard_copies): New
932 (ELF_DYNAMIC_INTERPRETER, PLT_ENTRY_SIZE): Define.
933 (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
934 elf_sh_plt_entry_be, elf_sh_plt_entry_le,
935 elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
937 (elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry):
939 (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
940 elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset,
941 elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset,
942 elf_sh_plt_reloc_offset): Define.
943 (elf_sh_pcrel_relocs_copied, elf_sh_link_hash_entry,
944 elf_sh_link_hash_table): New structs.
945 (sh_elf_link_hash_traverse, sh_elf_hash_table): New macros.
946 (sh_elf_relocate_section, sh_elf_check_relocs): Handle new
948 (elf_backend_create_dynamic_sections,
949 bfd_elf32_bfd_link_hash_table_create,
950 elf_backend_adjust_dynamic_symbol,
951 elf_backend_size_dynamic_sections,
952 elf_backend_finish_dynamic_symbol,
953 elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
954 elf_backend_plt_readonly, elf_backend_want_plt_sym,
955 elf_backend_got_header_size, elf_backend_plt_header_size):
957 * reloc.c (BFD_RELOC_SH_COPY, BFD_RELOC_SH_GLOB_DAT,
958 BFD_RELOC_SH_JMP_SLOT, BFD_RELOC_SH_RELATIVE, BFD_RELOC_SH_GOTPC):
960 * bfd-in2.h, libbfd.h: Rebuilt.
964 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert 2000-08-27
969 * elf32-sh.c (sh_elf_merge_private_data): If ibfd's elf header flags
970 not initialized, set them to indicate the SH1 instruction set.
974 * acinclude.m4: Include libtool and gettext macros from the
976 * aclocal.m4, configure: Rebuilt.
980 * elf.c: Eliminate references to __sparcv9 macro; replace with
981 autoconf variables HAVE_PSINFO32_T etc.
982 * configure.in: Auto-configure HAVE_PSINFO_32_T, HAVE_PRPSINFO32_T,
983 HAVE_PSTATUS32_T, HAVE_PRSTATUS32_T, HAVE_PRSTATUS32_T_PR_WHO.
985 * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE) define _SYSCALL32 so it can
986 detect the above typedefs. (BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Ditto.
988 * configure: Regenerate.
992 * elf32-i386.c (elf_i386_check_relocs): Keep info on relocs copied
993 for any shared link, not just shared -Bsymbolic.
994 (elf_i386_size_dynamic_sections): Call elf_i386_discard_copies on
995 any shared link, and pass link info to it.
996 (elf_i386_size_dynamic_sections): Update comment.
997 (elf_i386_discard_copies): Modify to discard relocs for symbols
998 that have been forced local.
999 (elf_i386_finish_dynamic_symbol): Don't copy relocs for symbols
1000 that have been forced local.
1004 * elflink.h (elf_link_add_object_symbols): Allow common
1005 symbols to have an alignment of 1 if explicitly requested, and
1006 not overridden by other definitions.
1010 * coff-w65.c (CREATE_LITTLE_COFF_TARGET): Fix typo.
1011 * coffcode.h (coff_set_flags): Add detection of w65 architecture.
1015 * elf-bfd.h (elf_link_hash_table): Add runpath.
1017 * bfd-in.h (bfd_elf_get_runpath_list): New prototype.
1018 * bfd-in2.h: Rebuilt.
1020 * elf.c (_bfd_elf_link_hash_table_init): Initialize the
1021 "runpath" field to NULL.
1022 (bfd_elf_get_runpath_list): New function.
1024 * elflink.h (elf_link_add_object_symbols): Record DT_RPATH and
1029 * elf32-sh.c (sh_elf_relocate_section) [R_SH_IND12W,
1030 R_SH_DIR8WPN, R_SH_DIR8WPZ, R_SH_DIR8WPL]: Handle them
1031 explicitly. Improve validation of r_type.
1035 * elf32-i386.c (elf_i386_size_dynamic_sections): Zero out the
1036 dynamic allocated content space. Add a comment to remind us that
1037 one day this ought to be fixed.
1038 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1039 * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
1040 * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
1044 * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate
1045 field with the newly relocated value instead of adding it to the
1046 existing immediate field.
1047 (elf32_i860_relocate_splitn): Likewise.
1048 (elf32_i860_relocate_highadj): Likewise.
1052 * elf32-i860.c (elf32_i860_relocate_pc16): Implemented function (it
1053 was previously just a stub).
1057 * elflink.c (_bfd_elf_create_got_section): Don't abort().
1059 (_bfd_elf_create_dynamic_sections): Likewise.
1063 * elf64-sparc.c (sparc64_elf_relocate_section): Set relocation address
1064 for undefined symbols to be the beginning of the section.
1066 * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Don't allocate
1067 four extra entries at the beginning of the .rela.plt section.
1068 (sparc64_elf_finish_dynamic_symbol): Adjust the offset in the .rela.plt
1069 section to account for the four reserved entries in the .plt section.
1073 * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Add ori r0,r0,0
1074 to the list of NOPs we recognize after a branch-and-link.
1075 Use the ori NOP when one is needed.
1077 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Finish implementation
1082 * elf64-ia64.c (elf64_ia64_merge_private_bfd_data): Handle
1083 EF_IA_64_REDUCEDFP, EF_IA_64_CONS_GP, and EF_IA_64_NOFUNCDESC_CONS_GP.
1084 (elf64_ia64_print_private_bfd_data): Likewise. Also handle
1089 * elf32-sh.c (sh_elf_set_mach_from_flags): Make it static.
1093 * elf32-i860.c (elf32_i860_relocate_section): New function.
1094 (i860_final_link_relocate): New function.
1095 (elf32_i860_relocate_splitn): New function.
1096 (elf32_i860_relocate_pc16): New function.
1097 (elf32_i860_relocate_highadj): New function.
1098 (elf32_i860_howto): Minor adjustments to some relocations.
1099 (elf_info_to_howto_rel): Define.
1100 (elf_backend_relocate_section): Define.
1104 * elf32-arm.h: Fix formatting.
1108 * elf32-sh.c (sh_elf_reloc_loop): Make LAST_SYMBOL_SECTION static.
1112 * elf32-i860.c (elf32_i860_howto_table): Updated some fields.
1116 * ieee.c (ieee_write_debug_part): Rewrite a comment.
1117 * elf64-ia64.c: Fix a typo.
1121 * elf32-i860 (elf32_i860_howto_table): New structure.
1122 (lookup_howto): New function.
1123 (elf32_i860_reloc_type_lookup): New function.
1124 (elf32_i860_info_to_howto_rela): New function.
1125 (elf_code_to_howto_index): New structure.
1126 (elf_info_to_howto): Re-define as elf32_i860_info_to_howto_rela.
1127 (bfd_elf32_bfd_reloc_type_lookup): Re-define as
1128 elf32_i860_reloc_type_lookup.
1132 * som.c (struct fixup_format): Constify `format'.
1133 (som_hppa_howto_table): Use SOM_HOWTO macro.
1134 (try_prev_fixup, hppa_som_reloc): Decorate unused parameter.
1135 (som_bfd_reloc_type_lookup): Likewise.
1136 (compare_subspaces): Remove unused `count1', `count2'.
1137 (som_begin_writing): Remove unused `total_reloc_size'.
1138 (som_bfd_derive_misc_symbol_info): Decorate unused parameter.
1139 (som_print_symbol, som_bfd_is_local_label_name): Likewise.
1140 (som_set_reloc_info): Constify `cp'. Remove unused `addend'.
1141 (som_find_nearest_line): Decorate unused parameter(s).
1142 (som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise.
1143 (som_bfd_link_split_section): Likewise.
1147 * section.c: Restore backed out code.
1148 * elf.c: Restore backed out code.
1149 (copy_private_bfd_data): Fix bug preventing stipped dynamic
1150 binaries from working.
1151 * bfd-in2.h: Regenerate.
1155 * section.c: Back out the change made by Nick Clifton
1158 * bfd-in2.h: Likewise.
1163 * elf32-sh.c (sh_elf_reloc_loop): Warning removal.
1167 * reloc.c (BFD_RELOC_860_*): New bfd relocs for i860.
1168 * bfd-in2.h, libbfd.h: Regenerate.
1172 * section.c (struct sec): Add new boolean field 'segment_mark'.
1173 (STD_SECTION): Initialise new field to zero.
1175 * bfd-in2.h: Regenerate.
1177 * elf.c (copy_private_bfd_data): Reorganise section to segment
1178 mapping to cope with moved sections requiring new segments,
1179 and overlapping segments.
1180 (SEGMENT_END): New macro: Return the end address of a segment.
1181 (IS_CONTAINED_BY_VMA): New macro: Determine if a segment
1182 contains a section by comparing their VMA addresses.
1183 (IS_CONTAINED_BY_LMA): New macro: Determine if a segment
1184 contains a section by comparing their LMA addresses.
1185 (INCLUDE_SECTION_IN_SEGMENT): New macro: Determine if a
1186 section should be included in a segment.
1187 (SEGMENT_AFTER_SEGMENT): New macro: Determine if one segment
1188 follows another in memory.
1189 (SEGMENT_OVERLAPS_SEGMENT): New macro: Determine if two
1194 * cpu-i860.c: Added comments.
1196 * elf32-i860.c (TARGET_LITTLE_SYM): Defined to
1197 bfd_elf32_i860_little_vec.
1198 (TARGET_LITTLE_NAME): Defined to "elf32-i860-little".
1199 (ELF_MAXPAGESIZE): Changed to 4096.
1201 * targets.c (bfd_elf32_i860_little_vec): Declaration of
1203 (bfd_target_vector): Added bfd_elf32_i860_little_vec.
1205 * config.bfd (i860-stardent-sysv4*, i860-stardent-elf*): Added
1206 config for little endian elf32 i860.
1207 (targ_defvec): Define for the new config above
1208 as "bfd_elf32_i860_little_vec".
1209 (targ_selvecs): Define for the new config above
1210 as "bfd_elf32_i860_vec bfd_elf32_i860_little_vec"
1212 * configure.in (bfd_elf32_i860_little_vec): Added recognition
1215 * configure: Regenerated.
1219 * elflink.h (elf_merge_symbol): Take one more argument,
1220 dt_needed, to indicate if the symbol comes from a DT_NEEDED
1221 entry. Don't overide the existing weak definition if dt_needed
1223 (elf_link_add_object_symbols): Pass dt_needed to
1224 elf_merge_symbol ().
1228 * elflink.h (elf_link_size_reloc_section): Zeroes the section's
1233 * configure.host (*-*-aix*): AIX has 'long long' always.
1235 * coff-rs6000.c (xcoff_write_one_armap_big): New procedure.
1236 (xcoff_write_armap_big): Write both 32-bit and 64-bit armaps.
1237 (xcoff_write_archive_contents_big): Don't update the offset
1238 of the symbol table, xcoff_write_armap will do it.
1242 * elf32-mips.c (_bfd_mips_elf_check_relocs): Use abfd instead
1243 of dynobj for SGI_COMPAT checks.
1247 * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): New function.
1248 * bfd-in.h (bfd_m68k_coff_create_embedded_relocs): Add declaration.
1249 * bfd-in2.h: Regenerate.
1253 * elf32-mips.c (_bfd_mips_elf_check_relocs): Detect out of
1254 range symbol indices in relocs and issue an error message.
1258 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't check
1259 info->new_dtags when setting DT_FLAGS_1. It will only be set
1260 by the new linker options. It shouldn't break anything.
1264 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set DT_FLAGS_1
1265 only if info->new_dtags is true.
1269 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set
1270 DT_RUNPATH and DT_FLAGS only if info->new_dtags is true.
1274 * Makefile.am (ALL_MACHINES): Add cpu-cris.lo.
1275 (ALL_MACHINES_CFILES): Add cpu-cris.c.
1276 (BFD32_BACKENDS): Add aout-cris.lo and elf32-cris.lo.
1277 (BFD32_BACKENDS_CFILES): Add aout-cris.c and elf32-cris.c.
1278 (cpu-cris.lo, aout-cris.lo, elf32-cris.lo): New rules.
1279 * Makefile.in: Rebuild.
1280 * aclocal.m4: Rebuild.
1281 * aoutx.h (NAME(aout,machine_type)): Add case for bfd_arch_cris.
1282 * archures.c (enum bfd_architecture): Add bfd_arch_cris.
1283 (bfd_cris_arch): Declare.
1284 (bfd_archures_list): Add bfd_cris_arch.
1285 * bfd-in2.h: Rebuild.
1286 * config.bfd: (cris-*-*): New target.
1287 * configure.in (bfd_elf32_cris_vec, cris_aout_vec): New vectors.
1288 * configure: Rebuild.
1289 * elf.c (prep_headers): Add bfd_arch_cris.
1290 * libbfd.h: Rebuild.
1291 * libaout.h (enum machine_type): Add M_CRIS.
1292 * reloc.c: Add CRIS relocations.
1293 * targets.c (bfd_elf32_cris_vec, cris_aout_vec): Declare.
1294 (bfd_target_vect): Add bfd_elf32_cris_vec and cris_aout_vec.
1295 * cpu-cris.c, aout-cris.c, elf32-cris.c: New files.
1296 * po/POTFILES.in, po/bfd.pot: Regenerate.
1300 * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set
1301 DF_TEXTREL if DT_TEXTREL is set.
1302 * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
1303 * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
1304 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
1305 * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
1306 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1307 * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
1308 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1309 * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
1310 * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise.
1311 * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
1313 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also
1314 set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if
1316 Set the DT_FLAGS and DT_FLAGS_1 entries if necessary.
1320 * bfd-in.h (bfd_elf_set_dt_needed_soname): New.
1321 * bfd-in2.h: Rebuild.
1323 * elf-bfd.h (elf_obj_tdata): Add dt_soname.
1324 (elf_dt_soname): New.
1326 * elf.c (bfd_elf_set_dt_needed_soname): New.
1328 * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED
1329 entry if the shared object loaded by DT_NEEDED is used to
1330 resolve the reference in a regular object.
1334 * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_CONFIG,
1335 DT_DEPAUDIT and DT_AUDIT as strings.
1339 * format.c: Fix formatting.
1343 * elf.c (_bfd_elf_print_private_bfd_data): Fix DT_CHECKSUM.
1347 * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_BIND_NOW,
1348 DT_INIT_ARRAY, DT_FINI_ARRAY, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ,
1349 DT_RUNPATH, DT_FLAGS, DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ,
1350 DT_PLTPADSZ, DT_MOVEENT, DT_MOVESZ, DT_FEATURE, DT_POSFLAG_1,
1351 DT_SYMINSZ, DT_SYMINENT, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT,
1352 DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT, DT_RELCOUNT,
1353 DT_FLAGS_1, DT_USED and DT_CHECKSUM.
1357 * elf.c (bfd_elf_get_sign_extend_vma, bfd_elf_get_arch_size): Move
1358 renamed functions from here...
1359 (assign_section_numbers): Use renamed functions.
1360 (prep_headers): Use renamed functions.
1362 * bfd.c (bfd_get_sign_extend_vma, bfd_get_arch_size): ...To here.
1363 * bfd-in.h (bfd_get_sign_extend_vma, bfd_get_arch_size): Update.
1364 * bfd-in2.h: Regenerate.
1368 * elf32-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Add
1369 parenthesis in if statement.
1373 Enable the support for Traditional MIPS.
1374 * elf32-mips.c (IRIX_COMPAT): Recognize bfd_elf32_tradbigmips_vecand
1375 return ict_none appropriately for traditional mips targets.
1376 (STUB_LW): Change 0x8f998000 to 0x8f998010 for traditional mips.
1377 (STUB_MOVE): Conditionalize for traditonal mips.
1378 (STUB_LI16): Likewise.
1379 (_bfd_mips_elf_modify_segment_map): Conditionalize to avoid making
1380 room for RTPROC header.
1381 (_bfd_mips_elf_modify_segment_map): For a normal mips executable set
1382 the permission for the PT_DYNAMIC as read, write and execute.
1383 (mips_elf_calculate_relocation): Check for the symbol _DYNAMIC_LINKING
1384 for traditonal mips.
1385 (_bfd_mips_elf_create_dynamic_sections): Add the symbol
1386 _DYNAMIC_LINKING for traditonal mips.
1387 (_bfd_mips_elf_create_dynamic_sections): Add the symbol __RLD_MAP
1388 in case of traditonal mips.
1389 (_bfd_mips_elf_adjust_dynamic_symbol): Create a stub only if a PLT
1390 entry is required. For a function if PLT is not required then set the
1391 corresponding hash table entry to 0.
1392 (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG entry for
1394 (_bfd_mips_elf_finish_dynamic_symbol): for a undefined symbol in a
1395 shared object set the value to 0.
1396 (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol
1397 _DYNAMIC_LINKING for traditonal mips.
1398 (_bfd_mips_elf_finish_dynamic_symbol): Check for the symbol __RLD_MAP
1399 for traditonal mips.
1403 * aoutx.h (translate_to_native_sym_flags): Handle BSF_LOCAL.
1407 * libbfd.c (bfd_seek): fix 'seek beyond EOF' error when writing
1408 out a structure that is BFD_IN_MEMORY.
1412 * elf64-hppa.c (get_dyn_name): Pass in section pointer instead of
1413 bfd pointer. Print section id instead of bfd pointer for local
1414 syms. Prefix addend with `+' for global syms as well as local.
1415 Correct calculation of name component lengths.
1416 (elf64_hppa_check_relocs): Update call to get_dyn_name.
1419 * elf-hppa.h (elf_hppa_relocate_section): Update calls here too.
1420 * elf64-hppa.c (elf64_hppa_check_relocs): Fix some warnings.
1421 (elf64_hppa_modify_segment_map): Likewise.
1425 * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA
1426 addresses to be "naturally" sign extended. Return -1 if unknown.
1427 * bfd-in.h (bfd_elf_get_sign_extend_vma): Add declaration.
1428 * bfd-in2.h: Regenerate.
1432 * ecoffswap.h (ecoff_get_off, ecoff_put_off): Add ECOFF_SIGNED_32
1433 and ECOF_SIGNED_64 to list ways to extract an offset.
1434 (ecoff_swap_fdr_in, ecoff_swap_fdr_out, ecoff_swap_pdr_in,
1435 ecoff_swap_pdr_out, ecoff_swap_ext_in, ecoff_swap_ext_out):
1437 * elf64-mips.c (ECOFF_SIGNED_64): Define instead of ECOFF_64.
1438 * elf32-mips.c (ECOFF_SIGNED_32): Define instead of ECOFF_32.
1442 * elfcode.h (elf_object_p): Use bfd_set_start_address and not
1443 bfd_get_start_address.
1444 (elf_swap_ehdr_in): Sign extend e_entry when applicable.
1445 (elf_swap_ehdr_out): Ditto.
1449 * archures.c (bfd_default_scan): Add set of bfd_mach_ cases for
1450 compatibility with older binutils.
1454 * section.c (bfd_make_section_anyway): Start section_id at 0x10.
1455 (STD_SECTION): Avoid negative ids, instead use 0 to 3.
1458 * dwarf1.c (parse_die): Cure signed/unsigned char warnings.
1459 (parse_line_table): Ditto.
1460 (_bfd_dwarf1_find_nearest_line): Ditto.
1461 * syms.c (cmpindexentry): Remove extra `*' from params.
1465 * elf32-mips.c (sort_dynamic_relocs): New Function.
1466 (_bfd_mips_elf_finish_dynamic_sections): Call sort_dynamic_relocs
1467 via qsort to sort the dynamic relocations in increasing r_symndx
1472 * elf64-hppa.c (elf64_hppa_dyn_hash_table_init): Add
1473 ATTRIBUTE_UNUSED to unused args.
1474 (get_opd): Likewise.
1475 (get_plt): Likewise.
1476 (get_dlt): Likewise.
1477 (get_stub): Likewise.
1478 (elf64_hppa_adjust_dynamic_symbol): Likewise.
1479 (elf64_hppa_link_output_symbol_hook): Likewise.
1480 (elf64_hppa_check_relocs): Delete unused var.
1481 (elf64_hppa_size_dynamic_sections): Likewise.
1482 (elf64_hppa_finalize_opd): Likewise.
1483 (elf64_hppa_finalize_dynreloc): Likewise.
1484 (elf64_hppa_modify_segment_map): Likewise.
1485 (elf64_hppa_finish_dynamic_sections): Likewise.
1487 * elf-hppa.h (elf_hppa_final_write_processing): Add
1488 ATTRIBUTE_UNUSED to unused args.
1489 (elf_hppa_final_link_relocate): Likewise.
1490 (elf_hppa_record_segment_addrs): Add paretheses.
1491 (elf_hppa_relocate_section): Constify dyn_name.
1494 * config.bfd: Add hppa*64*-*-linux-gnu 64-bit target, and
1495 rearrange case statement so that it gets preferred to 32-bit ones.
1497 * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Use
1498 asection->id instead of address of asection structure.
1499 (elf32_hppa_size_stubs): Likewise.
1501 * elf32-hppa.c (elf32_hppa_size_stubs): Use just one stub section
1502 for .init* and .fini*.
1504 * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Mask pointers
1505 and addends used in stub names to 32 bits.
1506 (elf32_hppa_size_stubs): Likewise.
1508 * elf-hppa.h (elf_hppa_final_link_relocate): Don't sum addend
1509 twice for R_PARISC_GPREL64. Use bfd_put_32 for R_PARISC_PCREL32,
1510 not bfd_put_64. Fix minor comment typo and formatting.
1512 Changes to create multiple linker stubs, positioned immediately
1513 before the section where they are required.
1514 * elf32-hppa.c: Don't include hppa_stubs.h.
1515 (elf32_hppa_stub_hash_entry): Add a pointer to the stub section.
1516 (elf32_hppa_stub_hash_table): Delete.
1517 (elf32_hppa_link_hash_entry): Delete.
1518 (elf32_hppa_link_hash_table): Use plain bfd_hash_table for
1519 stub_hash_table, and store the struct here rather than a pointer.
1520 Delete output_symbol_count. Add offset array. Change
1521 global_value to a bfd_vma.
1522 (elf32_hppa_stub_hash_lookup): Use table instead of table->root.
1523 (elf32_hppa_stub_hash_traverse): Delete.
1524 (elf32_hppa_name_of_stub): Delete.
1525 (elf32_hppa_link_hash_lookup): Delete.
1526 (elf32_hppa_link_hash_traverse): Delete.
1527 (elf32_hppa_stub_hash_table_init): Delete.
1528 (elf32_hppa_size_of_stub): Pass input section and offset rather
1529 than location and calculate location here. Don't pass name as all
1530 stubs are now the same size.
1531 (elf32_hppa_stub_hash_newfunc): Init new fields.
1532 (elf32_hppa_link_hash_table_create): Likewise, and stub_hash_table
1534 (elf32_hppa_bfd_final_link_relocate): Cast enums to int before
1535 comparing against ints. Rewrite stub handling code.
1536 (elf32_hppa_relocate_section): Make r_type and r_symndx unsigned.
1537 Case enums to int before comparing against ints. Remove
1538 bfd_reloc_dangerous case.
1539 (elf32_hppa_build_one_stub): Rewrite.
1540 (elf32_hppa_size_one_stub): New function.
1541 (elf32_hppa_build_stubs): Rewrite.
1542 (elf32_hppa_size_stubs): Pass in linker call-back functions.
1543 Rewrite stub-handling specific code.
1545 * elf32-hppa.h (elf32_hppa_size_stubs): Update prototype.
1547 * elf64-hppa.c (elf64_hppa_dyn_hash_entry): Fix a comment typo.
1549 * hppa_stubs.h: Delete.
1550 * Makefile.am (SOURCE_HFILES): Remove hppa_stubs.h
1551 (elf32-hppa.lo): Remove hppa_stubs.h from dependencies.
1552 * Makefile.in: Regenerate.
1554 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle e_nlsel and
1557 * libhppa.h (hppa_field_adjust): Correct e_nsel case.
1559 * elf32-hppa.c (elf32_hppa_relocate_section): Mention the offset
1560 and section name for bfd_reloc_notsupported error message.
1561 (elf32_hppa_bfd_final_link_relocate): Print reasons for returning
1562 bfd_reloc_notsupported.
1563 (elf32_hppa_relocate_section): Add ATTRIBUTE_UNUSED to output_bfd.
1565 * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Handle
1566 undefined weak symbols for all relocs.
1567 (elf32_hppa_size_of_stub): Adjust calculation by 8 since branch
1568 offsets are relative to one past the delay slot.
1569 (elf32_hppa_size_stubs): Account for reloc addend when calculating
1570 branch destination. Put addend into stub name too.
1571 (elf32_hppa_bfd_final_link_relocate): Account for reloc addend and
1572 adjust by 8 when deciding whether a linker stub is needed. Put
1573 addend into stub name as for above.
1575 * elf32-hppa.c (hppa_elf_relocate_insn): Change signed/unsigned on
1576 various args and vars.
1577 (elf32_hppa_bfd_final_link_relocate): Here too.
1578 (elf32_hppa_size_stubs): Rename index -> indx. Use e_indx for
1579 inner block var to avoid shadowing.
1581 * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Make `field' arg
1583 * elf64-hppa.h (_bfd_elf64_hppa_gen_reloc_type): Ditto.
1584 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Ditto.
1585 (elf_hppa_fake_sections): Rename local var to avoid shadowing.
1587 * libhppa.h: Change practically all unsigned ints to plain ints.
1588 Remove tests on gcc version. Instead use ATTRIBUTE_UNUSED for
1592 * libhppa.h (hppa_opcode_type): New enum to replace #define's.
1593 * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Modify to
1596 * elf-hppa.h (elf_hppa_relocate_insn): Update the opcode constants
1597 to the new OP_* ones.
1599 * elf32-hppa.c (elf32_hppa_size_stubs): Consolidate freeing on
1600 error exit. Bail out earlier on plabel relocs that we aren't
1601 interested in. Don't tell elf32_hppa_stub_hash_lookup to copy
1602 string, and then don't free our copy.
1603 (elf32_hppa_build_one_stub): Make insn unsigned int.
1605 * libhppa.h (bfd_hppa_insn2fmt): 22 bit branches are only
1606 available with BL, not BE and BLE.
1608 * elf32-hppa.c (hppa_elf_relocate_insn): Add some more example
1609 code for elf arg relocs.
1610 (elf32_hppa_bfd_final_link_relocate): Replace boolean is_local
1611 argument with elf_link_hash_entry h. Handle undefined weak
1612 symbols. Move $global$ lookup from here...
1613 (elf32_hppa_relocate_section): ...to here. Return correct error
1614 message for non-handled relocs.
1615 (elf32_hppa_size_of_stub): Correctly test branch range. Previous
1616 wrong test was -0x3ffff to +0x40000.
1618 * elf-hppa.h (elf_hppa_final_link_relocate): R_PARISC_DIR17R,
1619 R_PARISC_DIR17F, and R_PARISC_DIR21L are for absolute branches;
1620 Handle them as such.
1621 (elf_hppa_relocate_insn): Fix a typo.
1623 * libhppa.h (GET_FIELD, GET_BIT, MASK, CATENATE, ELEVEN): Delete.
1624 (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a,
1625 assemble_17, assemble_21): Delete.
1626 Supply defines for all 64 possible opcodes.
1627 (bfd_hppa_insn2fmt): Add bfd argument, and use to select wide mode
1628 formats. Handle COMICLR.
1629 (hppa_rebuild_insn): Delete bfd argument. Handle formats 10, -11,
1632 * elf32-hppa.c (hppa_elf_relocate_insn): Complete rewrite.
1633 (elf32_hppa_bfd_final_link_relocate): Major rewrite.
1634 (elf32_hppa_build_one_stub): Modify hppa_elf_relocate_insn calls
1636 (elf32_hppa_size_stubs): Don't free stub_name twice. Read in all
1637 the local syms - did this code get deleted accidentally? Ignore
1638 undefined and undefweak syms.
1640 * elf-hppa.h (elf_hppa_final_link): Move hppa_info to outermost
1641 block. Use it instead of elf64_hppa_hash_table (info).
1642 (elf_hppa_final_link_relocate): Use hppa_info instead of
1643 elf64_hppa_hash_table (info).
1645 * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16,
1646 re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn.
1647 (hppa_rebuild_insn): Mask immediate bits here instead.
1648 * elf-hppa.h (elf_hppa_relocate_insn): Mask here too.
1652 * section.c (struct sec): Add id field. Tidy comment formatting.
1653 (bfd_make_section_anyway): Set id.
1654 (STD_SECTION): Init id too.
1655 Change CONST to const throughout.
1656 * archures.c (bfd_arch_info): Tidy comment.
1657 (bfd_arch_list): Change a CONST to const.
1658 * libbfd-in.h: Tidy comments and replace CONST with const.
1659 * elf-bfd.h: Likewise.
1660 * libbfd.h: Regenerate.
1661 * bfd-in2.h: Regenerate.
1662 * libcoff.h: Regenerate.
1666 * archive.c (_bfd_write_archive_contents): Add an informative
1671 * srec.c: Fix formatting.
1679 * coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol
1680 value of PC-relative offsets.
1684 * elf64-alpha.c (alpha_elf_size_info): New.
1685 (elf_backend_size_info): Define to alpha_elf_size_info.
1686 * elfcode.h (elf_size_info): Change hash bucket size to 4.
1690 * elf32-mips.c: Include elf32-target.h again for the traditional
1695 * elf32-avr.c (bfd_elf32_bfd_reloc_type_lookup):
1696 Add ATTRIBUTE_UNUSED to unused arguments to avoid warnings.
1697 (avr_info_to_howto_rela): Likewise.
1698 (elf32_avr_gc_mark_hook): Likewise.
1699 (elf32_avr_gc_sweep_hook): Likewise.
1700 (elf32_avr_relocate_section): Likewise.
1704 * cofflink.c (_bfd_coff_write_global_sym): Turn a weak symbol into
1705 an external symbol for a non-shared, non-relocatable link.
1709 * cofflink.c (IS_EXTERNAL): New macro: Return true if the symbol
1710 is an external symbol.
1711 (IS_WEAK_EXTERNAL): New macro: Return true if the symbol is a weak
1716 * reloc16.c: Fix formatting.
1720 * config.bfd: Change targ_defvec and targ_selvecs for mips*-*-sysv4*
1721 to add a new target for traditional mips i.e
1722 bfd_elf32_tradbigmips_vec and bfd_elf32_tradlittlemips_vec.
1723 * configure.in: Likewise.
1724 * configure: Rebuild.
1725 * targets.c (bfd_elf32_tradbigmips_vec): Declare and put in
1727 (bfd_elf32_tradlittlemips_vec): Likewise.
1728 * elfxx-target.h: Add macro INCLUDED_TARGET_FILE which is more a test
1729 to see that elfNN_bed does not get redefined even if the target file
1730 is included twice for a chip. See elf32-mips.c.
1734 * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed
1735 (CLEANFILES): Add DEPA.
1736 * Makefile.in: Regenerate.
1740 * peicode.h (coff_swap_filehdr_in): can't use e_magic because we
1741 can't assume the PE header is at 0x80.
1745 * syms.c (_bfd_stab_section_find_nearest_line): Use IS_ABSOLUTE_PATH.
1749 * go32stub.h: Update stub.
1753 * archures.c (bfd_mach_avr5): Define.
1754 * bfd-in2.h (bfd_mach_avr5): Define.
1755 * cpu-avr.c (arch_info_struct): Rename bfd_mach_avr4 to
1756 bfd_mach_avr5, add bfd_mach_avr4. Update comments.
1757 (compatible): Update comment. Add missing test.
1758 * elf32-avr.c (avr_final_link_relocate): Support 8K wrap
1759 for avr2 and avr4. Simplify 8K wrap code.
1760 (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr5.
1761 (elf32_avr_object_p): Recognize E_AVR_MACH_AVR5.
1765 * coff-h8300.c: Fix formatting.
1766 * cpu-h8300.c: Likewise.
1770 * elf32-arm.h (elf32_arm_final_link_relocate): Print `(local)'
1771 for local symbols whose names are unknown.
1775 * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we
1777 * Makefile.in: Regenerate.
1778 * doc/Makefile.in: Regenerate.
1782 * Makefile.am: Rebuild dependency.
1783 * Makefile.in: Rebuild.
1787 * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): New function.
1788 (elf_backend_copy_indirect_symbol): Map to the new function.
1792 * archive.c (normalize): Correct pointer comparison when checking
1794 (bfd_bsd_truncate_arname): Likewise.
1795 (bfd_gnu_truncate_arname): Likewise.
1799 * elf-bfd.h (struct elf_obj_tdata): Define per BFD Irix 5 virtual
1800 sections elf_{text,data}_{section,symbol}.
1801 * elf32-mips.c: mips_elf_{text,data}_{section,symbol}{,_ptr}: Remove.
1802 (_bfd_mips_elf_hide_symbol): New function.
1803 (elf_backend_hide_symbol): Map to the new function.
1804 (_bfd_mips_elf_add_symbol_hook): Change to use new per BFD
1805 definitions of mips_elf_{text,data}_{section,symbol}.
1806 (mips_elf_local_relocation_p): Try to find the direct symbol
1807 based on new check_forced argument.
1808 (mips_elf_calculate_relocation): Use new version of
1809 mips_elf_local_relocation_p.
1810 (mips_elf_relocate_section): Likewise.
1811 (_bfd_mips_elf_relocate_section): Likewise.
1812 (mips_elf_sort_hash_table): Only assert that have enough GOT
1814 (mips_elf_got16_entry): Match all 32 bits to the existing GOT
1815 entry if the relocation based on the new external argument.
1816 (mips_elf_create_dynamic_relocation): Assert that we have a
1817 section contents allocated where we can swap out the dynamic
1819 (mips_elf_calculate_relocation): Find the real hash-table entry
1820 correctly by using h->root.root.type. Only create a dynamic
1821 relocation entry if the symbol is defined in a shared library.
1822 Create an external GOT entry for the GOT16 relocation if the
1823 symbol was forced local.
1824 (_bfd_mips_elf_finish_dynamic_symbol): Don't assert there is a
1825 dynamic index if the symbol was forced local.
1829 * elf32-mips.c: Fix typos in comments.
1833 * rs6000-core.c: Wrap definition of `union VmInfo' within #ifdef
1838 * Makefile.in, bfd-in2.h, libbfd.h, configure: Rebuild.
1839 * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES, BFD32_BACKENDS,
1840 BFD32_BACKENDS_CFILES): Add 68hc12, 68hc11 files.
1841 * configure.in (bfd_elf32_m68hc12_vec): Recognize.
1842 (bfd_elf32_m68hc11_vec): Likewise.
1843 * config.bfd (targ_cpu): Recognize 68hc12 and 68hc11.
1844 Supports 68hc11 & 68hc12 at the same time.
1845 * targets.c (bfd_elf32_m68hc12_vec): Declare and put in
1847 (bfd_elf32_m68hc11_vec): Likewise.
1848 * elf.c (prep_headers): Recognize bfd_arch_m68hc12 and 68hc11.
1849 * archures.c (bfd_m68hc12_arch): Define and register in global list
1850 (bfd_m68hc11_arch): Likewise.
1851 * reloc.c (BFD_RELOC_M68HC11_HI8, BFD_RELOC_M68HC11_LO8,
1852 BFD_RELOC_M68HC11_3B): Define.
1853 * cpu-m68hc12.c, elf32-m68hc12.c: New files for 68hc12 support.
1854 * cpu-m68hc11.c, elf32-m68hc11.c: New files for 68hc11 support.
1858 * elf_bfd.h (struct elf_backend_data): Add info argument to
1859 elf_backend_hide_symbol.
1860 (_bfd_elf_link_hash_hide_symbol): Likewise.
1861 * elf.c (_bfd_elf_link_hash_hide_symbol): Likewise.
1862 * elf64-ia64.c (elf64_ia64_hash_hide_symbol): Likewise.
1863 * elflink.h (elf_link_add_object_symbols): Likewise.
1864 (elf_link_assign_sym_version): Likewise.
1868 * coff-i386.c (coff_i386_reloc): Don't return in case of
1869 output_bfd == (bfd *) NULL if COFF_WITH_PE is defined.
1870 Compensate PE relocations when linking with non-PE object
1871 files to generate a non-PE executable.
1875 * elf32-mips.c (mips_elf_calculate_relocation): Explicitly write
1876 GOT entries if we're doing a static link or -Bsymbolic link.
1880 * elflink.h (elf_link_adjust_relocs): Check for and call backend
1881 specifific swap_reloc_{in,out} and swap_reloca_{in,out} if
1883 (elf_link_output_relocs): Likewise.
1884 (elf_reloc_link_order): Likewise.
1888 * archures.c (enum bfd_architecture): #define constants for
1889 PowerPc and RS6000 machine numbers.
1890 * bfd-in2.h: Regenerate.
1891 * coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch
1892 to bfd_arch_powerpc instead of bfd_arch_rs6000. Refer to PowerPc
1893 and RS6000 machine numbers using #defined constants from
1895 * cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000
1896 machine numbers using #defined constants from archures.c. Add
1897 entries for EC603e, 630, A35, RS64II, RS64III, 7400. Specify
1898 64-bit words in 620 entry.
1899 * cpu-rs6000.c (arch_info_struct): Create with entries for RS1,
1901 (bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k).
1905 * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64.
1906 * libcoff-in.h (struct xcoff_tdata): Define xcoff64 field.
1907 * libcoff.h (struct xcoff_tdata): Define xcoff64 field.
1911 * bfd-in.h (bfd_family_coff): Define.
1912 * bfd-in2.h: Regenerate.
1913 * coffgen.c (coff_count_linenumbers, coff_symbol_from,
1914 coff_find_nearest_line): Check COFFness using bfd_family_coff()
1915 instead of bfd_target_coff_flavour.
1916 * cofflink.c (_bfd_coff_final_link): Likewise.
1917 * cpu-ns32k.c (do_ns32k_reloc): Don't strcmp() target name to
1918 exclude XCOFF files.
1919 * reloc.c (bfd_perform_relocation, bfd_install_relocation):
1921 * targets.c (enum bfd_flavour): Add bfd_target_xcoff_flavour.
1922 * xcoff-target.h (TARGET_SYM): Use bfd_target_xcoff_flavour.
1923 * xcofflink.c (XCOFF_XVECP): Delete.
1924 (bfd_xcoff_link_record_set, bfd_xcoff_import_symbol,
1925 bfd_xcoff_export_symbol, bfd_xcoff_link_count_reloc,
1926 bfd_xcoff_record_link_assignment,
1927 bfd_xcoff_size_dynamic_sections): Replace XCOFF_XVECP() with
1928 check for bfd_target_xcoff_flavour.
1932 * rs6000-core.c: Support 64-bit core files, support pre-4.3 core
1934 (read_hdr): New function.
1935 (rs6000coff_core_p): Store mstsave or __context64 struct instead
1936 of trying to extract individual registers. Set abfd->arch_info
1937 to match the architecture that created the core file.
1938 (rs6000coff_get_section_contents): Delete.
1939 * xcoff-target.h (rs6000coff_get_section_contents): Delete.
1943 * vms-misc.c (_bfd_vms_next_record): Return -1 if PRIV(vms_rec)
1948 * configure: Regenerate.
1952 * peicode.h (pe_ILF_object_p): Use TARGET_LITTLE_SYM instead of
1957 * configure.in (VERSION): Update to show this is the CVS mainline.
1961 * elf32-d10v.c: Include elf/d10v.h
1962 (enum reloc_type): Delete.
1963 * elf32-d30v.c: Include elf/d30v.h
1964 (enum reloc_type): Delete.
1966 * Makefile.am: Run "make dep-am" to regenerate dependencies.
1967 * Makefile.in: Regenerate.
1969 * elf32-i386.c (elf_howto_table): Remove EMPTY_HOWTOs.
1970 (elf32_i386_vtinherit_howto, elf32_i386_vtentry_howto): Delete and
1971 move HOWTOs into elf_howto_table.
1972 (R_386_standard, R_386_ext_offset): Define.
1973 (R_386_ext, R_386_vt_offset, R_386_vt): Define.
1974 (elf_i386_reloc_type_lookup): Modify calculation of index into
1975 elf_howto_table since we've removed the padding.
1976 (elf_i386_info_to_howto_rel): Likewise.
1977 (elf_i386_relocate_section): Likewise.
1981 * elf.c (elf_grok_pr_status): Eliminate reference to prgregset_t.
1985 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't flag
1986 an error when seeing an undefined symbol with hidden/internal
1987 attribute. It is handled in *_relocate_section ().
1991 * elflink.h (elf_fix_symbol_flags): Follow the link for the
1992 indirect symbol for the ELF_LINK_NON_ELF bit.
1993 (elf_link_output_extsym): Don't output the indirect symbol even
1994 if the ELF_LINK_NON_ELF bit is set.
1998 * config.bfd (i[3456]86-*-netbsdelf*): New target.
1999 (i[3456]86-*-netbsdaout*): New target.
2000 (i[3456]86-*-netbsd*): Add bfd_elf32_i386_vec to targ_selvecs.
2001 (i[3456]86-*-openbsd*): Likewise.
2005 * trad-core.c: From hpux-core.c, include <dirent.h> or
2006 <sys/ndir.h> when possible.
2010 * opintl.h (_(String)): Explain why dgettext is used instead
2015 * elf.c (_bfd_elf_slurp_version_tables): Correct reading of version
2016 definitions. We must not assume they are sorted in the file
2017 according to their index numbers.
2021 * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field
2022 selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and
2023 R_PARISC_DIR17F are for absolute branches; Handle them as such.
2027 * cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB,
2028 80960CA, 80960MC as valid machine names.
2032 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the
2033 visibility bits if the symbol is undefined. Correctly handle
2034 weak undefined symbols with hidden and internal attributes.
2036 * elflink.h (elf_link_add_object_symbols): Always turn the
2037 symbol into local if it has the hidden or internal attribute.
2041 * ppcboot.c: Add packed attribute if compiling with GCC.
2045 * elf.c (_bfd_elf_link_hash_table_init): Initialize dynlocal.
2049 * elf.c (elfcore_grok_prstatus, elfcore_grok_pstatus,
2050 elfcore_grok_psinfo): Add code to allow debugging a 32-bit
2051 corefile on a 64-bit (Sparc Solaris) host. Also clean up
2056 * Makefile.am: Update dependencies with "make dep-am"
2057 * Makefile.in: Regenerate.
2059 * sysdep.h (gettext, dgettext, dcgettext, textdomain,
2060 bindtextdomain): Replace defines with those from intl/libgettext.h
2061 to quieten gcc warnings.
2065 * aoutx.h (find_nearest_line): Use IS_ABSOLUTE_PATH.
2067 * archive.c (normalize, bfd_bsd_truncate_arname,
2068 bfd_gnu_truncate_arname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support
2069 file names with backslashes.
2071 * cache.c (bfd_open_file) [__MSDOS__]: Don't unlink the file
2074 * sysdep.h: Include filenames.h.
2078 * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777.
2082 * elf64-sparc.c (sparc64_elf_relax_section): New.
2083 (sparc64_elf_relocate_section): Optimize tail call into branch always
2085 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2086 (elf32_sparc_relax_section): New.
2090 * elf64-sparc.c: Add ATTRIBUTE_UNUSED to unused function parameters.
2091 Remove unusued variables.
2092 (sparc64_elf_relocate_section): Change r_symndx type to unsigned long.
2093 (sparc64_elf_merge_private_bfd_data): Fix shared library case from
2094 previous fix, so that shared libs really don't influence targets
2095 extension mask and memory model.
2099 * elf64-alpha.c (elf64_alpha_relocate_section): Check
2100 h->root.other not h->other.
2101 * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
2103 * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo.
2107 * elf32-i386.c (elf_i386_relocate_section): Don't allow the
2108 undefined symbol with the non-default visibility attributes.
2109 * elf-hppa.h (elf_hppa_relocate_section): Likewise.
2110 * elf32-arm.h (elf32_arm_relocate_section): Likewise.
2111 * elf32-i370.c (i370_elf_relocate_section): Likewise.
2112 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2113 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2114 * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
2115 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2116 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2117 * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
2118 * elf64-ia64.c (elf64_ia64_relocate_section): Likewise.
2119 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2123 * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI,
2124 PCREL22, PCREL64I. Zero size of special relocs.
2125 (elf64_ia64_reloc_type_lookup): Likewise.
2126 (USE_BRL, oor_brl, oor_ip): New.
2127 (elf64_ia64_relax_section): New.
2128 (elf64_ia64_check_relocs): Handle PCREL60B, PCREL22, PCREL64I.
2129 (elf64_ia64_install_value): Likewise, plus PCREL21BI.
2130 (elf64_ia64_relocate_section): Likewise.
2131 (bfd_elf64_bfd_relax_section): New.
2132 * reloc.c (BFD_RELOC_IA64_PCREL21BI): New.
2133 (BFD_RELOC_IA64_{PCREL22,PCREL60B,PCREL64I}): New.
2134 * bfd-in2.h, libbfd.h: Regenerate.
2138 * configure.in : Add peigen.lo to MIPS PE targets.
2139 * configure: Regenerate.
2143 * libbfd.c (_bfd_generic_verify_endian_match): Compare endianess
2144 only if it is known for both input and output bfds. Separate
2145 error message strings as in some languages, it may be necessary
2146 to change more than one place in the string to change between
2149 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Remove inline
2150 endianess checks, call _bfd_generic_verify_endian_match() instead.
2152 * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2154 * elf32-mcore.c (mcore_elf_merge_private_bfd_data): Likewise.
2156 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Likewise. Verify
2157 endianess before checking bfd flavours.
2161 * elflink.h (elf_link_output_extsym): Clear the visibility
2162 field for symbols not defined locally.
2166 * libhppa.h (re_assemble_3, re_assemble_12, re_assemble_16,
2167 re_assemble_17, re_assemble_21, re_assemble_22): Don't mask insn.
2168 (hppa_rebuild_insn): Mask immediate bits here instead.
2169 * elf-hppa.h (elf_hppa_relocate_insn): Mask here too.
2173 * elflink.h (elf_bfd_final_link, elf_link_input_bfd): When emiting
2174 relocs for an executable, ensure that they are virtual addresses.
2178 * config.bfd (hppa*64*-*-hpux11*): New target triplet.
2183 * elflink.h: Add emitrelocations support: when enabled, relocation
2184 information and relocation sections are put into final output
2185 executables. If the emitrelocations flag is set, do the following:
2186 (elf_bfd_final_link): Emit relocation sections.
2187 (elf_link_input_bfd): Compute relocation section contents.
2188 (elf_gc_sections): Don't clean relocation sections.
2192 * som.c (som_decode_symclass): Recognize weak symbols.
2196 * peigen.c (pe_print_idata): Undo part of 2000-05-12 change that
2197 read idata section only from dataoff.
2198 (pe_print_edata): Correctly check for valid eat_member.
2202 * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8.
2206 * config.bfd (armeb-*-elf, arm*b-*-linux-gnu*): New targets.
2210 * targets.c (bfd_target_vector): #ifdef BFD64 rs6000coff64_vec
2212 * peigen.c (pe_print_idata): Look for .idata section and print
2213 info even if data directory has zero entries. Read idata section
2214 starting from dataoff, and adjust all data offsets to suit. Cast
2215 all bfd_vma vars to unsigned long before passing to fprintf.
2216 * peigen.c (pe_print_edata): Similarly, look for .edata section
2217 and print info even if data directory has zero entries. Cast
2218 all bfd_vma vars to unsigned long before passing to fprintf.
2221 * peigen.c (pe_print_idata): Use bfd_section_size rather than data
2222 directory size which may be bogus.
2223 * peigen.c (pe_print_edata): Similarly.
2227 * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela
2229 (copy_private_bfd_data): Allow for space possibly taken up by elf
2230 headers when calculating segment physical address from lma.
2234 * versados.c (versados_scan): Init stringlen and pass_2_done.
2236 * trad-core.c (trad_unix_core_file_p): Return
2237 bfd_error_wrong_format rather than bfd_error_file_truncated.
2239 * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to
2240 add_data_entry. DataDirectory virtual address is relative.
2241 (pe_print_idata): Account for relative DataDirectory virtual
2242 addresses. Don't trash datasize inside POWERPC_LE_PE code.
2243 (pe_print_edata): Similarly.
2246 * peigen.c (dir_names): Add Delay Import Directory.
2247 (pe_print_idata): Always search for bfd section containing
2248 idata address rather than looking up section name. Print this
2249 section name rather than .idata.
2250 (pe_print_edata): Similarly. Also print some fields as %08lx.
2251 (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as
2256 * xcoff.h: Rename to xcoff-target.h
2257 * Makefile.am: Change all instances of xcoff.h to xcoff-target.h
2258 * coff-rs6000.c: Ditto.
2259 * coff64-rs6000.c: Ditto.
2260 * coff-pmac.c: Ditto.
2261 * Makefile.in: Regenerate.
2265 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags):
2266 Change U802TOC64MAGIC to U803XTOCMAGIC.
2270 * elf.c (bfd_elf_get_arch_size): New function, return 32 | 64 | -1.
2271 * bfd-in.h: Prototype bfd_elf_get_arch_size.
2272 * bfd-in2.h: Prototype bfd_elf_get_arch_size.
2276 * libhppa.h (HPPA_R_CONSTANT): Cast argument to bfd_signed_vma.
2280 * elflink.h (elf_link_add_object_symbols): Reset dynindx for
2281 hidden and internal symbols.
2282 (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with
2284 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not
2285 assign a PLT or GOT entry to symbols with hidden and
2286 internal visibility.
2290 * bfd/coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for
2292 * bfd/coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
2296 * elf.c (prep_headers): Use ELFOSABI_NONE instead of
2301 * targets.c (bfd_target_vector): Restore bfd_elf32_hppa_vec.
2302 * Makefile.am (BFD32_BACKENDS): Restore elf32-hppa.lo. Regenerate
2304 * Makefile.in: Regenerate.
2308 * Makefile.am (BFD32_BACKENDS): Add efi-app-ia32.lo.
2309 (BFD32_BACKENDS_CFILES): Add efi-app-ia32.c.
2310 (BFD64_BACKENDS): Delete coff-ia64.lo. Add efi-app-ia64.lo.
2311 (BFD64_BACKENDS_CFILES): Delete coff-ia64.c. Add efi-app-ia64.c.
2312 * Makefile.in: Rebuild.
2316 * config.bfd: Re-enable elf32-hppa. It now compiles, even if it
2317 doesn't work very well.
2319 * elf-hppa.h (elf_hppa_internal_shdr): Define.
2320 (elf_hppa_fake_sections): hdr is elf_hppa_internal_shdr.
2321 Set hdr->s_type to 1 if ARCH_SIZE == 32.
2322 (_bfd_elf_hppa_gen_reloc_type): Add prototype.
2323 (elf_hppa_info_to_howto): Likewise.
2324 (elf_hppa_info_to_howto_rel): Likewise.
2325 (elf_hppa_reloc_type_lookup): Likewise.
2326 (elf_hppa_is_local_label_name): Likewise.
2327 (elf_hppa_fake_sections): Likewise.
2328 (elf_hppa_final_write_processing): Likewise.
2329 (elf_hppa_howto_table): Fully initialise all entries.
2330 (_bfd_elf_hppa_gen_reloc_type): Add ATTRIBUTE_UNUSED to args.
2331 (elf_hppa_info_to_howto): Likewise.
2332 (elf_hppa_info_to_howto_rel): Likewise.
2333 (elf_hppa_reloc_type_lookup): Likewise.
2334 (elf_hppa_final_write_processing, elf_hppa_add_symbol_hook,
2335 elf_hppa_unmark_useless_dynamic_symbols,
2336 elf_hppa_remark_useless_dynamic_symbols,
2337 elf_hppa_record_segment_addrs, elf_hppa_final_link,
2338 elf_hppa_relocate_section, elf_hppa_final_link_relocate,
2339 elf_hppa_relocate_insn): Compile only if ARCH_SIZE == 64 until
2340 elf32-hppa.c mess is cleaned up.
2341 (elf_hppa_final_link_relocate): Make insn and r_type unsigned
2342 int. Delete r_field. In case R_PARISC_PCREL21L, don't set
2343 r_field then call hppa_field_adjust inline func with variable
2344 r_field arg, instead call hppa_field_adjust with fixed arg.
2345 In case R_PARISC_PCREL22F, don't set r_field.
2346 (elf_hppa_relocate_insn): Change args and return type to unsigned
2347 int. Call re_assemble_* funcs to do the work.
2349 * elf32-hppa.c (hppa_elf_relocate_insn): Don't assume 32 bit when
2352 * libhppa.h (HPPA_R_CONSTANT): Don't assume 32 bit when sign
2354 (sign_extend): Mask first before sign extending.
2355 (low_sign_extend): Rewrite without condition expression.
2356 (ones, dis_assemble_3, dis_assemble_12, dis_assemble_16,
2357 dis_assemble_17, dis_assemble_21, dis_assemble_22): Delete.
2358 (assemble_3, assemble_6, assemble_12, assemble_16, assemble_16a,
2359 assemble_17, assemble_21, sign_unext, low_sign_unext): Return
2360 result as function return value rather than through pointer arg.
2361 Accept unsigned int args, and return unsigned int.
2362 (re_assemble_3): New. Combines function of dis_assemble_3 with
2363 re-assembly of opcode and immediate.
2364 (re_assemble_12): Likewise.
2365 (re_assemble_16): Likewise.
2366 (re_assemble_17): Likewise.
2367 (re_assemble_21): Likewise.
2368 (re_assemble_22): Likewise.
2369 (hppa_field_adjust): Rewrite and document, paying attention to
2370 size of types and signed/unsigned issues.
2371 (get_opcode): Shift before masking.
2372 (FDLW): Rename to FLDW.
2373 (bfd_hppa_insn2fmt): Change arg to unsigned int. Delete fmt.
2374 (hppa_rebuild_insn): Change args and return value to unsigned
2375 int. Make use of re_assemble_*. Correct case 11.
2377 * dep-in.sed: Handle ../opcodes/.
2378 * Makefile.am (SOURCE_HFILES): Add elf-hppa.h, elf32-hppa.h,
2379 elf64-hppa.h, hppa_stubs.h, xcoff.h.
2380 (BFD32_BACKENDS_CFILES): Restore elf32-hppa.c.
2381 Remove elf64-hppa.lo, cpu-ia64.lo, elf64-ia64.lo, elfarm-oabi.lo,
2382 elfarm-nabi.lo dependencies outside of auto-dependency area.
2383 Regenerate dependencies.
2384 * Makefile.in: Regenerate.
2386 * configure.in (TRAD_HEADER): Test non-null before
2388 * configure: Regenerate.
2390 * reloc.c: Fix mis-spelling in comment.
2394 * coff-sh.c (bfd_coff_small_swap_table): Fix Fri Apr 28 change.
2395 * vms.c (vms_openr_next_archived_file): Return NULL.
2399 * coffcode.h Copy changes mistakenly done to libcoff.h in
2404 * libbfd-in.h: Correctly check GCC version.
2405 * bfd-in.h: Likewise.
2406 * libhppa.h: Likewise.
2407 * libbfd.h: Regenerate.
2408 * bfd-in2.h: Regenerate.
2412 * Makefile.am (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): Add
2413 coffdu-rs6000.{lo,c}.
2414 (coff-pmac.lo, coff-rs6000.lo, coff64-rs6000.lo): Add dependency
2416 * Makefile.in: Regenerate.
2417 * xcoff.h: New file.
2418 * coff-pmac.c: Use xcoff.h instead of coff-rs6000.c.
2419 * coff-rs6000.c: Move all declarations and defines that are
2420 common to the xcoff backends into xcoff.h
2421 * coff64-rs6000.c: Ditto,
2425 * coff-mips.c (mips_ecoff_backend_data): Add initialization of
2426 _bfd_coff_force_symnames in strings and
2427 _bfd_coff_debug_string_prefix_length to their default values.
2428 * coff-sh.c: (bfd_coff_small_swap_table): Ditto.
2432 * coff-alpha.c (alpha_ecoff_backend_data): Add initialization of
2433 _bfd_coff_force_symnames in strings and
2434 _bfd_coff_debug_string_prefix_length to their default values.
2438 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return if dynobj NULL.
2439 Check local_got_refcounts before dereferencing.
2441 * elf32-ppc.c (ppc_elf_relocate_section): Check splt != NULL
2442 before deciding we don't need R_PPC_PLT32 relocation.
2443 (ppc_elf_gc_sweep_hook): Check local_got_refcounts before
2446 * elflink.h (elf_gc_common_finalize_got_offsets): Fix comment.
2448 * elf32-i386.c (elf_i386_check_relocs): Reference count .got and
2450 (elf_i386_gc_sweep_hook): Garbage collect .got and .plt entries.
2451 (elf_i386_adjust_dynamic_symbol): Recognize unused .plt entries.
2452 (elf_i386_relocate_section): Allow for .plt to go missing.
2453 (elf_i386_finish_dynamic_symbol): Use same test to decide if we
2454 can use a relative reloc for got as elf_i386_relocate_section.
2455 (bfd_elf32_bfd_final_link): Define to use gc form of final link.
2459 * config.bfd: Remove extraneous bfd_powerpc_64_arch.
2463 * Makefile.am (coff64-rs6000.lo): New rule.
2464 * Makefile.in: Regenerate.
2465 * coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data,
2466 xcoff_is_local_label_name, xcoff_rtype2howto,
2467 xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p,
2468 xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap,
2469 xcoff_write_archive_contents): No longer static, and prefix with _bfd_.
2470 (NO_COFF_SYMBOLS): Define.
2471 (xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in,
2472 xcoff64_swap_aux_out): New functions; handle xcoff symbol tables
2474 (MINUS_ONE): New macro.
2475 (xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS
2477 (coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in,
2478 coff_SWAP_aux_out): Map to the new functions.
2479 * coff64-rs6000.c: New file.
2480 * libcoff.h (bfd_coff_backend_data): Add new fields
2481 _bfd_coff_force_symnames_in_strings and
2482 _bfd_coff_debug_string_prefix_length.
2483 (bfd_coff_force_symnames_in_strings,
2484 bfd_coff_debug_string_prefix_length): New macros for above fields.
2485 * coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic.
2486 Set machine to 620 for XCOFF64. Use bfd_coff_swap_sym_in instead
2487 of using coff_swap_sym_in directly.
2488 (FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64.
2489 (coff_set_flags) Set magic for XCOFF64.
2490 (coff_compute_section_file_positions): Add symbol name length to
2491 string section length if bfd_coff_debug_string_prefix_length is
2493 (coff_write_object_contents): Don't do reloc overflow for XCOFF64.
2494 (coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of
2495 using coff_swap_lineno_in directly.
2496 (bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings
2497 and _bfd_coff_debug_string_prefix_length fields.
2498 * coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force
2499 symbol names into strings table when
2500 bfd_coff_force_symnames_in_strings is true.
2501 * coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR,
2502 SET_RELOC_VADDR): New macros.
2503 (coff_swap_reloc_in, coff_swap_reloc_out): Use above macros.
2504 (coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C
2506 (coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64
2507 changes within RS6000COFF_C specific code.
2508 (coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC,
2509 MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO.
2510 * reloc.c (bfd_perform_relocation, bfd_install_relocation):
2511 Extend existing hack on target name.
2512 * xcofflink.c (XCOFF_XVECP): Extend existing hack on
2514 * coff-tic54x.c (ticof): Keep up to date with new fields
2515 in bfd_coff_backend_data.
2516 * config.bfd: Add bfd_powerpc_64_arch to targ_arch and define
2517 targ_selvecs to include rs6000coff64_vec for rs6000.
2518 * configure.in: Add rs6000coff64_vec case.
2519 * cpu-powerpc.c: New bfd_arch_info_type.
2523 * config.bfd: Only disable elf32-hppa vectors, not all of the
2524 BSD and OSF configuration support. Provide (disabled) clauses
2526 * configure.in: Add clause for PA64 support.
2527 * configure: Rebuilt.
2529 * targets.c (bfd_target_vector): Add bfd_elf64_hppa_vec.
2530 (bfd_elf64_hppa_vec): Declare.
2532 * Makefile.am (BFD64_BACKENDS): Add elf64-hppa.lo
2533 (BFD64_BACKENDS_CFILES): Add elf64-hppa.c
2534 (elf64-hppa.lo): Add dependencies.
2535 * Makefile.in: Rebuilt.
2537 * elf64-hppa.c, elf64-hppa.h: New files with PA64 support.
2541 * libhppa.h (dis_assemble_16): New function.
2542 (pa_arch): Added pa20w element.
2546 * elf-bfd.h: Add prototypes for bfd_elf32_write_relocs,
2547 bfd_elf32_slurp_reloc_table, bfd_elf64_write_relocs, and
2548 bfd_elf64_slurp_reloc_table.
2550 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): New
2551 definitions to get external names.
2552 (elf_write_relocs): Renamed from write_relocs and make global.
2553 (elf_slurp_reloc_table): Make global.
2554 (_bfd_elf,size_info): Use elf_write_relocs instead of write_relocs.
2556 * archive.c (hpux_uid_gid_encode): New function.
2557 (bfd_ar_hdr_from_filesystem): Use it if HPUX_LARGE_AR_IDS is
2558 defined and the ID is greater than 99999.
2559 (bfd_generic_stat_arch_elt): If HPUX_LARGE_AR_IDS is defined decode
2560 special uid/gid fields into 32 bit values.
2564 * config.bfd: Add NetBSD/sparc64 support.
2571 * Makefile.am (ALL_MACHINES): Add cpu-ia64.lo.
2572 (ALL_MACHINES_CFILES): Add cpu-ia64.c.
2573 (BFD64_BACKENDS): Add elf64-ia64.lo.
2574 (BFD64_BACKENDS_CFILES): Add elf64-ia64.c.
2575 (cpu-ia64.lo, elf64-ia64.lo): New rules.
2576 * Makefile.in: Rebuild.
2577 * archures.c (enum bfd_architecture): Add bfd_arch_ia64.
2578 (bfd_ia64_arch): Declare.
2579 (bfd_archures_list): Add bfd_ia64_arch.
2580 * bfd-in2.h: Rebuild.
2581 * config.bfd: (ia64*-*-linux-gnu*, ia64*-*-elf*): New targets.
2582 * configure: Rebuild.
2583 * configure.host: (ia64-*-linux*): New host.
2584 * configure.in (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec,
2585 bfd_efi_app_ia64_vec, bfd_efi_app_ia64_vec): New vectors.
2586 * elf.c (prep_headers): Add bfd_arch_ia64.
2587 * libbfd.h: Rebuild.
2588 * reloc.c: Add IA-64 relocations.
2589 * targets.c (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_big_vec):
2591 (bfd_target_vect): Add bfd_elf64_ia64_little_vec.
2592 * cpu-ia64-opc.c, cpu-ia64.c, elf64-ia64.c: New files.
2596 * elf32-d30v.c (bfd_elf_d30v_reloc): Don't modify section
2597 contents when performing a partial link.
2598 (bfd_elf_d30v_reloc_21): Likewise.
2602 * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10
2603 patch to symbols defined by a shared object.
2604 * elf32-ppc.c (ppc_elf_relocate_section): Similarly.
2609 * dwarf2.c (concat_filename): Avoid string literal concatenation.
2610 * ieee.c (ieee_get_symtab): Don't initialise union in struct.
2614 * Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo.
2615 (BFD64_BACKENDS_CFILES): Mention coff-ia64.c
2616 (coff-ia64.lo): Add dependency.
2617 * Makefile.in: Regenerate.
2618 * coff-ia64.c: New file.
2619 * efi-app-ia32.c: Ditto.
2620 * efi-app-ia64.c: Ditto.
2621 * coffcode.h (coff_set_arch_mach_hook): Handle IA64MAGIC.
2622 (coff_set_flags): Ditto.
2623 (coff_write_object_contents) [IA64]: Set magic number to ZMAGIC.
2624 * config.bfd (i[3456]86-*-linux-gnu*): Mention bfd_efi_app_ia32_vec.
2625 * configure.in (elf): Handle bfd_efi_app_ia32 and bfd_efi_app_ia64_vec.
2626 * configure: Regenerate.
2627 * libpei.h (GET_OPTHDR_IMAGE_BASE): New macro.
2628 (PUT_OPTHDR_IMAGE_BASE): Ditto.
2629 (GET_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto.
2630 (PUT_OPTHDR_SIZE_OF_STACK_RESERVE): Ditto.
2631 (GET_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto.
2632 (PUT_OPTHDR_SIZE_OF_STACK_COMMIT): Ditto.
2633 (GET_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto.
2634 (PUT_OPTHDR_SIZE_OF_HEAP_RESERVE): Ditto.
2635 (GET_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto.
2636 (PUT_OPTHDR_SIZE_OF_HEAP_COMMIT): Ditto.
2637 (GET_PDATA_ENTRY): Ditto.
2638 * peigen.c (_bfd_pei_swap_aouthdr_in) [COFF_WITH_PEP64]: Don't read
2639 data_start. Use above macros to read fields that are 64 bit wide for
2640 COFF_WITH_PEP64. Don't truncate entry and text_start to 32 bits.
2641 (_bfd_pei_swap_aouthdr_out) [PEI_FORCE_MINIMUM_ALIGNMENT]: Force
2642 FileAlignment and SectionAlignment to minimum alignment if they
2644 (_bfd_pei_swap_aouthdr_out) [PEI_DEFAULT_TARGET_SUBSYSTEM]: Set
2645 Subsystem to default PEI_DEFAULT_TARGET_SUBSYSTEM.
2646 (_bfd_pei_swap_aouthdr_out) [COFF_WITH_PEP64]: Don't set data_start.
2647 Use above macros to write fields that are 64 bit wide for
2649 (pe_print_pdata): Set PDATA_ROW_SIZE to 3*8 for COFF_WITH_PEP64,
2650 5*4 otherwise. This should be right for IA-32 and IA-64, but may
2651 be wrong for platforms. Use PDATA_ROW_SIZE instead of hardcoded
2652 value of 20 bytes. Modify printing for COFF_WITH_PEP64 to print
2653 begin address, end address, and unwind info address only. Use
2654 GET_PDATA_ENTRY() to read .pdata entries. Use fprintf_vma() to
2656 (tbl): Add SECTION, REL32, RESERVED1, MIPS_JMPADDR16, DIR64, and
2657 HIGH3ADJ relocation names.
2658 (_bfd_pe_print_private_bfd_data): Print Subsystem name in legible form.
2659 * targets.c: Declare bfd_efi_app_ia32_vec and
2660 bfd_efi_app_ia64_vec.
2661 (bfd_target_vector): Mention bfd_efi_app_ia32_vec and
2662 bfd_efi_app_ia64_vec.
2666 * bfd-in2.h: Add prototypes for tic54x load page access.
2667 * bfd-in.h: Regenerate.
2668 * coff-tic54x.c: Add load page functions; allow bfd_arch_unknown
2669 in customized _set_arch_mach function.
2670 * coffcode.h (coff_set_alignment_hook): Set section load page if
2671 the appropriate macro is defined.
2672 (write_object_contents): Read section load page.
2676 * elf32-hppa.h: Update copyright date.
2678 * elf32-fr30.c (fr30_elf_i20_reloc): Don't use U suffix.
2679 * elf32-mips.c (_bfd_mips_elf_relocate_section): And here.
2681 * elf32-d30v.c (MAX32): Don't use LL suffix.
2682 (MIN32): Define in terms of MAX32.
2683 (bfd_elf_d30v_reloc): Make relocation a bfd_signed_vma.
2685 * coff-a29k.c (SIGN_EXTEND_HWORD): Replace with more concise
2688 * peicode.h (pe_ILF_build_a_bfd): Remove UL from hex constants.
2692 * dep-in.sed: Match space before file name, not after.
2693 * Makefile.am: Regenerate dependencies.
2694 * Makefile.in: Regenerate.
2696 * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield
2697 case, allow address wrap-around stupidly removed 2000-03-17. Sign
2698 extend without an if statement.
2702 * coff-mips.c (mips_gprel_reloc): Test for 16 bit range using
2704 * elf32-mips.c (gprel16_with_gp): Likewise.
2705 * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Test range
2706 here using -0x40000, not (int)0xfffc0000.
2707 (elf32_hppa_size_of_stub): Likewise.
2711 * coff-tic54x.c: Now builds with all targets.
2712 * Makefile.am: Add coff/tic54x.h to coff-tic54x.o dependencies.
2713 * Makefile.in: Regenerate.
2714 * coffcode.h (coff_set_arch_mach_hook): Eliminate warning on
2715 unitialized variable.
2719 * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add
2720 --enable-build-warnings option.
2721 * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions.
2722 * Makefile.in, configure: Re-generate.
2726 * reloc.c: Add BFD_RELOC_ARM_PCREL_BLX and
2727 BFD_RELOC_THUMB_PCREL_BLX.
2729 * elf32-arm.h (elf32_arm_final_link_relocate): Handle
2730 R_ARM_XPC25 and R_ARM_THM_PC22.
2732 * elfarm-nabi.c (elf32_arm_howto_): Fix definitions of
2733 R_ARM_XPC25 and R_ARM_THM_XPC22.
2734 (elf32_arm_reloc_map): Make BFD_RELOC_{ARM|THUMB}_PCREL_BLX to
2735 R_ARM_[XPC25|THM_XPC22].
2737 * elfarm-oabi.c: Define OLD_ARM_ABI and change include from
2738 elf/arm-oabi.h to elf/arm.h
2740 * Makefile.am: Fix dependency for elfarm-oabi.c
2741 * Makefile.in: Regenerate.
2743 * bfd-in2.h: Regenerate.
2744 * libbfd.h: Regenerate.
2748 * elfcore.h (elf_core_file_p): preserve value of tdata at entry,
2749 and restore it on failure. Release newly allocated tdata on
2754 * dwarf2.c (struct dwarf2_debug): New field dwarf_line_size.
2755 (decode_line_info): Set it. Report error if unit->line_offset is
2756 equal to or larger than it.
2760 * targets.c: Added vecs for tic54x.
2761 * reloc.c: Added relocs for tic54x.
2762 * libbfd.h: Regenerated.
2763 * configure: Add TI COFF vecs for tic54x.
2764 * configure.in: Ditto.
2765 * config.bfd (targ_cpu): Recognize new tic54x target.
2766 * coffcode.h (coff_slurp_symbol_table): Additions for TI COFF handling.
2767 * bfd-in2.h: Add tic54x target and relocations.
2768 * Makefile.am, Makefile.in: Add tic54x target.
2769 * archures.c (bfd_archures_list): Add tic54x target.
2770 * coff-tic54x.c: New.
2771 * cpu-tic54x.c: New.
2775 * elfcore.h (elf_core_file_p): call backend_object_p which
2776 thereby gets an opportunity to update the arch/machine type.
2780 * coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage
2781 class. Handle SEC_CLINK and SEC_BLOCK flags.
2782 * section.c: Add SEC_CLINK and SEC_BLOCK flags.
2783 * bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags.
2787 * elf32-arm.h (elf32_arm_set_private_flags): Only check for
2788 EF_INTERWORK if this is an unknown EABI.
2789 (elf32_arm_merge_private_bfd_data): Check EABI version
2790 numbers. Only check EF_xxx flags if the EABI version number
2792 (elf32_arm_check_private_bfd_data): Only check EF_xxx flags
2793 if the EABI version number is unknown.
2794 (elf32_arm_print_private_bfd_data): Only decode EF_xxx flags
2795 if the EABI version number is unknown.
2799 * reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and
2800 BFD_RELOC_SH_LOOP_END.
2801 * elf32-sh.c (sh_elf_howto_tab): Change special_func to
2802 sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore.
2803 Add entries for R_SH_LOOP_START and R_SH_LOOP_END.
2804 (sh_elf_reloc_loop): New function.
2805 (sh_elf_reloc): No need to test for always-to-be-ignored relocs
2807 (sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}.
2808 (sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}.
2809 * bfd-in2.h, libbfd.h: Regenerate.
2813 * po/bfd.pot: Regenerate.
2815 * Makefile.am: Remove extraneous mkdep comment.
2816 (MKDEP): Use gcc -MM rather than mkdep.
2817 (DEP): Quote when passing vars to sub-make. Add warning
2819 (DEP1): Rewrite for "gcc -MM".
2820 (CLEANFILES): Add DEP2.
2821 Update dependencies.
2822 * Makefile.in: Regenerate.
2826 * configure.in: Added corefile support for AIX 4.3. In particular,
2827 AIX_CORE_DUMPX_CORE will be defined in addition to AIX_CORE when
2828 compiling rs6000-core.c.
2829 * configure: Regenerated.
2833 * cache.c (bfd_open_file): Unlink the output file only if
2834 it has non-zero size.
2838 * elf64-alpha.c (elf64_alpha_relocate_section): Don't emit
2839 relative relocations for non-loaded sections in shared objects.
2840 (elf64_alpha_check_relocs): Similarly.
2844 * aoutx.h (NAME(aout,reloc_type_lookup)): Add BFD_RELOC_8 and
2845 BFD_RELOC_16 to switch for extended relocs.
2846 (MY_swap_ext_reloc_in): New.
2847 (MY_swap_ext_reloc_out): New.
2848 (NAME(aout,slurp_reloc_table)): Use MY_swap_ext_reloc_in rather
2849 than NAME(aout,swap_ext_reloc_in) for extended relocs.
2850 (NAME(aout,squirt_out_relocs)): Similarly use
2851 MY_swap_ext_reloc_out.
2852 (aout_link_reloc_link_order): Use MY_put_ext_reloc if defined.
2856 * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to
2857 the R_PCRWORD_B case.
2861 * srec.c : Set CHUNK size to 16 bytes to prevent download failures
2867 * elf32-m32r.c (m32r_elf_generic_reloc): new function. All
2868 HOWTO references to bfd_elf_generic_reloc, that have
2869 partial_inplace == true, now use the new function. The function
2870 is based on the recent rewrite of m32r_elf_lo16_reloc(), and
2871 extends its fixes to the R_M32R_{16,24,32} relocs.
2872 The new logic in m32r_elf_lo16_reloc() has been removed, and
2873 it instead calls the new routine to obtain that functionality.
2877 * elf32-avr.c (elf32_avr_gc_mark_hook, elf32_avr_gc_sweep_hook,
2878 elf32_avr_check_relocs, avr_final_link_relocate,
2879 elf32_avr_relocate_section, bfd_elf_avr_final_write_processing,
2880 elf32_avr_object_p): Add prototypes.
2881 (elf32_avr_gc_mark_hook): Add default for h->root.type.
2882 (bfd_elf_avr_final_write_processing): Make static.
2886 * cpu-avr.c: New file. BFD support routines for AVR architecture.
2887 * archures.c (bfd_architecture): Add AVR architecture.
2888 (bfd_archures_list): Add reference to AVR architecture info.
2889 * elf.c (prep_headers): Handle bfd_arch_avr.
2890 * reloc.c: Add various AVR relocation enums.
2891 * targets.c (bfd_elf32_avr_vec): Declare and add to target vector
2893 * Makefile.am: Add support for AVR elf.
2894 * configure.in: Likewise.
2895 * config.bfd: Likewise.
2896 * Makefile.in: Regenerate.
2897 * configure: This too.
2898 * bfd-in2.h: And this.
2899 * libbfd.h: And this.
2903 * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype.
2904 (elf64_alpha_find_reloc_at_ofs): Likewise.
2908 * reloc.c (bfd_check_overflow): In case complain_overflow_bitfield,
2909 flag an overflow if the bitfield is outside -2**n to 2**n-1. The
2910 allowable range used to be -2**(n-1) to 2**n-1.
2911 * reloc.c (_bfd_relocate_contents): Same here. Also replace
2912 "boolean overflow" with "bfd_reloc_status_type flag".
2916 * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite.
2920 * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number
2921 of shrinks properly, including the last reloc.
2925 * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity
2930 * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on
2931 a format mismatch rather than an "error" from bfd_read such as
2932 bfd_error_file_truncated.
2936 * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper
2937 sign-extension and big-endian compensation for
2938 R_MIPS_64 even in ld -r.
2942 * elf32-mips.c (mips_elf_next_relocation): Rename from
2943 mips_elf_next_lo16_relocation, and generalize to look
2944 for any relocation type.
2945 (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset.
2946 (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16.
2947 (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16.
2948 (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2.
2949 (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64.
2950 (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32.
2951 (bfd_elf32_bfd_reloc_type_lookup): Add new relocs.
2952 (mips_rtype_to_howto): Likewise.
2953 (mips_elf_calculate_relocation): Handle new relocs.
2954 (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs
2955 are paired. The addend for R_MIPS_GNU_REL16_S2
2956 is shifted right two bits.
2960 * reloc.c (bfd_perform_relocation): Undo emacs formatting of
2961 comment, and ensure it doesn't happen again.
2962 (bfd_install_relocation): Same here.
2963 (_bfd_relocate_contents): Don't bother assigning unused signmask
2964 shift result. Fix typos in comments.
2965 Remove trailing whitespace throughout file.
2969 * reloc.c (reloc_howto_struct): Fix partial_inplace comment.
2970 * bfd-in2.h: Rebuild.
2974 * peicode.h (struct pe_ILF_vars): Add sym_ptr_table and
2976 (SIZEOF_ILF_SYM_PTR_TABLE): Define.
2977 (SIZEOF_ILF_STRINGS): Redefine.
2978 (pe_ILF_make_a_symbol-reloc): New function. Creates a symbol
2979 relative reloc, as opposed to a section relative reloc.
2980 (pe_ILF_make_a_symbol): Set the class of local symbols to C_STAT
2982 Add length of symbol's prefix to string pointer.
2983 Store a pointer to the symbol in the symbol pointer table.
2984 (pe_ILF_build_a_bfd): Do not build .idata$2 or .idata$7.
2985 Initialise the symbol pointer table.
2986 Store the hint in the Hint/Name table.
2987 Make the jump reloc be symbol realtive, not section relative.
2988 Create an import symbol for imported code.
2992 * elf.c (swap_out_syms): Check for null type_ptr.
2996 * aout-target.h (MY(write_object_contents)): Remove unused
2997 and unusable "#if CHOOSE_RELOC_SIZE".
2998 * pc532-mach.c (MY(write_object_contents)): Ditto.
2999 * netbsd.h (MY(write_object_contents)): Ditto.
3000 * hp300hpux.c (MY(write_object_contents)): Ditto.
3001 * freebsd.h (MY(write_object_contents)): Ditto.
3002 * aout-tic30.c (tic30_aout_write_object_contents): Ditto.
3006 * peicode.h (jtab): Make it static.
3008 * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is
3009 defined and COFF_IMAGE_WITH_PE is not defined.
3010 (_bfd_sh_align_load_span): Defined as sh_align_load_span if
3011 COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined.
3015 * coff-arm.c (bfd_arm_process_before_allocation): Make
3016 'symndx' signed to prevent compile time warning.
3018 * coff-mcore.c: Remove unused prototype for pe_object_p.
3020 * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static
3021 functions that are not used when COFF_IMAGE_WITH_PE is
3023 (struct sh_opcode): Change type of 'flags' field to unsigned
3024 long so that it can hold the USESAS flag.
3026 * coffcode.h (styp_to_sec_flags): Initialise 'target_name'.
3028 * elf-m10300.c (mn10300_elf_relax_section): Initialise
3031 * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function
3033 Remove unusued variables and code.
3034 (elf_backend_add_symbol_hook): Fix prototype.
3036 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and
3039 * elf32-mcore.c (mcore_elf_relocate_section): Initialise
3042 * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function
3044 Remove unusued variables and code.
3045 (elf_backend_add_symbol_hook): Fix prototype.
3047 * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'.
3049 * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED
3050 to unused function parameter.
3052 * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function
3054 Use EMPTY_HOWTO to initialise empty howto slots.
3055 Remove unused variables.
3057 * peicode.h (pe_ILF_build_a_bfd): Initialise id6.
3061 * aoutx.h (aout_link_input_section_std): Pass "true" to
3062 the undefined_symbol callback.
3063 (aout_link_input_section_ext): Likewise.
3064 * bout.c (get_value): Likewise.
3065 * coff-a29k.c (coff_a29k_relocate_section): Likewise.
3066 * coff-alpha.c (alpha_ecoff_get_relocated_section_conten):
3068 (alpha_relocate_section): Likewise.
3069 * coff-arm.c (coff_arm_relocate_section): Likewise.
3070 * coff-i960.c (coff_i960_relocate_section): Likewise.
3071 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
3072 * coff-mips.c (mips_relocate_section): Likewise.
3073 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
3074 * coff-sh.c (sh_relocate_section): Likewise.
3075 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
3076 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
3077 * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
3078 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
3079 * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
3080 * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
3081 * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
3082 * elf32-i370.c (i370_elf_relocate_section): Likewise.
3083 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
3084 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
3085 * elf32-sh.c (sh_elf_relocate_section): Likewise.
3086 * elf32-v850.c (v850_elf_relocate_section): Likewise.
3087 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
3088 * elflink.h (elf_link_output_extsym): Likewise.
3089 * pe-mips.c (coff_pe_mips_relocate_section): Likewise.
3090 * reloc.c (bfd_generic_get_relocated_section_conten): Likewise.
3091 * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise.
3093 * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the
3094 undefined_symbol callback when building shared library with
3095 -Bsymbolic and undefined symbols are allowed. Otherwise, pass
3097 * elf32-arm.h (elf32_arm_relocate_section): Likewise.
3098 * elf32-i386.c (elf_i386_relocate_section): Likewise.
3099 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
3100 * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
3101 (elf32_mips_get_relocated_section_content): Likewise.
3102 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
3103 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
3104 * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
3105 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
3109 * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects.
3110 * Makefile.in: Regenerate.
3112 * configure.in: Add support for mips and sh pe vectors.
3113 * configure: regenerate.
3115 * config.bfd: Add support for arm-wince, mips-pe and sh-pe
3118 * targets.c: Add mips and sh pe vectors.
3120 * libpei.h (coff_final_link_postscript): Only define if not
3123 * coffcode.h: Add support for WinCE magic numbers.
3125 * peigen.c (pe_print_reloc): Update comment and rearrange
3126 appending of newline character.
3128 * peicode.h: Add support for Image Library Format.
3129 (pe_ILF_vars): Structure containing data used by ILF code.
3130 (pe_ILF_make_a_section): New function. Create a section based
3132 (pe_ILF_make_a_reloc): New function. Create a reloc based on
3134 (pe_ILF_make_a_symbol): New function. Create a symbol based
3136 (pe_ILF_save_relocs): New function. Store the relocs created
3137 by pe_ILF_make_a_reloc in a section.
3138 (pe_ILF_build_a_bfd): New function. Create a BFD describing
3140 (pe_ILF_object_p): New function. Return a bfd_target pointer
3142 (pe_bfd_object_p): If an ILF object is detected call
3143 pe_ILF_object_p on it.
3145 * coff-arm.c: Add support for WinCE relocs which are different
3146 from normal ARM COFF relocs.
3147 * pe-arm.c: Unset TARGET_UNDERSCORE for a WinCE target.
3149 * coff-sh.c: Add support for sh-pe target.
3150 * pe-sh.c: New file. Support code for sh-pe target.
3151 * pei-sh.c: New file. Support code for sh-pe target.
3153 * pe-mips.c: New file. Support code for mips-pe target.
3154 * pei-mips.c: New file. Support code for mips-pe target.
3158 * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump
3159 architecture if the object causing the bump is dynamic.
3160 * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise,
3161 and also don't it for memory ordering.
3162 (sparc64_elf_write_relocs): Take src_rela out of the loop.
3166 * dwarf2.c (read_abbrevs): Use _raw_size directly rather than
3167 calling bfd_get_section_size_before_reloc.
3168 (decode_line_info): Likewise.
3169 (_bfd_dwarf2_find_nearest_line): Likewise.
3173 * Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the
3174 name of the libtool directory.
3175 * Makefile.in: Rebuild.
3179 * som.c (SOM_HOWTO): Define.
3180 (som_hppa_howto_table): Use it.
3184 * config.bfd: Enable 64 bit support for GNU/Linux/sparc.
3186 * config.bfd: Enable 64 bit support for Solaris7+/sparc.
3190 * som.c (som_misc_symbol_info): Add field
3192 (som_bfd_derive_misc_symbol_info): Initialize
3194 (som_build_and_write_symbol_table): Keep track
3195 of secondary_def field.
3196 (som_slurp_symbol_table): Set BSF_WEAK symbol flag
3197 if secondary_def field is set.
3198 (som_bfd_ar_write_symbol_stuff): Initialize
3203 * dwarf2.c (read_address): Read 16-bits addresses.
3204 (parse_comp_unit): Accept addr_size == 2.
3208 * bfd-in.h: Update copyright date.
3212 * cpu-i370.c: New file.
3213 * elf32-i370.c: New file.
3214 * archures.c (enum bfd_architecture): Add bfd_arch_i370.
3215 (bfd_i370_arch): New.
3216 (bfd_archures_list): Add bfd_i370_arch.
3217 * elf.c (prep_headers): Add bfd_arch_i370.
3218 * Makefile.am: Add support for IBM 370 elf.
3219 * config.bfd: Likewise.
3220 * configure.in: Likewise.
3221 * libbfd.h (bfd_reloc_code_real_names): Likewise.
3222 * reloc.c (bfd_reloc_code_type): Likewise.
3223 * targets.c: Likewise.
3225 * Makefile.in: Regenerate.
3226 * configure: Regenerate.
3227 * bfd-in2.h: Regenerate.
3231 * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for
3232 invalid relocation types, and change them to R_386_NONE.
3236 * elflink.h (elf_link_add_object_symbols): If a version symbol is
3237 not defined, don't add a second ELF_VER_CHR.
3239 * elflink.h (elf_bfd_final_link): Call output_extsym for global
3240 symbols converted to local symbols even when stripping all
3242 (elf_link_output_extsym): Process global symbols converted to
3243 local symbols even if they are being stripped.
3247 * archures.c (bfd_octets_per_byte): Return unsigned int.
3248 (bfd_arch_mach_octets_per_byte): Ditto.
3249 * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned
3251 * section.c (bfd_get_section_size_before_reloc): Quell signed
3252 vs. unsigned comparison warning.
3253 (bfd_get_section_size_after_reloc): Same here. Fix parentheses too.
3254 * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27
3255 change. What was I thinking?
3256 * bfd-in2.h: Regenerate.
3258 * elflink.h (elf_gc_sweep): Skip non-elf input bfds.
3259 (elf_gc_sections): Same here.
3260 (elf_gc_common_finalize_got_offsets): And here.
3264 ELF HPPA doesn't work at present; remove it until it does.
3265 * config.bfd: Comment out setting targ_defvec to
3267 * Makefile.am: Rebuild dependencies.
3268 (BFD32_BACKENDS): Remove elf32-hppa.lo.
3269 (BFD32_BACKENDS_CFILES): Remove elf32-hppa.c.
3270 (SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h.
3271 * Makefile.in: Rebuild.
3272 * targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec.
3276 * coffcode.h (coff_set_arch_mach_hook): Use free(), because there
3277 is no bfd_free(). Revert bfd_free part of previous change.
3281 * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size
3283 (coff_compute_section_file_positions): Use bfd_free to pair
3285 (coff_write_object_contents): Likewise.
3287 * coff-rs6000.c (xcoff_howto_table_16): New variable.
3288 (xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs.
3292 * coff-rs6000.c (XCOFFARMAGBIG): New macro.
3293 (xcoff_ar_file_hdr_big): New structure.
3294 (SIZEOF_AR_FILE_HDR_BIG): New macro.
3295 (xcoff_ar_hdr_big): New structure.
3296 (SIZEOF_AR_HDR_BIG): New macro.
3297 (xcoff_big_format_p): New macro.
3298 (xcoff_ardata_big): New macro.
3299 (arch_xhdr_big): New macro.
3300 (xcoff_slurp_armap): Handle large archives.
3301 (xcoff_archive_p): Detect large archives.
3302 (xcoff_read_ar_hdr): Handle large archives.
3303 (xcoff_openr_next_archived_file): Handle large archives.
3304 (xcoff_generic_stat_arch_elt): Handle large archives.
3305 (xcoff_write_armap_old): Rename from xcoff_write_armap.
3306 (xcoff_write_armap_big): New function.
3307 (xcoff_write_armap): New function, dispatch to _old or _big.
3308 (xcoff_write_archive_contents_old): Rename from
3309 xcoff_write_archive_contents.
3310 (xcoff_write_archive_contents_big): New function.
3311 (xcoff_write_archive_contents): New function, dispatch to _old or
3316 * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect
3317 and hide_symbol members.
3318 (elf_link_hash_copy_indirect): Remove.
3319 (elf_link_hash_hide_symbol): Remove.
3320 (struct elf_backend_data): Add elf_backend_copy_indirect_symbol
3321 and elf_backend_hide_symbol.
3322 (_bfd_elf_link_hash_copy_indirect): Declare.
3323 (_bfd_elf_link_hash_hide_symbol): Declare.
3324 * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument.
3325 (_bfd_elf_link_hash_hide_symbol): Likewise.
3326 (_bfd_elf_link_hash_table_init): Don't init killed members.
3327 * elflink.h (elf_link_add_object_symbols): Use the bed function
3328 pointers not elf_link_hash_{copy_indirect,hide_symbol}.
3329 (elf_link_assign_sym_version): Likewise.
3330 * elfxx-target.h (elf_backend_copy_indirect_symbol): Default.
3331 (elf_backend_hide_symbol): Likewise.
3332 (elfNN_bed): Update for new members.
3336 * rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD,
3337 STACK_END_ADDR): Define for new core file format.
3338 (LOADER_OFFSET_FIELD, LOADER_REGION_SIZE, CORE_DUMP): New defines
3339 for handling the vagaries of the various core file structures used
3340 by AIX over the years.
3341 (rs6000coff_core_p, rs6000coff_core_file_matches_executable,
3342 Rs6kCorData): Use above defines to adapt code to use AIX 4.3's
3343 core_dumpx structure.
3347 * archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
3348 (bfd_mach_sh3_dsp): Likewise.
3349 (bfd_mach_sh4): Reinstate.
3350 (bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
3351 * bfd-in2.h: Regenerate.
3352 * coff-sh.c (struct sh_opcode): flags is no longer short.
3353 (USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
3354 (sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
3355 (sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
3356 (sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
3357 (sh_opcodes): No longer const.
3358 (sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
3359 (sh_insn_uses_reg): Check for USESAS and USESR8.
3360 (sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
3361 (_bfd_sh_align_load_span): Return early for SH4.
3362 Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
3363 Take into account that field b of a parallel processing insn
3364 could be mistaken for a separate insn.
3365 * cpu-sh.c (arch_info_struct): New array elements for
3366 sh2, sh-dsp and sh3-dsp.
3367 Reinstate element for sh4.
3368 (SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
3369 (SH4_NEXT): Reinstate.
3370 (SH3_NEXT, SH3E_NEXT): Adjust.
3371 * elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
3372 * elf32-sh.c (sh_elf_set_private_flags): New function.
3373 (sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
3374 (sh_elf_merge_private_data): New function.
3375 (elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
3376 (bfd_elf32_bfd_copy_private_bfd_data): Define.
3377 (bfd_elf32_bfd_merge_private_bfd_data): Change to
3378 sh_elf_merge_private_data.
3382 * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and
3383 hide_symbol members.
3384 (elf_link_hash_copy_indirect): New.
3385 (elf_link_hash_hide_symbol): New.
3386 * elflink.h (elf_link_add_object_symbols): Break out copy from
3387 indirect new new symbol to elf.c.
3388 (elf_link_assign_sym_version): Break out privatization of
3389 non-exported symbol to elf.c.
3390 * elf.c (_bfd_elf_link_hash_copy_indirect): New.
3391 (_bfd_elf_link_hash_hide_symbol): New.
3392 (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol.
3396 * section.c (_bfd_strip_section_from_output): Add info parameter.
3397 If it passed as non-NULL, use it to check whether any input BFD
3398 has an input section which uses this output section. Change all
3400 * bfd-in2.h: Rebuild.
3402 * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and
3403 bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of
3405 * bfd-in2.h: Rebuild.
3409 * coffswap.h (coff_swap_sym_in): Add hook SWAP_SYM_IN_POST to
3410 allow final modifications of swapped-in symbol.
3411 (coff_swap_sym_out): Ditto with SWAP_SYM_OUT_POST.
3412 * coffcode.h (coff_write_relocs): Use macro
3413 SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if defined to determine whether
3414 symbol index should be set to -1.
3418 * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG,
3419 USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros.
3420 * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes.
3421 * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg,
3422 sh_insns_uses_or_sets_freg): New functions.
3423 * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros.
3424 * (sh_insns_conflict): Use new functions and new macros to
3425 detect conflicts when two instructions both set same integer registers,
3426 both set same fp register, and both set special register.
3430 * coffgen.c (coff_real_object_p): Set arch/mach info prior to
3431 swapping in sections, so that the swapping routines have access to
3436 * coff-go32.c: Update comment. Update copyright.
3440 * syms.c (bfd_decode_symclass)
3441 Two new class characters were added - 'V' and 'v'. The
3442 meaning of 'W' is now restricted to just weak non-object
3443 symbols. This allows differentiation between, for example,
3444 weak functions vs weak objects. nm for example now dumps:
3446 'w' = weak unresolved
3447 'V' = weak global object
3448 'v' = weak unresolved object
3450 (bfd_is_undefined_symclass): New function. Return true if the
3451 given symbol class represents and undefined/unresolved symbol.
3453 (bfd_symbol_info): Use bfd_is_undefined_symclass to check for
3456 * bfd-in2.h: Add prototype for bfd_is_undefined_symbol().
3458 * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the
3459 STT_ARM_16BIT flag set, but it is not attached to a data object
3460 return STT_ARM_16BIT so that it will be treated as code by the
3465 * coff-i386.c (i3coff_object_p): Remove prototype.
3468 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Add const
3469 to name. Update copyright.
3471 * trad-core.c (trad_unix_core_file_p): Cast core_regsec
3472 assignment to avoid warning. Update copyright.
3476 * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc
3477 instead of using GNU C extension.
3481 * libbfd.c (bfd_read): Do not attempt to get a negativly sized
3482 amount from a bfd_in_memory structure.
3483 (bfd_seek): Do not allow seeks past the end of a bfd_in_memory
3488 * linker.c (default_indirect_link_order): oops - fix incorrectly
3489 applied patch from Tim Wall.
3493 * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx
3494 = scnhsz, filhsz, relsz, aoutsz, etc)
3496 * coffswap.h: Ditto.
3500 * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to
3501 interwork thumb to arm stub.
3505 * archures.c (bfd_octets_per_byte): New function: Return
3507 (bfd_arch_mach_octets_per_byte): New function: Return target
3510 * section.c: Distinguish between octets and bytes for usage of
3511 _cooked_size, _raw_size, and output_offset. Clarify
3512 description of bfd_set_section_contents.
3514 * bfd-in2.h: Regenerate.
3516 * coffgen.c: Indicate that the offset parameter is in bytes, not
3519 * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte
3520 where appropriate to get the octet offset when calling
3521 bfd_set_section_contents.
3522 (bfd_coff_reloc_link_order): Ditto.
3524 * linker.c (bfd_generic_reloc_link_order): Ditto.
3525 (_bfd_default_link_order): Ditto.
3527 * reloc.c (bfd_perform_relocation): Distinguish between octets
3528 and bytes. Use octets when indexing into octet data; use bytes
3529 when calculating target addresses.
3530 (bfd_install_relocation): Ditto.
3532 * srec.c (srec_write_section): Ditto.
3536 * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from
3537 3 to 2. This allows 4 byte sized sections, which is necessary for
3538 dlltool to build functioning DLLs.
3542 * config.bfd (arm*-*-linux-gnu*): Match instead of arm*-*-linux-gnu.
3543 (arm*-*-conix*): New target.
3547 * config.bfd: Include elf32_i386 vector to target list for cygwin
3550 * config.in: Undefine HAVE_WIN32_PSTATUS_T.
3551 * configure.in: Test for structure win32_pstatus_t in
3553 * configure: Regenerate.
3555 * elf.c (elfcore_grok_win32pstatus): New function: process
3556 win32_pstatus_t notes in elf core file.
3557 (elfcore_grok_note): Detect win32_pstatus notes.
3561 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Process symbol
3563 * elflink.h (elf_link_add_object_symbols): Combine visibilities.
3564 * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility.
3568 * elflink.h (bfd_elf,size_dynamic_sections): Don't export all
3569 if no dynamic sections created.
3573 * peicode.h (pe_bfd_object_p): Only define for PE format
3578 * coff-i386.c (i3coff_object_p): Delete.
3579 (i386coff_vec): Replace reference to i3coff_object_p with a
3580 reference to coff_object_p.
3582 * coff-mcore.c (pe_object_p): Delete.
3584 * peicode.h (pe_bfd_object_p): New function: Detect the
3585 presence of a PE format COFF object file. Also detect and
3586 warn about the presence of LINK6 format Image Library Format
3591 * coff-arm.c (NUM_ELEM): New macro.
3592 (NUM_RELOCS): New macro: The number of known ARM relocs.
3593 (RTYPE2HOWTO): Return NULL if the reloc type is out of range.
3594 (coff_arm_rtype_to_howto): Return NULL if the reloc type is out
3596 (bfd_arm_process_before_allocation): Produce a warning message if
3597 an out of range symbol index is encountered.
3601 * elflink.h (is_global_symbol_definition): New Function: Return
3602 true iff the symbol is being given a global definition in this
3604 (elf_link_is_defined_archive_symbol): Do not bother processing
3605 symbols for an archive element that has already been included
3607 Use is_global_symbol_definition().
3611 * config.bfd: Add support for sparc-*-netbsdelf* and
3612 sparc-*-netbsdaout*.
3616 * elflink.h (elf_link_is_defined_archive_symbol): Check to see
3617 if the symbol is in the common section.
3621 * elflink.h (elf_link_is_defined_archive_symbol): New
3622 function: Decide if a symbol, in an archive map is there
3623 because it is defined in the archive element, or because it is
3624 just another common declaration of it.
3625 (elf_link_add_archive_symbols): Use
3626 elf_link_is_defined_archive_symbol to decide if an archive
3627 element contain a reference to a common symbol should be
3632 * elflink.h: Revert previous patch.
3633 * targets.c: Revert previous patch.
3634 * libbfd-in2.h: Revert previous patch.
3635 * libbfd.h: Revert previous patch.
3636 * elfxx-target.h: Revert previous patch.
3637 * archive.c: Revert previous patch.
3638 * aout-target.h: Revert previous patch.
3639 * aout-tic30.h: Revert previous patch.
3640 * bfd.c: Revert previous patch.
3641 * coff-alpha.c: Revert previous patch.
3642 * coff-rs6000.c: Revert previous patch.
3643 * elf64-mips.c: Revert previous patch.
3644 * ieee.c: Revert previous patch.
3645 * libecoff.h: Revert previous patch.
3646 * oasys.c: Revert previous patch.
3647 * som.c: Revert previous patch.
3648 * vms.c: Revert previous patch.
3652 * elflink.h (elf_link_add_archive_symbols): Add an archive
3653 element even if contains a symbol which is currently only
3654 considered to be a common.
3656 * targets.c (struct bfd_target): Add new field
3657 _bfd_allow_commons_in_armap.
3658 * bfd-in2.h:Regenerate.
3660 * libbfd-in2.h (_bfd_noarchive_allow_commons_in_armap):
3662 (_bfd_archive_bsd_allow_commons_in_armap): Define.
3663 * libbfd.h: Regenerate.
3665 * elfxx-target.h: If using COFF archive map, override
3666 definition of allow_commons_in_armap and replace with
3669 * archive.c (bfd_compute_and_write_armap): Do not place common
3670 symbols into the archive map unless _bfd_allow_commons_in_armap
3673 * aout-target.h (MY_allow_commons_in_armap): Define.
3674 * aout-tic30.h (MY_allow_commons_in_armap): Define.
3675 * bfd.c (bfd_allow_commons_in_armap): Define.
3676 * coff-alpha.h (alpha_ecoff_allow_commons_in_armap): Define.
3677 * coff-rs6000.h (xcoff_allow_commons_in_armap): Define.
3678 * elf64-mips.c (bfd_elf64_allow_commons_in_armap): Define.
3679 * ieee.c (ieee_ecoff_allow_commons_in_armap): Define.
3680 * libecoff.h (_bfd_ecoff_allow_commons_in_armap): Define.
3681 * oasys.c (oasys_allow_commons_in_armap): Define.
3682 * som.c (som_allow_commons_in_armap): Define.
3683 * vms.c (vms_allow_commons_in_armap): Define.
3687 Add support for SSE registers in ELF core files.
3688 * elf.c (elfcore_make_note_pseudosection): New function.
3689 (elfcore_grok_prfpreg): Use it.
3690 (elfcore_grok_prxfpreg): New function.
3691 (elfcore_grok_note): Recognize Linux NT_PRXFPREG notes.
3695 * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16
3696 value by 4 before storing it back in the field. From
3701 * archures.c (bfd_mach_am33): Define.
3702 * bfd-in2.h: Rebuilt.
3703 * cpu-m10300.c (bfd_am33_arch): Add to the mn103 architecture list
3704 * elf-m10300.c (mn10300_elf_relax_section): Handle am33 instructions.
3705 (compute_function_info): Handle additional registers saved by
3707 (elf_mn10300_mach): Handle E_MN10300_MACH_AM33.
3708 (_bfd_mn10300_elf_final_write_processing): Handle bfd_mach_am33.
3712 * elf.c (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New
3714 * bfd-in2.h (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New
3719 * reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for
3720 internal use within gas for alpha explicit relocations.
3721 (BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto.
3722 (BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto.
3723 (BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto.
3724 (BFD_RELOC_ALPHA_USER_GPDISP): Ditto.
3725 (BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto.
3726 (BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto.
3728 * elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for
3729 BFD_RELOC_ALPHA_USER_*.
3731 * bfd-in2.h: Regenerate.
3732 * libbfd.h: Regenerate.
3736 * elf.c (elfcore_read_notes): Add prototype for static function.
3737 (_bfd_elf_make_section_from_phdr): Renamed from bfd_section_from_phdr.
3738 (bfd_section_from_phdr): Replacement function that calls
3739 _bfd_elf_make_section_from_phdr for generic segment types and
3740 backend fucntion pointed to by elf_backend_section_from_phdr for
3741 backend specific segment types.
3742 (_bfd_elfcore_section_from_phdr): Remove call to elfcore_read_notes,
3743 now called by _bfd_elf_make_section_from_phdr. Note that this func
3744 is now just a stub between the caller and bfd_section_from_phdr.
3746 * elf-bfd.h (struct elf_backend_data): Add new function pointer
3747 elf_backend_section_from_phdr.
3748 (elf_backend_section_from_phdr): Add prototype.
3750 * elfxx-target.h (elf_backend_section_from_phdr): Define default.
3751 (elfNN_bed): Add elf_backend_section_from_phdr.
3755 * coff-arm.c (bfd_arm_get_bfd_for_interworking): Add
3756 SEC_CODE and SEC_READONLY flags to glue sections.
3758 * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add
3759 SEC_CODE and SEC_READONLY flags to glue sections.
3763 * coff-mcore.c (coff_mcore_relocate_section): Fix typo in previous
3768 * elf32-m68k.c (elf_cpu32_plt0_entry): Fix encoding.
3769 (elf_cpu32_plt_entry): Likewise.
3773 * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling
3775 (coff_mcore_relocate_section): Initialise addend to 0.
3776 Special case processing of RVA reloc.
3780 * elf-bfd.h (struct elf_backend_data): Reorder collect and
3781 type_change_ok; add sign_extend_vma.
3782 * elf32-mips.c (elf_backend_sign_extend_vma): Define.
3783 * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma.
3784 (elf_swap_shdr_in, elf_swap_phdr_in): Likewise.
3785 * elfxx-target.h (elf_backend_sign_extend_vma): Default.
3786 (elfNN_bed): Follow struture changes.
3790 * libbfd.c (bfd_read): Check result of read against desired result
3792 (_bfd_generic_get_section_contents): Set bfd_error if the seek is
3793 invalid compared to the section size.
3795 * ieee.c (ieee_slurp_debug): Get the length of the debug
3796 information right if there is no data part.
3800 * som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND,
3801 R_LINETAB, R_LINETAB_ESC, and R_COMMENT.
3805 * elflink.h (elf_bfd_final_link): Make last_local signed.
3809 * stabs.c (_bfd_link_section_stabs): Make sure .stabstr section
3814 * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and
3816 * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add.
3817 * bfd-in2.h: Regenerate.
3821 * dwarf1.c (parse_die): Fail to parse a die if its length is zero.
3825 * libhppa.h (bfd_hppa_insn2fmt): Change to return an int.
3829 * elflink.h (elf_merge_symbol): When overriding a weak symbol with
3830 a defined symbol in a shared library, clear the DEF_DYNAMIC flag
3835 * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL
3836 relocs also need the GP value.
3837 (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs
3838 properly. Handle sign-extension for R_MIPS_64 correctly. Correct
3839 the GP value for R_MIPS_LITERAL relocs too. Handle
3840 R_MIPS_64 relocs properly on big-endian MIPS.
3841 (mips_elf_sign_extend): Behave properly with 'long long'.
3842 (mips_elf_highest): Correct typo.
3846 * cpu-m32r.c (arch_info_struct): New static global.
3847 (bfd_m32r_arch): Refer to it.
3848 * elf32-m32r.c (m32r_elf_object_p): Recognize E_M32RX_ARCH.
3849 (m32r_elf_print_private_bfd_data): Ditto.
3850 (m32r_elf_final_write_processing): Handle bfd_mach_m32rx.
3851 * archures.c (bfd_mach_m32rx): Define it.
3852 * bfd-in2.h: Rebuild.
3856 * targets.c (cisco_core_vec): Replaced with two new vecs ...
3857 (cisco_core_big_vec): Add new bigendian vec.
3858 (cisco_core_little_vec): Add new little endian vec.
3860 * cisco-core.c (CRASH_INFO): Fixed offset replaced with ...
3861 (crash_info_locs): Add array of possible offsets.
3862 (MASK_ADDR): Mask to apply to crash info offset.
3863 (crashinfo_external): Add textbase, database, bssbase and
3864 turn into a typedef.
3865 (cisco_core_file_validate): Renamed from cisco_core_file_p.
3866 Many small changes to account for additional hardware versions.
3867 Pick a reasonable size for ".reg" section. Add a ".crash"
3868 section to allow access to crashinfo_external struct.
3869 (cisco_core_file_p): New version of this function that
3870 iterates over crash_info_locs, calling cisco_core_file_validate.
3871 (cisco_core_vec): Old big endian only vec replaced with ...
3872 (cisco_core_big_vec): Add big endian version.
3873 (cisco_core_little_vec): Add little endian version.
3875 * configure.in (cisco_core_vec): Split to two new vectors ...
3876 (cisco_core_big_vec): New target vector.
3877 (cisco_core_little_vec): New target vector.
3878 * configure: Regenerate.
3879 * config.bfd (targ): For m68*-*-aout* targ, change cisco_core_vec
3880 to cisco_core_big_vec in targ_selvecs.
3884 * elf32-mips.c (mips_elf_relocate_hi16): Unused, delete.
3885 (mips_elf_relocate_got_local): Unused, delete.
3886 (mips_elf_relocate_global_got): Unused, delete.
3890 * elf.c (bfd_section_from_phdr): Add typename variable. Use p_type
3891 to initialize it to something meaningful. Then use it to generate
3892 more useful segment names.
3896 * som.c (NO_PCREL_MODES): Define if the system does not define
3898 (hppa_som_gen_reloc_type): Handle both short and long pcrel branches.
3899 (som_write_fixups): Eliminate redundant pcrel mode relocs. Handle
3900 R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE
3901 * libhppa.h (dis_assemble_22): New function.
3902 (bfd_hppa_insn2fmt): Handle long branch.
3904 * libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found
3909 * coff-i386.c (coff_i386_reloc_type_lookup): Support BFD_RELOC_16,
3910 BFD_RELOC_16_PCREL, BFD_RELOC_8, BFD_RELOC_8_PCREL relocs.
3911 (reloc_howto_type howto_table): Tidy comments and whitespace.
3915 * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Undo
3916 previous delta. Set sec->gc_mark instead.
3920 * elf32-m68k.c (elf_cpu32_plt0_entry): Use a1 instead of a0.
3921 (elf_cpu32_plt_entry): Likewise.
3925 * elf-hppa.h (elf_hppa_final_write_processing): Turn on TRAPNIL.
3927 * elf-hppa.h (elf_hppa_final_link): If unable to find __gp in the
3928 symbol table, then just compute a suitable value (but do not
3929 create a __gp symbol).
3931 * elf-hppa.h (elf_hppa_relocate_section): Allow undefined
3932 symbols when building shared libraries.
3933 (elf_hppa_final_link_relocate): Correct handling of PCREL
3934 relocations against undefined symbols.
3938 * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark
3939 interworking sections as linker created so that they will not
3940 be removed by garbage collection.
3944 * elf-hppa.h (elf_hppa_final_link): Revamp __gp handling.
3945 (elf_hppa_final_link_relocate): Consistently create an absolute
3946 address, then subtract out the value of __gp.
3950 * configure.in (Canonicalization of target names): Remove adding
3951 ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14
3952 generates $ac_config_sub with a ${CONFIG_SHELL} already.
3953 * configure: Regenerate.
3957 * elf32-m32r.c (ELF_MAXPAGESIZE): Change to 0x1 (at request of
3962 * elf-hppa.h (elf_hppa_record_segment_addrs): New function.
3963 (elf_hppa_final_link): Initialize text_segment_base and
3965 (elf_hppa_final_link_relocate): Handle SEGREL relocations.
3967 * elf-hppa.h (elf_hppa_final_link): Remove unused variables.
3968 (elf_hppa_final_link_relocate): Likewise.
3969 (elf_hppa_relocate_insn): Likewise.
3970 (elf_hppa_relocate_section): Initialize HOWTO.
3974 * coffcode.h (styp_to_sec_flags): Further refinement of COMDAT
3975 handling to support both GNU and MS objects.
3977 * coffcode.h (coff_write_object_contents): Don't check reloc_count
3978 when determining whether to set F_RELFLG.
3982 * elf32-arm.h (elf32_arm_final_link_relocate): Don't range-check
3983 PC24 relocs if the target is an undefined weak symbol.
3984 (arm_add_to_rel): Fix compiler warning.
3985 (elf32_arm_plt0_entry): Correct comments.
3989 * elfcode.h (write_relocs): Check for the_bfd NULL when handling
3990 an absolute symbol in REL relocs.
3994 * elf-hppa.h (elf_hppa_final_link_relocate): Handle SECREL32.
3995 Stub SEGREL32. Return an error for any relocation not handled.
3999 * cofflink.c (coff_link_add_symbols): Look for special MSVC string
4000 constant symbols, and avoid multiple definition errors on them.
4004 * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most
4005 significant bit is set.
4009 * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
4011 * elfcode.h (write_relocs): Handle an absolute symbol in REL
4012 relocs as we do for RELA relocs.
4016 * libpei.h (_bfd_pei_final_link_postscript): Declare.
4017 (coff_final_link_postscript): Define.
4018 * peigen.c (_bfd_pei_swap_aouthdr_out): Don't set value for data
4019 directory entries here.
4020 (_bfd_pei_final_link_postscript): New function.
4022 * peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets
4023 section flags based on the section name.
4025 * peicode.h (coff_swap_scnhdr_in): If COFF_IMAGE_WITH_PE, the
4026 get the overflow of the s_nlnno field from the s_nreloc field.
4027 * peigen.c (_bfd_pei_swap_scnhdr_out): If doing a final link, swap
4028 the s_nlnno overflow of the .text section into the s_nreloc
4031 * peigen.c (add_data_entry): Declare.
4032 (pei_swap_aouthdr_out): Get image size right. Set linker version
4034 (pei_swap_scnhdr_out): Test for UNINIT section, not .bss.
4035 (pe_print_idata): Code cleanup, print more info, get rid of (now)
4036 extraneous ImageBase.
4037 (pe_print_edata): Likewise.
4038 (pe_print_pdata): Likewise. Print exception entries.
4039 (pe_print_reloc): Likewise. Print MIPS_JMPADDR.
4040 (tbl): Make const, add "UNKNOWN".
4041 (_bfd_pe_print_private_bfd_data_common): Print timestamp.
4042 (_bfd_pe_bfd_copy_private_bfd_data_common): Don't copy deleted
4043 section data directory.
4044 (_bfd_pe_bfd_copy_private_section_data): Copy pe_flags.
4046 * libpei.h (_bfd_pe_bfd_get_symbol_info): Declare.
4047 * peigen.c (_bfd_pe_bfd_get_symbol_info): New function.
4048 * peicode.h (coff_get_symbol_info): Define.
4050 * config.bfd (i[3456]86-*-interix*): Set targ_cflags to
4052 * coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather
4054 (coff_classify_symbol): Re-revert 1999-08-08 patch if
4057 * libpei.h: New file, broken out of peicode.h.
4058 * peigen.c: New file, broken out of peicode.h.
4059 * peicode.h: A bunch of code moved out to libpei.h and peigen.c.
4060 * configure.in: Add peigen.lo to list of files required for each
4062 * Makefile.am: Rebuild dependencies.
4063 (BFD32_BACKENDS): Add peigen.lo.
4064 (BFD32_BACKENDS_CFILES): Add peigen.c.
4065 (SOURCE_HFILES): Add libpei.h.
4066 * configure, Makefile.in: Rebuild.
4068 * peicode.h (coff_swap_scnhdr_in): Don't check for a special
4069 section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA
4070 instead. Don't clear the s_paddr field for an uninitialized data
4073 * coffcode.h (coff_mkobject_hook): Set timestamp field in
4074 coff_data_type to f_timdat.
4075 * peicode.h (pe_mkobject_hook): Likewise.
4077 * peicode.h (coff_swap_filehdr_in): Check the NT executable magic
4078 number if COFF_IMAGE_WITH_PE.
4080 * coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG
4081 to the reverse of IMAGE_FILE_DEBUG_STRIPPED.
4082 (coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if
4083 there is no SEC_DEBUGGING section.
4084 * peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of
4085 IMAGE_FILE_DEBUG_STRIPPED.
4087 * pe-i386.c (COFF_LONG_FILENAMES): Define.
4088 (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
4089 * pei-i386.c (COFF_LONG_FILENAMES): Define.
4090 (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
4092 * coffswap.h (IMAGE_BASE): Don't define.
4093 * pei-arm.c (IMAGE_BASE): Don't define.
4094 * pei-i386.c (IMAGE_BASE): Don't define.
4095 * pei-mcore.c (IMAGE_BASE): Don't define.
4096 * pei-ppc.c (IMAGE_BASE): Don't define.
4098 * cofflink.c (_bfd_coff_link_input_bfd): When writing out a
4099 symbol, switch on the class when determining whether to modify the
4100 value. For PE, don't modify the value of a C_FCN symbol not named
4103 * libbfd-in.h (_bfd_abort): Declare.
4105 * bfd.c (_bfd_abort): New function.
4106 * libbfd.h: Rebuild.
4108 * coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE
4111 * cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped,
4112 don't write out the associated line numbers.
4114 * cofflink.c (_bfd_coff_write_global_sym): Handle section symbol
4117 * cofflink.c (coff_link_add_symbols): Don't warn about symbol type
4118 changes when the base type is unknown.
4120 * coffgen.c (coff_print_symbol): Fix printing of aux record for
4123 * syms.c (BSF_DEBUGGING_RELOC): Define.
4124 * coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING
4125 for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such
4127 * coffgen.c (fixup_symbol_value): Relocate a symbol which has
4128 BSF_DEBUGGING_RELOC set.
4129 * bfd-in2.h: Rebuild.
4133 * ecoff.c (bfd_debug_section): Update initialization for new
4135 (_bfd_ecoff_styp_to_sec_flags): Add section parameter.
4136 * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration.
4140 * coff-alpha.c (alpha_ecoff_backend_data): Initialize the new
4141 _bfd_filnmlen field.
4142 * coff-mips.c (mips_ecoff_backend_data): Likewise.
4146 * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries
4147 for FPTR relocs involving local symbols.
4149 * elf-hppa.h (elf_hppa_final_link_relocate): Get the right
4150 value for the stub address in a call through a stub.
4151 Install the value for a local symbol directly into the DLT
4152 instead of generating a reloc. Correctly handle FPTR64 relocs.
4154 * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function.
4155 (elf_hppa_remark_useless_dynamic_symbols): Similarly.
4156 (elf_hppa_final_link): Call them.
4160 * elflink.h (elf_fix_symbol_flags): Move weakdef handling here...
4161 (elf_adjust_dynamic_symbol): ...from here.
4165 * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR
4166 relocation, remove them. SECREL64->LTOFF16WF.
4167 (elf_hppa_final_link_relocate): Handle LTOFF* relocations. Handle
4169 (elf_hppa_relocate_insn): Similarly.
4171 * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs.
4172 (elf_hppa_relocate_insn): Similarly.
4174 * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and
4176 (elf_hppa_relocate_insn): Similarly.
4178 * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos.
4179 Handle LTOFF_TP* relocs.
4180 (elf_hppa_relocate_insn): Similarly.
4182 * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs.
4183 Consistently deal with addends. Handle DLTIND14F and DLTREL14F.
4184 (elf_hppa_relocate_insn): Handle PCREL* relocs.
4186 * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*,
4187 DIR32, DIR64 and FPTR64 relocations.
4188 (elf_hppa_relocate_insn): Similarly.
4190 * elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the
4191 address of the .PARISC.global section.
4192 (elf_hppa_relocate_section): Lookup and pass the PA64 hash
4193 table entry elf_hppa_final_link_relocate. Do not give a warning
4194 for a reloc against an external symbol if it has a PA64 hash
4196 (elf_hppa_final_link_relocate): Significantly rework. Handle
4197 DLTIND relocations. Compute the final value of the relocation
4198 before passing the value of elf_hppa_relocate_insn.
4199 (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling
4200 relocation support. Handle DLTIND relocation requests just like
4201 DLTREL relocation requests. Simplify branch handling.
4205 * elf-hppa.h (elf_hppa_relocate_section): Catch problems with
4206 non-allocated section as done in i386 version.
4207 (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch
4208 statement since this is no know relocation.
4212 * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F
4214 (elf_hppa_relocate_insn): Similarly.
4216 * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and
4218 (elf_hppa_relocate_insn): Similarly.
4220 * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and
4221 DLTREL21L relocs. Pass the output bfd to elf_hppa_relocate_insn.
4222 Pass the relocate type rather than the insn format to
4223 elf_hppa_relocate_insn.
4224 (elf_hppa_relocate_insn): Make switch dependent on relocation type
4225 rather than the opcode. Handle DLTREL21L and DLTREL14R relocs.
4229 * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field.
4230 (bfd_coff_filnmlen): Define.
4231 (bfd_coff_std_swap_table): Initialize new field.
4232 * coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather
4234 (coff_write_symbols): Likewise.
4235 (coff_get_normalized_symtab): Likewise.
4236 * coff-sh.c (bfd_coff_small_swap_table): Initialize new field.
4237 * libcoff.h: Rebuild.
4241 * coffcode.h (sort_by_secaddr): New static function if
4243 (coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort
4244 sections by VMA when assigning target_index values. Always set
4247 * libcoff-in.h (struct pei_section_tdata): Add pe_flags field.
4248 * coffcode.h (coff_set_alignment_hook) [COFF_WITH_PE version]: Set
4250 * libcoff.h: Rebuild.
4252 * coffcode.h (coff_set_custom_section_alignment): Add const to
4253 declaration to match definition.
4254 (coff_write_object_contents): Don't set F_AR32W(R)? if
4257 * coff-i386.c (in_reloc_p): Add declaration.
4258 (i386coff_vec): Simplify initialization of
4259 application_section_flags.
4261 * coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE
4262 version. Move COFF_WITH_PE specific code to new version.
4263 (stype_to_sec_flags): Likewise. Add section parameter.
4264 * coffgen.c (make_a_section_from_file): Set target_index before
4265 calling styp_to_sec_flags. Pass section to styp_to_sec_flags.
4266 * libcoff.h: Rebuild.
4268 * syms.c (stt): Add some PE/PEI section names.
4269 (bfd_decode_symclass): Return 'w', not 'U', for a weak undefined
4271 (bfd_symbol_info): Check for 'w'.
4273 * section.c (struct bfd_comdat_info): Define.
4274 (asection): Add comdat field.
4275 (STD_SECTION): Initialize comdat field.
4276 (bfd_make_section_anyway): Likewise.
4277 * bfd-in2.h: Rebuild.
4281 * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag
4286 * elflink.h (elf_gc_record_vtentry): Use bfd_zmalloc and
4287 bfd_realloc instead of calloc and realloc.
4291 * cpu-pj.c: New file.
4292 * elf32-pj.c: New file.
4293 * config.bfd (pj*): New cpu.
4294 (pj-*-*, pjl-*-*): New targets.
4295 * configure.in (bfd_elf32_pj_vec): New target vector.
4296 (bfd_elf32_pjl_vec): New target vector.
4297 * archures.c (bfd_arch_pj): Define.
4298 * elf.c (prep_headers): Handle bfd_arch_pj.
4299 * reloc.c: Define BFD_RELOC_PJ_* relocations.
4300 * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add
4301 to target vector list.
4302 * Makefile.am: Rebuild dependencies.
4303 (ALL_MACHINES): Add cpu-pj.lo.
4304 (ALL_MACHINES_CFILES): Add cpu-pj.c.
4305 (BFD32_BACKENDS): Add elf32-pj.lo.
4306 (BFD32_BACKENDS_CFILES): Add elf32-pj.c.
4307 * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
4311 * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define.
4312 * elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK
4313 and NON_GOT_REF from weak defined symbol to real symbol.
4314 * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF.
4315 (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't
4316 create a COPY reloc.
4317 * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF.
4318 (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set,
4319 don't create a COPY reloc.
4323 * elflink.h (elf_bfd_final_link): When counting relocations, don't
4324 count those in sections we are not including in the link.
4328 * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK
4329 field in hpux11 shared libraries.
4333 * elflink.h (elf_gc_record_vtentry): Fix memory leak.
4337 * elf-hppa.h (elf_hppa_add_symbol_hook): New function.
4338 (elf_hppa_final_link, elf_hppa_relocate_section): Likewise.
4339 (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise.
4343 * elflink.h (record_link_assignment): When possible, keep the
4344 original type of the symbol.
4348 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both
4349 R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the
4350 tools were configured.
4351 * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare.
4355 * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local
4356 GOT entries for GOT16 relocations; they're not required.
4362 * config.bfd (arm-*-netbsd*): New target.
4363 * configure.in (armnetbsd_vec): New target vector.
4364 * configure: Regenerate
4365 * targets.c (bfd_target_vector): Add &armnetbsd_vec.
4367 * Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo.
4368 (ALL_MACHINES_CFILES): Add armnetbsd.c.
4369 (armnetbsd.lo): New rule with deps.
4370 * Makefile.in: Regenerate.
4372 * armnetbsd.c: New file: Definitions specific to arm-netbsd
4377 * som.c (som_slurp_symbol_table): Fix typo in comment.
4381 * elf-hppa.h (elf_hppa_fake_sections): Compute section indices
4382 here instead of using elf_section_data...
4386 * coff-mcore.c (mcore_emit_base_file_entry): New function: Emit
4387 relocations into the base file.
4388 (coff_mcore_relocate_section): Call mcore_emit_base_file_entry if
4389 we are building a base file.
4393 * elf32-arm.h (arm_add_to_rel): New function. Add a value to
4395 (elf32_arm_relocate_section): Use arm_add_to_rel to increment
4396 REL relocs when performing a partial relocation.
4400 * cofflink.c: Move definitions of N_TMASK, et. al., out of
4401 _bfd_coff_link_input_bfd into top level.
4403 * coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE.
4404 (RTYPE2HOWTO): Return NULL if reloc type is out of range.
4405 (coff_i386_rtype_to_howto): Likewise.
4406 * coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG.
4407 Completely ignore symbols which are all zero.
4408 (dummy_reloc16_estimate): Add return 0.
4409 * cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope
4410 variable copy to name_copy to avoid shadowing outer scope
4412 * libcoff-in.h (coff_data_type): Change raw_syment_count field
4413 from unsigned int to unsigned long. Add timestamp field.
4414 * libcoff.h: Rebuild.
4418 * elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in
4423 * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC
4424 for special section symbols.
4425 * elflink.h (elf_merge_symbol): If we have no old BFD, check
4426 BSF_DYNAMIC on the section symbol to see whether the old BFD is
4431 * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate
4432 coincidence of variable names between old and new code.
4436 * elf32-arm.h (elf32_arm_to_thumb_stub): Make 'offset' parameter
4437 into a bfd_vma and 'addend' parameter a 'bfd_signed_vma'.
4438 (elf32_thumb_to_arm_stub): Make 'offset' parameter into a bfd_vma
4439 and 'addend' parameter a 'bfd_signed_vma'.
4440 (elf32_arm_final_link_relocate): Do not involve stubs in
4441 R_ARM_THM_PC22 relocs relative to section symbols, they are long
4442 jumps, not function calls.
4446 * elf32-arm.h (elf32_arm_final_link_relocate): Check for overflow
4447 in R_ARM_PC24 relocs.
4451 * elf-hppa.h (elf_hppa_fake_sections): New function.
4452 * elf32-hppa.c (elf_backend_fake_sections): Define.
4454 * elf-hppa.h (elf_hppa_final_write_processing): Update for
4455 recent changes to the arch_info structure.
4457 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle
4458 R_HPPA_SEGBASE and R_HPPA_SEGREL32.
4459 * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info
4465 * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always
4466 output DT_MIPS_GOTSYM.
4467 (_bfd_mips_elf_finish_dynamic_sections): Use the same value as
4468 DT_MIPS_SYMTABNO if there are no global GOT symbols.
4472 * elf32-mips.c (mips_elf_create_dynamic_relocation): Change
4473 prototype. Handle local symbols. Add commentary.
4474 (mips_elf_calculate_relocation): Adjust accordingly.
4475 (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32
4478 * elflink.h (elf_bfd_final_link): Tweak last change.
4482 * elflink.h (elf_link_size_reloc_section): Use the counts in the
4483 elf-section data to allocate just the right amount of relocation
4484 space. Don't allocate the hash space twice.
4485 (elf_bfd_final_link): Calculate the amount of space to allocate in
4486 each relocation section.
4490 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in
4491 64bit mode, generate a section relative relocation for a 32bit
4493 (elf_hppa_is_local_label_name): New function.
4494 * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted. To be
4495 shared between 32bit and 64bit port.
4499 * elf32-mips.c (elf_mips_howto_table): Fix src_mask for
4500 R_MIPS_GOT16 and R_MIPS_CALL16.
4501 (mips_elf_got16_entry): Use mips_elf_high to calculate the value
4502 to use when looking for a preexisting GOT entry.
4506 * elf64-sparc.c (sparc64_elf_relocate_section): Back out part of
4507 the Sep. 4th, 1998 change. glibc 2.0.x dynamic linker had bug,
4509 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
4513 * elflink.h (elf_link_output_extsym): Don't output a weak
4514 reference to an undefined symbol just because it was defined weak
4519 * coffgen.c (coff_find_nearest_line): When looking for file, use
4520 last best match rather than first. If address is beyond last line
4521 number record, don't return the last line as the correct value.
4525 * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT.
4526 * bfd-in2.h: Rebuild.
4530 * libcoff-in.h (struct coff_section_alignment_entry): Define.
4531 * coffcode.h (coff_set_custom_section_alignment): New static
4533 (coff_section_alignment_table): New static array.
4534 (coff_new_section_hook): Use coff_set_customer_section_alignment.
4535 * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
4536 * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
4537 * libcoff.h: Rebuild.
4541 * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to
4543 * Makefile.in: Rebuild.
4547 * section.c (SEC_SHARED): Define.
4548 * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED.
4549 (styp_to_sec_flags): Likewise.
4550 * peicode.h (coff_swap_scnhdr_out): Likewise.
4551 * bfd-in2.h: Rebuild.
4555 * coffcode.h (coff_classify_symbol): Comment out part of
4556 1999-08-05 change which breaks cygwin DLLs.
4558 * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*.
4559 * aclocal.m4, configure: Rebuild.
4563 * section.c (global_syms): Only initialize union field if
4568 * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by
4569 the size of a GOT entry here.
4570 (mips_elf_calculate_relocation): Don't create a local GOT entry
4571 for the symbol in a GOT16 relocation; just for it's high-order bit
4572 (_bfd_mips_elf_relocate_section): Fix thinko.
4577 * coffcode.h (enum coff_symbol_classification): Define.
4578 (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to
4579 _bfd_coff_classify_symbol. Change return type.
4580 (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global.
4581 (coff_slurp_symbol_table): Use coff_classify_symbol.
4582 (coff_classify_symbol): New static function.
4583 (coff_sym_is_global): Never define.
4584 (bfd_coff_std_swap_table): Initialize with coff_classify_symbol.
4585 * cofflink.c (coff_link_check_ar_symbols): Use
4586 bfd_coff_classify_symbol rather than bfd_coff_sym_is_global.
4587 (coff_link_add_symbols): Likewise.
4588 (_bfd_coff_link_input_bfd): Likewise.
4589 * coff-sh.c (bfd_coff_small_swap_table): Initialize with
4590 coff_classify_symbol.
4591 * libcoff.h: Rebuild.
4595 * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors
4596 (e_ltpsel, e_rtpsel): Similarly.
4598 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel
4599 and 14bit ertpsel. Handle 64bit psel.
4603 * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16
4604 handling for REL relocations. And only left-shift R_MIPS26
4605 relocation addends where necessary.
4609 * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ...
4610 (mips_elf_next_lo16_relocation): Don't compute the addend here.
4611 Just return the relocation found.
4612 (mips_elf_relocate_section): Pull the LO16 addend out of the
4613 section itself when using REL relocations.
4615 * elf32-mips.c (mips_elf_calculate_relocation): Restore
4616 _DYNAMIC_LINK handling and handling of undefined symbols in shared
4621 * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation
4622 value of a symbol in a SEC_DEBUGGING section. Warn when doing a
4623 relocation against a symbol in an input section with no output
4626 * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used.
4628 * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to
4629 look for generated file correctly.
4630 * aclocal.m4, configure: Rebuild.
4634 * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26
4635 and R_MIPS16_26 relocations correctly when relocating.
4636 (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16
4637 and R_MIPS_CALL_LO16 are for global symbols.
4641 * elflink.h (elf_bfd_final_link): Copy the whole isym, not just
4643 * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used
4644 variables and initialize them.
4648 * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where
4649 there are no global symbols requiring GOT entries.
4650 (_bfd_mips_elf_size_dynamic_sections): Likewise.
4651 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
4652 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
4654 * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak
4655 symbols are considered to have the value zero.
4656 (_bfd_mips_elf_relocate_section): Don't try to perform a
4657 relocation for an undefined symbol.
4658 (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local
4663 * elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI
4664 wants ba,a,pt %xcc instead of %icc.
4665 Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots
4666 of large PLT entries.
4667 (sparc64_elf_plt_ptr_offset): Fix calculation.
4668 (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT
4669 addend should be relative to load address, not .plt section start.
4670 (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries.
4674 * elf-bfd.h (struct elf_backend_data): Add
4675 print_symbol_all and output_arch_syms backend methods.
4676 * elfxx-target.h: Likewise.
4677 * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create,
4678 sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms,
4679 sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New
4681 (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER
4682 symbols in .dynsym, add their names into .dynstr. Put those symbols
4684 (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER
4685 pointers to STT_REGISTER symbols in dynsym section.
4686 (sparc64_elf_print_symbol_all): New function.
4687 * elf.c (bfd_elf_print_symbol): Allow special backend symbol
4688 printing using the print_symbol_all hook.
4692 * elf32-arm.h (elf32_arm_check_relocs): Use r_offset for
4697 * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if
4698 dynamic_sections_created.
4702 * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ...
4703 (mips_rtype_to_howto): ... new function.
4704 (_bfd_mips_elf_relocate_section): Use it.
4708 * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo.
4714 * coff-arm.c (coff_arm_is_local_label_name): Change to strip
4715 out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'.
4719 * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags
4720 field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL.
4721 * cofflink.c (coff_link_add_symbols): If PE, handle section
4723 * libcoff.h: Rebuild.
4725 * config.bfd (i[3456]86-*-interix*): New target.
4729 * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and
4730 COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with
4731 .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD.
4732 * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define.
4733 (COFF_SUPPORT_GNU_LINKONCE): Define.
4734 * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define.
4735 (COFF_SUPPORT_GNU_LINKONCE): Define.
4740 * makefile.dos: Remove; obsolete.
4741 * configure.bat: Remove; obsolete.
4745 * config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes.
4749 * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error
4750 message and fail if a symbol index is out of range.
4754 * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value
4755 when looking at a R_MIPS_GOT16 relocation.
4759 * coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC.
4763 * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP
4764 removed in previous change.
4765 (_bfd_mips_elf_relocate_section): Adjust GP relative relocations
4766 in relocateable output.
4770 * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target
4773 * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
4774 if they appear to be specially created by the linker.
4778 * targets.c (alternative_target): New field in bfd_target
4780 (bfd_search_for_target): New function: Find a target that
4781 satisifies a search function.
4782 * bfd-in2.h: Regenerate.
4784 * elfxx-target.h: Initialise the alternative_target field of
4785 the bfd_target structures to point to the other target (if
4787 * nlm-target.h: Initialise the alternative_target field of
4788 the bfd_target structures to point to the other target (if
4791 * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro.
4792 (CREATE_LITTLE_COFF_TARGET_VEC): New macro.
4794 * aix386-core.c: Initialise new field of bfd_target structure.
4795 * aout-adobe.c: Initialise new field of bfd_target structure.
4796 * aout-arm.c: Initialise new field of bfd_target structure.
4797 * aout-target.h: Initialise new field of bfd_target structure.
4798 * aout-tic30.c: Initialise new field of bfd_target structure.
4799 * binary.c: Initialise new field of bfd_target structure.
4800 * bout.c: Initialise new field of bfd_target structure.
4801 * cisco-core.c: Initialise new field of bfd_target structure.
4802 * coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC.
4803 * coff-alpha.c: Initialise new field of bfd_target structure.
4804 * coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC.
4805 * coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
4806 * coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC.
4807 * coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC.
4808 * coff-i386.c: Initialise new field of bfd_target structure.
4809 * coff-i860.c: Initialise new field of bfd_target structure.
4810 * coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
4811 * coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC.
4812 * coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
4813 * coff-mips.c: Initialise new field of bfd_target structure.
4814 * coff-ppc.c: Initialise new field of bfd_target structure.
4815 * coff-rs6000.c: Initialise new field of bfd_target structure.
4816 * coff-sh.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
4817 * coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC.
4818 * coff-tic30.c: Initialise new field of bfd_target structure.
4819 * coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
4820 * coff-w65.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
4821 * coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC.
4822 * coff-z8k.c: Use CREATE_BIG_COFF_TARGET_VEC.
4823 * hppabsd-core.c: Initialise new field of bfd_target structure.
4824 * hpux-core.c: Initialise new field of bfd_target structure.
4825 * i386msdos.c: Initialise new field of bfd_target structure.
4826 * i386os9k.c: Initialise new field of bfd_target structure.
4827 * ieee.c: Initialise new field of bfd_target structure.
4828 * ihex.c: Initialise new field of bfd_target structure.
4829 * irix-core.c: Initialise new field of bfd_target structure.
4830 * mipsbsd.c: Initialise new field of bfd_target structure.
4831 * netbsd-core.c: Initialise new field of bfd_target structure.
4832 * oasys.c: Initialise new field of bfd_target structure.
4833 * osf-core.c: Initialise new field of bfd_target structure.
4834 * ppcboot.c: Initialise new field of bfd_target structure.
4835 * ptrace-core.c: Initialise new field of bfd_target structure.
4836 * sco5-core.c: Initialise new field of bfd_target structure.
4837 * som.c: Initialise new field of bfd_target structure.
4838 * srec.c: Initialise new field of bfd_target structure.
4839 * tekhex.c: Initialise new field of bfd_target structure.
4840 * trad-core.c: Initialise new field of bfd_target structure.
4841 * versados.c: Initialise new field of bfd_target structure.
4842 * vms.c: Initialise new field of bfd_target structure.
4846 * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash
4851 * elflink.h (elf_link_adjust_relocs): New function.
4852 (elf_bfd_final_link): Use it.
4853 (elf_link_input_bfd): Deal with the fact that there can be
4854 two relocation sections for a single section.
4855 (elf_reloc_link_order): Likewise.
4857 * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for
4858 a relocateable object.
4859 (_bfd_mips_elf_relocate_section): Handle relocateable links.
4863 * elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID.
4864 (sparc64_elf_get_reloc_upper_bound,
4865 sparc64_elf_get_dynamic_reloc_upper_bound,
4866 sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
4867 sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs):
4869 (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use
4870 ELF64_R_TYPE_ID/DATA where appropriate.
4874 * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove
4879 * elf32-mips.c (mips_elf_local_relocation_p): New static
4881 (mips_elf_next_lo16_addend): Call bfd_set_error on failure.
4882 (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p.
4883 Always set *require_jalxp.
4884 (mips_elf_stub_section_p): Mark abfd parameter as unused.
4885 (_bfd_mips_elf_relocate_section): Only look for LO16 following
4886 GOT16 if the GOT16 is against a local symbol. Don't return false
4887 for an undefined symbol. If there is an overflow, assert that we
4892 * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused
4893 variables `link' and `elfsec'.
4894 (elf_bfd_final_link): Remove unused variable `os'.
4898 * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require
4899 a PT_PHDR program headers.
4900 (_bfd_mips_elf_final_link): Don't assume there are going to be
4901 section symbols when we're not building a shared object.
4902 (_bfd_mips_elf_check_relocs): Make sure we have a GOT when
4907 * config.bfd (i[3456]86-*-vxworks*): New target.
4911 * elf32-mips.c (mips_elf_stub_section_p): New function.
4912 (mips_elf_calculate_relocation): Handle MIPS16 stub functions.
4913 (mips_elf_relocate_section): Adjust calling sequence for
4914 mips_elf_calculate_relocation and mips_elf_perform_relocation.
4915 (mips_elf_perform_relocation): Turn `jal' into `jalx' where
4920 * configure.in: Bump version number to 2.9.5.
4921 * configure: Rebuild.
4925 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle
4927 (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type
4928 to derive final type instead of hardwiring a selection.
4932 * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of
4933 things relocated by R_MIPS16_GPREL.
4934 (mips_elf_perform_relocation): Likewise.
4938 * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss.
4942 * elf32-mips.c (struct mips_got_info): Add global_gotno.
4943 (_bfd_mips_elf_size_dynamic_sections): Set it.
4944 (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow.
4945 (mips_elf_sort_hash_table): Set max_non_got_dynindex based off
4946 new argument max_local.
4950 * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit
4951 subwords when handling an R_MIPS16_26 relocation.
4952 (mips_elf_perform_relocation): Don't be paranoid abour right-shift
4955 * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and
4956 dst_mask to match reality.
4957 (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL.
4958 (mips_elf_obtain_contents): Use bfd_get.
4959 (mips_elf_perform_relocation): Handle R_MIPS16_GPREL.
4960 (mips_elf_relocate_section): Likewise.
4964 * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26.
4965 (mips_elf_relocate_section): Adjust calling sequence for
4966 mips_elf_perform_relocation.
4967 (mips_elf_perform_relocation): Take additional argument. Handle
4968 R_MIPS16_26. Use bfd_put for convenience.
4972 * elf.c (assign_file_positions_for_segments): Thinko last change.
4973 Always overwrite p_flags.
4977 * elf-bfd.h (struct elf_backend_data): Add want_dynbss.
4978 * elflink.c (_bfd_elf_create_dynamic_sections): Only create
4979 .dynbss and .rel[a].bss if want_dynbss.
4980 * elfxx-target.h (elf_backend_want_dynbss): Provide default.
4984 * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags.
4988 * elf-bfd.h (struct elf_link_local_dynamic_entry): New.
4989 (struct elf_link_hash_table): Add dynlocal.
4990 (_bfd_elf_link_lookup_local_dynindx): Prototype.
4991 (_bfd_elf_link_adjust_dynindx): Delete.
4992 (_bfd_elf_link_renumber_dynsyms): Prototype.
4993 (_bfd_elf,link_record_local_dynamic_symbol): Prototype.
4994 * elfcode.h (elf_link_record_local_dynamic_symbol): New alias.
4995 * elflink.c (_bfd_elf_link_adjust_dynindx): Delete.
4996 (_bfd_elf_link_lookup_local_dynindx): New function.
4997 (elf_link_renumber_hash_table_dynsyms): New function.
4998 (_bfd_elf_link_renumber_dynsyms): New function.
4999 * elflink.h (elf_link_record_local_dynamic_symbol): New function.
5000 (struct elf_assign_sym_version_info): Delete removed_dynamic.
5001 (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output
5002 instead of elf_link_remove_section_and_adjust_dynindices.
5003 Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms.
5004 (elf_link_assign_sym_version): Remove removed_dynamic code.
5005 (elf_link_renumber_dynsyms): Delete.
5006 (elf_bfd_final_link): Install section and local symbols into .dynsym.
5008 * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete.
5009 (elf_m68k_size_dynamic_sections): Don't set section dynindicies.
5010 (elf_m68k_finish_dynamic_sections): Don't write section dynsyms.
5011 * elf32-mips.c: Similarly.
5012 * elf32-ppc.c: Similarly.
5013 * elf32-sparc.c: Similarly.
5014 * elf64-alpha.c: Similarly.
5015 * elf64-sparc.c: Similarly.
5019 * elf32-mips.c (mips_elf_calculate_relocation): Do not complain
5020 when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow
5021 when the relocation is against _gp_disp.
5025 * dwarf2.c (read_attribute): Support DW_FORM_ref8.
5026 * elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs
5027 to possibly_dynamic_relocs. Adjust usage throughout code.
5028 (elf_mips_howto_table): Handle R_MIPS_64 correctly.
5029 (elf_mips_ctor64_howto): Likewise.
5030 (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32.
5032 (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode.
5033 (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32.
5034 Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries.
5035 * elf64-mips.c (elf_backend_may_use_rel_p): Define.
5039 * Makefile.am: Rebuild dependencies.
5040 * Makefile.in: Rebuild.
5042 * bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE.
5043 * bfd-in2.h: Rebuild.
5045 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
5046 as appropriate. Use EMPTY_HOWTO as appropriate. Fill in
5047 structure initializations. Add casts.
5048 * reloc.c (EMPTY_HOWTO): Define.
5049 * bfd-in2.h: Rebuild.
5050 * coff-h8300.c (h8300_reloc16_extra_cases): Remove useless
5051 comparisons against 0.
5052 * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change
5053 previous_ibfd_e_flags to unsigned long.
5054 * vms.h (struct vms_private_data_struct): Change section_count to
5056 * vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned.
5057 (_bfd_vms_write_gsd): Change symnum to unsigned.
5058 * vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned.
5059 * vms-tir.c (etir_sta): Change psect to unsigned.
5060 (alloc_section): Change idx to unsigned.
5061 (tir_sta, tir_ctl): Change psect to unsigned.
5062 (_bfd_vms_write_tir): Change len and before to bfd_size_type.
5063 * vms.c (priv_section_count): Change to unsigned.
5067 * elf32-m68k.c: Add some ATTRIBUTE_UNUSED.
5068 * m68klinux.c: Likewise.
5072 * Many files: Changes to avoid gcc warnings: Remove unused local
5073 variables. Add default case to enum switches.
5074 * coff-arm.c (bfd_arm_allocate_interworking_sections): Only
5075 compile if not COFF_IMAGE_WITH_PE.
5076 (record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise.
5077 (bfd_arm_get_bfd_for_interworking): Likewise.
5078 (bfd_arm_process_before_allocation): Likewise.
5079 * epoc-pei-arm.c: Don't rename bfd_arm functions.
5080 * pei-arm.c: Likewise.
5081 * elf32-mips.c (mips_elf_link_hash_table_create): Don't declare.
5082 (MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change.
5083 (mips_elf_got16_entry): Put parens around & in body of ==.
5084 (mips_elf_calculate_relocation): Correct test for empty string.
5085 * vms-gsd.c: Use _bfd_error_handler rather than fprintf to
5087 * vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf
5092 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
5093 as appropriate. Fill in structure initializations. Add variable
5094 initializations. Add casts.
5095 * dwarf1.c (parse_line_table): Change eachLine to unsigned long.
5096 (dwarf1_unit_find_nearest_line): Change i to unsigned long.
5098 * elf.c (bfd_elf_hash): Change parameter from unsigned char * to
5100 * elf-bfd.h (bfd_elf_hash): Update declaration.
5101 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts
5102 when calling bfd_elf_hash.
5106 * libbfd.c (bfd_put_8): Make it of type `void'.
5107 * bfd-in2.h: Regenerated.
5108 * elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize
5110 (_bfd_mips_elf_final_link): Likewise.
5112 * elflink.h (elf_link_read_relocs_from_section): Be type-correct.
5116 * config.bfd (hppa*-*-linux-gnu*): New target
5120 * elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify.
5121 (_bfd_mips_elf_create_dynamic_sections): New function.
5122 (_bfd_mips_elf_add_symbol_hook): Likewise.
5123 (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
5124 (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
5125 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
5126 (_bfd_mips_elf_gc_mark_hook): Likewise.
5127 (_bfd_mips_elf_gc_sweep_hook): Likewise.
5128 (_bfd_mips_elf_always_size_sections): Likewise.
5129 (_bfd_mips_elf_size_dynamic_sections): Likewise.
5130 (_bfd_mips_elf_check_relocs): Likewise.
5131 (_bfd_mips_elf_link_hash_table_create): Likewise.
5132 (_bfd_mips_elf_print_private_data): Likewise.
5133 (_bfd_mips_elf_link_output_symbol_hook): Likewise.
5134 (_bfd_mips_elf_final_link): Likewise.
5135 (_bfd_mips_elf_additional_program_headers): Likewise.
5136 (_bfd_mips_elf_modify_segment_map): Likewise.
5137 (_bfd_mips_elf_relocate_section): Likewise.
5138 * elf32-mips.c (mips_elf32_object_p): Move contents into
5139 _bfd_mips_elf_object_p.
5140 (mips_elf_additional_program_headers): Rename to
5141 _bfd_mips_elf_additional_program_headers.
5142 (mips_elf_modify_segment_map): Rename to
5143 _bfd_mips_elf_modify_segment_map.
5144 (elf_mips_abi_name): Change prototype.
5145 (mips_elf32_section_from_shdr): Merge into
5146 _bfd_mips_elf_section_from_shdr.
5147 (mips_elf32_section_processing): Merge into
5148 _bfd_mips_elf_section_processing.
5149 (mips_elf_final_link): Rename to _bfd_mips_elf_final_link. Invoke
5150 the right back-end ELF linker.
5151 (mips_elf_relocate_section): Rename to
5152 _bfd_mips_elf_relocate_section. Clean up. Adjust for 64-bit code.
5153 (mips_elf_link_output_symbol_hook): Rename to
5154 _bfd_mips_elf_link_output_symbol_hook.
5155 (mips_elf_create_dynamic_section): Rename to
5156 _bfd_mips_elf_create_dynamic_section.
5157 (mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs.
5158 Adjust for 64-bit code. Use mips_elf_got_section.
5159 (mips_elf_adjust_dynamic_symbol): Rename to
5160 _bfd_mips_elf_adjust_dynamic_symbol. Use
5161 mips_elf_allocate_dynamic_relocations.
5162 (mips_elf_finish_dynamic_symbol): Rename to
5163 _bfd_mips_elf_finish_dynamic_symbol. Use mips_elf_got_section.
5164 Adjust for 64-bit code.
5165 (mips_elf_finish_dynamic_sections): Rename to
5166 _bfd_mips_elf_finish_dynamic_sections. Adjust for 64-bit code.
5167 (mips_elf_always_size_sections): Rename to
5168 _bfd_mips_elf_always_size_sections.
5169 (mips_elf_add_symbol_hook): Rename to
5170 _bfd_mips_elf_add_symbol_hook.
5171 (mips_elf_next_lo16_addend): Constify.
5172 (mips_elf_calculate_relocation): Likewise.
5173 (mips_elf_obtain_contents): Likewise.
5174 (mips_elf_perform_relocation): Likewise.
5175 (mips_elf_create_dynamic_relocation): Likewise.
5176 (mips_elf_allocate_dynamic_relocations): New function.
5177 (MIPS_ELF_REL_DYN_SECTION_NAME): New macro.
5178 (MIPS_ELF_REL_SIZE): Likewise.
5179 (MIPS_ELF_DYN_SIZE): Likewise.
5180 (MIPS_ELF_GOT_SIZE): Likewise.
5181 (MIPS_ELF_SYM_SIZE): Likewise.
5182 (MIPS_ELF_LOG_FILE_ALIGN): Likewise.
5183 (MIPS_ELF_GET_WORD): Likewise.
5184 (MIPS_ELF_PUT_WORD): Likewise.
5185 (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
5186 (STUB_LW): Conditionalize for 64-bit value.
5187 (elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST
5189 (_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS].
5190 Check it for inconsistency.
5191 (_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit
5193 (_bfd_mips_elf_fake_sections): Remove duplicate handling of
5195 (mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE.
5196 (mips_elf_got_offset_from_index): Use misp_elf_got_section.
5197 (mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE.
5198 (mips_elf_local_got_index): Likewise.
5199 (mips_elf_got_page): Likewise.
5200 (mips_elf_got_info): Likewise.
5201 (mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split.
5202 (ELF_DYNAMIC_INTERPRETER): Handle 64-bit code.
5203 (mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN,
5204 instead of constant `2'.
5205 (mips_elf_create_got_section): Tidy. Use MIPS_ELF_GOT_SIZE.
5206 (mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN.
5207 (mips_elf_size_dynamic_sections): Use
5208 MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE,
5209 MIPS_ELF_ADD_DYNAMIC_ENTRY. Remove #if 0'd code.
5210 Adjust all releveant entries in elf backend table.
5211 * elf64-mips.c (mips_elf64_section_from_shdr): Remove.
5212 (mips_elf64_section_processing): Likewise.
5213 Adjust elf backend entries to use _bfd_mips_elf variants now
5216 * elflink.h (elf_link_create_dynamic_sections): Handle non-standard
5218 (size_dynamic_sections): Likewise.
5219 (elf_link_output_extsym): Likewise.
5220 * elf.c: (elf_fake_sections): Likewise.
5221 * libbfd.c (bfd_get): New macro.
5222 (bfd_put): Likewise.
5223 * bfd-in2.h: Regenerated.
5227 * elf-bfd.h (elf_size_info): Add hash_entry_size,
5228 int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out,
5229 wap_reloca_in, and swap_reloca_out.
5230 * elflink.h (elf_link_read_relocs_from_section): Adjust to handle
5231 multiple internal relocations per external relocation.
5232 (link_read_relocs): Likewise.
5233 (elf_bfd_final_link): Likewise.
5234 (elf_link_input_bfd): Likewise.
5235 (elf_gc_mark): Likewise.
5236 (elf_gc_smash_unused_vtentry_relocs): Likewise.
5237 * elfcode.h (elf_swap_dyn_out): Adjust type to match
5239 (size_info): Add entries for new fields.
5240 * elf64-mips.c (mips_elf64_swap_reloc_out): Enable.
5241 (mips_elf64_be_swap_reloc_in): New function.
5242 (mips_elf64_be_swap_reloc_out): Likewise.
5243 (mips_elf64_be_swap_reloca_in): Likewise.
5244 (mips_elf64_be_swap_reloca_out): Likewise.
5245 (mips_elf64_size_info): Add entries for new fields.
5249 * elflink.h (elf_bfd_final_link): Assert that section reloc_count
5250 field equals the new rel_count field.
5251 (elf_link_input_bfd): When doing a relocateable link, use the new
5252 rel_count field rather than the reloc_count field.
5253 (elf_reloc_link_order): Likewise.
5254 (elf_finish_pointer_linker_section): Likewise.
5257 * elflink.h (elf_merge_symbol): Permit a non-weak definition in a
5258 shared library to override a weak definition in a regular object.
5262 * libhppa.h: Revert July 2, 1999 patch.
5264 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors
5265 need to generate DLTIND relocations, not DLTREL relocations.
5269 * coffcode.h (coff_set_arch_mach_hook): Recognise arm 5
5271 (coff_set_flags): Recognise arm 5 architectures.
5273 * cpu-arm.c: Add support for strongarm and arm9 cpus.
5274 Add support for armv5 architecture.
5276 * archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T.
5278 * reloc.c: Add new, assembler only, ARM reloc:
5279 BFD_RELOC_ARM_ADRL_IMMEDIATE.
5281 * bfd-in2.h: Regenerate.
5285 * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter.
5286 (_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter.
5287 * elf.c (_bfd_elf_find_nearest_line): Pass it.
5288 * elf32-arm.h (elf32_arm_find_nearest_line): Likewise.
5289 * elf32-mips.c (ABI_64_P): New macro.
5290 (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P.
5291 (_bfd_mips_elf_find_nearest_line): Adjust call to
5292 _bfd_dwarf2_find_nearest_line.
5293 * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype.
5294 * libbfd.h: Regenerated.
5298 * config.bfd: Add * at the end of i[3456]86-*-unixware.
5302 * libhppa.h (HPPA_R_ARG_RELOC): Delete.
5303 (HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise.
5307 * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2
5309 (_bfd_elf_init_reloc_shdr): New function.
5310 * elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than
5311 bfd_alloc followed by memset.
5312 (_bfd_elf_init_reloc_shdr): New function, split out from ...
5313 (elf_fake_sections): Here.
5314 (assign_section_numbers): Assign section numbers for the second
5315 relocation section, if required.
5316 * elflink.h (elf_link_output_relocs): New function.
5317 (elf_link_size_reloc_section): Likewise.
5318 (elf_bfd_final_link): Use elf_link_size_reloc_section.
5319 (elf_link_input_bfd): Use elf_link_output_relocs.
5321 * elf32-mips.c (_bfd_mips_elf_fake_sections): Use
5322 _bfd_elf_init_reloc_shdr to initialize rel_hdr2.
5326 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL
5331 * elf32-mips.c (mips_elf_got_info): Move declaration before
5332 prototypes. Change global_gotsym to be a pointer to a hash entry,
5333 rather than a number index.
5334 (mips_elf_link_hash_entry): Move declaration before prototypes.
5335 (mips_elf_irix6_finish_dynamic_symbol): New function.
5336 (mips_elf_sign_extend): Likewise.
5337 (mips_elf_high): Likewise.
5338 (mips_elf_higher): Likewise.
5339 (mips_elf_highest): Likewise.
5340 (mips_elf_global_got_index): Likewise.
5341 (mips_elf_local_got_index): Likewise.
5342 (mips_elf_got_offset_from_index): Likeiwse.
5343 (mips_elf_record_global_got_symbol): Likewise.
5344 (mips_elf_got_page): Likewise.
5345 (mips_elf_next_lo16_addend): Likewise.
5346 (mips_elf_calculate_relocation): Likewise.
5347 (mips_elf_obtain_contents): Likewise.
5348 (mips_elf_perform_relocation): Likewise.
5349 (mips_elf_assign_gp): Likewise.
5350 (mips_elf_sort_hash_table_f): Likewise.
5351 (mips_elf_sort_hash_table): Likewise.
5352 (mips_elf_got_section): Likewise.
5353 (mips_elf_got_info): Likewise.
5354 (mips_elf_create_local_got_entry): Likewise.
5355 (mips_elf_got16_entry): Likewise.
5356 (mips_elf_create_dynamic_relocation): Likewise.
5357 (elf_mips_howto_table): Add description of R_MIPS_SCN_DISP.
5358 (mips_elf_final_gp): Use mips_elf_assign_gp.
5359 (_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols
5360 into SHN_SCOMMON automatically on IRIX6.
5361 (mips_elf_add_symbol_hook): Likewise.
5362 (mips_elf_relocate_section): Rewrite, using
5363 mips_elf_calculate_relocation and mips_elf_perform_relocation.
5364 (mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME.
5365 Don't deal with .rld_map on IRIX6.
5366 (mips_elf_create_got_section): Adjust use of global_gotsym. Set
5367 section flags appropriately for .got.
5368 (mips_elf_check_relocs): Handle IRIX6 relocations making use of
5369 the got. Call mips_elf_record_global_got_symbol and allocate
5370 local got space appropriately.
5371 (mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned
5372 char *. Rework calculation of GOT size. Sort dynamic symbol
5373 table entries so entries that do not require GOT entries appear at
5374 the beginning. Don't use DT_MIPS_HIPAGENO on IRIX6. Remove dead
5375 code dealing with DT_INIT and DT_FINI. Remove fiddling with
5377 (mips_elf_finish_dynamic_symbol): Adjust creation of global GOT
5379 (mips_elf_finish_dynamic_symbol): Use
5380 mips_elf_irix6_finish_dynamic_symbol.
5381 (mips_elf_finish_dynamic_sections): Correct off-by-one error
5382 setting DT_MIPS_UNREFEXTNO. Adjust setting of DT_MIPS_GOTSYM for
5383 change to global_gotsym. Set DT_MIPS_OPTIONS on IRIX6.
5387 * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a
5392 * elf32-arm.h (elf_backend_got_header_size): Define.
5393 (elf_backend_plt_header_size): Likewise.
5397 * elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined
5401 * elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as
5402 relocation function.
5403 * elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function.
5407 * elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro.
5408 (MIPS_ELF_OPTIONS_SECTION_NAME): Likewise.
5409 (MIPS_ELF_STUB_SECTION_NAME): Likewise.
5410 (_bfd_mips_elf_section_from_shdr): Use them.
5411 (_bfd_mips_elf_fake_sections): Likewise. Add .srdata to the list
5412 of GP-relative sections.
5413 (_bfd_mips_elf_set_section_contents): Use them.
5414 (_bfd_mips_elf_section_processing): Share code between .sdata and
5415 .lit4/.lit8 sections. Set appropriate flags for .srdata.
5416 (mips_elf_additional_program_headers): Add handling for
5417 PT_MIPS_OPTIONS segment on IRIX6.
5418 (mips_elf_modify_segment_map): Likeiwse.
5419 (mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI.
5420 Include the options sections on IRIX6. Don't look for GP-relative
5421 sections by name; use SHF_MIPS_GPREL instead.
5422 (ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for
5424 (mips_elf_create_dynamic_sections): Don't muck about with section
5425 alignments and such on IRIX6.
5426 (mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME.
5427 (mips_elf_size_dynamic_sections): Likewise. Adjust to handle the
5428 fact that ELF_DYNAMIC_INTERPRETER is no longer a constant. Use
5429 bfd_zalloc rather than bfd_alloc and memset.
5430 (mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME.
5431 Don't assert the existence of .rld_map on IRIX6.
5432 (mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME.
5434 * elf32-mips.c (mips_elf_adjust_dynindx): Remove.
5435 (mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx
5440 * elf32-mips.c (mips_elf_swap_msym_in): New function.
5441 (mips_elf_swap_msym_out): New function.
5442 (mips_elf_create_msym_section): Likewise.
5443 (MIPS_ELF_MSYM_SECTION_NAME): New macro.
5444 (_bfd_mips_elf_final_write_processing): Set sh_link for .msym.
5445 (_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM
5446 section not named .msym.
5447 (_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not
5448 .msym directly. Set appropriate attributes for the .msym
5450 (mips_elf_link_hash_entry): Add min_dyn_reloc_index field.
5451 (mips_elf_link_hash_newfunc): Clear it.
5452 (mips_elf_create_dynamic_sections): Create the .msym section
5454 (mips_elf_size_dynamic_sections): Allocate space for the
5455 .msym section. Add a DT_MIPS_MSYM entry.
5456 (mips_elf_finish_dynamic_symbol): Write out a .msym entry for
5458 (mips_elf_finish_dynamic_sections): Assign a value for
5459 DT_MIPS_MSYM. Add .msym entries for the section symbols as well.
5461 * elf32-mips.c (irix_compat_t): New enumeration.
5462 (ABI_N32_P): New macro.
5463 (IRIX_COMPAT): Likewise.
5464 (SGI_COMPAT): Implement in terms of IRIX_COMPAT.
5465 (mips_elf_relocate_section): Fix typo.
5469 * peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections
5470 as writable PE sections.
5474 * dwarf2.c (struct arange): New type.
5475 (struct comp_unit): Replace LOW and HIGH by member ARANGE.
5476 (arange_add): New function.
5477 (decode_line_info): Keep track of address ranges that a compilation
5479 (comp_unit_contains_address): Return true if address is contained
5480 in _any_ of the address ranges associated with a compilation unit.
5481 (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line
5482 on the first comp_unit that contains the address.
5486 * dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer.
5487 (decode_line_info): Add variable STASH and initialize it to point
5488 to the per-bfd dwarf2_debug info. Remove static variable
5489 dwarf_line_buffer and use stash->dwarf_line_buffer in its place.
5493 * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic
5494 shared library to have an undefined symbol.
5497 * elf32-ppc.c (ppc_elf_relocate_section): Fix last patch.
5501 * elf-hppa.c (elf_hppa_final_write_processing): New function.
5502 * elf32-hppa.c: Remove everything related to symbol extension
5503 sections & records. Use the common elf_hppa_final_write_processing.
5507 * elflink.h (size_dynamic_sections): Use user-specified init/fini
5508 functions instead of _init/_fini if requested.
5512 * elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link
5518 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx
5520 (ppc_elf_finish_dynamic_sections): Check for positive section
5521 dynindx field, rather than comparing against -1.
5522 (ppc_elf_relocate_section): Only return false if undefined_symbol
5523 or reloc_overflow fail, not always upon encountering an error.
5527 * elflink.h (link_read_relocs): Explicitly cast external_relocs to
5528 bfd_byte * before performing pointer arithmetic.
5532 * elf-hppa.h: New file. Common stuff for elf32 and elf64 PA
5534 * elf32-hppa.c: Include elf-hppa.h.
5535 (ARCH_SIZE): Define.
5536 (elf_hppa_reloc_type_lookup): Delete. Found in the common code
5538 (elf32_hppa_info_to_howto): Similarly.
5539 (elf_hppa_howto_table): Similarly.
5540 (elf_hppa_reloc_type_lookup): Similarly.
5541 (hppa_elf_gen_reloc_type): Similarly.
5542 * elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete.
5546 * elf32-v850.c (v850_elf_final_link_relocate): Catch overflow
5547 handling R_V850_22_PCREL relocation.
5551 * coff-arm.c (arm_emit_base_file_entry): Explicitly declare return
5556 * section.c (_bfd_strip_section_from_output): Ignore sections
5557 DISCARDed by the link script.
5561 * elflink.h (elf_link_remove_section_and_adjust_dynindices):
5562 Remove unused local variable spp.
5564 * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if
5565 the entry symbol is not set.
5569 * elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust
5570 GPDISP or LITUSE in a relocatable link.
5574 * dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc.
5575 * (alloc_dwarf1_func): Likewise.
5579 * libhppa.h: Fix various formatting errors.
5580 (assemble_3); Rewrite using CATENATE.
5581 (assemble_17): Fix various bugs.
5585 * elf32-mcore.c (R_MCORE_RAW): Fix definition.
5589 * section.c (SEC_SHORT): Define.
5590 * bfd-in2.h: Rebuild.
5594 * elflink.h (elf_link_remove_section_and_adjust_dynindices):
5595 Remove abfd parameter. Use _bfd_strip_section_from_output.
5596 (bfd_elf_size_dynamic_sections): Adjust callers accordingly.
5598 * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function.
5599 * elflink.c (_bfd_elf_link_adjust_dynindx): Define it.
5600 * elflink.h (elf_link_remove_section_and_adjust_dynindices): New
5602 (bfd_elf_size_dynamic_sections): Use it.
5606 * elf32-i386.c (elf_howto_table): Change R_386_PC8 from
5607 complain_overflow_bitfield to complain_overflow_signed.
5611 * elflink.h (elf_link_read_relocs_from_section): New function,
5613 (elf_link_read_relocs): Here. Use it for both relocation
5618 * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume
5619 asect->reloc_count is valid.
5623 * elf32-mips.c (mips_elf32_section_processing): Permit a
5624 SHT_MIPS_REGINFO section to have a size of 0.
5628 * config.bfd (alpha*-*-freebsd*): New target.
5629 (i[3456]86-*-freebsd*): Now defaults to ELF.
5633 * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to
5634 wrap if the relocation covers the high bit of an address.
5636 * dwarf2.c (decode_line_info): Remove unused variable first_time.
5640 * elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std
5641 instead of R_SPARC_max.
5642 (sparc64_elf_info_to_howto): Likewise.
5643 * elf32_sparc.c (elf32_sparc_relocate_section): Likewise.
5644 (elf32_sparc_info_to_howto): Likewise; handle vtable relocations.
5648 * section.c (_bfd_strip_section_from_output): Remove output
5649 sections with no initial link_order.
5653 * elf32-m88k.c (ELF_MAXPAGESIZE): Define.
5657 * Makefile.am (SOURCE_HFILES): Add missing headers.
5658 * Makefile.in: Regenerated.
5662 * elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize
5667 * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of
5668 range undefweak symbols.
5669 * hash.c: Add missing comma after @xref{}
5670 * linker.c: Likewise.
5674 * elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message
5676 * elf32-gen.c (ELF_MAXPAGESIZE): Define.
5677 * elf32-i860.c (ELF_MAXPAGESIZE): Define.
5678 * elf32-i960.c (ELF_MAXPAGESIZE): Define.
5679 * elf64-gen.c (ELF_MAXPAGESIZE): Define.
5683 * Makefile.am: Rebuild dependencies.
5684 (BFD32_BACKENDS): Add dwarf1.lo.
5685 (BFD32_BACKENDS_CFILES): Add dwarf1.c.
5686 * Makefile.in: Rebuild.
5690 * Makefile.am: Add epoc-arm-pe target.
5691 * Makefile.in: Regenerate.
5692 * pe-arm.c: Only redefine interworking function names if they have
5693 not already been redefined.
5694 * pei-arm.c: Only redefine interworking function names if they have
5695 not already been redefined.
5696 * epoc-pe-arm.c: Redefine interworking function names to avoid a
5698 * epoc-pei-arm.c: Redefine interworking function names to avoid a
5703 * elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1.
5707 * elf.c (elf_fake_sections): Undo change of 1999-05-10.
5711 * elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of
5712 start / stop for recalculating of r_addend of R_SH_SWITCH*.
5716 * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32
5717 in other text sections.
5721 * libbfd.c (_bfd_generic_verify_endian_match): New function.
5722 * libbfd-in.h (_bfd_generic_verify_endian_match): Declare.
5723 * libbfd.h: Regenerate.
5724 * coff-sh.c (sh_merge_private_data): Delete.
5725 (coff_bfd_merge_private_bfd_data): Change to
5726 _bfd_generic_verify_endian_match.
5727 (elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define.
5731 * elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE.
5735 * bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct
5737 (bfd_elf32_arm_process_before_allocation): Likewise.
5738 * bfd-in2.h: Rebuild.
5742 * dwarf2.c (struct line_info): Add member END_SEQUENCE to keep
5743 track of end_sequence markers.
5744 (add_line_info): Add END_SEQUENCE arg.
5745 (decode_line_info): Don't try to infer lo_pc and hi_pc from the
5746 debug-line info---it doesn't work right if a compilation unit
5747 consists of multiple discontiguous code-sequences. It would be
5748 worthwhile to optimize for the common case where a compilation
5749 unit results in a contiguous set of code sequences, but this is
5750 quite tricky to get right for arbitrary DWARF2 files.
5751 (lookup_address_in_line_info_table): Don't use the last line entry
5752 for a compilation unit for anything with an address higher than
5753 this line entry. Also, check for end_sequence markers to
5754 correctly handle discontinuities.
5755 (_bfd_dwarf2_find_nearest_line): When checking previously loaded
5756 compilation units, check all compilation units with each->high==0
5757 just like when reading compilation units.
5759 * dwarf2.c (decode_line_info): Initialize table->files and
5760 table->last_line to NULL to avoid segfaults due to random
5761 values in these members.
5762 (concat_filename): Check for out-of-range file number before
5763 indexing filename table. Segfaults suck.
5765 * dwarf2.c (decode_line_info): Don't truncate address to least
5766 significant 32 bits (breaks 64 bit targets).
5767 (lookup_address_in_function_table): Ditto.
5768 (comp_unit_contains_address): Ditto.
5772 * elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR.
5773 * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
5774 (mips_elf64_howto_table_rela): Likewise.
5776 * elfcode.h (elf_slurp_reloc_table_from_section): New function,
5778 (elf_slurp_reloc_table): Here. Use it to handle the case where a
5779 single section has two associated relocation sections.
5783 * coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if
5784 COFF_WITH_PE defined.
5788 * pe-arm.c: Rename global arm interworking functions to avoid name
5789 collision when all targets BFD is built.
5794 * elf-bfd.h (elf_backend_data): Remove use_rela_p. Add
5795 may_use_rel_p, may_use_rela_p, default_use_rela_p.
5796 (bfd_elf_section_data): Add use_rela_p.
5797 * elf.c (bfd_section_from_shdr): Set use_rela_p appropriately.
5798 (_bfd_elf_new_section_hook): Likewise.
5799 (elf_fake_sections): Use may_use_rela_p, etc., instead of
5801 (_bfd_elf_copy_private_section_data): Copy use_rela_p.
5802 * elfcode.h (write_relocs): Determine whether or not use rela
5803 relocs based on the relocation section header.
5804 * elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p
5805 instead of use_rela_p.
5806 * elfxx-target.h (elf_backend_may_use_relp): New macro.
5807 (elf_backend_may_use_rela_p): Likewise.
5808 (elf_backend_default_use_rela_p): Likewise.
5809 (elfNN_bed): Use them.
5813 * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096.
5817 * reloc.c (BFD_RELOC_MIPS_SUB): New relocation.
5818 (BFD_RELOC_MIPS_GOT_PAGE): Likewise.
5819 (BFD_RELOC_MIPS_GOT_OFST): Likewise.
5820 (BFD_RELOC_MIPS_GOT_DISP): Likewise.
5821 * bfd-in2.h: Regenerated.
5822 * libbfd.h: Likewise.
5823 * elf32-mips.c (mips_info_to_howto_rela): New function.
5824 (USE_REL): Adjust for new conventions.
5825 (MINUS_ONE): New macro.
5826 (elf_mips_howto_table): Add R_MIPS_SUB.
5827 (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST,
5829 (mips_elf_final_write_processing): Set sh_link, not sh_info, for a
5830 .MIPS.content section.
5831 (_bfd_mips_elf_fake_sections): Treat all sections that begin
5832 with .MIPS.content as .MIPS.content sections. Set
5833 SHF_MNIPS_NOSTRIP for such section.
5834 (elf_info_to_howto): Define to mips_info_to_howto_rela.
5835 * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE,
5836 MIPS_GOT_OFST, and MIPS_GOT_DISP.
5840 * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized
5843 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous
5848 * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of
5849 1993-03-25 (!!). Take into account the bitmasks for the reloc so
5850 the addend does not overflow into the rest of the word.
5854 * bfd-in.h: Amend prototype for
5855 bfd_elf32_arm_process_before_allocation .
5856 * bfd-in.h: Regenerate.
5858 * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of
5859 elements in a fixed sized array.
5860 (ARM_ELF_ABI_VERSION): Define.
5861 (ARM_ELF_OS_ABI_VERSION): Define.
5862 (R_ARM_THM_ABS5): Fix rightshift and size.
5863 (R_ARM_THM_PC22): Fix size.
5864 (R_ARM_PLT32): Define Howto.
5865 (find_howto): New function: Locate a howto based on a reloc
5867 (elf32_arm_info_to_howto): Use find_howto if necessary.
5868 (elf32_arm_reloc_map): Change type of field bfd_reloc_val to
5869 bfd_reloc_code_real_type.
5870 (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT
5871 and BFD_RELOC_VTABLE_ENTRY.
5872 (elf32_arm_reloc_type_lookup): Use find_howto if necessary.
5874 * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of
5875 elements in a fixed sized array.
5876 (ARM_ELF_ABI_VERSION): Define.
5877 (ARM_ELF_OS_ABI_VERSION): Define.
5878 (R_ARM_THM_ABS5): Fix rightshift and size.
5879 (R_ARM_THM_PC22): Fix size.
5880 (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto.
5881 (elf32_arm_reloc_map): Change type of field bfd_reloc_val to
5882 bfd_reloc_code_real_type.
5884 * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field:
5885 no_pipeline_knowledge.
5886 (elf32_arm_link_hash_create): Initialise new field to zero.
5887 (bfd_elf32_arm_process_before_allocation): Add new paraemter:
5888 no_pipeline_knowledge. Use this parameter to initialise the field
5889 in the globals data structure.
5890 (elf32_arm_final_link_relocate): Only add in pipeline offset if
5891 no_pipeline_knowledge is false and the binary is from an old
5893 (elf32_arm_merge_private_data): Generate an error if an attempt is
5894 made to link together big endian and little endian code.
5895 (elf32_arm_post_process_headers): New function: Initialise the
5896 EI_OSABI and EI_ABIVERSION fields of the newly created ELF program
5898 (elf_backend_post_process_headers): Define.
5902 * elf-bfd.h (struct elf_backend_data): Add new field:
5903 elf_backend_post_process_headers.
5905 * elfxx-target.h (elf_backend_post_process_headers): Define to
5906 NULL if not already defined.
5907 (elfNN_bed): Initialise elf_backend_post_process_headers field.
5909 * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields
5911 (_bfd_elf_compute_section_file_positions): Call
5912 elf_backend_post_process_headers if defined.
5916 * configure.in: Check whether getuid and getgid exist.
5917 * archive.c: Define getuid and getgid as macros if HAVE_GETUID or
5918 HAVE_GETGID are not defined, respectively.
5919 (bfd_write_armap): Don't special case on _WIN32 for getuid and
5921 * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*.
5922 * configure, config.in: Rebuild.
5926 * elf32-i960.c: New file.
5927 * elf.c (prep_headers): Handle bfd_arch_i960.
5928 * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec.
5929 * config.bfd (i960-*-elf*): New target.
5930 * configure.in (bfd_elf32_i960_vec): New target vector.
5931 * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo.
5932 (BFD32_BACKENDS_CFILES): Add elf32-i960.c.
5933 * Makefile.in, aclocal.m4, configure: Rebuild.
5937 * elfarm-oabi.c (elf32_arm_howto_table): Add entry for
5939 (find_howto): New function: Find entries in the
5940 elf32_arm_howto_table.
5941 (elf32_arm_info_to_howto): Use find_howto if the entry cannot be
5943 (elf32_arm_reloc_type_lookup): Add lookup for
5944 BFD_RELOC_ARM_PLT32.
5948 * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function.
5949 (elf32_arm_link_hash_table_create): Use above function as the
5950 constructor for hash table entries.
5951 (elf32_arm_relocate_section): Avoid crash when there is no output
5953 (elf32_arm_final_link_relocate): New parameter h.
5954 (elf32_arm_relocate_section): Pass symbol hash entry to above
5956 (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct
5961 * coff-arm.c (coff_arm_relocate_section): Don't emit
5962 base file entries for pc-relative values.
5966 * peicode.h (coff_swap_sym_in): When we create the actual section
5967 to reflect the not-there section C_SECTION symbols refer to,
5968 change the symbol class to C_STAT as the section is now really
5973 * elf32-arm.h (elf32_arm_relocate_section): Undo change of
5978 * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed
5980 * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and
5981 F_ARM_3M labels. Changed F_PIC_INT to F_PIC.
5985 * coff-mcore.c (in_reloc_p): Reinstate.
5989 * reloc.c (BFD_RELOC_MCORE_RVA): Define.
5990 * bfd-in2.h: Regenerate.
5991 * coff-mcore.c (in_reloc_p): Remove defintion.
5992 (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA.
5993 (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to
5994 IMAGE_REL_MCORE_RVA.
5995 (coff_mcore_rtype_to_howto): Add special processing for
5996 IMAGE_REL_MCORE_RVA.
5997 (coff_mcore_relocate_section): Add support for
5998 IMAGE_REL_MCORE_RVA.
5999 * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE.
6000 (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to
6002 (mcore_elf_relocate_section): Delete redundant case labels.
6006 * elf32-arm.h (elf32_arm_relocate_section): Fix operator
6007 precedence between bit-and and comparison.
6011 * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to
6012 list of target formats (targ_selvecs).
6013 (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets.
6014 (powerpcle*-*rtems*, sh-*-rtemself*): New targets.
6018 * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a
6019 reasonable mode until "ar x" is smart enough to skip it (fixes
6020 gcc/libgcc.a builds on mips-ecoff targets
6022 * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed
6023 to work. Hack to support MS import libraries, which use different
6024 COMDAT types than GNU.
6025 (coff_slurp_symbol_table): C_SECTION symbols are local; they refer
6026 to implied zero-length sections (see peicode below)
6027 * coffgen.c (coff_get_normalized_symtab): Properly read long MS
6028 filename symbols, which use one *or more* auxents.
6029 * coffswap.h (coff_swap_aux_in): ditto
6030 * peicode.h (coff_swap_sym_in): Build the implied zero-length
6035 * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false
6036 for all relocations.
6040 * bfd-in.h (bfd_arm_allocate_interworking_sections): Static
6041 if COFF_IMAGE_WITH_PE.
6042 (bfd_arm_process_before_allocation): Likewise.
6043 (bfd_arm_get_bfd_for_interworking): Likewise.
6044 * coff-arm.c: Likewise.
6045 * bfd-in2.h: Regenerate.
6046 * configure.in (armpe_little_vec): Remove coff-arm.lo.
6047 (armpe_big_vec): Likewise.
6048 * configure: Rebuild.
6052 * elf.c (elf_fake_sections): Check for .rel. as start of rel
6053 section, not just .rel. Same for .rela.
6057 * coff-mcore.c (coff_mcore_relocate_section): Replace assert about
6058 endianism with an error message.
6062 * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer
6063 assignment from "unsigned char *" to "char *".
6064 (decode_line_info): Likewise for dwarf_line_buffer assignment.
6068 * coff-arm.c (coff_arm_relocate_section): Add one to
6069 address of ARM_RVA32 thumb functions.
6073 * elf32-m68k.c (elf32_m68k_set_private_flags): New.
6074 (elf32_m68k_copy_private_bfd_data): New.
6075 (elf32_m68k_merge_private_bfd_data): New.
6076 (elf32_m68k_print_private_bfd_data): New.
6077 (CPU32_FLAG): Define.
6078 (PLT_CPU32_ENTRY_SIZE): Define.
6079 (elf_cpu32_plt0_entry): Declare.
6080 (elf_cpu32_plt_entry): Declare.
6081 (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries.
6082 (elf_m68k_finish_dynamic_symbol): Likewise.
6083 (elf_m68k_finish_dynamic_sections): Likewise.
6084 (elf_backend_plt_header_size): Remove definition.
6085 (bfd_elf32_bfd_copy_private_bfd_data): Define.
6086 (bfd_elf32_bfd_merge_private_bfd_data): Define.
6087 (bfd_elf32_bfd_set_private_flags): Define.
6088 (bfd_elf32_bfd_print_private_bfd_data): Define.
6092 * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE
6093 and R_LONG_PCREL_MODE.
6097 * coff-mcore.c (coff_mcore_relocate_section): Fix typos.
6101 * elf32-sh.c (sh_elf_relocate_section): Include relocation addend
6102 in relocation calculation.
6106 * aclocal.m4, configure: Updated for new version of libtool.
6110 * coff-mcore.c: Add support for mcore relocs.
6114 * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): Scrap the
6115 incorrect use EF_MIPS_xxBITPTRS.
6119 * elf64-alpha.c (elf64_alpha_relax_section): Remove unused local
6122 * bfd-in2.h: Rebuild.
6123 * libbfd.h: Rebuild.
6127 * coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform.
6128 (coff_arm_relocate_section): Add ARM26D transform. Only
6129 change to ARM26D for relocateable links.
6133 * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): New.
6134 (bfd_elf32_bfd_print_private_bfd_data): New.
6138 * elf32-arm.h (elf32_arm_final_link_relocate): For R_ARM_THM_ABS5,
6139 refetch addend if USE_REL, add many comments regarding current state.
6140 For R_ARM_THM_PC22, refetch addend if USE_REL, simplify.
6141 * elfarm-nabi.c (elf32_arm_howto_table): For R_ARM_THM_ABS5, fix
6142 size and rightshift. For R_ARM_THM_PC22, fix bitsize.
6143 * elfarm-oabi.c (elf32_arm_howto_table): Ditto.
6147 * elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Zero `debug'.
6148 * elf64-alpha.c (elf64_alpha_read_ecoff_info): Likewise.
6152 * dwarf2.c (decode_line_info): Don't truncate address to least
6153 significant 32 bits (breaks 64 bit targets).
6154 (lookup_address_in_function_table): Ditto.
6155 (comp_unit_contains_address): Ditto.
6159 * coff-arm.c (arm_emit_base_file_entry): New routine.
6160 (A2T3_OFFSET): Define.
6161 (T2A3_OFFSET): Define.
6162 (coff_arm_relocate_section): Emit base file entries for interworking
6167 * elfarm-nabi.c (elf32_arm_howto_table): Add dummy entries for
6168 relocs 17 through 19.
6172 * elfcode.h: Remove fnmatch.h.
6173 * elflink.h (elf_link_assign_sym_version): Call back to ld
6174 instead of calling fnmatch.
6176 * config.bfd (i?86-*-beoself): Include pe vecs.
6180 * elf32-i386.c (elf_i386_finish_dynamic_sections): Allow .plt
6185 * elf32-i386.c (elf_i386_relocate_section): Mind no_undefined
6186 when trying to resolve dynamic symbol references.
6187 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
6188 * elf32-mips.c (mips_elf_relocate_section): Likewise.
6189 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
6190 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
6191 * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
6192 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
6193 * elflink.h (elf_link_output_extsym): Likewise.
6197 * section.c (_bfd_strip_section_from_output): New function moved from
6198 * elf64-alpha.c (elf64_alpha_strip_section_from_output): ... here.
6199 * elf32-i386.c (elf_i386_size_dynamic_sections): Use it.
6200 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
6201 * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise.
6202 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
6203 * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
6204 * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
6205 * bfd-in2.h: Update.
6209 * elf64-sparc.c: Fix incorrect calls to bfd_check_overflow.
6213 * coff-mcore.c: New File: Support for mcore-pe targets.
6214 * cpu-mcore.c: New File: Support for mcore targets.
6215 * elf32-mcore.c: New File: Support for mcore-elf target.
6216 * pe-mcore.c: New File: Definitions for mcore-pe target.
6217 * pei-mcore.c: New File: Definitions for mcore-pei target.
6218 * Makefile.am: Add support for MCore targets.
6219 * Makefile.in: Regenerate.
6220 * config.bfd: Add support for MCore targets.
6221 * configure.in: Add support for MCore targets.
6222 * configure: Regenerate.
6223 * archures.c: Add support for MCore architecture.
6224 * bfd-in2.h: Regenerate.
6225 * coffcode.h: Add support for mcore-pe targets.
6226 * elf.c: Add support for mcore-elf target.
6227 * reloc.c: Add support for MCore relocs.
6228 * targets.c: Add support for MCore targets.
6232 * elfarm-nabi.c (elf32_arm_howto_table): Add entries for
6233 R_ARM_XPC25 and R_ARM_THM_XPC22.
6234 (elf32_arm_reloc_map): Remove redundant entries.
6238 * sysdep.h (LC_MESSAGES): Never define.
6242 * reloc.c (bfd_check_overflow): Add addrsize parameter. Change
6243 all callers. Rewrite completely.
6244 (_bfd_relocate_contents): Rewrite overflow checking.
6245 * bfd-in2.h: Rebuild.
6250 * elf32-ppc.c (ppc_elf_howto_raw): Set R_PPC_GOT16_LO,
6251 R_PPC_PLT16_LO and R_PPC_SECTOFF_LO to be complain_overflow_dont.
6252 Set R_PPC_PLT16_HA, R_PPC_SECTOFF_HA and R_PPC_EMB_NADDR16_HA to
6253 have a rightshift of 16 and use ppc_elf_addr16_ha_reloc.
6254 * ppcboot.c (ppcboot_vec): Use little endian routines for
6257 * elf.c (elfcore_strndup): Only define if it will be used.
6258 * elf32-ppc.c (ppc_elf_relax_section): Remove unused locals irel
6260 (ppc_elf_check_relocs): Remove unused local i.
6261 (ppc_elf_gc_mark_hook): Add default case to switch.
6264 * srec.c (srec_scan): Accept \r in symbol definitions.
6265 (srec_object_p): Set HAS_SYMS if we saw any symbols.
6266 (symbolsrec_object_p): Likewise.
6270 * config.bfd: Add mips*el-*-vxworks* and mips*-*-vxworks*.
6274 * dwarf1.c (parse_line_table): Remove unused locals last_pc and
6276 * elf-bfd.h (_bfd_elfcore_section_from_phdr): Declare.
6277 * elf32-i386.c (elf_i386_gc_mark_hook): Add default case to
6279 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove unused
6281 * syms.c (_bfd_stab_section_find_nearest_line): Remove unused
6286 * config.bfd: Add support for arm-epoc-pe target.
6287 * configure.in: Add support for arm-epoc-pe target.
6288 * configure: Regenerate.
6289 * targets.c: Add support for arm-epoc-pe target.
6290 * coff-arm.c: Allow header files to override definition of
6291 TARGET_UNDERSCORE and USER_LABEL_PREFIX.
6292 * pe-arm.h: Allow previous header files to override definition of
6293 TARGET_LITTLE_SYM and TARGET_BIG_SYM.
6294 * pei-arm.h: Allow previous header files to override definition of
6295 TARGET_LITTLE_SYM and TARGET_BIG_SYM.
6296 * epoc-pe-arm.c: New file. Support arm-epoc-pe target.
6297 * epoc-pei-arm.c: New file. Support arm-epoc-pei target.
6301 * elf.c (elf_map_symbols): Handle the case where section
6302 symbols are generated for content-less sections which are
6303 not mapped to the output file.
6305 * linker.c: Replace direct references to fields in BFD structure
6306 with accessor macros.
6308 * elflink.h: Replace direct references to fields in BFD structure
6309 with accessor macros.
6313 * config.bfd: Eliminate redundancy in checks for Linux/ARM.
6315 * elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into
6316 account when adjusting section symbols during a partial link.
6320 * coff-sparc.c (struct coff_reloc_map): Change type of field
6321 'bfd_reloc_val' to bfd_reloc_code_real_type.
6322 * elf-m10200.c (struct mn10200_reloc_map): Ditto.
6323 * elf-m10300.c (struct mn10300_reloc_map): Ditto.
6324 * elf32-arc.c (struct arc_reloc_map): Ditto.
6325 * elf32-d10v.c (struct d10v_reloc_map): Ditto.
6326 * elf32-d30v.c (struct d30v_reloc_map): Ditto.
6327 * elf32-fr30.c (struct fr30_reloc_map): Ditto.
6328 * elf32-m32r.c (struct m32r_reloc_map): Ditto.
6329 * elf32-sh.c (struct elf_reloc_map): Ditto.
6330 * elf32-sparc.c (struct elf_reloc_map): Ditto.
6331 * elf32-v850.c (struct v850_reloc_map): Ditto.
6332 * elf64-sparc.c (struct elf_reloc_map): Ditto.
6333 * elfarm-nabi.c (struct elf32_arm_reloc_map): Ditto.
6334 * elfarm-oabi.c (struct elf32_arm_reloc_map): Ditto.
6338 * syms.c (_bfd_stab_section_find_nearest_line): Changed this
6339 function so source-level assembly works. If multiple N_SOs
6340 are seen without and N_FUNs, create an indextable entry with
6341 a NULL function name.
6345 * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data) Allow merging
6346 of certian similar cpus.
6350 * elf32-mips.c (_bfd_mips_elf_final_write_processing):
6351 Add the 5000. Change the architecture for the 5400 to mips4.
6352 (elf_mips_mach): Add r5000.
6356 * cpu-i960.c (scan_i960_mach): Recognize i960:ka_sa and i960:kb_sb.
6360 * binary.c (binary_set_section_contents): Generate warning about
6361 huge file offsets for any section that will occupy file space, not
6362 just those that are loadable.
6366 * libbfd.h: Regenerate after Nick Clifton's Feb 17 changes.
6370 * elf32-ppc.c: Add ppc_elf_relax_section() for the ld option mpc860c0.
6374 * elf-bfd.h (ELF_LINK_HASH_REF_REGULAR_NONWEAK): Define.
6375 * elflink.h: Revert all changes since Feb 16. Instead:
6376 (elf_link_add_object_symbols): Set REF_REGULAR_NONWEAK flag if
6377 appropriate. Copy it to version symbols.
6378 (elf_fix_symbol_flags): Set REF_REGULAR_NONWEAK for non ELF
6379 symbols if appropriate.
6380 (elf_adjust_dynamic_symbol): Set REF_REGULAR_NONWEAK for weakdef
6381 symbol if appropriate.
6382 (elf_link_output_extsym): If symbol is marked as undefined, and
6383 has no nonweak references, mark it as weak undefined.
6387 * elflink.h (elf_merge_symbol): When overriding a dynamic
6388 definition with a weak undefined symbol, set NEEDS_PLT if it is a
6390 (elf_link_add_object_symbols): Don't copy the other field if we
6395 * elflink.h (elf_merge_symbol): Do not merge any symbol from a
6396 shared object with a weak undefined symbol.
6400 * elfarm-nabi.c: Set partial_inplace back to false.
6404 * coff-arm.c (TARGET_UNDERSCORE): Re-enable.
6405 (USER_LABEL_PREFIX): Set to "_".
6407 The following patches are from: Scott Bambrough
6410 * libaout.h (M_ARM6_NETBSD): Set to 143.
6412 * reloc.c: Add ARM PIC relocs: BFD_RELOC_ARM_GOT12,
6413 BFD_RELOC_ARM_GOT32, BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_COPY,
6414 BFD_RELOC_ARM_GLOB_DAT, BFD_RELOC_ARM_PLT32,
6415 BFD_RELOC_ARM_RELATIVE, BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC.
6416 * bfd-in2.h: Regenerate.
6418 * elfarm-nabi.c (elf32_arm_howto_table): Set partial_inplace to
6419 'true' as REL relocs are now being used. Add new PIC relocs:
6420 R_ARM_COPY, R_ARM_GLOB_DAT, R_ARM_JUMP_SLOT, R_ARM_RELATIVE,
6421 R_ARM_GOTOFF, R_ARM_GOTPC, R_ARM_GOT32, R_ARM_PLT32.
6423 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Check byte order
6425 (elf32_arm_final_link_relocate): Change parameters so that entire
6426 reloc is passed. Add support for PIC relocs.
6427 (elf32_arm_relocate_section): Pass entire reloc to
6428 elf32_arm_final_link_relocate.
6429 (elf32_arm_check_relocs): Handle new PIC relocs.
6430 (elf32_arm_adjust_dynamic_symbol): New function.
6431 (elf32_arm_size_dynamic_sections): New function.
6432 (elf32_arm_discard_copies): New function.
6433 (elf32_arm_finish_dynamic_symbol): New function.
6434 (elf32_arm_finish_dynamic_sections): New function.
6435 (ELF_MAXPAGE_SIZE): Define.
6436 (bfd_elf32_bfd_reloc_type_lookup): Define.
6437 (elf_backend_relocate_section): Define.
6438 (elf_backend_adjust_dynamic_symbol): Define.
6439 (elf_backend_create_dynamic_sections): Define.
6440 (elf_backend_finish_dynamic_symbol): Define.
6441 (elf_backend_finish_dynamic_sections): Define.
6442 (elf_backend_size_dynamic_sections): Define.
6443 (elf_backend_plt_readonly): Define.
6444 (elf_backend_want_got_plt): Define.
6445 (elf_backend_want_plt_sym): Define.
6449 * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo
6450 sections SEC_LINK_ONCE and SEC_LINK_DUPLICATES_SAME_SIZE.
6451 (_bfd_mips_elf_fake_sections): Likewise.
6455 * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections,
6456 bfd_elf32_arm_get_bfd_for_interworking,
6457 bfd_elf32_arm_process_before_allocation): Define to avoid clash
6460 * elf32-arm.h: Don't declare elf32_arm_info_to_howto.
6461 (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
6462 elf32_arm_find_nearest_line): Make them static.
6466 * elflink.h (elf_merge_symbol): Add pflags parameter. Change all
6467 callers. Do not merge a definition from a shared object with a
6468 weak undefined symbol.
6469 (elf_link_add_object_symbols): Do not change the symbol type or
6470 size if the old symbol overrides the new one.
6474 * config.bfd: Add support for strongarm target.
6478 * elf32-m68k.c (reloc_map): Use the correct types for the struct
6479 fields instead of unsigned char.
6483 * Makefile.am: Rebuild dependencies.
6484 * Makefile.in: Rebuild.
6488 * configure.in: Change AC_PREREQ to 2.13. Remove AM_CYGWIN32.
6489 Change AM_EXEEXT to AC_EXEEXT and AM_PROG_INSTALL to
6490 AC_PROG_INSTALL. Add comments to uses of AC_DEFINE.
6491 * acinclude.m4: Add comments to uses of AC_DEFINE.
6492 * acconfig.h: Remove.
6493 * configure: Rebuild with current autoconf/automake.
6494 * aclocal.m4: Likewise.
6495 * config.in: Likewise.
6496 * Makefile.in: Likewise.
6500 * libbfd.c (real_read): don't call fread for zero bytes. This
6501 covers up a bug (or misuse of bfd) that's exposed by Solaris.
6505 * elf32-mips.c (mips_elf_relocate_section): Insure that the target
6506 of a jump is in the current 256 MB region.
6510 * format.c (bfd_check_format_matches): Change last patch to only
6511 take effect for the binary target.
6515 * elf32-i386.c (elf_i386_reloc_type_lookup): Add BFD_RELOC_CTOR.
6519 * elf32-fr30.c (fr30_elf_check_relocs): New routine.
6523 * format.c (bfd_check_format_matches): If the target was
6524 previously specified, don't check other targets when checking for
6529 * elf32-arm.h (elf32_arm_reloc_map): Removed.
6530 (elf32_arm_reloc_type_lookup): Removed
6531 * elfarm-nabi.c (elf32_arm_reloc_map): New.
6532 (elf32_arm_reloc_type_lookup): New.
6533 * elfarm-oabi.c (elf32_arm_reloc_map): New.
6534 (elf32_arm_reloc_type_lookup): New.
6538 * elfarm-nabi.c: Renamed from elf32-arm-newabi.c.
6539 * elfarm-oabi.c: Renamed from elf32-arm-oldabi.c
6540 * Makefile.am: Use new files.
6541 * Makefile.in: Regenerate.
6542 * configure.in: Use new files.
6543 * configure: Regenerate.
6547 * elf32-fr30.c (fr30_elf_gc_mark_hook): New function.
6548 (fr30_elf_gc_sweep_hook): New function.
6549 (elf_backend_can_gc_sections): Define.
6553 * targets.c (bfd_target_vector): Add bfd_elf32_littlearm_oabi_vec
6554 and bfd_elf32_bigarm_oabi_vec.
6558 * Makefile.am (elf32-arm-oldabi.lo): New.
6559 (elf32-arm-newabi.lo): New.
6560 * Makefile.in: Regenerate.
6561 * config.bfd (thumb-*-elf): Remove definition of targ_underscore.
6562 (arm-*-elf): Likewise.
6564 (thumb-*-oabi): New.
6565 * configure: Regenerate.
6566 * configure.in (bfd_elf32_littlearm_oabi_vec): New.
6567 (bfd_elf32_bigarm_oabi_vec): New.
6568 * elf32-arm-newabi.c: New.
6569 * elf32-arm-oldabi.c: New.
6570 * elf32-arm.c: Removed.
6575 * binary.c (binary_set_section_contents): Omit warnings for
6576 unloadable sections.
6580 * config.bfd (powerpc{,le}-*-vxworks*): Add aliases to
6581 powerpc{,le}-*-eabi.
6585 * dwarf2.c (read_unsigned_leb128): Remove unused variables.
6586 * dwarf2.c (read_signed_leb128): Remove unused variables.
6590 * elf.c (assign_file_positions_for_segments): Only adjust
6591 p_align when needed.
6595 * binary.c (binary_set_section_contents): Don't return early for a
6596 non-loadable section, in case the first section is non-loadable.
6597 Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej
6602 * elf32-fr30.c (fr30_reloc_map): Add R_FR30_GNU_VTINHERIT and
6603 R_FR30_GNU_VTENTRY relocs.
6607 * elflink.h (elf_link_output_sym): Zero syms which are
6608 part of sections which have been excluded.
6612 * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed F_PIC
6614 * coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and
6615 F_ARM_3M labels. Changed F_PIC to F_PIC_INT.
6619 * elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48
6621 (fr30_final_link_relocate): Use computed value as result of
6626 * binary.c (binary_set_section_contents): Emit warning for
6627 huge file offsets due to widely-dispersed section LMAs.
6631 * elf.c (assign_file_positions_for_segments): If not D_PAGED,
6632 align first section to largest section alignment, not first
6637 * configure.in: Require autoconf 2.12.1 or higher.
6641 * archures.c (bfd_mach_i386_i386_intel_syntax): Define.
6642 * bfd-in2.h: Likewise.
6643 * cpu-i386.c (bfd_i386_arch_intel_syntax): New.
6647 * archures.c,bfd-in2.h (bfd_mach_mips4111): New.
6648 * cpu-mips.c: Add support for and independent 4111.
6649 * elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111.
6650 (_bfd_mips_elf_final_write_processing):
6651 bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111.
6655 * elf32-mips.c (elf_mips_abi_name): New.
6656 (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags.
6660 * elf32-mips.c (_bfd_mips_elf_final_write_processing):
6661 Handle bfd_mach_mips4300.
6665 * elf32-i386.c: Remove leaked development code from patch
6666 1998-12-10 by Richard Henderson.
6670 * elf32-i386.c (elf_i386_relocate_section): Don't fail relocations
6671 in debug sections for symbol defined externally.
6675 * targets.c (bfd_target_vector): Remove duplicate entry for
6680 * elf32-fr30.c (fr30_elf_howto_table): Set src_mask fields to 0
6681 since we are using RELAs.
6685 SCO Open Server Release 5 core file support, from Jouke Numan
6687 * sco5-core.c: New file.
6688 * configure.in (i[3456]86-*-sco3.2v5*): Use sco5-core.lo.
6689 (sco5-core.lo): Define SCO5_CORE in COREFLAG.
6690 * Makefile.am: Rebuild dependencies.
6691 (OPTIONAL_BACKENDS): Add sco5-core.lo.
6692 (OPTIONAL_BACKENDS_CFILES): Add sco5-core.c.
6693 * bfd.c (struct _bfd): Add sco5_core_data field to tdata.
6694 * targets.c (sco5_core_vec): Add to target list if SCO5_CORE.
6695 * bfd-in2.h, configure, Makefile.in: Rebuild.
6699 * config.bfd (hppa*-*-mpeix*): New target.
6700 * configure.in: Add AC_HEADER_DIRENT.
6701 (hppa*-*-mpeix*): New target.
6702 * configure.host (hppa*-*-mpeix*): New host.
6703 * hpux-core.c: Check HOST_HPPAMPEIX. Use HAVE_DIRENT_H and
6704 friends rather than just including <sys/dir.h>.
6705 * som.h (struct som_symbol): Add hppa_priv_level and apto
6706 tc_data. Change all users.
6707 (struct somdata): Add comp_unit field.
6708 (obj_som_compilation_unit): Define.
6709 (bfd_som_attach_compilation_unix): Declare.
6710 * som.c: Check HOST_HPPAMPEIX.
6711 (struct som_misc_symbol_info): Add new field priv_level.
6712 (som_object_setup): Add current_offset parameter. Change all
6714 (setup_sections): Likewise.
6715 (som_object_p): For EXECLIBMAGIC, read the lst header.
6716 (som_write_symbol_strings): Add compilation_unit parameter.
6718 (som_finish_writing): Write out compilation_unit.
6719 (som_bfd_derive_misc_symbol_info): Set priv_level.
6720 (som_build_and_write_symbol_table): Set xleast field to 3.
6721 (som_slurp_symbol_table): Set symbol priv_level.
6722 (bfd_som_attach_compilation_unit): New function.
6723 (som_bfd_ar_write_symbol_stuff): Set xleast field to 3. Set
6724 priv_level into symbol_value.
6725 * configure, config.in: Rebuild.
6729 * hpux-core.c (hpux_core_core_file_p): Change call to nonexistent
6730 warning function to call _bfd_error_handler instead.
6732 * libbfd.c (COERCE32): Cast through unsigned long and long to
6733 avoid bug in old version of gcc.
6735 * elf64-alpha.c (elf64_alpha_additional_program_headers): Remove.
6736 (elf_backend_additional_program_headers): Don't define.
6740 * elf32-fr30.c (fr30_final_link_relocate): Fix PC relative
6741 relocations to include offset of 2 included in the insns, and the
6742 offset of the relocs within the section.
6746 The following changes were made by David Taylor
6751 changes originally made by HP; HP did not create ChangeLog
6754 * aclocal.m4, configure, Makefile.in: Rebuilt using latest
6755 automake macro library.
6757 * hpux-core.c (hpux_core_core_file_p): this function now
6758 understands HPUX 10.30 thread info. Yes, the thread stacks can be
6759 found in the corefile! Also, in hpux_core_core_file_p, if we
6760 encounter a section with an unknown type, don't punt. Instead,
6761 just skip it. Also, count the number of sections of known type
6762 that we encounter. If we encounter at least one good one, then
6763 we'll declare that the file is a core file. If we encounter any
6764 unknown ones but some known ones, then we'll issue a warning (but
6765 still declare it to be a core file). Also, correctly decide when a
6767 (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined.
6768 (CORE_ANON_SHMEM): define if not defined.
6769 (hpux_core_struct): add members lwpid and user_tid.
6770 (core_kernel_thread_id, core_user_thread_id): new macros.
6771 (make_bfd_asection): use bfd_alloc to allocate room for a copy of
6772 the name before storing it in the bfd.
6773 (hpux_core_core_file_p): handle threads.
6775 * libhppa.h (GET_FIELD): protect against redefinition.
6776 (HPPA_WIDE): define.
6777 (GET_FIELD): define.
6782 (sign_extend): redefine.
6783 (assemble_6): define.
6784 (assemble_12): rewrite.
6785 (assemble_16): define.
6786 (assemble_16a): define.
6787 (assemble_17): rewrite.
6788 (assemble_22): define.
6792 * elf32-fr30.c (fr30_final_link_relocate): Using signed
6793 relocations for signed values.
6797 * mipsbsd.c (MY(set_arch_mach)): Make static.
6798 * aoutx.h (NAME(aout,machine_type)): For bfd_arch_mips, use
6799 bfd_mach_mips* macros rather than simple numbers.
6801 COFF weak symbol support, based on patches from Mark Elbrecht
6803 * coffcode.h (coff_slurp_symbol_table): Handle C_WEAKEXT.
6804 * coffgen.c (coff_renumber_symbols): Handle weak symbols.
6805 (coff_write_alien_symbol): Likewise.
6806 * cofflink.c (coff_link_check_ar_symbols): Likewise.
6807 (coff_link_add_symbols): Likewise.
6808 (_bfd_coff_link_input_bfd): Likewise.
6809 (_bfd_coff_write_global_sym): Likewise.
6811 * elf.c (copy_private_bfd_data): Always initialize the
6812 includes_phdrs field.
6814 * elflink.h (elf_fix_symbol_flags): Check for case where a non-ELF
6815 file defines a symbol first mentioned in an ELF file.
6817 * bfd-in.h: Always define BFD_HOST_64_BIT and BFD_HOST_U_64_BIT if
6818 possible, rather than only if BFD64.
6819 * elflink.h (compute_bucket_count): Just check BFD_HOST_U_64_BIT,
6821 * bfd-in2.h: Rebuild.
6823 * srec.c (srec_set_section_contents): Correct test to avoid
6824 switching to 4 byte addresses after seeing a second section which
6825 requires 3 byte addresses. From Joel Schantz
6828 * config.bfd (m68*-*-gnu*): New target. From Aymeric Vincent
6833 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Fix logic to
6834 decide whether the output file is -mrelocatable-lib,
6835 -mrelocatable, or neither. (gdb.base/nodebug.exp)
6839 * elf32-fr30.c: Add support for R_FR30_48 reloc.
6840 * reloc.c: Add BFD_RELOC_FR30_48 relocation.
6841 * bfd-in2.h: Regenerate.
6842 * libbfd.h: Regenerate
6846 * elflink.h (elf_adjust_dynamic_symbol): Warn on an attempt to
6847 link against a dynamic symbol with no type or size.
6851 * elf32-i386.c (i386_check_relocs) [R_386_32]: Don't emit
6852 relocation for section which does not get loaded.
6853 (elf_i386_relocate_section) [R_386_32]: Likewise.
6857 * coff-h8300.c (h8300_bfd_link_add_symbols): Make reloc_size,
6858 reloc_count and i long instead of unsigned long. Handle error
6859 return from bfd_canonicalize_reloc.
6863 * elf32-v850.c (v850_elf_relocate_section): Detect the absence of
6868 * elf32-sh.c (elf/sh.h): Include.
6869 sh_reloc_type: Delete. Changed all references to elf_sh_reloc_type.
6870 (sh_elf_howto_tab): Add HOWTO for R_SH_SWITCH8.
6871 (sh_reloc_map): Map BFD_RELOC_8_PCREL to R_SH_SWITCH8.
6872 (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8.
6873 * Makefile.in: Add dependency of elf32-sh.lo on $(INCDIR)/elf/sh.h.
6877 * elflink.h (compute_bucket_count): Don't allow minsize==0, it
6878 causes division by zero later on.
6882 * elf32-fr30.c (fr30_elf_pc9_reloc,fr30_elf_pc12_reloc): Not
6887 * coff-i386.c (i3coff_object_p): Remove hack. Use new emulation
6892 * elf32-fr30.c (fr30_elf_relocate_section): Call
6893 fr30_final_link_relocate.
6894 (fr30_final_link_relocate): New function: Handle I20 and I32
6896 (fr30_elf_i32_reloc): New function: Handle I32 relocs.
6897 (fr30_elf_pc9_reloc): New function: Handle 9_PCREL relocs.
6898 (fr30_elf_pc12_reloc): New function: Handle 12_PCREL relocs.
6900 * elf32-v850.c (v850_elf_relocate_section): Reset hi16s reloc
6903 The following changes are based on a patch submitted by Gianluca
6906 (v850_elf_perform_relocation): Only update a hi16s reloc if it has
6907 not already been updated.
6908 (find_remembered_hi16s_reloc): New parameter 'already_found'
6909 returns state of remembered hi16s reloc.
6910 (remember_hi16s_reloc): Set 'found' field to false.
6911 (hi16s_location): Add 'found' field.
6915 * coff-i386.c (bfd_pe_dll_not_recognized_hack): the linker wants
6916 to see .DLL files as unrecognized.
6917 (i3coff_object_p): Sorry, had to hack it to not recognize these
6918 files (pei-i386) on request.
6922 * opncls.c (bfd_make_readable): need more cleanup for symbols and
6923 relents. Call bfd_check_format to reinitialize.
6927 * elf32-fr30.c (fr30_elf_relocate_section): Remove spurious
6932 * aclocal.m4: regenerate
6933 * configure: regenerate
6937 * elf-bfd.h (struct elf_link_hash_entry): Add vtable_entries_size.
6938 * elf.c (_bfd_elf_link_hash_newfunc): Clear it.
6939 * elflink.h (elf_gc_propagate_vtable_entries_used): Copy it, and
6940 respect it as an upper bound on what memory to reference.
6941 (elf_gc_smash_unused_vtentry_relocs): Likewise.
6942 (elf_gc_record_vtentry): Handle as-yet undefined vtables. Set and
6943 update vtable_entries_size appropriately.
6947 * elf32-fr30.c (fr30_reloc_type_lookup): Used integers to hold
6952 * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY
6953 bfds; they have no "file" so we fake it.
6954 * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen)
6955 * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by
6956 resizing the memory buffer.
6957 * opncls.c (bfd_make_writable): New function; lets you write a
6958 bfd_create'd bfd to an in-memory buffer.
6959 (bfd_make_readable): New function; lets you read back that buffer
6960 as if it were from bfd_openr. Used to build generated archive
6961 members (winsup's ld's dlltool)
6965 * po/bfd.pot: Regenerated.
6969 * elf32-v850.c (hi16s_location): Replaced fixed size array with
6974 * elf64-alpha.c (elf64_alpha_relax_section): Search for the proper
6975 element of the gotentry list for local symbols too.
6976 (elf64_alpha_relocate_section): Unify local and global handling.
6977 Assert that gotent->use_count > 0.
6981 * configure.in (vms_alpha_vec): Rename from evax_alpha_vec, and
6982 update for file name changes of July 2, 1998.
6984 * configure: Rebuild.
6988 * po/bfd.pot: Regenerated.
6992 * acinclude.m4, config.bfd: detect cygwin* instead of cygwin32*.
6993 * aclocal.m4, configure: regenerate
6997 * elf.c (prep_headers): Add support for bfd_arch_fr30.
7001 * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE,
7002 BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value
7004 * aclocal.m4, configure: regenerated.
7008 * elf32-d10v.c (reloc_type): Add R_D10V_GNU_VTINHERIT and
7009 R_D10V_GNU_VTENTRY relocs.
7010 (elf_d10v_howto_table): Likewise.
7011 (d10v_reloc_map d10v_reloc_map): Likewise.
7012 (elf32_d10v_gc_mark_hook): New.
7013 (elf32_d10v_gc_sweep_hook): New.
7014 (elf32_d10v_check_relocs): New.
7015 (elf32_d10v_relocate_section): New.
7016 (elf_backend_relocate_section): Define.
7017 (elf_backend_can_gc_sections): Define.
7021 * Makefile.am (BFD32_BACKENDS): Move vms files here...
7022 (BFD64_BACKENDS): ...from here.
7023 (BFD32_BACKENDS_CFILES): Move vms files here...
7024 (BFD64_BACKENDS_CFILES): ...from here.
7025 * Makefile.in: Rebuild.
7029 * Makefile.am: Add FR30 target.
7030 * Makefile.in: Add FR30 target.
7031 * archures.c: Add support for FR30.
7032 * config.bfd: Add support for FR30.
7033 * configure.in: Add support for FR30.
7034 * reloc.c: Add support for FR30 relocations.
7035 * targets.c: Add support for FR30 relocations.
7036 * bfd-in2.h: Regenerate.
7037 * configure: Regenerate.
7038 * libbfd.h: Regenerate.
7039 * cpu-fr30.c: New file.
7040 * elf32-fr30.c: New file.
7044 * configure.in: detect cygwin* instead of cygwin32*
7045 * configure: regenerate
7049 * elf-m10300.c (mn10300_elf_relax_section): Do not use alloca,
7050 use bfd_malloc and free instead and check return value from bfd_malloc.
7054 * libbfd-in.h (_bfd_dwarf1_find_nearest_line): Declare.
7055 * libbfd.h: Rebuild.
7057 * elf32-mips.c (mips_elf_dynsym_sec_names): Comment out.
7058 (SIZEOF_MIPS_DYNSYM_SECNAMES): Likewise.
7059 (MIPS_TEXT_DYNSYM_SECN): Likewise.
7060 (_bfd_mips_elf_fake_sections): Don't set sh_info field of a .hash
7062 (struct mips_elf_link_hash_table): Remove dynsym_sec_strindex
7064 (mips_elf_link_hash_table_create): Don't initialize
7065 dynsym_sec_strindex.
7066 (mips_elf_gc_mark_hook): Add default case to avoid warning.
7067 (mips_elf_size_dynamic_sections): Generate a section symbol for
7068 every output section.
7069 (mips_elf_finish_dynamic_sections): Count all sections for
7071 (mips_elf_finish_dynamic_sections): Use dynamic symbols for all
7076 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Allocate two slots
7077 for later PLT entries in large PLTs.
7078 (ppc_elf_finish_dynamic_symbol): Allow for the extra slots.
7082 * elf32-ppc.c (ppc_elf_reload_section): Fix typo.
7086 * elf-bfd.h (struct elf_link_hash_entry): Add new field elf_hash_value.
7087 * elflink.h (elf_collect_hash_codes): New function. This function is
7088 called for each exported symbol and we compute the ELF hash value for
7090 (compute_bucket_value): New function. It is called from
7091 size_dynamic_sections to determine the hash table size. When we are
7092 optimizing a better, but slower, algorithm is used.
7093 (size_dynamic_sections): Call compute_bucket_value.
7095 * elf.c (bfd_elf_hash): Optimize the hash function a bit.
7099 * elf32-sh.c: Add HOWTO entries for R_SH_GNU_VTINHERIT and
7101 (sh_elf_gc_mark_hook): New.
7102 (sh_elf_gc_sweep_hook): New.
7103 (sh_elf_check_relocs): New.
7104 (elf_backend_can_gc_sections): Define.
7108 * acinclude.m4: undo previous gettext change
7109 * aclocal.m4: rebuild with right version of aclocal.
7113 * acinclude.m4, aclocal.m4: move gettext-related fragments from
7114 aclocal.m4 to acinclude.m4, so they don't get lost.
7116 * elfcore.h: rewrite for better corefile support.
7117 * elf.c (elfcore_*): new functions.
7118 * elf-bfd.h (elf_obj_tdata): new structure members.
7119 * acconfig.h, acinclude.m4, configure.in: add feature-tests for
7121 * aclocal.m4, config.in, configure, Makefile.in: regenerated.
7125 * elf32-m32r.c: Add HOWTO entries for R_M32R_GNU_VTINHERIT
7126 and R_M32R_GNU_VTENTRY.
7127 (elf_backend_can_gc_sections): Define.
7128 (m32r_elf_check_relocs): New.
7129 (m32r_elf_gc_mark_hook): New.
7130 (m32r_elf_gc_sweep_hook): New.
7131 (m32r_elf_relocate_section): Handle VT relocs.
7135 * coff-arm.c (arm_relocate_section): Remove redundant test.
7137 * bfd-in2.h (struct reloc_howto_struct): Improve comment to make
7138 cleat that the 'bitsize' field is the size of the bitfield AFTER
7139 relocation not before.
7141 * elf32-m32r.c (R_M32R_18_PCREL): Fix size of bitfield.
7143 * coff-mips.c (mips_relocate_hi): Cope with missing refhi or reflo
7148 * elf32-sparc.c: Add HOWTO entries for R_SPARC_GNU_VTINHERIT and
7149 R_SPARC_GNU_VTENTRY.
7150 (elf32_sparc_check_relocs): Handle them.
7151 (elf32_sparc_reloc_type_lookup): Likewise.
7152 (elf32_sparc_relocate_section): Likewise.
7153 (elf32_sparc_gc_mark_hook): New.
7154 (elf32_sparc_gc_sweep_hook): New.
7158 * som.c (som_finish_writing): Perform some sanity checks when
7159 writing an executable or shared library.
7163 * dwarf1.c : New file. Adds _bfd_dwarf1_find_nearest_line.
7164 * configure.in (elf): Add dwarf1.lo.
7165 * elf_bfd.h (elf_ob_tdata): Add dwarf1_find_line_info.
7166 * elf.c (_bfd_elf_find_nearest_line): Add call to
7167 _bfd_dwarf1_find_nearest_line.
7168 * elf32-mips.c (_bfd_mips_elf_find_nearest_line):
7169 Add call to _bfd_dwarf1_find_nearest_line.
7170 * configure: Rebuilt.
7174 * elflink.h (elf_gc_sections): Do not allow garbage
7175 collection if dynamic sections have been created.
7179 * elf32-v850.c: Add HOWTO entries for R_V850_GNU_VTINHERIT and
7181 (v850_elf_check_relocs): Handle VTINHERIT and VTENTRY relocs.
7182 (v850_elf_perform_relocation): Likewise.
7183 (v850_elf_final_link_relocate): Likewise.
7184 (v850_elf_relocate_section): Likewise.
7185 (v850_elf_gc_sweep_hook): New routine.
7186 (v850_elf_gc_mark_hook): New routine.
7187 (elf_backend_can_gc_sections): Define.
7191 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Don't assume
7196 * rs6000-core.c (rs6000coff_core_file_matches_executable_p):
7197 Declare size as bfd_size_type.
7198 (rs6000coff_get_section_contents): Declare count as bfd_size_type.
7202 * cpu-hppa.c (bfd_hppa20_arch): Define. Link it into the bfd_hppa_arch
7204 * som.c (CPU_PA_RISC2_0): Define.
7205 (_PA_RISC2_0_ID): Likewise.
7206 (som_finish_writing): Use CPU_PA_RISC2_0 for the system_id as needed.
7210 * elflink.h (elf_link_add_object_symbols): When a versioned symbol
7211 has a base which is already defined, only add the referenced
7212 symbol to the dynamic symbol table if it is defined or referenced
7215 * elf32-i386.c (elf_i386_info_to_howto_rel): Handle vtable relocs
7220 * elflink.h (elf_link_add_object_symbols): Undo last change.
7224 * elflink.h (elf_link_add_object_symbols): Don't record a dynamic
7225 symbol for the indirect alias to a versioned symbol.
7229 * elf32-i386.c (elf32_i386_vtinherit_howto): New.
7230 (elf32_i386_vtentry_howto): New.
7231 (elf_i386_reloc_type_lookup): Return elf32_i386_vtentry_howto
7232 or elf32_i386_vtinherit_howto on lookup.
7236 * elf32-m68k.c: Include "elf/m68k.h". Remove definition of enum
7237 reloc_type. Rename R_68K__max to R_68K_max.
7238 (howto_table): Use _bfd_elf_rel_vtable_reloc_fn for a VTENTRY
7243 * libbfd.c (bfd_getb32): Rewrite expression to get better code.
7244 (bfd_getl32, bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
7246 * libbfd.c (bfd_log2): Cast to bfd_vma before shifting, not
7251 * elflink.h (elf_link_add_object_symbols): Ensure that the warning
7252 message has a null byte terminator.
7256 * elf32-v850.c (v850_elf_perform_relocation): Ignore contents of
7257 word subject to R_V850_32 relocation.
7261 * dwarf2.c: Add comment describing problem computing line numbers
7262 for undefined symbols at link time.
7266 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't
7267 transform a defweak into a plt entry.
7268 (elf64_alpha_calc_dynrel_sizes): Allow room for secondary
7269 plt entry references to receive a RELATIVE reloc.
7270 (elf64_alpha_finish_dynamic_symbol): Fill them in.
7271 (elf64_alpha_relocate_section): Assert we don't overrun
7272 the allocated relocation space.
7276 * elf.c (swap_out_syms): Always treat section symbols as
7277 special, even if they are attached to a common section.
7281 * elf32-v850.c (v850_elf_symbol_processing): Move symbols in
7282 sections with v850 common section attributes into named v850
7284 (v850_elf_add_symbol_hook): Move symbols in sections with v850
7285 common section attributes into named v850 common sections.
7289 * elf32-arm.c (elf32_arm_gc_mark_hook): Remove print
7294 * elf32-ppc.c (ppc_elf_relocate_section): Reverse output_offset
7295 part of Vladimir's change of 1998-08-19. Make a R_PPC_SDAREL16
7296 reloc to the wrong section a warning, not an error. .dynsbss
7297 is not an output section, so there is no need to check for it.
7301 * elf-bfd.h: Add argument to elf_backend_get_symbol_type.
7305 * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type.
7306 * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and
7308 (elf32_arm_gc_mark_hook): New.
7309 (elf32_arm_gc_sweep_hook): New.
7310 (elf32_arm_check_relocs): New.
7311 (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY
7313 (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY
7318 * elf32-ppc.c (ppc_elf_relocate_section): If dynobj is NULL,
7319 assume there is no PLT or GOT.
7323 * elf32-arm.c (elf32_arm_find_nearest_line): New function: just
7324 like _elf_bfd_find_nearest_line() except that STT_ARM_TFUNC is
7325 also accepted as a function symbol type.
7329 * rs6000-core.c (_LONG_LONG): Define for AIX 4.x only.
7333 * libbfd-in.h (_bfd_nolink_bfd_gc_sections): Correct definition to
7334 match definition of _bfd_gc_sections field.
7335 * libbfd.h: Rebuild.
7339 * elf32-sparc.c (elf32_sparc_relocate_section): Properly adjust
7340 the addend of a dynamic relocation referencing a section.
7341 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7342 (sparc64_elf_finish_dynamic_symbol): Fix the PLT relocation offset.
7346 * elflink.h (bfd_elfNN_size_dynamic_sections): Verify that the
7347 bed has a size_dynamic_sections routine before trying to use it.
7351 * elf32-mips.c (elf_mips_gnu_vtentry_howto): Use
7352 _bfd_elf_rel_vtable_reloc_fn.
7356 * Makefile.am: Add elf32-arm.c.
7357 * Makefile.in: Rebuild.
7358 * elf-bfd.h: Add elf_backend_get_symbol_type.
7359 * elf.c (swap_out_syms): If defined, call
7360 elf_backend_get_symbol_type.
7361 * elf32-arm.c: Define elf_backend_get_symbol_type.
7362 (elf32_arm_get_symbol-type): New routine.
7363 (record_thumb_to_arm_glue): Change to use STT_ARM_TFUNC.
7364 (bfd_elf32_arm_process_before_allocation): Change to
7365 check for STT_ARM_TFUNC.
7366 (elf32_arm_final_link_relocate): Likewise.
7367 * elfxx-target.h: Add elf_backend_get_symbol_type.
7371 * archures.c (bfd_mach_alpha_ev[456]): New.
7372 * cpu-alpha.c: Rework to match these types.
7373 * bfd-in2.h: Rebuild.
7377 * elf-bfd.h (_bfd_elf_rel_vtable_reloc_fn): Declare.
7378 * elf.c (_bfd_elf_rel_vtable_reloc_fn): New.
7380 * elf32-i386.c (elf_howto_table): Add vtable relocs.
7381 (elf_i386_reloc_type_lookup): Recognize them.
7382 (elf_i386_check_relocs): Pass them off to generic code.
7383 (elf_i386_relocate_section): Ignore them.
7384 (elf_i386_gc_mark_hook, elf_i386_gc_sweep_hook): New.
7385 (elf_backend_can_gc_sections): True.
7389 * elf32-arm.c (elf32_thumb_to_arm_stub): Check sym_sec is not NULL
7390 before looking at owner field.
7391 (elf32_arm_to_thumb_stub): Ditto.
7392 (elf32_arm_relocate_section): Compute name before calling
7393 elf32_arm_final_link_relocate().
7397 * elf.c: comment and formatting cleanups.
7402 * elfcode.h (elf_object_p): Reject files of header type ET_CORE
7403 (core files are treated differently than object files).
7404 * elf-bfd.h (_bfd_elf_write_corefile_contents,
7405 bfd_elf_mkcorefile): declare.
7406 * elfxx-target.h (_bfd_elf_write_corefile_contents,
7407 bfd_elf_mkcorefile): add to bfd_target vector.
7408 * elfcore.h (elf_core_file_p): save the program header table,
7409 and set the bfd architecture from the elf file header.
7410 * elf.c (bfd_elf_mkcorefile): new function.
7411 (_bfd_elf_write_corefile_contents): new function.
7412 (assign_file_positions_for_segments): add cases for handling
7413 PT_NOTE segments. (assign_file_positions_except_relocs):
7414 core files should be handled the same as exec files.
7415 (prep_headers): identify core files as type ET_CORE.
7416 (copy_private_bfd_data): identify the sections belonging to
7417 the PT_NOTE segment.
7419 * elf32-sparc.c (elf32_sparc_final_write_processing):
7420 add break statement to default case.
7424 * elf32-ppc.c (ppc_elf_relocate_section): Check that output
7425 section (not input) will be in sections ".sbss", ".sbss2",
7426 ".sdata", and ".sdata" for R_PPC_SDAREL16, R_PPC_EMB_SDA2REL,
7427 R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA. In all these cases also ignore
7428 output_offset for correct evaluation of addend.
7432 * elf32-arm.c: Add prefix bfd_ to elf32_arm_get_bfd_for_interworking,
7433 elf32_arm_allocate_interworking_sections and
7434 elf32_arm_process_before_allocation.
7438 * bfd-in.h: Ammend prototype for
7439 elf32_arm_process_before_allocation to remove surplus third
7442 * bfd-in2.h: Regenerate.
7446 * elf64-alpha.c (elf64_alpha_relax_section): Handle indirect symbols.
7450 * aoutx.h (aout_link_input_section_ext): Use the relocation already
7451 calculated for RELOC_SPARC_REV32 case.
7455 * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking,
7456 elf32_arm_allocate_interworking_sections and
7457 elf32_arm_process_before_allocation.
7458 * bfd-in2.h: Regenerated.
7459 * elf32-arm.c Define elf32_arm_link_hash_table.
7460 (insert_thumb_branch): New routine.
7461 (find_thumb_glue): New routine.
7462 (find_arm_glue): New routine.
7463 (record_arm_to_thumb_glue): New routine.
7464 (record_thumb_to_arm_glue): New routine.
7465 (elf32_arm_link_hash_table_create): New routine.
7466 (elf32_arm_get_bfd_for_interworking): New routine.
7467 (elf32_arm_allocate_interworking_sections) New routine.
7468 (elf32_arm_process_before_allocation) New routine.
7469 (elf32_thumb_to_arm_stub): New routine.
7470 (elf32_arm_to_thumb_stub): New routine.
7471 (elf32_print_private_bfd_data): Fix typo.
7472 (elf32_arm_final_link_relocate): Add argument sym_sec.
7473 Check for branches to thumb symbols in case R_ARM_PC24.
7474 Check for branches to arm symbols in case R_ARM_THM_PC22.
7475 (elf32_arm_relocate_section): Pass symbol section to
7476 elf32_arm_final_link_relocate.
7480 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Generate PLT
7481 entries unless the symbol is defined in the executable; in
7482 particular, undefined weak symbols get a PLT entry.
7486 * libaout.h: Remove nested comment to avoid warning.
7490 * elf32-arm.c (elf32_arm_final_link_relocate): Rework
7491 R_ARM_PC24 relocation.
7495 * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused
7496 argument is_local. Add argument sym_flags. Check sym_flags
7497 in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case.
7498 (elf32_arm_relocate_section): Don't pass local sym and pass
7499 sym_flags to elf32_arm_final_link_relocate.
7503 * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Correct last change
7504 to not count too few relocs for dynamicly linked executables.
7508 * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Never consider
7509 symbols without a dynamic index dynamic. Consider all weak
7511 (elf64_alpha_strip_section_from_output): Don't assume 1-1
7512 correspondance between input and output sections.
7516 * elflink.h (elf_gc_common_finalize_got_offsets): For backends
7517 that use a .got.plt section start the got offset at zero.
7521 * ieee.c (ieee_write_processor): Correct the processor ID written
7522 out for bfd_arch_m68k, accommodating change of March 25.
7526 * elf32-arm.c (elf32_arm_final_link_relocate): Rework
7527 R_ARM_THM_RPC22 relocations.
7531 * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Undef weak symbols
7533 (elf64_alpha_calc_dynrel_sizes): Allow enough room for RELATIVE
7534 .got relocs in -Bsymbolic shared objects.
7538 * elf32-arm.c: Add private flags to ELF header.
7539 (elf32_arm_print_private_bfd_data): New Function.
7540 (elf32_arm_set_private_flags): New Function.
7541 (elf32_arm_copy_private_flags): New Function.
7542 (elf32_arm_merge_private_bfd_data): New Function.
7546 * elf32-sparc.c (elf32_sparc_check_relocs): Permit WPLT30 against
7548 (elf32_sparc_relocate_section): Likewise.
7552 * elf32-ppc.c (ppc_elf_check_relocs): Init sgot to NULL. Create the
7553 .got if any relocation referrs to _GLOBAL_OFFSET_TABLE_.
7554 (ppc_elf_relocate_section): Pull sgot and splt search to the start
7555 of the function. Recognize no .plt as static linking.
7559 * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Don't pass
7560 ".liblist" string through gettext.
7564 * Makefile.am: Add support for elf32-arm.lo.
7565 * Makefile.in: Rebuild.
7566 * config.bfd (arm-*-elf): Define targ_defvec and targ_selvecs.
7567 (thumb-*-elf): Define targ_defvec and targ_selvecs.
7568 * configure.in: Handle bfd_elf32_littlearm_vec and bfd_elf32_bigarm_vec.
7569 * configure: Regenerate.
7570 * elf.c: (prep_headers): Support arch_type of EM_ARM.
7571 * targets.c: Support new targets bfd_elf32_bigarm_vec and
7572 bfd_target bfd_elf32_littlearm_vec.
7573 * elf32-arm.c: New file.
7577 * libaout.h (M_SPARCLITE_LE): New machine.
7578 * sunos.c (MACHTYPE_OK): Add machine M_SPARCLITE_LE.
7579 * aoutf1.h (sunos_set_arch_mach): Add machine M_SPARCLITE_LE.
7580 (sunos_write_object_contents): Add machine bfd_mach_sparc_sparclite_le
7581 * aoutx.h (howto_table_ext): Add relocation R_SPARC_REV32.
7582 (NAME(aout,machine_type)) Add machine bfd_mach_sparc_sparclite_le
7583 (aout_link_input_section_ext): Add RELOC_SPARC_REV32 support.
7584 * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map,
7585 elf32_sparc_relocate_section): Rename R_SPARC_32LE to be R_SPARC_REV32
7586 * libbfd.h (bfd_reloc_code_real_names): Rename BFD_RELOC_SPARC_32LE to
7587 be BFD_RELOC_SPARC_REV32.
7589 * config.bfd (sparc86x-*-aout): New
7593 * linker.c (_bfd_generic_final_link): Allocate NULL symbol before
7594 actually mapping the output sections.
7599 * elf-m10300.c (mn10300_elf_howto): Add R_MN10300_24 entry.
7600 (mn10300_elf_reloc_map): Similarly.
7601 (mn10300_elf_final_link_relocate): Handle R_MN10300_24.
7605 * elf32-mips.c (elf_mips_howto_table): Add reloc types used on
7607 (bfd_elf32_bfd_reloc_type_lookup): Add default case.
7608 * elf64-mips.c: Replace all uses of mips_elf64_reloc_type with
7609 elf_mips_reloc_type defined in elf/mips.h.
7613 * elf64-mips.c: Remove reloc_type definition completely. It's now
7618 * elf64-mips.c (mips_elf64_reloc_type): #if 0 out more relocations
7619 as they are defined in elf/mips.h now.
7624 * Re-add lost change:
7625 * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field
7627 (mn10300_elf_relax_section): Include stack space for register saves
7628 in the imm8 field of a "call" instruction.
7629 (compute_function_info): Determine how much stack is allocated by
7630 the movm instruction. Fix typo.
7631 (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size.
7635 * elf32-sparc.c (elf_backend_got_header_size): Define as 4.
7636 * elf64-sparc.c (elf_backend_got_header_size): Define as 8.
7640 * elf32-ppc.c: Change use of pp_reloc_type to elf_ppc_reloc_type.
7644 * elf32-hppa.h: Let ELF header define the enum containing the
7645 external reloc numbers.
7646 * elf32-i386.h: Likewise.
7650 * elf-m10300.c: Let ELF header now define the macros to get the enum.
7651 * elf32-mips.c: Likewise.
7652 * elf32-ppc.c: Likewise.
7656 * bfd-in2.h: Change type of 'class' parameter to 'unsigned int' in
7657 bfd_coff_set_symbol_class(), in order to avoid K&R compatability
7659 * bfd-in.h: Regenerate.
7660 * coffgen.c (bfd_coff_set_symbol_class): Change type of 'class'
7661 parameter to 'unsigned int' to avoid K&R compatability problems.
7665 * ieee.c (ieee_find_nearest_line): Change filename_ptr and
7666 functionname_ptr to be const. Change line_ptr to be unsigned.
7668 * coffcode.h (coff_link_output_has_begun): Simplify handling when
7669 macro is not defined. Change second parameter from bfd_link_info
7670 to coff_final_link_info. Add prototype.
7671 (coff_final_link_postscript): Simplify handling when macro is not
7672 defined. Add prototype.
7676 * elf-mn10300.c: Before include system specific ELF header define
7677 START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS.
7678 * elf32-mips.c: Likewise.
7679 * elf32-ppc.c: Likewise.
7683 * elf64-mips.c (mips_elf64_reloc_type): Copy Ulrich's elf32-mips.c
7684 temporary patch over to elf64-mips.c as well.
7688 * elf32-mips.c (reloc_type): Temporarily disable definition of
7689 standard relocation since they are now defined in elf/mips.h.
7693 * elf-m10200.c (mn10200_elf_final_link_relocate):
7694 Modify range test for case R_MN10200_8.
7696 * elf-m10300.c (mn10300_elf_final_link_relocate):
7697 Modify range test for case R_MN10300_8.
7701 * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size.
7702 * elf32-i386.c (elf_backend_got_header_size): Define.
7703 (elf_backend_plt_header_size): Define.
7704 * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise.
7705 * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise.
7706 * elfxx-target.h: Provide a default of zero.
7707 * elflink.c (_bfd_elf_create_got_section): Use got_header_size.
7708 * elflink.h (elf_gc_common_finalize_got_offsets): Likewise.
7710 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT
7711 entry from an executable, even if the plt refcount goes to 0.
7715 * aoutx.h (NAME(aout,find_nearest_line)): Also remember the
7716 directory name at the line number.
7718 * elf.c (_bfd_elf_find_nearest_line): Also consider symbols
7719 with an unspecified type.
7723 * sunos.c: Add undef of valid to avoid problem on SunOS.
7727 * config.bfd (i?86-pc-beos{pe,elf,}*): Recognize.
7731 * elf32-m68k.c (elf_m68k_check_relocs): Also reference count
7732 R_68K_PCxx and R_68K_xx relocations. Make sure that
7733 ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference.
7734 (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and
7735 R_68K_xx relocations.
7736 (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol
7737 that has no plt entry.
7738 (elf_m68k_relocate_section): Ignore the plt offset in a static
7740 * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for
7742 (elf_gc_common_finalize_got_offsets): Set the got offsets also in
7745 * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc
7747 (howto_table, reloc_map): Add entries for them.
7748 (elf_m68k_check_relocs): Handle them. Implement reference
7749 counting for got and plt entries.
7750 (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions.
7751 (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt
7753 (rtype_to_howto_rel, elf_info_to_howto_rel): Delete.
7754 (elf_m68k_relocate_section): Handle the new reloc types.
7755 (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook,
7756 elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define.
7757 * elflink.h (elf_link_add_object_symbols): When creating an
7758 indirect reference for symbol versioning also copy the plt
7760 (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT
7761 flag also reset the plt offset.
7762 (elf_link_assign_sym_version): Likewise.
7763 (elf_gc_common_finalize_got_offsets): Increment the got offset by
7764 the size of the entry in bytes.
7765 (elf_gc_allocate_got_offsets): Likewise.
7769 * elflink.h (elf_gc_sections): Return true rather than falling off
7772 * coffgen.c (bfd_coff_set_symbol_class): Call bfd_alloc, not
7777 * coff-arm.c: Supress definition of TARGET_UNDERSCORE and add a
7778 comment describing when it should be enabled.
7779 Changed definition of USER_LABEL_PREFIX to "", to fall into line
7784 * ieee.c (ieee_slurp_external_symbols): Handle call optimization
7785 information ATN records.
7789 * ieee.c (ieee_slurp_external_symbols): Select an appropriate
7790 section for an absolute symbol in a fully linked file. Based on
7795 * coff-m88k.c (m88k_special_reloc): Don't lose the information
7796 that a symbol is undefined.
7800 * som.c (som_bfd_gc_sections): Define.
7804 * coff-arm.c (aoutarm_std_reloc_howto): Do not complain about
7805 overflows in ARM_26D patches, since they have already been
7810 * coffcode.h (coff_write_object_contents): If we have any long
7811 section names, call coff_write_symbols even if there are no
7816 * elf.c (copy_private_bfd_data): Only set phdr_included once for a
7817 PT_LOAD segment, rather than only setting it once for the entire
7820 * elf.c (_bfd_elf_make_section_from_shdr): When setting the LMA,
7821 rather than ignoring every phdr with a p_paddr of 0, ignore all
7822 the phdrs if they all have a p_paddr of 0.
7824 * stabs.c (_bfd_write_stab_strings): Check whether the .stabstr
7825 section was discarded from the link.
7829 * coff-sh.c (sh_insn_uses_freg): Ignore lowest bit of register number.
7833 * coff-sh.c (sh_insns_conflict): Load of fpscr conflicts with
7834 floating point operations.
7838 * cofflink.c (_bfd_coff_link_input_bfd): Skip undefined global
7843 Merge of vax/vms (read-only) support
7844 * configure.com: Support Vax target.
7845 * makefile.vms: Support Vax target.
7846 * vms.h: Renamed from evax.h, merged vax/vms (read-only) support.
7847 * vms.c: Renamed from evax-alpha.c, merged vax/vms (read-only)
7849 * vms-hdr.c: Renamed from evax-emh.c, merged vax/vms (read-only)
7851 * vms-gsd.c: Renamed from evax-egsd.c, merged vax/vms (read-only)
7853 * vms-tir.c: Renamed from evax-etir.c, merged vax/vms (read-only)
7855 * vms-misc.c: Renamed from evax-misc.c, merged vax/vms (read-only)
7857 * libbfd.c (real_read): Use unbuffered read on VMS/Vax.
7858 * targets.c (bfd_target_ovax_flavour): New flavour.
7859 (vms_alpha_vec): Renamed from evax_alpha_vec.
7861 (target_vector): Update accordingly.
7862 * config.bfd (alpha*-*-*vms*): Use vms_alpha_vec, not
7864 (vax*-*-*vms*): New target.
7865 * Makefile.am: Update for renamed files. Rebuild dependencies.
7866 * bfd-in2.h: Rebuild.
7867 * configure.in, Makefile.in, aclocal.m4: Rebuild.
7872 * linker.c (_bfd_generic_final_link): Force a trailing NULL
7873 pointer on abfd->outsymbols.
7874 (generic_add_output_symbol): Handle NULL sym parameter.
7878 * elf.c (copy_private_bfd_data): Add support for changing VMA or
7883 * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons
7884 when handling 32 bit immediate relocs.
7885 * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise.
7889 * section.c (STD_SECTION): Account for recently added gc_mark
7890 field in struct asection.
7892 * elf-m10300.c (bfd_mn10300_elf_merge_private_bfd_data): New function.
7893 (bfd_elf32_bfd_merge_private_bfd_data): Define.
7897 ELF Section-level Garbage Collection:
7898 * bfd.c (bfd_gc_sections): New.
7899 * aout-adobe.c: Hook to default implementation.
7900 * aout-target.h, aout-tic30.c, binary.c, bout.c: Likewise.
7901 * coff-alpha.c, coff-mips.c, coff-rs6000.c, coffcode.h: Likewise.
7902 * evax-alpha.c, i386msdos.c, i386os9k.c, ieee.c: Likewise.
7903 * ihex.c, nlm-target.h, oasys.c, ppcboot.c, srec.c: Likewise.
7904 * tekhex.c, versados.c: Likewise.
7905 * libbfd-in.h (_bfd_nolink_bfd_gc_sections): New.
7906 * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_gc_sections.
7908 * reloc.c (BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY): New.
7909 (bfd_generic_gc_sections): New.
7910 * section.c (SEC_KEEP): New.
7911 (asection): Add gc_mark member.
7913 * elfcode.h (elf_gc*): New name remappings.
7914 * elflink.h (elf_link_input_bfd): Don't set contents on stabs
7915 sections to be excluded.
7916 (elf_gc_mark, elf_gc_sweep, elf_gc_sweep_symbol): New.
7917 (elf_gc_propogate_vtable_entries_used): New.
7918 (elf_gc_smash_unused_vtentry_relocs): New.
7919 (elf_gc_sections, elf_gc_record_vtinherit, elf_gc_record_vtentry): New.
7920 (elf_gc_common_finalize_got_offsets): New.
7921 (elf_gc_allocate_got_offsets, elf_gc_common_final_link): New.
7922 * elfxx-target.h: Add and default gc hooks.
7924 * elf-bfd.h (struct elf_link_hash_entry): Swap got_offset/plt_offset
7926 (struct elf_obj_tdata): Likewise for local_got_offsets.
7927 * elf.c, elf-i386.c, elf32-m68k.c, elf32-mips.c: Update all uses.
7928 * elf32-ppc.c, elf32-sparc.c, elf64-alpha.c: Likewise.
7929 * elf64-sparc.c, elflink.h: Likewise.
7931 * elf-bfd.h (struct elf_link_hash_entry): Add vtable members.
7932 (ELF_LINK_HASH_MARK): Define.
7933 (struct elf_backend_data): Add GC hooks.
7934 * elf.c (_bfd_elf_link_hash_newfunc): Zero vtable members.
7936 * elf-m10300.c (mn10300_elf_check_relocs): New.
7937 (mn10300_elf_gc_mark_hook): New.
7938 (R_MN10300_GNU_VTINHERIT, R_MN10300_GNU_VTENTRY): New.
7939 (elf_mn10300_howto, mn10300_reloc_map): Handle them.
7940 (mn10300_elf_final_link_relocate): Likewise.
7941 (mn10300_elf_relocate_section): Likewise.
7942 (elf_backend_can_gc_sections): Define.
7943 * elf32-mips.c (R_MIPS_GNU_VTINHERIT, R_MIPS_GNU_VTENTRY): New.
7944 (elf_mips_gnu_vtinherit_howto, elf_mips_gnu_vtentry_howto): New.
7945 (bfd_elf32_bfd_reloc_type_lookup): Handle them.
7946 (mips_info_to_howto_rel): Likewise.
7947 (mips_elf_relocate_section): Likewise.
7948 (mips_elf_check_relocs): Likewise.
7949 (mips_elf_gc_mark_hook, mips_elf_gc_sweep_hook): New.
7950 (elf_backend_can_gc_sections): Define.
7951 * elf32-ppc.c (R_PPC_GNU_VTINHERIT, R_PPC_GNU_VTENTRY): New.
7952 (ppc_elf_howto_raw): Handle them.
7953 (ppc_elf_reloc_type_lookup): Likewise.
7954 (ppc_elf_relocate_section): Likewise.
7955 (ppc_elf_check_relocs): Reference count .got and .plt entries.
7956 Handle new vtable relocs.
7957 (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries.
7958 (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New.
7959 (elf_backend_can_gc_sections): Define.
7963 * archures.c (bfd_mach_mn10300): Define.
7964 * elf-m10300.c: Include elf/mn10300.h
7965 (elf_mn10300_mach): New function.
7966 (_bfd_mn10300_elf_final_write_processing): Likewise.
7967 (_bfd_mn10300_elf_object_p): Likewise.
7968 (elf_backendfinal_write_processing): Define.
7969 (elf_backend_object_p): Likewise.
7973 * elf32-v850.c (v850_elf_perform_relocation): Fix HI16_S
7978 * elflink.h (elf_bfd_final_link): Loop over input_bfds using the
7979 link_next field, not the next field.
7983 * elf.c (map_sections_to_segments): Check the section address
7984 against the phdr size both with and without a modulo of
7989 * elf32-mips.c (mips_elf_size_dynamic_sections): Only strip a
7990 linker created empty input section if the output section has the
7993 * elflink.h (elf_link_output_extsym): Print an error message if
7994 _bfd_elf_section_from_bfd_section fails.
7996 * elf.c (_bfd_elf_section_from_bfd_section): Call bfd_set_error on
8001 * elf.c (copy_private_bfd_data): Improve handling of Solaris
8002 native linker output. Avoid putting an empty section in more than
8007 * po/Make-in (all-yes): If maintainer mode, depend on .pot file.
8008 ($(PACKAGE).pot): Unconditionally depend on POTFILES.
8012 * elf.c (swap_out_syms): New arg relocatable_p.
8013 Don't add section VMA to symbols for relocatable output.
8014 (_bfd_elf_compute_section_file_positions): Update call to
8019 * elf32-v850.c (v850_elf_perform_relocation): Make comparisons
8020 against 'addend' be signed rather than unsigned.
8024 * elf32-m32r.c: Add prototyps for static functions.
8026 * coff-arm.c: Add prototypes for static functions.
8030 * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the
8031 LMA is used to order sections in a segment.
8033 * elf32-v850.c: Add prototypes for static functions.
8034 Change type of addend parameter to bfd_vma in various functions.
8038 * aoutx.h (howto_table_ext): Change RELOC_BASE13 to use
8039 complain_overflow_signed instead of complain_overflow_bitfield.
8043 * elf.c (elf_map_symbols): Don't add section VMA to symbol value
8044 when comparing against 0.
8048 * Makefile.am (config.status): New target.
8049 * Makefile.in: Rebuild.
8053 * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Give an
8054 error if previous object endianness doesn't match current object.
8058 * elf32-v850.c (v850_elf_print_private_bfd_data): Call
8059 _bfd_elf_print_private)bfd_data ().
8063 * elflink.h (elf_merge_symbol): Don't always set type_change_ok
8065 (elf_link_add_object_symbols): Set type_change_ok and
8066 size_change_ok before calling elf_merge_symbol.
8068 * elf32-mips.c (mips_elf_relocate_section): If we issue an
8069 undefined symbol error, don't also issue an overflow error.
8073 * elf32-ppc.c (ppc_elf_relocate_section): The target of an
8074 R_PPC_LOCAL24PC relocation should be local; if not, print an error
8075 message instead of crashing.
8079 * archures.c (bfd_mach_cpu32): Define.
8080 (bfd_default_scan): Add case for 68060. Fix 68332 case to use
8082 * cpu-m68k.c (arch_info_struct): Add m68k:cpu32.
8083 * ieee.c: Include <ctype.h>.
8084 (ieee_object_p): Parse out process ID string to make it more
8085 likely to be acceptable for bfd_scan_arch.
8086 * bfd-in2.h: Rebuild.
8090 * elf32-m32r.c (m32r_elf_print_private_bfd_data): Also call
8091 _bfd_elf_print_private_bfd_data() so that the program header will
8096 * peicode.h (coff_swap_sym_in): Check for C_SECTION rather than
8097 0x68. Reindent. Add some comments.
8101 * elf.c (copy_private_bfd_data): Adjust physical address of
8102 segment in output BFD to contain LMAs of its sections.
8106 * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map,
8107 elf32_sparc_relocate_section): Added R_SPARC_32LE for little
8108 endian data 32 bit relocations.
8109 (elf32_sparc_merge_private_bfd_data): Check if linking little
8110 endian objects with big endian objects.
8111 (elf32_sparc_object_p): Set bfd_mach_sparc_sparclite_le.
8112 (elf32_sparc_final_write_processing): Set EF_SPARC_LEDATA in e_flags.
8113 * libbfd.h (bfd_reloc_code_real_names): Added BFD_RELOC_SPARC_32LE.
8115 * cpu-sparc.c (arch_info_struct): Added sparc:sparclite_le
8116 * archures.c (bfd_mach_sparc_sparclite_le): New.
8117 * bfd-in2.h (BFD_RELOC_SPARC_32LE, bfd_mach_sparc_sparclite_le): New.
8121 * peicode.h (add_data_entry): Fix precedence of operators in if ()
8126 * bfd-in.h: Move over patch to bfd-in2.h.
8128 * reloc.c (bfd_check_overflow): Add casts before shifts which may
8130 (_bfd_relocate_contents): Likewise.
8134 * peicode.h (add_data_entry): If the section has no private data
8135 then do not create a Data Dictionary entry for it.
8139 * elf64-alpha.c (elf64_alpha_relax_section): Set again on changes.
8140 (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots,
8141 elf64_alpha_size_got_sections): Rewrite, handling multiple got
8142 subsections during relaxation more correctly.
8146 * bfd-in2.h: Add new prototype: bfd_coff_set_symbol_class ().
8147 Add extra argument to bfd_arm_process_before_allocation ().
8148 * bfd-in.h: Reflect changes made in bfd-in2.h.
8149 * coffgen.c (bfd_coff_set_symbol_class): New function. Set the
8150 coff class of a BFD symbol.
8151 * coff-arm.c: Add support for interworking between Thumb code and
8152 non-interworking aware ARM code.
8156 * po/Make-in (install-info): New target.
8160 * filemode.c: Remove; not used.
8162 If sysdep.h includes a header file, don't include it again:
8163 * aix386-core.c: Don't include <stdio.h>, <stddef.h>, or
8165 * aoutx.h: Don't include <string.h>. Use "sysdep.h" rather than
8167 * archive.c: Don't include <string.h> or <errno.h>.
8168 * evax-alpha.c; Don't include <stdio.h>.
8169 * evax-egsd.c: Likewise.
8170 * evax-etir.c: Likewise.
8171 * evax-misc.c: Likewise.
8172 * evax-emh.c: Likewise. Also, don't include <sys/types.h>.
8173 * hppabsd-core.c: Don't include <stdio.h>, <sys/types.h>, or
8175 * hpux-core.c: Likewise.
8176 * netbsd-core.c: Likewise.
8178 * libbfd.c: Don't include <sys/types.h>.
8179 * nlmcode.h: Don't include <string.h>.
8180 * osf-core.c: Don't include <string.h> or <stdio.h>.
8181 * ptrace-core.c: Don't include <stdio.h>, <sys/types.h>,
8182 <errno.h>, or <unistd.h>.
8183 * trad-core.c: Don't include <stdio.h> or <sys/types.h>.
8187 * configure.com: If the version number can not be found in
8188 configure.in, set it to "unknown" rather than "2.8.1".
8192 * elf32-mips.c (elf_mips_mach): New.
8193 (_bfd_mips_elf_object_p): Use elf_mips_mach.
8194 (_bfd_mips_elf_final_write_processing): Use the names
8195 of machines, rather than the numbers. Set both the ARCH
8196 and MACH in e_flags. Handle a few more specific machines.
8197 (_bfd_mips_elf_merge_private_bfd_data): Merge both
8198 EF_MIPS_ARCH and EF_MIPS_MACH.
8202 * syms.c (bfd_is_local_label): Revert last change.
8203 * srec.c (srec_write_symbols): Discard debugging symbols.
8207 * som.c: Include <ctype.h>.
8208 * som.h: Don't include sysdep.h.
8212 * libbfd.h: Rebuilt.
8213 * libbfd-in.h: Removed gettext includes and defines.
8214 * sysdep.h: Moved gettext-related includes and defines here.
8218 * srec.c (srec_write_symbols): Use bfd_is_local_label rather than
8219 an ad-hoc test. Kill bogus #if 0 code.
8220 * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local.
8224 * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address
8225 when generating a normal executable for a symbol defined in a
8226 regular file. When copying a reloc into the output file, adjust
8227 the addend for a PC relative reloc against a global symbol.
8231 * libbfd.h: Rebuilt.
8232 * libbfd-in.h (_): Define as dgettext.
8236 * coff-arm.c (coff_arm_relocate_section): Cast to bfd_signed_vma,
8238 * peicode.h (pe_saved_coff_bfd_print_private_bfd_data): Use PARAMS
8239 when declaring parameter types.
8240 (pe_saved_coff_bfd_copy_private_bfd_data): Likewise.
8244 * config.bfd: If we include any ELF targets in targ_defvec and/or
8245 targ_selvecs, then add the generic ELF targets to targ_selvecs.
8246 * elf32-gen.c (dummy): New static const variable.
8247 (elf_generic_info_to_howto): New static function.
8248 (elf_generic_info_to_howto_rel): New static function.
8249 (elf_info_to_howto): Define as elf_generic_info_to_howto.
8250 (elf_info_to_howto_rel): Define as elf_generic_info_to_howto_rel.
8251 * elf64-gen.c: Same changes as elf32-gen.c.
8252 * elfcode.h (elf_object_p): For the generic target, ignore a
8253 failure of bfd_default_set_arch_mach. Fix indentation a bit.
8257 * configure.in (WIN32LIBADD): Add -lintl on cygwin32.
8258 * configure: Rebuild.
8262 * config.bfd: Update OSR5/Unixware patterns.
8266 * elf.c (assign_file_positions_for_segments): Allow for holes
8267 between sections added by a link script.
8271 * configure.in: Change version number to 2.9.4
8272 * configure: Rebuild.
8275 * elf.c (bfd_elf_get_bfd_needed_list): New function.
8276 * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare.
8277 * bfd-in2.h: Rebuild.
8281 * elf64-alpha.c (struct alpha_relax_info): Replace elfsym with other.
8286 * elf64-alpha.c (struct alpha_relax_info): Add tsec & elfsym members.
8287 (elf64_alpha_relax_section): Fill them in.
8288 (elf64_alpha_relax_opt_call): Implement more than a stub.
8289 (elf64_alpha_add_symbol_hook): Don't set SEC_LOAD or default
8290 alignment on .scommon.
8291 (elf64_alpha_merge_gots): Merge use counts as well.
8295 * elf64-alpha.c (elf64_alpha_relax_section): Use the proper section
8296 for calculating a local symbol's address.
8297 (elf64_alpha_calc_got_offsets): Skip entries with 0 use count.
8298 Set the .got's cooked size as well as the raw size.
8302 * elf32-v850.c (v850_elf_print_private_bfd_data): Add
8303 internationalisation of printed information.
8305 * coff-arm.c (coff_arm_print_private_bfd_data): Add
8306 internationalisation of printed information.
8310 * syms.c (struct indexentry): Change directory_name, file_name,
8311 and function_name fields to char *.
8312 (struct stab_find_info): Change cached_file_name field to char *.
8316 * peicode.h (dir_names): Add missing N_() macros to dir_names array.
8320 * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir).
8324 * Makefile.am (install-data-local): Make $(includedir).
8325 * Makefile.in: Rebuild.
8329 * libbfd-in.h: Use `gettext' and not `dgettext' for now.
8333 * Makefile.am (INCLUDES): Add -I$(srcdir)/../intl -I../intl.
8334 * Makefile.in: Rebuild.
8336 * bfd-in2.h: Rebuild for Nick's changes.
8340 * archive.c (_bfd_generic_read_ar_hdr_mag): Fix lossage in last
8341 change wrt length == max_namelen.
8345 * Many files: Added gettext invocations around user-visible
8347 * libbfd-in.h: Added gettext includes and defines.
8348 * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY,
8349 HAVE_LC_MESSAGES): Define.
8350 * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and
8352 * Makefile.am (SUBDIRS): Added po.
8353 (POTFILES): New macro.
8354 (po/POTFILES.in): New target.
8355 (SOURCE_HFILES): New macro.
8357 * po/Make-in, po/POTFILES.in, po/bfd.pot: New files.
8361 * elfcore.h (bfd_prstatus): Copy core_prstatus from the first
8362 NT_PRSTATUS note section encountered, it contains the status of
8363 the currently executing thread when the core file was written.
8367 * libcoff.h: Add extra parameter to
8368 bfd_coff_link_output_has_begun overrideable function.
8369 * cofflink.c: Pass extra parameter to
8370 bfd_coff_link_output_has_begun function.
8371 * bfd-in.h: Add prototypes for exported ARM interworking
8373 * peicode.h: ARM specific code reorganised to conform to BFD
8375 * coffcode.h: ARM specific code reorganised to conform to BFD
8377 * coff-arm.c: Code reorganised to conform to the BFD coding
8378 conventions. Global variables have been moved into an ARM
8379 specific hash table structure and a new function:
8380 bfd_arm_get_bfd_for_interworking() has been created which is
8381 called from the linker scripts.
8385 * archive.c (_bfd_generic_read_ar_hdr_mag): Simplify end-of-name test.
8387 * elf64-alpha.c (elf64_alpha_find_reloc_at_ofs): Renamed from
8388 elf64_alpha_relax_find_reloc_ofs. Changed all callers.
8389 (elf64_alpha_add_symbol_hook): Put small commons in .scommon not .sbss.
8390 (elf64_alpha_size_got_sections): Don't merge .got sections twice.
8394 * config.bfd: Added sparc86x support.
8398 * elf32-mips.c (mips_elf_relocate_section): Do not complain about
8399 an out of range pc-relative jump/call to an undefined weak symbol.
8403 * elf64-alpha.c (elf64_alpha_do_reloc_gpdisp): Do all gpdisp
8408 * archive.c (bfd_generic_archive_p): If a slurp subroutine returns
8409 an error other than bfd_error_system_call, set the error to
8410 bfd_error_wrong_format.
8412 * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add
8413 bfd_elf32_powerpcle_vec.
8415 * elf.c (copy_private_bfd_data): If all the p_paddr fields in the
8416 program segments are zero, don't set p_paddr_valid.
8420 * elf64-alpha.c: Initial implementation of relaxation --
8421 (struct alpha_elf_link_hash_entry): Add use_count member.
8422 (elf64_alpha_check_relocs): Initialize and increment it.
8423 (elf64_alpha_can_merge_gots): Check it when considering merging.
8424 (elf64_alpha_merge_gots): Drop entries with zero use.
8425 (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
8426 (elf64_alpha_always_size_sections): Split out got sizing ...
8427 (elf64_alpha_size_got_sections): ... here. New function.
8428 (elf64_alpha_relax_find_reloc_ofs): New function.
8429 (elf64_alpha_relax_with_lituse): Likewise.
8430 (elf64_alpha_relax_without_lituse): Likewise.
8431 (elf64_alpha_relax_opt_call): Likewise.
8432 (elf64_alpha_relax_section): Likewise.
8433 (elf64_alpha_add_symbol_hook): Likewise.
8434 (elf64_alpha_howto_table): Implement GPRELHIGH/LOW & IMMED_GP_16.
8435 (elf64_alpha_relocate_section): Likewise.
8436 (bfd_elf64_bfd_relax_section): Define.
8437 (elf_backend_add_symbol_hook): Likewise.
8441 * elf.c (prep_headers): Use new EM_SPARCV9 symbol.
8442 * elf64-sparc.c (ELF_MACHINE_CODE): Likewise.
8443 (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64.
8447 * configure.in: Add -lkernel32 to WIN32LIBADD on cygwin32.
8448 * configure: Rebuild.
8452 * Makefile.am (libbfd_la_LIBADD): Add @WIN32LIBADD@.
8453 (libbfd_la_LDFLAGS): Add @WIN32LDFLAGS@.
8454 * configure.in: Define and substitute WIN32LDFLAGS and
8456 * aclocal.m4: Rebuild with new libtool.
8457 * configure, Makefile.in: Rebuild.
8461 * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol
8462 before any other symbols in the same section.
8466 * config.bfd (powerpc*-*-*): Remove PowerPC NT support from ELF
8471 * dwarf2.c (comp_unit): Move it earlier in the source. Add
8473 (read_address): Replace 'bdf*' argument with 'comp_unit*' argument.
8474 Use addr_size for address size, rather than sizeof(bfd_vma).
8475 (read_attribute): Replace bdf* argument with 'comp_unit*' argument.
8476 Fix call to read_address.
8477 (decode_line_info): Replace bdf* argument with 'comp_unit*' argument.
8478 Scrap other unneeded arguments. Fix call to read_address.
8479 (scan_unit_for_functions): Fix call to read_attribute.
8480 (parse_comp_unit): We now handle more values for addr_size.
8481 Set addr_size in unit. Fix call to read_attribute and
8486 * dwarf2.c (parse_comp_unit): Drop use of unit->name when it is null.
8490 * archures.c (bfd_default_scan): Add m68k cases back to default
8491 switch, reverting patch of March 25, since IEEE support depends
8496 * Makefile.am (diststuff): New target.
8497 * Makefile.in: Rebuild.
8501 * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of
8502 som_offset when we have an extended name table.
8506 * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before
8508 * Makefile.in: Rebuild.
8512 * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section
8513 symbols when creating a shared library.
8514 (elf_m68k_adjust_dynindx): New function, used by above code.
8515 (elf_m68k_finish_dynamic_sections): Initialize the section
8517 (elf_m68k_relocate_section): Change abort to BFD_ASSERT.
8521 * coff-arm.c (in_reloc_p): Use ARM_RVA32 in place of constant
8526 * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix
8531 * elf-m10300.c (mn10300_elf_relax_section): Correctly handle
8536 * configure.in: Set version to 2.9.1.
8537 * configure: Rebuild.
8539 * Branched binutils 2.9.
8543 * syms.c (ENABLE_CACHING): Define.
8544 (struct indexentry): Define.
8545 (struct stab_cache): Remove.
8546 (cmpindexentry): New static function.
8547 (struct stab_find_info): Add new fields: indextable,
8548 indextablesize, cached_indexentry, cached_offset, cached_stab, and
8549 cached_file_name. Remove fields: file_cache, function_cache, and
8551 (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted
8552 index table and search it.
8556 * elf.c (_bfd_elf_copy_private_section_data): Call
8557 copy_private_bfd_data once we've seen the last SEC_ALLOC section.
8559 * cpu-mips.c: Remove trailing comma at end of enumeration list.
8563 * coff-arm.c: Define all globally visible variables and functions
8564 only when COFF_WITH_PE is not defined.
8565 * configure.in (armpe_little_vec, armpe_big_vec): Add
8567 * configure: Rebuild.
8571 Fix some gcc -Wall warnings:
8572 * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings.
8573 * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise.
8574 * archures.c (bfd_default_scan): Likewise.
8575 * bfd.c (bfd_scan_vma): Likewise.
8576 * binary.c (mangle_name): Likewise
8577 * coff-arm.c (aoutarm_fix_pcrel_26): Likewise.
8578 * coff-sh.c (sh_relocate_section): Likewise.
8579 * coff-stgo32.c (create_go32_stub): Likewise.
8580 * coffcode.h (coff_slurp_line_table): Likewise.
8581 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
8582 * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
8583 (assign_file_positions_for_segments): Likewise.
8584 * elf32-mips.c (mips_elf_relocate_section): Likewise.
8585 * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
8586 * oasys.c (oasys_write_sections): Likewise.
8587 * ppcboot.c (ppcboot_object_p): Likewise.
8588 (mangle_name): Likewise.
8589 * riscix.c (riscix_fix_pcrel_26): Likewise.
8590 * srec.c (srec_scan): Likewise.
8591 * stabs.c (_bfd_write_section_stabs): Likewise.
8592 * sunos.c (sunos_add_dynamic_symbols): Likewise.
8593 * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to
8594 switch. Declare parameters for function pointers.
8595 * archures.c (bfd_default_scan): Add braces to avoid ambiguous if
8597 * elf.c (elf_sort_sections): Likewise.
8598 * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation.
8599 Add default cases to switches.
8600 (coff_arm_relocate_section): Remove unused local variables.
8602 (coff_arm_bfd_set_private_flags): Change flag variable to type
8604 * coff-mips.c (mips_relocate_section): Initialize use_lo.
8605 * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int.
8606 (dump_toc): Change cat to const, and initialize it.
8607 * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff.
8608 * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise.
8609 (sh_elf_relocate_section): Initialize r_symndx.
8610 * coffcode.h (coff_compute_section_file_positions): Only declare
8611 old_sofar if ALIGN_SECTIONS_IN_FILE.
8612 (coff_write_object_contents): Initialize csym.
8613 * coffgen.c (coff_pointerize_aux): Make type and class unsigned.
8614 * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to
8616 * dwarf2.c: Include libiberty.h.
8617 (read_2_signed_bytes, read_4_signed_bytes): Comment out.
8618 (decode_line_info): Remove unused local variables.
8619 * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise.
8620 (m32r_elf_relocate_section): Likewise.
8621 * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise.
8622 (v850_elf_reloc): Likewise.
8623 * elf-bfd.h (elf_linker_section_t): Make alignment unsigned.
8624 (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned.
8625 * elf.c (assign_file_positions_for_segments): Always set adjust.
8626 * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully
8627 parenthesize expression.
8628 * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h.
8629 (m32r_elf_object_p): Return a value.
8630 (m32r_elf_print_private_bfd_data): Change fprintf format string.
8631 * elf32-mips.c (mips_elf_final_link): Initialize last.
8632 (mips_elf_finish_dynamic_sections): Initialize last and dindx.
8633 * elf32-v850.c (v850_elf_object_p): Return a value.
8634 (v850_elf_print_private_bfd_data): Change fprintf format string.
8635 * elfcode.h (elf_slurp_symbol_table): Change symcount and i to
8637 * elflink.h (elf_link_add_object_symbols): Change vernum to
8638 unsigned int, and initialize it. Change fprintf format string.
8639 (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type
8640 when setting or comparing to soname_indx.
8641 (elf_create_pointer_linker_section): Change num_symbols to
8643 * libcoff-in.h (coff_data_type): Change flags to flagword.
8644 * peicode.h (pe_print_idata): Initialize idx. Change j to
8645 bfd_size_type. Initialize hint_member. Remove useless test to
8647 (pe_print_edata): Change num_functions and num_names in struct
8648 EDT_type to unsigned long. Remove cast. Change fprintf format
8650 * ppcboot.c (ppcboot_object_p): Change i to size_t.
8651 * reloc.c (bfd_get_reloc_size): Change return type to unsigned
8653 * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to
8654 int *. Update uses. Change j to long.
8655 * bfd-in2.h, libcoff.h: Rebuild.
8659 * elf32-v850.c Remove definition of USE_REL.
8660 (v850_elf_info_to_howto_rela): New function.
8661 (v850_elf_perform_relocation): Renamed from
8662 v850_elf_store_addend_in_insn. Removed replace argument.
8663 (v850_elf_reloc): store the relocation in the addend field instead
8665 (v850_elf_final_link_relocate): Now calls
8666 v850_elf_perform_relocation.
8667 (v850_elf_relocate_section): Remove code to generate REL
8672 * coffcode.h (coff_new_section_hook): Set the type and storage
8673 class in the native symbol information allocated for a new section
8678 * peicode.h: Chain together calls to
8679 coff_bfd_copy_private_bfd_data and
8680 coff_bfd_print_private_bfd_data.
8682 * coff-arm.c: Add prototypes for
8683 coff_arm_bfd_print_private_bfd_data and
8684 coff_arm_bfd_copy_private_bfd_data.
8688 * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE
8691 * peicode.h: Call arm-coff private data functions after handling
8694 * coff-arm.c: Turn statics into globals so that they can be shared
8695 both pe and pei backends.
8699 * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than
8701 (sunos_write_object_contents): Likewise.
8702 * aoutx.h (NAME(aout,machine_type)): Likewise.
8703 * coffcode.h (coff_set_arch_mach_hook): Likewise.
8707 * archures.c (bfd_mach_m68*): Add definitions for various m68k
8709 (bfd_default_scan): Remove m68k special cases.
8710 * bfd-in2.h: Rebuild.
8711 * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather
8713 * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise.
8714 * cpu-m68k.c (arch_info_struct): Likewise. Add entry for
8716 (bfd_m68k_arch): Set mach field to zero to signal no explicit
8717 selection, change printable_name to just "m68k" and make that the
8718 default instead of m68k:68020.
8720 * aout-tic30.c (NAME): Define this to avoid multiple definitions
8722 (MY_get_section_contents): Define as aout_32_get_section_contents
8723 rather than NAME(aout,get_section_contents).
8725 * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast.
8727 * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha
8728 and call bfd_default_set_arch_mach to do the real work.
8732 * bout.c (BALX): Include return register g14 as part of the insn.
8734 (calljx_callback): Use it.
8738 * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma.
8739 * libbfd.h: Rebuild.
8741 * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change
8742 byte_count to unsigned int.
8743 (mn10300_elf_relax_section): Initialize internal_relocs. Remove
8744 unused local variables.
8746 * evax-alpha.c (evax_close_and_cleanup): Remove unused local
8747 variables er and er1.
8749 * cpu-v850.c: Include <ctype.h>.
8750 (scan): Case isdigit argument to unsigned char.
8753 * ihex.c (ihex_scan): Add extbase variable so that getting an
8754 extended linear address record does not ignore any previous
8756 (ihex_write_object_contents): When writing out an extended linear
8757 address record, zero out any previous extended address.
8761 * ieee.c (do_one): Check section before dereferencing it.
8762 (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr.
8763 (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive.
8767 * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF.
8771 * coff-arm.c: Add interworking functions to pe backends.
8775 * configure.in: Use AM_DISABLE_SHARED.
8776 * aclocal.m4, configure: Rebuild with libtool 1.2.
8780 * coff-arm.c (coff_arm_relocate_section): Better error messages
8781 when interowrking conflucts occur. Courtesy of Jonathan Walton
8783 (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted
8784 relocations. Patch courtesy of Jonathan Walton and Tony
8789 * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert
8790 part of Feb 22 change controling when to override the existing
8791 symbol with the .plt entry.
8795 * config.bfd (targ_cpu): Add thumb-pe target.
8797 * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external
8798 functions in PE build.
8802 * config.bfd (sparclite-*-elf*): Added.
8806 * configure.in: Add elf.lo to elf shell variable.
8807 * Makefile.am (BFD_LIBS): Remove elf.lo.
8808 (BFD_LIBS_CFILES): Remove elf.c.
8809 (BFD32_BACKENDS): Add elf.lo.
8810 (BFD32_BACKENDS_CFILES): Add elf.c.
8811 * configure, Makefile.in: Rebuild.
8815 * elf32-i386.c (elf_i386_relocate_section): A pc-relative
8816 relocation against a non-local symbol should not have a dynamic
8821 * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in
8823 (pe_print_private_bfd_data): Print PE flags. From Mikey
8828 * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create
8829 a plt entry when we can determine that we authoritatively define
8834 * configure.in (COREFILE selection): Remove sparc-*-linux*. They
8835 don't actually use trad-core, but a SunOS-style core file handled
8837 * hosts/sparclinux.h: Remove.
8841 * peicode.h (pe_print_idata): If there is no .idata section, look
8842 for the import tables in some other section. Make the initial
8843 label line up better with the data. Print the import address
8844 table even if there is no import name table. If the import
8845 address table holds actual addresses, print them.
8849 * libbfd.c (bfd_seek): If fseek fails, save errno around call to
8850 bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not
8851 bfd_error_system_call.
8855 * Makefile.am (AUTOMAKE_OPTIONS): Define.
8856 * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
8859 * Makefile.am (libbfd_la_LDFLAGS): Define.
8860 * Makefile.in: Rebuild.
8865 * netbsd.h (MACHTYPE_OK): Define.
8866 (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when
8867 calling N_SET_MACHTYPE, rather than having a switch.
8868 * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD,
8870 * i386netbsd.c (MACHTYPE_OK): Don't define.
8871 (DEFAULT_MID): Define.
8872 * m68k4knetbsd.c (SEGMENT_SIZE): Don't define.
8873 (MACHTYPE_OK): Don't define.
8874 (DEFAULT_MID): Define.
8875 * m68knetbsd.c: (MACHTYPE_OK): Don't define.
8876 (DEFAULT_MID): Define.
8877 * ns32knetbsd.c (MACHTYPE_OK): Don't define.
8878 (DEFAULT_MID): Define.
8879 * sparcnetbsd.c (MACHTYPE_OK): Don't define.
8880 (DEFAULT_MID): Define.
8883 * vaxnetbsd.c: New file.
8884 * netbsd-core.c: Clean up. Remove unused macros. Use netbsd
8885 rather than netbsd_core.
8886 * targets.c (vaxnetbsd_vec): Declare.
8887 (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is
8888 defined, add netbsd_core_vec.
8889 * configure.in: Set COREFILE for alpha*-*-netbsd* and
8890 powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is
8891 netbsd-core.lo, set COREFLAG to -DNETBSD_CORE.
8892 * config.bfd (alpha*-*-netbsd*): New target.
8893 * Makefile.am: Rebuild dependencies.
8894 (BFD32_BACKENDS): Add vaxnetbsd.lo.
8895 (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c.
8896 * configure, Makefile.in: Rebuild.
8898 * configure.host: Remove the old shared library build stuff. We
8899 now use libtool instead.
8903 * tekhex.c (tekhex_write_object_contents): Call tekhex_init.
8907 * configure.in: Take stab-syms.lo out of sparclinux_vec list.
8908 * configure: Rebuild.
8911 * elf32-v850.c (remember_hi16s_reloc): New function.
8912 (find_remembered_hi16s_reloc): New function.
8913 (v850_elf_store_addend_in_insn): Use the above new functions to
8914 match up HI6S relocs with LO16 relocs.
8918 * configure.in: Change -linux* to -linux-gnu*.
8919 * config.bfd, configure.host: Likewise.
8920 * configure: Rebuild.
8924 * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another
8925 LO16/HI16S bug and improve comments about what is going on.
8929 * configure, aclocal.m4: Rebuild with new libtool.
8933 * elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain
8934 when merging v850 code into v850e/v850ea code. Do not initialise
8935 output flags if the input is the default architecture.
8939 * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR
8940 get the size from bfd_arch_bits_per_address instead of directly
8945 * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address
8946 to wrap, just return all 1's bits instead.
8947 * libbfd.h: Regenerate.
8951 * coff-i386.c (coff_pe_i386_relocate_section): New static function
8953 (coff_relocate_section): If COFF_WITH_PE, define as
8954 coff_pe_i386_relocate_section.
8955 * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE,
8956 skip empty sections, to match coff_write_object_contents.
8958 * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend,
8959 rather than swapping out r_offset twice. From Luke Deller
8964 * configure.in: Set libtool_enable_shared rather than
8965 libtool_shared. Remove diversion hack.
8966 * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild
8971 * syms.c (struct stab_cache): Define.
8972 (struct stab_find_info): Remove cached_offset, cached_stab,
8973 cached_str, and cached_stroff fields. Add file_cache,
8974 function_cache, and line_cache fields.
8975 (_bfd_stab_section_find_nearest_line): Use extensive caching to
8980 * peicode.h (pe_print_idata): Check for import of ordinal rather
8982 (pe_print_edata): If there is no .edata section, look for the
8983 export data in some other section.
8987 * configure.in: Change version to 2.8.4.
8988 * configure: Regenerated.
8992 Add tms320c30 support:
8993 * cpu-tic30.c: New file.
8994 * aout-tic30.c: New file.
8995 * coff-tic30.c: New file.
8996 * archures.c (bfd_arch_tic30): Define.
8997 (bfd_tic30_arch): Declare.
8998 (bfd_archures_list): Add bfd_tic30_arch.
8999 * targets.c (bfd_target_vector): Add tic30_aout_vec and
9001 * reloc.c (BFD_RELOC_TIC30_LDP): Define.
9002 * coffcode.h (coff_set_arch_mach_hook): Add tic30 case.
9003 (coff_set_flags): Likewise.
9004 * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets.
9005 * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors.
9006 * Makefile.am: Rebuild dependencies.
9007 (ALL_MACHINES): Add cpu-tic30.lo.
9008 (ALL_MACHINES_CFILES): Add cpu-tic30.c.
9009 (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo.
9010 (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c.
9011 * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
9015 * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc
9016 to lag behind LO16 reloc by a couple of instructions.
9020 * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force
9021 make to reexamine the file timestamp.
9022 ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise.
9024 * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from
9029 * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure
9030 to create .dynsbss and .rela.sbss sections.
9031 (ppc_elf_adjust_dynamic_symbol): Put space for small data to be
9032 copied from dynamic objects into .sbss.
9033 (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't
9034 use it. Correct typo of .rela.sdata2.
9035 (ppc_elf_finish_dynamic_symbol): Generate reloc to where we
9036 put the data, which may now be in .sbss.
9037 (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss.
9038 (elf_backend_create_dynamic_sections): Define as
9039 ppc_elf_create_dynamic_sections.
9041 * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs
9042 against _GLOBAL_OFFSET_TABLE_.
9043 (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in
9044 shared libraries which refer to local symbols. Make sure that the
9045 test for allocating space for a reloc in a shared object is the
9046 same as the test for emitting a reloc.
9050 * config.bfd (i[3456]-*-mingw32*): New target.
9051 * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32.
9052 * aclocal.m4, configure: Rebuild.
9056 * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we
9061 Sparc v9 ABI compliant PLT:
9062 * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries.
9063 (plt_templates, sparc64_elf_build_plt_entry): Delete.
9064 (LARGE_PLT_THRESHOLD): New define.
9065 (GOT_RESERVED_ENTRIES): V9 ABI only uses 1.
9066 (sparc64_elf_build_plt): New function.
9067 (sparc64_elf_plt_entry_offset): Likewise.
9068 (sparc64_elf_plt_ptr_offset): Likewise.
9069 (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to
9070 contain the index for convenience. Skip the initial entries
9072 (sparc64_elf_size_dynamic_sections): Zero the allocated contents
9073 memory for the benefit of .rela.plt.
9074 (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset.
9075 (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use
9076 sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc.
9077 (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt.
9078 Call sparc64_elf_build_plt.
9079 (elf_backend_want_got_plt): No.
9080 (elf_backend_plt_readonly): No.
9081 (elf_backend_plt_alignment): 8.
9083 * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab.
9084 * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it.
9085 * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it
9090 * archures.c (bfd_mach_mips*): Add definitions for various MIPS
9092 * cpu-mips.c (arch_info_struct): Add mips variants.
9093 * bfd-in2.h: Rebuilt.
9097 * coff-arm.c (coff_arm_relocate_section): Preserve the contents of
9102 * config.bfd (i[3456]86-sco3.2v5*): ELF now the default.
9103 (i[3456]86sco3.2v5*coff): New target.
9107 * bfd-in2.h: Rebuild with changes to chew--tab expansion.
9111 * bfd.c (bfd_get_error_handler): Add orthogonal function.
9112 * bfd-in2.h: Regenerate.
9116 * tekhex.c (tekhex_write_object_contents): Check for no symbols.
9120 * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't
9121 adjust addend for an output common symbol (from Jimmy Blair
9123 defined symbol to counteract adjustment made in generic relocation
9126 * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h.
9130 * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name.
9131 (GET_SCNDHR_NLNNO): Likewise.
9135 * cpu-sh.c (arch_info_struct): Correct next field of sh3e.
9139 * elf32-m32r.c: Add macros to handle NOP insertion.
9143 * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section.
9144 (xcoff_mark): Likewise.
9145 (xcoff_build_ldsyms): Mark absolute symbols.
9149 * bout.c (b_out_write_object_contents): Sort symbols before output
9150 to keep {CALL,BAL}NAME symbols adjacent.
9151 (b_out_symbol_cmp): New function.
9153 For older changes see ChangeLog-9697
9159 version-control: never