3 * elflink.c (_bfd_elf_dynamic_symbol_p): Undo the last change.
7 * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
8 (SYMBOL_CALLS_LOCAL): Likewise.
10 * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
11 immediately if symbol isn't defined locally.
15 * elflink.c (_bfd_elf_dynamic_symbol_p): New.
16 * elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it.
17 (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it.
18 * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise.
19 * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
20 * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise.
21 * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise.
22 Update all callers to provide the relocation being resolved.
26 * config.bfd (arm-wince-pe): Add -DARM_COFF_BUGFIX to
31 * po/es.po: New Spanish translation.
32 * po/sv.po: New Swedish translation.
33 * po/opcodes.pot: Regenerate.
37 * config.bfd, configure.host, configure.in: Remove ia64-aix support.
38 * elfxx-ia64.c, targets.c: Likewise.
42 * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false
43 for symbols defined locally plus -Bsymbolic. Tidy logic.
47 * archures.c (bfd_mach_mips7000): New.
48 * bfd-in2.h: Regenerated.
49 * cpu-mips.c (arch_info_struct): Add an entry for mips:7000.
50 * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips7000.
51 (mips_mach_extensions): Add an entry for it.
55 * po/tr.po: Update with latest version.
56 * po/SRC-POTFILES.in: Regenerate.
57 * po/bfd.pot: Regenerate.
58 * Makfile.in: Regenerate.
59 * configure: Regenerate.
63 * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures.
64 * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
65 * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
66 * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino.
70 * coffcode.h (coff_set_section_contents): Set the
71 IMAGE_FILE_32BIT_MACHINE flag for PE targets.
75 * bfd-in.h (bfd_h8300_pad_address): Declare.
76 * bfd-in2.h: Regenerate.
77 * cpu-h8300.c (bfd_h8300_pad_address): New function.
78 * coff-h8300.c (h8300_reloc16_estimate): Use it to canonicalize
79 addresses before checking whether they can be relaxed.
80 (h8300_reloc16_extra_cases): Likewise for the R_MOVL2 sanity check.
81 Don't complain about overflows in general 8-bit relocations.
82 * elf32-h8300.c (elf32_h8_relax_section): Use bfd_h8300_pad_address.
83 Fix handling of R_H8_DIR24A8.
87 * elf32-h8300.c: Convert function prototypes and definitions
89 * coff-h8300.c: Likewise.
90 * cpu-h8300.c: Likewise.
94 * po/SRC-POTFILES.in: Regenerate.
95 * po/bfd.pot: Likewise.
99 * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new
100 .got.loc section. Do not set SEC_ALLOC or SEC_LOAD flags for the
102 (elf_xtensa_size_dynamic_sections): Set size of the .got.loc section
103 and allocate memory for it.
104 (elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output
105 section to the .got.loc section.
106 (elf_xtensa_finish_dynamic_sections): Fix up call to
107 elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to
108 the address of .got.loc.
109 (relax_property_section): Shrink .got.loc to match changes in any
110 literal table section.
111 (xtensa_is_property_section): Change to match
112 xtensa_get_property_section_name.
113 (xtensa_is_littable_section): New.
117 * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1 instead of
122 * Makefile.am (BFD32_BACKENDS): Add elf32-am33lin.lo.
123 (BFD32_BACKENDS_CFILES): elf32-am33lin.c not elf32-am33lin.lo.
125 * Makefile.in: Regenerate.
130 * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
131 (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
133 * elf32-am33lin.c: Rename global functions.
135 * config.bfd (am33_2.0, am33_2.0-*-linux*): Added.
136 * configure.in (bfd_elf32_am33lin_vec): Added.
137 * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo.
138 (elf32-am33lin.lo): List dependencies.
139 * aclocal.m4, configure, Makefile.in: Rebuilt.
140 * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME,
141 ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if
142 ELF_ARCH was not defined before.
143 (elf_symbol_leading_char): Define if not defined.
144 * elf32-am33lin.c: Override the definitions above.
145 * targets.c (bfd_elf32_am33lin_vec): New.
150 * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize
153 * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from
154 ld-linux.so.2 to ld.so.1.
156 * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro.
157 (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it.
158 (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
159 * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate
160 .rela.* section contents with bfd_zalloc.
162 * elf-m10300.c: Added declarations for functions missing them.
163 Merge some shared-library changes from the i386 back-end. Use
164 R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and
165 R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate.
166 (struct elf32_mn10300_link_hash_entry): Remove duplicates of
167 members of elf_link_hash_entry. Adjusted references.
168 (mn10300_elf_final_link_relocate): dynobj was already loaded
169 into a local variable, use it.
171 * elf-m10300.c: Add missing function prototypes.
173 * elf-m10300.c (mn10300_elf_relocate_section): Don't compute
174 relocation for dynamic relocations.
176 * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New.
177 * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and
178 PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32.
179 (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT...
180 (_bfd_mn10300_elf_create_got_section): ... here, so that its
181 adress is already known at the time we compute relaxations.
182 (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32
183 and PLT32 to narrower relocations.
184 * libbfd.h, bfd-in2.h: Rebuilt.
186 * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24,
187 BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY,
188 BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT,
189 BFD_RELOC_MN10300_RELATIVE): New relocs.
190 * libbfd.h, bfd-in2.h: Rebuilt.
191 * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New.
192 (struct elf32_mn10300_link_hash_entry): Added DSO-related
194 (elf_mn10300_howto): Defined new relocation types.
195 (mn10300_reloc_map): Map them.
196 (_bfd_mn10300_elf_create_got_section): New fn.
197 (mn10300_elf_check_relocs): Handle PIC relocs.
198 (mn10300_elf_final_link_relocate): Likewise.
199 (mn10300_elf_relocate_section): Handle DSOs.
200 (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros.
201 (elf_mn10300_plt0_entry, elf_mn10300_plt_entry,
202 elf_mn10300_pic_plt_entry): New.
203 (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset,
204 elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset,
205 elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset,
206 elf_mn10300_plt_reloc_offset: New macros.
207 (ELF_DYNAMIC_INTERPRETER): Likewise.
208 (_bfd_mn10300_elf_create_dynamic_sections): New function.
209 (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise.
210 (_bfd_mn10300_elf_discard_copies): Likewise.
211 (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
212 (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
213 (_bfd_mn10300_elf_finish_dynamic_sections): Likewise.
214 (elf_backend_can_gc_sections,
215 elf_backend_create_dynamic_sections,
216 elf_backend_adjust_dynamic_sections,
217 elf_backend_size_dynamic_sections,
218 elf_backend_finish_dynamic_symbol,
219 elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
220 elf_backend_plt_readonly, elf_backend_want_plt_sym,
221 elf_backend_got_header_size, elf_backend_plt_header_size): New
227 * elf-m10300.c (compute_function_info): Account for AM33
228 registers in `movm' when computing stack space for `call' when
229 linking for AM33/2.0 link.
231 * archures.c (bfd_mach_am33_2): Renamed from bfd_mach_am332.
232 * bfd-in2.h: Rebuilt.
233 * cpu-m10300.c (bfd_am33_2_arch): Renamed from bfd_am332_arch.
234 * elf-m10300.c: Updated.
236 * archures.c (bfd_mach_am332): Defined.
237 * bfd-in2.h: Rebuilt.
238 * cpu-m10300.c (bfd_am332_arch): Defined.
239 (bfd_am33_arch): Chained with am33-2.
240 * elf-m10300.c (elf_mn10300_mach): Handle am332.
241 (_bfd_mn10300_elf_final_write_processing): Likewise.
245 * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1LL.
249 * elf64-ppc.c (bfd_elf64_mkobject): Define.
250 (struct ppc64_elf_obj_tdata): New.
251 (ppc64_elf_tdata, ppc64_tlsld_got): Define.
252 (ppc64_elf_mkobject): New function.
253 (struct got_entry): Add "owner". Move "tls_type".
254 (struct ppc_link_hash_table): Delete "relgot", "tlsld_got".
255 (ppc64_elf_init_stub_bfd): New function.
256 (create_got_section): Create header .got in dynobj. Create .got
257 and .rela.got in each bfd. Stash pointers in ppc64_elf_obj_tdata.
258 (ppc64_elf_create_dynamic_sections): Don't call create_got_section.
259 Look for dynobj .got, and test it.
260 (ppc64_elf_copy_indirect_symbol): Adjust for changed got.
261 (update_local_sym_info): Likewise.
262 (ppc64_elf_check_relocs): Likewise.
263 (ppc64_elf_gc_sweep_hook): Likewise.
264 (ppc64_elf_tls_optimize): Likewise.
265 (allocate_dynrelocs): Likewise.
266 (ppc64_elf_size_dynamic_sections): Likewise.
267 (ppc64_elf_relocate_section): Likewise.
268 (ppc64_elf_next_toc_section): Update comment.
269 (toc_adjusting_stub_needed): Remove unneeded cast.
270 (ppc64_elf_build_stubs): Check for stub sections in stub bfd by
271 testing section flags.
272 (ppc64_elf_build_stubs): Likewise.
273 (ppc64_elf_size_stubs): Likewise. Remove stub_bfd param.
274 (ppc64_elf_finish_dynamic_sections): Write out got sections.
275 (func_desc_adjust): Copy over dynamic info for undef weaks.
276 * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare.
277 (ppc64_elf_size_stubs): Update prototype.
278 * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn
279 input sections rather than scanning dynobj.
283 * elfxx-mips.c (mips_elf_link_hash_entry): Remove min_dyn_reloc_index.
284 (bfd_mips_elf_swap_msym_in, bfd_mips_elf_swap_msym_out): Delete.
285 (mips_elf_create_msym_section): Delete.
286 (mips_elf_create_dynamic_relocation): Don't set min_dyn_reloc_index.
287 (_bfd_mips_elf_copy_indirect_symbol): Likewise.
288 (_bfd_mips_elf_create_dynamic_sections): Don't create .msym.
289 (_bfd_mips_elf_size_dynamic_sections): Don't calculate its size.
290 (_bfd_mips_elf_size_dynamic_sections): Don't add DT_MIPS_MSYM.
291 (_bfd_mips_elf_finish_dynamic_symbol): Don't add symbols to .msym.
292 (_bfd_mips_elf_finish_dynamic_sections): Likewise.
296 * elfxx-mips.c (mips_elf_irix6_finish_dynamic_symbol): Make the
301 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Fix handling
302 of relocations whose offset is -2.
306 * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat
307 forced-local symbols like other locals. Don't create relocations
308 against STN_UNDEF in irix objects.
312 * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI-
313 compatible objects, add the values of defined external symbols
318 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Always
319 initialize a GOT entry to the symbol's st_value.
323 * elf-bfd.h (struct elf_obj_tdata): Move linker_section_pointers..
324 * elf32-ppc.c (struct ppc_elf_obj_tdata): ..to here. New.
325 (ppc_elf_tdata): Define.
326 (elf_local_ptr_offsets): Adjust.
327 (ppc_elf_mkobject): New function.
328 (bfd_elf32_mkobject): Define.
330 * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format.
331 * elfcore.h (elf_core_file_p): Likewise.
332 * section.c (bfd_section_init): Remove prototype.
336 * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer
338 (enum elf_linker_section_enum): Delete.
339 (struct elf_linker_section): Delete.
340 (struct elf_linker_section_pointers): Delete.
341 (struct elf_obj_tdata): Remove #if 0 chunk. Remove linker_section.
342 Make linker_section_pointers a void**.
343 (elf_local_ptr_offsets, elf_linker_section): Don't define.
344 * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version
345 of old item in elf-bfd.h.
346 (struct elf_linker_section): Likewise.
347 (struct elf_linker_section_pointers): Likewise.
348 (elf_local_ptr_offsets): Define.
349 (struct ppc_elf_link_hash_entry): Add linker_section_pointer.
350 (ppc_elf_link_hash_newfunc): Init it.
351 (struct ppc_elf_link_hash_table): Add sbss.
352 (ppc_elf_link_hash_table_create): zmalloc rather than clearing
354 (elf_create_linker_section): Fold into..
355 (ppc_elf_create_linker_section): ..here. Remove hole_size code.
356 Make rela section here if shared.
357 (elf_find_pointer_linker_section): Pass lsect rather than enum.
358 (elf_create_pointer_linker_section): Adjust. zalloc rather than
360 (elf_finish_pointer_linker_section): Adjust. Don't make rela
362 (ppc_elf_check_relocs): Adjust.
363 (ppc_elf_add_symbol_hook): Tighten hash creator test. Remove code
364 creating .sbss by hand.
365 * elf.c (_bfd_elf_link_hash_newfunc): Adjust.
369 * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to
370 complain_overflow_bitfield.
371 * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to
372 complain_overflow_bitfield.
376 * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return
381 * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec.
382 (elfNN_ia64_dynamic_symbol_p): Change info->shared into
384 (get_fptr): For -pie create .opd as writable section and create
386 (elfNN_ia64_check_relocs): Change info->shared into
388 (allocate_fptr): Likewise.
389 (allocate_dynrel_entries): Account for a relative reloc for -pie
390 @fptr(). Don't account for a relative reloc if -pie want_ltoff_fptr
391 for undefweak symbol. Account for an IPLT reloc in .rela.opd
393 (set_got_entry): Don't create a relative reloc if -pie
394 want_ltoff_fptr for undefweak symbol.
395 (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie.
396 (elfNN_ia64_relocate_section): Emit a relative reloc for -pie
399 * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol
401 * elf32-i386.c (elf_i386_relocate_section): Likewise.
402 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
403 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
404 * elf64-s390.c (elf_s390_relocate_section): Likewise.
405 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
406 * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
407 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
408 * elf32-s390.c (elf_s390_relocate_section): Likewise.
409 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
413 * elf32-h8300.c (R_H8_DIR32A16): Fix name field.
414 (elf32_h8_relax_section) <R_H8_DIR16A8>: Adjust position of relocation.
415 <R_H8_DIR32A16>: Fix type of relocation.
419 * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic
420 sections were created already. Remove unnecessary tests of
425 * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call
426 bfd_make_section for existing sections.
430 * elf32-sparc.c (elf32_sparc_check_relocs): Don't call
431 create_got_section if we already have done so.
432 * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
433 (sh_elf_check_relocs): Likewise.
434 (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var. Use
435 htab->root.dynobj instead.
436 (sh_elf_check_relocs): Likewise.
437 (sh_elf_finish_dynamic_sections): Likewise.
439 * section.c (bfd_make_section): Return NULL for existing section.
443 * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call
444 ppc_elf_create_got if we've already done so.
446 * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare.
447 (_bfd_elf_find_pointer_linker_section): Likewise.
448 (bfd_elf32_create_pointer_linker_section): Likewise.
449 (bfd_elf32_finish_pointer_linker_section): Likewise.
450 (bfd_elf64_create_pointer_linker_section): Likewise.
451 (bfd_elf64_finish_pointer_linker_section): Likewise.
452 (_bfd_elf_make_linker_section_rela): Likewise.
453 * elfcode.h (elf_create_pointer_linker_section): Don't define.
454 (elf_finish_pointer_linker_section): Likewise.
455 * elflink.c (_bfd_elf_make_linker_section_rela): Delete.
456 (_bfd_elf_create_linker_section): Move this function..
457 (_bfd_elf_find_pointer_linker_section): ..and this..
458 * elflink.h (elf_create_pointer_linker_section): ..and this..
459 (elf_finish_pointer_linker_section): ..and this..
460 * elf32-ppc.c: ..to here, renaming to the following, and adjusting
462 (elf_create_linker_section): Convert to C90, tidy.
463 (elf_find_pointer_linker_section): Likewise.
464 (elf_create_pointer_linker_section): Likewise.
465 (elf_finish_pointer_linker_section): Likewise.
466 * elf32-i370.c: Delete #if 0 code.
470 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and
471 _restf* to be satisfied by shared libs, and always force them local.
472 (toc_adjusting_stub_needed): Avoid scanning linker created sections.
473 Correct test for "bl".
474 (ppc64_elf_relocate_section <R_PPC64_TLS>): Correct test for
479 * elf32-s390.c (s390_elf_ldisp_reloc): New prototype.
480 (s390_tls_reloc): New function.
481 (elf_howto_table): Add long displacement relocations R_390_20,
482 R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20.
483 (elf_s390_reloc_type_lookup): Likewise.
484 (elf_s390_check_relocs): Likewise.
485 (elf_s390_gc_sweep_hook): Likewise.
486 (elf_s390_relocate_section): Likewise.
487 * elf64-s390.c: Same changes as for elf32-s390.c.
488 * reloc.c: Add long displacement relocations BFD_RELOC_390_20,
489 BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and
490 BFD_RELOC_390_TLS_GOTIE20.
491 * bfd-in2.h: Regenerate.
492 * libbfd.h: Likewise.
496 * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts.
497 (ins_imms, ins_immsm1u4): Likewise. Warning fix.
501 * archive.c: Convert to C90, remove unnecessary prototypes and casts.
502 Replace PTR with void *. Formatting.
503 * archive64.c: Likewise.
504 * archures.c: Likewise.
505 * bfd-in.h: Likewise.
508 * bfdwin.c: Likewise.
510 * corefile.c: Likewise.
511 * format.c: Likewise.
513 * libbfd-in.h: Likewise.
514 * libbfd.c: Likewise.
515 * linker.c: Likewise.
516 * opncls.c: Likewise.
518 * section.c: Likewise.
519 * simple.c: Likewise.
521 * targets.c: Likewise.
522 * bfd-in2.h: Regenerate.
523 * libbfd.h: Regenerate.
525 * ecoff.c (bfd_debug_section): Add missing kept_section initialization.
526 * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined.
527 * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify.
528 (bfd_getb64): Rewrite without parens.
529 (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
530 * cache.c (insert, snip): Remove INLINE.
531 * linker.c (bfd_link_add_undef): Likewise.
535 * elf64-x86-64.c: Convert to ISO C90 prototypes, remove
536 unnecessary prototypes. Replace PTR with void *.
537 (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to
538 trim plt entries. Move undefweak non-default visibility test ...
539 (allocate_dynrelocs): ... from here.
540 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
542 (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. Use
543 SYMBOL_REFERENCES_LOCAL for dynreloc check.
544 (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for
545 dynreloc and .got relocs.
546 (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL
551 * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR.
555 * opncls.c (bfd_add_gnu_debuglink_section): Rename to
556 bfd_add_gnu_debuglink_section and only create the section, do not
557 fill in its contents.
558 (bfd_fill_in_gnu_debuglink_section): New function. Fill in the
559 contents of a .gnu-debuglink section.
560 * bfd-in2.h: Regenerate.
564 * elfxx-mips.c: Revert .got alignment to 2**4.
568 * elf32-mips.c: Fix addend for _gp_disp special symbol.
572 * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default
573 relocation header setup.
577 * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast.
578 (ppc_elf_reloc_type_lookup): Modify comment.
579 (ppc_elf_info_to_howto): Ditto.
580 (ppc_elf_relocate_section): Ditto.
581 (ppc_elf_check_relocs): Call ppc_elf_howto_init.
585 * aout-ns32k.c: Correct spelling of "relocatable".
587 * bfd-in.h: Likewise.
590 * coff-a29k.c: Likewise.
591 * coff-alpha.c: Likewise.
592 * coff-arm.c: Likewise.
593 * coff-i386.c: Likewise.
594 * coff-i860.c: Likewise.
595 * coff-i960.c: Likewise.
596 * coff-m68k.c: Likewise.
597 * coff-m88k.c: Likewise.
598 * coff-mcore.c: Likewise.
599 * coff-mips.c: Likewise.
600 * coff-or32.c: Likewise.
601 * coff-ppc.c: Likewise.
602 * coff-rs6000.c: Likewise.
603 * coff-sh.c: Likewise.
604 * coff-tic80.c: Likewise.
605 * coff64-rs6000.c: Likewise.
606 * cofflink.c: Likewise.
607 * cpu-ns32k.c: Likewise.
609 * ecofflink.c: Likewise.
610 * elf-bfd.h: Likewise.
611 * elf-eh-frame.c: Likewise.
612 * elf-hppa.h: Likewise.
613 * elf-m10200.c: Likewise.
614 * elf-m10300.c: Likewise.
616 * elf32-arm.h: Likewise.
617 * elf32-avr.c: Likewise.
618 * elf32-cris.c: Likewise.
619 * elf32-d10v.c: Likewise.
620 * elf32-dlx.c: Likewise.
621 * elf32-fr30.c: Likewise.
622 * elf32-frv.c: Likewise.
623 * elf32-h8300.c: Likewise.
624 * elf32-hppa.c: Likewise.
625 * elf32-i370.c: Likewise.
626 * elf32-i386.c: Likewise.
627 * elf32-i860.c: Likewise.
628 * elf32-i960.c: Likewise.
629 * elf32-ip2k.c: Likewise.
630 * elf32-iq2000.c: Likewise.
631 * elf32-m32r.c: Likewise.
632 * elf32-m68hc11.c: Likewise.
633 * elf32-m68hc1x.c: Likewise.
634 * elf32-m68k.c: Likewise.
635 * elf32-mcore.c: Likewise.
636 * elf32-mips.c: Likewise.
637 * elf32-msp430.c: Likewise.
638 * elf32-openrisc.c: Likewise.
639 * elf32-ppc.c: Likewise.
640 * elf32-s390.c: Likewise.
641 * elf32-sh.c: Likewise.
642 * elf32-sh64.c: Likewise.
643 * elf32-sparc.c: Likewise.
644 * elf32-v850.c: Likewise.
645 * elf32-vax.c: Likewise.
646 * elf32-xstormy16.c: Likewise.
647 * elf32-xtensa.c: Likewise.
648 * elf64-alpha.c: Likewise.
649 * elf64-hppa.c: Likewise.
650 * elf64-mips.c: Likewise.
651 * elf64-mmix.c: Likewise.
652 * elf64-ppc.c: Likewise.
653 * elf64-s390.c: Likewise.
654 * elf64-sh64.c: Likewise.
655 * elf64-sparc.c: Likewise.
656 * elf64-x86-64.c: Likewise.
657 * elfcode.h: Likewise.
658 * elflink.h: Likewise.
659 * elfn32-mips.c: Likewise.
660 * elfxx-ia64.c: Likewise.
661 * elfxx-mips.c: Likewise.
662 * i386linux.c: Likewise.
664 * libcoff-in.h: Likewise.
665 * linker.c: Likewise.
666 * m68klinux.c: Likewise.
668 * pe-mips.c: Likewise.
669 * peXXigen.c: Likewise.
671 * reloc16.c: Likewise.
672 * sparclinux.c: Likewise.
675 * versados.c: Likewise.
677 * xcofflink.c: Likewise.
678 * bfd-in2.h: Regenerate.
679 * libcoff.h: Regenerate.
680 * libbfd.h: Regenerate.
684 * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against
687 * elf32-i386.c: Convert to C90 function definitions, remove unnecessary
688 prototypes and casts. Replace PTR with void *. Formatting.
689 * elf32-ppc.c: Likewise. Break long strings too.
690 (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type.
691 (ppc_elf_unhandled_reloc): Internationalize error message.
692 * elf32-ppc.h: Remove PARAMS.
696 * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count
698 (ppc_elf_final_write_processing): Likewise.
702 * elflink.h (elf_link_input_bfd): Check raw size when using
703 kept_section to preserve debug information discarded by
708 * elf64-ppc.c (struct ppc_link_hash_table): Add top_id.
709 (ppc64_elf_setup_section_lists): Set it.
710 (ppc64_elf_relocate_section): Check sym section id against top_id.
711 (ppc_build_one_stub): Comment on top_id.
715 * config.bfd: Add tic4x-*-rtems*.
719 * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary
720 prototypes and casts. Replace PTR with void *. Format copyright.
722 (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt,
723 sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt.
724 (ppc_type_of_stub): Make r_type an enum.
725 (ppc64_elf_size_stubs): Likewise.
726 * elf64-ppc.h: Remove PARAMS macro.
730 * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of
733 * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
734 (ppc64_elf_info_to_howto): Likewise.
735 (ppc64_elf_build_stubs): Add "stats" param, and print statistics.
736 * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype.
740 * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32
741 reloc overflow on discarded eh_frame entries.
745 * elf64-ppc.c (toc_adjusting_stub_needed): New function.
746 (ppc64_elf_next_input_section): Use it here to set has_gp_reloc.
747 Return error condition.
748 (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections
749 that have has_gp_reloc set.
750 (struct ppc_link_hash_table): Add stub_count.
751 (ppc_build_one_stub): Increment it.
752 (ppc64_elf_link_hash_table_create): zmalloc rather than clearing
754 * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype.
758 * elflink.h (elf_gc_record_vtentry): Revert last change. Correct
759 size calculation from addend. Round size up.
763 * elf32-cris.c (cris_elf_relocate_section) <case
764 R_CRIS_32_GOTREL>: When linking a program, don't complain about a
765 symbol from a normal object or an undefined weak symbol.
769 * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on
774 * section.c (struct sec): Put back kept_section.
775 (STD_SECTION): Put back kept_section initialization.
776 * bfd-in2.h: Regenerate.
778 * elflink.h (elf_link_input_bfd): Also check discarded linkonce
779 sections for relocateable output. Use kept_section to preserve
780 debug information discarded by linkonce.
784 * elfxx-ia64.c (elfNN_ia64_relocate_section): Support
785 segment-relative relocation between different segments.
789 * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc
790 optimizations earlier.
792 * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index.
793 Restore previous input_list type.
794 (ppc64_elf_link_hash_table_create): Undo last change.
795 (ppc64_elf_setup_section_lists): Reinstate code setting up input lists
796 per output section, but don't bother with bfd_abs_section marker.
797 (ppc64_elf_next_input_section): Adjust for multiple input section
799 (group_sections): Likewise.
803 * elf64-ppc.c (ppc64_elf_relocation_section): Ensure
804 *r_offset == r_addend for RELATIVE relocs against .got.
808 * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs.
812 * elflink.h (elf_gc_record_vtentry): Allocate an extra element
813 in the vtable_entries_used array to allow for the accessing
818 * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index. Modify
820 (ppc64_elf_link_hash_table_create): Init input_list here.
821 (ppc64_elf_setup_section_lists): Remove code setting up input lists
822 per output section. Set toc_off for abs and other standard sections.
823 (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc.
824 (ppc64_elf_next_input_section): Adjust for single input section list.
825 Don't set toc_curr from input bfds that haven't set elf_gp.
826 (group_sections): Adjust for single input section list.
828 * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero.
832 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel
833 tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a
834 dtprel entry. Ensure TLS_LD DTPMOD reloc has a zero addend. Write
835 got section for RELATIVE relocs. Fix wrong comment. Change condition
836 under which dynamic relocs update the section contents.
840 * config.bfd: Add i386-netbsd-gnu target.
844 * opncls.c (calc_crc32): Rename to
845 bfd_calc_gnu_debuglink_crc32 and export.
846 (GNU_DEBUGLINK): Define and use to replace occurrences of
847 hard-coded ".gnu_debuglink" in the code.
848 (get_debug_link_info): Prevent aborts by replacing call to
849 xmalloc with a call to malloc.
850 (find_separate_debug_file): Prevent aborts by replacing calls
851 to xmalloc and xstrdup with calls to malloc and strdup.
852 (bfd_add_gnu_debuglink): New function. Add a .gnu_debuglink
854 * bfd-in2.h: Regenerate.
858 * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]):
859 New target (was i[3-7]86-*-openbsd* before).
860 (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec.
861 (vax-*-openbsd*): New target.
865 * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options
867 (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too.
868 (mips_elf_rel_dyn_section): Use appropriate section alignment.
869 (mips_elf_create_got_section): Likewise.
870 (_bfd_mips_elf_create_dynamic_sections): Likewise.
874 * elf32-mips.c (mips_elf_generic_reloc): New Function.
875 (elf_mips_howto_table_rel): Use it.
876 (gprel32_with_gp): Move prototype.
877 (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend.
878 Use mips_elf_generic_reloc.
879 (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend.
881 (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of
883 (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic
884 as in the other *_gprel*_reloc functions.
885 (gprel32_with_gp): Handle partial_inplace properly.
886 (mips32_64bit_reloc): Use mips_elf_generic_reloc.
887 (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend.
888 Do addend handling directly instead of calling
889 _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly.
890 * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead
891 of zero addend. Handle partial_inplace properly.
892 (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero
894 (mips_elf64_gprel16_reloc): Likewise.
895 (mips_elf64_literal_reloc): Likewise.
896 (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment
897 logic as in the other *_gprel*_reloc functions. Handle
898 partial_inplace properly.
899 (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero
900 addend. Handle partial_inplace properly.
901 (mips16_gprel_reloc): Likewise. Do addend handling directly instead
902 of calling _bfd_mips_elf_gprel16_with_gp.
903 * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL.
904 (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead
906 (mips_elf_shift6_reloc): Handle partial_inplace properly.
907 (mips16_gprel_reloc): Likewise. Do addend handling directly instead
908 of calling _bfd_mips_elf_gprel16_with_gp.
909 * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle
910 partial_inplace properly. Fix wrong addend handling. Fix overflow
912 (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and
914 (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend.
915 (_bfd_mips_elf_relocate_section): Likewise.
916 (mips_elf_create_dynamic_relocation): Update sec_info_type access.
917 * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration.
918 (_bfd_mips_elf_sign_extend): New prototype.
922 * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]):
923 New target (was sparc-*-openbsd* before).
924 (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec.
926 * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo.
927 * configure: Regenerate.
931 * po/Make-in (DESTDIR): New.
932 (install-data-yes): Support $(DESTDIR).
933 (uninstall): Likewise.
937 * Makefile.am (config.status): Depend on version.h.
939 * Makefile.in: Regenerate.
940 * po/SRC-POTFILES.in: Regenerate.
945 * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq.
949 * archures.c (bfd_mach_h8300sxn): New architecture.
950 * bfd-in2.h: Regenerate.
951 * cpu-h8300.c (h8300_scan): Check for 'sxn'.
952 (h8300sxn_info_struct): New.
953 (h8300sx_info_struct): Link to it.
954 * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case.
955 (elf32_h8_final_write_processing): Likewise.
959 * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by
960 elfxx-target.h so that we can use elf_backend_got_header_size.
961 (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete.
962 (GLINK_CALL_STUB_SIZE): Modify. Define new glink call stub and
964 (ppc64_elf_howto_raw <GOT_TPREL16_DS, GOT_TPREL16_LO_DS>): Correct
966 (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and
967 ppc_stub_plt_branch_r2off.
968 (struct ppc_stub_hash_entry): Reorganize.
969 (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed,
970 toc_curr, toc_off and emit_stub_syms.
971 (ppc64_elf_link_hash_table_create): Init them.
972 (ppc_stub_name): Correct string size.
973 (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs.
974 (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries
976 (ppc_type_of_stub): Tweak root.type test.
977 (build_plt_stub): Remove glink code. Adjust for insn macro changes.
978 (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and
979 ppc_stub_plt_branch_r2off.
980 (ppc_build_one_stub): Likewise. Fix var shadowing. Correct addis,addi
981 range test. Use toc_off to calculte r2 values. Handle emit_stub_syms.
982 (ppc64_elf_setup_section_lists): Remove htab creator flavour test.
983 Initialize elf_gp and toc_curr.
984 (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions.
985 (ppc64_elf_next_input_section): Set toc_off.
986 (group_sections): Ensure groups have the same TOC.
987 (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub.
988 (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab.
989 Build new glink stub.
990 (ppc64_elf_relocate_section): Handle multiple TOCs. Fix comments.
991 (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK.
992 * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype.
993 (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare.
994 * section.c (struct sec): Rename flag12 to has_gp_reloc.
995 (STD_SECTION): Update.
996 * ecoff.c (bfd_debug_section): Update comment.
997 * bfd-in2.h: Regenerate.
1001 * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference
1002 NULL function pointers.
1006 * simple.c (bfd_simple_get_relocated_section_contents): Call
1007 _bfd_generic_link_add_symbols instead of bfd_link_add_symbols.
1011 * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and
1012 ticoff1_bad_format_hook() functions. Removed the coff0 and coff1
1014 * coff-tic4x.c: Ditto
1015 * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC
1016 and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro
1017 CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(),
1018 ticoff1_bad_format_hook() functions. Created the coff0 and coff1
1020 * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros.
1021 * coff-a29k.c: Append COFF_SWAP_TABLE argument
1022 * coff-apollo.c: Ditto
1024 * coff-h8300.c: Ditto
1025 * coff-h8500.c: Ditto
1026 * coff-i960.c: Ditto
1027 * coff-m68k.c: Ditto
1028 * coff-m88k.c: Ditto
1029 * coff-mcore.c: Ditto
1031 * coff-sparc.c: Ditto
1032 * coff-tic80.c: Ditto
1033 * coff-we32k.c: Ditto
1039 * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed
1044 * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK.
1045 (bfd_section_from_phdr): Likewise.
1046 (map_sections_to_segments): Create PT_GNU_STACK segment header.
1047 (get_program_header_size): Count with PT_GNU_STACK.
1048 * elf-bfd.h (struct elf_obj_tdata): Add stack_flags.
1049 * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags.
1053 * elflink.h (elf_link_input_bfd): Call linker error_handler
1054 for discarded definitions.
1058 * syms.c (decode_section_type): Return 'n' if section flags are
1059 SEC_HAS_CONTENTS && SEC_READONLY.
1063 * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to
1064 R_V850_ABS32. Add entry for R_V850_REL32.
1065 (v850_elf_reloc_map): Likewise.
1066 (v850_elf_check_relocs): Likewise.
1067 (v850_elf_perform_relocation): Likewise.
1068 (v850_elf_final_link_relocate): Likewise. Include computation
1069 to make R_V850_REl32 pc-relative.
1073 * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section
1074 and DT_DEBUG dynamic tag even for position independent executables.
1075 * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
1079 * config.bfd: Move obsolete entries out of the range of the
1080 targmatch sed script.
1084 * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete.
1088 * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192
1089 plt entries, not just 8191.
1093 * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index.
1099 * elflink.h (elf_link_add_object_symbols): Use !info->executable
1100 instead of info->shared where appropriate.
1101 (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise.
1102 * elflink.c (_bfd_elf_create_got_section): Likewise.
1103 (_bfd_elf_link_create_dynamic_sections): Likewise.
1104 (_bfd_elf_link_assign_sym_version): Likewise.
1105 * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section
1106 and DT_DEBUG dynamic tag even for position independent executables.
1107 * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
1108 * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise.
1109 * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise.
1110 * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise.
1111 * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise.
1112 * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise.
1113 * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise.
1114 * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise.
1115 * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise.
1119 * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
1121 (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
1125 * pef.c: Include "safe-ctype.h" instead of <ctype.h>.
1127 * Makefile.am: Add dependency on safe-ctype.h.
1128 * Makefile.in: Regenerate.
1132 * elfxx-mips.c: Don't force symbols local unconditionally.
1136 * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus
1137 undefined_symbol call.
1141 * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
1142 (mips_elf_link_hash_table): Likewise.
1146 * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
1147 R_MIPS_GNU_REL16_S2 support.
1148 (bfd_elf64_bfd_reloc_type_lookup): Use it.
1149 (mips_elf64_rtype_to_howto): Use it.
1150 * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
1151 R_MIPS_GNU_REL16_S2 support.
1152 (bfd_elf32_bfd_reloc_type_lookup): Use it.
1153 (mips_elf_n32_rtype_to_howto): Use it.
1157 * som.h: Define PA_2_0 before including a.out.h
1162 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
1163 pic tests, change to warning.
1164 (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
1168 * config.bfd: Check for a target triplet of shl-...-netbsdelf as
1169 well as shle-...-netbsdelf. Remove duplicate entry.
1173 * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask
1174 for X_STORMY16_REL_12 reloc.
1176 * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check
1177 the type of the hash table in the bfd_link_info structure.
1178 (bfd_elf_get_runpath_list): Likewise.
1182 * elf.c (bfd_elf_bfd_from_remote_memory): New function.
1183 * bfd-in.h: Declare it.
1184 * bfd-in2.h: Regenerated.
1185 * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function.
1186 * elf-bfd.h (struct elf_backend_data): New function pointer member
1187 elf_backend_bfd_from_remote_memory.
1188 (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory):
1190 * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro.
1191 (elfNN_bed): Add that to the initializer.
1195 * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section.
1199 * elflink.h (elf_link_output_extsym): Only issue error about !=
1200 STV_DEFAULT symbols if they are bfd_link_hash_undefined.
1204 * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF
1205 when removing the old definition for symbols with non-default
1210 * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation.
1214 * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in
1215 elf_section_data during processing of pc-relative and absolute
1217 (elf_m68k_relocate_section): Use the cached reloc section instead
1218 of computing it again. Fix handling of visibility. Don't modify
1219 addend when copying over a relocation into the output.
1223 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
1224 to trim plt entries. Move undefweak non-default visibility test..
1225 (allocate_dynrelocs): ..from here.
1226 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test
1227 dynamic_sections_created here. Update comment. Move undefweak
1228 non-default visibility test..
1229 (allocate_dynrelocs): ..from here. Fix comment.
1230 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL
1231 to trim plt entries. Move undefweak non-default visibility test..
1232 (allocate_dynrelocs): ..from here. Fix comment.
1233 * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with
1234 STV_DEFAULT rather than comparing with zero.
1235 * elflink.c (_bfd_elf_merge_symbol): Likewise.
1236 (_bfd_elf_fix_symbol_flags): Likewise. Format comment.
1240 * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null
1242 (_bfd_set_gp_value): Likewise.
1246 * archures.c (bfd_mach_h8300sx): New.
1247 * bfd-in2.h: Regenerate.
1248 * cpu-h8300.c (h8300_scan)): Add support for h8300sx.
1249 (h8300sx_info_struct): New.
1250 (h8300s_info_struct): Link to it.
1251 * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
1252 (elf32_h8_final_write_processing): Likewise.
1253 (elf32_h8_relax_section): Likewise.
1257 * config.bfd: Accept i[3-7]86 variants.
1258 * configure.host: Likewise.
1259 * configure.in: Likewise.
1260 * configure: Regenerate.
1264 * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
1269 * elflink.h (elf_link_check_versioned_symbol): Also allow
1275 * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
1276 (elf_i386_relocate_section): Likewise.
1277 * elf32-ppc.c (allocate_dynrelocs): Likewise.
1278 (ppc_elf_relocate_section): Likewise.
1279 * elf64-ppc.c (allocate_dynrelocs): Likewise.
1280 (ppc64_elf_relocate_section): Likewise.
1284 * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case.
1288 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for
1289 processor capability, allow merge of HC12 and HCS12 in some cases.
1290 (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc.
1291 * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct.
1292 (bfd_m68hc12_arch): Link it.
1293 (scan_mach): New function.
1297 * elf.c (bfd_elf_hash): Mask lower 32 bits of hash.
1302 * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from
1303 elf32-ppc.c. Add ELF_LINK_FORCED_LOCAL check.
1304 * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete.
1305 (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check.
1306 (ppc_elf_relocate_section): Likewise.
1307 * elf64-ppc.c (allocate_dynrelocs): Likewise.
1308 (ppc64_elf_relocate_section): Likewise. Use for .got relocs too.
1309 (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt
1310 relocs need no other types.
1311 * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for
1313 (elf_i386_relocate_section): Likewise. Use for .got relocs too.
1314 (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for
1319 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,
1320 copy ELF_LINK_NON_GOT_REF from weakdef.
1321 (allocate_dynrelocs): For undef weak syms with non-default
1322 visibility, a) don't allocate plt entries, b) don't allocate
1323 .got relocs, c) discard dyn rel space
1324 (sh_elf_relocate_section): d) don't generate .got relocs, e)
1325 don't generate dynamic relocs.
1326 (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF
1327 for weakdefs when symbol already adjusted.
1331 * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield'
1332 overflow detection for R_XSTORMY16_16 reloc.
1336 * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc.
1340 * elf32-i860.c (elf32_i860_relocate_highadj): Properly
1342 (elf32_i860_relocate_splitn): Obtain upper 5 bits from the
1344 (elf32_i860_relocate_pc16): Obtain upper 5 bits from the
1349 * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly
1350 complicated tests for unresolvable relocs with a simple direct
1351 scheme using "unresolved_reloc" var. Report some detail on
1352 bfd_reloc_outofrange and similar errors.
1356 * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section):
1357 Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call.
1358 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
1359 * elf64-s390.c: Likewise.
1363 * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one.
1364 (elf_s390_adjust_dynamic_symbol): For weak symbols, copy
1365 ELF_LINK_NON_GOT_REF from weakdef.
1366 (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has
1367 already been adjusted before treating it specially.
1368 * el64-s390.c: Likwise.
1372 * elf32-s390.c (allocate_dynrelocs): For undef weak syms with
1373 non-default visibility, a) don't make them dynamic, b) discard
1374 space for dynamic relocs.
1375 (elf_s390_relocate_section): Initialize the GOT entries and skip
1376 R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined
1377 symbols with non-default visibility.
1378 * elf64-s390.c: Likewise.
1382 * cpu-arm.c (arm_check_note): Warning fix.
1383 * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes. Arrange
1384 to keep relocs if edited.
1385 (iq2000_elf_print_private_bfd_data): Return TRUE.
1386 * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not
1388 (elfNN_ia64_relax_ldxmov): Warning fix.
1389 * xtensa-isa.c (xtensa_add_isa): Warning fix.
1390 * xtensa-modules.c (get_num_opcodes): Warning fix.
1394 * elf.c (elf_fake_sections): Use correct cast for sh_name.
1398 * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from
1399 elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align.
1400 (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align.
1401 (bfd_elf_record_link_assignment): Move from elflink.h.
1402 (_bfd_elf_merge_symbol): Likewise.
1403 (_bfd_elf_add_default_symbol): Likewise.
1404 (_bfd_elf_export_symbol): Likewise.
1405 (_bfd_elf_link_find_version_dependencies): Likewise.
1406 (_bfd_elf_link_assign_sym_version): Likewise.
1407 (_bfd_elf_link_read_relocs): Likewise.
1408 (_bfd_elf_link_size_reloc_section): Likewise.
1409 (_bfd_elf_fix_symbol_flags): Likewise.
1410 (_bfd_elf_adjust_dynamic_symbol): Likewise.
1411 (_bfd_elf_link_sec_merge_syms): Likewise.
1412 (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel
1413 and bed->s->sizeof_rela.
1414 (_bfd_elf_link_output_relocs): Likewise.
1415 * elf-bfd.h (struct elf_size_info): Rename file_align to
1417 (struct elf_info_failed): Move from elflink.h.
1418 (struct elf_assign_sym_version_info): Likewise.
1419 (struct elf_find_verdep_info): Likewise.
1420 (_bfd_elf_create_dynamic_sections): Delete duplicate declaration.
1421 (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol,
1422 _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies,
1423 _bfd_elf_link_assign_sym_version,
1424 _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs,
1425 _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs,
1426 _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
1427 _bfd_elf_link_sec_merge_syms): Declare.
1428 (bfd_elf32_link_create_dynamic_sections): Don't declare.
1429 (_bfd_elf32_link_read_relocs): Likewise.
1430 (bfd_elf64_link_create_dynamic_sections): Likewise.
1431 (_bfd_elf64_link_read_relocs): Likewise.
1432 * elflink.h: Move lots o' stuff elsewhere.
1433 * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare.
1434 (bfd_elf64_record_link_assignment): Likewise.
1435 (bfd_elf_record_link_assignment): Declare.
1436 * bfd-in2.h: Regenerate.
1437 * elfcode.h (elf_link_create_dynamic_sections): Don't declare.
1438 (NAME(_bfd_elf,size_info)): Adjust for log_file_align.
1439 * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align.
1440 (assign_file_positions_for_segments): Likewise.
1441 (assign_file_positions_except_relocs): Likewise.
1442 (swap_out_syms, elfcore_write_note): Likewise.
1443 * elf-m10200.c: Adjust for changed function names.
1444 * elf-m10300.c: Likewise.
1445 * elf32-arm.h: Likewise.
1446 * elf32-h8300.c: Likewise.
1447 * elf32-hppa.c: Likewise.
1448 * elf32-ip2k.c: Likewise.
1449 * elf32-m32r.c: Likewise.
1450 * elf32-m68hc11.c: Likewise.
1451 * elf32-m68hc1x.c: Likewise.
1452 * elf32-m68k.c: Likewise.
1453 * elf32-mips.c: Likewise.
1454 * elf32-ppc.c: Likewise.
1455 * elf32-sh.c: Likewise.
1456 * elf32-v850.c: Likewise.
1457 * elf32-xtensa.c: Likewise.
1458 * elf64-alpha.c: Likewise.
1459 * elf64-hppa.c: Likewise.
1460 * elf64-mmix.c: Likewise.
1461 * elf64-ppc.c: Likewise.
1462 * elf64-sh64.c: Likewise.
1463 * elfxx-ia64.c: Likewise.
1464 * elfxx-mips.c: Likewise.
1465 (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align.
1466 * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align.
1467 * elf64-hppa.c (hppa64_elf_size_info): Likewise.
1468 * elf64-mips.c (mips_elf64_size_info): Likewise.
1469 * elf64-s390.c (s390_elf64_size_info): Likewise.
1470 * elf64-sparc.c (sparc64_elf_size_info): Likewise.
1474 * elflink.h (elf_add_default_symbol): After skipping the
1475 unversioned symbol, go to non-default one.
1479 * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
1481 (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
1482 for symbols with non-default visibility.
1486 * elflink.h (elf_link_check_versioned_symbol): Also handle the
1487 case that a DSO references a hidden symbol which may be
1488 satisfied by a versioned symbol in another DSO.
1489 (elf_link_output_extsym): Check versioned definition for hidden
1490 symbol referenced by a DSO.
1494 * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset
1495 R_XSTORMY16_16 reloc to ignore overflows.
1499 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve
1500 error message for mixing different-endian files. Check for ABI
1501 compatibility of input files with the selected emulation.
1505 * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
1506 non-default visibility, a) don't make them dynamic, b) discard
1507 space for dynamic relocs.
1508 * elf64-x86-64.c (allocate_dynrelocs): Likewise.
1510 * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
1511 non-default visibility, a) don't allocate plt entries, b) don't
1512 allocate .got relocs, c) discard dyn rel space,
1513 (ppc_elf_relocate_section): d) don't generate .got relocs, e)
1514 don't generate dynamic relocs.
1515 * elf64-ppc.c (allocate_dynrelocs): As above.
1516 (ppc64_elf_relocate_section): As above.
1520 * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
1521 relocation entries for weak undefined symbols with non-default
1523 (elf64_x86_64_relocate_section): Initialize the GOT entries and
1524 skip R_386_32/R_386_PC32 for weak undefined symbols with
1525 non-default visibility.
1529 * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
1530 relocation entries for weak undefined symbols with non-default
1532 (elf_i386_relocate_section): Initialize the GOT entries and
1533 skip R_386_32/R_386_PC32 for weak undefined symbols with
1534 non-default visibility.
1536 * elfxx-ia64.c (allocate_fptr): Don't allocate function
1537 descriptors for weak undefined symbols with non-default
1539 (allocate_dynrel_entries): Don't allocate relocation entries
1540 for symbols resolved to 0.
1541 (set_got_entry): Don't install dynamic relocation for weak
1542 undefined symbols with non-default visibility.
1543 (set_pltoff_entry): Likewise.
1545 * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
1546 with non-default visibility.
1547 (elf_link_output_extsym): Don't make weak undefined symbols
1548 with non-default visibility dynamic.
1552 * elflink.h (elf_merge_symbol): Correctly handle weak definiton.
1556 * elflink.h (elf_merge_symbol): Don't record a hidden/internal
1557 symbol dynamic. Check indirection when removing the old
1558 definition for symbols with non-default visibility.
1559 (elf_add_default_symbol): Skip when told by elf_merge_symbol.
1563 * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the
1564 R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
1569 * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
1570 ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
1571 (ELIMINATE_COPY_RELOCS): Define as one. Use throughout.
1572 (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
1573 ELF_LINK_NON_GOT_REF from weakdef.
1578 * acinclude.m4: Fix name of --enable-install-libbfd switch.
1579 * aclocal.m4: Regenerate.
1580 * configure: Regenerate.
1581 * Makefile.in: Regenerate.
1585 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
1586 weakdef sym has already been adjusted before treating it specially.
1587 * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
1588 ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
1589 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
1590 (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
1594 * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
1595 the relax finalize pass.
1597 * section.c (struct sec): Add need_finalize_relax and remove
1599 (STD_SECTION): Update struct sec initializer.
1600 * bfd-in2.h: Regenerated.
1604 * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
1605 to copy any information related to dynamic linking when we flip
1610 * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
1611 (ELF_LINK_DYNAMIC_WEAK): New.
1613 * elflink.h (elf_merge_symbol): Add one argument to indicate if
1614 a symbol should be skipped. Ignore definitions in dynamic
1615 objects for symbols with non-default visibility.
1616 (elf_add_default_symbol): Adjusted.
1617 (elf_link_add_object_symbols): Check if a symbol should be
1618 skipped. Don't merge the visibility field with the one from
1620 (elf_link_check_versioned_symbol): Use undef_bfd.
1621 (elf_link_output_extsym): Warn if a forced local symbol is
1622 referenced from dynamic objects. Make non-weak undefined symbol
1623 with non-default visibility a fatal error.
1627 * configure.in: Bump version on HEAD to 2.14.90.
1628 * configure: Regenerated.
1633 * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
1634 when we couldn't relax something.
1638 * elflink.h (elf_merge_symbol): When we find a regular definition
1639 for an indirect symbol, flip the indirection so that the old
1640 direct symbol now points to the new definition.
1644 * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
1648 * elf32-ppc.c: Formatting and comment fixes.
1649 (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
1650 (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
1654 * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
1655 * bfd-in2.h: Rebuilt.
1656 * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
1657 * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC
1659 (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
1660 * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
1661 (h8300sn_info_struct, h8300hn_info_struct): New.
1662 * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
1663 (elf32_h8_final_write_processing): Likewise.
1667 * elf32-sh.c (tpoff): New.
1668 (struct elf_sh_dyn_relocs): Remove tls_tpoff32.
1669 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
1670 (allocate_dynrelocs): Don't make unnecessary dynamic TLS
1671 relocations. Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
1672 (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
1673 (dtpoff_base): Fix wrong indentation.
1674 (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
1675 relocations. Don't set tls_tpoff32 flag. Don't make unnecessary
1676 R_SH_TLS_TPOFF32 relocations.
1680 * archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
1681 * cpu-sh.c: Likewise.
1682 * elf32-sh.c: Likewise.
1683 * reloc.c (bfd_reloc_code_real): Likewise.
1684 * elf32-sh64-com.c: Change comment to refer to SuperH.
1685 * elf32-sh64.c: Likewise.
1686 * elf64-sh64.c: Likewise.
1687 * bfd-in2.h (enum bfd_architecture): Regenerate.
1692 * elf32-i386.c (elf_i386_info_to_howto): Delete.
1693 (elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
1697 * archures.c: Replace references to Mitsubishi M32R with references
1699 * relocs.c: Likewise.
1700 * bfd-in2.h: Regenerate.
1704 * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
1705 executable when a symbol is defined both regular and dynamic.
1709 * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
1710 (elf32-m68hc1x.lo): Update dependencies
1711 * configure.in: Add elf32-m68hc1x.lo.
1712 * configure: Rebuild.
1713 * Makefile.in: Rebuild.
1717 * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
1718 (m68hc11_elf_hash_table_create): New function.
1719 (elf32_m68hc11_link_hash_table_free): New function.
1720 (stub_hash_newfunc): New function.
1721 (m68hc11_add_stub): New function.
1722 (elf32_m68hc11_add_symbol_hook): New function.
1723 (elf32_m68hc11_setup_section_lists): New function.
1724 (elf32_m68hc11_next_input_section): New function.
1725 (elf32_m68hc11_size_stubs): New function.
1726 (elf32_m68hc11_build_stubs): New function.
1727 (m68hc11_get_relocation_value): New function.
1728 (elf32_m68hc11_relocate_section): Call the above to redirect
1729 some relocations to the trampoline code.
1730 (m68hc11_elf_export_one_stub): New function.
1731 (m68hc11_elf_set_symbol): New function.
1732 (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
1733 (m68hc11_elf_get_bank_parameters): Get parameters only when the info
1734 is not yet initialized.
1736 * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
1737 (elf32_m68hc11_stub_hash_entry): New struct.
1738 (m68hc11_page_info): Add trampoline handler address.
1739 (m68hc11_elf_link_hash_table): Add stubs generation members.
1740 (elf32_m68hc11_add_symbol_hook): Declare.
1741 (elf32_m68hc11_setup_section_lists): Declare.
1742 (elf32_m68hc11_size_stubs): Declare.
1743 (elf32_m68hc11_build_stubs): Declare.
1745 * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
1746 (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
1747 (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
1748 (_bfd_m68hc11_elf_set_private_flags): Ditto.
1749 (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
1750 (_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
1751 (bfd_elf32_bfd_link_hash_table_create): Define.
1752 (elf_backend_add_symbol_hook): Define.
1753 (m68hc11_elf_bfd_link_hash_table_create): New function.
1754 (m68hc11_elf_build_one_stub): New function.
1755 (m68hc11_elf_size_one_stub): New function.
1756 (m68hc11_elf_bfd_link_hash_table_create): Install the above.
1757 (bfd_elf32_bfd_link_hash_table_create): Define.
1759 * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
1760 (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
1761 (m68hc12_phys_addr): Ditto.
1762 (m68hc12_phys_page): Ditto.
1763 (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
1764 (elf32_m68hc11_gc_mark_hook): Likewise.
1765 (elf32_m68hc11_gc_sweep_hook): Likewise.
1766 (elf32_m68hc11_check_relocs): Likewise.
1767 (elf32_m68hc11_relocate_section): Likewise.
1768 (_bfd_m68hc12_elf_set_private_flags): Likewise.
1769 (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
1770 (_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
1771 (m68hc12_elf_build_one_stub): New function.
1772 (m68hc12_elf_size_one_stub): New function.
1773 (m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
1774 (elf_backend_add_symbol_hook): Define.
1775 (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
1779 * format.c (bfd_check_format_matches): Only check associated
1780 vector if the matching_vector has been created.
1784 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in
1785 2003-04-09's change.
1789 * peicode.h (coff_swap_scnhdr_in): If a section holds
1790 uninitialized data and is from an object file or from an
1791 executable image that has not initialized the s_size field, or if
1792 the physical size is padded, use the virtual size (stored in
1797 * elflink.h (elf_link_add_object_symbols): Properly report
1798 filename for alignment reduction.
1802 * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'.
1803 * reloc.c: Likewise.
1804 * coff-h8300.c: Likewise.
1805 * coff-h8500.c: Likewise.
1806 * coff-sh.c: Likewise.
1807 * cpu-h8300.c: Likewise.
1808 * cpu-sh.c: Likewise.
1809 * elf32-h8300.c: Likewise.
1810 * elf32-sh.c: Likewise.
1811 * elf32-sh64-com.c: Likewise.
1812 * elf32-sh64.c: Likewise.
1813 * elf64-sh64.c: Likewise.
1814 * bfd-in2.h: Regenerate.
1818 * elflink.h (elf_link_add_object_symbols): Maintain maximum
1819 alignment for common symbols. Warn reducing alignment for
1820 common symbols. Report old filename when symbol size changes.
1824 * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
1825 occurrences of the same test changed in the previous patch.
1830 * elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
1831 (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
1832 GOT_DISP/addend only if the symbol got a global GOT entry.
1836 * elfxx-mips.c (mips_elf_calculate_relocation): Decay
1837 GOT_PAGE/GOT_OFST referencing overridable symbol to
1839 (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
1840 global symbol as GOT_DISP.
1844 * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
1845 next relocation on an undefined symbol.
1849 * elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
1850 Ignore relocations against r_symndx == 0.
1854 * elf64-alpha.c (elf64_alpha_relocate_section): Don't return
1855 FALSE for undefined symbols.
1856 * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
1860 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
1861 and IRIX-specific shift-to-64-bit 4-byte lengths before following
1866 * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
1867 pointer size from ABI, not arch_bits_per_address.
1871 * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
1872 constants for n32 ABI.
1876 * simple.c (bfd_simple_get_relocated_section_contents): Disable
1877 free that leads to GDB vs BFD memory corruption.
1881 * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
1882 symbols that mark the end of the section.
1883 (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
1884 converting to a relative branch so that the offset is computed after
1885 the relaxation; also relocate a jsr into a bsr if possible but don't
1886 relax them if they are to a far symbol as we need to call the
1888 (elf_m68hc11_howto_table): Set pcrel_offset to true.
1892 * archures.c: Namespace cleanup. Rename bfd_mach_c3x to
1893 bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x
1894 * bfd-in2.h: Regenerate
1895 * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/
1896 * cpu-tic4x.c: Ditto
1900 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
1901 differently for object files and executables.
1902 * peicode.h (coff_swap_scnhdr_in): Only set the s_size field
1903 for object files or for executables who have not already
1904 initialised the field.
1905 * libpei.h (bfd_pe_executable_p): New macro. Return true if
1906 the PE format bfd is an executable.
1910 * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
1911 here as it's too early to reliably determine locality.
1912 (ppc_elf_gc_sweep_hook): Likewise.
1913 (SYMBOL_REFERENCES_LOCAL): Expand comment.
1917 * xtensa-modules.c: Remove comment indicating that this is a
1922 * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
1926 * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
1927 (ALL_MACHINES_CFILES): Add cpu-xtensa.c.
1928 (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and
1930 (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and
1932 (cpu-xtensa.lo): New target.
1933 (elf32-xtensa.lo): Likewise.
1934 (xtensa-isa.lo): Likewise.
1935 (xtensa-modules.lo): Likewise.
1936 * Makefile.in: Regenerate.
1937 * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa.
1938 (bfd_archures_list): Add bfd_xtensa_arch.
1939 * config.bfd: Handle xtensa-*-*.
1940 * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec.
1941 * configure: Regenerate.
1942 * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE,
1943 PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}.
1944 * targets.c (bfd_elf32_xtensa_be_vec): Declare.
1945 (bfd_elf32_xtensa_le_vec): Likewise.
1946 (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec.
1947 * cpu-xtensa.c: New file.
1948 * elf32-xtensa.c: Likewise.
1949 * xtensa-isa.c: Likewise.
1950 * xtensa-modules.c: Likewise.
1951 * libbfd.h: Regenerate.
1952 * bfd-in2.h: Likewise.
1956 * archures.c (bfd_mach_arm_unknown): Define.
1957 * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes,
1958 bfd_arm_get_mach_from_notes): Prototype.
1959 * bfd-in2.h: Regenerate.
1960 * coff-arm.c (coff_arm_merge_private_bfd_data): Call
1961 bfd_arm_merge_machines.
1962 (coff_arm_final_link_postscript): Call bfd_arm_update_notes.
1963 * coffcode.h (coff_set_arch_mach_hook): Call
1964 bfd_arm_get_mach_from_notes.
1965 * coffgen.c (coff_real_object_p): Revert previous delta.
1966 * cpu_arm.c (arm_check_note): New function. Examine a note in a
1968 (bfd_arm_merge_machines): New function: Handle the merging of ARM
1969 binaries compiled for different architectures..
1970 (bfd_arm_update_notes): New function: Update an ARM note section.
1971 (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine
1972 number from an ARM note section.
1973 * elf32-arm.h (elf32_arm_object_p): Use
1974 bfd_arm_get_mach_from_notes.
1975 (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines.
1976 (elf32_arm_final_write_processing): Use bfd_arm_update_notes.
1980 * dwarf2.c (read_attribute_value): Correct typo in comment.
1984 * dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
1985 instead of concat().
1986 (decode_line_info): Only free filename if it is not NULL.
1987 (add_line_info): Make a copy of the filename when storing it into
1993 * simple.c (bfd_simple_get_relocated_section_contents): Add
1994 parameter symbol_table. Optionally use it instead of the symbol
1995 table from the bfd. Save and restore output offsets and output
1996 sections around bfd_get_relocated_section_contents. Fix a memory
1998 (simple_save_output_info, simple_restore_output_info): New
2000 * bfd-in2.h: Regenerate.
2001 * dwarf2.c (read_abbrevs): Use
2002 bfd_simple_get_relocated_section_contents instead of
2003 bfd_get_section_contents.
2004 (decode_line_info): Likewise.
2005 (_bfd_dwarf2_find_nearest_line): Likewise. Don't call
2007 (find_rela_addend): Remove.
2008 * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
2010 (elfNN_ia64_hash_table_create): Create the hash table with malloc,
2015 * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of
2017 * dwarf2.c (concat_filename): Always allocate space for the
2019 (decode_line_info): Free the allocated filename returned by
2021 * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks.
2022 * elf.c (copy_private_bfd_data): Likewise.
2023 (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer.
2024 * elflink.h (elf_link_sort_relocs): Fix memory leak.
2025 * format.c (bfd_check_format_matches): Likewise.
2026 * linker.c (bfd_generic_final_link): Likewise.
2027 * opncls.c (find_separate_debug_info): Likewise.
2028 * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
2032 * elflink.h (elf_link_add_object_symbols): Correctly combine
2037 * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
2038 to -1 before recomputing got offsets.
2042 * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
2043 (elf_m68k_relocate_section): Use it to correctly handle symbols
2045 (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
2046 entries for symbols that are forced to be local.
2050 * elfxx-mips.c (_bfd_mips_relax_section): New function.
2051 * elfxx-mips.h (_bfd_mips_relax_section): Declare.
2052 * elfn32-mips.c, elf64-mips.c: Use it.
2057 Contribute support for Intel's iWMMXt chip - an ARM variant:
2059 * archures.c: Add bfd_mach_arm_iWMMXt.
2060 * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2.
2061 * bfd-in2.h: Regenerate.
2062 * libbfd.h: Regenerate.
2063 * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt
2064 object files to be linked with XScale ones.
2065 (coff_arm_final_link_postscript): Update note section.
2066 * coffcode.h (coff_set_arch_mach_hook): Handle note section.
2067 * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook
2068 after identifying a coff binary.
2069 * cpu-arm.c (processors): Add iWMMXt.
2070 (arch_inf): Likewise.
2071 * elf32-arm.h (arm_object_p): Handle note section.
2072 (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to
2073 be linked with XScale ones.
2074 (elf32_arm_section_flags): New function: Set flags on note section.
2075 (elf32_arm_final_write_processing): Handle note section.
2079 * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
2080 _bfd_elf_rela_local_sym.
2084 * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
2089 * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and
2090 $idata5 in case bfd_coff_final_link is not called.
2094 * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
2096 (canon_reloc_count): Define.
2097 (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
2098 sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
2100 (sparc64_elf_canonicalize_reloc): New routine.
2101 (bfd_elf64_canonicalize_reloc): Define.
2105 * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
2106 againt mergeable sections. Take r_addend into account when caching
2111 * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
2112 local symbols that have no dyninfo.
2116 * ieee.c (ieee_write_expression): Handle the case where symbol is
2118 General formatting improvements.
2122 * configure.in (LINGUAS): Add zh_CN.
2123 * configure: Regenerate.
2124 * po/zh_CN.po: New file.
2128 * aout-cris.c (BYTES_IN_WORD): Don't define.
2129 aout-encap.c: Likewise.
2130 aout-ns32k.c: Likewise.
2131 aout-tic30.c: Likewise.
2132 hp300bsd.c: Likewise.
2133 i386aout.c: Likewise.
2134 i386dynix.c: Likewise.
2135 i386linux.c: Likewise.
2136 i386lynx.c: Likewise.
2137 i386mach3.c: Likewise.
2138 m68k4knetbsd.c: Likewise.
2139 m68klinux.c: Likewise.
2140 m68klynx.c: Likewise.
2141 m68knetbsd.c: Likewise.
2142 m88kmach3.c: Likewise.
2143 mipsbsd.c: Likewise.
2144 newsos3.c: Likewise.
2145 sparclinux.c: Likewise.
2146 sparclynx.c: Likewise.
2147 sparcnetbsd.c: Likewise.
2148 vaxbsd.c: Likewise. Fix comment formatting.
2152 * Reverted 2003-03-02's patch.
2154 * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
2156 * elf64-mips.c (mips_elf64_canonicalize_reloc,
2157 mips_elf64_get_dynamic_reloc_upper_bound,
2158 mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
2159 (bfd_elf64_get_canonicalize_reloc,
2160 bfd_elf64_get_dynamic_reloc_upper_bound,
2161 bfd_elf64_canonicalize_dynamic_reloc): Define.
2162 (mips_elf64_slurp_reloc_table): Support dynamic.
2163 (mips_elf64_slurp_one_reloc_table): Adjust.
2167 * xsym.c (bfd_sym_fetch_type_information_table_entry): Change
2168 'index' to 'offset' in test for zero value.
2172 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
2173 dynamic relocations pointing to local or section symbols, use the
2174 NULL symbol instead. Document the choice to not emit an
2175 additional R_MIPS_64 relocation.
2179 * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
2180 zero index dynamic tls relocs generated for the GOT. Tidy code.
2181 Set "relocation" to 1 on DTPMOD32 relocs. Optimize HA adjustment.
2182 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2186 * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
2187 a tls_get_addr call.
2189 * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
2190 (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
2191 ELF_LINK_NON_GOT_REF from weakdef.
2192 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
2193 (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
2194 ELF_LINK_NON_GOT_REF from weakdef.
2195 * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one. Use throughout.
2196 (elf_i386_adjust_dynamic_symbol): For weak symbols, copy
2197 ELF_LINK_NON_GOT_REF from weakdef.
2202 * elflink.h (elf_bfd_discard_info): Don't process eh frames if
2203 output is relocateable.
2207 * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and
2212 * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
2214 (ELIMINATE_COPY_RELOCS): Define to zero.
2215 (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
2216 TLSLD relocs. Report reloc types on a number of errors. Optimize
2217 LOCAL24PC check for non-local syms. Don't capitalize error messages.
2218 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
2219 (ppc64_elf_relocate_section): Don't deref htab->tls_sec when
2220 calculating TLSLD relocs. Report reloc types on a number of errors.
2221 Don't capitalize error messages.
2225 * elfxx-ia64.c (USE_BRL): Removed.
2230 * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
2231 relocation (no special function), and make it non-partial_inplace.
2232 (sh_elf_relax_section): When creating a bsr, use a consistent value
2233 no matter if the symbol is extern or not; set addend to -4.
2234 Don't swap load / non-load instructions for SH4.
2235 (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
2236 rather than if the symbol is external to determine if adjusting the
2237 offset makes sense. Adjust the addend too if appropriate.
2238 (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
2243 * po/da.po: Installed latest translation.
2247 * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
2248 R_MIPS_PC16 to rightshift 2.
2249 (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
2250 (bfd_elf32_bfd_reloc_type_lookup): Support
2251 BFD_RELOC_MIPSEMB_16_PCREL_S2.
2252 * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
2253 R_MIPS_PC16 to rightshift 2.
2254 (mips_elf64_howto_table_rela): Likewise.
2255 (mips_reloc_map): Map to rightshifted BFD reloc.
2256 * elfn32-mips.c: The same as in elf64-mips.c.
2257 * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
2258 (mips_elf_calculate_relocation): Handle rightshifted addends for
2260 * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
2261 MIPS Embedded PIC. Remove superfluous empty COMMENT.
2262 * libbfd.h: Regenerate.
2263 * bfd-in2.h: Regenerate.
2267 * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
2268 for ltoff22x relaxation.
2272 * bfd-in.h (_bfd): Don't define.
2273 * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
2275 * bfd-in2.h: Regenerate.
2279 * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
2280 (elfNN_ia64_check_relocs): Set it.
2281 (allocate_global_data_got): Check it.
2282 (allocate_local_got): Likewise.
2283 (allocate_dynrel_entries): Likewise.
2284 (elfNN_ia64_relax_ldxmov): New.
2285 (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
2286 (elfNN_ia64_choose_gp): Split out from ...
2287 (elfNN_ia64_final_link): ... here.
2291 * bfd.c (struct bfd): Rename "struct _bfd".
2292 * bfd-in.h: Update copyright.
2293 (struct bfd): Rename "struct _bfd".
2294 (_bfd): Define for backward compatibility.
2295 * bfd-in2.h: Regenerate.
2299 * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
2300 and rel_hdr2 when initially counting input relocs rather than after
2301 creating output reloc sections.
2302 (elf_link_read_relocs_from_section): Don't abort with wrong reloc
2305 * Makefile.am: Run "make dep-am".
2306 * Makefile.in: Regenerate.
2310 * elf.c (elfcore_read_notes): Add check for QNX style core file.
2311 (elfcore_grog_nto_note): New function.
2312 (elfcore_grog_nto_gregs): New function.
2313 (elfcore_grog_nto_status): New function.
2317 * elflink.c (_bfd_elf_create_got_section): Check existing .got
2318 section flags before concluding that we've already been called.
2319 Don't use register keyword.
2320 (_bfd_elf_create_dynamic_sections): Don't use register keyword.
2321 (_bfd_elf_create_linker_section): Formatting.
2325 * coff-h8300.c: Fix typo: intial -> initial.
2326 * coff-ppc.c: Likewise.
2330 * elf32-ppc.c: Formatting.
2331 (allocate_dynrelocs): LD and GD relocs against the same sym need
2332 separate GOT entries.
2333 (ppc_elf_relocate_section): Correct GOT handling for multiple GOT
2338 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
2339 removal. Localize vars. Remove unnecessary dynobj test.
2340 * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
2342 (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
2344 (elf_i386_relocate_section): Likewise.
2345 (elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars.
2346 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
2347 * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
2348 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
2349 * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
2350 * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove
2351 local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32
2352 or PCPLT10 relocs. Don't subtract twice on PLT32 relocs.
2355 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
2356 (ppc64_elf_check_relocs): Use it. Correct comment. Move SEC_ALLOC
2358 (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
2359 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2360 (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
2361 and optimize. Use ELIMINATE_COPY_RELOCS.
2362 (ppc64_elf_relocate_section): Likewise.
2364 * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
2365 (ppc_elf_copy_indirect_symbol): Copy pc_count field.
2366 (ELIMINATE_COPY_RELOCS): Define.
2367 (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
2368 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
2369 (MUST_BE_DYN_RELOC): Define.
2370 (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
2371 and optimize. Trim dyn_relocs.
2372 (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
2373 not be used. Do generate dyn_relocs for copy reloc avoidance. Keep
2374 track of pc_rel dyn relocs.
2375 (ppc_elf_relocate_section): Remove "will_become_local". Adjust
2376 WILL_CALL_FINISH_DYNAMIC_SYMBOL use. Trim dyn relocs as per
2377 allocate_dynrelocs. Don't recalculate "sec".
2381 * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
2382 * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
2383 on invalid LD relocs.
2384 (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
2385 (ppc64_elf_relocate_section): Unify new handling of LD relocs and
2386 tlsld_got entry. Use IS_PPC64_TLS_RELOC.
2388 * elf32-ppc.h: New file.
2389 * elf32-ppc.c: Include elf32-ppc.h.
2390 (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
2391 (struct ppc_elf_link_hash_entry): Rename "root" to "elf". Adjust uses.
2392 Add "tls_mask" field.
2393 (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
2394 (struct ppc_elf_link_hash_table): Rename "root" to "elf". Adjust uses.
2395 Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
2396 sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
2397 Make use of htab shortcuts throughout file.
2398 (ppc_elf_link_hash_newfunc): Init tls_mask field.
2399 (ppc_elf_link_hash_table_create): Init new fields.
2400 (ppc_elf_copy_indirect_symbol): Copy tls_mask.
2401 (ppc_elf_howto_raw): Add tls relocs.
2402 (ppc_elf_reloc_type_lookup): Handle them.
2403 (ppc_elf_unhandled_reloc): New function.
2404 (ppc_elf_create_got): Stash got section pointer in hash table,
2405 return status. Make .rela.got too.
2406 (ppc_elf_create_dynamic_sections): Stash section pointers in htab.
2407 (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
2408 NON_GOT_REF set. Don't allocate space in .plt here..
2409 (allocate_dynrelocs): ..do so here instead, properly ref-counting and
2410 not allocating plt entries unnecessarily. Allocate got entries here.
2411 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
2412 (ppc_elf_size_dynamic_sections): Allocate local got entries. Pass
2413 "info" during allocate_dynrelocs hash traversal. Use htab section
2414 shortcuts rather than searching for named sections. Get rid of
2415 "plt" and "strip" booleans.
2416 (update_local_sym_info, bad_shared_reloc): New functions.
2417 (ppc_elf_check_relocs): Handle TLS relocs. Move .rela.got creation to
2418 ppc_elf_create_got. Don't mark got or plt reloc syms dynamic, do so
2419 in allocate_dynreloc. Use update_local_sym_info and bad_shared_reloc.
2420 Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
2421 R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
2422 in shared libs. R_PPC_PLTREL32 is a plt reloc too. Refcount all
2423 relocs that might use a plt entry. Set NON_GOT_REF too.
2424 Enumerate all do-nothing relocs.
2425 (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs. Handle
2426 tls relocs and all plt relocs.
2427 (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
2428 (ppc_elf_finish_dynamic_symbol): Don't build got entries here.
2429 (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
2431 (ppc_elf_relocate_section): Tidy. Handle TLS relocs. Use
2432 bfd_elf_local_sym_name. Simplify unresolved reloc code. Build got
2433 entries and got relocs here. Warn on non-zero got reloc addend.
2434 Split out branch taken/not taken reloc code into a separate switch
2435 and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
2436 Split out HA reloc adjustments to separate switch statement. Don't
2437 warn on reloc overflow if we've already warned about undefined.
2438 Don't rebuild sym name when reporting errors. Report all possible
2439 errors from _bfd_final_link_relocate.
2440 (bfd_elf32_bfd_final_link): Don't define.
2444 * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r". Don't
2445 rebuild sym name when reporting errors.
2449 * elflink.h (elf_link_output_extsym): Only check
2450 allow_shlib_undefined for shared libraries.
2451 * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
2452 of allow_shlib_undefined.
2453 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2454 * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
2455 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2456 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2457 * elf32-s390.c (elf_s390_relocate_section): Likewise.
2458 * elf32-sh.c (sh_elf_relocate_section): Likewise.
2459 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2460 * elf32-vax.c (elf_vax_relocate_section): Likewise.
2461 * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
2462 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2463 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2464 * elf64-s390.c (elf_s390_relocate_section): Likewise.
2465 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2466 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
2467 * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
2468 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
2472 * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
2473 address field to use in the comparison.
2474 (SEGMENT_OVERLAPS): Check that LMAs overlap as well.
2478 * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF
2479 backends when checking if the generic ELF target should be used.
2481 * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs
2482 outside of functions, treat values as absolute addresses.
2484 * bfd.c: Change embedded documentation to use consistent indentation
2485 and to split up long lines. Change informal style of description
2486 for functions lacking real documentation.
2487 * coffcode.h: Break up long lines in embedded documentation.
2488 * format.c: Likewise.
2489 * targets.c: Likewise.
2490 * libcoff.h: Regenerate.
2491 * bfd-in2.h: Regenerate.
2495 * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
2496 (ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
2497 (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
2498 (allocate_dynrelocs): Don't treat undefined and undefweak specially.
2499 (ppc_size_one_stub): Fix warning, and tighten plt entry check.
2500 (group_sections): Don't share a stub section if stubs are for a large
2501 section. Adjust comment.
2502 (ppc64_elf_size_stubs): Roughly double the size left for stubs if
2503 !stubs_always_before_branch.
2504 (ppc64_elf_relocate_section): Initialize tlsld GOT entry once. Don't
2505 treat undefined and undefweak specially when processing dyn relocs.
2509 * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
2513 * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs
2514 in computation of offset to insert into BL instruction.
2518 * config.bfd: Add support for kaOS as cross build target system.
2522 * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
2523 .__tls_get_addr too.
2524 (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
2528 * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
2529 (elf_sh_link_hash_entry): Remove tls_tpoff32 field.
2530 (sh_elf_link_hash_newfunc): Remove the initialization of
2532 (allocate_dynrelocs): Keep dyn_relocs if it includes the entry
2533 for which tls_tpoff32 flag is set.
2534 (sh_elf_relocate_section): Covert to LE only if the dyn_relocs
2535 of the symbol includes the entry matched with the input_section
2536 and having tls_tpoff32 flag on. When linking statically, set
2537 symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
2538 is defined in this executable.
2539 (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
2543 * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
2544 even if there is just non-empty .rela.plt.
2548 * archures.c (bfd_mach_arm_ep9312): Define.
2549 * bfd-in2.h: Regenerate.
2550 * cpu-arm.c (processors[]): Add ep9312.
2551 (bfd_arm_arch): Add ep9312.
2552 * elf32-arm.h (elf32_arm_merge_private_data): Update error
2553 messages and add test for Maverick floating point support.
2554 (elf32_arm_print_private_bfd_data): Handle
2555 EF_ARM_MAVERICK_FLOAT flag.
2556 (elf32_arm_object_p): New function.
2557 (elf_backend_object_p): Define.
2561 * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
2562 variables, structure fields or function params to tls_mask or
2563 similar to better reflect usage.
2564 (struct got_entry): Comment.
2565 (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*.
2566 (get_tls_mask): Rename from get_tls_type.
2570 * elf64-ppc.c (TLS_GD_LD): Don't define..
2571 (TLS_GD): ..define this instead and update all uses.
2572 (TLS_TPRELGD): Define.
2573 (ppc64_elf_link_hash_table_create): Tweak initialization of
2574 init_refcount and init_offset.
2575 (ppc64_elf_check_relocs): Add one extra element to t_symndx array.
2576 Mark second slot of GD or LD toc entries.
2577 (get_tls_type): Return an int. Distinguish toc GD and LD entries
2578 from other tls types.
2579 (ppc64_elf_tls_setup): New function, split out from..
2580 (ppc64_elf_tls_optimize): ..here. Don't optimize when symbols are
2581 defined in a dynamic object. Fix LD optimization. Don't set TLS_TPREL
2582 on GD->IE optimization, use TLS_TPRELGD instead. Use get_tls_type
2583 return value to properly decide whether toc GD and LD entries can
2584 optimize away __tls_get_addr call. Check next reloc after DTPMOD64
2585 to determine GD or LD rather than looking at TLS_LD flag. Don't
2586 attempt to adjust got entry tls_type here..
2587 (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
2588 look for possible merges.
2589 (ppc64_elf_size_dynamic_sections): Adjust local got entries for
2591 (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
2592 (ppc64_elf_relocate_section): Rename some vars to better reflect usage.
2593 Make use of return value from get_tls_type to properly detect GD and
2594 LD optimizations. Split tlsld/gd hi/ha from lo/ds case. Don't
2595 handle tls_get_addr removal when looking at REL24 relocs, do it when
2596 looking at the previous reloc. Check reloc after DTPMOD64 to determine
2598 * elf64-ppc.h (ppc64_elf_tls_setup): Declare.
2602 * elf32-hppa.c (group_sections): Don't share a stub section if
2603 stubs are for a large section.
2605 * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
2606 stubs if !stubs_always_before_branch.
2610 * elf.c (swap_out_syms): Generate an error message if an
2611 equivalent output section cannot be found for a symbol.
2615 * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
2616 local_got_entries is NULL.
2620 * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
2621 (read_value): Add parameter is_signed, use signed extraction if
2622 the value is signed.
2623 (_bfd_elf_write_section_eh_frame): Pass signed flag of the
2624 encoding to read_value.
2628 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
2629 plt info when called to transfer weak sym info.
2633 * reloc.c: Add PPC and PPC64 TLS relocs.
2634 * libbfd.h: Regenerate.
2635 * bfd-in2.h: Regenerate.
2636 * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare.
2637 (ppc64_elf_howto_raw): Add TLS howto's. Adjust R_PPC64_NONE to be
2638 against a 32 bit field.
2639 (ppc64_elf_reloc_type_lookup): Handle TLS relocs.
2640 (_ppc64_elf_section_data): Add t_symndx and comments.
2641 (ppc64_elf_section_data): Use elf_section_data macro.
2642 (ppc64_elf_new_section_hook): American spelling.
2643 (struct got_entry, struct plt_entry): New.
2644 (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC.
2645 (struct ppc_stub_hash_entry): Add "addend" field.
2646 (struct ppc_link_hash_entry): Add "tls_type".
2647 (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL,
2648 TLS_EXPLICIT): Define.
2649 (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
2650 (link_hash_newfunc): Init new fields.
2651 (ppc64_elf_link_hash_table_create): Likewise. Set init_refcount and
2652 init_offset to NULL.
2653 (ppc64_elf_copy_indirect_symbol): Copy got and plt info. Don't call
2654 _bfd_elf_link_hash_copy_indirect, rather insert relevant code from
2656 (update_local_sym_info, update_plt_info): New functions.
2657 (ppc64_elf_check_relocs): Use them. Handle TLS relocs. Adjust GOT
2658 handling to use got.glist rather than got.refcount. Likewise for PLT.
2659 (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists.
2660 (func_desc_adjust): Adjust for new PLT list.
2661 (ppc64_elf_adjust_dynamic_symbol): Likewise.
2662 (get_sym_h, get_tls_type): New functions.
2663 (ppc64_elf_edit_opd): Remove unused variable. Use get_sym_h.
2664 (ppc64_elf_tls_optimize): New function.
2665 (allocate_dynrelocs): Adjust for new PLT and GOT lists. Allocate
2667 (ppc64_elf_size_dynamic_sections): Likewise.
2668 (ppc_type_of_stub): Adjust for new PLT list.
2669 (ppc_build_one_stub): Likewise.
2670 (ppc64_elf_size_stubs): Likewise. Use get_sym_h. Treat __tls_get_addr
2672 (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists. Handle
2673 TLS relocs. Report local syms using bfd_elf_local_sym_name. Don't
2674 init GOT entries that have a reloc. Generate GOT relocs here..
2675 (ppc64_elf_finish_dynamic_symbol): ..not here. Adjust for PLT list.
2676 * elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
2680 * elf32-m68k.c (elf_m68k_hash_entry): Define.
2681 (elf_m68k_link_hash_traverse): Remove.
2682 (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and
2683 elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to
2685 (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of
2687 (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse
2688 instead of elf_m68k_link_hash_traverse.
2689 (elf_m68k_discard_copies): Change first parameter to pointer to
2690 struct elf_link_hash_entry and use elf_m68k_hash_entry when struct
2691 elf_m68k_link_hash_entry is needed.
2695 * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare.
2696 (struct elf_link_hash_entry): Add "glist" and "plist" fields to
2697 "got" union, and declare as gotplt_union. Use gotplt_uinion for
2699 (struct elf_link_hash_table): Make "init_refcount" a gotplt_union.
2700 Add "init_offset" field.
2701 (struct elf_obj_tdata <local_got>): Add "struct got_entry **" to union.
2702 (elf_local_got_ents): Declare.
2703 * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got"
2705 (_bfd_elf_link_hash_hide_symbol): Use "init_offset".
2706 (_bfd_elf_link_hash_table_init): Set "init_offset".
2707 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount
2709 (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset.
2711 * elf.c (bfd_elf_local_sym_name): Split out from..
2712 (group_signature): ..here.
2713 * elf-bfd.h (bfd_elf_local_sym_name): Declare.
2717 * elf-bfd.h (enum elf_link_info_type): Remove.
2718 (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields
2719 to struct sec. Remove linkonce_p field.
2720 (elf_linkonce_p): Delete.
2721 (elf_discarded_section): Update for sec_info_type change.
2722 * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc,
2723 flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24.
2724 (ELF_INFO_TYPE_NONE): Define.
2725 (ELF_INFO_TYPE_STABS): Define.
2726 (ELF_INFO_TYPE_MERGE): Define.
2727 (ELF_INFO_TYPE_EH_FRAME): Define.
2728 (ELF_INFO_TYPE_JUST_SYMS): Define.
2729 (STD_SECTION): Update struct sec initializer.
2730 * ecoff.c (bfd_debug_section): Likewise.
2731 * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p.
2732 * elflink.h: Likewise.
2733 * elf-eh-frame.c: Likewise.
2734 * elf64-alpha.c: Likewise.
2735 * elfxx-ia64.c: Likewise.
2736 * elfxx-mips.c: Likewise.
2737 * bfd-in2.h: Regenerate.
2739 * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than
2740 referring to used_by_bfd.
2741 * elf64-sparc.c (sec_do_relax): Likewise.
2742 * elf64-mmix.c (mmix_elf_section_data): Likewise.
2743 * elfxx-mips.c (mips_elf_section_data): Likewise.
2744 * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro.
2745 (ieee_get_section_contents): Likewise.
2746 (ieee_new_section_hook): Formatting.
2747 (ieee_canonicalize_reloc): Remove commented out code.
2748 * mmo.c (mmo_section_data): Define. Use throughout file.
2749 * oasys.c (oasys_get_section_contents): Use oasys_per_section macro.
2753 * Makefile.am (opncls.lo): Add dependency upon libiberty.h.
2754 * Makefile.in: Regenerate.
2755 * opncls.c (calc_crc32, get_debug_link_info,
2756 seperate_debug_file_exists, find_seperate_debug_file): New
2758 (bfd_follow_gnu_debuglink): New function. Follow the pointer
2759 contained inside a .gnu_debuglink section.
2760 * bfd-in2.h: Regenerate.
2764 * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference
2765 entry->abfd when it's NULL.
2769 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle
2770 _bfd_elf_section_offset returning -2 the same way as -1.
2772 * elfxx-mips.c (mips_elf_multi_got): New function.
2773 (struct mips_got_entry): Make symndx and gotidx signed. Moved
2774 addend into union along with address and link hash entry.
2775 (struct mips_got_info): Added bfd2got and next.
2776 (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx.
2777 (mips_elf_got_section, mips_elf_create_got_section): Use
2778 SEC_EXCLUDE bit to tell whether we really need the got
2779 section. Take boolean arguments to disregard an excluded
2780 section, or to create it as excluded. Adjust all callers.
2781 Use mips_elf_got_section all over.
2782 (mips_elf_local_got_index, mips_elf_got_page,
2783 mips_elf_got16_entry): Take input bfd as argument, and pass it
2784 on to mips_elf_create_local_got_entry.
2785 (mips_elf_global_got_index, mips_elf_create_local_got_entry):
2786 Take input bfd as argument, and manage entries in the
2788 (mips_elf_got_offset_from_index): Take input bfd as argument,
2789 and use it to adjust the GP offset of the bfd.
2790 (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move
2791 unreferenced GOT entries of global symbols to the end.
2792 (mips_elf_record_global_got_symbol): Take input bfd as
2793 argument. Add entries to the master GOT hash table.
2794 (struct mips_elf_bfd2got_hash): New.
2795 (struct mips_elf_got_per_bfd_arg): New.
2796 (struct mips_elf_set_global_got_offset_arg): New.
2797 (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash,
2798 mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash,
2799 mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd,
2800 mips_elf_merge_gots, mips_elf_set_global_got_offset,
2801 mips_elf_resolve_final_got_entry,
2802 mips_elf_resolve_final_got_entries, mips_elf_adjust_gp,
2803 mips_elf_got_for_ibfd): New functions.
2804 (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT.
2805 (MIPS_ELF_GOT_MAX_SIZE): New macro.
2806 (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT.
2807 (mips_elf_got_entry_hash): Take new fields into account. Use
2808 mips_elf_hash_bfd_vma.
2809 (mips_elf_got_entry_eq): Take new fields into account.
2810 (mips_elf_create_got_section): Initialize new fields.
2811 (mips_elf_calculate_relocation): Pass input_bfd to functions
2812 that now take it. Adjust gp for the input_bfd.
2813 (mips_elf_allocate_dynamic_relocation,
2814 mips_elf_create_dynamic_relocation,
2815 _bfd_mips_elf_create_dynamic_sections): Use...
2816 (mips_elf_rel_dyn_section): New function. Borrow code from...
2817 (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that
2818 now take it. Create the got section if needed, even if
2819 excluded, before recording a global got symbol. Move some
2821 (mips_elf_record_local_got_symbol): New fn.
2822 (_bfd_mips_elf_size_dynamic_sections): Disable combreloc.
2823 Compute multi-got global entries offsets. Move GOT code to...
2824 (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got
2825 if the GOT is too big.
2826 (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of
2827 undefweak symbol to zero. Generate dynamic relocations for
2828 non-primary GOT entries for global symbols.
2829 (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got
2830 case. Generate dynamic relocations for local got entries.
2831 Sort dynamic relocations on N64 too, using...
2832 (sort_dynamic_relocs_64): New fns.
2833 (_bfd_mips_elf_hide_symbol): Adjust multi-got counters.
2834 (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT.
2838 * bfd.c (struct _bfd): Added id field.
2839 * opncls.c (_bfd_id_counter): New static variable.
2840 (_bfd_new_bfd): Use it.
2841 * bfd-in2.h: Rebuilt.
2845 * elf32-sparc.c (bfd_elf32_new_section_hook): Define.
2849 * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs.
2850 (elf32_sparc_rev32_howto): New variable.
2851 (sparc_reloc_map): Add TLS relocs.
2852 (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto):
2854 (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject):
2856 (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry,
2857 struct elf32_sparc_link_hash_table):
2859 (elf32_sparc_tdata, elf32_sparc_local_got_tls_type,
2860 elf32_sparc_hash_table): Define.
2861 (link_hash_newfunc, elf32_sparc_link_hash_table_create,
2862 create_got_section, elf32_sparc_create_dynamic_sections,
2863 elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New
2865 (elf32_sparc_check_relocs): Handle TLS relocs. Add dynamic reloc
2867 (elf32_sparc_gc_sweep_hook): Likewise.
2868 (elf32_sparc_adjust_dynamic_symbol): Likewise.
2869 (elf32_sparc_size_dynamic_sections): Likewise.
2870 (elf32_sparc_relocate_section): Likewise.
2871 (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff):
2873 (elf32_sparc_object_p): Allocate backend private object data.
2874 (bfd_elf32_bfd_link_hash_table_create,
2875 elf_backend_copy_indirect_symbol, bfd_elf32_mkobject,
2876 elf_backend_can_refcount): Define.
2877 (elf_backend_create_dynamic_sections): Define to
2878 elf32_sparc_create_dynamic_sections.
2879 * reloc.c: Add SPARC TLS relocs.
2880 * bfd-in2.h, libbfd.h: Rebuilt.
2881 * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs.
2882 (sparc_reloc_map): Likewise.
2886 * bfd-in2.h: Regenerate.
2887 * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition,
2888 s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions.
2889 (elf_howto_table): Add TLS relocs.
2890 (elf_s390_reloc_type_lookup): Likewise.
2891 (elf_s390_link_hash_entry): Add tls_type.
2892 (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type):
2894 (elf_s390_link_hash_table): Add tls_ldm_got.
2895 (link_hash_newfunc): Initialize tls_type.
2896 (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got.
2897 (elf_s390_copy_indirect_symbol): Copy tls_type information.
2898 (elf_s390_check_relocs): Support TLS relocs.
2899 (elf_s390_gc_sweep_hook): Likewise.
2900 (allocate_dynrelocs): Likewise.
2901 (elf_s390_size_dynamic_sections): Likewise.
2902 (elf_s390_relocate_section): Likewise.
2903 (elf_s390_finish_dynamic_symbol): Likewise.
2904 (bfd_elf32_mkobject): Define for TLS.
2905 * elf64-s390.c: Same changes as for elf32-s390.c.
2906 * libbfd.h: Regenerate.
2907 * reloc.c: Add s390 TLS relocations.
2911 * aclocal.m4: Fix name of --enable-install-libbfd switch.
2917 * archures.c (bfd_mach_sh2e): Added.
2918 * bfd-in2.h: Rebuilt.
2919 * cpu-sh.c (arch_info_struct): Added SH2e.
2920 * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E.
2924 * elf-bfd.h (struct bfd_elf_section_data): Remove tdata. Change
2925 dynindx to an int. Rearrange for better packing.
2926 * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
2927 * elf32-mips.c (bfd_elf32_new_section_hook): Define.
2928 * elf32-sh64.h: New. Split out from include/elf/sh.h.
2929 (struct _sh64_elf_section_data): New struct.
2930 (sh64_elf_section_data): Don't dereference sh64_info (was tdata).
2931 * elf32-sh64-com.c: Include elf32-sh64.h.
2932 * elf32-sh64.c: Likewise.
2933 (sh64_elf_new_section_hook): New function.
2934 (bfd_elf32_new_section_hook): Define.
2935 (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
2936 (sh64_bfd_elf_copy_private_section_data): Likewise.
2937 (sh64_elf_final_write_processing): Likewise.
2938 * elf32-sparc.c (struct elf32_sparc_section_data): New.
2939 (elf32_sparc_new_section_hook): New function.
2940 (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
2941 (sec_do_relax): Define.
2942 (elf32_sparc_relax_section): Adjust to use sec_do_relax.
2943 (elf32_sparc_relocate_section): Likewise.
2944 * elf64-mips.c (bfd_elf64_new_section_hook): Define.
2945 * elf64-mmix.c (struct _mmix_elf_section_data): New.
2946 (mmix_elf_section_data): Define. Use throughout file.
2947 (mmix_elf_new_section_hook): New function.
2948 (bfd_elf64_new_section_hook): Define.
2949 * elf64-ppc.c (struct _ppc64_elf_section_data): New.
2950 (ppc64_elf_section_data): Define. Use throughout.
2951 (ppc64_elf_new_section_hook): New function.
2952 (bfd_elf64_new_section_hook): Define.
2953 * elf64-sparc.c (struct sparc64_elf_section_data): New.
2954 (sparc64_elf_new_section_hook): New function.
2955 (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
2956 (sec_do_relax): Define.
2957 (sparc64_elf_relax_section): Adjust to use sec_do_relax.
2958 (sparc64_elf_relocate_section): Likewise.
2959 (bfd_elf64_new_section_hook): Define.
2960 * elfn32-mips.c (bfd_elf32_new_section_hook): Define.
2961 * elfxx-mips.c (struct _mips_elf_section_data): New.
2962 (mips_elf_section_data): Define. Use throughout.
2963 (_bfd_mips_elf_new_section_hook): New function.
2964 (mips_elf_create_got_section): Don't alloc used_by_bfd.
2965 * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
2966 * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
2967 * Makefile.am: Run "make dep-am".
2968 * Makefile.in: Regenerate.
2972 * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
2973 (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value.
2974 (elf64_alpha_adjust_dynamic_symbol): Set them.
2975 (elf64_alpha_size_plt_section_1): Reset them when plt entry removed.
2976 (elf64_alpha_relax_tls_get_addr): Handle LDM relocs. Frob the
2977 symbol index when relaxing LDM to TPREL.
2978 (elf64_alpha_relax_section): Likewise. Allow relaxation of GD
2979 relocs, even if the target isn't locally defined.
2980 (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero.
2981 (elf64_alpha_relocate_section): Likewise. Force TP-relative
2982 relocs vs symndx 0 to the tp base.
2986 * config.bfd: Handle i[3456]86-*-aros*.
2990 * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define.
2991 (struct ppc_elf_link_hash_entry): Define.
2992 (ppc_elf_hash_entry): New function.
2993 (struct ppc_elf_link_hash_table): Define.
2994 (ppc_elf_hash_table): New function.
2995 (ppc_elf_link_hash_newfunc): New function.
2996 (ppc_elf_link_hash_table_create): New function.
2997 (ppc_elf_copy_indirect_symbol): New function.
2998 (allocate_dynrelocs): New function.
2999 (readonly_dynrelocs): New function.
3000 (ppc_elf_size_dynamic_sections): Allocate space for dynamic
3001 relocs and determine DT_TEXTREL.
3002 (ppc_elf_check_relocs): Don't do that here, just count the
3004 (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the
3006 (bfd_elf32_bfd_link_hash_table_create): Define.
3007 (elf_backend_copy_indirect_symbol): Define.
3011 * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
3012 TPREL also get a reloc if shared. Remove SREL support.
3013 (elf64_alpha_emit_dynrel): New.
3014 (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL
3015 and GOTTPREL relocs to local symbols against the tp base.
3016 (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.
3018 * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got
3019 use count before clobbering r_type.
3020 (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn
3021 ordering would mean dataflow inspection is necessary.
3025 * coffcode.h (coff_set_flags): Added get/set arch hooks.
3029 * elf32-sh.c: Treat elfNN_bed like other macros defined in
3030 elfxx-target.h and #undef it before #define'ing it.
3031 * elf32-i386.c: Likewise.
3032 * elf32-sh64.c: Likewise.
3033 * elf64-alpha.c: Likewise.
3034 * elf64-sh64.c: Likewise.
3038 * bfd-in2.h: Regenerate.
3039 * elf32-s390.c (elf_s390_adjust_gotplt): New prototype.
3040 (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add
3041 R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16,
3042 R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16,
3043 R_390_PLTOFF32 and R_390_PLTOFF64.
3044 (elf_s390_reloc_type_lookup): Likewise.
3045 (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track
3046 of GOTPLT references to a function.
3047 (link_hash_newfunc): Initialize gotplt_refcount.
3048 (elf_s390_check_relocs): Move allocation of local_got_refcounts array
3049 and creation of the got section out of the main switch. Add support
3050 for the gotoff, gotplt and pltoff relocations.
3051 (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt
3053 (elf_s390_adjust_gotplt): New function.
3054 (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed
3056 (allocate_dynrelocs): Add comment.
3057 (elf_s390_relocate_section): Change r_type to unsigned. Add support
3058 for gotoff, gotplt and pltoff relocations.
3059 * elf64-s390.c: Same changes as for elf32-s390.c.
3060 * libbfd.h: Regenerate.
3061 * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12,
3062 BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64,
3063 BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32
3064 and BFD_RELOC_390_PLTOFF64.
3068 * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
3069 R_IA64_TPREL64[LM]SB against non-global symbol properly.
3073 * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add
3074 self_dtpmod_done and self_dtpmod_offset.
3075 (allocate_global_data_got): Only use one got entry for all
3076 dtpmod relocs against local symbols.
3077 (allocate_dynrel_entries): Only need .rela.got entry for
3078 dtpmod against global symbol.
3079 (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset.
3080 Reserve space in .rela.got for the local dtpmod entry.
3081 (set_got_entry): Initialize the common local dtpmod .got entry.
3082 (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB
3083 and R_IA_64_DTPREL64MSB.
3087 * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
3088 (R_PPC_*): Rename all occurrences to R_PPC64_*.
3089 (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
3090 (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
3091 (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
3092 relative relocs, not with absolute ones.
3093 * Makefile.am: Run "make dep-am".
3094 * Makefile.in: Regenerate.
3095 * po/SRC-POTFILES.in: Regenerate.
3099 * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
3100 relocation against a non-allocated readonly section.
3104 * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
3105 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. PLTGOT16_HA too.
3109 * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
3110 (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
3111 * Makefile.in: Regenerate.
3115 * elfn32-mips.c (prev_reloc_section): New.
3116 (GET_RELOC_ADDEND): Use it. Parenthesize macro arguments.
3117 (SET_RELOC_ADDEND): Parenthesize macro argument.
3121 * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
3122 adjust addil instructions if the symbol has no section.
3126 * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
3131 * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for
3132 PC relative relocations.
3133 (elf_m68k_discard_copies): Set it here instead.
3138 * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo.
3139 (ALL_MACHINES_CFILES): Add cpu-iq2000.c.
3140 (BFD32_BACKENDS): Add elf32-iq2000.lo.
3141 (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c.
3142 (cpu-iq2000.lo): New target.
3143 * Makefile.in: Regenerate.
3144 * config.bfd: Handle iq2000-*-elf.
3145 * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000.
3146 (bfd_archures_list): Add bfd_iq2000_arch.
3147 * configure.in: Handle bfd_elf32_iq2000_vec.
3148 * configure: Regenerate.
3149 * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
3150 and BFD_RELOC_IQ2000_UHI16.
3151 * targets.c (bfd_elf32_iq2000_vec): Declare.
3152 (bfd_target_vector): Add bfd_elf32_iq2000_vec.
3153 * elf.c (prep_headers): Set e_machine to EM_IQ2000.
3154 * cpu-iq2000.c: New file.
3155 * elf32-iq2000.c: Likewise.
3156 * libbfd.h: Regenerate.
3157 * bfd-in2.h: Likewise.
3161 * elfxx-mips.c: Include libiberty.h.
3162 (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove.
3163 (mips_set_isa_flags): New function, split out from...
3164 (_bfd_mips_elf_final_write_processing): ...here. Only call
3165 mips_set_isa_flags if the EF_MIPS_MACH bits are clear.
3166 (mips_mach_extensions): New array.
3167 (mips_32bit_flags_p): New function.
3168 (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks.
3169 Use mips_32bit_flags_p to check if one binary is 32-bit and the
3170 other is 64-bit. When adopting IBFD's architecture, adopt the
3171 bfd_mach as well as the flags.
3175 * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to
3176 fix internal errors, fix bad code generation, fix incorrect stabs
3177 information, and improve ability to eliminate redundant page
3178 instructions. Added code to ip2k_final_link_relocate to self-verify
3179 the linker relaxation. Fix formatting problems.
3183 * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case.
3184 * archures.c (bfd_mach_mipsisa32r2): New define.
3185 * bfd-in2.h: Regenerate.
3186 * cpu-mips.c (I_mipsisa32r2): New enum value.
3187 (arch_info_struct): Add entry for I_mipsisa32r2.
3188 * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach)
3189 (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2.
3190 (_bfd_mips_elf_final_write_processing): Add
3191 bfd_mach_mipsisa32r2 case.
3192 (_bfd_mips_elf_merge_private_bfd_data): Handle merging of
3193 binaries marked as using MIPS32 Release 2.
3197 * Makefile.am: Add msp430 target.
3198 * configure.in: Likewise.
3199 * Makefile.in: Regenerate.
3200 * configure: Regenerate.
3201 * archures.c: Add msp430 architecture vector.
3202 * config.bfd: Likewise.
3203 * reloc.c: Add msp430 relocs.
3204 * targets.c: Add msp320 target.
3205 * cpu-msp430.c: New file: msp430 cpu detection.
3206 * elf32-msp430.c: New file: msp430 reloc processing.
3207 * bfd-in2.h: Regenerate.
3208 * libbfd.h: Regenerate.
3212 * elf.c (elf_sort_sections): Don't reorder .tbss.
3213 (assign_file_positions_for_segments): Only adjust off/voff
3214 for increased alignment in PT_LOAD or PT_NOTE segment,
3215 but adjust p_filesz for .tbss too. in PT_LOAD consider
3216 .tbss to have zero memory size.
3217 (copy_private_bfd_data) [SECTION_SIZE]: Define.
3218 [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
3219 [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
3220 into PT_TLS segment. Never put SHF_TLS sections in
3221 segments other than PT_TLS or PT_LOAD.
3223 * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt
3228 * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal.
3232 * elflink.h (elf_link_output_extsym): Heed strip_discarded.
3236 * archures.c (bfd_arch_get_compatible): Add third parameter
3237 'accept_unknowns'. Only accept unknown format BFDs if
3238 accept_unknowns is true, or if the format is "binary".
3239 * bfd-in2.h: Regenerate.
3243 * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround
3244 that subtracted 8 from pc relative relocations.
3248 * coff-h8300.c: Fix comment typos.
3249 * coffcode.h: Likewise.
3250 * cpu-cris.c: Likewise.
3251 * elf32-vax.c: Likewise.
3252 * genlink.h: Likewise.
3253 * linker.c: Likewise.
3255 * tekhex.c: Likewise.
3256 * vms-misc.c: Likewise.
3260 * reloc.c: Add BFD_RELOC_XSTORMY16_12.
3261 * libbfd.h: Regenerate.
3262 * bfd-in2.h: Regenerate.
3263 * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12.
3264 (xstormy16_reloc_map): Add R_XSTORMY16_12.
3268 * doc/bfdint.texi: Fix typos.
3272 Port to POSIX 1003.1-2001.
3273 * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o".
3274 * configure.in (build-warnings): Likewise.
3275 (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1".
3276 * aclocal.m4: Regenerate.
3277 * config.in: Regenerate.
3278 * configure: Regenerate.
3282 * coff-h8300.c: Include libiberty.h.
3283 (h8300_reloc16_extra_cases): Check the hash table creator before
3284 referencing h8300 specific fields. Stash the hash table pointer
3285 in a local var. Comment typo fixes.
3286 (h8300_bfd_link_add_symbols): Likewise.
3288 * reloc.c (struct reloc_howto_struct): Revise src_mask and
3290 * bfd-in2.h: Regenerate.
3294 * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc
3295 code a little. Comment on dynamic relocs against section symbols.
3299 * configure.host (ia64-*-hpux*): Support 64 bit targets using
3300 the HP compiler's "long long".
3304 * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16
3305 and R_XSTORMY16_HI16) howto entries.
3306 (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16.
3307 (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to
3308 determine the start of the second reloc table.
3312 * ecofflink.c: Fix the reading of the debugging information
3313 of Tru64/Alpha binaries that are produced by recent Compaq
3315 (mk_fdrtab): Fix error in creating the FDR (file descriptor)
3317 (lookup_line): Because of the strange information sometimes
3318 generated by Compaq's recent compilers, change how the FDR
3319 table is searched so that PDRs (procedure descriptors) are
3320 correctly found. Note that this change is really more of a hack;
3321 however, I have included extensive documentation as to why
3322 this is the best solution short of an extensive rewrite or
3324 (fdrtab_lookup): Add comments to explain the algorithm.
3328 * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder
3329 initializers to match struct declaration.
3333 * dwarf2.c (comp_unit_contains_address): Comment typo fix.
3334 * elf.c (get_program_header_size): Likewise.
3335 * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise.
3336 (m32r_elf_generic_reloc): Likewise.
3337 * elf32-ppc.c (ppc_elf_howto_init): Likewise.
3338 * elflink.h (elf_bfd_discard_info): Likewise.
3342 * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset
3343 to DT_JMPREL. Use srelplt input section size for DT_PLTRELSZ and
3344 DT_RELSZ adjustment, not output section. Avoid writing tags when
3345 unchanged. Don't assume linker script is sane, adjust DT_REL too.
3346 * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw
3347 size of srelplt for DT_PLTRELSZ. Use srelplt input section size for
3348 DT_RELASZ adjustment, not output section. Avoid writing tags when
3349 unchanged. Adjust DT_RELA.
3350 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better
3351 formatting. Avoid writing tags when unchanged. Adjust DT_RELA.
3355 * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide
3360 * elfxx-mips.c (struct mips_got_entry): New.
3361 (struct mips_got_info): Added got_entries field.
3362 (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions.
3363 (mips_elf_local_got_index, mips_elf_got_page,
3364 mips_elf_got16_entry): Re-implement in terms of new...
3365 (mips_elf_create_local_got_entry): Rewrite to use got_entries.
3367 (mips_elf_highest): Warning clean-up.
3368 (mips_elf_create_got_section): Initialize got_entries.
3369 (_bfd_mips_elf_check_relocs): Use got_entries to estimate
3371 (_bfd_mips_elf_size_dynamic_sections): Do not account for
3372 GOT_PAGE entries, since we now reuse GOT16 entries.
3376 * aoutx.h (set_section_contents): Allow an otherwise unrepresentable
3377 read-only section that lies after .text and before .data to be
3378 written into the output file and included in a_text.
3379 (translate_to_native_sym_flags): If an otherwise unrepresentable
3380 section was merged with .text, convert its symbols to N_TEXT
3382 * libaout.h (aout_section_merge_with_text_p): New macro.
3386 * bfd-in.h: Comment typo fix. Formatting.
3387 * bfd-in2.h: Regenerate.
3388 * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix.
3389 * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype.
3390 * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix.
3394 * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI.
3395 Only send PCREL21B though the plt. Fix installed reloc type.
3396 (elfNN_ia64_relocate_section): Give error for dynamic reloc
3397 against PCREL22 or PCREL64I; clean up error messages for
3402 * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo):
3404 (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
3408 * cpu-ia64-opc.c: Add operand constant "ar.csd".
3412 * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of
3413 BFD address when constructing local name.
3417 * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec
3419 (elf_m68k_link_hash_table_create): Initialize it.
3420 (elf_m68k_check_relocs): Handle symbols that are forced to be
3421 local due to visibility changes.
3422 (elf_m68k_adjust_dynamic_symbol): Likewise.
3423 (elf_m68k_size_dynamic_sections): Likewise.
3424 (elf_m68k_discard_copies): Likewise.
3425 (elf_m68k_relocate_section): Likewise.
3429 * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo.
3433 * srec.c (srec_write_symbols): Restore '$' prefix to address
3434 accidentally removed in 2002-04-04 change.
3435 (srec_get_symtab): Use 0 instead of `(long) FALSE'.
3439 * elf32-ppc.c (apuinfo_list_init): New function.
3440 (apuinfo_list_add): New function: Add a value to the list.
3441 (apuinfo_list_length): New function: Return the number of
3443 (apuinfo_list_element): New function: Return a value on the
3445 (apuinfo_list_finish): New function: Free the resources used
3447 (ppc_elf_begin_write_processing): New function. Scan the
3448 input bfds for apuinfo sections.
3449 (ppc_elf_write_section): New function: Delay the creation of
3450 the contents of an apuinfo section in an output bfd.
3451 (ppc_elf_final_write_processing): New function. Create the
3452 contents of an apuinfo section in an output bfd.
3453 (elf_backend_begin_write_processing): Define.
3454 (elf_backend_final_write_processing): Define.
3455 (elf_backend_write_section): Define.
3459 * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry.
3463 Fix PR savannah/1417:
3464 * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust
3465 branch if it goes to the start of the deleted region.
3469 * bfd-in2.h (bfd_mach_m6812): Rebuild.
3470 * archures.c (bfd_mach_m6812_default, bfd_mach_m6812,
3471 bfd_mach_m6812s): Declare.
3473 * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function.
3474 (_bfd_m68hc12_elf_set_private_flags): Call it.
3475 (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version.
3476 (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and
3477 report microcontroller incompatibilities (HC12 vs HCS12).
3478 (elf_backend_object_p): Update.
3482 * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
3483 (enum bfd_boolean, boolean): Delete.
3484 (bfd_boolean): Typedef to an int.
3485 (FALSE, TRUE): Define.
3486 * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
3487 aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
3488 aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
3489 binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
3490 coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
3491 coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
3492 coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
3493 coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
3494 coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
3495 coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
3496 corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
3497 cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
3498 cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
3499 cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
3500 cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
3501 cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
3502 cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
3503 cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
3504 cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
3505 cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
3506 dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
3507 elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
3508 elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
3509 elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
3510 elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
3511 elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
3512 elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
3513 elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
3514 elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
3515 elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
3516 elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
3517 elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
3518 elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
3519 elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
3520 elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
3521 elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
3522 hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
3523 i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
3524 libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
3525 libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
3526 m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
3527 mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
3528 nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
3529 pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
3530 pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
3531 pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
3532 reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
3533 som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
3534 syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
3535 vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
3536 xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
3537 bfd_boolean, true with TRUE, false with FALSE. Simplify comparisons
3538 of bfd_boolean vars with TRUE/FALSE. Formatting.
3539 * bfd-in2.h, libbfd.h, libcoff.h: Regenerate
3543 * elf-bfd.h: Replace occurrences of Elf32_Internal_* and
3544 Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel
3545 with Elf_Internal_Rela.
3546 * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
3547 elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
3548 elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
3549 elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
3550 elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
3551 elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
3552 elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
3553 elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
3554 elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
3555 elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
3556 elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
3557 * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr
3559 * elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
3560 * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
3561 Remove INLINE keyword.
3562 (elf_swap_reloc_in): Likewise. Also clear r_addend.
3563 (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
3565 (elf_write_relocs): Consolidate REL and RELA code.
3566 (elf_slurp_reloc_table_from_section): Simplify REL code.
3567 (NAME(_bfd_elf,size_info)): Populate reloc swap entries.
3568 * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
3569 * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
3571 (elf_link_adjust_relocs): Likewise. Don't malloc space for temp
3572 reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
3573 (elf_link_output_relocs): Likewise.
3574 (elf_reloc_link_order): Likewise.
3575 (elf_finish_pointer_linker_section): Likewise.
3576 (struct elf_link_sort_rela): Remove union.
3577 (elf_link_sort_cmp1): Update to suit.
3578 (elf_link_sort_cmp2): Here too.
3579 (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory
3580 over-allocation for int_rels_per_ext_rel != 1 case.
3581 * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
3582 * elf32-i386.c: Likewise.
3583 * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
3584 * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
3585 elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
3586 * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
3587 * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
3588 elf64-sparc.c, elf64-x86-64.c: Likewise.
3589 * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
3590 * elfxx-mips.c (sort_dynamic_relocs): Likewise for
3591 bfd_elf32_swap_reloc_in.
3593 * elf32-arm.h: Update elf32_arm_info_to_howto calls.
3594 * elf32-mips.c: Likewise for mips_info_to_howto_rel.
3595 (mips_elf64_swap_reloc_in): Zero r_addend.
3596 (mips_elf64_be_swap_reloc_in): Likewise.
3597 (mips_elf64_slurp_one_reloc_table): Simplify.
3599 * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
3600 * elf64-hppa.c (hppa64_elf_size_info): Likewise.
3601 * elf64-sparc.c (sparc64_elf_size_info): Likewise.
3605 * elf32-sh.c (sh_elf_relocate_section): Don't complain about
3606 unresolved debugging relocs in dynamic applications.
3607 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
3611 * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs.
3612 (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs
3613 on a relocatable link. Comment typos.
3614 * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure
3615 in the order they are declared. Clear elf_hash_value too.
3616 (_bfd_elf_link_hash_table_init): Likewise assign in order. Clear
3617 eh_info and tls_segment.
3618 * elflink.h (elf_link_input_bfd <emit_relocs>): Keep reloc offsets
3619 sorted when discarding relocs by turning them into R_*_NONE.
3621 * libbfd.c (warn_deprecated): Comment spelling.
3622 * po/SRC-POTFILES.in: Regenerate.
3626 * elflink.h (elf_link_add_object_symbols): Don't overwrite the
3627 arch's st_other bits when merging visibilities.
3628 (elf_link_output_extsym): Tidy clearing of visibility field.
3632 * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define.
3633 (SWAP_OUT_RELOC_OFFSET): Define.
3637 * elf.c (_bfd_elf_link_hash_table_init): Make sure
3638 can_refcount is properly extended to the type of
3643 * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro.
3644 (_bfd_mips_elf_relocate_section): Use it.
3646 * elfxx-mips.c (MNAME): New macro.
3647 (_bfd_mips_elf_check_relocs): Use it.
3648 (_bfd_mips_elf_discard_info): Likewise.
3649 (_bfd_mips_elf_final_link): Likewise.
3653 * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust
3654 rel_hdr.sh_size too.
3658 * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo.
3659 (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c.
3660 (BFD_H_FILES): Add bfdwin.c, bfdio.c.
3661 (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c.
3662 Add dependencies for bfdwin.c, bfdio.c.
3663 * bfd.c: Remove bfd_get_mtime, bfd_get_size.
3664 * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal,
3665 bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite,
3666 bfd_tell, bfd_flush, bfd_stat, bfd_seek.
3667 * bfdio.c: New file. Contains real_read, bfd_bread, bfd_write,
3668 bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime,
3669 bfd_get_size (moved from libbfd.c and bfd.c).
3670 * bfdwin.c New file. Contains _bfd_window_internal,
3671 bfd_init_window, bfd_free_window, bfd_get_file_window (moved from
3672 libbfd.c and bfd.c).
3673 * po/SRC-POTFILES.in: Regenerate.
3674 * po/bfd.pot: Regenerate.
3675 * libbfd.h: Regenerate.
3676 * bfd-in2.h: Regenerate.
3677 * aclocal.m4: Regenerate.
3678 * Makefile.in: Regenerate.
3679 * configure: Regenerate.
3683 * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY.
3687 * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away
3688 jsr after a short jump.
3689 * elf32-h8300.c (elf32_h8_relax_section): Likewise.
3693 * pef.c (bfd_pef_convert_architecture): Move declaration of
3694 ARCH_POWERPC and ARCH_M68K to the start of the function.
3698 * coff-tic4x.c (tic4x_howto_table): Formatting fixup
3702 * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs):
3703 For bpo_gregs_section->contents, allocate _raw_size, not
3708 * config.bfd: Add entries for powerpc-*-darwin and cousins.
3712 * elfcode.h (elf_object_p): Don't restore abfd->arch_info.
3717 * bfd.c (struct bfd_preserve): New.
3718 (bfd_preserve_save): New function.
3719 (bfd_preserve_restore): Ditto.
3720 (bfd_preserve_finish): Ditto.
3721 * bfd-in2.h: Regenerate.
3722 * mach-o.c: Formatting.
3723 (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned.
3724 (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish.
3725 (bfd_mach_o_core_p): Ditto.
3726 (bfd_mach_o_scan): Pass in mdata.
3727 * mach-o.h (bfd_mach_o_scan): Update prototype.
3728 * pef.c: Formatting.
3729 (bfd_pef_object_p): Use bfd_preserve_save/restore/finish.
3730 (bfd_pef_xlib_object_p): Ditto.
3731 (bfd_pef_scan): Pass in mdata. Move version check to bfd_pef_object_p.
3732 * pef.h (bfd_pef_scan): Update prototype.
3733 * xsym.c: Formatting, K&R fixes.
3734 (bfd_sym_object_p): Use bfd_preserve_save/restore/finish.
3735 (bfd_sym_scan): New function split out from bfd_sym_object_p.
3736 * xsym.h (bfd_sym_scan): Declare.
3737 * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish.
3738 * elfcore.h (elf_core_file_p): Likewise.
3739 * targets.c (_bfd_target_vector): Revert 2002-11-08 change.
3743 * po/da.po: Updated Danish translation.
3747 * elflink.h (elf_link_add_object_symbols): Optimize stabs for
3748 relocatable link too.
3749 (elf_link_input_bfd): When emitting relocs, adjust offsets for
3750 eh_frame and stab sections. Zap deleted relocs.
3751 (elf_reloc_symbol_deleted_p): Return true for zero r_symndx.
3752 (elf_bfd_discard_info): Run for relocatable link too.
3753 * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd. Make global.
3755 (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here.
3756 * elf64-ppc.h (ppc64_elf_edit_opd): Declare.
3758 * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c.
3759 (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise.
3760 (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise.
3761 (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR.
3762 (struct eh_frame_hdr_info): Add "hdr_sec", remove "split".
3763 (struct elf_link_hash_table): Add eh_info.
3764 (struct elf_obj_tdata): Change eh_frame_hdr to an asection *.
3765 (_bfd_elf_discard_section_eh_frame): Update prototype.
3766 (_bfd_elf_discard_section_eh_frame_hdr): Likewise.
3767 (_bfd_elf_write_section_eh_frame): Likewise.
3768 (_bfd_elf_write_section_eh_frame_hdr): Likewise.
3769 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec"
3770 param. Get "hdr_info" from link hash table.
3771 (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param. Get
3772 header section from link hash table. Save header section to elf_tdata.
3773 (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec". Use
3774 header section from link hash table. Don't alloc hdr_info. Clear
3775 hdr_sec instead of setting "strip".
3776 (_bfd_elf_eh_frame_section_offset): Formatting.
3777 (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param.
3778 Get header section from link hash table.
3779 (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param.
3780 Get header section from link hash table.
3781 * elf.c (map_sections_to_segments): Use cached eh_frame_hdr.
3782 (get_program_header_size): Likewise.
3783 (_bfd_elf_section_offset): Formatting.
3784 * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header
3785 section pointer in link hash table.
3786 (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr
3787 and _bfd_elf_write_section_eh_frame calls. Update comment about
3789 (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and
3790 _bfd_elf_discard_section_eh_frame_hdr calls. Remove "ehdr".
3792 * po/SRC-POTFILES.in: Regenerate.
3794 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero
3795 relocs for discarded FDEs. Remove dead code.
3796 (_bfd_elf_write_section_eh_frame_hdr): Remove dead code.
3797 * elflink.h (elf_bfd_discard_info): Don't save edited relocs.
3798 Tidy conditions under which stabs are edited. Formatting.
3799 * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
3800 from discarded relocs.
3801 * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output
3802 section adjustments after testing magic values.
3806 * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct
3807 references to large plt symbols.
3811 * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when
3812 looking for an unused section name.
3816 * coff-h8300.c: Fix formatting.
3817 * elf32-h8300.c: Likewise.
3818 * reloc16.c: Likewise.
3822 * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output
3823 section when dynamic section unused; _bfd_strip_section_from_output
3828 * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec
3831 * dwarf2.c: Revert last change.
3835 * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
3836 _bfd_dwarf2_find_nearest_line): Use
3837 bfd_simple_get_relocated_section_contents() instead of
3838 bfd_get_section_contents().
3839 * reloc.c (bfd_perform_relocation): Add sanity check.
3840 * simple.c (simple_get_relocated_section_contents): If the section
3841 does not have any relocs associated with it, just return the
3842 unadjusted contents.
3846 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOT,
3847 case R_CRIS_32_GOT>: Correct test for filling in constant .got
3848 contents, enabling for a non-DSO, for symbols defined in the
3849 program with --export-dynamic.
3853 * elf64-ppc.c: Comment typo fixes.
3854 (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input.
3858 * po/da.po: Updated Danish translation.
3862 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate
3863 exactly three internal relocs per external reloc. Set reloc_count
3864 to the external reloc count.
3868 * coff-stgo32.c (stub_bytes): Mark as const.
3869 Fix comment formatting.
3873 * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and
3875 (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c.
3876 (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h
3877 * archures.c (enum bfd_architecture): Add bfd_arch_m98k.
3878 * bfd.c (struct bfd): Add private data for mach-o, pef, and sym.
3879 * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and
3881 (_bfd_target_vector): Add target vectors for mach-o, pef, and sym.
3882 * Makefile.in: Regenerate.
3883 * doc/Makefile.in: Regenerate.
3884 * bfd-in2.h: Regenerate.
3885 * xsym.c: New file. Contains support for the Apple/Metrowerks
3886 xSYM debugging format.
3888 * pef.c: New file. Contains support for the Apple Code Fragment
3889 Manager Preferred Executable Format
3891 * pef-traceback.h: New file. Contains support for parsing PowerPC
3892 traceback tables as used by PEF executables (and perhaps other
3894 * mach-o.c: New file. Contains support for the Mach-O object file
3896 * mach-o.h: New file.
3897 * mach-o-target.c: New file. Declares the mach-o targets
3898 themselves. Included three times by mach-o.c; each time with a
3899 different set of macros set.
3903 * Makefile.am: Remove entries for elf32-qnx.[ch].
3904 * Makefile.in: Regenerate.
3905 * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec,
3906 ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use
3907 bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
3908 * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec,
3909 bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec,
3910 and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets.
3911 bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec.
3912 * configure: Regenerate.
3913 * elf32-qnx.c: Remove.
3914 * elf32-qnx.h: Remove.
3915 * elf.c: Remove calls to QNX specific set_nonloadable_filepos,
3916 is_contained_by_filepos, and copy_private_bfd_data_p.
3917 * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos,
3918 is_contained_by_filepos, and copy_private_bfd_data_p.
3919 * elf32-i386.c: Remove QNX extended bfd support.
3920 * elf32-ppc.c: Remove QNX extended bfd support.
3921 * elf32-sh.c: Remove QNX extended bfd support.
3922 * elfarm-nabi.c: Remove QNX extended bfd support.
3923 * targets.c: Remove qnx vectors.
3924 * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove
3925 (elf_backend_is_contained_by_filepos): Remove.
3926 (elf_backend_copy_private_bfd_data_p): Remove.
3927 * po/SRC-POTFILES.in: Regenerate.
3932 * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of
3933 dynamic relocs against section symbols for the output section vma.
3937 * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn,
3938 t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove.
3943 * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64
3944 vectors in target_selvecs.
3945 (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors
3947 (sh-*-netbsdelf*): Likewise.
3948 * configure.in (assocvecs): New variable. Handle assocvecs like
3950 * configure: Regenerate.
3951 * format.c (bfd_check_format_matches): Store bfd_target pointers
3952 in matching_vector instead of target names. Select first target
3953 from bfd_associated_vector that matches a list of ambiguous targets.
3954 * targets.c (_bfd_associated_vector): New array.
3955 (bfd_associated_vector): New variable.
3956 (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec.
3957 * libbfd-in.h (bfd_associated_vector): Declare.
3958 * libbfd.h: Regenerate.
3962 * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is
3963 non-NULL before dereferencing.
3967 * vms.c (vms_object_p): Restore the start address when returning
3973 * elflink.h (struct elf_final_link_info): Add shndxbuf_size.
3974 (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields.
3975 Set up a larger symshndxbuf, and write it out. Free it on
3976 exit rather than freeing symbuf twice. Correct section index
3977 on output section symbol loop.
3978 (elf_link_output_sym): Accumulate symbol extension section
3979 indices, reallocating symshndxbuf rather than writing it out.
3980 (elf_link_flush_output_syms): Don't flush symshndxbuf.
3981 * elf.c (assign_section_numbers): Init i_shdrp to all zero.
3982 Use bfd_zalloc to clear i_shdrp[0] too.
3986 * elf32-sh64-com.c (sh64_address_in_cranges): Use
3987 _raw_size of cranges section if _cooked_size not yet set.
3991 * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters
3992 for bfd_elf32_swap_symbol_out.
3996 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix
3997 signed and unsigned in comparison.
4001 * coffcode.h: Remove extraneous '\'.
4005 * Makefile.am (targets.lo): Depend on Makefile instead of
4007 (archures.lo): Likewise.
4008 * Makefile.in: Regenerated.
4012 * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add
4013 bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to
4018 * elf64-sh64.c (sh_elf64_relocate_section): Call
4019 _bfd_elf_rela_local_sym. Handle relocs against STT_SECTION symbol
4020 of SHF_MERGE section.
4024 * simple.c: Correct placement of ATTRIBUTE_UNUSED.
4028 * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to
4029 unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to
4031 (NAME(aout,final_link)): Cast enum used in assignment.
4032 (aout_link_write_symbols): Cast enums in comparisons, int values to
4033 boolean, enums in assignments to int.
4034 (aout_link_input_section_std): Cast rel->r_index to unsigned int.
4035 (aout_link_input_section_ext): Likewise. Cast enums used in
4036 comparisons with unsigned ints.
4037 (aout_link_reloc_link_order): Cast enum to int in assignment.
4038 * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr
4040 * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in
4042 * bfd-in2.h (bfd_set_section_vma): Likewise.
4043 * bfd.c (bfd_record_phdr): Cast enums in assignments.
4044 * binary.c (bfd_alloc): Cast enum to long.
4045 * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean.
4046 * dwarf2.c (read_abbrevs): Add casts to enum types.
4047 (read_attribute_value): Likewise.
4048 (arange_add): Cast result of bfd_zalloc call.
4049 (comp_unit_contains_address): Return true and false.
4050 (comp_unit_find_nearest_line): Cast return to boolean.
4051 * format.c (bfd_check_format_matches, bfd_set_format): Likewise.
4052 * gen-aout.c: define macro '_' if not defined.
4053 * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR.
4054 (bfd_bwrite): Cast bfd_realloc to bfd_byte *.
4055 (bfd_write_bigendian_4byte_int): Cast return to boolean.
4056 (bfd_seek): Cast bfd_realloc to bfd_byte *.
4057 (bfd_generic_is_local_label_name): Cast return to boolean.
4058 * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'.
4059 * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to
4060 struct bfd_hash_entry *.
4061 (_bfd_generic_link_hash_newfunc): likewise.
4062 (_bfd_generic_final_link): Cast enum to unsigned int.
4063 * merge.c (sec_merge_emit): Cast return to boolean.
4064 (merge_strings): Add casts to const unsigned char *.
4065 * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int.
4066 (bfd_generic_get_relocated_section_content): Cast enum to unsigned int.
4067 * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result
4068 to struct bfd_hash_entry *.
4069 (bfd_set_section_content): Add cast to PTR in comparison.
4070 * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol,
4071 simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous,
4072 simple_dummy_unattached_reloc,
4073 bfd_simple_get_relocated_section_contents): Add K&R declarations and
4074 function definitions.
4075 * srec.c (S3Forced): Initialize to false.
4076 (srec_get_symtab): Cast return value from bfd_alloc to asymbol *.
4077 * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons.
4078 (_bfd_discard_section_stabs): Likewise. Also cast return to boolean.
4079 * syms.c (bfd_is_undefined_symclass): Cast return to boolean.
4080 (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in
4085 * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic
4086 relocs into shared lib non-allocated reloc sections.
4090 * dwarf2.c (add_line_info): Ensure that the line_info_table is
4091 sorted even when given an out-of-order line sequence.
4092 (lookup_address_in_line_info_table): When an exact VMA match is
4093 not found, return line information with the closest VMA.
4097 * elf64-hppa.c: Force DT_FLAGS to always be set. Required by
4098 HPUX 11.00 patch PHSS_26559.
4102 * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move
4103 the options section into a separate section unless IRIX 6
4104 compatibility is enabled.
4108 * elflink.h (struct elf_link_sort_rela): Turn rel and rela
4110 (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust.
4111 (elf_link_sort_relocs): Likewise. Take int_rels_per_ext_rel
4113 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose
4114 R_MIPS_REL32 with R_MIPS64 if ABI_64_P.
4118 * targets.c (_bfd_target_vector): Add missing qnx vectors.
4122 * targets.c (bfd_target_list): Don't return the default target twice.
4126 * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace
4127 perror with bfd_perror.
4131 * elflink.h (elf_link_add_object_symbols): Correctly handle
4132 DT_RPATH and DT_RUNPATH.
4136 * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes.
4140 * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code
4145 * elfxx-target.h (USE_REL): Don't define as 1.
4146 * elf32-arm.h (USE_REL): Provide a default define of 0.
4147 Use #if rather than #ifdef when testing USE_REL.
4148 * elf32-m32r.c: Likewise.
4150 * elf32-arc.c (USE_REL): Define as 1.
4151 * elf32-d10v.c (USE_REL): Likewise.
4152 * elf32-m32r.c (USE_REL): Likewise.
4153 * elf32-m68hc11.c (USE_REL): Likewise.
4154 * elf32-m68hc12.c (USE_REL): Likewise.
4155 * elf32-or32.c (USE_REL): Likewise.
4156 * elfarm-nabi.c (USE_REL): Likewise.
4160 * config.bfd (s390-*-linux*): Add targ64_selvecs.
4161 (s390x-*-linux*): Add targ_selvecs.
4165 * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,
4166 elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo,
4167 elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo,
4168 elf32-sh64-nbsd.lo, elf32-shqnx.lo. Add elf32-qnx.lo.
4169 (BFD32_BACKENDS_CFILES): Likewise for corresponding C files.
4170 (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo.
4171 (BFD64_BACKENDS_CFILES): Likewise for corresponding C files.
4172 (SOURCE_HFILES): Add elf32-qnx.h.
4173 (BUILD_HFILES): Add bfdver.h.
4175 * Makefile.in: Regenerate.
4176 * configure.in Update bfd vector dependencies.
4177 * configure: Regenerate.
4178 * elf32-i386-fbsd.c: Delete. Move code to elf32-i386.c.
4179 * elf32-i386qnx.c: Likewise.
4180 * elf32-ppcqnx.c: Delete. Move code to elf32-ppc.c.
4181 * elf32-sh-nbsd.c: Delete. Move code to elf32-sh.c.
4182 * elf32-sh-lin.c: Likewise.
4183 * elf32-shqnx.c: Likewise.
4184 * elf32-sh64-lin.c: Delete. Move code to elf32-sh64.c.
4185 * elf32-sh64-nbsd.c: Likewise.
4186 * elf64-sh64-lin.c: Delete. Move code to elf64-sh64.c.
4187 * elf64-sh64-nbsd.c: Likewise.
4188 * elfarmqnx-nabi.c: Delete. Move code to elfarm-nabi.c.
4189 * elf32-arm.h (ELF_MAXPAGESIZE): Always define.
4190 * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests.
4191 * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests.
4192 * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define.
4193 (elf_backend_is_contained_by_filepos): Likewise.
4194 (elf_backend_copy_private_bfd_data_p): Likewise.
4195 Globalize and move functions to..
4196 * elf32-qnx.c: ..here. New file.
4197 * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests. Don't
4198 emit target vectors when INCLUDE_SHMEDIA.
4199 * elf32-sh64.c: Remove ELF_ARCH test. Move TARGET_* etc. defines to
4201 * elf64-sh64.c: Remove ELF_ARCH test.
4202 * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test.
4203 * po/BLD-POTFILES.in: Regenerate.
4204 * po/SRC-POTFILES.in: Regenerate.
4208 * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
4209 loaded with --just-symbols.
4211 * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define.
4212 * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
4213 * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
4214 * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define.
4218 * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
4219 (BFD64_BACKENDS_CFILES): Likewise.
4220 * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
4221 * elf64-alpha-fbsd.c: Remove file, move code ...
4222 * elf64-alpha.c: ... here.
4223 * Makefile.in, configure: Rebuild.
4227 * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment
4232 * elf32-sh.c (elf_sh_link_hash_entry): Replace
4233 datalabel_got_offset with union of datalabel_got
4234 offset and refcount.
4235 (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount.
4236 (allocate_dynrelocs): Delete unnecessary code for
4237 STT_DATALABEL type. Create entry in got for
4238 datalabel version of symbol if datalabel_got.refcount > 0.
4239 (sh_elf_relocate_section): Use datalabel_got union.
4240 (sh_elf_gc_sweep_hook): Pull common code to initialize
4241 h and eh out of switch statement. Declare seen_stt_datalabel.
4242 Initialize it. Decrement datalabel_got.refcount for
4243 got relocs when seen_stt_datalabel is true.
4244 Decrement local_got_refcounts entry for datalabel got relocs
4246 (sh_elf_copy_indirect_symbol): Copy datalabel_got field over.
4247 (sh_elf_check_relocs): Declare seen_stt_datalabel.
4248 Initialize it. When seen_stt_datalabel is true, increment
4249 datalabel_got refcount rather than got.refcount.
4250 (sh_elf_finish_dynamic_symbol): Create relocs to
4251 initialize got entry for datalabel version of symbol.
4255 * Makefile.am: Run "make dep-am".
4256 (BFD_H_FILES): Remove version.h.
4257 * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move..
4258 * version.h: ..to here.
4259 * configure.in (bfd_version_date): Remove.
4260 (AC_OUTPUT): Make bfdver.h from version.h.
4261 * bfd.c: #include "bfdver.h".
4262 * vms-hdr.c: Likewise.
4263 * Makefile.in: Regenerate.
4264 * bfd-in2.h: Regenerate.
4265 * configure: Regenerate.
4266 * po/SRC-POTFILES.in: Regenerate.
4270 * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086,
4271 bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64,
4272 bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64,
4273 bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850,
4274 bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8,
4275 bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple,
4276 bfd_mach_ia64_elf64, bfd_mach_ia64_elf32,
4277 bfd_mach_ip2022, bfd_mach_ip2022ext,
4278 bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber.
4279 * bfd-in2.h: Regenerate.
4283 * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative
4284 endian vector to targ_selvecs.
4288 * elfxx-mips.c (mips_elf_calculate_relocation): Take
4289 save_addend argument. Don't apply the 32-bit mask to a
4290 GPREL32 value if it's to be used in another relocation. Don't
4291 use forced-check computation of local_p to decide whether to
4292 add gp0 to GPREL16 value. Don't use only the lowest 16 bits
4293 of the addend of a non-in-place GPREL16 relocation.
4294 (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to
4295 mips_elf_calculate_relocation().
4299 * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs
4300 with symbols in other sections if we relaxed something; the sections
4301 output offsets must be re-computed before.
4305 * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols
4306 handling to use Elf_Internal_Sym.
4307 (m68hc11_elf_relax_delete_bytes): Likewise.
4311 * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
4312 sh_elf_object_p, dtpoff_base): New functions.
4313 (sh_elf_howto_table): Add TLS relocs.
4314 (sh_reloc_map): Likewise.
4315 (sh_elf_info_to_howto): Support TLS relocs.
4316 (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
4317 (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
4319 (sh_elf_obj_tdata): New.
4320 (elf_sh_link_hash_table): Add tls_ldm_got.
4321 (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
4322 (allocate_dynrelocs): Support TLS relocs.
4323 (sh_elf_size_dynamic_sections): Likewise.
4324 (sh_elf_relocate_section): Support TLS relocs. Don't try to find
4325 .rela.got section when found already. Return false after printing
4326 error about unresolvable relocation.
4327 (sh_elf_gc_sweep_hook): Support TLS relocs.
4328 (sh_elf_check_relocs): Likewise.
4329 (sh_elf_finish_dynamic_symbol): Likewise.
4330 (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
4331 * reloc.c: Add SH TLS relocs.
4332 * bfd-in2.h, libbfd.h: Regenerate.
4336 * Makefile.in: Regenerated.
4340 * Makefile.am: Run dep-am.
4341 (BFD_H_DEP): Add simple.c and linker.c.
4342 (BFD32_LIBS): Add simple.lo.
4343 (BFD32_LIBS_CFILES): Add simple.c.
4344 * Makefile.in: Regenerated.
4345 * bfd-in2.h: Regenerated.
4346 * simple.c: New file.
4350 * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
4351 (record_thumb_to_arm_glue): Likewise.
4352 * ecoff.c (ecoff_link_add_externals): Likewise.
4353 * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
4354 (record_thumb_to_arm_glue): Likewise.
4355 * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
4356 * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
4357 * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
4358 * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
4359 * elf64-ppc.c (func_desc_adjust): Likewise.
4360 * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
4361 (sh64_elf64_create_dynamic_sections): Likewise.
4362 * elflink.c (_bfd_elf_create_got_section): Likewise.
4363 (_bfd_elf_create_dynamic_sections): Likewise.
4364 (_bfd_elf_create_linker_section): Likewise.
4365 * elflink.h (elf_add_default_symbol): Likewise.
4366 (elf_link_create_dynamic_sections): Likewise.
4367 (NAME(bfd_elf,size_dynamic_sections)): Likewise.
4368 * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
4369 * elfxx-mips.c (mips_elf_create_got_section): Likewise.
4370 (_bfd_mips_elf_add_symbol_hook): Likewise.
4371 (_bfd_mips_elf_create_dynamic_sections): Likewise.
4372 * linker.c (generic_link_add_symbol_list): Likewise.
4373 * xcofflink.c (xcoff_link_add_symbols): Likewise.
4375 * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
4377 * elf64-ppc.c (edit_opd): Only zero opd syms when function is
4378 completely removed. Correct local sym adjustment.
4382 * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
4383 Correct mistake in calculation of address of .got.
4384 * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
4385 elf_sh64_pic_plt_entry_le): Likewise.
4390 * Makefile.am: Add entries for elf32-sh64-lin.c and
4391 elf64-sh64-lin.c. Regenerate.
4392 * Makefile.in: Regenerate.
4393 * config.bfd: Change sh64eb-*-linux* and sh64-*-linux*
4394 to use sh64 vectors rather than sh vectors.
4395 * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
4396 bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
4397 * configure: Regenerate.
4398 * elf32-sh64-lin.c: New file.
4399 * elf64-sh64-lin.c: New file.
4400 * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
4401 bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
4405 * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
4406 IE->LE transition for R_386_TLS_IE.
4410 * elf64-ppc.c (edit_opd): Correct test for discarded sections.
4414 * cofflink.c (mark_relocs): Don't mark relocations in excluded
4419 * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
4422 * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
4426 * opncls.c: Formatting.
4427 (_bfd_new_bfd): Use a smaller section hash table.
4431 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
4432 of the other two relocations packed with a REL32 to NONE.
4436 * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
4437 (sh_elf_link_hash_newfunc): Initialize it.
4438 (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
4439 to got.refcount for symbols that are forced local or when
4440 we have direct got refs.
4441 (sh_elf_gc_sweep_hook): Adjust gotplt_refcount. Use it
4442 to correctly adjust got.refcount and plt.refcount.
4443 (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
4444 (sh_elf_check_relocs): Increment gotplt_refcount.
4448 * elf32-i386.c (elf_i386_relocate_section): Fix
4449 movl foo@indntpoff, %eax IE->LE transition.
4453 * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
4454 sequence and its transitions.
4458 * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
4459 to st_value + addend in non-code sections.
4460 * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
4461 R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
4469 * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
4470 (bfd_mach_mips5500): New.
4471 * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New.
4472 (arch_info_struct): Add corresponding entries here.
4473 * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120,
4474 E_MIPS_MACH_5400 and E_MIPS_MACH_5500.
4475 (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120,
4476 bfd_mach_mips5400 and bfd_mach_mips5500.
4477 (_bfd_mips_elf_mach_extends_p): New function.
4478 (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge
4479 the EF_MIPS_MACH flags.
4480 * bfd-in2.h: Regenerate.
4484 * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip
4489 * elf.c (map_sections_to_segments): Correct test for start of
4490 writable section in the same page as end of read-only section.
4494 * elf32-vax.c (elf_vax_check_relocs): Remove unused
4495 local_got_refcounts usage. Remove allocation of got slot.
4496 (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage.
4497 Remove de-allocation of got slot.
4498 (elf_vax_size_dynamic_section): Fix some indentation. Add hash
4499 traversal for elf_vax_instantiate_got_entries. Allow empty .got
4500 sections to be GC'ed.
4501 (elf_vax_instantiate_got_entries): New function.
4502 (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling. Remove
4503 tests that are now handled by elf_vax_instantiate_got_entries.
4504 Assert GOT entry falls within .got section size. Remove redundant
4505 comparisions. Fix comments.
4509 * reloc.c: Add x86-64 TLS relocs.
4510 * bfd-in2.h, libbfd.h: Rebuilt.
4511 * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit
4512 relocs. Add TLS relocs.
4513 (x86_64_reloc_map): Add TLS relocs.
4514 (elf64_x86_64_info_to_howto): Adjust for added TLS relocs.
4515 (struct elf64_x86_64_link_hash_entry): Add tls_type field.
4516 (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define.
4517 (elf64_x86_64_hash_entry): Define.
4518 (struct elf64_x86_64_obj_tdata): New.
4519 (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define.
4520 (struct elf64_x86_64_link_hash_table): Add tls_ld_got.
4521 (link_hash_newfunc): Initialize tls_type.
4522 (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got.
4523 (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary.
4524 (elf64_x86_64_mkobject): New.
4525 (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata.
4526 (elf64_x86_64_tls_transition): New.
4527 (elf64_x86_64_check_relocs): Add r_type variable and use it.
4529 (elf64_x86_64_gc_sweep_hook): Handle TLS relocs.
4530 (allocate_dynrelocs): Allocate GOT space for TLS relocs.
4531 (elf64_x86_64_size_dynamic_sections): Likewise.
4532 (dtpoff_base, tpoff): New.
4533 (elf64_x86_64_relocate_section): Handle TLS relocs.
4534 (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT
4536 (bfd_elf64_mkobject): Define.
4538 * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set
4539 DF_STATIC_TLS if shared.
4543 * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded
4544 empty relocation sections.
4548 * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here.
4549 (ppc64_elf_build_stubs): Build them here instead.
4553 * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE
4554 addend into r_addend, not *r_offset.
4555 (elf32_sparc_finish_dynamic_symbol): Likewise.
4556 * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at
4557 R_SPARC_RELATIVE's r_offset.
4561 * dwarf2.c (decode_line_info): Update to correctly decode
4562 the (non-standard DWARF2) out-of-order address sequences
4563 generated by the Intel C++ 6.0 compiler for ia64-Linux.
4567 * config.bfd: For DJGPP targets, match with any cpu and any machine.
4571 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs
4572 for discarded FDEs. Remove redundant assignment.
4573 * elflink.h (elf_bfd_discard_info): Save edited relocs.
4577 * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge
4578 the relocation count between different .reloc sections.
4582 * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and
4583 ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for
4584 R_PPC_EMB_SDA2REL. Similarly for R_PPC_EMB_SDA21 and
4587 * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount"
4588 unsigned. Move "symcount" assignment out of loop.
4589 * Makefile.am: Run "make dep-am".
4590 * Makefile.in: Regenerate.
4591 * configure: Regenerate.
4592 * po/SRC-POTFILES.in: Regnerate.
4596 * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is
4597 zero, set it to 8 for (non-standard) 64-bit DWARF2 formats
4602 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word
4603 even if generating R_PPC_RELATIVE reloc.
4604 (ppc_elf_relocate_section): Make sure relocation is performed
4605 if skip == -2. Clear memory at r_offset when creating dynamic
4610 * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
4611 BFD_RELOC_386_TLS_GOTIE): Add.
4612 * bfd-in2.h, libbfd.h: Rebuilt.
4613 * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
4614 and R_386_TLS_GOTIE.
4615 (elf_i386_reloc_type_lookup): Handle it.
4616 (struct elf_i386_link_hash_entry): Change tls_type type to unsigned
4617 char instead of enum, change GOT_* into defines.
4618 (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
4619 (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
4620 (elf_i386_check_relocs): Likewise. Avoid crash if local symbol is
4621 accessed both as normal and TLS symbol. Move R_386_TLS_LDM and
4622 R_386_PLT32 cases so that R_386_TLS_IE can fall through.
4623 Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
4624 (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
4625 Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
4626 (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
4627 tls_type is GOT_TLS_IE_BOTH.
4628 (elf_i386_size_dynamic_sections): Likewise.
4629 (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
4630 Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
4631 (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
4632 all 4 GOT_TLS_* TLS types.
4636 * elflink.h (elf_fix_symbol_flags): When examining weak symbols,
4637 follow indirect links.
4641 * ecoffswap.h (ecoff_swap_pdr_in) <isym, iline>: Update to
4642 correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1)
4644 (ecoff_swap_sym_in) <iss>: Likewise.
4645 * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading
4646 ECOFF information: 'ioptMax' refers to the actual *size*
4647 of the optimization symtab, not the number of entries.
4651 * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update
4652 ELF_LINK_HASH_NEEDS_PLT logic.
4656 * elfcode.h (elf_slurp_reloc_table_from_section): Check
4657 correct relocation count.
4661 * bfd-in.h (bfd_get_dynamic_symcount): Define.
4662 * bfd.c (struct _bfd): Add dynsymcount.
4663 * bfd-in2.h: Regenerated.
4664 * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set
4666 * elfcode.h (elf_slurp_reloc_table_from_section): Check
4671 * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
4672 (mips_elf64_final_gp): Don't make up gp value.
4673 * elfn32-mips.c (mips_elf_final_gp): Likewise.
4674 * elfxx-mips.c (_bfd_mips_elf_final_link): Always create
4675 .MIPS.options/.options section.
4679 * elf32-i386-fbsd.c: Always label using the EI_OSABI method.
4680 It is benign for FreeBSD < 4.1. Minor reformatting.
4681 * elf64-alpha-fbsd.c: Likewise.
4685 * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate
4690 * elf64-alpha.c (alpha_elf_size_info): Make static.
4694 * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED.
4695 * cpu-tic4x.c: Ditto.
4699 * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove
4704 * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included
4705 by a target variant implementation.
4706 * elf64-alpha.c: Likewise.
4707 * elf32-i386-fbsd.c: New file.
4708 * elf64-alpha-fbsd.c: New file.
4709 * targets.c: Support bfd_elf32_i386_freebsd_vec and
4710 bfd_elf64_alpha_freebsd_vec.
4711 * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec,
4712 bfd_elf64_alpha_freebsd_vec.
4713 * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo.
4714 (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c.
4715 (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo.
4716 (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c.
4717 (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies.
4718 * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD
4719 specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate.
4723 * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is
4725 (elf_i386_relocate_section): Return false after printing error about
4726 unresolvable relocation.
4730 * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of
4735 * elf32-h8300.c (elf32_h8_relax_section): Fix typo.
4739 * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and
4740 line_ptr before deciding we've found a symbol.
4744 * po/da.po: New Danish translation file.
4745 * configure.in (LINGUAS): Add 'da'.
4746 * configure: Regenerate.
4750 * irix-core.c (do_sections, do_sections64): New functions.
4751 (irix_core_core_file_p): Call new functions do_sections,
4752 do_sections64, depending on corefile (32-bit or 64-bit).
4756 * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M
4757 and PCREL21F like PCREL21B.
4761 * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default
4766 * elf32-v850.c (v850_elf_final_link_relocate): Use helpful
4767 names instead of cryptically overloaded bfd_reloc error
4769 (v850_elf_relocate_section): Likewise.
4770 (v850_elf_relax_section): Replace caching of external symbols
4771 with caching of internal symbols obtained from calling
4772 bfd_elf_get_elf_syms().
4773 Fixup problems with freeing cached allocated memory blocks.
4777 * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove.
4778 (bfd_pj_arch): Use bfd_default_scan.
4779 * cpu-v850.c (scan): Remove.
4780 (N): Use bfd_default_scan.
4781 * cpu-z8k.c (scan_mach): Remove.
4782 (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is
4783 first. Use bfd_default_scan.
4785 * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded
4787 (ecoff_get_magic): Likewise.
4788 * elf32-v850.c (v850_elf_object_p): Likewise.
4789 (v850_elf_final_write_processing): Likewise.
4790 * mipsbsd.c (MY(set_arch_mach)): Likewise.
4791 (MY(write_object_contents)): Likewise.
4792 * coff64-rs6000.c (xcoff64_write_object_contents): Likewise.
4793 * coffcode.h (coff_write_object_contents): Likewise.
4794 (coff_set_arch_mach_hook): Add comment describing machine == 0.
4795 Remove unnecessary "machine" assignments.
4796 (coff_write_relocs): Test for the absolute section sym by testing
4799 * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386
4800 and bfd_mach_i386_i386_intel_syntax.
4801 * pdp11.c (NAME(aout,machine_type)): Likewise.
4805 * bfd-in.h (align_power): Cast constants to bfd_vma type.
4806 * bfd-in2.h (align_power): Likewise.
4810 * Makefile.am: Run "make dep-am".
4811 * Makefile.in: Regenerate.
4813 * cpu-avr.c (compatible): Don't use hard-coded mach constants.
4814 * cpu-powerpc.c (powerpc_compatible): Likewise.
4815 * cpu-rs6000.c (rs6000_compatible): Likewise.
4819 * elf32-v850.c (v850_elf_reloc_map): Add new relocs.
4820 (v850-elf-reloc): Don't resolve pc relative relocs.
4821 (v850_elf_ignore_reloc): New routine.
4822 (v850_elf_final_link_relocate): Handle new relocs.
4823 (v850_elf_relax_delete_bytes ): New routine.
4824 (v850_elf_relax_section): New routine.
4825 (bfd_elf32_bfd_relax_section): Define.
4826 (HOWTO): New entries for new relocs.
4827 * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc.
4828 (BFD_RELOC_V850_LONGJUMP): New reloc.
4829 (BFD_RELOC_V850_ALIGN): New reloc.
4830 * archures.c: Remove redundant v850ea architecture.
4831 * cpu-v850.c: Remove redundant v850ea support.
4832 * libbfd.h: Regenerate.
4833 * bfd-in2.h: Regenerated.
4837 * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target.
4838 * configure.in: Add tic4x_coff vector files.
4839 * configure: Regenerate.
4840 * Makefile.am: Add tic4x target.
4841 * Makefile.in: Regenerate.
4845 * archures.c: Add the BFD arch type tic4x.
4846 * bfd-in.h: Add BFD_IN_MEMORY flag.
4847 * coff-tic4x.c: New file.
4848 * coffswap.h (coff_swap_sym_out): Add preadjuster.
4849 * cpu-tic4x.c: New file.
4850 * targets.c: Added tic4x- in list of xvecs.
4851 * ticoff.h: New file.
4852 * bfd-in2.h: Regenerate.
4856 * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last
4857 bit of DT_INIT and DT_FINI for Thumb functions.
4861 * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC.
4865 * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8.
4869 * elf32-sh.c (sh_elf_copy_indirect_symbol): New.
4870 (create_got_section, allocate_dynrelocs, readonly_dynrelocs):
4872 (struct elf_sh_pcrel_relocs_copied): Removed.
4873 (struct elf_sh_dyn_relocs): New.
4874 (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied
4875 field with dyn_relocs.
4876 (struct elf_sh_link_hash_table): Add short-cuts to get dynamic
4877 sections and sym_sec.
4878 (sh_elf_link_hash_newfunc): Clear dyn_relocs.
4879 (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec.
4880 (sh_elf_create_dynamic_sections): Use create_got_section instead
4881 of _bfd_elf_create_got_section.
4882 (sh_elf_check_relocs): Likewise.
4883 (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic
4885 (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections,
4886 sh_elf_relocate_section, sh_elf_check_relocs,
4887 sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections):
4889 (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the
4890 dynamic relocations and avoiding the copy relocation when we
4891 didn't find any dynamic relocations in the section which has
4892 contents or is read-only.
4893 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
4894 (sh_elf_size_dynamic_sections): Don't reset the size of
4895 .rela.got section even if dynamic_sections_created flag is off.
4896 Don't use sh_elf_discard_copies. Scan all input bfd and use
4897 allocate_dynrelocs. Call readonly_dynrelocs to determine
4898 whether we need DT_TEXTREL.
4899 (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine
4900 whether the symbol was never referred to.
4901 (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL.
4902 (sh_elf_gc_sweep_hook): Fill with the real sweep function.
4903 (sh_elf_check_relocs): Call create_got_section if the short-cut
4904 to .got is null. Increment reference counters only instead of
4905 allocating space on dynamic sections here. Don't conditionalize
4906 uninitialized got.offset value when marking the symbol as a
4907 global offset table entry. Keep relocations for symbols satisfied
4908 by a dynamic library to avoid copy relocations for the symbol.
4909 Set dynobj field of an elf hash table if needed.
4910 (sh_elf_finish_dynamic_sections): Handle null section pointer
4912 (elf_backend_copy_indirect_symbol): Defined.
4913 (elf_backend_can_refcount): Defined.
4917 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo
4918 previous change. Add comment explaining why.
4922 * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy
4923 contents of .got.plt[2] to tr0, not address of .got.plt.
4924 (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when
4925 patching absolute plt entry. For shmedia plt entry, set bottom bit
4926 of branch to plt0 as this is a branch to an shmedia instruction.
4927 * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le):
4928 Copy contents of .got.plt[2] to tr0, not address of .got.plt.
4929 (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to
4931 (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when
4932 patching absolute plt entry. For shmedia plt entry, branch to
4933 plt0 is now ptrel, so use relative offset. Set bottom bit of
4934 branch target as it is a branch to an shmedia instruction.
4939 * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
4940 value if .init is an SHmedia function. Similarly for DT_FINI.
4941 * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
4945 * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
4947 * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
4951 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
4952 byte read when reading the return address register column.
4956 * config.bfd: Add powepc64-*-*bsd* target.
4960 * Makefile.am: Add entries for elf32-shqnx.c
4961 * Makefile.in: Regenerate.
4962 * config.bfd: Add support sh-*-nto* target.
4963 * configure.in: Add support for bfd_elf32_sh{l}qnx_vec.
4964 * configure: Regenerate.
4965 * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" .
4966 * elf32-sh.c: Do not include elf32-target.h if
4967 ELF32_SH_C_INCLUDED is defined.
4968 * elf32-shqnx.c: New file: Support for QNX.
4969 * targets.c: Add bfd_elf32_sh{l}qnx_vec.
4973 * po/tr.po: Updated Turkish translation.
4975 * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the
4976 symbols are not read.
4980 * elf32-m68hc11.c: Formatting fixes.
4981 (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test.
4982 * elf32-m68hc12.c: Formatting fixes.
4983 (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test.
4987 * coff-rs6000.c (rs6000coff_vec <object_flags>): Add SEC_CODE and
4989 (pmac_xcoff_vec): Likewise.
4990 * coff64-rs6000.c (rs6000coff64_vec): Likewise.
4991 (aix5coff64_vec): Likewise.
4995 * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data
4996 param to elf_backend_copy_indirect_symbol.
4997 (_bfd_elf_link_hash_copy_indirect): Likewise.
4998 * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust
4999 calls to copy_indirect_symbol.
5000 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
5001 * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
5002 * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
5003 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
5004 * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
5005 * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
5006 * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
5007 * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
5008 * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise.
5009 * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly
5010 test refcounts for "used" values.
5014 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to
5015 argument declaration.
5019 * archures.c (bfd_mach_ppc_e500): Added.
5020 * bfd-in2.h: Rebuilt.
5021 * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
5025 * elf32-m68hc12.c (elf_backend_can_gc_sections): False.
5029 * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
5034 * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the
5035 IRIX 6 segment layout for NEWABI.
5039 * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
5040 symbols when looking for section referred to by a relocation.
5041 * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
5045 * elf32-i370.c: Move reloc enum to include/elf/i370.h.
5049 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add
5050 missing check for whether the symbol is referenced by DSO before
5051 unexporting it as an unneeded dynamic symbol.
5055 * libbfd.h: Regenerate.
5059 * config.bfd: Always add 64bit vectors to 32bit Linux/mips.
5063 * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of
5065 (m68hc11_direct_relax): New to define table of relaxable instructions.
5066 (find_relaxable_insn): New, find a relaxable insn.
5067 (compare_reloc): New to compare two relocs.
5068 (m68hc11_elf_relax_section): New, relax text sections.
5069 (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs.
5070 (elf32_m68hc11_check_relocs): New function for GC support.
5071 (elf32_m68hc11_relocate_section): New function for GC support.
5072 (bfd_elf32_bfd_relax_section): Define to support linker relaxation.
5073 (elf_backend_check_relocs): Likewise.
5074 (elf_backend_relocate_section): Likewise.
5078 * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count
5079 definitions in shared objects when checking symbol with
5084 * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC.
5085 (elf32_m68hc11_gc_sweep_hook): Likewise.
5086 (elf_backend_gc_mark_hook): Define for GC section support.
5087 (elf_backend_gc_sweep_hook): Likewise.
5088 (elf_backend_can_gc_sections): Likewise.
5090 * elf32-m68hc12.c: Likewise.
5094 * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New.
5095 (_bfd_m68hc11_elf_merge_private_bfd_data): New function.
5096 (_bfd_m68hc11_elf_set_private_flags): New function.
5097 Use them to set/check/print ELF flags specific to 68HC11.
5099 * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New.
5100 (_bfd_m68hc12_elf_merge_private_bfd_data): New function.
5101 (_bfd_m68hc12_elf_set_private_flags): New function.
5102 Use them to set/check/print ELF flags specific to 68HC12.
5106 * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs;
5107 fix masks for PC-rel relocs.
5108 (m68hc11_elf_ignore_reloc): New function.
5110 * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific
5111 68HC12 banked addressing relocs.
5112 (m68hc12_phys_addr): New to compute physical address of banked memory.
5113 (m68hc12_phys_page): Likewise for page.
5114 (m68hc12_addr_is_banked): New to see if address is in banked area.
5115 (elf_m68hc12_howto_table): Add new relocs and rename to xx12.
5119 * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP,
5120 BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE,
5121 BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12.
5122 * bfd-in2.h: Regenerate.
5126 * elflink.h (elf_add_default_symbol): Preserve section across
5131 * Makefile.am: Add entries for elf32-ppcqnx.c, and add
5132 elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
5133 * Makefile.in: Regenerate.
5134 * config.bfd: Add support for powerpc{le}-*-nto targets.
5135 * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec.
5136 * configure: Regenerate.
5137 * elf32-i386qnx.c: Moved backend functions into a QNX specific
5138 common file "elf32-qnx.h", and now include that file.
5139 * elf32-qnx.h: New file: QNX specific common elf backend.
5140 * elf32-ppc.c: Do not include elf32-target.h if
5141 ELF32_PPC_C_INCLUDED is defined.
5142 * elf32-ppcqnx.c: New file: Support for QNX.
5143 * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend.
5144 * targets.c: Add bfd_elf32_powerpc{le}qnx_vec.
5148 * po/sv.po: Updated Swedish translation.
5152 * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
5153 g->global_gotsym is NULL.
5157 * elflink.h (elf_add_default_symbol): Don't warn if a definition
5158 overrides an indirect versioned symbol.
5162 * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
5163 for R_386_TLS_TPOFF32 relocs against symndx 0.
5167 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol
5168 with undefined version if needed.
5169 (elf_link_assign_sym_version): Match a default symbol with a
5170 version without definition. No need to hide the default
5171 definition separately.
5175 * elflink.h (elf_link_output_extsym): Don't output symbols from
5176 SEC_EXCLUDE sections.
5178 * aoutx.h (aout_link_write_symbols): Correct handling of warning syms.
5182 * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd
5187 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness
5192 * elfxx-mips.c (ABI_64_P): Remove superfluous check.
5196 * elf32-mips.c (mips_reloc_map): Fix typo.
5200 * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section.
5204 * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries.
5208 * libxcoff.h: Use PARAMS on function declarations.
5209 * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc.
5210 * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
5212 * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in
5214 * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise.
5218 * coff-rs6000.c: Formatting fixes.
5219 (xcoff_calculate_relocation): Use PARAMS in declaration.
5220 (xcoff_complain_overflow): Likewise.
5221 (xcoff_ppc_relocate_section): Use old-style function pointer call.
5222 (bfd_xcoff_backend_data): Remove useless comments.
5223 (rs6000coff_vec): Likewise.
5224 (bfd_pmac_xcoff_backend_data): Likewise.
5225 (pmac_xcoff_vec): Likewise.
5227 * coff64-rs6000.c: Formatting fixes.
5228 (xcoff64_calculate_relocation): Use PARAMS in declaration.
5229 (xcoff64_ppc_relocate_section): Use old-style function pointer call.
5230 (bfd_xcoff_backend_data): Remove useless comments.
5231 (rs6000coff64_vec): Likewise.
5232 (bfd_xcoff_aix5_backend_data): Likewise.
5233 (aix5coff64_vec): Likewise.
5237 * coff-rs6000.c (xcoff_howto_table): Revert some of last change to
5238 mask entries. Use complain_overflow_dont for R_REF.
5239 (xcoff_reloc_type_ba): Revert last change.
5240 (xcoff_reloc_type_br): Likewise.
5241 (xcoff_reloc_type_crel): Likewise.
5242 (xcoff_ppc_relocate_section): Likewise.
5243 * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise.
5244 (xcoff64_ppc_relocate_section): Likewise.
5245 (xcoff64_howto_table): Revert some of last change to mask entries.
5246 Use complain_overflow_dont for R_REF.
5248 * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries. Make all
5249 relocs with bitsize == 16 have size = 1.
5250 (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment.
5251 (xcoff_reloc_type_br): Likewise.
5252 (xcoff_reloc_type_crel): Likewise.
5253 (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly.
5254 * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and
5255 dst_mask adjustment.
5256 (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly.
5257 (xcoff64_howto_table): Fix src_mask entries. Make all relocs with
5258 bitsize == 16 have size = 1.
5262 * elf32-ip2k.c: Processor manufacturer changed to Ubicom.
5263 (struct misc): New field isymbuf. All free_* fields removed.
5264 (symbol_value): Pass in internal syms. No need to swap syms in.
5265 (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free
5266 possibly cached info.
5267 (tidyup_after_error): Removed.
5268 (ip2k_elf_relax_section_pass1): Don't use removed fields of struct
5269 misc. Use new field.
5270 (adjust_all_relocations): Use internal syms. No need to swap syms
5272 (add_page_insn): Don't use removed fields of struct misc.
5276 * elf32-arm.h: Revert previous delta.
5280 * configure.in (AM_INIT_AUTOMAKE): Bump version number.
5281 * configure: Regenerate.
5285 * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is
5290 * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD
5295 * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type
5296 if _bfd_elf_link_hash_copy_indirect will swap got.refcount.
5300 * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate):
5301 There is no 8 byte relocation type for this architecture.
5302 (do_ns32k_reloc): Use bfd_vma instead of native types.
5303 (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data
5305 (_bfd_ns32k_put_displacement): Don't check for overflow. We can
5306 rely on generic code to do that.
5307 * aout-ns32k.c (howto_table): Add appropriate overflow detection
5308 to all table entries.
5309 (_bfd_ns32k_relocate_contents): put_data returns void.
5310 * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate)
5311 (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions
5316 * aoutx.h (aout_link_check_ar_symbols): Whether to include an
5317 archive object is target dependant.
5321 * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE.
5322 (THUMB_PLT_ENTRY_SIZE): New macro.
5323 (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE.
5324 (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to
5326 (elf32_arm_plt_entry): Likewise.
5327 (elf_backend_plt_header_size): Likewise.
5328 (elf32_thumb_plt0_entry): New global.
5329 (elf32_arm_finish_dynamic_sections): Use it. Put Thumb entries
5331 (elf32_thumb_plt_entry): New global.
5332 (elf32_arm_finish_dynamic_symbol): Use it. Use .thumb.plt for
5333 Thumb entries. Set the bottom bit of the corresponding GOT entry
5334 for a Thumb PLT entry.
5335 (struct elf32_arm_plt_entry_info): New structure.
5336 (struct elf32_arm_link_hash_entry, plt_info): New member of this
5338 (elf32_arm_link_hash_newfunc): Initialize new member.
5339 (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle
5340 relocations against the PLT.
5341 (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set
5342 first_rel_type if this is the first time we encounter the symbol.
5343 (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case.
5344 Determine if relocation needs a PLT entry. Set first_rel_type if
5345 this is the first time we encounter the symbol
5346 (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb
5348 (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt.
5349 (elf32_arm_create_dynamic_sections): New function. Create the
5351 (elf_backend_create_dynamic_sections): Call it.
5355 * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to
5356 'alternative' in order to avoid shadowing global symbol of the
5358 * bfd-in2.h: Regenerate.
5359 * libbfd.h: Regenerate.
5360 * libcoff.h: Regenerate.
5364 * Makefile.am: Add n32 ABI support.
5365 * Makefile.in: Regenerate.
5366 * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64
5367 bit vectors for mips*-*-linux targets as optional.
5368 * configure.in: Add n32 ABI vectors.
5369 * configure: Regenerate.
5370 * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files.
5371 * elfn32-mips.c: New file, n32 ABI support.
5372 * targets.c: Add n32 ABI vectors.
5376 * elfarmqnx-nabi.c: New file: Support for QNX.
5377 * config.bfd: Add support for arm-*-nto target.
5378 * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec.
5379 * configure: Regenerate.
5380 * Makefile.am: Add entries for elfarmqnx-nabi.c.
5381 * Makefile.in: Regenerate.
5382 * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined.
5383 Do not define global function if ELFARM_NABI_C_INCLUDED is defined.
5384 * elfarm-nabi.c: Do not include elf32-arm.h if
5385 ELFARM_NABI_C_INCLUDED is defined.
5386 * targets.c: Add bfd_elf32_{big|little}armqnx_vec.
5390 * po/sv.po: Updated Swedish translation.
5394 * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type.
5398 * aoutx.h (some_aout_object_p): Clean up tdata properly on error.
5399 * archive.c (bfd_generic_archive_p): Likewise.
5400 * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise.
5401 (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol.
5402 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
5403 (xcoff64_archive_p): Likewise.
5404 (xcoff64_openr_next_archived_file): Likewise.
5405 (xcoff64_archive_p): Clean up tdata properly on error.
5406 * coffgen.c (coff_real_object_p): Likewise.
5407 (coff_object_p): Release filehdr and opthdr.
5408 * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error.
5409 * ieee.c (ieee_archive_p): Likewise.
5410 * ihex.c (ihex_object_p): Likewise.
5411 (ihex_mkobject): Always allocate tdata.
5412 * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error.
5413 * srec.c (srec_mkobject): Always allocate tdata.
5414 (srec_object_p): Clean up tdata properly on error.
5415 (symbolsrec_object_p): Likewise.
5416 * versados.c (versados_object_p): Likewise.
5417 * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc,
5418 and bfd_realloc instead of realloc.
5419 (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections.
5420 * vms.c (vms_initialize): Always allocate tdata. Use bfd_alloc in
5421 place of bfd_malloc, simplifying error freeing. Free hash table too.
5422 (vms_object_p): Clean up tdata on error.
5423 (vms_mkobject): Don't complain on stderr if vms_initialize fails.
5424 (vms_close_and_cleanup): Adjust for bfd_alloc use.
5428 * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags.
5432 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE
5433 flags into resulting BFD.
5438 * elf32-i386.c (elf_i386_link_hash_table_create): Clear
5439 tls_ldm_got.refcount.
5443 * elf64-mips.c: Update TODO comment.
5444 (mips_elf64_higher_reloc,mips_elf64_highest_reloc,
5445 mips_elf64_gprel16_reloca): Remove prototypes.
5446 (mips16_jump_reloc,mips16_gprel_reloc): Add functions.
5447 (UNUSED_RELOC): Replace by EMPTY_RELOC.
5448 (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove
5449 wrong comments. Remove disfunctional support of R_MIPS_HIGHER and
5451 (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and
5452 R_MIPS_GOT16. Remove wrong comments.
5453 (elf_mips16_jump_howto,elf_mips16_gprel_howto,
5454 elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code
5456 (mips_elf64_hi16_reloc): Fix formatting.
5457 (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove.
5458 (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code.
5459 Better comment. Fall back to R_MIPS_GOT_DISP instead of abort().
5460 (mips_elf64_gprel16_reloc): Make static. Add check for
5462 (mips_elf64_gprel16_reloca): Remove.
5463 (mips_elf64_literal_reloc): New function.
5464 (mips_elf64_gprel32_reloc): Fix formatting.
5465 (mips_elf64_shift6_reloc): Fix comment. Make static.
5466 (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from
5468 (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in
5470 (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU
5471 specific relocations.
5472 (mips_elf64_rtype_to_howto): Enable GNU specific relocations.
5473 (mips_elf64_object_p): Invert logic to check for SGI-ish ABI.
5474 (ELF_MAXPAGESIZE): Add comment.
5478 * po/sv.po: Updated Swedish translation.
5479 * po/es.po: Updated Spanish translation.
5480 * po/fr.po: Updated French translation.
5484 * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define
5485 as elf_link_record_local_dynamic_symbol.
5486 (_bfd_elf64_link_record_local_dynamic_symbol): Likewise.
5487 (elf_link_record_local_dynamic_symbol): Declare. Now returns int.
5488 * elflink.h (elf_link_record_local_dynamic_symbol): Move to..
5489 * elflink.c: .. here. Use bfd_elf_get_elf_syms. Check whether an
5490 attempt is made to record a symbol in a discarded section, and
5491 return `2' in that case.
5495 * po/sv.po: Updated Swedish translation.
5496 * po/es.po: Updated Spanish translation.
5500 * po/SRC-POTFILES.in: Regenerate.
5502 * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
5503 immediately. Remove code handling relocatable linking.
5504 * elf32-avr.c (elf32_avr_relocate_section): Likewise.
5505 * elf32-cris.c (cris_elf_relocate_section): Likewise.
5506 * elf32-fr30.c (elf32_frv_relocate_section): Likewise.
5507 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
5508 * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
5509 * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
5510 * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
5511 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
5512 * elf32-v850.c (v850_elf_relocate_section): Likewise.
5513 * elf32-vax.c (elf_vax_relocate_section): Likewise.
5514 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
5515 * elf32-avr.c (elf_backend_rela_normal): Define.
5516 * elf32-cris.c: Likewise.
5517 * elf32-fr30.c: Likewise.
5518 * elf32-frv.c: Likewise.
5519 * elf32-h8300.c: Likewise.
5520 * elf32-hppa.c: Likewise.
5521 * elf32-ip2k.c: Likewise.
5522 * elf32-sparc.c: Likewise.
5523 * elf32-v850.c: Likewise.
5524 * elf32-vax.c: Likewise.
5525 * elf64-hppa.c: Likewise.
5526 * elf64-sparc.c: Likewise.
5527 * elf32-fr30.c (elf32_frv_relocate_section): Edit comment.
5528 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
5529 * elf32-i860.c (elf32_i860_relocate_section): Likewise.
5530 * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
5531 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
5532 * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
5533 * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
5534 * elf-m10200.c (USE_RELA): Don't define.
5535 * elf-m10300.c: Likewise.
5536 * elfarm-oabi.c: Likewise.
5537 * elf32-i370.c: Likewise.
5538 * elf32-ip2k.c: Likewise.
5539 * elf32-m68k.c: Likewise.
5540 * elf32-mcore.c: Likewise.
5541 * elf32-ppc.c: Likewise.
5542 * elf32-s390.c: Likewise.
5543 * elf32-vax.c: Likewise.
5544 * elf64-ppc.c: Likewise.
5545 * elf64-s390.c: Likewise.
5546 * elf64-x86-64.c: Likewise.
5547 * elfxx-ia64.c: Likewise.
5548 * elf32-avr.c (USE_REL): Don't undef.
5549 * elf32-ip2k.c: Likewise.
5553 * elf-bfd.h (struct elf_backend_data): Add new bitfield
5554 'want_p_paddr_set_to_zero'.
5555 * elfxx-target.h: Set default value for want_p_paddr_set_to_zero
5557 * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target.
5558 * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero.
5562 * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of
5563 the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to
5564 show the Copyright string.
5565 Minor formatting tidy ups.
5569 * po/fr.po: Updated French translation.
5570 * po/sv.po: Updated Swedish translation.
5574 * elflink.h (elf_link_input_bfd): Don't change internal symbols
5575 when outputting relocs.
5579 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert
5580 DT_PLTGOT into the dynamic section if there is a PLT.
5584 * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from
5586 (_bfd_mips_elf_write_section): Likewise.
5587 * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype.
5588 (_bfd_mips_elf_write_section): Likewise.
5589 * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c.
5590 (elf32_mips_write_section): Likewise.
5591 * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it.
5592 (_bfd_mips_elf_write_section): Likewise.
5596 * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan
5597 PT_IA_64_UNWIND segments for a given section.
5601 * Makefile.am: Fix a typo.
5602 * Makefile.in: Regenerate.
5612 * Makefile.am: Add support for ip2k.
5613 * Makefile.in: Regenerate.
5614 * doc/Makefile.in: Regenerate.
5615 * archures.c: Add support for ip2k.
5616 * config.bfd: Add support for ip2k.
5617 * configure.in: Add support for ip2k.
5618 * configure: Regenerate.
5619 * reloc.c: Add support for ip2k.
5620 * targets.c: Add support for ip2k.
5621 * bfd-in2.h: Regenerate.
5622 * libbfd.h: Regenerate.
5623 * cpu-ip2k.c: New file.
5624 * elf32-ip2k.c: New file.
5628 * dwarf2.c (concat_filename): If we can't establish the directory
5629 just return the filename.
5633 * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args.
5637 * elflink.h: Formatting fixes, tidy prototypes.
5638 (elf_link_assign_sym_version): Move common code out of loop.
5642 * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
5643 reloc section size is zero. Correct reloc output location.
5647 * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
5648 the final type for the e_fsel selector when generating PA2.0W code.
5649 (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
5654 * elflink.h (elf_link_assign_sym_version): Hide the default
5655 definition if there is a hidden versioned definition.
5659 * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical
5660 dynamic reference test in assertion when initializing GOT with
5661 static contents. Just assert that there are either no dynamic
5662 sections, the symbol is defined in the regular objects or that the
5663 symbol is undef weak. Tweak comment.
5664 (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program
5665 only if the symbol isn't defined in the program and isn't undef
5667 (elf_cris_adjust_dynamic_symbol): Simplify condition for getting
5668 rid of PLT entry: only do it if the symbol isn't defined in a DSO.
5669 When doing so, clear ELF_LINK_HASH_NEEDS_PLT. Tweak comments.
5670 (elf_cris_discard_excess_program_dynamics): Don't consider
5671 ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs.
5675 * elf32-i386.c (elf_i386_relocate_section): Don't complain about
5676 unresolved debugging relocs in dynamic applications.
5677 * elf32-s390.c (elf_s390_relocate_section): Likewise.
5678 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
5679 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
5680 * elf64-s390.c (elf_s390_relocate_section): Likewise.
5681 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
5682 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
5686 * elf64-ppc.c (ONES): Define.
5687 (ppc64_elf_howto_table): Use ONES here to avoid warnings. Fill in
5688 missing src_mask fields. Tweak R_PPC64_NONE, R_PPC64_COPY. Fill
5689 in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32.
5691 * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete.
5692 (ppc64_elf_set_private_flags): Delete.
5693 (ppc64_elf_section_from_shdr): Delete.
5694 (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code.
5695 (ppc64_elf_fake_sections): Delete.
5696 (bfd_elf64_bfd_set_private_flags): Don't define.
5697 (bfd_elf64_get_symbol_info): Likewise.
5698 (elf_backend_section_from_shdr): Likewise.
5699 (elf_backend_fake_sections): Likewise.
5703 * elf.c: (assign_section_numbers) Set sh_entsize for .stab only
5704 when not already set.
5705 * elf64-sparc.c: (sparc64_elf_fake_sections): New function.
5706 (elf_backend_fake_sections): Define.
5710 * merge.c (_bfd_merge_section): Remove redundant output_section check.
5712 (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections.
5716 * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for
5717 NULL sym_hashes to just before use.
5718 <case R_CRIS_32_GOTREL>: In test for local symbol, accept also
5719 symbol with non-default visibility.
5720 <case R_CRIS_32_GOTREL, case R_CRIS_32_PLT_GOTREL>: Ditto.
5721 <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
5723 (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for
5724 symbol with non-default visibility.
5725 (cris_elf_check_relocs): At tests for local symbol before
5726 increasing h->plt.refcount, also check for non-default
5727 visibility. Ditto when checking for local symbol to eliminate
5728 pc-relative runtime relocs.
5732 * elf.c: Formatting.
5733 (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks.
5734 (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP.
5735 (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP
5741 * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
5742 account the impact of relocation count overflow when computing
5744 * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether
5745 or not to apply the PE COFF reloc overflow handling. Fix a
5746 fencepost error in deciding whether or not to use that technique.
5750 * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx,
5751 change type of locsyms.
5752 (bfd_elf_get_elf_syms): Declare.
5753 * elf.c (bfd_elf_get_elf_syms): New function.
5754 (group_signature): Use bfd_elf_get_elf_syms.
5755 (bfd_section_from_r_symndx): Likewise.
5756 * elfcode.h (elf_slurp_symbol_table): Likewise.
5757 * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
5758 (elf_link_add_object_symbols): Likewise. Reorganise to increase
5759 locality of various data structures. Properly free internal relocs.
5760 (elf_bfd_final_link): Properly free internal relocs.
5761 (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms.
5762 (elf_link_input_bfd): Likewise.
5763 (elf_gc_mark): Likewise. Properly free internal relocs.
5764 (elf_gc_sweep): Properly free internal relocs.
5765 (elf_reloc_symbol_deleted_p): No need to swap syms in.
5766 (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free
5768 * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms.
5769 Properly free possibly cached info.
5770 (mn10200_elf_relax_delete_bytes): Remove symbol swapping code.
5771 (mn10200_elf_symbol_address_p): Pass in internal syms. Remove
5772 symbol swapping code.
5773 (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms.
5774 Properly free possibly cached info.
5775 * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c.
5776 (mn10300_elf_relax_delete_bytes): Likewise.
5777 (mn10300_elf_symbol_address_p): Likewise.
5778 (mn10300_elf_get_relocated_section_contents): Likewise.
5779 * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c.
5780 (elf32_h8_relax_delete_bytes): Likewise.
5781 (elf32_h8_symbol_address_p): Likewise.
5782 (elf32_h8_get_relocated_section_contents): Likewise.
5783 * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c.
5784 (m32r_elf_relax_delete_bytes): Likewise.
5785 (m32r_elf_get_relocated_section_contents): Likewise.
5786 * elf32-sh.c (sh_elf_reloc_loop): Free section contents using
5787 elf_section_data to determine whether cached.
5788 (sh_elf_relax_section): As above for elf-m10200.c.
5789 (sh_elf_relax_delete_bytes): Likewise.
5790 (sh_elf_get_relocated_section_contents): Likewise.
5791 * elf32-xstormy16.c (xstormy16_elf_relax_section): As above.
5792 * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay
5793 reading of local syms.
5794 * elf64-mmix.c (mmix_elf_relax_section): Likewise.
5795 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above.
5796 * elfxx-ia64.c (elfNN_ia64_relax_section): As above.
5797 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal
5799 * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly
5800 free internal relocs and section contents. Don't read symbols.
5801 * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms.
5802 (elf32_hppa_size_stubs): Don't free local syms.
5803 * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay
5804 reading of local syms. Use bfd_elf_get_elf_syms. Properly free
5805 possibly cached info.
5806 * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
5807 * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms.
5808 * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and
5810 (get_local_syms): Delete function.
5811 (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache
5813 (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit.
5817 * syms.c (decode_section_type): New.
5818 (bfd_decode_symclass): Call decode_section_type.
5822 * merge.c (_bfd_merged_section_offset): Avoid accessing byte before
5823 section content start.
5828 * section.c (_bfd_strip_section_from_output): Remove unnecessary
5829 link order code. Don't actually remove the output section here;
5830 Just set a flag for the linker to do so.
5831 * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed
5832 sections when setting up output section dynsyms.
5836 * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux
5838 * elf.c (bfd_section_from_shdr): Work around broken hpux shared
5843 * elf64-s390.c (create_got_section): Set .got section alignment to
5845 (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes.
5849 * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar.
5853 * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_*
5858 * elfxx-mips.c (ABI_64_P): Fix comment.
5859 (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the
5860 new section names for N64 ABI.
5861 (mips_elf_output_extsym): No special _gp_disp handling for NewABI.
5862 (mips_elf_calculate_relocation): Code formatting.
5863 (mips_elf_create_dynamic_relocation): Likewise.
5864 (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too.
5865 (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI.
5866 (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64
5868 (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling
5870 (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI.
5871 (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled
5876 * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert
5877 R_X86_64_64 to R_X86_64_RELATIVE.
5881 * vaxbsd.c: New BFD backend for VAX BSD and Ultrix.
5882 * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend.
5884 * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of
5886 * configure.in (vaxbsd_vec): Add.
5887 * targets.c (vaxbsd_vec): Add.
5888 * Makefile.in: Rebuild.
5889 * configure: Rebuild.
5890 * po/SRC-POTFILES.in: Rebuild.
5894 * elflink.h (elf_gc_mark): Pass in the section whose relocs we are
5895 examining to gc_mark_hook, rather than the bfd.
5896 (elf_gc_sections): Adjust.
5897 * elf-bfd.h (struct elf_backend_data <gc_mark_hook>): Likewise.
5898 * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise.
5899 * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise.
5900 * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise.
5901 * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
5902 * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise.
5903 * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise.
5904 * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
5905 * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
5906 * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
5907 * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
5908 * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
5909 * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise.
5910 * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
5911 * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
5912 * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
5913 * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise.
5914 * elf32-v850.c (v850_elf_gc_mark_hook): Likewise.
5915 * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
5916 * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise.
5917 * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
5918 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
5919 * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
5920 * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
5921 * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
5922 * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise.
5923 * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
5924 * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise. Also remove
5925 redundant local sym tests.
5926 * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry.
5927 (link_hash_newfunc): Init is_entry.
5928 (ppc64_elf_copy_indirect_symbol): Copy is_entry.
5929 (ppc64_elf_link_hash_table_create): Init all_local_syms.
5930 (create_linkage_sections): Use bfd_make_section_anyway rather than
5932 (ppc64_elf_mark_entry_syms): New function.
5933 (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab. Set
5934 up opd entry to function section map.
5935 (ppc64_elf_gc_mark_hook): Special case opd section relocs, and
5936 relocs that reference the opd section.
5937 (edit_opd): New function.
5938 (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd.
5939 (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here.
5940 (get_local_syms): Do so here. Exit if we already have local syms.
5941 Remove bogus comment imported from elf32-hppa.c. Don't attempt to
5942 read local syms on non-ELF input.
5943 (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather
5944 than duplicating it's function here. Adjust free of internal
5946 (ppc64_elf_relocate_section): Adjust local syms in opd section.
5947 * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare.
5948 * elf32-hppa.c (elf32_hppa_size_stubs): Call
5949 _bfd_elf32_link_read_relocs rather than duplicating it's function
5950 here. Adjust free of internal relocs to suit.
5954 * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations
5955 are not allowed in shared libs code, enforce -fPIC.
5959 * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and
5960 trailing zero-sequences when there's previous left-over data.
5964 * elf64-hppa.c (elf64_hppa_reloc_type_class): New function.
5965 (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec
5966 and opd_rel_sec in order for starting rela section. Check _raw_size.
5967 (elf_backend_reloc_type_class): Define.
5971 * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
5976 * cpu-powerpc.c: Comment on ordering of arch_info.
5977 * elf32-ppc.c (ppc_elf_object_p): New function.
5978 (elf_backend_object_p): Define.
5979 * elf64-ppc.c (ppc64_elf_object_p): New function.
5980 (elf_backend_object_p): Define.
5984 * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo.
5985 * configure: Regenerate.
5989 * dwarf2.c (decode_line_info): Check unit->addr_size
5990 to read in the proper number of prologue bytes.
5994 * config.bfd (powerpc-*-aix5*): Only create a selvecs for
5995 aix5coff64_vec if 64-bit bfd support has been enabled.
5996 (powerpc64-*-aix5*): Only define if 64-bit bfd support has
5999 * targets.c (_bfd_target_vector[]): Only include
6000 aix5coff64_vec if 64-bit bfd support has been enabled.
6004 * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy.
6005 * elf32-hppa.c (hppa_add_stub): Likewise.
6006 * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
6007 * elflink.h (elf_add_default_symbol): Fix comment typo.
6008 (elf_add_default_symbol): Replace strcpy and strncpy with memcpy.
6009 (elf_link_add_object_symbols): Likewise.
6010 (elf_link_assign_sym_version): Likewise.
6011 * hash.c (bfd_hash_lookup): Likewise.
6012 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
6013 * section.c (bfd_get_unique_section_name): Likewise.
6014 * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
6015 * elf.c (_bfd_elf_make_section_from_phdr): Likewise.
6016 (assign_section_numbers): Likewise.
6017 (_bfd_elfcore_make_pseudosection): Likewise.
6018 (elfcore_grok_lwpstatus): Likewise.
6019 (elfcore_grok_win32pstatus): Likewise.
6020 (elfcore_write_note): Constify input params. Use PTR instead of
6021 void *. Include terminating NUL in namesz. Correct padding.
6022 Support NULL "name" param. Use memcpy instead of strcpy.
6023 (elfcore_write_prpsinfo): Constify input params.
6024 (elfcore_write_prstatus): Likewise. Use PTR instead of void *.
6025 (elfcore_write_lwpstatus): Likewise.
6026 (elfcore_write_pstatus): Likewise.
6027 (elfcore_write_prfpreg): Likewise.
6028 (elfcore_write_prxfpreg): Likewise.
6029 * elf-bfd.h (elfcore_write_note): Update declaration.
6030 (elfcore_write_prpsinfo): Likewise.
6031 (elfcore_write_prstatus): Likewise.
6032 (elfcore_write_pstatus): Likewise.
6033 (elfcore_write_prfpreg): Likewise.
6034 (elfcore_write_prxfpreg): Likewise.
6035 (elfcore_write_lwpstatus): Likewise.
6039 * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for
6040 symbols of type stProc and stStaticProc.
6044 * ecoff.c: VArious formatting fixes.
6048 * coff-rs6000.c (xcoff_generate_rtinit): Fix typo.
6052 * aout-adobe.c: Don't compare against "true" or "false.
6053 * aout-target.h: Likewise.
6054 * aoutx.h: Likewise.
6055 * archive.c: Likewise.
6057 * cache.c: Likewise.
6058 * coff-a29k.c: Likewise.
6059 * coff-alpha.c: Likewise.
6060 * coff-i386.c: Likewise.
6061 * coff-mips.c: Likewise.
6062 * coff-or32.c: Likewise.
6063 * coff64-rs6000.c: Likewise.
6064 * coffcode.h: Likewise.
6065 * coffgen.c: Likewise.
6066 * cpu-ns32k.c: Likewise.
6067 * ecoff.c: Likewise.
6068 * ecofflink.c: Likewise.
6070 * elf32-arm.h: Likewise.
6071 * elf32-cris.c: Likewise.
6072 * elf32-d30v.c: Likewise.
6073 * elf32-i386.c: Likewise.
6074 * elf32-mcore.c: Likewise.
6075 * elf32-ppc.c: Likewise.
6076 * elf32-sh.c: Likewise.
6077 * elf32-sh64.c: Likewise.
6078 * elf32-v850.c: Likewise.
6079 * elf64-alpha.c: Likewise.
6080 * elf64-sh64.c: Likewise.
6081 * elfcode.h: Likewise.
6082 * elfcore.h: Likewise.
6083 * elflink.h: Likewise.
6084 * elfxx-mips.c: Likewise.
6085 * i386os9k.c: Likewise.
6087 * libbfd.c: Likewise.
6088 * linker.c: Likewise.
6090 * nlm32-alpha.c: Likewise.
6091 * nlm32-i386.c: Likewise.
6092 * nlm32-ppc.c: Likewise.
6093 * nlm32-sparc.c: Likewise.
6094 * nlmcode.h: Likewise.
6095 * oasys.c: Likewise.
6096 * pdp11.c: Likewise.
6097 * peicode.h: Likewise.
6098 * reloc.c: Likewise.
6101 * tekhex.c: Likewise.
6103 * xcofflink.c: Likewise.
6104 * elf64-sparc.c: Edit comment to not use "== false".
6106 * aoutf1.h: Don't use "? true : false".
6107 * ecoff.c: Likewise.
6108 * format.c: Likewise.
6110 * linker.c: Likewise.
6112 * oasys.c: Likewise.
6116 * elflink.h (elf_link_add_archive_symbols): For the default
6117 version, check references with only one `@' first.
6121 * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New
6123 (allocate_global_data_dlt): Don't add millicode symbols to dynamic
6125 (allocate_global_data_opd, allocate_dynrel_entries): Likewise.
6126 (elf64_hppa_size_dynamic_sections): Revise to use
6127 elf64_hppa_mark_milli_and_exported_functions.
6128 (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode
6129 symbols out of dynamic symbol table.
6133 * Makefile.in: Regenerate.
6134 * libbfd.h: Regenerate.
6135 * bfd-in2.h: Regenerate.
6136 * configure: Regenerate.
6137 * po/SRC-POTFILES.in: Regenerate.
6139 * elflink.h: Comment typo fixes.
6143 * elf-bfd.h (elf_link_loaded_list): New structure.
6144 (elf_link_hash_table): Add "loaded".
6145 * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded".
6146 * elflink.h (elf_link_check_versioned_symbol): New function.
6147 (elf_link_output_extsym): Call elf_link_check_versioned_symbol.
6151 * elflink.h (size_dynamic_sections): If the target does not
6152 support an ELF style hash table, return true, indicating that
6153 nothing needed to be done, rather than false, indicating that the
6154 section's size could not be computed.
6158 From Catherine Moore, Michael Meissner, Dave Brolley:
6159 * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c
6160 * targets.c: Support bfd_elf32_frv_vec.
6161 * reloc.c: Add FRV relocs.
6162 * configure.in: Add support for bfd-elf32-frv-vec.
6163 * config.bfd (targ_cpu): Add support for frv-*-elf.
6164 * archures.c: Add frv arch and machines.
6165 * Makefile.am (ALL_MACHINES): Add cpu-frv.lo.
6166 (ALL_MACHINES_CFILES): Add cpu-frv.c.
6167 (BFD32_BACKENDS): Add elf32-frv.lo.
6168 (BFD32_BACKENDS_CFILES): Add elf32-frv.c
6169 (cpu-frv.lo): New target.
6170 (elf32-frv.lo): New target.
6171 * cpu-frv.c: New file.
6172 * elf32-frv.c: New file.
6176 * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies
6178 Only read the first section header if e_shoff is non-zero.
6179 Don't consider e_shstrndx if there are no sections.
6183 * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R,
6184 R_D10V_10_PCREL_L and R_D10V_18_PCREL to use
6185 complain_overflow_bitfield.
6189 * opncls.c (bfd_openr): Remove redundant bfd_set_error.
6190 (bfd_fdopenr): Likewise.
6191 (bfd_openstreamr): Likewise.
6192 (bfd_openw): Likewise.
6194 * targets.c: Sort target vecs.
6195 (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec,
6196 bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec,
6197 bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec,
6198 bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec.
6199 * configure.in: Sort target vecs. Add m88kmach3_vec.
6200 * configure: Regenerate.
6204 * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member
6205 bpo_reloc_no to break sort order ties, not address of items.
6209 * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment.
6210 Skip excluded sections in determing __gp value.
6211 (elf_hppa_final_link_relocate): Use the symbol's address in
6212 R_PARISC_FPTR64 relocations that don't need an opd entry.
6213 * elf64-hppa.c (allocate_dynrel_entries): Simplify code.
6214 (elf64_hppa_finalize_dynreloc): Likewise.
6215 (elf64_hppa_size_dynamic_sections): Move comments and fix typo.
6216 (elf64_hppa_finish_dynamic_symbol): Break up assert.
6220 * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
6221 alignment for .bss, .data and .text sections so that sse and sse2
6223 * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
6227 config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*,
6232 * elflink.h (elf_bfd_final_link): Improve error handling for missing
6235 * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry
6236 for a symbol that has no output section.
6237 (allocate_dynrel_entries): Correct comment.
6238 (elf64_hppa_finalize_dynreloc): Likewise. Don't create an opd entry
6240 (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL.
6241 (elf64_hppa_finalize_dlt): Likewise. Prevent segfault for symbols
6242 with no section. Remove unnecessary parentheses.
6246 * coffcode.h (coff_compute_section_file_positions): Add data
6247 section to AIX loader alignment check.
6249 * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section
6250 alignment to 4 bytes.
6251 (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
6252 power accessor macro.
6253 (do_shared_object_padding): Remove invalid assertion.
6257 * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
6258 for removed output sections.
6262 * merge.c (merge_strings): Use htab_create_alloc with calloc, not
6264 * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise.
6268 * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to
6269 work around a long long bug in gcc 2.96 on mips.
6273 * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo.
6274 (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c.
6275 Regenerate dependency lists.
6276 * Makefile.in: Regenerate.
6277 * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add
6278 vax1knetbsd_vec to targ_selvecs.
6279 * configure.in: Add vax1knetbsd_vec.
6280 * configure: Regenerate.
6281 * targets.c (_bfd_target_vector): Add vax1knetbsd_vec.
6282 * vax1knetbsd.c: New file.
6283 * vaxnetbsd.c: Update copyright years.
6284 (TARGET_PAGE_SIZE): Set to 0x1000.
6285 (DEFAULT_MID): Set to M_VAX4K_NETBSD.
6289 * libaout.h (enum machine_type): Add M_VAX4K_NETBSD.
6293 * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static.
6297 * Makefile.am: Run "make dep-am".
6298 * Makefile.in: Regenerate.
6300 * armnetbsd.c: Replace CONST with const.
6301 * corefile.c: Likewise.
6302 * elf32-dlx.c: Likewise.
6303 * elf64-mips.c: Likewise.
6305 * ns32knetbsd.c: Likewise.
6307 * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash
6308 table is elf64-sparc.
6312 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code.
6313 Fix RELA addends to get not shifted in the result. Don't do special
6314 handling of R_MIPS_64 for NewABI.
6318 * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
6319 (NAME(aout,slurp_reloc_table)): Likewise.
6320 * coff-mips.c (mips_relax_section): Use bfd_zalloc.
6321 * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc.
6322 (xcoff_write_archive_contents_big): Likewise.
6323 (xcoff_generate_rtinit): Likewise.
6324 (xcoff_generate_rtinit): Likewise, and check error return.
6325 * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise.
6326 * coffgen.c (coff_section_symbol): Use bfd_zalloc.
6327 (coff_get_normalized_symtab): Likewise.
6328 (coff_make_empty_symbol): Likewise.
6329 (bfd_coff_set_symbol_class): Likewise.
6330 * cofflink.c (coff_link_add_symbols): Likewise.
6331 * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise.
6332 * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc.
6333 (bfd_ecoff_write_accumulated_debug): Likewise.
6334 * elf64-alpha.c (get_got_entry): Use bfd_zalloc.
6335 * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise.
6336 * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc.
6337 * ieee.c (do_with_relocs): Use bfd_zalloc.
6338 * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise.
6339 * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc.
6340 (NAME(aout,slurp_reloc_table)): Likewise.
6341 (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd.
6342 * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc.
6343 * som.c (som_build_and_write_symbol_table): Likewise.
6344 (som_slurp_string_table): Likewise.
6345 (som_slurp_symbol_table): Likewise.
6346 (som_bfd_ar_write_symbol_stuff): Likewise.
6347 * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc.
6348 * sunos.c (bfd_sunos_size_dynamic_sections): Likewise.
6349 * tekhex.c (find_chunk): Likewise. Get rid of unused "sname".
6350 * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc.
6351 * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc.
6355 * elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
6357 (elf_group_name): Update.
6358 (elf_group_id): Define.
6359 (bfd_elf_set_group_contents): Declare.
6360 * elf.c (elf_fake_sections): Qualify use of elf_group_name.
6361 (set_group_contents): Rename to bfd_elf_set_group_contents. Remove
6362 ATTRIBUTE_UNUSED from failedptrarg. If elf_group_id is set, use
6363 that sym for the signature.
6364 (_bfd_elf_compute_section_file_positions): Don't call
6365 set_group_contents for "ld -r" case.
6366 (swap_out_syms): Use bfd_zalloc.
6367 * elflink.h (elf_link_add_archive_symbols): Likewise.
6368 (NAME(bfd_elf,size_dynamic_sections)): Likewise.
6369 (elf_bfd_final_link): Call bfd_elf_set_group_contents.
6373 * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
6374 relocs in opd for non-shared too.
6378 * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
6383 * merge.c: Include libiberty.h.
6384 * elf-strtab.c: Include libiberty.h.
6388 * peXXigen.c (pe_print_idata): Remove unused variable.
6392 * elf.c (assign_file_positions_for_segments): Remove unallocated
6393 sections from the section to segment mapping for PT_LOAD segments.
6394 Update comment about empty loadable segments.
6398 * stabs.c (_bfd_link_section_stabs): Check that the symbol offset
6399 is within the .stabstr section.
6403 * elf-bfd.h (struct elf_size_info <swap_symbol_in>): Function args
6404 are "const PTR", not "const PTR *".
6405 (bfd_elf32_swap_symbol_in): Likewise.
6406 (bfd_elf64_swap_symbol_in): Likewise.
6407 * elfcode.h (elf_swap_symbol_in): Change input args to const PTR.
6408 (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
6409 * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
6410 (elf_link_add_object_symbols): Likewise.
6411 (elf_link_record_local_dynamic_symbol): Likewise.
6412 (elf_link_input_bfd): Likewise.
6413 (elf_gc_mark): Likewise.
6414 (elf_reloc_symbol_deleted_p): Likewise.
6415 * elf-m10200.c (mn10200_elf_relax_section): Likewise.
6416 (mn10200_elf_relax_delete_bytes): Likewise.
6417 (mn10200_elf_symbol_address_p): Likewise.
6418 (mn10200_elf_get_relocated_section_contents): Likewise.
6419 * elf-m10300.c (mn10300_elf_relax_section): Likewise.
6420 (mn10300_elf_relax_section): Likewise.
6421 (mn10300_elf_relax_delete_bytes): Likewise.
6422 (mn10300_elf_symbol_address_p): Likewise.
6423 (mn10300_elf_get_relocated_section_contents): Likewise.
6424 * elf32-h8300.c (elf32_h8_relax_section): Likewise.
6425 (elf32_h8_relax_delete_bytes): Likewise.
6426 (elf32_h8_symbol_address_p): Likewise.
6427 (elf32_h8_get_relocated_section_contents): Likewise.
6428 * elf32-hppa.c (get_local_syms): Likewise.
6429 * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
6430 * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
6431 * elf32-sh.c (sh_elf_relax_section): Likewise.
6432 (sh_elf_relax_delete_bytes): Likewise.
6433 (sh_elf_get_relocated_section_contents): Likewise.
6434 * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
6435 * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
6436 * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
6437 * elf64-mmix.c (mmix_elf_relax_section): Likewise.
6438 * elf64-ppc.c (get_local_syms): Likewise.
6439 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
6440 * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
6444 * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations.
6448 * elf.c (group_signature): Swap in the whole symbol, and handle
6449 extracting section symbol names.
6450 (setup_group): Add comment.
6451 (set_group_contents): When called from objcopy or ld, arrange for
6452 section contents to be written. Write group member output section
6453 indices to allow objcopy to reorganize sections.
6454 (_bfd_elf_copy_private_section_data): Copy group info.
6456 * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
6457 (bfd_elf32_swap_symbol_in): Update prototype.
6458 (bfd_elf64_swap_symbol_in): Likewise.
6459 * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
6460 (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
6461 * elflink.h (elf_link_is_defined_archive_symbol): Likewise.
6462 (elf_link_add_object_symbols): Likewise.
6463 (elf_link_record_local_dynamic_symbol): Likewise.
6464 (elf_link_input_bfd): Likewise.
6465 (elf_gc_mark): Likewise.
6466 (elf_reloc_symbol_deleted_p): Likewise.
6467 * elf-m10200.c (mn10200_elf_relax_section): Likewise.
6468 (mn10200_elf_relax_delete_bytes): Likewise.
6469 (mn10200_elf_symbol_address_p): Likewise.
6470 (mn10200_elf_get_relocated_section_contents): Likewise.
6471 * elf-m10300.c (mn10300_elf_relax_section): Likewise.
6472 (mn10300_elf_relax_section): Likewise.
6473 (mn10300_elf_relax_delete_bytes): Likewise.
6474 (mn10300_elf_symbol_address_p): Likewise.
6475 (mn10300_elf_get_relocated_section_contents): Likewise.
6476 * elf32-h8300.c (elf32_h8_relax_section): Likewise.
6477 (elf32_h8_relax_delete_bytes): Likewise.
6478 (elf32_h8_symbol_address_p): Likewise.
6479 (elf32_h8_get_relocated_section_contents): Likewise.
6480 * elf32-hppa.c (get_local_syms): Likewise.
6481 * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
6482 * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
6483 * elf32-sh.c (sh_elf_relax_section): Likewise.
6484 (sh_elf_relax_delete_bytes): Likewise.
6485 (sh_elf_get_relocated_section_contents): Likewise.
6486 * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
6487 * elf64-alpha.c (elf64_alpha_relax_section): Likewise.
6488 * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
6489 * elf64-mmix.c (mmix_elf_relax_section): Likewise.
6490 * elf64-ppc.c (get_local_syms): Likewise.
6491 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
6492 * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
6493 * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
6494 * elf64-alpha.c (alpha_elf_size_info): Likewise.
6495 * elf64-hppa.c (hppa64_elf_size_info): Likewise.
6496 * elf64-mips.c (mips_elf64_size_info): Likewise.
6497 * elf64-s390.c (s390_elf64_size_info): Likewise.
6498 * elf64-sparc.c (sparc64_elf_size_info): Likewise.
6502 * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to...
6503 elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here.
6504 elf64-mips.c (elf_backend_ignore_discarded_relocs): Use
6505 _bfd_mips_elf_ignore_discarded_relocs.
6506 elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare.
6510 * elfxx-mips.c (mips_elf_calculate_relocation): Call
6511 _bfd_elf_rel_local_sym for STT_SECTION relocations against
6512 the SEC_MERGE section.
6516 * coff-alpha.c: Update copyright date.
6517 * coff-mips.c: Likewise.
6518 * xcoff-target.h: Likewise.
6520 * bfd-in.h: Remove "taken from the source" comment.
6521 * libbfd-in.h: Likewise.
6522 * libcoff-in.h: Likewise.
6523 * bfd-in2.h: Regenerate.
6524 * libbfd.h: Regenerate.
6525 * libcoff.h: Regenerate.
6527 * elf.c (bfd_elf_discard_group): Return true.
6528 * elf-bfd.h (bfd_elf_discard_group): Declare.
6529 * bfd-in.h (bfd_elf_discard_group): Don't declare here.
6530 * section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
6531 * bfd.c (bfd_discard_group): Define.
6532 * targets.c (struct bfd_target): Add _bfd_discard_group.
6533 (BFD_JUMP_TABLE_LINK): Here too.
6534 * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
6535 * aout-adobe.c (aout_32_bfd_discard_group): Define.
6536 * aout-target.h (MY_bfd_discard_group): Define.
6537 * aout-tic30.c (MY_bfd_discard_group): Define.
6538 * binary.c (binary_bfd_discard_group): Define.
6539 * bout.c (b_out_bfd_discard_group): Define.
6540 * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
6541 * coffcode.h (coff_bfd_discard_group): Define.
6542 * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
6543 * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
6544 * i386msdos.c (msdos_bfd_discard_group): Define.
6545 * i386os9k.c (os9k_bfd_discard_group): Define.
6546 * ieee.c (ieee_bfd_discard_group): Define.
6547 * ihex.c (ihex_bfd_discard_group): Define.
6548 * mmo.c (mmo_bfd_discard_group): Define.
6549 * nlm-target.h (nlm_bfd_discard_group): Define.
6550 * oasys.c (oasys_bfd_discard_group): Define.
6551 * ppcboot.c (ppcboot_bfd_discard_group): Define.
6552 * som.c (som_bfd_discard_group): Define.
6553 * srec.c (srec_bfd_discard_group): Define.
6554 * tekhex.c (tekhex_bfd_discard_group): Define.
6555 * versados.c (versados_bfd_discard_group): Define.
6556 * vms.c (vms_bfd_discard_group): Define.
6557 * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
6558 * coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
6559 (aix5coff64_vec): Likewise.
6560 * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
6564 * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo.
6565 (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c.
6566 (elf32-sh64-com.lo): New dependency list.
6567 * Makefile.in: Regenerate.
6568 * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec)
6569 (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add
6571 * configure: Regenerate.
6572 * elf32-sh64.c (sh64_address_in_cranges)
6573 (sh64_get_contents_type, sh64_address_is_shmedia): Move to...
6574 (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb):
6575 (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to...
6576 * elf32-sh64-com.c: ...here. New file.
6580 * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove
6581 ATTRIBUTE_UNUSED on used params.
6582 * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks
6583 before calling bfd_section_from_elf_index on local syms.
6584 * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise.
6588 * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo.
6589 (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c.
6590 (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo.
6591 (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c.
6592 (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules.
6593 * Makefile.in: Regenerate.
6594 * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*)
6595 (sh64-*-netbsd*): New targets.
6596 * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec,
6597 bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec.
6598 * configure: Regenerate.
6599 * elf32-sh64-nbsd.c: New file.
6600 * elf64-sh64-nbsd.c: New file.
6601 * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec,
6602 bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and
6603 bfd_elf64_sh64lnbsd_vec.
6607 * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups.
6608 (bfd_section_from_shdr): Likewise. Set section name of group
6609 sections from signature.
6610 (group_signature): Split out from setup_group. Ensure symbol table
6612 (bfd_elf_discard_group): New function.
6613 (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on
6614 .gnu.linkonce* sections if they are members of a group.
6615 (set_group_contents): Set GRP_COMDAT flag.
6616 * section.c (bfd_discard_group): New function.
6617 * bfd-in.h (bfd_elf_discard_group): Declare.
6618 * bfd-in2.h: Regenerate.
6619 * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field.
6620 (elf_linkonce_p): Define.
6624 * elf.c (bfd_section_from_shdr): Make "name" const.
6625 * elf-bfd.h (elf_backend_section_from_shdr): Likewise.
6626 * elf32-i370.c (i370_elf_section_from_shdr): Likewise.
6627 * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
6628 * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
6629 * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
6630 * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
6631 * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
6632 * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
6633 * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
6634 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
6635 * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
6639 * elfxx-mips.c (ABI_64_P): Use backend's data to determine the
6644 * elf32-arc.c: Fix formatting.
6645 * elf32-arm.h: Likewise.
6646 * elf32-cris.c: Likewise.
6647 * elf32-dlx.c: Likewise.
6648 * elf32-hppa.c: Likewise.
6649 * elf32-i386.c: Likewise.
6650 * elf32-i386qnx.c: Likewise.
6651 * elf32-or32.c: Likewise.
6652 * elf32-s390.c: Likewise.
6653 * elf32-sh64.c: Likewise.
6654 * elf32-vax.c: Likewise.
6655 * elf32-xstormy16.c: Likewise.
6656 * elf64-alpha.c: Likewise.
6657 * elf64-mmix.c: Likewise.
6658 * elf64-ppc.c: Likewise.
6659 * elf64-s390.c: Likewise.
6660 * elf64-sh64.c: Likewise.
6661 * elf64-x86-64.c: Likewise.
6665 * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference
6666 null when there are no got entries for a symbol.
6667 (elf64_alpha_relax_find_tls_segment): Rearrange to avoid
6668 uninitialized variable warning.
6672 * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for
6673 undefined symbols here.
6674 (elf64_alpha_relax_section): Do it here. Also test for not
6675 defined in the current module.
6676 (elf64_alpha_relocate_section_r): Split out of ...
6677 (elf64_alpha_relocate_section): ... here. Don't dereference
6678 NULL when looking up local got entries.
6682 * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined
6683 symbols from JSR relaxation.
6684 (elf64_alpha_size_plt_section_1): New.
6685 (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ...
6686 (elf64_alpha_size_rela_got_1): ... here.
6687 (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ...
6688 (elf64_alpha_size_rela_got_section): ... here.
6689 (elf64_alpha_size_plt_section): New.
6690 (elf64_alpha_relax_section): Call them.
6691 (elf64_alpha_size_got_sections): Remove output_bfd arg.
6692 (elf64_alpha_finish_dynamic_symbol): Check gotent use_count.
6696 * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New.
6697 (elf64_alpha_relocate_section): Use them. Reject LE TLS relocs
6698 in shared libraries. Fix DTPRELHI and TPRELHI value.
6699 (INSN_ADDQ, INSN_RDUNIQ): New.
6700 (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent.
6701 (elf64_alpha_relax_with_lituse): Return boolean. Remove irelend
6702 argument. Reject dynamic symbols. Use LITUSE symbolic constants.
6703 (elf64_alpha_relax_got_load): Rename from relax_without_lituse.
6704 Handle GOTDTPREL and GOTTPREL relocations.
6705 (elf64_alpha_relax_gprelhilo): New.
6706 (elf64_alpha_relax_tls_get_addr): New.
6707 (elf64_alpha_relax_find_tls_segment): New.
6708 (elf64_alpha_relax_section): Handle TLS relocations.
6709 (ALPHA_ELF_LINK_HASH_TLS_IE): New.
6710 (elf64_alpha_check_relocs): Set it.
6714 * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp.
6716 * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic
6717 check; don't suppress dynamic relocs for non-allocated sections.
6719 * elf64-alpha.c: Remove dead code.
6723 * bfd-in2.h: Regenerate.
6724 * libbfd.h: Regenerate.
6725 * po/SRC-POTFILES.in: Regenerate.
6727 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
6732 * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo.
6733 (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c.
6735 * Makefile.in: Regenerate.
6736 * config.bfd: Add i[3456]86-*-nto-qnx* support.
6737 * configure.in: Add bfd_elf32_i386qnx_vec support.
6738 * configure: Regenerate.
6739 * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos,
6740 is_contained_by_filepos, and copy_private_bfd_data_p.
6741 * elf.c (assign_file_positions_for_segments): Call backend
6742 set_nonloadable_filepos. Fix non-K&R call to _bfd_error_handler.
6743 (IS_CONTAINED_BY_FILEPOS): Define.
6744 (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS.
6745 (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS. Typo fix.
6746 Fix non-K&R call to _bfd_error_handler.
6747 (_bfd_elf_copy_private_section_data): Use backend
6748 copy_private_bfd_data_p.
6749 * elf32-i386.c: Don't include elfxx-target.h when
6750 ELF32_I386_C_INCLUDED is defined.
6751 * elf32-i386qnx.c: New QNX elf backend file.
6752 * elfxx-target.h: Add elf_backend_set_nonloadable_filepos,
6753 elf_backend_is_contained_by_filepos, and
6754 elf_backend_do_copy_private_bfd_data.
6755 * targets.c: Add bfd_target bfd_elf32_i386qnx_vec.
6759 * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define.
6760 Move other similar defines to start of file.
6764 * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA.
6765 * coff64-rs6000.c (xcoff64_rtype2howto): Same.
6769 * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD,
6770 ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New.
6771 (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove.
6772 (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove.
6773 (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated.
6774 (struct alpha_elf_obj_tdata): Rename total_got_entries and
6775 n_local_got_entries to total_got_size and local_got_size.
6776 (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs.
6777 (alpha_got_entry_size): New.
6778 (elf64_alpha_relax_with_lituse): Use it.
6779 (elf64_alpha_relax_without_lituse): Likewise.
6780 (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES.
6781 (get_got_entry): New.
6782 (elf64_alpha_check_relocs): Handle TLS relocs. Reorganize.
6783 (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask.
6784 (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type.
6785 (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise.
6786 (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size.
6787 (elf64_alpha_calc_got_offsets): Likewise.
6788 (alpha_dynamic_entries_for_reloc): New.
6789 (elf64_alpha_calc_dynrel_sizes): Use it.
6790 (elf64_alpha_size_dynamic_sections): Likewise.
6791 (elf64_alpha_relocate_section): Handle TLS relocations.
6792 * reloc.c: Add Alpha TLS relocations.
6793 * bfd-in2.h, libbfd.h: Rebuild.
6797 * peXXigen.c (pe_print_idata): Remove double printed
6798 import table lines; add Bound-To comment.
6802 * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.
6803 (BFD32_BACKENDS_CFILES): Add elf32-vax.c.
6804 (elf32-vax.lo): New rule.
6805 * Makefile.in: Regenerate.
6806 * configure.in (bfd_elf32_vax_vec)
6807 (vaxnetbsd_vec): New vectors.
6808 * configure: Regenerate.
6809 * config.bfd (vax-*-netbsdelf*)
6811 (vax-*-netbsd*): New targets.
6812 * elf32-vax.c: New file.
6813 * reloc.c: Add VAX relocations.
6814 * bfd-in2.h: Regenerate.
6815 * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec.
6819 * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec
6820 and bfd_elf32_bigarm_vec to targ_selvecs.
6824 * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables
6825 with auto-imported symbols.
6829 * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue
6830 sections only record bfd.
6831 (bfd_elf32_arm_add_glue_sections_to_bfd): New function.
6832 * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it.
6833 * bfd-in2.h: Regenerate.
6837 * syms.c (_bfd_stab_section_find_nearest_line): Move
6838 declaration and initialisation of saw_line and saw_func out of
6843 * elf64-ppc.c (ppc64_elf_get_symbol_info): New function.
6844 (bfd_elf64_get_symbol_info): Define.
6845 * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef.
6849 * cpu-h8300.c: Make default h8300 machine first in machine list.
6853 * config.bfd: Added DLX configuraton.
6854 * Makefile.am: Added DLX configuraton.
6855 * configure.in: Added DLX configuraton.
6856 * archures.c: Add DLX architecure.
6857 * reloc.c: Add DLX relocs.
6858 * targets.c: Added DLX target vector.
6859 * configure: Regenerate.
6860 * Makefile.in: Regenreate.
6861 * bfd-in2.h: Regenreate.
6862 * elf32-dlx.c: New file: Support DLX target.
6863 * cpu-dlx.c: New file: Support DLX target.
6867 * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting.
6869 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change.
6870 (ppc64_elf_check_relocs): Don't set up function descriptor symbol
6871 strings to point inside function code sym string.
6872 (func_desc_adjust): Likewise.
6873 (ppc64_elf_hide_symbol): Rewrite code to look up function code sym.
6877 * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added.
6878 (elf64_x86_64_grok_psinfo): Added.
6882 * config.bfd: Add a target for i386-netbsdpe.
6886 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func
6887 and is_func_descriptor.
6888 (func_desc_adjust): Hide function code sym in shared libs unless
6889 there is a matching exported function descriptor sym.
6893 * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
6894 for symbols from SHF_TLS section.
6895 (_bfd_elf_print_private_bfd_data): Add PT_TLS.
6896 (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
6897 (map_sections_to_segments): Build PT_TLS segment if necessary.
6898 (assign_file_positions_for_segments): Likewise.
6899 (get_program_header_size): Account for PT_TLS segment.
6900 (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
6901 SEC_THREAD_LOCAL sections to STT_TLS.
6902 * reloc.c: Add 386 and IA-64 TLS relocs.
6903 * section.c (SEC_THREAD_LOCAL): Define.
6904 (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
6906 * elflink.h (elf_link_add_object_symbols): Support .tcommon.
6907 (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
6909 (struct elf_final_link_info): Add first_tls_sec.
6910 (elf_bfd_final_link): Set first_tls_sec.
6911 Compute elf_hash_table (info)->tls_segment.
6912 (elf_link_output_extsym): Handle STT_TLS symbols.
6913 (elf_link_input_bfd): Likewise.
6914 * syms.c (BSF_THREAD_LOCAL): Define.
6915 * bfd-in2.h: Rebuilt.
6916 * libbfd.h: Rebuilt.
6917 * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
6918 elf_i386_mkobject, elf_i386_object_p): New functions.
6919 (elf_howto_table): Add TLS relocs.
6920 (elf_i386_reloc_type_lookup): Support TLS relocs.
6921 (elf_i386_info_to_howto_rel): Likewise.
6922 (struct elf_i386_link_hash_entry): Add tls_type.
6923 (struct elf_i386_obj_tdata): New.
6924 (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
6926 (struct elf_i386_link_hash_table): Add tls_ldm_got.
6927 (link_hash_newfunc): Clear tls_type.
6928 (elf_i386_check_relocs): Support TLS relocs.
6929 (elf_i386_gc_sweep_hook): Likewise.
6930 (allocate_dynrelocs): Likewise.
6931 (elf_i386_size_dynamic_sections): Likewise.
6932 (elf_i386_relocate_section): Likewise.
6933 (elf_i386_finish_dynamic_symbol): Likewise.
6934 (bfd_elf32_mkobject, elf_backend_object_p): Define.
6935 * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
6936 dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
6937 want_tprel, want_dtpmod, want_dtprel.
6938 (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
6939 (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
6940 R_IA64_LTOFF_TPREL22.
6941 (elf_code_to_howto_index): Add TLS relocs.
6942 (elfNN_ia64_check_relocs): Support TLS relocs.
6943 (allocate_global_data_got): Account for TLS .got data.
6944 (allocate_dynrel_entries): Account for TLS dynamic relocations.
6945 (elfNN_ia64_install_value): Supprt TLS relocs.
6946 (set_got_entry): Support TLS relocs.
6947 (elfNN_ia64_relocate_section): Likewise.
6951 * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb
6952 BLX reloc round the relocation up rather than down.
6953 * coff-arm.c (coff_arm_relocate_section): Likewise.
6957 * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
6962 * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
6963 (ppc64_elf_relocate_section): Handle unresolved relocs in opd.
6967 * elf64-ppc.c (ppc64_elf_relocate_section): Return false for
6969 (ppc64_elf_size_dynamic_sections): Check for splt NULL.
6973 * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
6978 * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return
6980 * elflink.h (elf_link_output_relocs): Likewise. Improve error message.
6981 return with false on error.
6982 (elf_link_input_bfd): Check reloc_emitter return value.
6986 * config.bfd (armeb-*-netbsdelf*): New target.
6990 * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
6991 at the plt call stub.
6995 * cpu-mips.c (mips_compatible): Don't try to check machine
7000 * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent.
7004 * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting.
7005 (ppc64_elf_relocate_section): Don't warn about reloc overflow when
7006 we've already warned about an undefined symbol. Report more
7007 detail on reloc errors.
7011 * acinclude.m4 (AM_INSTALL_LIBBFD): New.
7012 * configure.in: Invoke AM_INSTALL_LIBBFD.
7013 * Makefile.am (install-data-local): Revert 2002-05-13. Move to..
7014 (install_libbfd): .. New target.
7015 (uninstall_libbfd): Likewise.
7016 (install-bfdlibLTLIBRARIES): Likewise.
7017 (uninstall-bfdlibLTLIBRARIES): Likewise.
7019 (bfdincludedir): New.
7020 (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
7021 * aclocal.m4: Regenerate.
7022 * configure: Regenerate.
7023 * Makefile.in: Regenerate.
7027 * hash.c (bfd_hash_lookup): Remove computation of len from inside
7032 * config.bfd: Add targets for sh64-linux (little endian and
7037 * peXXigen.c (pe_print_idata): Do not assume that the first thunk
7038 is located in the same section as the import table. Instead
7039 check, and if necessary load the section containing the thunk.
7043 * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with
7045 (xcoff64_core_file_matches_executable_p): Replace bfd_read
7050 * aix5ppc-core.c: Warning fixes.
7051 * aout-adobe.c (aout_32_bfd_link_just_syms): Define.
7052 * aout-target.h (MY_bfd_link_just_syms): Define.
7053 * aout-tic30.c (MY_bfd_link_just_syms): Define.
7054 * bfd.c (bfd_link_just_syms): Define.
7055 * binary.c (binary_bfd_link_just_syms): Define.
7056 * bout.c (b_out_bfd_link_just_syms): Define.
7057 * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
7058 * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
7059 * coffcode.h (coff_bfd_link_just_syms): Define.
7060 * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
7061 (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
7062 (_bfd_elf_link_just_syms): Declare.
7063 * elf.c (_bfd_elf_link_just_syms): New function.
7064 * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
7065 sections haven't already been discarded by the linker.
7066 * elflink.h (elf_link_add_object_symbols): Likewise for stab
7067 sections and SEC_MERGE sections.
7068 (elf_bfd_discard_info): Similarly here.
7069 * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
7070 * i386msdos.c (msdos_bfd_link_just_syms): Define.
7071 * i386os9k.c (os9k_bfd_link_just_syms): Define.
7072 * ieee.c (ieee_bfd_link_just_syms): Define.
7073 * ihex.c (ihex_bfd_link_just_syms): Define.
7074 * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
7075 (_bfd_generic_link_just_syms): Declare.
7076 * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
7077 * linker.c (_bfd_generic_link_just_syms): New function.
7078 * mmo.c (mmo_bfd_link_just_syms): Define.
7079 * nlm-target.h (nlm_bfd_link_just_syms): Define.
7080 * oasys.c (oasys_bfd_link_just_syms): Define.
7081 * ppcboot.c (ppcboot_bfd_link_just_syms): Define.
7082 * som.c (som_bfd_link_just_syms): Define.
7083 * srec.c (srec_bfd_link_just_syms): Define.
7084 * targets.c (struct bfd_target): Add _bfd_link_just_syms.
7085 (BFD_JUMP_TABLE_LINK): And here.
7086 * tekhex.c (tekhex_bfd_link_just_syms): Define.
7087 * versados.c (versados_bfd_link_just_syms): Define.
7088 * vms.c (vms_bfd_link_just_syms): Define.
7089 * libbfd.h: Regenerate.
7090 * bfd-in2.h: Regenerate.
7094 * elf32-mips.c: Remove superfluous definitions copied from
7096 (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the
7097 SGIish vectors to check the special case.
7098 (mips_elf_hi16_reloc): Fix comment.
7099 (mips_elf_got16_reloc): Likewise.
7100 (_bfd_mips_elf32_gprel16_reloc): Likewise.
7101 (elf_reloc_map): Code cleanup.
7102 (mips_reloc_map): Add comment.
7103 (bfd_elf23_bfd_reloc_type_lookup): Code cleanup.
7104 (mips_elf32_rtype_to_howto): Likewise.
7105 (mips_elf32_discard_info): Likewise.
7106 (elf32_mips_irix_compat): Invert logic: Only SGIish vectors
7107 lead to IRIX compatibility now.
7111 * elfxx-mips.c: Call it IRIX, not Irix in comments.
7115 * config.bfd (shle-*-netbsdelf*): Add target which includes
7120 * configure.in: Revert 2002-04-07. Instead, auto-configure
7122 * configure: Regenerate.
7123 * config.in: Regenerate.
7124 * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL
7129 * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd
7131 * configure: Regenerate.
7135 * Makefile.am (install-data-local): Install headers to
7136 $(exec_prefix)/include.
7137 * Makefile.in: Regenerate.
7142 * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE. Don't
7147 * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*,
7148 hppa*-*-openbsd*): New targets.
7149 * configure.in (alpha*-*-openbsd*): Set COREFILE.
7150 * configure: Regenerate.
7154 * coff64-rs6000.c (xcoff64_reloc_type_br): New function for
7155 xcoff64_ppc_relocate_section.
7156 * coff-rs6000.c : Extern common xcoff_reloc_type functions.
7157 * libxcoff.h: Common xcoff_reloc_type function declaration.
7161 * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks
7162 added in 2002-05-09 commit.
7164 * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04,
7165 don't look for stubs on all undefined syms.
7169 * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete.
7170 (ppc64_elf_howto_raw <R_PPC64_RELATIVE>): Not pc_relative or
7173 * elf32-i386.c (elf_howto_table): Comments.
7174 (elf_i386_relocate_section): Handle more relocs for relocatable
7175 linking and against SEC_MERGE sections.
7179 * elf32-ppc.c (ppc_elf_create_got): New function.
7180 (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before
7181 _bfd_elf_create_dynamic_sections. Correct .plt flags.
7182 (ppc_elf_check_relocs): Use ppc_elf_create_got in place of
7183 _bfd_elf_create_got_section.
7187 * elf-bfd.h (struct elf_backend_data): Add rela_normal.
7188 * elfxx-target.h (elf_backend_rela_normal): Define.
7189 (elfNN_bed): Init rela_normal.
7190 * elflink.h (elf_link_input_bfd <emit_relocs>): Handle adjustment
7191 for section symbols here if rela_normal. Simplify abs section test.
7192 * elf-m10200.c (mn10200_elf_relocate_section): If relocatable,
7193 return immediately. Remove code handling relocatable linking.
7194 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
7195 * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
7196 * elf32-i370.c (i370_elf_relocate_section): Likewise.
7197 * elf32-i860.c (elf32_i860_relocate_section): Likewise.
7198 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
7199 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
7200 * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
7201 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
7202 * elf32-s390.c (elf_s390_relocate_section): Likewise.
7203 * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
7204 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
7205 * elf64-s390.c (elf_s390_relocate_section): Likewise.
7206 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
7207 * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
7208 * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL.
7209 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
7210 * elf-m10200.c (elf_backend_rela_normal): Define.
7211 * elf-m10300.c (elf_backend_rela_normal): Define.
7212 * elf32-fr30.c (elf_backend_rela_normal): Define.
7213 * elf32-i370.c (elf_backend_rela_normal): Define.
7214 * elf32-i860.c (elf_backend_rela_normal): Define.
7215 * elf32-m68k.c (elf_backend_rela_normal): Define.
7216 * elf32-mcore.c (elf_backend_rela_normal): Define.
7217 * elf32-openrisc.c (elf_backend_rela_normal): Define.
7218 * elf32-ppc.c (elf_backend_rela_normal): Define.
7219 * elf32-s390.c (elf_backend_rela_normal): Define.
7220 * elf32-xstormy16.c (elf_backend_rela_normal): Define.
7221 * elf64-ppc.c (elf_backend_rela_normal): Define.
7222 * elf64-s390.c (elf_backend_rela_normal): Define.
7223 * elf64-x86-64.c (elf_backend_rela_normal): Define.
7224 * elfxx-ia64.c (elf_backend_rela_normal): Define.
7225 * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL.
7226 * elf32-m32r.c (elf_backend_rela_normal): Likewise.
7230 * elf32-arm.h (elf32_arm_final_link_relocate): Convert
7231 'reloc_signed_max' and 'reloc_signed_min' into half-word offsets.
7235 * elflink.h (elf_link_input_bfd <emit_relocs>): Adjust r_offset
7236 when not relocatable. Fix reloc_emitter call for K&R.
7240 * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code
7241 reloading local sym addend mistakenly removed in 2002-05-01 change.
7243 * dwarf2.c (struct line_head): Make prologue_length a bfd_vma.
7244 (read_abbrevs): Change "offset" param to bfd_vma.
7245 (parse_comp_unit): Change "version" and addr_size to unsigned ints.
7246 Change "abbrev_offset" to bfd_vma.
7247 (read_indirect_string): Use correct conversion chars in error
7248 message format string, cast bfd_vma's to unsigned long.
7249 (read_abbrevs): Likewise.
7250 (read_attribute_value): Likewise.
7251 (decode_line_info): Likewise.
7252 (scan_unit_for_functions): Likewise.
7253 (parse_comp_unit): Likewise.
7257 * coffswap.h (coff_swap_reloc_in): Remove XCOFF support.
7258 (coff_swap_reloc_out): Same.
7259 * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h.
7260 (xcoff_swap_reloc_out): Same.
7261 (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special
7262 case some 16 bit relocs. Add reloc value to output.
7263 (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit
7264 R_RBR. Improve names.
7265 (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS.
7266 (bfd_xcoff_backend_data): Update with new reloc swap names.
7267 (bfd_pmac_xcoff_backend_data) : Same.
7268 * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h.
7269 (xcoff64_swap_reloc_out): Same.
7270 (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit
7271 R_POS. Add reloc value to output.
7272 (xcoff64_howto_table): Move 64 bit R_POS to first entry. Add 16
7273 bit R_RBR. Improve names, masks.
7274 (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS.
7275 (bfd_xcoff_backend_data): Update with new reloc swap names.
7276 (bfd_xcoff_aix5_backend_data) : Same.
7280 * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add
7281 bfd_count top_index, input_list, all_local_syms.
7282 (elf32_hppa_setup_section_lists): New function, split from
7283 elf32_hppa_size_stubs.
7284 (elf32_hppa_next_input_section): Likewise.
7285 (group_sections): Likewise.
7286 (get_local_syms): Likewise.
7287 (elf32_hppa_size_stubs): Adjust for split out functions. Look for
7288 stubs on undefined syms too.
7289 (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*.
7290 Only access htab elf fields when we have an elf hash table.
7291 * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare.
7292 (elf32_hppa_next_input_section): Declare.
7296 * opncls.c (_bfd_new_bfd_contained_in): Check return value of
7301 * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
7302 (mips_elf_link_hash_newfunc): Initialize forced_local to false.
7303 (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
7304 to hide a global symbol.
7305 (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
7306 forced_local to true.
7310 * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs
7311 vs SHN_UNDEF to zero.
7315 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_SECTOFF>): Change to a
7317 <R_PPC64_SECTOFF_DS>: Likewise.
7318 (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
7320 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_SECTOFF>): Correct.
7321 (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to
7324 * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete.
7325 (ppc64_elf_ha_reloc): New function.
7326 (ppc64_elf_brtaken_reloc): New function.
7327 (ppc64_elf_sectoff_reloc): New function.
7328 (ppc64_elf_sectoff_ha_reloc): New function.
7329 (ppc64_elf_toc_reloc): New function.
7330 (ppc64_elf_toc_ha_reloc): New function.
7331 (ppc64_elf_toc64_reloc): New function.
7332 (ppc64_elf_unhandled_reloc): New function.
7333 (ppc64_elf_howto_raw): Use the above.
7334 <R_PPC64_RELATIVE>: Mark pc_relative, pcrel_offset.
7335 <R_PPC64_SECTOFF>: Not pc_relative or pcrel_offset. Fix dst_mask.
7336 <R_PPC64_SECTOFF_DS>: Likewise.
7337 (IS_ABSOLUTE_RELOC): Update.
7338 (struct ppc_link_hash_table): Add have_undefweak.
7339 (ppc64_elf_link_hash_table_create): Init.
7340 (func_desc_adjust): Set have_undefweak.
7341 (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier. Only
7342 add the .sfpr blr when have_undefweak.
7343 (ppc64_elf_setup_section_lists): Check hash table flavour.
7344 (ppc64_elf_next_input_section): Move output_section->owner test to
7346 (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param
7347 and relocatable test. Return TOCstart and don't set elf_gp.
7348 (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch
7349 offset calculation. Add assert on weak sym branch tweaks.
7350 * elf64-ppc.h (ppc64_elf_set_toc): Delete.
7351 (ppc64_elf_toc): Declare.
7352 (ppc64_elf_next_input_section): Update.
7356 * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL
7361 * elf64-ppc.c (CROR_151515, CROR_313131): Define.
7362 (ppc64_elf_relocate_section): Use them. Don't look for plt calls
7363 on R_PPC64_ADDR24 relocs. Require a nop or no link reg on plt
7364 call branches. Correct undefined weak destination.
7365 (ppc64_elf_func_desc_adjust): Always create at least one blr in
7366 .sfpr, and correct case where either only savef* or restf* is
7369 Long branch stubs, multiple stub sections.
7370 * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare.
7371 (ppc64_elf_next_input_section): Declare.
7372 * elf64-ppc.c: Move linker-only prototypes.
7373 (STUB_SUFFIX): Define.
7374 (enum ppc_stub_type): New.
7375 (struct ppc_stub_hash_entry): New.
7376 (struct ppc_branch_hash_entry): New.
7377 (struct ppc_link_hash_entry): Add stub_cache, oh.
7378 (struct ppc_link_hash_table): Add stub_hash_table etc. Remove
7379 sstub. Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration.
7380 Rename plt_overflow to stub_error.
7381 (ppc_stub_hash_lookup): Define.
7382 (ppc_branch_hash_lookup): Define.
7383 (stub_hash_newfunc): New function.
7384 (branch_hash_newfunc): New function.
7385 (link_hash_newfunc): Init new fields.
7386 (ppc64_elf_link_hash_table_create): Likewise.
7387 (ppc64_elf_link_hash_table_free): New function.
7388 (ppc_stub_name): New function.
7389 (ppc_get_stub_entry): New function.
7390 (ppc_add_stub): New function.
7391 (create_linkage_sections): Use bfd_make_section_anyway. Create
7392 .branch_lt and .rela.branch_lt sections. Don't create .stub.
7393 (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*,
7394 and set up for plt call stubs. Link func and func desc syms.
7395 (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24.
7396 (func_desc_adjust): Avoid hash lookup when func desc sym available
7397 via shortcut, and set links when processing.
7398 (ppc64_elf_hide_symbol): Likewise.
7399 (allocate_dynrelocs): Don't allocate stub section here.
7400 (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt.
7402 (ppc_type_of_stub): New function.
7403 (build_one_stub): Delete.
7404 (ppc_build_one_stub): New function.
7405 (ppc_size_one_stub): New function.
7406 (ppc64_elf_setup_section_lists): New function.
7407 (ppc64_elf_next_input_section): New function.
7408 (group_sections): New function.
7409 (get_local_syms): New function.
7410 (ppc64_elf_size_stubs): Rewrite.
7411 (ppc64_elf_build_stubs): Rewrite.
7412 (ppc64_elf_relocate_section): Look up stub entry for REL24
7413 relocs. Don't propagate REL14* to dynamic objects. Look for long
7414 branch stubs if REL14* or REL24 relocs won't reach.
7415 (bfd_elf64_bfd_link_hash_table_free): Define.
7419 * config.bfd: Add support for powerpc-*-windiss.
7423 * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT
7424 symbol names into the hash table.
7428 * coff-rs6000.c (xcoff_calculate_relocation) : Function table for
7429 calulating relocations.
7430 (xcoff_complain_overflow) : Function table for relocation errors.
7431 (xcoff_ppc_relocate_section): Use relocation and complain function
7433 (xcoff_complain_overflow_unsigned_func): New complain function.
7434 (xcoff_complain_overflow_signed_func): Same.
7435 (xcoff_complain_overflow_bitfield_func): Same.
7436 (xcoff_complain_overflow_dont_func): Same.
7437 (xcoff_reloc_type_crel): New recot function.
7438 (xcoff_reloc_type_br): Same.
7439 (xcoff_reloc_type_ba): Same.
7440 (xcoff_reloc_type_toc): Same.
7441 (xcoff_reloc_type_rel): Same.
7442 (xcoff_reloc_type_neg): Same.
7443 (xcoff_reloc_type_pos): Same.
7444 (xcoff_reloc_type_fail): Same.
7445 (xcoff_reloc_type_noop): Same.
7446 * libxcoff.h : Declare common parts for xcoff64.
7447 * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation
7448 and complain function tables.
7452 * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo.
7453 * elf32-hppa.c (elf32_hppa_final_link): Formatting.
7457 * opncls.c (bfd_make_readable): Call bfd_section_list_clear.
7458 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
7460 * elflink.h (elf_bfd_final_link): Ensure input bfd class is the
7461 same as the output before calling elf_link_input_bfd.
7463 * coffcode.h (coff_compute_section_file_positions): Set
7464 section_tail after shuffling section list.
7468 * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The
7469 addresses are 23bit with a special layout, not plain 32bit
7470 values. Prevent relocation of immediate values.
7474 * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or
7475 MIPS-16 ASE flags are set, print something to indicate that.
7479 * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition
7480 under which a plt call stub is used.
7481 (final_link_relocate): Similarly.
7482 (allocate_plt_static): Clear h-plabel except when plt entry is
7483 exclusively used for a plabel.
7484 (allocate_dynrelocs): Use the above to simplify plt sizing.
7485 (struct elf32_hppa_link_hash_table): Add has_22bit_branch.
7486 (elf32_hppa_link_hash_table_create): Init.
7488 (hppa_build_one_stub): Use BL22_RP if has_22bit_branch.
7489 (elf32_hppa_check_relocs): Set has_22bit_branch.
7491 * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message.
7492 (final_link_relocate): Likewise.
7496 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build
7497 search table if some FDE is DW_EH_PE_aligned encoded either.
7498 (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially.
7503 * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative.
7504 (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel
7505 encoded personality.
7506 (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality
7507 for CIE/FDE removal.
7511 * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent.
7515 * archures.c (bfd_lookup_arch): Move the list order comment..
7516 (struct bfd_arch_info): ..to where it belongs.
7517 * bfd-in2.h: Regenerate.
7519 * archures.c (bfd_lookup_arch): Add comment on list order.
7520 (bfd_default_set_arch_mach): Use bfd_lookup_arch.
7521 * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default
7522 is always at head of list.
7526 * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9,
7527 insert_thumb_branch, record_thumb_to_arm_glue): Suppress
7528 definition of these functions for ARM_WINCE builds as they are
7530 (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define
7531 for ARM_WINCE builds.
7535 * coff-arm.c (bfd_arm_process_before_allocation):
7539 * cpu-sh.c (scan_mach): Delete.
7540 (arch_info_struct): Replace scan_mach with bfd_default_scan.
7541 (bfd_sh_arch): Likewise.
7545 * ihex.c (ihex_write_object_contents): Fix check for records
7546 crossing 64K boundaries.
7550 * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table
7551 type rather than just assuming entries are ELF.
7552 * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
7553 * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
7554 * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise.
7555 * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry
7556 rather than elf_link_hash_entry.
7560 * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow
7565 * opncls.c (bfd_close): Write contents if writeable.
7566 Minor formatting tidy-ups.
7570 * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.
7574 * bfd-in.h (bfd_get_section_lma): New access macro.
7575 Minor white-space fix-up.
7579 * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or
7584 * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks.
7588 * coffcode.h (coff_read_word): New.
7589 (coff_compute_checksum): New.
7590 (coff_apply_checksum): New.
7591 (coff_write_object_contents): Call coff_apply_checksum () to
7592 apply checksum to PE image.
7596 * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h.
7597 (elf32_hppa_final_link): Split out sorting logic to..
7598 * elf-hppa.h (elf_hppa_sort_unwind): ..here.
7599 (elf_hppa_final_link): Call elf_hppa_sort_unwind.
7603 * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]*
7605 * configure: Re-generate.
7609 * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version
7610 is greater or equal to 4.3.3.
7611 * configure: Regenerate.
7616 * elf32-cris.c (cris_elf_howto_table) <R_CRIS_16_PCREL,
7617 R_CRIS_32_PCREL>: Fix typo in name.
7618 (cris_elf_check_relocs): Always create .rela.got here when
7619 R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen.
7620 (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here;
7621 assume it's created.
7625 * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
7626 * aout-target.h (MY_bfd_link_hash_table_free): Conditionally
7628 * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
7629 * bfd.c (bfd_link_hash_table_free): Define.
7630 * binary.c (binary_bfd_link_hash_table_free): Define.
7631 * bout.c (b_out_bfd_link_hash_table_free): Define.
7632 * coff-rs6000.c (rs6000coff_vec): Include
7633 _bfd_generic_link_hash_table_free.
7634 (pmac_xcoff_vec): Likewise.
7635 * coff64-rs6000.c (rs6000coff64_vec): Likewise.
7636 (aix5coff64_vec): Likewise.
7637 * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
7638 * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
7639 (bfd_elf32_bfd_link_hash_table_free): Define.
7640 * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
7641 (bfd_elf32_bfd_link_hash_table_free): Define.
7642 * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
7644 * i386msdos.c (msdos_bfd_link_hash_table_free): Define.
7645 * i386os9k.c (os9k_bfd_link_hash_table_free): Define.
7646 * ieee.c (ieee_bfd_link_hash_table_free): Define.
7647 * ihex.c (ihex_bfd_link_hash_table_free): Define.
7648 * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
7649 (_bfd_generic_link_hash_table_free): Add prototype.
7650 * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
7651 * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
7652 * linker.c (_bfd_generic_link_hash_table_free): New function.
7653 * mmo.c (mmo_bfd_link_hash_table_free): Define.
7654 * nlm-target.h (nlm_bfd_link_hash_table_free): Define.
7655 * oasys.c (oasys_bfd_link_hash_table_free): Define.
7656 * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
7657 * som.c (som_bfd_link_hash_table_free): Define.
7658 * srec.c (srec_bfd_link_hash_table_free): Define.
7659 * tekhex.c (tekhex_bfd_link_hash_table_free): Define.
7660 * versados.c (versados_bfd_link_hash_table_free): Define.
7661 * vms.c (vms_bfd_link_hash_table_free): New function.
7662 * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
7664 * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
7665 instead of bfd_alloc.
7666 * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
7667 * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
7668 * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
7669 * cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
7670 * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
7671 * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
7672 * elf.c (_bfd_elf_link_hash_table_create): Likewise.
7673 * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
7674 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
7675 * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
7676 * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
7677 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
7678 * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
7679 * elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
7680 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
7681 * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
7682 * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
7683 * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
7684 * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
7685 * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
7686 * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
7687 * linker.c (_bfd_generic_link_hash_table_create): Likewise.
7688 * m68klinux.c (linux_link_hash_table_create): Likewise.
7689 * sparclinux.c (linux_link_hash_table_create): Likewise.
7690 * sunos.c (sunos_link_hash_table_create): Likewise.
7691 * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
7693 * targets.c: Add _bfd_link_hash_table_free to xvec.
7695 * bfd-in2.h: Regenerate.
7696 * libbfd.h: Regenerate.
7697 * libcoff.h: Regenerate.
7701 * dep-in.sed: Cope with absolute paths.
7702 * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR.
7704 * Makefile.in: Regenerate.
7705 * coff-arm.c: Fix copyright date.
7706 * cpu-h8300.c: Likewise.
7707 * cpu-i370.c: Likewise.
7708 * cpu-s390.c: Likewise.
7709 * cpu-mips.c: Likewise.
7710 * po/SRC-POTFILES.in: Regenerate.
7714 * Makefile.am: Add elfxx-mips.c to the known backends.
7715 (elf32-mips.lo): remove dependency to coff/external.h.
7716 * Makefile.in: Regenerate.
7717 * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo
7718 Remove elf32-mips.lo from 64 bit vectors. Update dependencies
7720 * configure: Regenerate.
7721 * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h.
7722 (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c.
7723 (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New
7724 MIPS specific backend functions.
7725 * elf32-mips.c: Moved most code to elfxx-mips.c.
7726 (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make
7728 (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc.
7729 (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc.
7730 (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc.
7731 (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed
7732 interface to allow selection of the right REL or RELA howto table.
7733 (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made
7734 static. Let it refuse n32 objects.
7735 (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus.
7736 (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo.
7737 (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info.
7738 (elf32_mips_ignore_discarded_relocs): Rename from
7739 _bfd_elf32_mips_ignore_discarded_relocs.
7740 (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section.
7741 (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT.
7742 (elf_mips_howto_table_rela): Remove.
7743 * elf64-mips.c: Moved most code to elfxx-mips.c.
7744 (bfd_elf64_bfd_reloc_type_lookup): Make static.
7745 (mips_elf64_rtype_to_howto): New function.
7746 (mips_elf64_object_p): Likewise.
7747 (elf64_mips_irix_compat): Likewise.
7748 * elfxx-mips.c: New file containing common code merged together from
7749 elf32-mips.c and elf64-mips.c.
7750 * elfxx-mips.h: New file containing MIPS specific prototypes from
7752 * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and
7753 elf_backend_mips_rtype_to_howto.
7757 * srec.c (MAXCHUNK, Chunk): Revise comments.
7758 (srec_write_record): Correct buffer size.
7759 (srec_write_header): Do without intermediate buffer.
7760 (srec_write_section): Validate Chunk.
7761 (srec_write_terminator): Pass NULL instead of dummy buffer.
7762 (srec_write_symbols): Pass file and symbol names directly to
7763 bfd_bwrite so sprintf won't overflow buffer.
7767 * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic
7768 PC relative relocs against hidden symbols.
7769 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
7773 * elf.c (_bfd_elf_make_section_from_shdr): When setting section
7774 LMAs, loop over segments until p_vaddr and p_memsz specify an
7775 extent enclosing the section.
7779 * ihex.c (ihex_write_object_contents): Do not allow records to
7780 cross a 64K boundary - wrap if necessary.
7784 * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error
7785 which caused the returned LWP ID to always be 0.
7789 * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
7790 (elf32_sparc_relocate_section): Use it to figure out when to
7791 initialize .got entries.
7792 * elf64-sparc.c: Similarly.
7796 * linker.c (link_action): Ignore duplicate warning syms.
7797 (_bfd_generic_link_write_global_symbol): Follow warning symbol link.
7798 * elflink.h (elf_adjust_dynstr_offsets): Likewise.
7799 (elf_adjust_dynamic_symbol): Likewise.
7800 (elf_export_symbol): Likewise.
7801 (elf_link_find_version_dependencies): Likewise.
7802 (elf_link_assign_sym_version): Likewise.
7803 (elf_link_sec_merge_syms): Likewise.
7804 (elf_link_output_extsym): Likewise.
7805 (elf_gc_sweep_symbol): Likewise.
7806 (elf_gc_propagate_vtable_entries_used): Likewise.
7807 (elf_gc_smash_unused_vtentry_relocs): Likewise.
7808 (elf_gc_allocate_got_offsets): Likewise.
7809 (elf_collect_hash_codes): Likewise.
7810 * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise.
7811 * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
7812 (elf_hppa_remark_useless_dynamic_symbols): Likewise.
7813 * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
7814 * elf32-arm.h (elf32_arm_discard_copies): Likewise.
7815 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise.
7816 (elf_cris_discard_excess_dso_dynamics): Likewise.
7817 * elf32-hppa.c (clobber_millicode_symbols): Likewise.
7818 (mark_PIC_calls): Likewise.
7819 (allocate_plt_static): Likewise.
7820 (allocate_dynrelocs): Likewise.
7821 (readonly_dynrelocs): Likewise.
7822 * elf32-i386.c (allocate_dynrelocs): Likewise.
7823 (readonly_dynrelocs): Likewise.
7824 * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
7825 * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
7826 * elf32-mips.c (mips_elf_output_extsym): Likewise.
7827 (mips_elf_sort_hash_table_f): Likewise.
7828 (mips_elf_check_mips16_stubs): Likewise.
7829 * elf32-s390.c (allocate_dynrelocs): Likewise.
7830 (readonly_dynrelocs): Likewise.
7831 * elf32-sh.c (sh_elf_discard_copies): Likewise.
7832 * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise.
7833 (xstormy16_relax_plt_realloc): Likewise.
7834 * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
7835 (elf64_alpha_output_extsym): Likewise.
7836 * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise.
7837 * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise.
7838 (mips_elf64_check_mips16_stubs): Likewise.
7839 (mips_elf64_output_extsym): Likewise.
7840 * elf64-ppc.c (func_desc_adjust): Likewise.
7841 (allocate_dynrelocs): Likewise.
7842 (readonly_dynrelocs): Likewise.
7843 * elf64-s390.c (allocate_dynrelocs): Likewise.
7844 (readonly_dynrelocs): Likewise.
7845 * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
7846 * elf64-x86-64.c (allocate_dynrelocs): Likewise.
7847 (readonly_dynrelocs): Likewise.
7848 * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise.
7849 * aoutx.h (aout_link_write_other_symbol): Likewise.
7850 * cofflink.c (_bfd_coff_write_task_globals): Likewise.
7851 (_bfd_coff_write_global_sym): Likewise.
7852 * i386linux.c (linux_tally_symbols): Likewise.
7853 * m68klinux.c (linux_tally_symbols): Likewise.
7854 * sparclinux.c (linux_tally_symbols): Likewise.
7855 * pdp11.c (aout_link_write_other_symbol): Likewise.
7856 * sunos.c (sunos_scan_dynamic_symbol): Likewise.
7857 * xcofflink.c (xcoff_build_ldsyms): Likewise.
7858 (xcoff_write_global_symbol): Likewise.
7860 * cofflink.c (_bfd_coff_final_link): Formatting.
7861 * cpu-mips.c (mips_compatible): Make static, prototype.
7862 * elf32-i386.c (elf_i386_check_relocs): Formatting.
7863 * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
7864 * elf64-alpha.c (elf64_alpha_output_extsym): Likewise.
7865 * elf64-mips.c (mips_elf64_sort_hash_table): Likewise.
7866 (mips_elf64_final_link): Likewise.
7867 * elflink.h (elf_link_find_version_dependencies): Remove duplicate
7872 * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define.
7873 (SWAP_OUT_RELOC_OFFSET): Define.
7877 * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for
7878 terminating NULL if empty symbol table.
7879 (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise.
7883 * elflink.h (elf_link_input_bfd): Revert the last change since
7884 the gcc exception handling isn't fixed yet.
7888 * elflink.h (elf_link_input_bfd): Complain about relocations
7889 against local symbols in discarded sections.
7893 * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections.
7897 * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
7898 section file offset for !SEC_LOAD sections.
7902 * elf32-arm.h (elf32_arm_final_link_relocate <case R_ARM_GOTOFF>,
7903 <case R_ARM_GOT>): Handle relocations to Thumb functions.
7907 * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
7909 * archive.c: Update copyright date.
7910 * bfd-in2.h: Regenerate.
7911 * libbfd.h: Regenerate.
7912 * Makefile.am: Run "make dep-am"
7913 * Makefile.in: Regenerate.
7914 * po/SRC-POTFILES.in: Regenerate.
7918 * dwarf2.c (struct funcinfo): Move up.
7919 (lookup_address_in_function_table): New argument function_ptr.
7921 (lookup_address_in_line_table): New argument function. If function
7922 is non-NULL, use it to handle ``addr'' before the first line note of
7924 (comp_unit_find_nearest_line): Update and swap calls to
7925 lookup_address_in_function_table and lookup_address_in_line_table.
7926 * syms.c (_bfd_stab_section_find_nearest_line): Use the first
7927 N_SLINE encountered if we see an N_FUN before any N_SLINE.
7931 * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from
7932 _bfd_xcoff_generic_stat_arch_elt. Fix format check.
7933 * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt.
7937 * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all
7938 dynamic objects in archives.
7942 * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set
7943 STT_NOTYPE symbols to STT_OBJECT.
7947 * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64"
7951 * aix5ppc.core.c : New file for AIX 5 64 bit core support.
7952 * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
7953 * coff-rs6000 (do_pad) : New function for archive padding.
7954 (do_copy) : New function for object file copying in archives.
7955 (do_shared_object_padding) : New function for padding shared
7956 objects to their text section alignment in archives.
7957 (bfd_xcoff_ar_achive_set_magic) : Stub.
7958 (xcoff_write_armap_big) : Use do_copy and do_pad.
7959 (xcoff_write_archive_contents_big) : Use do_shared_object_padding,
7961 * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
7962 bfd_xcoff_magic_number.
7963 (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
7965 (xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
7966 (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
7967 (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
7968 * rs6000-core.c : Update copyright date.
7969 * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
7971 * coffcode.h (coff_new_section_hook) : Use new accessor macros.
7972 (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
7973 (coff_set_flags) : Use bfd_xcoff_magic_number.
7974 * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
7975 * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
7976 * Makefile.am : Same.
7977 * config.bfd : Same.
7979 * configure : Regnerate.
7980 * Makefile.in : Same.
7985 * po/fr.po: Updated version.
7989 * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success.
7990 * libbfd.h: Regenerate.
7991 * archive.c (coff_write_armap): Pass on failures from
7992 bfd_write_bigendian_4byte_int.
7996 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD
7997 error to bfd_error_nonrepresentable_section for reinit_array
8002 * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag,
8003 OR it in rather than replacing previously selected flags.
8005 * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15.
8006 (TARGET_LITTLE_SYM): Set ar_max_namelen to 15.
8010 * cpu-mips.c (mips_compatible): New. Don't check bits_per_word.
8012 * elflink.h (elf_bfd_final_link): Revert last change. Instead,
8013 ensure reloc size matches before calling elf_link_input_bfd.
8014 Add an assert to check reloc size when counting output relocs.
8018 * mmo.c (mmo_get_loc): Return NULL rather than false.
8022 * po/fr.po: Updated version.
8026 * archures.c (bfd_default_compatible): Test bits_per_word.
8027 * cpu-i386.c (i386_compatible): Remove. Replace occurrences with
8028 bfd_default_compatible.
8029 * cpu-i370.c (i370_compatible): Likewise.
8030 * cpu-sparc.c (sparc_compatible): Likewise.
8031 * cpu-h8300.c (compatible): Test in->arch == out->arch.
8033 * elflink.h: Formatting fixes.
8034 (elf_link_output_extsym): Merge undefined and undef weak cases.
8036 * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd
8037 when word size of input matches output word size.
8041 * cpu-i386.c (i386_compatible): New. Use it instead of
8042 bfd_default_compatible.
8046 * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type
8047 as the type for bfd_reloc_val.
8051 * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function.
8052 (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols.
8053 (elf_hppa_final_link_relocate): Correct relocations for indirect
8054 references to local data through the DLT. Fix .opd creation for
8055 local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64
8056 relocations. Use e_lsel selector for R_PARISC_DLTIND21L,
8057 R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per
8058 "Processor-Specific ELF for PA_RISC, Version 1.43" document.
8059 Similarly, use e_rsel for DLT and LTOFF 'R' relocations.
8060 * elf32-hppa.c (final_link_relocate): Revise relocation selectors
8061 as per "Processor-Specific ELF for PA_RISC, Version 1.43" document.
8065 * merge.c (_bfd_merge_sections): Don't segfault if there
8066 is nothing to merge due to GC.
8070 * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep
8071 symbols that have been forced local.
8073 * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym
8074 to output forced local syms for non-shared link.
8075 (elf_link_output_extsym): Tweak condition for calling backend
8076 adjust_dynamic_symbol so that previous behaviour is kept.
8077 Whitespace changes throughout file.
8081 * elf.c (bfd_section_from_shdr): Handle special sections,
8082 .init_array, .fini_array and .preinit_array.
8083 (elf_fake_sections): Likewise.
8085 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the
8086 DT entry only if the section is in output for .init_array,
8087 .fini_array and .preinit_array. Complain about .preinit_array
8089 (elf_bfd_final_link): Warn zero size for .init_array,
8090 .fini_array and .preinit_array sections.
8092 * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove
8093 SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
8094 (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and
8099 * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment.
8100 * configure: Regenerate.
8104 * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with
8106 * coff-rs6000.c (xcoff_howto_table): Same.
8110 * elflink.h (size_dynamic_sections): If section named
8111 ".preinit_array" exists, create DT_PREINIT_ARRAY and
8112 DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for
8113 ".init_array" and ".fini_array".
8114 (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ,
8115 DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and
8120 * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local
8125 * elf64-hppa.h: Update copyright date.
8127 * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix.
8128 (ppc64_elf_relocate_section): Don't generate power4 style branch
8129 hints for *_BRTAKEN and *_BRNTAKEN relocs.
8133 * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my
8135 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
8139 * elf64-x86-64.c: Major rework that introduces all recent changes
8140 to the x86-64 backend. Get a closer match to elf32-i386.
8141 (struct elf64_x86_64_dyn_relocs): Rename from
8142 elf64_x86_64_pcrel_relocs_copied, add additional fields. Change
8144 (struct elf64_x86_64_link_hash_table): Add short cuts to some
8146 (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc,
8147 remove casts, initialize new hash members.
8148 (create_got_section): New.
8149 (elf64_x86_64_create_dynamic_sections): New.
8150 (elf64_x86_64_copy_indirect_symbol): New.
8151 (elf64_x86_64_check_relocs): Don't allocate space for dynamic
8152 relocs, .got or .relgot here but do it in allocate_dynrelocs.
8153 Reference count possible .plt and .got entries. Don't test input
8154 section SEC_READONLY here to try to avoid copy relocs, and keep
8155 dyn_relocs regardless of ELF_LINK_NON_GOT_REF. Don't set
8156 DF_TEXTREL here. Delay setting of variables until needed. Cache
8157 pointer to "sreloc" section in elf_section_data. Tweak condition
8158 under which .got created. Report files with bad relocation
8160 (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
8161 Reference count possible .plt entries. Don't deallocate .got and
8163 (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc. Don't
8164 do copy reloc processing for weakdefs. Remove redundant casts and
8165 aborts. Delay setting of vars until needed. Move creation of
8166 dynamic symbols and allocation of .plt and .rela.plt to
8167 allocate_dynrelocs. Replace BFD_ASSERT with abort.
8168 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New.
8169 (allocate_dynrelocs): New.
8170 (readonly_dynrelocs): New.
8171 (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs.
8172 Allocate space for dyn relocs. Replace BFD_ASSERT with abort.
8173 Zero out the dynamic allocated content space.
8174 (elf64_x86_64_discard_copies): Removed.
8175 (elf64_x86_64_relocate_section): Make use of dynamic section
8176 short-cuts. Localise vars, and delay setting. Better error
8177 reporting, replace BFD_ASSERT with abort. Check
8178 ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the
8179 regular object file and tread the weak definition as the normal
8180 one. Don't discard relocs for undefweak or undefined symbols and
8181 check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy
8183 (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for
8184 symbols that have been forced local. Use same test to decide if
8185 we can use a relative reloc for got as relocate_section. Expand
8186 SHN_UNDEF comment. Move expressions out of function calls.
8187 Replace BFD_ASSERT with abort.
8188 (bfd_elf64_bfd_final_link): Removed.
8189 (elf_backend_copy_indirect_symbol): Define.
8193 * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA.
8194 (_bfd_xcoff_reloc_type_lookup): Use it.
8195 * coff64-rs6000.c (xcoff64_howto_table): Same.
8196 (xcoff64_reloc_type_lookup): Same.
8200 * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are
8205 * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31.
8206 (bfd_mach_s390_esame): Rename to bfd_mach_s390_64.
8207 * bfd-in2.h: Regenerate.
8208 * cpu-s390.c (arch_info_struct): Use renamed architecture defines.
8209 Replace architecture name "s390" with "s390:31-bit" and "s390:esame"
8211 * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations.
8212 (elf_s390_reloc_type_lookup): Likewise.
8213 (elf_s390_check_relocs): Likewise.
8214 (elf_s390_gc_sweep_hook): Likewise.
8215 (elf_s390_relocate_section): Likewise.
8216 (elf_s390_object_p): Use renamed architecture define.
8217 * elf64-s390.c (elf_s390_object_p): Use renamed architecture define.
8221 * syms.c (stt[]): Sorted. Added .init/.fini -> "t" mapping.
8225 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable
8226 absptr -> pcrel optimization for shared libs.
8227 Only create minimal .eh_frame_hdr if absptr FDE encoding in shared
8228 library cannot be converted to pcrel.
8229 (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr
8231 * elf32-i386.c (elf_i386_relocate_section): If
8232 _bfd_elf_section_offset returned -2, skip, but make sure the
8233 relocation is installed.
8234 * elf32-arm.h (elf32_arm_final_link_relocate): Likewise.
8235 * elf32-cris.c (cris_elf_relocate_section): Likewise.
8236 * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
8237 * elf32-i370.c (i370_elf_relocate_section): Likewise.
8238 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
8239 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
8240 * elf32-s390.c (elf_s390_relocate_section): Likewise.
8241 * elf32-sh.c (sh_elf_relocate_section): Likewise.
8242 * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
8243 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
8244 * elf64-s390.c (elf_s390_relocate_section): Likewise.
8245 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
8246 * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
8247 * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
8248 * elf64-alpha.c (elf64_alpha_relocate_section): Handle
8249 _bfd_elf_section_offset returning -2 the same way as -1.
8250 * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise.
8251 * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME
8253 * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise.
8257 * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support.
8258 (bfd_xcoff_size_dynamic_sections): Same.
8259 * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same.
8260 (bfd_xcoff_size_dynamic_sections): Same.
8261 * coff-rs6000.c (xcoff_generate_rtinit): Same.
8262 * coff-rs646000.c (xcoff64_generate_rtinit): Same.
8263 * libxcoff.h (struct xcoff_backend_data_rec): Same.
8264 * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean.
8265 * bfd-in2.h: Regenerate.
8269 * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define.
8270 (struct ppc_link_hash_table): Add sfpr.
8271 (ppc64_elf_link_hash_table_create): Init it.
8272 (ppc64_elf_create_dynamic_sections): Split creation of .stub and
8274 (create_linkage_sections): ..here. Make .sfpr too.
8275 (ppc64_elf_check_relocs): Call create_linkage_sections, and set
8277 (MIN_SAVE_FPR, MAX_SAVE_FPR): Define.
8278 (ppc64_elf_func_desc_adjust): Look for missing ._savef* and
8279 ._restf* functions, and create as needed.
8280 (func_desc_adjust): Only force_local for shared libs.
8284 * configure.in: Bump version number post 2.12 branching.
8285 * configure: Regenerate.
8289 * mmo.c: Correct and improve comments.
8290 (mmo_write_chunk): Store trailing byte in bfd buffer; don't
8291 zero-pad. Use input to fill up non-empty bfd buffer.
8292 (mmo_flush_chunk): New function.
8293 (mmo_write_loc_chunk): Add parameter last_vmap, all callers
8294 changed. Don't emit location specifier if VMA is same as
8295 *LAST_VMAP after omitting leading zero contents. Call
8296 mmo_flush_chunk before emitting location specifier.
8297 (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished
8298 with mmo_write_loc_chunk calls.
8299 (mmo_internal_write_section): Call mmo_flush_chunk after
8301 (mmo_write_symbols_and_terminator): Move :Main to first position
8302 in symbol array. Add faked one if it does not exist if there are
8303 other symbols. Don't add it if there are no symbols at all. Move
8304 out test for value of :Main from symbol loop. Rename table
8305 fakemain to maintable and variable mainsym to fakemain.
8309 * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target
8310 section with no got matches any got. Simplify error generaion.
8314 Support arbitrary length fill patterns.
8315 * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc.
8316 (_bfd_default_link_order): Remove bfd_fill_link_order code.
8317 Call default_data_link_order.
8318 (default_fill_link_order): Delete.
8319 (default_data_link_order): New function.
8320 * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences
8321 of bfd_fill_link_order with bfd_data_link_order.
8322 * elf64-alpha.c (elf64_alpha_final_link): Likewise.
8323 * elf64-mips.c (mips_elf64_final_link): Likewise.
8325 * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value.
8326 Correct value returned in "end" for "0x<non-hex>".
8330 * cpu-arm.c (processors): Replace 'arch' field with 'mach'.
8331 (scan): Test against 'mach' field in info structure.
8335 * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD.
8339 * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize
8344 * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on
8345 non-zero physical addresses when adjusting the LMAs of new
8350 * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped
8351 from _bfd_elf_hppa_gen_reloc_type.
8352 (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype.
8353 * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype.
8354 * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h.
8355 * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype.
8359 * elf-m10300.c (mn10300_elf_relax_section): Skip section before
8360 loading its contents if there's nothing to do in it.
8364 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
8367 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic
8368 DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
8369 (ppc64_elf_finish_dynamic_sections): Set values for them.
8373 * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
8374 * elf.c (elfcore_grok_pstatus): Add prototype.
8375 (elfcore_grok_lwpstatus): Add prototype.
8376 (elfcore_write_lwpstatus): New function.
8377 (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
8381 * elf32-sh.c: Added missing prototypes.
8382 * elf32-sh64.c: Likewise.
8383 (sh_elf_align_loads): Mark unused args as such.
8384 * elf64-sh64.c: Added missing prototypes.
8385 (struct elf_sh64_link_hash_entry): Fix typo.
8386 (sh_elf64_relocate_section): Fix info argument passed to
8387 _bfd_elf_section_offset.
8391 * Makefile.am: "make dep-am".
8392 * Makefile.in: Regenerate.
8393 * aclocal.m4: Regenerate.
8394 * config.in: Regenerate.
8395 * configure: Regenerate.
8399 * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized
8401 * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned
8403 * trad-core.c (trad_unix_core_file_p): Silence pointer/integer
8404 cast warnings for the common case.
8408 * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64
8410 (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64
8415 * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP.
8416 (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise.
8417 (elf64_alpha_relocate_section): Likewise.
8418 * reloc.c (BFD_RELOC_ALPHA_BRSGP): New.
8419 * bfd-in2.h, libbfd.h: Rebuild.
8423 * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check
8424 that base-plus-offset reloc accounting is consistent.
8425 (mmix_elf_relax_section): Keep base-plus-offset reloc accounting
8426 up to date for undefined symbols.
8432 * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela
8433 sections for the O32 ABI.
8437 * elf32-arm.h: Fix formatting of _("...").
8438 * elf32-d10v.c: Likewise.
8439 * elf32-m68k.c: Likewise.
8440 * elf32-mips.c: Likewise.
8444 * coff-or32.c: Fix compile time warning messages.
8448 Contribute sh64-elf.
8450 * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16,
8451 R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16,
8452 R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16,
8453 R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16,
8454 R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16,
8455 R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16,
8456 R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16,
8457 R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8,
8458 R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64):
8460 * libbfd.h, bfd-in2.h: Rebuilt.
8461 * elf32-sh.c (sh_elf_howto_table): Define new relocs.
8462 (sh_reloc_map): Map them.
8463 (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le,
8464 elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be,
8465 elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry,
8466 elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset,
8467 elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset,
8468 elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset,
8469 movi_shori_putval) [INCLUDE_SHMEDIA]: New.
8470 (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add
8471 datalabel_got_offset.
8472 (sh_elf_link_hash_newfunc): Initialize it.
8473 (sh_elf_relocate_section): Augment the scope of
8474 seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT,
8475 GOT and GOTOFF handling to new SHmedia relocation types. Support
8477 (sh_elf_check_relocs): Likewise.
8478 (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in
8479 PLT entries using movi_shori_putval. Support GOT_BIAS.
8480 (sh_elf_finish_dynamic_sections): Likewise.
8481 * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to
8482 relocation, it's now done by the caller.
8484 * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt,
8485 elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset,
8486 elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset,
8487 elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER,
8488 elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry,
8489 elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse,
8490 sh64_elf64_hash_table): New.
8491 (sh_elf64_howto_table): Introduce new relocs.
8492 (sh_elf64_info_to_howto): Accept new PIC relocs.
8493 (sh_elf64_relocate_section): Augment the scope of
8494 seen_stt_datalabel. Support new PIC relocs.
8495 (sh_elf64_check_relocs): Support new PIC relocs.
8496 (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le,
8497 elf_sh64_plt_entry_be, elf_sh64_plt_entry_le,
8498 elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le,
8499 elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry,
8500 sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create,
8501 movi_shori_putval, movi_3shori_putval,
8502 sh64_elf64_create_dynamic_sections,
8503 sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies,
8504 sh64_elf64_size_dynamic_sections,
8505 sh64_elf64_finish_dynamic_symbol,
8506 sh64_elf64_finish_dynamic_sections): New.
8507 (elf_backend_create_dynamic-sections,
8508 bfd_elf64_bfd_link_hash_table_create,
8509 elf_backend_adjust_dynamic_symbol,
8510 elf_backend_size_dynamic_sections,
8511 elf_backend_finish_dynamic_symbol,
8512 elf_backend_finish_dynamic_sections, elf_backend_want_got_plt,
8513 elf_backend_plt_readonly, elf_backend_want_plt_sym,
8514 elf_backend_got_header_size, elf_backend_plt_header_size):
8517 * elf32-sh.c: Renumbered and renamed some SH5 relocations to
8518 match official numbers and names; moved unmaching ones to the
8520 * elf32-sh64.c, elf64-sh64.c: Likewise.
8522 * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia
8525 * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must
8527 * elf64-sh64.c (sh_elf64_relocate_section): Ditto.
8529 * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define.
8530 (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a
8531 .cranges section with SEC_SORT_ENTRIES set.
8532 (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an
8533 incoming sorted .cranges section.
8534 (sh64_bfd_elf_copy_private_section_data): New.
8535 (sh64_elf_final_write_processing): Only sort .cranges and modify
8536 start address if called by linker.
8538 * elf32-sh64.c (sh64_elf_final_write_processing): Activate
8539 Hans-Peter Nilsson's set bit 0 patch from 2001-01-06.
8540 * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto.
8542 * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of
8543 line. Add comments before all entries.
8544 <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct and clarify describing
8546 (sh_elf64_reloc): Correct head comment.
8547 (sh_elf64_relocate_section): Correct spacing.
8548 <relocating for a local symbol>: Do not honour STO_SH5_ISA32;
8549 instead call reloc_dangerous callback.
8550 <case R_SH_SHMEDIA_CODE>: New case.
8551 (sh_elf64_gc_mark_hook): Correct spacing.
8552 (sh_elf64_check_relocs): Ditto.
8553 * elf32-sh64.c (shmedia_prepare_reloc) <case R_SH_SHMEDIA_CODE>:
8555 * elf32-sh.c: Correct #endif comments for #ifndef-wrapped
8557 (sh_elf_howto_table) <R_SH_PT_16, R_SH_SHMEDIA_CODE>: Correct,
8558 clarify describing comment. Add comments before all entries.
8559 (sh_elf_relocate_section) <relocating for a local symbol>: Do not
8560 honour STO_SH5_ISA32; instead call reloc_dangerous callback.
8562 Sort .cranges section in final link. Prepare to set bit 0 on
8564 * elf32-sh64.c (struct sh64_find_section_vma_data): New.
8565 (sh64_elf_link_output_symbol_hook): Fix typo in prototype.
8566 (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming
8568 (sh64_backend_section_from_shdr): New, to recognize
8569 SHT_SH5_CR_SORTED on incoming .cranges section.
8570 (elf_backend_section_from_shdr): Define.
8571 (sh64_elf_final_write_processing): Sort outgoing .cranges
8572 section. (New, temporarily disabled:) Set bit 0 on entry address
8573 according to ISA type.
8574 (sh64_find_section_for_address): New.
8575 (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb,
8576 crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c.
8577 (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c. Use
8578 bfd_malloc, not xmalloc.
8579 (sh64_get_contents_type): Move here from opcodes/sh64-dis.c. Make
8581 * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but
8582 temporarily disabled) setting bit 0 on entry address.
8583 (elf_backend_final_write_processing): Define.
8585 * elf32-sh.c (sh_elf_howto_table) <R_SH_PT_16>: Adjust fields to
8586 be a proper relocation for PTA and PTB rather than a marker.
8587 <R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2,
8588 R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16,
8589 R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16,
8590 R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL,
8591 R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL>:
8593 * elf64-sh64.c: Ditto.
8594 (sh_elf64_relocate_section) <case R_SH_PT_16>: New case.
8595 * elf32-sh64.c: Include opcodes/sh64-opc.h
8596 (shmedia_prepare_reloc): Take a bfd_link_info pointer as first
8597 argument. Drop const qualifiers from "bfd *" and "bfd_byte *"
8598 parameters. No unused parameters. Caller changed.
8599 <case R_SH_PT_16>: New case.
8600 * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h.
8601 * Makefile.in: Regenerate.
8603 * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for
8605 (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
8606 (sh64_elf_merge_private_data): Ditto.
8607 * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data
8608 to access stored section flags.
8609 (sh64_elf_final_write_processing): Return immediately unless
8610 called by linker. Use sh64_elf_section_data (cranges) to get size
8611 of linker-generated cranges entries.
8612 (sh64_elf_copy_private_data): Add missing "return true".
8613 (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5.
8614 (sh_elf64_merge_private_data): Ditto.
8616 * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of
8617 elf64-sh64.c:sh64_elf_fake_sections.
8618 (elf_backend_fake_sections): Define as sh64_elf64_fake_sections.
8620 * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete.
8621 (sh64_elf_final_write_processing): New.
8622 (elf_backend_final_write_processing): Define.
8623 (sh64_elf_fake_sections): Get header flags from tdata field.
8624 (sh64_elf_copy_private_data): Do not call
8625 sh64_elf_copy_private_data_internal, just copy e_flags field.
8626 (sh64_elf_merge_private_data): Do not call
8627 sh64_elf_copy_private_data_internal.
8629 Remove EF_SH64_ABI64, let ELF size make difference.
8630 Remove SH64-specific BFD section flag.
8631 * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as
8632 containing SHmedia through elf_section_data (asect)->tdata
8633 non-zero, not using a BFD section flag.
8634 (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64.
8635 (sh64_elf_merge_private_data): Similar.
8636 (elf_backend_section_flags): Don't define.
8637 (sh64_elf_backend_section_flags): Delete.
8638 * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64,
8640 (sh_elf64_merge_private_data): Similar.
8641 * section.c (Section flags definitions): Don't define
8643 (bfd-in2.h): Regenerate.
8645 Make DataLabel references work with partial linking.
8646 * elf32-sh64.c: Fix formatting.
8647 (sh64_elf_link_output_symbol_hook): New.
8648 (elf_backend_link_output_symbol_hook): Define to
8649 sh64_elf_link_output_symbol_hook.
8650 (sh64_elf_add_symbol_hook): Make DataLabel symbol just global
8651 undefined if partial linking. Adjust sanity check.
8652 * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New.
8653 (elf_backend_link_output_symbol_hook): Define to
8654 sh64_elf64_link_output_symbol_hook.
8655 (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global
8656 undefined if partial linking. Adjust sanity check.
8658 Implement semantics for inter-file DataLabel references.
8659 * elf64-sh64.c (DATALABEL_SUFFIX): Define.
8660 (sh64_elf64_add_symbol_hook): New.
8661 (sh_elf64_relocate_section): If passing an indirect symbol with
8662 st_type STT_DATALABEL on the way to a symbol with st_other
8663 STO_SH5_ISA32, do not bitor 1 to the relocation.
8664 (elf_backend_add_symbol_hook): Define to
8665 sh64_elf64_add_symbol_hook.
8666 * elf64-sh32.c: Tweak comments.
8667 (DATALABEL_SUFFIX): Define.
8668 (sh64_elf_add_symbol_hook): New.
8669 (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook.
8670 * elf32-sh.c (sh_elf_relocate_section): If passing an indirect
8671 symbol with st_type STT_DATALABEL on the way to a symbol with
8672 st_other STO_SH5_ISA32, do not bitor 1 to the relocation.
8674 Pass through STT_DATALABEL.
8675 * elf32-sh64.c (sh64_elf_get_symbol_type): New.
8676 (elf_backend_get_symbol_type): Define.
8677 * elf64-sh64.c (sh64_elf64_get_symbol_type): New.
8678 (elf_backend_get_symbol_type): Define.
8680 * elf32-sh64.c: Tweak comments.
8681 (sh64_elf_copy_private_data_internal): Add prototype.
8682 (bfd_elf32_bfd_set_private_flags): Define.
8683 (sh64_elf_copy_private_data_internal): Compare machine name, not
8684 textual BFD target name, to check whether to copy section flag
8686 (sh64_elf_merge_private_data): Validize bfd_get_arch_size.
8687 Tweak section-contents-type-mismatch message.
8688 (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers.
8689 Validize reloc-types.
8690 * elf64-sh64.c: New file.
8691 * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare.
8692 * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo.
8693 (BFD64_BACKENDS_CFILES): Add elf64-sh64.c.
8694 Regenerate dependencies.
8695 * Makefile.in: Regenerate.
8696 * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and
8697 bfd_elf64_sh64l_vec.
8698 * configure.in: Handle bfd_elf64_sh64_vec and
8699 bfd_elf64_sh64l_vec.
8700 * configure: Regenerate.
8701 * po/POTFILES.in: Regenerate.
8702 * po/bfd.pot: Regenerate.
8704 * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize
8705 anything else but EF_SH64 and EF_SH64_ABI64.
8706 (sh64_elf_merge_private_data): Emit error for anything else but
8707 EF_SH64 and EF_SH64_ABI64.
8708 * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec
8710 * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and
8711 bfd_elf32_sh64l_vec as a temporary measure.
8712 * configure: Regenerate.
8714 * cpu-sh.c (arch_info_struct): Include sh5 item
8716 * config.bfd (sh64-*-elf*): Do not set targ_cflags.
8717 Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec,
8718 bfd_elf32_shblin_vec and bfd_elf32_shlin_vec.
8719 * elf32-sh64.c: Tweak comments.
8720 (sh64_elf_set_mach_from_flags): Recognize all machine flags that
8721 are proper subsets of SH64 as bfd_mach_sh5. Add EF_SH64_ABI64.
8722 (sh64_elf_copy_private_data_internal): Wrap long line.
8723 (sh64_elf_merge_private_data): Rewrite to allow objects from
8724 SH64 subsets to be linked together.
8725 (INCLUDE_SHMEDIA): Define.
8726 * elf32-sh.c (sh_elf_relocate_section) <local symbol>:
8727 Parenthesize plus-expression inside or-expression.
8728 <global symbol>: Ditto.
8729 (sh_elf_set_mach_from_flags): Remove code refusing
8730 deleted EF_SH64_32BIT_ABI flag.
8732 * elf32-sh.c (sh_elf_howto_table) <R_SH_IMM_LOW16_PCREL,
8733 R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16_PCREL,
8734 R_SH_IMM_HI16_PCREL, R_SH_64_PCREL>: Set pcrel_offset to true.
8735 (sh_elf_relocate_section) <local symbol>: Or 1 in
8736 calculation of relocation if sym->st_other & STO_SH5_ISA32.
8737 <global symbol>: Ditto if h->other & STO_SH5_ISA32.
8738 * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to
8741 * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo.
8742 (BFD32_BACKENDS_CFILES): Add elf32-sh64.c.
8743 Regenerate dependencies.
8744 * Makefile.in: Regenerate.
8745 * archures.c: Add bfd_mach_sh5.
8746 * config.bfd: Map targ_cpu sh* to bfd_sh_arch.
8747 Handle sh64-*-elf*. Set targ_cflags to -DINCLUDE_SHMEDIA.
8748 * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec.
8749 * configure: Regenerate.
8750 * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5,
8751 BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6,
8752 BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2,
8753 BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8,
8754 BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16,
8755 BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16,
8756 BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16,
8757 BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16,
8758 BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations.
8759 * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link
8761 * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items
8763 [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs.
8764 [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call
8765 shmedia_prepare_reloc, goto final_link_relocate if it returns
8766 non-zero, else fail as before.
8767 (sh_elf_set_mach_from_flags): Provide function only if not defined
8768 as macro. Do not recognize objects with EF_SH64_32BIT_ABI set.
8769 (sh_elf_set_private_flags): Provide function only if not defined
8771 (sh_elf_copy_private_data): Similar.
8772 (sh_elf_merge_private_data): Similar.
8773 * section.c (SEC_SH_ISA_SHMEDIA): New.
8774 * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare.
8775 * elf32-sh64.c: New file.
8776 * libbfd.h: Regenerate.
8777 * bfd-in2.h: Regenerate.
8778 * po/POTFILES.in: Regenerate.
8779 * po/bfd.pot: Regenerate.
8780 * bfd-in2.h: Regenerate.
8781 * libbfd.h: Regenerate.
8785 * bfd-in.h: Update <stdbool.h> check to only see if <stdbool.h> has
8786 been included, not drag it in.
8787 * bfd-in2.h: Regenerate.
8791 * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
8792 the mach and ISA fields if necessary.
8796 * coffcode.h (coff_set_arch_mach_hook): Select the highest known
8797 ARM architecture when an F_ARM_5 flag is detected, since we cannot
8798 be sure exactly which architecture this represents.
8802 * po/tr.po: Updated translation.
8807 * archures (bfd_mach_ppc64): Define.
8808 (bfd_powerpc_arch): Rename to bfd_powerpc_archs.
8809 (bfd_powerpc_arch): Define.
8810 * bfd-in2.h: Regenerate.
8811 * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs.
8812 (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs.
8813 (bfd_powerpc_archs): Add default powerpc64 arch.
8817 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs
8818 against section syms in readonly sections. Don't do the global
8819 sym check if we find one.
8820 * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
8821 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
8822 * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
8823 * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
8824 (elf_s390_grok_prstatus): Add missing prototype.
8828 * elf64-mmix.c (mmix_dump_bpo_gregs): New function.
8829 (mmix_elf_check_common_relocs) <case R_MMIX_BASE_PLUS_OFFSET>:
8830 Call bfd_get_section_by_name only once. Initialize
8831 bpodata->n_bpo_relocs_this_section.
8832 (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment
8834 (bpo_reloc_request_sort_fn): Don't use difference of values as
8837 2002-02-02 David O'Brien <obrien@FreeBSD>
8839 * configure.in: Tweak the FreeBSD 4.x recognition more. Only treat
8840 version 4.5 and later the same as 5-CURRENT.
8841 * configure: Re-generate.
8845 * config.bfd (hppa*-*-netbsd*): New target.
8849 * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR
8850 to front of message. Unify messages with elf32-arm.h. Use
8851 commas where neccessary.
8852 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase
8853 ERROR in messages. Unify messages with coff-arm.c. Correct
8854 VFP/FPA error message.
8855 (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and
8856 APCS-32 for translation.
8860 Perform on-demand global register allocation from
8861 R_MMIX_BASE_PLUS_OFFSET relocs.
8862 * elf64-mmix.c (struct bpo_reloc_section_info, struct
8863 bpo_reloc_request, struct bpo_greg_section_info): New.
8864 (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook,
8865 bpo_reloc_request_sort_fn, mmix_elf_relax_section,
8866 _bfd_mmix_check_all_relocs,
8867 _bfd_mmix_prepare_linker_allocated_gregs,
8868 _bfd_mmix_finalize_linker_allocated_gregs): New functions.
8869 (elf_mmix_howto_table): Correct src_mask for most relocs.
8870 (mmix_elf_perform_relocation) <case R_MMIX_BASE_PLUS_OFFSET>: New
8872 (mmix_final_link_relocate) <case R_MMIX_BASE_PLUS_OFFSET>: New
8873 case. Fix typo in comment. New label do_mmix_reloc.
8874 (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to
8875 store first object file with a base-plus-offset reloc. Call
8876 mmix_elf_check_common_relocs for the part common with mmo.
8877 (mmix_elf_final_link): Write out linker-allocated register
8879 (elf_backend_gc_sweep_hook): Define.
8880 (bfd_elf64_bfd_relax_section): Define.
8882 * mmo.c: Don't include <ctype.h>
8883 (mmo_init): Correct init-once logic.
8887 * config.bfd: Conditionally support <aiaff> for pre AIX 4.3.
8891 * Makefile.am: Run "make dep-am"
8892 * Makefile.in: Regenerate.
8894 2002-01-31 David O'Brien <obrien@FreeBSD>
8896 * configure.in: Recognize the differences in core files from FreeBSD
8897 4.{0,1} and later versions of 4.x. This treats 4.2+ the same as
8899 * configure: Regenerate.
8903 * coff-or32.c: New file.
8904 * cpu-or32.c: New file.
8905 * elf32-or32.c: New file.
8906 * archures.c: Add support for or32.
8907 * targets.c: Add support for or32.
8908 * bfd-in2.h: Regenerate.
8909 * coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
8910 coff_write_object_contents): Add support for or32.
8911 * config.bfd: Add target.
8912 * configure.in: Add support for or32.
8913 * configure: Regenerate.
8914 * Makefile.am: Add support for or32.
8915 * Makefile.in: Regenerate.
8916 * po/SRC-POTFILES.in: Add or32 files.
8917 * po/bfd.pot: Regenerate.
8922 * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return
8923 false' with a return of a bfd_reloc_ error code.
8927 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
8928 unexport unreferenced symbols when --export-dynamic. Call
8929 _bfd_elf_strtab_delref when unexporting.
8933 * bfd-in.h: Include <stdbool.h> if it is available.
8934 * bfd-in2.h: Regenerated.
8938 * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should
8943 * archures.c: Tidy up formatting of embedded comments.
8944 * bfd.c: Tidy up formatting of embedded comments.
8945 * bfd-in.h: Fix formatting of comments.
8946 * reloc.c: Tidy up formatting of ordinary & embedded comments.
8947 * section.c: Tidy up formatting of embedded comments.
8948 * syms.c: Tidy up formatting of embedded comments.
8949 * targets.c: Tidy up formatting of embedded comments.
8951 * bfd-in2.h: Regenerate.
8955 * vms-tir.c (cmd_name): New function.
8956 (tir_cmd_name): New function.
8957 (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name().
8958 (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name().
8961 * peXXigen.c (pe_print_idata): Rearrange message to aid in
8963 (pe_print_pdata): Rearrange message to aid in translation.
8965 * libbfd.c (warn_deprecated): Rearrange error message to aid in
8968 * ihex.c (ihex_write_object_contents): Fix spelling typo.
8970 * ieee.c (ieee_slurp_external_symbols): Remove spurious space.
8972 * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error
8973 message to aid in translation.
8975 * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message
8976 to aid in translation.
8978 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo.
8982 * coff-arm.c, elf32-elf.h: Unify messages.
8986 * po/sv.po: Updated translation.
8990 * dwarf2.c (read_abbrev): Use full section name in error message.
8991 (decode_line_info): Likewise.
8993 * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging
8998 * elf64-ppc.c (func_desc_adjust): Only provide missing function
8999 descriptor symbols for undefined function code syms. Clear
9000 ELF_LINK_NON_ELF so that they can stay weak.
9005 * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype.
9006 * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function
9007 to handle 32-bit ELF embedded reloc (ld --embedded-relocs)
9009 * bfd-in2.h: Regenerate.
9013 * elf32-mips.c: Add additional comments about HI16 relocation
9015 (_bfd_mips_elf_hi16_reloc): Don't subtract address here for
9016 pc-relative relocations. (Reverts change made on 2001-10-31.)
9017 (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here
9018 for pc-relative relocations.
9019 (mips_elf_calculate_relocation): Add a comment about a kludge
9020 in the R_MIPS_GNU_REL_HI16 handling.
9021 (_bfd_mips_elf_relocate_section): Implement that kludge;
9022 adjust pc-relative HI16 relocation for difference in HI16 and
9023 LO16 addresses, since it can't easily be done in
9024 mips_elf_calculate_relocation.
9028 * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32
9029 relocations with PC32 relocations for undefined or weak symbols.
9030 * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise.
9031 * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise.
9035 * elfcore.h (elf_core_file_p): Improve comment for last change.
9039 * configure: Regenerated.
9043 * elfcore.h (elf_core_file_p): Set the machine architecture
9044 before processing the program headers.
9048 * configure.in <64-bit configuration>: If using gcc, check and
9049 emit error for egcs-1.1.2.
9050 * configure: Regenerate.
9054 * elf.c (elfcore_grok_win32pstatus): Copy only as much information
9055 as possible to avoid stack corruption.
9059 * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext
9060 for non-allocated sections.
9064 * elf.c (elfcore_write_prstatus): Make sure we pass the address of
9065 prstat.pr_reg even if it is a struct.
9069 * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX.
9073 * coffgen.c (coff_print_symbol): Don't mark info message
9078 * po/fr.po: Updated translation.
9079 * po/es.po: Updated translation.
9083 * coff-alpha.c (alpha_relocate_section): Unify warning message
9084 for GP relative relocations without GP defined.
9085 * coff-mips.c (mips_relocate_section): Likewise.
9089 * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid
9090 unsigned overflow when new_offset < old_offset.
9094 * bfd.c (_bfd_abort): Fix typo.
9098 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress
9099 plt entries for undefweak symbols.
9103 * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR.
9104 (bfd_elf64_ia64_hpux_big_vec): Ditto.
9105 (bfd_elf32_h8300_vec): Ditto.
9109 * elf64-ppc.c: Remove stale part of ABI comment.
9110 (NO_OPD_RELOCS): Define.
9111 (ppc64_elf_check_relocs): Use it.
9112 (ppc64_elf_relocate_section): Here too.
9113 (build_one_stub): Don't point function syms at the stub. Instead,
9115 (ppc64_elf_relocate_section): Check whether REL24 relocs should
9116 really go to the stub. Make all dynamic relocs in opd against
9118 (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of
9123 * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp.
9127 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of
9128 TOC_BASE_OFF adjustment.
9130 * Makefile.am: Run "make dep-am".
9131 * Makefile.in: Regenerate.
9132 * po/SRC-POTFILES.in: Regenerate.
9136 * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new
9141 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GOTREL>:
9142 Check for and emit error if sgot is NULL at this point.
9146 * config.bfd (ia64*-*-netbsd*): New target.
9150 * som.c (som_write_space_strings): Comment typo fix.
9154 * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and
9155 is_func_descriptor fields.
9156 (link_hash_newfunc): Init them.
9157 (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a
9158 dot are candidates for plt entries. When processing .opd relocs,
9159 set function descriptor strings to point inside function code
9160 string, and set new ppc_link_hash_entry fields.
9161 (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs.
9162 (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with
9163 function descriptors. It's now done in..
9164 (func_desc_adjust): New.
9165 (ppc64_elf_func_desc_adjust): New.
9166 (define elf_backend_always_size_sections): Define.
9167 (ppc64_elf_hide_symbol): New.
9168 (define elf_backend_hide_symbol): Define.
9169 (allocate_dynrelocs): Remove code looking up function descriptors
9170 as that has been done earlier.
9171 (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash
9173 (ppc64_elf_finish_dynamic_symbol): Likewise. Remove code looking
9174 up function descriptor.
9175 (build_one_stub): Look up the function code sym. Check for
9176 invalid plt offsets.
9177 (ppc64_elf_relocate_section): Tweak calls to undefined weak syms.
9178 Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs.
9180 * elf-bfd.h (elf_backend_data <elf_backend_hide_symbol>): Add
9182 (_bfd_elf_link_hash_hide_symbol): Likewise.
9183 * elflink.h (elf_link_add_object_symbols): Adjust call to
9184 elf_backend_hide_symbol.
9185 (elf_fix_symbol_flags): Likewise.
9186 (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather
9188 * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param.
9189 Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref.
9190 * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
9191 (clobber_millicode_symbols): Adjust to suit new hide_symbol.
9192 * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param
9194 * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call
9195 _bfd_elf_link_hash_hide_symbol rather than duplicating code.
9196 * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.
9200 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a
9201 dynamic function descriptor symbol, not the associated function
9206 * elf32-mips.c (mips_elf_calculate_relocation): Fix typo.
9210 * po/bfd.pot: Regenerate.
9211 * po/fr.po: Regenerate.
9215 * elf-bfd.h (elf_backend_data <elf_backend_section_from_bfd_section>):
9216 Remove "Elf_Internal_Shdr *" param.
9217 (_bfd_mips_elf_section_from_bfd_section): Ditto.
9218 * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto.
9219 * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto.
9220 * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto.
9221 * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto.
9222 * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto.
9223 * elf.c (_bfd_elf_section_from_bfd_section): Allow backend
9224 function to override special sections. Remove hdr arg from
9225 backend call, and don't loop.
9229 * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp
9230 on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of
9231 relocations requiring gp0 and gp.
9235 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle
9237 (elf32_arm_print_private_bfd_data): Likewise.
9241 * po/tr.po: Import new version.
9245 * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs.
9246 (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc.
9247 (ORI_R0_R0_0): Correct.
9251 * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE
9252 when plt_not_loaded.
9253 * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to
9254 clear .plt SEC_CODE here. Create .stub and correct .glink flags.
9255 (PLT_INITIAL_ENTRY_SIZE): Set to 24.
9256 (ppc64_elf_glink_code): Delete.
9257 (PPC64_ELF_GLINK_SIZE): Delete.
9258 (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11,
9259 BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0,
9260 ORI_R0_R0_0): Define.
9261 (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define.
9262 (struct ppc_link_hash_table): Add sstub and plt_overflow.
9263 (ppc64_elf_link_hash_table_create): Init them.
9264 (ppc64_elf_check_relocs <R_PPC64_REL24>): Refcount .plt entry.
9265 Don't copy to shared lib.
9266 (ppc64_elf_check_relocs): Call bfd_set_error on errors.
9267 (ppc64_elf_gc_sweep_hook <R_PPC64_REL24>): Sweep plt refcount.
9268 (allocate_dynrelocs <plt>): Don't change function sym here. Make
9269 room for .stub and .glink code.
9270 (ppc64_elf_size_dynamic_sections): Handle .stub. Make entry for
9272 (ppc64_elf_final_link): Rename to ppc64_elf_set_toc. Don't call
9273 bfd_elf64_bfd_final_link.
9274 (bfd_elf64_bfd_final_link): Don't define.
9275 (ppc64_elf_size_stubs): New.
9276 (build_plt_stub): New.
9277 (build_one_stub): New.
9278 (ppc64_elf_build_stubs): New.
9279 (ppc64_elf_relocate_section <toc relocs>): Remove assert.
9280 (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs.
9281 (ppc64_elf_finish_dynamic_symbol): Don't build stubs here. Set
9282 DT_PPC64_GLINK entry. Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in
9283 case output sections not separate. Adjust DT_RELASZ to not
9284 include plt relocs. Set reserved got entry. Set got and plt
9286 (elf_backend_got_header_size): Set to 8.
9287 * elf64-ppc.h: New file.
9291 * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing
9292 sections, use bfd_section_list_remove.
9293 * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
9294 * elflink.h (elf_link_add_object_symbols): When removing all
9295 sections, use bfd_section_list_clear.
9299 * po/sv.po: New file: Swedish translation.
9300 * configure.in (ALL_LINGUAS): Add sv.
9301 * configure: Regenerate.
9305 * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
9306 * elf.c (merge_sections_remove_hook): New function.
9307 (_bfd_elf_merge_sections): Pass it as 3rd argument to
9308 _bfd_merge_sections.
9309 * libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
9310 * libbfd.h: Rebuilt.
9311 * merge.c (_bfd_merge_sections): Add remove_hook argument.
9312 Call remove_hook if a SEC_EXCLUDE section is encountered.
9316 * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'.
9317 (xstormy16_reloc_map): Initialise new field with correct howto
9319 (xstormy16_reloc_type_lookup): Use 'table' field to locate correct
9324 * elf.c (elfcore_write_prstatus): Use long instead of pid_t;
9325 (elfcore_write_pstatus): Use long instead of pid_t;
9326 * elf-bfd.h: Change prototypes to use long instead of pid_t;
9330 * elf.c: Update copyright years.
9331 (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO
9332 and NT_NETBSDCORE_FIRSTMACH. Improve a comment.
9336 Add capability to write corefile note sections, for gdb.
9337 * elf.c (elfcore_write_note): New function.
9338 (elfcore_write_prpsinfo): New function.
9339 (elfcore_write_prstatus): New function.
9340 (elfcore_write_pstatus): New function.
9341 (elfcore_write_prfpreg): New function.
9342 (elfcore_write_prxfpreg): New function.
9343 * elf-bfd.h: Add prototypes for above functions.
9347 * elf.c (elf_fake_sections): Propagate errors from
9348 elf_backend_fake_section.
9352 * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo.
9353 (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c.
9354 (elf32-sh-nbsd.lo): New rule.
9355 * Makefile.in: Regenerate.
9356 * config.bfd (sh*le-*-netbsdelf*): New target.
9357 (sh*-*-netbsdelf*): New target.
9358 * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*.
9359 (bfd_elf32_shnbsd_vec): New vector.
9360 (bfd_elf32_shlnbsd_vec): New vector.
9361 * configure: Regenerate.
9362 * elf32-sh-nbsd.c: New file.
9363 * targets.c: Update copyright years.
9364 (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and
9365 bfd_elf32_shnbsd_vec.
9369 * coff-rs6000.c (READ20): Use bfd_scan_vma.
9373 * elflink.h (elf_link_input_bfd): Don't ask for the merged offset
9374 of a symbol in a section that will be deleted.
9378 * po/es.po: New file: Spanish translation.
9379 * configure.in (ALL_LINGUAS): Add es.
9380 * configure: Regenerate.
9384 * elfxx-ia64.c (is_unwind_section_name): Add target vector as
9385 argument so we can handle HP-UX specially.
9386 (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name.
9387 (elfNN_hpux_backend_section_from_bfd_section): New for support
9388 of SHN_IA_64_ANSI_COMMON.
9389 (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON.
9390 (is_unwind_section_name): Add special HP-UX support.
9391 (elfNN_ia64_section_from_shdr): Add support for more sections.
9392 (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and
9393 add support for more sections.
9394 (elfNN_ia64_additional_program_headers): Modify
9395 is_unwind_section_name call.
9396 (elfNN_ia64_modify_segment_map): Remove assumption that there is
9397 only one unwind section in segment.
9401 * syms.c (_bfd_generic_make_empty_symbol): New function.
9402 * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
9403 _bfd_generic_make_empty_symbol.
9404 * libbfd.h: Regenerate.
9405 * bfd-in2.h: Regenerate.
9406 * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
9407 (hppabsd_core_get_symtab_upper_bound): Don't define.
9408 (hppabsd_core_get_symtab): Likewise.
9409 (hppabsd_core_print_symbol): Likewise.
9410 (hppabsd_core_get_symbol_info): Likewise.
9411 (hppabsd_core_bfd_is_local_label_name): Likewise.
9412 (hppabsd_core_get_lineno): Likewise.
9413 (hppabsd_core_find_nearest_line): Likewise.
9414 (hppabsd_core_bfd_make_debug_symbol): Likewise.
9415 (hppabsd_core_read_minisymbols): Likewise.
9416 (hppabsd_core_minisymbol_to_symbol): Likewise.
9417 (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
9419 * hpux-core.c: Similarly.
9420 * irix-core.c: Similarly.
9421 * osf-core.c: Similarly.
9422 * sco5-core.c: Similarly.
9423 * binary.c (binary_make_empty_symbol): Remove function, define as
9424 _bfd_generic_make_empty_symbol.
9425 * ihex.c (ihex_make_empty_symbol): Likewise.
9426 * mmo.c (mmo_make_empty_symbol): Likewise.
9427 * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
9428 * srec.c (srec_make_empty_symbol): Likewise.
9429 * versados.c (versados_make_empty_symbol): Likewise.
9430 * vms.c (_bfd_vms_make_empty_symbol): Remove.
9431 (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
9432 * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
9433 rather than _bfd_vms_make_empty_symbol.
9434 * vms-misc.c (new_symbol): Likewise.
9438 * section.c (bfd_section_init): Remove unnecessary initialisations.
9439 (bfd_section_list_clear): New function.
9440 (bfd_section_list_remove, bfd_section_list_insert): New macros.
9441 (_bfd_strip_section_from_output): Use them.
9442 * coffcode.h (coff_set_alignment_hook): Likewise.
9443 * elf32-mips.c (_bfd_mips_elf_final_link): Likewise.
9444 * elf64-mips.c (mips_elf64_final_link): Likewise.
9445 * elf64-mmix.c (mmix_elf_final_link): Likewise.
9446 * sunos.c (sunos_add_dynamic_symbols): Likewise.
9447 * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
9448 * bfd-in2.h: Regenerate.
9450 * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway
9451 rather than doing our own section handling. Clean up after errors
9452 with bfd_release and bfd_section_list_clear. Handle unexpected
9454 * aoutf1.h (sunos4_core_file_p): Likewise.
9455 * aix386-core.c (aix386_core_file_p): Likewise.
9456 * cisco-core.c (cisco_core_file_validate): Likewise.
9457 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
9458 * trad-core.c (trad_unix_core_file_p): Likewise.
9460 * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors
9461 with bfd_release and bfd_section_list_clear.
9462 * hpux-core.c (hpux_core_core_file_p): Likewise.
9463 * irix-core.c (irix_core_core_file_p): Likewise.
9464 * lynx-core.c (lynx_core_file_p): Likewise.
9465 * osf-core.c (osf_core_core_file_p): Likewise.
9466 * rs6000-core.c (rs6000coff_core_p): Likewise.
9467 * sco5-core.c (sco5_core_file_p): Likewise.
9469 * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform
9470 sign extension adjustments without conditionals.
9474 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if
9475 CIE at .eh_frame start is removed due to no FDEs referencing it.
9479 * config.bfd (x86_64-*-netbsd*): New target.
9480 * configure.in (x86_64-*-netbsd*): Set COREFILE
9482 * configure: Regenerated.
9486 * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering
9487 for recent bfd_make_section_anyway change.
9491 * elf32-arm.h (elf32_arm_final_link_relocate): Handle
9492 R_ARM_THM_PC11 reloc.
9496 * configure.in (LINGUAS): Add ja.
9497 * configure: Regenerate.
9498 * po/ja.po: Import from translation project's web site.
9502 * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error
9503 messages to ease translation into other languages.
9505 For older changes see ChangeLog-0001
9511 version-control: never