OSDN Git Service

bfd/
[pf3gnuchains/pf3gnuchains4x.git] / bfd / ChangeLog
1 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
2
3         * bfd.c (bfd): Remove section_tail and add section_last.
4         (bfd_preserve): Likewise.
5         (bfd_preserve_save): Likewise.
6         (bfd_preserve_restore): Likewise.
7         * opncls.c (_bfd_new_bfd): Likewise.
8
9         * coffcode.h (coff_compute_section_file_positions): Updated.
10         (coff_compute_section_file_positions): Likewise.
11         * elf.c (assign_section_numbers): Likewise.
12         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
13         * elf64-mmix.c (mmix_elf_final_link): Likewise.
14         * elfxx-ia64.c (elfNN_ia64_object_p): Likewise.
15         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
16         * sunos.c (sunos_add_dynamic_symbols): Likewise.
17         * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
18
19         * ecoff.c (bfd_debug_section): Initialize prev.
20
21         * section.c (bfd_section): Add prev.
22         (bfd_section_list_remove): Updated.
23         (bfd_section_list_append): New.
24         (bfd_section_list_insert_after): New.
25         (bfd_section_list_insert_before): New.
26         (bfd_section_list_insert): Removed.
27         (bfd_section_removed_from_list): Updated.
28         (STD_SECTION): Initialize prev.
29         (bfd_section_init): Updated.
30         (bfd_section_list_clear): Updated.
31
32         * bfd-in2.h: Regenerated.
33
34 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
35
36         * elf.c (_bfd_elf_new_section_hook): Don't call
37         _bfd_elf_get_sec_type_attr on sections from input files.
38
39 2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>
40
41         * merge.c (sec_merge_init): Call bfd_hash_table_init_n with
42         hash table size 16699 instead of bfd_hash_table_init.
43
44 2005-05-01  Paul Brook  <paul@codesourcery.com>
45
46         * elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong
47         definition has already been seen.
48
49 2005-05-01  Paul Brook  <paul@codesourcery.com>
50
51         * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Treat
52         R_ARM_PLT32 the same as R_ARM_PC24.
53         (arm_add_to_rel): Ditto.
54
55 2005-04-29  Ralf Corsepius <ralf.corsepius@rtems.org>
56
57         * config.bfd: Add h8300*-*-rtemscoff.
58         Switch h8300*-*-rtems* to elf.
59
60 2005-04-28  Paul Brook  <paul@codesourcery.com>
61
62         Merge changes only applied to Makefile.in.
63         * Makefile.am (BFD32_BACKENDS): Add elfxx-sparc.lo
64         (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
65         (elfxx-sparc.lo): New rule.
66         (elf32-sparc.lo): Add elfxx-sparc.h dependency.
67         (elf64-sparc.lo): Likewise.
68
69 2005-04-28  Julian Brown  <julian@codesourcery.com>
70
71         * elflink.c (_bfd_elf_provide_symbol): Provide symbol for weak
72         import.
73
74 2005-04-27  H.J. Lu  <hongjiu.lu@intel.com>
75
76         * elf-bfd.h (bfd_elf_sym_name): Also take "asection *".
77
78         * elf.c (bfd_elf_sym_name): Updated.
79         (group_signature): Likewise.
80         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
81         * elf64-ppc.c (ppc64_elf_edit_opd): Likewise.
82         (ppc64_elf_edit_toc): Likewise.
83         (ppc64_elf_relocate_section): Likewise.
84         * elfcode.h (elf_slurp_symbol_table): Likewise.
85         * elflink.c (elf_link_input_bfd): Likewise.
86
87         * elfxx-ia64.c (elfNN_ia64_relocate_section): Call
88         bfd_elf_sym_name to get local symbol name when reporting errors.
89
90 2005-04-27  Nick Clifton  <nickc@redhat.com>
91
92         * elflink.c (elf_link_input_bfd): Handle the case where a badly
93         formatted input file results in a reloc which has no associated
94         global symbol.
95
96 2005-04-26  Jerome Guitton  <guitton@gnat.com>
97
98         * bfd.m4 (BFD_NEED_DECLARATION): Restore.
99
100 2005-04-25  David S. Miller  <davem@davemloft.net>
101
102         * elfxx-sparc.c (sparc_elf_append_rela_64): Add BFD64 protection.
103         (sparc_elf_r_info_64, _bfd_sparc_elf_finish_dynamic_symbol,
104         sparc64_finish_dyn, _bfd_sparc_elf_finish_dynamic_sections):
105         Likewise.
106
107 2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>
108
109         PR 858
110         * elflink.c (elf_link_input_bfd): Make non-debugging reference
111         to discarded section an error.
112
113 2005-04-21  Jerome Guitton  <guitton@gnat.com>
114
115         * configure.in: Replace BFD_NEED_DECLARATION checks by the
116         corresponding AC_CHECK_DECLS.
117         * sysdep.h: Replace NEED_DECLARATION_* checks by the corresponding
118         HAVE_DECL_*.
119         * bfd.m4 (BFD_NEED_DECLARATION): Remove, obsolete.
120         * configure: Regenerate.
121         * config.in: Ditto.
122
123 2005-04-21  Andreas Schwab  <schwab@suse.de>
124
125         * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove
126         unsigned from type of dynamic_interpreter.
127         * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create): Remove
128         casts again.
129
130         * elf.c (assign_section_numbers): Fix comment.
131
132 2005-04-21  Jerome Guitton  <guitton@gnat.com>
133
134         * som.c (som_bfd_print_private_bfd_data): Add explicit cast to long
135         for struct som_exec_auxhdr fields.
136
137 2005-04-21  Nick Clifton  <nickc@redhat.com>
138
139         * aout-adobe.c: Convert to ISO C and fix formatting.
140         * aout-arm.c: Convert to ISO C and fix formatting.
141         * aout-cris.c: Convert to ISO C and fix formatting.
142         * aout-ns32k.c: Convert to ISO C and fix formatting.
143         * aout-tic30.c: Convert to ISO C and fix formatting.
144         * coffcode.h: Convert to ISO C and fix formatting.
145         * coffswap.h: Convert to ISO C and fix formatting.
146         * i386aout.c: Convert to ISO C and fix formatting.
147         * libaout.h: Convert to ISO C and fix formatting.
148         * libcoff-in.h: Convert to ISO C and fix formatting.
149         * libcoff.h: Convert to ISO C and fix formatting.
150         * libecoff.h: Convert to ISO C and fix formatting.
151         * libnlm.h: Convert to ISO C and fix formatting.
152         * libpei.h: Convert to ISO C and fix formatting.
153         * libxcoff.h: Convert to ISO C and fix formatting.
154         * nlm-target.h: Convert to ISO C and fix formatting.
155         * nlm.c: Convert to ISO C and fix formatting.
156         * nlm32-alpha.c: Convert to ISO C and fix formatting.
157         * nlm32-i386.c: Convert to ISO C and fix formatting.
158         * nlm32-ppc.c: Convert to ISO C and fix formatting.
159         * nlm32-sparc.c: Convert to ISO C and fix formatting.
160         * nlmcode.h: Convert to ISO C and fix formatting.
161         * nlmswap.h: Convert to ISO C and fix formatting.
162         * pe-mips.c: Convert to ISO C and fix formatting.
163         * peXXigen.c: Convert to ISO C and fix formatting.
164         * peicode.h: Convert to ISO C and fix formatting.
165         * vms-gsd.c: Convert to ISO C and fix formatting.
166         * vms-hdr.c: Convert to ISO C and fix formatting.
167         * vms-misc.c: Convert to ISO C and fix formatting.
168         * vms-tir.c: Convert to ISO C and fix formatting.
169         * vms.c: Convert to ISO C and fix formatting.
170         * vms.h: Convert to ISO C and fix formatting.
171
172         * coffgen.c (coff_print_symbol): Restore correct formatting of
173         output.
174
175 2005-04-20  David S. Miller  <davem@davemloft.net>
176
177         * elfxx-sparc.c (sparc_elf_r_symndx_64): Fix compiler warning.
178         (_bfd_sparc_elf_link_hash_table_create): Likewise.
179         (allocate_dynrelocs): Likewise.
180
181 2005-04-20  Jerome Guitton  <guitton@gnat.com>
182
183         * configure.in: Fix the check for basename declaration. Add check
184         for declarations of ftello, ftello64, fseeko, fseeko64.
185         * configure: Regenerate.
186         * config.in: Ditto.
187         * sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64.
188
189 2005-04-19  David S. Miller  <davem@davemloft.net>
190
191         * elfxx-sparc.c: New file.
192         * elfxx-sparc.h: New file.
193         * Makefile.in (BFD32_BACKENDS): Add elfxx-sparc.lo
194         (BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
195         (elfxx-sparc.lo): New rule.
196         (elf32-sparc.lo): Add elfxx-sparc.h dependency.
197         (elf64-sparc.lo): Likewise.
198         * configure.in (bfd_elf32_sparc_vec): Add elfxx-sparc.lo
199         (bfd_elf64_sparc_vec): Likewise.
200         * configure: Regenerate.
201         * elf32-sparc.c: Remove common code now in elfxx-sparc.c
202         * elf64-sparc.c: Likewise, also use elf64_sparc_*() naming
203         which is more consistent with elf32-sparc.c
204
205 2005-04-19  Daniel Jacobowitz  <dan@codesourcery.com>
206
207         * elfxx-mips.c (struct mips_elf_link_hash_entry): Update comment.
208         (mips_elf_create_local_got_entry): Check h->root.forced_local.
209
210 2005-04-19  Alan Modra  <amodra@bigpond.net.au>
211
212         * elf32-ppc.c (ppc_elf_check_relocs): Don't bother with
213         dynamic relocs in non-SEC_ALLOC sections.
214         (ppc_elf_gc_sweep_hook): Likewise.
215         (ppc_elf_relax_section): Likewise.
216         (ppc_elf_relocate_section): Likewise.
217
218 2005-04-18  Nick Clifton  <nickc@redhat.com>
219
220         * aix5ppc-core.c (xcoff64_core_p): Fix compile time warning
221         assigning a value to return_value.
222
223 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
224
225         PR 855
226         * elf.c (_bfd_elf_copy_private_section_data): Don't copy linker
227         created group data.
228
229 2005-04-17  H.J. Lu  <hongjiu.lu@intel.com>
230
231         PR 855
232         * elf.c (setup_group): Properly handle zero group count.
233
234 2005-04-17  Mark Kettenis  <kettenis@gnu.org>
235
236         * som.c (hppa_som_reloc, som_mkobject, som_is_space)
237         (som_is_subspace, compare_subspaces, som_compute_checksum)
238         (som_build_and_write_symbol_table, som_slurp_symbol_table): New
239         protoypes.
240         (hppa_som_reloc, compare_syms, compare_subspaces)
241         (som_print_symbol, som_get_section_contents)
242         (som_set_section_contents): Remove space after 'void *'.
243         (som_bfd_print_private_bfd_data): Use %lx to print longs.
244         (som_bfd_merge_private_bfd_data)
245         (som_bfd_copy_private_header_data, som_bfd_set_private_flags): New
246         defines.
247
248 2004-04-15  Julian Brown  <julian@codesourcery.com>
249
250         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
251         * bfd-in2.h: Regenerate.
252         * elf32-arm.c (elf32_arm_link_hash_table): New field, 'use_blx'.
253         (elf32_arm_link_hash_table_create): Initialise fix_v4bx, use_blx.
254         (bfd_elf32_arm_set_target_relocs): Handle use_blx.
255         (elf32_arm_final_link_relocate): Use Thumb BLX for R_ARM_THM_PC22
256         relocations if requested to.
257         (allocate_dynrelocs): Don't count size of omitted Thumb stubs based on
258         use_blx rather than symbian_p.
259         (elf32_arm_finish_dynamic_symbol): Don't output Thumb PLT stubs if
260         use_blx is in effect.
261         (elf32_arm_symbian_link_hash_table_create): Enable use_blx by default
262         for SymbianOS.
263
264 2005-04-15  Nick Clifton  <nickc@redhat.com>
265
266         * coffgen.c (coff_print_symbol): Use fprintf_vma to print vma
267         values.
268
269 2005-04-15  Alan Modra  <amodra@bigpond.net.au>
270
271         PR ld/815
272         * elflink.c (elf_smash_syms): Clear undef.next if it's not being
273         used as a list pointer.
274
275 2005-04-14  Alan Modra  <amodra@bigpond.net.au>
276
277         * Makefile.am (NO_WERROR): Define.
278         * warning.m4: New file
279         * acinclude.m4: Include warning.m4.
280         * configure.in: Invoke AM_BINUTILS_WARNINGS.
281         * Makefile.in: Regenerate.
282         * configure: Regenerate.
283
284 2005-04-14  Alan Modra  <amodra@bigpond.net.au>
285
286         * merge.c (sec_merge_emit): Tidy.  Check for bfd_zmalloc errors.
287         Write trailing padding.
288
289         * merge.c (merge_strings): Round up section size for alignment.
290
291 2005-04-14  David S. Miller  <davem@davemloft.net>
292
293         Add TLS support for 64-bit Sparc ELF.
294         *  elf64-sparc.c (sparc64_elf_dyn_relocs,
295         sparc64_elf_link_hash_entry, sparc64_elf_obj_tdata): New structs.
296         (GOT_UNKNOWN, GOT_NORMAL, GOT_TLD_GD, GOT_TLD_IE,
297         sparc64_elf_hash_entry, sparc64_elf_tdata,
298         sparc64_elf_local_got_tls_type): New defines.
299         (sparc64_elf_mkobject): New function.
300         (sparc64_elf_link_hash_table): Add members for dynamic linker
301         sections PLT, RELPLT, DYNBSS, and RELBSS.  Add tls_ldm_got
302         uion to track TLS GOT references.  Add sym_sec to cache
303         mappings from local sym to section.
304         (link_hash_newfunc): New function.
305         (sparc64_elf_bfd_link_hash_table_create): Rename to
306         sparc64_elf_link_hash_table_create for consistency.
307         Pass link_hash_newfunc to _bfd_elf_link_hash_table_init.
308         (sparc64_elf_create_dynamic_sections): Initialize new section
309         members of sparc64_elf_link_hash_table.  Only init srelbss
310         if not-shared.
311         (sparc64_elf_copy_indirect_symbol, sparc64_elf_tls_transition):
312         New functions.
313         (SPARC_NOP): Define.
314         (sparc64_elf_build_plt, sparc64_elf_plt_entry_offset,
315         sparc64_elf_plt_ptr_offset): Delete.
316         (sparc64_plt_entry_build): New function to build PLT entries
317         gradually instread of all at once at the end of linking.
318         (sparc64_elf_check_relocs): Delete dynobj, sgot, and srelgot
319         local vars.  Get them from sparc64_elf_hash_table instead.
320         Check early on if r_symndx is in bounds.  Handle TLS transitions.
321         Account for TLS GOT references and DF_STATIC_TLS, as needed.
322         For TLS relocs, record the tls_type in either
323         sparc64_elf_local_got_tls_type or sparc64_elf_hash_entry as
324         appropriate.  For R_SPARC_TLS_{GD,LDM}_CALL, emit a reference
325         to the __tls_get_addr symbol.  For PLT relocs, track references
326         via h->plt.refcount.  When R_SPARC_{PC10,PC22,PC_HH22,PC_HM10,
327         PC_LM22} and h not-NULL, set h->non_got_ref.  For global data
328         symbol references, count the number of relocations needed for
329         that symbol.  For default switch case, don't error, this lets
330         the TLS relocs not explicitly handled by this function get
331         accepted.
332         (sparc64_elf_gc_mark_hook, sparc64_gc_sweep_hook): New functions.
333         (sparc64_elf_adjust_dynamic_symbol): Remove dynobj local var, get
334         it from sparc64_elf_hash_table.  Store the real PLT offset
335         in h->plt.offset, and build PLT entries one at a time.  Also
336         get .dynbss section pointer from htab.
337         (allocate_dynrelocs, readonly_dynrelocs,
338         sparc64_omit_section_dynsym): New functions.
339         (sparc64_elf_omit_section_dynsym): Use these new functions as
340         helpers.
341         (dtpoff_base, tpoff): New functions.
342         (sparc64_elf_relocate_section): Kill dynobj, sgot, and splt
343         locals, get them from sparc64_elf_hash_table.  Handle TLS
344         relocations and refcounting in main relocation loop.
345         (sparc64_elf_finish_dynamic_symbol): Use
346         sparc64_elf_link_hash_table.  Build PLT entries as we see
347         them.  Handle TLS GOT relocations.
348         (sparc64_elf_finish_dynamic_sections): Get sgot and dynobj
349         from sparc64_elf_hash_table.  Initialize only PLT header
350         not all entries since we not build PLT entries one by one.
351         (elf_backend_copy_indirect_symbol, bfd_elf64_mkobject,
352         elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook,
353         elf_backend_can_gc_sections, elf_backend_can_refcount): Define.
354
355 2005-04-13  Daniel Jacobowitz  <dan@codesourcery.com>
356
357         * elflink.c (elf_link_input_bfd): Update check for removed
358         sections.
359
360 2005-04-12  Alan Modra  <amodra@bigpond.net.au>
361
362         * Makefile.am: Run "make dep-am".
363         * Makefile.in: Regenerate.
364         * aclocal.m4: Regenerate.
365         * libcoff.h: Regenerate.
366
367 2005-04-11  H.J. Lu  <hongjiu.lu@intel.com>
368
369         * linker.c (_bfd_generic_link_output_symbols): Also check if
370         the output section of an input section has been removed from
371         the output file.
372
373         * section.c (bfd_section_list_remove): Clear the next field
374         of the removed section.
375         (bfd_section_removed_from_list): New.
376         * bfd-in2.h: Regenerated.
377
378 2005-04-11  David S. Miller  <davem@davemloft.net>
379
380         * elf32-sparc.c (elf32_sparc_relocate_section,
381         R_SPARC_TLS_LDO_{HIX22,LOX10}): When not shared, transition to
382         R_SPARC_TLS_LE_{HIX22,LOX10}.
383         (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_HIX22): Only
384         xor relocation with 0xffffffff if R_SPARC_TLS_LE_HIX22.
385         (elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_LOX10): Only
386         or 0x1c00 into relocation if R_SPARC_TLS_LE_HIX22.
387
388 2005-04-11  H.J. Lu  <hongjiu.lu@intel.com>
389
390         * coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h.
391
392 2005-04-11  Nick Clifton  <nickc@redhat.com>
393         
394         * aout-target.h:  Convert to ISO C.
395         * aoutf1.h:  Convert to ISO C.
396         * aoutx.h:  Convert to ISO C.
397         * bout.c:  Convert to ISO C.
398         * dwarf1.c:  Convert to ISO C.
399         * ecoffswap.h:  Convert to ISO C.
400         * freebsd.h:  Convert to ISO C.
401         * genlink.h:  Convert to ISO C.
402         * ieee.c:  Convert to ISO C.
403         * ihex.c:  Convert to ISO C.
404         * libcoff-in.h:  Convert to ISO C.
405         * mach-o.c:  Convert to ISO C.
406         * mach-o.h:  Convert to ISO C.
407         * netbsd.h:  Convert to ISO C.
408         * ns32k.h:  Convert to ISO C.
409         * ns32knetbsd.c:  Convert to ISO C.
410         * oasys.c:  Convert to ISO C.
411         * pdp11.c:  Convert to ISO C.
412         * pef-traceback.h:  Convert to ISO C.
413         * pef.c:  Convert to ISO C.
414         * pef.h:  Convert to ISO C.
415         * riscix.c:  Convert to ISO C.
416         * som.c:  Convert to ISO C.
417         * som.h:  Convert to ISO C.
418         * srec.c:  Convert to ISO C.
419         * stabs.c:  Convert to ISO C.
420         * sunos.c:  Convert to ISO C.
421         * tekhex.c:  Convert to ISO C.
422         * versados.c:  Convert to ISO C.
423         * version.h:  Convert to ISO C.
424         * xcoff-target.h:  Convert to ISO C.
425         * xcofflink.c:  Convert to ISO C.
426         * xsym.c:  Convert to ISO C.
427         * xsym.h:  Convert to ISO C.
428
429 2005-04-08  Paul Brook  <paul@codesourcery.com>
430
431         * elf32-arm.c (ARM2THUMB_GLUE_SIZE): Rename...
432         (ARM2THUMB_STATIC_GLUE_SIZE): ... to this.
433         (ARM2THUMB_PIC_GLUE_SIZE): Define.
434         (a2t1p_ldr_insn, a2t2p_add_pc_insn, a2t3p_bx_r12_insn): Add.
435         (elf32_arm_to_thumb_stub): Create PIC stubs.
436         (record_arm_to_thumb_glue): Use different stub size for relocatable
437         images.
438
439 2005-04-05  Alan Modra  <amodra@bigpond.net.au>
440
441         * elf64-ppc.c (dec_dynrel_count): New function split out from
442         ppc64_elf_edit_toc, with additional code from ppc64_elf_edit_opd.
443         (ppc64_elf_edit_toc, ppc64_elf_edit_opd): Use it.
444         (ppc64_elf_tls_optimize): Likewise.
445
446 2005-04-05  Mark Kettenis  <kettenis@gnu.org>
447
448         * netbsd-core.c (SPARC_WCOOKIE_OFFSET): Renamed from
449         CORE_WCOOKIE_OFFSET.
450         (SPARC64_WCOOKIE_OFFSET): New.
451         (netbsd_core_file_p): Provide .wcookie section for OpenBSD/sparc64.
452
453 2005-04-05  Nick Clifton  <nickc@redhat.com>
454
455         * po/rw.po: New translation: Kinyarwanda
456         * configure.in (ALL_LINGUAS): Add rw
457         * configure: Regenerate.
458
459 2005-04-05  Richard Sandiford  <rsandifo@redhat.com>
460
461         * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
462         (_bfd_mips_elf_section_from_shdr): Use it to check for recognized
463         SHT_MIPS_OPTIONS names.  Allow all sections with unrecognised
464         section flags.
465         (_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P
466         to check for SHT_MIPS_OPTIONS sections.
467         (_bfd_mips_elf_set_section_contents): Likewise.
468
469 2005-04-04  Eric Christopher  <echristo@redhat.com>
470
471         * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
472         Clean up gp handling code.
473
474 2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>
475
476         * elf.c (bfd_elf_set_group_contents): Ignore linker created
477         group section. 
478         (assign_section_numbers): Accept link_info. Check SHT_GROUP
479         sections for relocatable files only. Remove the linker created
480         group sections.
481         (_bfd_elf_compute_section_file_positions): Pass link_info to
482         assign_section_numbers.
483
484         * elfxx-ia64.c (elfNN_ia64_object_p): New.
485         (elf_backend_object_p): Defined.
486
487 2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>
488
489         * elf-bfd.h (elf_section_data): Use (sec) instead of sec.
490
491 2005-04-03  Fred Fish  <fnf@specifixinc.com>
492
493         * dwarf2.c (struct dwarf2_debug): Add dwarf_ranges_buffer and
494         dwarf_ranges_size members.
495         (struct comp_unit): Add base_address member.
496         (struct funcinfo): Replace low/high members with an arange.
497         (arange_add): Replace incoming "unit" parameter with "abfd" and
498         "first_arange" pointers.  Reorganize/rewrite function body.
499         (decode_line_info): Change arange_add call to pass bfd and arange
500         pointers.
501         (lookup_address_in_line_info_table): Use arange list instead of
502         individual low/high members.  Walk function's arange list to find
503         lowest PC in list, to test for overlapping functions.
504         (read_debug_ranges): New function, reads the debug_ranges section.
505         (lookup_address_in_function_table): Use arange list instead of
506         individual low/high members.  Rewrite to find smallest range that
507         matches.
508         (read_rangelist): Read a given rangelist from debug_ranges.
509         (scan_unit_for_functions): Use arange list instead of individual
510         low/high members.  Handle a DW_AT_ranges attribute.
511         (parse_comp_unit): Use arange list instead of individual low/high
512         members.  Save comp unit base address.  Handle a DW_AT_ranges
513         attribute.
514
515 2005-04-01  H.J. Lu  <hongjiu.lu@intel.com>
516
517         * elf.c (assign_section_numbers): Really use the kept section.
518
519 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
520
521         * elf-bfd.h (_bfd_elf_check_kept_section): New.
522
523         * elf.c (assign_section_numbers): When sh_link points to a
524         discarded section, call _bfd_elf_check_kept_section to see if
525         the kept section can be used. Otherwise reject sh_link
526         pointing to discarded section.
527
528         * elflink.c (_bfd_elf_check_kept_section): New.
529         (elf_link_input_bfd): Use it.
530
531 2005-04-01  Alan Modra  <amodra@bigpond.net.au>
532
533         * elf64-ppc.c (ppc64_elf_edit_toc): Account for dynamic relocs
534         that we no longer need.
535
536 2005-04-01  Alan Modra  <amodra@bigpond.net.au>
537
538         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors
539         rather than 0.
540         (ppc64_elf_check_relocs): Remove unnecessary SEC_ALLOC check.
541
542 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
543
544         * elf.c (assign_section_numbers): Fix a typo.
545
546 2005-03-31  H.J. Lu  <hongjiu.lu@intel.com>
547
548         * elflink.c (elf_link_input_bfd): Remove the extra `\n' in
549         error message.
550         (_bfd_elf_section_already_linked): Likewise.
551
552 2005-03-31  Jerome Guitton  <guitton@gnat.com>
553
554         * config.in: Regenerate.
555
556 2005-03-31  Jerome Guitton  <guitton@gnat.com>
557
558         * config.in (HAVE_DECL_BASENAME): New configure macro.
559         * configure.in: Check for basename.
560         * configure: Regenerate.
561
562 2005-03-30  Julian Brown  <julian@codesourcery.com>
563
564         * bfd-in.h (bfd_is_arm_mapping_symbol_name): Rename from
565         bfd_elf32_is_arm_mapping_symbol_name.
566         * bfd-in2.h: Regenerate.
567         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename from
568         bfd_elf32_is_arm_mapping_symbol_name.
569         * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename
570         bfd_elf32_is_arm_mapping_symbol_name to bfd_is_arm_mapping_symbol_name.
571         (arm_elf_find_function): Likewise.
572         (elf32_arm_output_symbol_hook): Likewise.
573
574 2005-03-30  Julian Brown  <julian@codesourcery.com>
575
576         * bfd-in.h (bfd_elf32_is_arm_mapping_symbol_name): Add prototype.
577         * bfd-in2.h: Regenerate.
578         * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to
579         bfd_elf32_is_arm_mapping_symbol_name.
580         (elf32_arm_output_symbol_hook): Likewise.
581         (arm_elf_find_function): Likewise, and include STT_NOTYPE in test for
582         mapping symbols.
583         (is_arm_mapping_symbol_name): Function moved from here...
584         * cpu-arm.c (bfd_elf32_is_arm_mapping_symbol_name): ...to here, renamed
585         and made global.
586
587 2005-03-29  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
588
589         * configure.in: Check for ffs decl and alphabetize.
590         * config.in: Regenerate.
591         * configure: Regenerate.
592         * sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and 
593         alphabetize.
594
595 2005-03-29  Fred Fish  <fnf@specifixinc.com>
596
597         * dwarf2.c (struct comp_unit): Fix typo.
598         (scan_unit_for_functions): Remove unused local variable "name"
599         and dead code that set it.
600
601 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
602             Phil Blundell  <philb@gnu.org>
603
604         * bfd-in2.h, libbfd.h: Regenerated.
605         * reloc.c: Add ARM TLS relocations.
606         * elf32-arm.c (elf32_arm_howto_table): Add dynamic TLS
607         relocations.
608         (elf32_arm_tls_gd32_howto, elf32_arm_tls_ldo32_howto)
609         (elf32_arm_tls_ldm32_howto, elf32_arm_tls_le32_howto)
610         (elf32_arm_tls_ie32_howto): New.
611         (elf32_arm_howto_from_type): Support TLS relocations.
612         (elf32_arm_reloc_map): Likewise.
613         (elf32_arm_reloc_type_lookup): Likewise.
614         (TCB_SIZE): Define.
615         (struct elf32_arm_obj_tdata): New.
616         (elf32_arm_tdata, elf32_arm_local_got_tls_type): Define.
617         (elf32_arm_mkobject): New function.
618         (struct elf32_arm_relocs_copied): Add pc_count.
619         (elf32_arm_hash_entry, GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD)
620         (GOT_TLS_IE): Define.
621         (struct elf32_arm_link_hash_table): Add tls_ldm_got.
622         (elf32_arm_link_hash_newfunc): Initialize tls_type.
623         (elf32_arm_copy_indirect_symbol): Copy pc_count and tls_type.
624         (elf32_arm_link_hash_table_create): Initialize tls_ldm_got.
625         (dtpoff_base, tpoff): New functions.
626         (elf32_arm_final_link_relocate): Handle TLS relocations.
627         (IS_ARM_TLS_RELOC): Define.
628         (elf32_arm_relocate_section): Warn about TLS mismatches.
629         (elf32_arm_gc_sweep_hook): Handle TLS relocations and pc_count.
630         (elf32_arm_check_relocs): Detect invalid symbol indexes.  Handle
631         TLS relocations and pc_count.
632         (elf32_arm_adjust_dynamic_symbol): Check non_got_ref.
633         (allocate_dynrelocs): Handle TLS.  Bind REL32 relocs to local
634         calls.
635         (elf32_arm_size_dynamic_sections): Handle TLS.
636         (elf32_arm_finish_dynamic_symbol): Likewise.
637         (bfd_elf32_mkobject): Define.
638
639 2005-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
640
641         * elf32-arm.c (elf32_arm_check_relocs): Increment count for all
642         relocation types.  Don't count relocations which will use a PLT.
643
644 2005-03-29  Joel Brobecker  <brobecker@gnat.com>
645
646         * elf.c (elfcore_grok_nto_status): Print tid as long.
647         (elfcore_grok_nto_regs): Likewise.
648
649 2005-03-29  Joel Brobecker  <brobecker@gnat.com>
650
651         * irix-core.c: Remove some unnecessary prototypes.
652
653 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
654
655         * irix-core.c: Convert to ISO C.
656
657 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
658
659         * irix-core.c (do_sections): Replace + by | in expression.
660         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
661         to unused parameters to avoid a compiler warning.
662
663 2005-03-28  Mark Kettenis  <kettenis@gnu.org>
664
665         * netbsd-core.c: Convert to ISO C.  Fix formatting.
666
667 2005-03-24  Eric Christopher  <echristo@redhat.com>
668
669         * elfxx-mips.c: Revert previous patch.
670
671 2005-03-24  Nick Clifton  <nickc@redhat.com>
672
673         * targets.c (_bfd_target_vector): Only include the
674         bfd_elf32_ia64_hpux_big_vec vector when building a 64-bit BFD with
675         all targets enabled.
676
677 2005-03-24  James E Wilson  <wilson@specifixinc.com>
678
679         * Makefile.am (BFD32_BACKENDS): Delete elf32-ia64.lo.
680         (BFD64_BACKENDS): Add elf32-ia64.lo.
681         * Makefile.in: Regenerate.
682
683 2005-03-23  Eric Christopher  <echristo@redhat.com>
684
685         * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): New.
686         (mips_elf_calculate_relocation): Use. Define DF_TEXTREL
687         after emitting relocation.
688         (_bfd_mips_elf_adjust_dynamic_symbol): Ditto.
689         (_bfd_mips_elf_check_relocs): Remove code to set DF_TEXTREL
690         and readonly_reloc.
691
692 2005-03-23  Mike Frysinger  <vapier@gentoo.org>
693             Nick Clifton  <nickc@redhat.com>
694
695         * config.bfd: Accept any C library to accompany a GNU Linux
696         implementation, not just the GNU C library.
697         * configure.in: Likewise.
698         * configure: Regenerate.
699
700 2005-03-22  H.J. Lu  <hongjiu.lu@intel.com>
701
702         * bfd-in.h (_bfd_elf_provide_symbol): New.
703         * bfd-in2.h: Regenerated.
704
705         * elf32-ppc.c (set_linker_sym): Moved to elflink.c.
706         (ppc_elf_set_sdata_syms): Call _bfd_elf_provide_symbol instead
707         of set_linker_sym.
708
709         * elflink.c (_bfd_elf_provide_symbol): New. Moved and renamed
710         from elf32-ppc.c.
711
712 2005-03-22  Hans-Peter Nilsson  <hp@axis.com>
713
714         * hash.c (strtab_hash_newfunc): Fix typo in allocated size.
715
716 2005-03-22  Bob Wilson  <bob.wilson@acm.org>
717
718         * xtensa-isa.c (xtensa_opcode_lookup, xtensa_state_lookup,
719         xtensa_sysreg_lookup_name, xtensa_interface_lookup,
720         xtensa_funcUnit_lookup): Skip bsearch call if count is zero.
721         (xtensa_opcode_decode): Rearrange code.
722
723 2005-03-22  Nick Clifton  <nickc@redhat.com>
724
725         * binary.c: Convert to ISO C90 formatting.
726         * coff-arm.c: Convert to ISO C90 formatting.
727         * coffgen.c: Convert to ISO C90 formatting.
728         * elf32-gen.c: Convert to ISO C90 formatting.
729         * elf64-gen.c: Convert to ISO C90 formatting.
730         * hash.c: Convert to ISO C90 formatting.
731         * ieee.c: Convert to ISO C90 formatting.
732
733 2005-03-22  Daniel Jacobowitz  <dan@codesourcery.com>
734
735         * elf32-arm.c (elf32_arm_final_link_relocate): Don't fail for
736         unresolved symbols in R_ARM_NONE relocations.
737
738 2005-03-22  Daniel Jacobowitz  <dan@codesourcery.com>
739
740         * elf32-arm.c (elf32_arm_final_link_relocate): Add
741         UNRESOLVED_RELOC_P argument.  Set it appropriately.
742         (elf32_arm_relocate_section): Update call to
743         elf32_arm_final_link_relocate.  Don't clobber RELOCATION; use
744         unresolved_reloc instead.
745
746 2005-03-23  Alan Modra  <amodra@bigpond.net.au>
747
748         * elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on
749         .gnu.warning.* sections.
750
751 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
752
753         * elf32-ppc.c (elf_linker_section_pointers_t): Remove
754         written_address_p.
755         (ppc_elf_create_linker_section): Don't try to reuse existing section.
756         (elf_create_pointer_linker_section): Delete info parm.  Don't make
757         h dynamic.  Don't set written_address_p.
758         (ppc_elf_check_relocs): Adjust ppc_elf_create_linker_section calls.
759         (bfd_put_ptr): Delete.
760         (elf_finish_pointer_linker_section): Remove output_bfd and info parms.
761         Always write section contents.  Assert global sym is def_regular.
762         Use offset bottom bit as a written flag.
763         (ppc_elf_relocate_section): Adjust elf_finish_pointer_linker_section
764         calls.
765
766 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
767
768         * elf32-ppc.c (ppc_elf_set_sdata_syms): New function, extracted from..
769         (ppc_elf_set_sdata_syms): ..here.  Expand comment.  Set .sbss start
770         and end syms.
771
772 2005-03-21  Nick Clifton  <nickc@redhat.com>
773
774         * coff-arm.c (coff_link_hash_entry): Only define for non WINCE
775         targets.
776         (t2a1_bx_pc_insn): Likewise.
777         (t2a2_noop_insn): Likewise.
778         (t2a3_b_insn): Likewise.
779         (t2a1_push_insn): Likewise.
780         (t2a2_ldr_insn): Likewise.
781         (t2a3_mov_insn): Likewise.
782         (t2a4_bx_insn): Likewise.
783         (t2a5_pop_insn): Likewise.
784         (t2a6_bx_insn): Likewise.
785         (coff_arm_relocate_section): Only declare the high_address
786         variable for non WINCE targets.
787
788 2005-03-22  Alan Modra  <amodra@bigpond.net.au>
789
790         * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
791         SEC_LINKER_CREATED.  Attach to dynobj.
792         (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
793
794 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
795
796         * elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
797         sym_offset.  Add name, bss_name, sym_name, sym_val.
798         (struct ppc_elf_link_hash_table): Remove sdata and sdata2 pointers.
799         Add sdata array of elf_linker_section_t.
800         (ppc_elf_link_hash_table_create): Set name, sym_name, and bss_name.
801         (enum elf_linker_section_enum): Delete.
802         (ppc_elf_create_linker_section): Rewrite.  Don't create syms here.
803         (ppc_elf_check_relocs): Delay ppc_elf_create_linker_section until
804         the special sections are needed.  Adjust htab->sdata refs.
805         Ensure dynobj is set in sreloc code.
806         (ppc_elf_size_dynamic_sections): Strip sdata sections.
807         (ppc_elf_set_sdata_syms): New function.
808         (elf_finish_pointer_linker_section): Use 0x8000 for sym_offset.
809         (ppc_elf_relocate_section): Adjust references to htab->sdata.  Use
810         sym_val instead of sym_hash.
811         * elf32-ppc.h (ppc_elf_set_sdata_syms): Declare.
812
813 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
814
815         * elf32-ppc.c (is_ppc_elf_target): Move to linker part of file.
816         (ppc_elf_merge_private_bfd_data): Likewise.
817
818 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
819
820         * elf32-ppc.c (struct elf_linker_section): Remove rel_section.
821         (ppc_elf_create_linker_section): Don't create rel_section.
822         (elf_create_pointer_linker_section): Don't size relocs.
823         (elf_finish_pointer_linker_section): Remove relative_reloc parm.
824         Don't generate relocs.
825         (ppc_elf_relocate_section): Adjust calls to
826         elf_finish_pointer_linker_section.
827
828 2005-03-21  Alan Modra  <amodra@bigpond.net.au>
829
830         * elf32-ppc.c (is_ppc_elf_target): New function.
831         (ppc_elf_merge_private_bfd_data): Use it rather than just testing
832         for bfd_target_elf_flavour.  Do this test before endian check.
833         (ppc_elf_add_symbol_hook): Use is_pcc_elf_target.
834         (ppc_elf_size_dynamic_sections): Likewise.
835
836 2005-03-20  H.J. Lu  <hongjiu.lu@intel.com>
837
838         * elf-bfd.h (elf_backend_data): Add int to
839         elf_backend_section_from_shdr.
840         (bfd_elf_section_data): Update comment for this_idx.
841         (_bfd_elf_make_section_from_shdr): Add int.
842         * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
843
844         * elf.c (_bfd_elf_make_section_from_shdr): Take section index
845         and use it to set this_idx in bfd_elf_section_data.
846         (bfd_section_from_shdr): Pass shindex to
847         _bfd_elf_make_section_from_shdr.
848         (_bfd_elf_section_from_bfd_section): Use this_idx in
849         bfd_elf_section_data to find section index.
850
851         * elf32-arm.c (elf32_arm_section_from_shdr): Take section
852         index and pass it to _bfd_elf_make_section_from_shdr.
853         * elf32-i370.c(i370_elf_section_from_shdr): Likewise.
854         * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
855         * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
856         * elf32-v850.c (v850_elf_section_from_shdr): Likewise.
857         * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
858         * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
859         * elf64-x86-64.c (elf64_x86_64_section_from_shdr): Likewise.
860         * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
861         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
862
863 2005-03-19  Danny Smith <dannysmith@users.sourceforge.net>
864             Ross Ridge  <rridge@csclub.uwaterloo.ca>
865
866         * peicode.h (pe_ILF_build_a_bfd): Strip only one prefix
867         character in IMPORT_NAME_UNDECORATE and IMPORT_NAME_NOPREFIX
868         cases.  Add comment.
869
870 2005-03-18  H.J. Lu  <hongjiu.lu@intel.com>
871
872         * elflink.c (elf_mark_used_section): Remove check for special
873         sections.
874
875 2005-03-18  Andreas Schwab  <schwab@suse.de>
876
877         * elfxx-ia64.c (elfNN_ia64_install_value): Change type of insn
878         from bfd_vma to ia64_insn, remove broken cast.
879
880 2005-03-18  C Jaiprakash  <cjaiprakash@noida.hcltech.com>
881
882         * elf32-m68k.c (elf_cfv4e_plt0_entry): plt entry for coldfire v4e.
883         (elf_m68k_adjust_dynamic_symbol,elf_m68k_finish_dynamic_symbol,
884          elf_m68k_finish_dynamic_sections): Use it.
885
886 2005-03-17  Paul Brook <paul@codesourcery.com>
887             Dan Jacobowitz <dan@codesourcery.com>
888             Mark Mitchell  <mark@codesourcery.com>
889
890         * elf32-arm.c (elf32_arm_modify_segment_map): New function.
891         (elf32_arm_additional_program_headers): Likewise.
892         (elf_backend_modify_segment_map): Define.
893         (elf_backend_additional_program_headers): Likewise.
894         (elf32_arm_symbian_modify_segment_map): Use
895         elf32_arm_modify_segment_map.
896
897 2005-03-18  H.J. Lu  <hongjiu.lu@intel.com>
898
899         * elflink.c (elf_mark_used_section): Check bfd_is_const_section
900         for special sections.
901
902 2005-03-18  Alan Modra  <amodra@bigpond.net.au>
903
904         * elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete.
905         * elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add
906         section_sym_count param, and return number of section symbols.
907         (bfd_elf_size_dynamic_sections): Clear section symbol area of
908         .dynsym contents.  Don't bother calling swap_symbol_out on the
909         first all-zero dynsym.
910         (elf_mark_used_section): Formatting.  Avoid twiddling flags in
911         special sections like bfd_abs_section.
912         (bfd_elf_gc_sections): Spelling fix.
913
914 2005-03-16  Fred Fish  <fnf@specifixinc.com>
915
916         PR binutils/790
917         * dwarf2.c (read_indirect_string): Fix apparent typo, check
918         dwarf_str_buffer allocation, not dwarf_abbrev_buffer.
919
920 2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>
921
922         * elflink.c (elf_mark_used_section): New.
923         (bfd_elf_gc_sections): Call elf_gc_mark_section for
924         non-relocatable link if we don't do GC.
925
926 2005-03-16  Nick Clifton  <nickc@redhat.com>
927             Ben Elliston  <bje@au.ibm.com>
928
929         * configure.in (werror): New switch: Add -Werror to the
930         compiler command line.  Enabled by default.  Disable via
931         --disable-werror.
932         * configure: Regenerate.
933
934 2005-03-16  Nick Clifton  <nickc@redhat.com>
935
936         * ecoff.c: Convert to ISO C90 formatting.
937
938 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
939
940         * elf32-ppc.c: Divide file into general and linker specific
941         functions.  Sort linker functions into roughly the order in which
942         they are called by the ELF linker code.
943
944 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
945
946         * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED
947         on section.  Correct comment, and add FIXME.
948         (ppc_elf_additional_program_headers): Don't bump header count for
949         interp.  Test SEC_ALLOC, not SEC_LOAD, and don't test size.
950         (ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but
951         do allocate memory if they need it.
952
953 2005-03-15  Mikkel Krautz  <krautz@gmail.com>
954
955         * config.bfd (x86_64-elf): Add target.
956
957 2005-03-15  Alan Modra  <amodra@bigpond.net.au>
958
959         * po/es.po: Commit new Spanish translation.
960
961 2005-03-14  H.J. Lu  <hongjiu.lu@intel.com>
962
963         * elfxx-ia64.c (elfNN_ia64_relocate_section): Set symbo name
964         for global symbol when reporting overflow.
965
966 2005-03-11  Jakub Jelinek  <jakub@redhat.com>
967
968         * libbfd-in.h (_bfd_ar_spacepad): New prototype.
969         * libbfd.h: Rebuilt.
970         * archive.c (_bfd_ar_spacepad): New function.
971         (_bfd_construct_extended_name_table, _bfd_write_archive_contents,
972         bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp,
973         coff_write_armap): Use it.
974         (bfd_ar_hdr_from_filesystem): Likewise.  Fix HP-UX large
975         uid/gid support.
976         * archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
977
978 2005-03-10  Mark Kettenis  <kettenis@gnu.org>
979
980         * archive.c (_bfd_look_for_bfd_in_cache): Move declaration of
981         has_table to the start of the function.
982
983 2005-03-10  Ben Elliston  <bje@au.ibm.com>
984
985         * archive.c: Include hashtab.h.
986         (struct ar_cache): Rename `arelt' to `arbfd' and remove `next'.
987         (_bfd_look_for_bfd_in_cache): Reimplement using htab_find.
988         (hash_file_ptr): New function.
989         (eq_file_ptr): Likewise.
990         (_bfd_add_bfd_to_archive_cache): Reimplement using a hash table.
991         * libbfd-in.h: Include hashtab.h.
992         (struct artdata): Change `cache' member type to htab_t.
993         * libbfd.h: Rebuild.
994
995 2005-03-08  Daniel Jacobowitz  <dan@codesourcery.com>
996
997         * configure.in: Bump version to 2.16.90.
998         * configure: Regenerated.
999
1000 2005-03-07  Jakub Jelinek  <jakub@redhat.com>
1001
1002         * opncls.c (opncls_bread, opncls_bclose): Fix if pread resp.
1003         close is a function like macro in system headers.
1004
1005 2005-03-07  Alan Modra  <amodra@bigpond.net.au>
1006
1007         PR ld/778
1008         * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate
1009         _GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.
1010
1011 2005-03-06  Alan Modra  <amodra@bigpond.net.au>
1012
1013         * elf.c (elfcore_grok_win32pstatus): Warning fixes.
1014
1015 2005-03-05  Alan Modra  <amodra@bigpond.net.au>
1016
1017         * po/bfd.pot: Regenerate.
1018
1019 2005-03-05  Alan Modra  <amodra@bigpond.net.au>
1020
1021         * elf64-ppc.c (update_plt_info): Don't mark new ABI call syms
1022         with is_func.
1023         (func_desc_adjust): Force dot-syms local in executables as well
1024         as shared libs.
1025
1026 2005-03-04  David Daney  <ddaney@avtrex.com>
1027
1028         * elfxx-mips.c (mips_elf_calculate_relocation): Handle special
1029         '__gnu_local_gp' symbol used by gas -mno-shared.
1030
1031 2005-03-03  H.J. Lu  <hongjiu.lu@intel.com>
1032
1033         * elf-bfd.h (elf_backend_data): Add "const char *" to
1034         elf_backend_section_from_phdr.
1035
1036         * elf.c (bfd_section_from_phdr): Pass "proc" to the
1037         elf_backend_section_from_phdr hook.
1038
1039 2005-03-02  Daniel Jacobowitz  <dan@codesourcery.com>
1040             Joseph Myers  <joseph@codesourcery.com>
1041
1042         * elfxx-mips.c (struct mips_got_entry): Add tls_type.
1043         (struct mips_got_info): Add tls_gotno, tls_assigned_gotno,
1044         and tls_ldm_offset.
1045         (struct mips_elf_got_per_bfd_arg): Add global_count.
1046         (struct mips_elf_count_tls_arg): New.
1047         (struct mips_elf_hash_sort_data): Update comment for min_got_dynindx.
1048         (struct mips_elf_link_hash_entry): Add tls_type and tls_got_offset.
1049         (GOT_NORMAL, GOT_TLS_GD, GOT_TLS_LDM, GOT_TLS_IE)
1050         (GOT_TLS_OFFSET_DONE, GOT_TLS_DONE): Define.
1051         (TLS_RELOC_P): Define.
1052         (TP_OFFSET, DTP_OFFSET): Define.
1053         (dtprel_base, tprel_base): New functions.
1054         (mips_elf_link_hash_newfunc): Initialize tls_type.
1055         (mips_elf_got_entry_hash, mips_elf_got_entry_eq)
1056         (mips_elf_multi_got_entry_hash, mips_elf_multi_got_entry_eq): Handle
1057         TLS entries.
1058         (mips_tls_got_relocs, mips_elf_count_local_tls_relocs)
1059         (mips_elf_count_global_tls_entries, mips_elf_count_global_tls_relocs)
1060         (mips_elf_output_dynamic_relocation, mips_elf_initialize_tls_slots)
1061         (mips_tls_got_index): New functions.
1062         (mips_elf_local_got_index): Add new R_SYMNDX, H, and R_TYPE
1063         arguments.  Pass them to mips_elf_create_local_got_entry.  Use
1064         mips_tls_got_index.
1065         (mips_elf_global_got_index): Add new R_TYPE and INFO arguments.
1066         Handle TLS entries.
1067         (mips_elf_got_page, mips_elf_got16_entry): Update calls to
1068         mips_elf_create_local_got_entry.
1069         (mips_elf_create_local_got_entry): Add new R_SYMNDX, H, and R_TYPE
1070         arguments.  Handle TLS entries.
1071         (mips_elf_sort_hash_table_f): Add non-TLS assertions.
1072         (mips_elf_record_local_got_symbol): Add new TLS_FLAG argument.  Handle
1073         TLS entries.
1074         (mips_elf_record_global_got_symbol): Likewise.
1075         (mips_elf_make_got_per_bfd): Initialize new mips_got_info members.
1076         Count TLS entries.
1077         (mips_elf_merge_gots): Handle TLS entries when merging.
1078         (mips_elf_initialize_tls_index): New function.
1079         (mips_elf_set_global_got_offset): Handle TLS entries.
1080         (mips_elf_adjust_gp): Handle TLS.
1081         (mips_elf_multi_got): Remove redundant call to
1082         mips_elf_resolve_final_got_entries.  Initialize global_count.
1083         Correct a comment.  Initialize new TLS members of mips_got_info.
1084         Assign TLS GOT indexes for new GOTs.
1085         (mips_elf_create_got_section): Initialize new TLS members of
1086         mips_got_info.
1087         (mips_elf_calculate_relocation): Handle TLS relocs.
1088         (_bfd_mips_elf_check_relocs): Likewise.  Update calls to changed
1089         functions.
1090         (_bfd_mips_elf_always_size_sections): Handle TLS.
1091         (_bfd_mips_elf_size_dynamic_sections): Likewise.
1092         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.  Update calls to
1093         changed functions.
1094         (_bfd_mips_elf_copy_indirect_symbol): Copy tls_type.
1095         (_bfd_mips_elf_hide_symbol): Handle TLS.
1096         * elfn32-mips.c (elf_mips_howto_table_rel, elf_mips_howto_table_rela)
1097         (mips_reloc_map): Add TLS relocs.
1098         * elf32-mips.c (elf_mips_howto_table_rel, mips_reloc_map): Likewise.
1099         * elf64-mips.c (mips_elf64_howto_table_rel)
1100         (mips_elf64_howto_table_rela, mips_reloc_map): Likewise.
1101         * reloc.c: Define new MIPS TLS relocations.
1102         * libbfd.h, bfd-in2.h: Regenerated.
1103
1104 2005-03-02  Jan Beulich  <jbeulich@novell.com>
1105
1106         * Makefile.am: Add dependency of cache.o on libiberty.h.
1107         * cache.c: Include libiberty.h.
1108         (bfd_open_file): Use unlink_if_ordinary instead of unlink.
1109
1110 2005-03-01  Zack Weinberg  <zack@codesourcery.com>
1111
1112         * elf.c (bfd_section_from_shdr <default case>): Call
1113         elf_backend_section_from_shdr hook unconditionally, and return
1114         what it returns.
1115         (bfd_section_from_phdr): Similarly, for elf_backend_section_from_phdr.
1116         * elfxx-target.h (elf_backend_section_from_shdr)
1117         (elf_backend_section_from_phdr): Default to
1118         _bfd_elf_make_section_from_shdr and _bfd_elf_make_section_from_phdr
1119         respectively.
1120
1121 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
1122
1123         * targets.h: Typo fix.
1124         * bfd-in2.h: Regenerate.
1125
1126         * bout.c (b_out_write_object_contents): Don't use sizeof on host
1127         structs to size on-disk structures.
1128         (b_out_set_section_contents): Size the external struct, not the
1129         internal one for on-disk size.
1130         (b_out_sizeof_headers): Likewise.
1131
1132 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
1133
1134         * elf64-ppc.c (ppc64_elf_size_stubs): Override defined dot-sym
1135         entry points with the func descriptor as well as undefweak.
1136
1137 2005-02-28  Ross Ridge  <rridge@csclub.uwaterloo.ca>
1138
1139         * peicode.h (pe_ILF_build_a_bfd): Do not assume that an @ will be
1140         present when IMPORT_NAME_UNDOECRATE is used.
1141
1142 2005-02-28  H.J. Lu  <hongjiu.lu@intel.com>
1143
1144         PR 757
1145         * elf-bfd.h (_bfd_elf_merge_symbol): Add a pointer to unsigned
1146         int.
1147
1148         * elf32-sh-symbian.c (sh_symbian_relocate_section): Pass NULL
1149         to _bfd_elf_merge_symbol.
1150
1151         * elflink.c (_bfd_elf_merge_symbol): Use the pointer to
1152         unsigned int to return the alignment of the old common symbol
1153         in the dynamic object.
1154         (_bfd_elf_add_default_symbol): Pass NULL to
1155         _bfd_elf_merge_symbol.
1156         (elf_link_add_object_symbols): Pass &old_alignment to
1157         _bfd_elf_merge_symbol. Get the alignment of the new common
1158         symbol in the dynamic object.
1159
1160 2005-02-24  Ben Elliston  <bje@au.ibm.com>
1161
1162         * coffcode.h (coff_sym_filepos): Remove GNU960 conditional code.
1163         * format.c (bfd_check_format_matches): Likewise.
1164         * archive.c (BFD_GNU960_ARMAG): Likewise.
1165         (bfd_generic_archive_p): Likewise.
1166         (_bfd_write_archive_contents): Likewise.
1167
1168 2005-02-24  H.J. Lu  <hongjiu.lu@intel.com>
1169
1170         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.95.
1171         * configure: Regenerate.
1172
1173 2005-02-24  Julian Brown  <julian@sirius.codesourcery.com>
1174
1175         * elflink.c (elf_link_add_object_symbols): Force symbols in discarded
1176         COMDAT group sections to have default visibility.
1177
1178 2005-02-24  Alan Modra  <amodra@bigpond.net.au>
1179
1180         * coffcode.h (coff_print_aux): Warning fix.
1181         * elf-m10300.c (mn10300_elf_relax_section): Use section->id
1182         instead of section pointer to identify.
1183         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.  Allocate
1184         the correct size buffer for local sym mangling too.
1185         (h8300_bfd_link_add_symbols): Likewise.
1186         * elf32-sh-symbian.c (sh_symbian_process_embedded_commands): Fix
1187         warning.
1188         * elf32-sh64.c (shmedia_prepare_reloc): Use %B and %p in error message
1189         * elf32-xtensa.c (literal_value_hash): Warning fix.
1190         * versados.c (process_otr): Warning fix.
1191         (versados_canonicalize_reloc): Likewise.
1192         * vms-gsd.c (_bfd_vms_slurp_gsd): Warning fix.
1193         * vms.c (fill_section_ptr): Warning fix.
1194
1195 2005-02-23  H.J. Lu  <hongjiu.lu@intel.com>
1196
1197         * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Defined.
1198         * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Likewise.
1199
1200 2005-02-23  Nick Clifton  <nickc@redhat.com>
1201
1202         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Initialise
1203         the relvaddr field of the Elf32_crinfo structure.
1204
1205         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Initialise
1206         variables that are passed by reference to
1207         m68hc11_get_relocation_value in case that function does not
1208         initialise them.
1209
1210         * elf32-cr16c.c (cr16c_elf_final_link_relocate): Remove duplicated
1211         return statements and replace with a single return at the end of
1212         the function.  This helps pacify the flow analysis code in gcc 4.0.
1213
1214         * elf.c (_bfd_elf_compute_section_file_positions): Initialise
1215         strtab to avoid compile time warning.
1216
1217 2005-02-23  Ben Elliston  <bje@au.ibm.com>
1218
1219         * opncls.c (bfd_zalloc): Document this function.
1220
1221 2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
1222
1223         * coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with
1224         SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK.
1225         Replace SEC_SHARED with SEC_COFF_SHARED.
1226         (styp_to_sec_flags): Likewise.
1227
1228         * elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0.
1229         (TARGET_LITTLE_SYM): Likewise.
1230
1231         * section.c (SEC_ARCH_BIT_0): Removed.
1232         (SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with
1233         SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE.
1234         (SEC_SHARED): Renamed to ...
1235         (SEC_COFF_SHARED): This.
1236         (SEC_BLOCK): Renamed to ...
1237         (SEC_TIC54X_BLOCK): This.
1238         (SEC_CLINK): Renamed to ...
1239         (SEC_TIC54X_CLINK): This.
1240         (SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY,
1241         SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the
1242         end.
1243         * bfd-in2.h: Regenerated.
1244
1245 2005-02-21  Fred Fish  <fnf@specifixinc.com>
1246
1247         * dwarf2.c (find_abstract_instance_name): Call recursively
1248         to handle a DW_AT_specification.
1249
1250 2005-02-21  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
1251
1252         * elfxx-mips.c (ecoff_swap_rpdr_out, mips_elf_output_extsym,
1253         mips_elf_create_dynamic_relocation,
1254         _bfd_mips_elf_size_dynamic_sections, _bfd_mips_elf_final_link):
1255         Remove #if 0'd code.
1256
1257 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1258
1259         * Makefile.am: Run "make dep-am"
1260         * Makefile.in: Regenerate.
1261
1262 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1263
1264         * coffgen.c (bfd_coff_get_comdat_section): Check that
1265         coff_section_data isn't NULL.
1266
1267 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
1268
1269         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix.
1270         * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise.
1271         * coff-rs6000.c (xcoff_write_armap_big): Warning fixes.  Remove
1272         useless assignments.
1273         (xcoff_write_archive_contents_big): Likewise.
1274         (_bfd_xcoff_put_ldsymbol_name): Likewise.
1275         * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
1276         * coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
1277         * cofflink.c (process_embedded_commands): Warning fixes.
1278         * cpu-arm.c: Delete unnecessary prototypes.  Convert to C90.
1279         Warning fixes.
1280         * dwarf2.c: Warning fixes.
1281         * elf-bfd.h: Likewise.
1282         * elf-eh-frame.c: Likewise.
1283         * elf-strtab.c: Likewise.
1284         * elf.c: Likewise.
1285         * elf32-m68k.c: Likewise.
1286         * elf32-ppc.c: Likewise.
1287         * elf32-sh-symbian.c: Likewise.
1288         * elf32-sh.c: Delete unnecessary prototypes.  Warning fixes.
1289         * elf64-sh64.c: Likewise.
1290         * peicode.h: Likewise.
1291         * elf64-mmix.c: Warning fixes.
1292         * elfcode.h: Likewise.
1293         * elfxx-mips.c: Likewise.
1294         * libbfd-in.h: Likewise.
1295         * libbfd.c: Likewise.
1296         * mach-o.c: Likewise.
1297         * merge.c: Likewise.
1298         * mmo.c: Likewise.
1299         * opncls.c: Likewise.
1300         * pef.c: Likewise.
1301         * srec.c: Likewise.
1302         * vms-hdr.c: Likewise.
1303         * vms-tir.c: Likewise.
1304         * xtensa-isa.c: Likewise.
1305         * xtensa-modules.c: Likewise.
1306         * xsym.c: Likewise.
1307         (pstrcmp): Use correct choice of string lengths.  Fix return value.
1308         (bfd_sym_module_name): Correct string length.
1309         * bfd-in2.h: Regenerate.
1310         * libbfd.h: Regenerate.
1311
1312 2005-02-17  Alexandre Oliva  <aoliva@redhat.com>
1313
1314         * elf32-frv.c (elf32_frv_relocate_section): Remove warning from
1315         uninitialized check_segment[1] in TLSMOFF case.
1316         Reported by Alan Modra.
1317         (elf32_frv_relocate_section): Improve errors and warnings.
1318
1319 2005-02-17  Alan Modra  <amodra@bigpond.net.au>
1320
1321         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Fix warning.
1322
1323 2005-02-16  Alan Modra  <amodra@bigpond.net.au>
1324
1325         * coff-arm.c (coff_arm_is_local_label_name): Warning fix.
1326         * elf32-frv.c (frvfdpic_relocs_info_hash): Likewise.
1327         * pef.c (bfd_pef_scan): Don't ignore return value of
1328         bfd_pef_scan_start_address.
1329         * mach-o.c (bfd_mach_o_scan): Don't ignore return value of
1330         bfd_mach_o_scan_start_address.
1331         * elfxx-ia64.c (elfNN_ia64_relax_brl): Rewrite for 32-bit bfd_vma.
1332         * elfxx-mips.c: Remove unnecessary prototypes.
1333         (sort_dynamic_relocs_64): Abort if not BFD64.
1334
1335 2005-02-16  Alan Modra  <amodra@bigpond.net.au>
1336
1337         * elf64-ppc.c (ppc64_elf_edit_toc): Skip toc if size is zero.
1338         Skip toc reloc adjust if reloc_count is zero.
1339
1340 2005-02-15  Nigel Stephens  <nigel@mips.com>
1341             Maciej W. Rozycki  <macro@mips.com>
1342
1343         * elf32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
1344         reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
1345         R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1346         (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
1347         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1348         dst_mask.
1349         (mips16_gprel_reloc): Remove bit shuffling; call
1350         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1351         and _bfd_mips16_elf_reloc_shuffle() instead.
1352         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1353         (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1354         relocs.
1355         (mips_elf32_rtype_to_howto): Fetch MIPS16 howtos from
1356         elf_mips16_howto_table_rel.
1357         * elf64-mips.c (mips16_elf64_howto_table_rel): New array for
1358         MIPS16 REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16
1359         relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1360         (elf_mips16_jump_howto): Move into mips16_elf64_howto_table_rel.
1361         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1362         dst_mask.
1363         (mips16_elf64_howto_table_rela): New array for MIPS16 RELA
1364         reloc howtos.  Add R_MIPS16_26, R_MIPS16_GPREL, R_MIPS16_HI16 and
1365         R_MIPS16_LO16 relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16
1366         placeholders.
1367         (mips16_gprel_reloc): Remove bit shuffling; call
1368         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1369         and _bfd_mips16_elf_reloc_shuffle() instead.
1370         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1371         (bfd_elf64_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1372         relocs.
1373         (mips_elf64_rtype_to_howto): Fetch MIPS16 howtos from
1374         mips16_elf64_howto_table_rela or mips16_elf64_howto_table_rel.
1375         * elfn32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
1376         REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
1377         R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
1378         (elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
1379         (elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
1380         dst_mask.
1381         (mips16_gprel_reloc): Remove bit shuffling; call
1382         _bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
1383         and _bfd_mips16_elf_reloc_shuffle() instead.
1384         (mips16_reloc_map): New reloc map for MIPS16 relocs.
1385         (bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
1386         relocs.
1387         (mips_elf_n32_rtype_to_howto): Fetch MIPS16 howtos from
1388         elf_mips16_howto_table_rela or elf_mips16_howto_table_rel.
1389         * elfxx-mips.c (_bfd_mips16_elf_reloc_unshuffle): New function to
1390         handle bit shuffling for MIPS16 relocs.
1391         (_bfd_mips16_elf_reloc_shuffle): Likewise.
1392         (_bfd_mips_elf_lo16_reloc): Use _bfd_mips16_elf_reloc_unshuffle()
1393         and _bfd_mips16_elf_reloc_shuffle().
1394         (_bfd_mips_elf_generic_reloc): Likewise.
1395         (mips_elf_calculate_relocation): Likewise.  Handle R_MIPS16_HI16
1396         and R_MIPS16_LO16.
1397         (mips_elf_obtain_contents): Remove bit shuffling.
1398         (mips_elf_perform_relocation): Likewise; call
1399         _bfd_mips16_elf_reloc_unshuffle() and _bfd_mips16_elf_reloc_shuffle()
1400         instead.
1401         (_bfd_mips_elf_relocate_section): Likewise.  Handle R_MIPS16_HI16
1402         and R_MIPS16_LO16.
1403         * elfxx-mips.h (_bfd_mips16_elf_reloc_unshuffle): Declare.
1404         (_bfd_mips16_elf_reloc_shuffle): Likewise.
1405         * reloc.c (BFD_RELOC_MIPS16_HI16): New reloc.
1406         (BFD_RELOC_MIPS16_HI16_S): Likewise.
1407         (BFD_RELOC_MIPS16_LO16): Likewise.
1408         * bfd-in2.h: Regenerate.
1409         * libbfd.h: Regenerate.
1410
1411 2005-02-15  Jan Beulich  <jbeulich@novell.com>
1412
1413         * elfxx-ia64.c (ia64_howto_table): Correct strings for
1414         R_IA64_DTPMOD64[LM]SB.
1415
1416 2005-02-14  H.J. Lu  <hongjiu.lu@intel.com>
1417
1418         * elfxx-ia64.c (elfNN_ia64_relax_section): Allow relax
1419         backward branch in the same section.
1420         (elfNN_ia64_relocate_section): Inform users that the input
1421         section is too big to relax br instruction when overflow
1422         happens to R_IA64_PCREL21B, R_IA64_PCREL21BI, R_IA64_PCREL21M
1423         and R_IA64_PCREL21F.
1424
1425 2005-02-14 Orjan Friberg <orjanf@axis.com>
1426
1427         * elfcore.h (elf_core_file_p): Move the call to
1428         elf_backend_object_p to allow the correct machine to be set before
1429         processing the program headers.
1430
1431 2005-02-14  Nick Clifton  <nickc@redhat.com>
1432
1433         PR binutils/716
1434         * peicode.h (pe_bfd_copy_private_bfd_data): Copy the large address
1435         aware flag from the input bfd to the output bfd.
1436
1437 2005-02-11  Maciej W. Rozycki  <macro@mips.com>
1438
1439         * elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Reject
1440         R_MIPS_LITERAL relocations for external symbols.
1441         * elf64-mips.c (mips_elf64_literal_reloc): Likewise.
1442         * elfn32-mips.c (mips_elf_literal_reloc): Likewise.
1443
1444 2005-02-11  H.J. Lu  <hongjiu.lu@intel.com>
1445
1446         * bfd-in2.h: Rebuilt.
1447
1448 2005-02-11  Paul Brook  <paul@codesourcery.com>
1449
1450         * elf-bfd.h (struct elf_link_hash_table): Add
1451         is_relocatable_executable.
1452         * elf.c (_bfd_elf_link_hash_table_init): Initialize it.
1453         * elflink.c (bfd_elf_link_record_dynamic_symbol): Create local dynamic
1454         symbols in relocatable executables.
1455         (bfd_elf_record_link_assignment): Create dynamic section symbols in
1456         relocatable executables.
1457         (_bfd_elf_link_renumber_dynsyms): Ditto.
1458         (bfd_elf_final_link): Ditto.
1459         * elf32-arm.c (elf32_arm_final_link_relocate): Copy absolute
1460         relocations into relocatable executables.
1461         (elf32_arm_check_relocs): Crate dynamic sections for relocatable
1462         executables.  Also copy absolute relocations.
1463         (elf32_arm_adjust_dynamic_symbol): Don't create copy relocations
1464         in relocatable executables.
1465         (allocate_dynrelocs): Copy relocations for relocatable executables.
1466         Output dynamic symbols for symbols defined in linker scripts.
1467
1468 2005-02-11  Nick Clifton  <nickc@redhat.com>
1469
1470         * libbfd.c (read_signed_leb128): Use an unsigned type for 'shift'
1471         to avoid a compile time warning.
1472
1473         * coff-alpha.c (alpha_adjust_reloc_in): Remove redundant test from
1474         BFD_ASSERT.
1475
1476         * coff-tic4x.c (coff_rtype_to_howto): Move definition before
1477         inclusion of coffcode.h so that it is actually picked up.
1478
1479         * coffcode.h (coff_std_swap_table): Add an unused attribute in
1480         case it is not used.
1481
1482         * elf32-ip2k.c (ip2k_call_opcode, IS_CALL_OPCODE): Remove unused
1483         structure and macro.
1484
1485         * elf32-iq2000.c (iq2000_reloc_map): Remove unused structure and
1486         array.
1487
1488         * elf32-m32r.c (m32r_reloc_map_old): Use #ifdef USE_M32R_OLD_RELOC
1489         to protect the declaration of this array.
1490
1491         * xsym.c (bfd_sym_parse_contained_variables_table_entry_v32):
1492         Avoid call to memcpy with a size of 0.
1493
1494 2005-02-12  Alan Modra  <amodra@bigpond.net.au>
1495
1496         * elf64-ppc.c (toc_adjusting_stub_needed): Return true for
1497         old-style branches to undefined dot-symbols which will be
1498         satisfied by a plt call.
1499
1500 2005-02-11  Alan Modra  <amodra@bigpond.net.au>
1501
1502         * elf64-ppc.c (move_plt_plist): New function, extracted from..
1503         (ppc64_elf_copy_indirect_symbol): ..here.
1504         (func_desc_adjust): Use move_plt_plist.
1505
1506 2005-02-10  Paul Brook  <paul@codesourcery.com>
1507
1508         * elf32-arm.c (elf32_arm_final_link_relocate): Handle R_ARM_THM_PC9.
1509
1510 2005-02-10  Paul Brook  <paul@codesourcery.com>
1511
1512         * elflink.c (bfd_elf_record_link_assignment): Make hidden and internal
1513         symbols local.
1514         (elf_link_renumber_hash_table_dynsyms): Ignore local symbols.
1515         (elf_link_renumber_local_hash_table_dynsyms): New function.
1516         (_bfd_elf_link_renumber_dynsyms): Number local dynamic symbols.
1517
1518 2005-02-10  Jakub Jelinek  <jakub@redhat.com>
1519
1520         * bfd-in.h (BFD_LINKER_CREATED): Define.
1521         * bfd-in2.h: Rebuilt.
1522         * elflink.c (bfd_elf_size_dynamic_sections): Disregard
1523         BFD_LINKER_CREATED bfds when determining input bfds without
1524         .note.GNU-stack section.
1525
1526 2005-02-10  Maciej W. Rozycki  <macro@mips.com>
1527
1528         * elf64-mips.c (mips16_gprel_reloc): Update a comment.
1529         * elfn32-mips.c (mips16_gprel_reloc): Keep R_MIPS16_GPREL
1530         relocations against external symbols unchanged.
1531
1532 2005-02-08  Paul Brook  <paul@codesourcery.com>
1533
1534         * elflink.c (elf_link_input_bfd): Ignore symbols from null input
1535         sections.
1536
1537 2005-02-08  Hans-Peter Nilsson  <hp@axis.com>
1538
1539         * elflink.c (elf_link_add_object_symbols): Don't add "warning: "
1540         prefix here.
1541
1542 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
1543
1544         * elf64-mips.c: Fix formatting throughout.
1545
1546 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
1547
1548         * elfn32-mips.c (elf_mips_howto_table_rela): Fix a comment typo.
1549
1550 2005-02-07  Alexandre Oliva  <aoliva@redhat.com>
1551
1552         * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove special handling for
1553         *ABS*/*UND* sections.
1554         (elf32_frv_relocate_section): Move zero-addend-required error...
1555         (_frv_emit_got_relocs_plt_entries): ... here.  Report error for
1556         missing needed TLS section.
1557
1558 2005-02-07  Hans-Peter Nilsson  <hp@axis.com>
1559
1560         * aoutx.h (NAME(aout,find_nearest_line)): Correct case for N_SO
1561         being the last symbol.
1562         (aout_link_add_symbols): Just return TRUE if a warning
1563         symbol was last.
1564
1565 2005-02-07  Maciej W. Rozycki  <macro@mips.com>
1566
1567         * elf32-mips.c (mips_elf_gprel32_reloc): Reject
1568         R_MIPS_GPREL32 relocations against external symbols.
1569         * elf64-mips.c (mips_elf64_gprel32_reloc): Replace an incorrect
1570         comment.
1571
1572 2005-02-07  Alan Modra  <amodra@bigpond.net.au>
1573
1574         * elf-bfd.h (elf_string_from_elf_strtab): Delete macro.
1575         * elf.c (bfd_elf_string_from_elf_section): Expand occurrence of
1576         elf_string_from_elf_strtab.
1577         (_bfd_elf_setup_group_pointers, bfd_section_from_shdr): Likewise.
1578         (bfd_section_from_shdr): For SHT_SYMTAB, load SHT_SYMTAB_SHNDX too
1579         if it exists.  Don't do the reverse for SHT_SYMTAB_SHNDX.  For
1580         SHT_STRTAB, check whether the strtab is for symtab or dynsymtab by
1581         looking at cached symtab info first, before iterating over headers.
1582         For SHT_REL and SHT_RELA, load dynsymtab if needed.
1583         * elfcode.h (elf_object_p): Don't load section header stringtab
1584         specially.
1585
1586 2005-02-06  H.J. Lu  <hongjiu.lu@intel.com>
1587
1588         * elf32-i386.c (elf_i386_relocate_section): Disallow R_386_GOTOFF
1589         against protected function when building shared library.
1590
1591         PR 584
1592         * elf64-x86-64.c (is_32bit_relative_branch): New.
1593         (elf64_x86_64_relocate_section): Alllow R_X86_64_PC32 on a
1594         protected function symbol when building shared library for
1595         32bit relative branch instruction.
1596
1597 2005-02-06  Alan Modra  <amodra@bigpond.net.au>
1598
1599         * elf64-ppc.c (add_symbol_adjust): Don't create fake descriptor
1600         syms when doing a relocatable link.
1601         (ppc64_elf_gc_mark_hook): Check that syms are defined before looking
1602         at u.def.section.
1603         (ppc64_elf_tls_setup): Likewise.
1604         (ppc64_elf_edit_opd): Don't use an undefined func desc sym.
1605
1606 2005-02-04  Alan Modra  <amodra@bigpond.net.au>
1607
1608         * elf64-ppc.c (struct ppc_link_hash_entry): Add "fake".
1609         (link_hash_newfunc): Clear all locals using memset.
1610         (make_fdh): Remove flags param.  Always create fake func desc
1611         weak.  Link the descriptor with the code entry sym.
1612         (ppc64_elf_archive_symbol_lookup): Don't return fake syms.
1613         (add_symbol_adjust): Adjust make_fdh call.
1614         (func_desc_adjust): Likewise.  Twiddle any pre-existing fake
1615         descriptor to strong undefined if code entry is strong.
1616
1617 2005-02-04  Alan Modra  <amodra@bigpond.net.au>
1618
1619         * elflink.c (bfd_elf_record_link_assignment): Do "provide" symbol
1620         lookup here.  Set to new before calling bfd_link_repair_undef_list.
1621         (elf_smash_syms): Check that u.undef.weak isn't the not_needed bfd.
1622
1623 2005-02-03  Alan Modra  <amodra@bigpond.net.au>
1624
1625         * linker.c (_bfd_link_hash_newfunc): Set all local fields.
1626
1627 2005-02-03  Alan Modra  <amodra@bigpond.net.au>
1628
1629         * linker.c (_bfd_generic_link_add_one_symbol): Set u.undef.weak.
1630         * elflink.c (elf_smash_syms): Restore symbols that were undefweak
1631         before the as-needed lib was loaded.  Abort on unexpected refs.
1632
1633 2005-02-02  Alan Modra  <amodra@bigpond.net.au>
1634
1635         * elflink.c (elf_smash_syms): Expand comments.
1636         (elf_link_add_object_symbols): Only call elf_smash_syms for
1637         as-needed dynamic objects.
1638
1639         * elfxx-ia64.c (elfNN_ia64_new_elf_hash_entry): Don't clear
1640         everything, just the field specific to ia64.
1641         * elf64-hppa.c (elf64_hppa_new_dyn_hash_entry): Likewise.
1642
1643 2005-02-01  Alan Modra  <amodra@bigpond.net.au>
1644
1645         * elf64-ppc.c (func_desc_adjust): Move code creating func desc sym to..
1646         (make_fdh): ..here.  New function.  Don't set BSF_OBJECT for
1647         undefined syms.
1648         (struct add_symbol_adjust_data): New.
1649         (add_symbol_adjust): Make an undefweak func desc for old ABI
1650         objects to link with --as-needed shared libs.  Return fail status.
1651         Don't adjust old ABI func entry sym to weak if func desc syms
1652         isn't defined.
1653         (ppc64_elf_check_directives): Adjust call to add_symbol_adjust,
1654         and return status.
1655
1656 2005-02-01  Hans-Peter Nilsson  <hp@axis.com>
1657
1658         * cpu-cris.c (get_compatible): Rearrange disabled code and comment
1659         for clarity.
1660
1661 2005-02-01  Alan Modra  <amodra@bigpond.net.au>
1662
1663         * elf64-ppc.c (ppc64_elf_check_directives): Move undefs list fixup..
1664         * linker.c (bfd_link_repair_undef_list): ..to new function, but don't
1665         remove anything but new and undefweak.
1666         * elflink.c (_bfd_elf_link_create_dynamic_sections): Override any
1667         existing _DYNAMIC.
1668         (_bfd_elf_create_dynamic_sections): Formatting.
1669         (bfd_elf_record_link_assignment): Call bfd_link_repair_undef_list.
1670         (_bfd_elf_merge_symbol): Don't handle as-needed syms here.
1671         (struct elf_smash_data): New.
1672         (elf_smash_syms): New function.
1673         (elf_link_add_object_symbols): Call elf_smash_syms.  Don't add
1674         unneeded dynamic objects to loaded list.
1675         (elf_link_output_extsym): Don't handle as-needed here.  Strip
1676         bfd_link_hash_new symbols.
1677         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
1678         delref when dynindx is already -1.
1679         * elf64-alpha.c (elf64_alpha_output_extsym): Strip bfd_link_hash_new
1680         symbols.
1681         * elfxx-mips.c (mips_elf_output_extsym): Likewise.
1682
1683 2005-02-01  Ben Elliston  <bje@au.ibm.com>
1684
1685         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Redefine.
1686
1687 2005-02-01  Ben Elliston  <bje@au.ibm.com>
1688
1689         * aout-arm.c, aout-target.h, aoutx.h, archive.c, armnetbsd.c,
1690         bfd-in.h, bfdio.c, coff-alpha.c, coff-arm.c, coff-h8300.c,
1691         coff-i860.c, coff-mcore.c, coff-or32.c, coff-ppc.c, coff-sh.c,
1692         coff-sparc.c, coffcode.h, coffgen.c, cofflink.c, cpu-cris.c,
1693         cpu-h8500.c, cpu-ns32k.c, ecoff.c, ecofflink.c, elf.c,
1694         elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-hppa.c,
1695         elf32-i860.c, elf32-ip2k.c, elf32-m32r.c, elf32-sh.c,
1696         elf32-v850.c, elf64-mips.c, elf64-sparc.c, elflink.c,
1697         i386aout.c, i386msdos.c, i386os9k.c, ieee.c, mach-o.c,
1698         nlm32-sparc.c, oasys.c, opncls.c, pdp11.c, pe-mips.c, peXXigen.c,
1699         pef.c, peicode.h, reloc.c, riscix.c, section.c, simple.c, som.c,
1700         sparclynx.c, targets.c, vms-misc.c, vms-tir.c, xsym.c, doc/chew.c,
1701         hosts/delta68.h, hosts/vaxbsd.h: Remove #if 0'd code
1702         throughout. Similarly, collapse #if 1'd code.
1703
1704 2005-02-01  Ben Elliston  <bje@au.ibm.com>
1705
1706         * elf-bfd.h (bfd_elf_discard_group): Remove.
1707         * elf.c (bfd_elf_discard_group): Likewise.
1708         * elfxx-target.h (bfd_elfNN_bfd_discard_group): Remove macro.
1709
1710 2005-01-31  Richard Sandiford  <rsandifo@redhat.com>
1711
1712         * elf-bfd.h (elf_backend_data): Add elf_backend_eh_frame_address_size.
1713         (_bfd_elf_eh_frame_address_size): Declare.
1714         * elfxx-target.h (elf_backend_eh_frame_address_size): Define a default.
1715         (elfNN_bed): Initialize elf_backend_eh_frame_address_size.
1716         * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Declare.
1717         (elf_backend_eh_frame_address_size): Define.
1718         * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): New function.
1719         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Get the address
1720         size from the new backend hook.
1721         (_bfd_elf_write_section_eh_frame): Likewise.
1722         (_bfd_elf_eh_frame_address_size): New function.
1723
1724 2005-01-31  Andrew Cagney  <cagney@gnu.org>
1725
1726         * configure: Regenerate to track ../gettext.m4.
1727
1728 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1729
1730         * elf32-arm.c (elf32_arm_symbian_special_sections): Do not set
1731         SHF_WRITE for .init_array, .fini_array, and .preinit_array.
1732
1733 2005-01-31  Nick Clifton  <nickc@redhat.com>
1734
1735         * confg.bfd: Make targets scheduled for obsoletion (m68k-lynxos,
1736         sparc-lynxos, vax-vms) be obsolete.
1737
1738 2005-01-28  Daniel Jacobowitz  <dan@codesourcery.com>
1739
1740         * elf-bfd.h (struct elf_backend_data): Add minpagesize.
1741         * elf32-arm.c (ELF_MINPAGESIZE): Define.
1742         * elf32-ppc.c (ELF_MINPAGESIZE): Define.
1743         * elfcode.h (elf_object_p): Use minpagesize instead of
1744         maxpagesize.
1745         * elfxx-target.h (ELF_MINPAGESIZE): Default to ELF_MAXPAGESIZE.
1746         (elfNN_bed): Include ELF_MINPAGESIZE.
1747
1748 2005-01-28  Julian Brown  <julian@codesourcery.com>
1749
1750         * bin-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
1751         * bin-in2.h (bfd_elf32_arm_set_target_relocs): Update prototype.
1752         * elf32-arm.c (elf32_arm_link_hash_table): Add fix_v4bx flag.
1753         (bfd_elf32_arm_set_target_relocs): Add formal parameter fix_v4bx for
1754         passing flag value from ld. Set flag value in global hash table entry.
1755         (elf32_arm_final_link_relocate): Add code to implement R_ARM_V4BX
1756         relocation.
1757
1758 2005-01-27  Andrew Cagney  <cagney@gnu.org>
1759
1760         * configure: Regenerate to track ../gettext.m4 change.
1761
1762 2005-01-25  Mark Mitchell  <mark@codesourcery.com>
1763
1764         * elf32-arm.c (elf_backend_default_use_rela_p): Define to zero for
1765         SymbianOS.
1766
1767 2005-01-25  Alexandre Oliva  <aoliva@redhat.com>
1768
1769         2004-12-10  Alexandre Oliva  <aoliva@redhat.com>
1770         * elf32-frv.c (elf32_frv_relocate_section): Force local binding
1771         for TLSMOFF.
1772         * reloc.c: Add R_FRV_TLSMOFF.
1773         * elf32-frv.c (elf32_frv_howto_table): Likewise.
1774         (frv_reloc_map, frv_reloc_type_lookup): Map it.
1775         (elf32_frv_relocate_section): Handle it.
1776         (elf32_frv_check_relocs): Likewise.
1777         * libbfd.h, bfd-in2.h: Rebuilt.
1778         2004-11-26  Alexandre Oliva  <aoliva@redhat.com>
1779         * elf32-frv.c (_frvfdpic_emit_got_relocs_plt_entries): Don't crash
1780         when given an undefweak TLS symbol.  Fix constant TLS PLT entries
1781         such that they return the constant in gr9.
1782         (_frvfdpic_relax_tls_entries): Don't crash for undefweak TLS
1783         symbols.
1784         (_frvfdpic_size_got_plt): Set _cooked_size of dynamic sections.
1785         too, such that they shrink on relaxation.
1786         (elf32_frvfdpic_finish_dynamic_sections): Check __ROFIXUP_END__ as
1787         marking the position right past the _GLOBAL_OFFSET_TABLE_ value.
1788         (_frvfdpic_assign_plt_entries): Shrink constant TLS PLT entries
1789         if we can guarantee the use of 16-bit constants.
1790         2004-11-10  Alexandre Oliva  <aoliva@redhat.com>
1791         Introduce TLS support for FR-V FDPIC.
1792         * reloc.c: Add TLS relocations.
1793         * elf32-frv.c (elf32_frv_howto_table): Add TLS relocations.
1794         (elf32_frv_rel_tlsdesc_value_howto): New.
1795         (elf32_frv_rel_tlsoff_howto): New.
1796         (frv_reloc_map): Add new mappings.
1797         (struct frvfdpic_elf_link_hash_table): Add pointer to summary
1798         reloc information.
1799         (frvfdpic_dynamic_got_plt_info): New.
1800         (frvfdpic_plt_tls_ret_offset): New.
1801         (ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE): Move earlier.
1802         (struct _frvfdpic_dynamic_got_info): Likewise.  Add TLS members.
1803         (struct _frvfdpic_dynamic_got_plt_info): Likewise.
1804         (FRVFDPIC_SYM_LOCAL): Regard symbols defined in the absolute
1805         section as local.
1806         (struct frvfdpic_relocs_info): Add TLS fields.
1807         (frvfdpic_relocs_info_hash): Warning clean up.
1808         (frvfdpic_relocs_info_find): Initialize tlsplt_entry.
1809         (frvfdpic_pic_merge_early_relocs_info): Merge TLS fields.
1810         (FRVFDPIC_TLS_BIAS): Define.
1811         (tls_biased_base): New.
1812         (_frvfdpic_emit_got_relocs_plt_entries): Deal with TLS
1813         relocations.
1814         (frv_reloc_type_lookup): Likewise.
1815         (frvfdpic_info_to_howto_rel): Likewise.
1816         (elf32_frv_relocate_section): Likewise.
1817         (_frv_create_got_section): Create the PLT section here.
1818         (elf32_frvfdpic_create_dynamic_sections): Not here.
1819         (_frvfdpic_count_nontls_entries): Move out of...
1820         (_frvfdpic_count_got_plt_entries): ... here.
1821         (_frvfdpic_count_tls_entries): Likewise.  Add TLS support.
1822         (_frvfdpic_count_relocs_fixups): Likewise.  Add relaxation
1823         support.
1824         (_frvfdpic_relax_tls_entries): New.
1825         (_frvfdpic_compute_got_alloc_data): Add TLS support.
1826         (_frvfdpic_get_tlsdesc_entry): New.
1827         (_frvfdpic_assign_got_entries): Add TLS support.
1828         (_frvfdpic_assign_plt_entries): Likewise.
1829         (_frvfdpic_reset_got_plt_entries): New.
1830         (_frvfdpic_size_got_plt): Move out of...
1831         (elf32_frvfdpic_size_dynamic_sections): ... here.
1832         (_frvfdpic_relax_got_plt_entries): New.
1833         (elf32_frvfdpic_relax_section): New.
1834         (elf32_frvfdpic_finish_dynamic_sections): Add TLS sanity check.
1835         (elf32_frv_check_relocs): Add TLS support.
1836         (bfd_elf32_bfd_relax_section): Define for FDPIC.
1837         * libbfd.h, bfd-in2.h: Rebuilt.
1838
1839 2005-01-25  Alan Modra  <amodra@bigpond.net.au>
1840
1841         * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound): Only include
1842         loadable reloc sections.
1843         (_bfd_elf_canonicalize_dynamic_reloc): Likewise.
1844         (_bfd_elf_get_synthetic_symtab): Return 0 if no dynamic syms.
1845
1846 2005-01-25  Alan Modra  <amodra@bigpond.net.au>
1847
1848         * elflink.c (elf_link_add_object_symbols): Don't create link dynamic
1849         sections immediately when linking shared libs.  Instead, wait until
1850         we know a lib is needed.
1851         (_bfd_elf_link_create_dynstrtab): Extract from..
1852         (_bfd_elf_link_create_dynamic_sections_): ..here.
1853         (elf_add_dt_needed_tag): Call _bfd_elf_link_create_dynstrtab and
1854         _bfd_elf_link_create_dynamic_sections.  Add abfd param.  Allow
1855         for non-existent .dynamic.
1856         (elf_link_output_extsym): Don't complain about undefined symbols
1857         in as-needed dynamic libs that aren't actually linked.
1858
1859 2005-01-24  Andrew Cagney  <cagney@gnu.org>
1860
1861         * configure: Regenerate, ../gettext.m4 was updated.
1862
1863 2005-01-21  Ben Elliston  <bje@au.ibm.com>
1864
1865         * aout-encap.c: Remove unused file.
1866
1867 2005-01-19  H.J. Lu  <hongjiu.lu@intel.com>
1868
1869         PR 679
1870         * elflink.c (_bfd_elf_dynamic_symbol_p): Only protected
1871         non-function symbols are local.
1872         (_bfd_elf_symbol_refs_local_p): Likewise.
1873
1874 2005-01-18  Alan Modra  <amodra@bigpond.net.au>
1875
1876         * bfd.c (bfd_link_just_syms): Add abfd param.
1877         * bfd-in2.h: Regenerate.
1878
1879 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
1880
1881         * elf-eh-frame.c (skip_cfa_op, skip_non_nops): New functions.
1882         (_bfd_elf_discard_section_eh_frame): Use them to interpret the CFA
1883         instructions.  If the amount of padding is known, reduce the size
1884         of the CIE or FDE by that amount.
1885
1886 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
1887
1888         * elf-bfd.h (struct cie): Use bfd_vmas for code_align, ra_column and
1889         augmentation_size.  Use bfd_signed_vmas for data_align.
1890         * elf-eh-frame.c (read_uleb128, read_sleb128): Delete in favor of...
1891         (read_byte, skip_leb128, read_uleb128, read_sleb128): ...these new
1892         functions.  Don't read past the end of the enclosing CIE or FDE.
1893         (skip_bytes): New utility function.
1894         (_bfd_elf_discard_section_eh_frame): Use new functions, adding more
1895         sanity checking.
1896         (_bfd_elf_write_section_eh_frame): Use new functions.
1897
1898 2005-01-17  Richard Sandiford  <rsandifo@redhat.com>
1899
1900         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use an
1901         assert-style REQUIRE() macro to handle sanity checks.
1902
1903 2005-01-17  H.J. Lu  <hongjiu.lu@intel.com>
1904
1905         * dwarf2.c (dwarf2_debug): Move info_ptr_unit to ...
1906         (comp_unit): Here.
1907         (read_unsigned_leb128): Removed.
1908         (read_signed_leb128): Removed.
1909         (find_abstract_instance_name): Updated.
1910         (parse_comp_unit): Accept info_ptr_unit.
1911         (_bfd_dwarf2_find_nearest_line): Set info_ptr_unit for each
1912         comp unit and pass it to parse_comp_unit.
1913
1914         * elf-eh-frame.c (read_unsigned_leb128): Moved to ...
1915         (read_signed_leb128): Moved to ...
1916         * libbfd.c: Here.
1917
1918         * libbfd-in.h (read_unsigned_leb128): New prototype.
1919         (read_signed_leb128): Likewise.
1920         * libbfd.h: Regenerated.
1921
1922 2005-01-17  Andrew Stubbs  <andrew.stubbs@st.com>
1923             Nick Clifton   <nickc@redhat.com>
1924
1925         * cpu-sh.c (bfd_to_arch_table): Change arch_sh1_up to arch_sh_up,
1926         arch__sh4_nofp_up to arch_sh4_nofpu_up and arch_sh4a_nofp_up to
1927         arch_sh4a_nofpu_up in order to match the external names and make the
1928         testsuite's job easier.
1929         * archuires.c: Rename bfd_mach_sh2a_fake? to more meaningful
1930         names.
1931         * bfd-in2.h: Regenerate.
1932
1933 2005-01-15  Andrew Cagney  <cagney@gnu.org>
1934
1935         * bfd.m4: New file.
1936         * acinclude.m4: Move BFD_NEED_DECLARATION,
1937         BFD_HAVE_SYS_PROCFS_TYPE and BFD_HAVE_SYS_PROCFS_TYPE_MEMBER to
1938         the new file bfd.m4.  Include ../bfd/bfd.m4.
1939         * configure: Re-generate.
1940
1941 2005-01-12  Alan Modra  <amodra@bigpond.net.au>
1942
1943         * elf32-ppc.c (ppc_elf_howto_raw): Delete RELAX32* entries.
1944         (ppc_elf_relax_section): Use PLT variants of RELAX32 relocs for
1945         reaching PLT.
1946         (ppc_elf_relocate_section): Handle R_PPC_RELAX32_PLT and
1947         R_PPC_RELAX32PC_PLT.
1948
1949 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
1950
1951         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Follow indirect and warning
1952         symbols.
1953         * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
1954         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
1955         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
1956         * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
1957         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
1958         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
1959         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
1960         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
1961         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
1962         * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.
1963         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
1964         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
1965         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
1966         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
1967
1968 2005-01-11  Alan Modra  <amodra@bigpond.net.au>
1969
1970         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Correct
1971         .dynsbss flags.
1972
1973 2005-01-10  Inderpreet Singh <inderpreetb@noida.hcltech.com>
1974
1975         * archures.c: Define bfd_mach_maxq10 and bfd_mach_maxq20.
1976         * bfd-in2.h:  Regenerate.
1977         * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Add code
1978         to support these new machine values.
1979         * cpu-maxq.c (bfd_maxq10_arch): New architecture definition for
1980         the maxq10.
1981         (bfd_maxq_arch): Update values for the maxq20.
1982
1983 2005-01-10  Eric Botcazou  <ebotcazou@libertysurf.fr>
1984
1985         * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): When linking a
1986         non-shared object, do not reserve space in .plt and .rela.plt for
1987         regular symbols neither defined nor referenced in shared objects.
1988
1989 2005-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
1990
1991         * elf32-sparc.c (elf32_sparc_link_hash_table_create): Use bfd_zmalloc
1992         to zero the structure.
1993         (create_got_section): Use BFD_ASSERT instead of abort.
1994         * elf64-sparc.c (struct sparc64_elf_link_hash_table): New 'sgot' and
1995         'srelgot' fields.
1996         (create_got_section): New function.
1997         (sparc64_elf_create_dynamic_sections): Likewise.
1998         (sparc64_elf_check_relocs): Invoke create_got_section instead of
1999         _bfd_elf_create_got_section.  Use the sgot and srelgot shortcuts.
2000         (sparc64_elf_size_dynamic_sections): Use the srelgot shortcut.
2001         (sparc64_elf_relocate_section): Use the sgot and srelgot shortcuts.
2002         (sparc64_elf_finish_dynamic_symbol): Likewise.
2003         (sparc64_elf_finish_dynamic_sections): Use the sgot shortcut.
2004         (elf_backend_create_dynamic_sections): Define to
2005         sparc64_elf_create_dynamic_sections.
2006
2007 2005-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
2008
2009         * elf32-sparc.c (elf32_sparc_omit_section_dynsym): New function.
2010         (elf_backend_omit_section_dynsym): Define to it.
2011         * elf64-sparc.c (sparc64_elf_omit_section_dynsym): New function.
2012         (elf_backend_omit_section_dynsym): Define to it.
2013
2014 2005-01-07  Jakub Jelinek  <jakub@redhat.com>
2015
2016         * bfd/elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into
2017         PT_DYNAMIC segment, unless .dynamic.
2018
2019 2005-01-06  Paul Brook  <paul@codesourcery.com>
2020
2021         * config.bfd: Add entry for arm-*-vxworks and arm-*-windiss.
2022         * configure.in: Add bfd_elf32_{big,little}arm_vxworks_vec.
2023         * configure: Regenerate.
2024         * elf32-arm.c: Add VxWorks target bfd.
2025         (USE_REL): Remove.
2026         (elf32_arm_link_hash_table): Add use_rel.
2027         (elf32_arm_link_hash_table_create, elf32_arm_final_link_relocate,
2028         elf32_arm_relocate_section): Replace USE_REL with runtime check.
2029         Correct offset calculation for RELA case.
2030         (elf_backend_may_use_rel_p, elf_backend_may_use_rela_p,
2031         elf_backend_default_use_rela_p, elf_backend_rela_normal): Define.
2032         (elf32_arm_vxworks_link_hash_table_create): New function.
2033         * targets.c (bfd_elf32_bigarm_vxworks_vec): Add declaration.
2034         (bfd_elf32_littlearm_vxworks_vec): Ditto.
2035         (_bfd_target_vector): Add bfd_elf32_{big,little}arm_vxworks_vec.
2036
2037 2005-01-06  Alan Modra  <amodra@bigpond.net.au>
2038
2039         * elf64-ppc.c (struct ppc_link_hash_table): Add no_multi_toc and
2040         multi_toc_needed.
2041         (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Define.
2042         (ppc64_elf_check_relocs): Update references to has_gp_reloc.
2043         (ppc64_elf_setup_section_lists): Add no_multi_toc parm, set htab bit.
2044         (ppc64_elf_next_toc_section): Heed no_multi_toc.
2045         (ppc64_elf_reinit_toc): Set multi_toc_needed.
2046         (toc_adjusting_stub_needed): Rewrite.
2047         (ppc64_elf_next_input_section): Use multi_toc_needed to shortcut
2048         toc tests.  Adjust for toc_adjusting_stub_needed changes.
2049         (ppc64_elf_size_stubs): Update references to has_gp_reloc.
2050         * elf64-ppc.h (ppc64_elf_setup_section_lists): Update prototype.
2051         * section.c: Expand comment on backend bits.
2052         * bfd-in2.h: Regenerate.
2053         * libbfd.h: Regenerate.
2054
2055 2005-01-06  Alan Modra  <amodra@bigpond.net.au>
2056
2057         * elf64-ppc.c (ppc64_elf_size_stubs): When determining need for
2058         toc adjusting stub, do not test source section flags.
2059
2060 2005-01-05  Eric Botcazou  <ebotcazou@libertysurf.fr>
2061
2062         * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows
2063         from STABS debugging sections again.
2064
2065 2005-01-05  Fred Fish  <fnf@specifixinc.com>
2066
2067         * dwarf2.c (struct dwarf2_debug): Add info_ptr_unit member.
2068         (find_abstract_instance_name): New function.
2069         (scan_unit_for_functions): Handle DW_TAG_inlined_subroutine.
2070         (scan_unit_for_functions): Handle DW_AT_abstract_origin.
2071         (_bfd_dwarf2_find_nearest_line): Initialize info_ptr_unit.
2072
2073 2004-12-31  Paul Brook  <paul@copdesourcery.com>
2074
2075         * elf32-arm.c (elf32_arm_symbian_plt_entry): Fix comment typo.
2076
2077 2004-12-31  Alan Modra  <amodra@bigpond.net.au>
2078
2079         * reloc.c (BFD_RELOC_AVR_LDI, BFD_RELOC_AVR_6, BFD_RELOC_AVR_6_ADIW):
2080         Commit missing changes from 2004-12-22.
2081         * bfd-in2.h: Regenerate.
2082
2083 2004-12-23  Tomer Levi  <Tomer.Levi@nsc.com>
2084
2085         * elf32-crx.c (elf32_crx_relax_section): Support 'bcop' relaxation.
2086
2087 2004-12-21  Kris Warkentin  <kewarken@qnx.com>
2088
2089         * elf.c (elfcore_grok_nto_gregs): Change name to elfcore_grok_nto_regs.
2090         Add 'base' argument for constructing register sections.  Reformat.
2091         (elfcore_grok_nto_note): Call elfcore_grok_nto_regs for both
2092         gp and fp regs.  Reformat.
2093
2094 2004-12-22  Klaus Rudolph  <lts-rudolph@gmx.de>
2095
2096         * reloc.c: Add new relocs R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW.
2097         * bfd-in2.h: Regenerate.
2098         * elf32-avr.c (elf_avr_nowto_table): Add the new relocs.
2099         (avr_reloc_map): Likewise.
2100         (avr_final_link_relocate): Likewise.
2101
2102 2004-12-22  Alan Modra  <amodra@bigpond.net.au>
2103
2104         * elflink.c (_bfd_elf_merge_symbol): Treat old definitions from
2105         as-needed dynamic libs as undefined.
2106         (elf_link_add_object_symbols): Remove DYN_AS_NEEDED from as-needed
2107         libs when finding they are needed.
2108
2109 2004-12-20  Alan Modra  <amodra@bigpond.net.au>
2110
2111         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add opd_relocs.
2112         (opd_entry_value): Use opd_relocs if available.
2113         (ppc64_elf_relocate_section): Don't set reloc_done.  Instead
2114         copy .opd relocations to opd_relocs.
2115         (ppc64_elf_edit_toc): Set rel_hdr.sh_size after editing relocs.
2116
2117 2004-12-16  Richard Sandiford  <rsandifo@redhat.com>
2118
2119         * reloc.c (BFD_RELOC_V850_LO16_SPLIT_OFFSET): New bfd_reloc_code_type.
2120         * elf32-v850.c (v850_elf_howto_table): Add entry for
2121         R_V850_LO16_SPLIT_OFFSET.
2122         (v850_elf_reloc_map): Map it to BFD_RELOC_V850_LO16_SPLIT_OFFSET.
2123         (v850_elf_perform_lo16_relocation): New function, extracted from...
2124         (v850_elf_perform_relocation): ...here.  Use it to handle
2125         R_V850_LO16_SPLIT_OFFSET.
2126         (v850_elf_check_relocs, v850_elf_final_link_relocate): Handle
2127         R_V850_LO16_SPLIT_OFFSET.
2128         * libbfd.h, bfd-in2.h: Regenerate.
2129
2130 2004-12-14  P.J. Darcy  <darcypj@us.ibm.com>
2131
2132         * config.bfd: Add s390x-ibm-tpf support.
2133
2134 2004-12-14  Tomer Levi  <Tomer.Levi@nsc.com>
2135
2136         * elf32-crx.c (elf32_crx_relax_delete_bytes): Add 'struct bfd_link_info *'
2137         to prototype, to make hash info available.
2138         Prevent wrapped symbols from being adjusted twice.
2139
2140 2004-12-14  Richard Sandiford  <rsandifo@redhat.com>
2141
2142         * elfxx-mips.c (mips_elf_calculate_relocation): Don't report an
2143         overflow for calls to undefined weak symbols.
2144
2145 2004-12-11  Alan Modra  <amodra@bigpond.net.au>
2146
2147         * elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that
2148         canonical sections syms have a name.
2149
2150 2004-12-11  Alan Modra  <amodra@bigpond.net.au>
2151
2152         * elf64-ppc.c (opd_entry_value): Don't use cached relocs if they
2153         have been adjusted for output.
2154         (ppc64_elf_relocate_section): Mark sections with reloc_done.
2155
2156 2004-12-10  Alan Modra  <amodra@bigpond.net.au>
2157
2158         * elf.c (bfd_elf_sym_name): Rename from bfd_elf_local_sym_name and
2159         add symtab_hdr param.
2160         (group_signature): Update calls.
2161         * elf-bfd.h (bfd_elf_sym_name): Update.
2162         * elf32-ppc.c (ppc_elf_relocate_section): Update.
2163         * elf64-ppc.c (ppc64_elf_edit_opd, ppc64_elf_edit_toc): Update.
2164         (ppc64_elf_relocate_section): Update.
2165         * elflink.c (elf_link_input_bfd): Update.
2166
2167 2004-12-10  Jakub Jelinek  <jakub@redhat.com>
2168
2169         * elf.c (bfd_elf_local_sym_name): Avoid crashes with invalid
2170         st_shndx on STT_SECTION sections.
2171
2172 2004-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
2173
2174         * elfcode.h (elf_slurp_reloc_table_from_section): Don't canonicalize
2175         ELF section symbols.
2176
2177 2004-12-09  Ian Lance Taylor  <ian@wasabisystems.com>
2178
2179         * elfxx-mips.c (mips_elf_calculate_relocation): For R_MIPS_JALR,
2180         return a real value, unless it is a PLT symbol.
2181         (mips_elf_perform_relocation): On the RM9000, turn a jal into a
2182         bal if possible.
2183
2184         * elfn32-mips.c (elf_mips_howto_table_rela): Change dst_mask of
2185         R_MIPS_JALR entry to 0.
2186
2187         * archures.c: Define bfd_mach_mips9000.
2188         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_9000.
2189         (mips_set_isa_flags): Handle bfd_mach_mips9000.
2190         * cpu-mips.c (I_mips9000): Define.
2191         (arch_info_struct): Add case for bfd_mach_mips9000.
2192         * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mips9000.
2193         * bfd-in2.h: Regenerate.
2194
2195 2004-12-08  Ian Lance Taylor  <ian@wasabisystems.com>
2196
2197         * elfxx-mips.c (mips_elf_calculate_relocation): Test for R_MIPS_26
2198         overflow.
2199
2200 2004-12-07  Ben Elliston  <bje@gnu.org>
2201
2202         * netbsd-core.c (netbsd_core_file_p): Make `i' unsigned.
2203
2204 2004-12-06  Daniel Jacobowitz  <dan@debian.org>
2205
2206         Suggested by Fergal Daly <fergal@esatclear.ie>:
2207         * simple.c (simple_dummy_multiple_definition): New function.
2208         (bfd_simple_get_relocated_section_contents): Use it.
2209
2210 2004-12-03  Jan Beulich  <jbeulich@novell.com>
2211
2212         * elf.c (elf_find_function): Don't use the last file symbol ever,
2213         seen, but the last one seen prior to the symbol being reported.
2214         Don't report a filename at all for global symbols when that might
2215         be ambiguous/wrong.
2216
2217 2004-12-01  Paul Brook  <paul@codesourcery.com>
2218
2219         * elf32-arm.c (elf32_arm_copy_private_bfd_data): Set EI_OSABI.
2220         (elf32_arm_post_process_headers): Set EI_OSABI depending on ABI
2221         version.
2222
2223 2004-12-01  Paul Brook  <paul@codesourcery.com>
2224
2225         * elflink.c (elf_link_add_object_symbols): Make symbols from discarded
2226         sections undefined.
2227
2228 2004-11-30  Paul Brook  <paul@codesourcery.com>
2229
2230         * elf32-arm.c (struct elf32_arm_link_hash_table): Remove
2231         no_pipeline_knowledge
2232         (elf32_arm_link_hash_table_create): Ditto.
2233         (bfd_elf32_arm_process_before_allocation): Ditto.
2234         (elf32_arm_final_link_relocate): Ditto.  Remove oabi relocation
2235         handling.
2236         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
2237         prototype.
2238         * bfd-in2.h: Regenerate.
2239
2240 2004-11-30  Randolph Chung  <tausq@debian.org>
2241
2242         * elf32-hppa.c (elf32_hppa_grok_prstatus): New function.
2243         (elf32_hppa_grok_psinfo): New function.
2244         (elf_backend_grok_prstatus): Define.
2245         (elf_backend_grok_psinfo): Define.
2246
2247 2004-11-24  H.J. Lu  <hongjiu.lu@intel.com>
2248
2249         PR 574:
2250         * elfcode.h (elf_slurp_symbol_table): Handle STT_TLS.
2251
2252 2004-11-24  Paul Brook  <paul@codesourcery.com>
2253
2254         * elf.c (assign_section_numbers): Number SHT_GROUP sections first.
2255
2256 2004-11-24  Paul Brook  <paul@codesourcery.com>
2257
2258         * elf32-arm.c (elf32_arm_swap_symbol_in): New function.
2259         (elf32_arm_swap_symbol_out): New function.
2260         (elf32_arm_size_info): Add.
2261         (elf_backend_size_info): Define.
2262
2263 2004-11-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2264
2265         * hpux-core.c (hpux_core_core_file_p): Use offsetof macro in calls to
2266         make_bfd_asection.
2267
2268 2004-11-19  Alan Modra  <amodra@bigpond.net.au>
2269
2270         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Warning fix.
2271         * elf32-iq2000.c (iq2000_reloc_type_lookup): C90 function decl.
2272         * nlmcode.h (nlm_write_object_contents): Warning fix.
2273
2274 2004-11-18  Bob Wilson  <bob.wilson@acm.org>
2275
2276         * elf32-xtensa.c (ebb_propose_action): Fix argument order.
2277
2278 2004-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
2279
2280         * elf32-arm.c (PLT_THUMB_STUB_SIZE): Define.
2281         (elf32_arm_plt_thumb_stub): New.
2282         (struct elf32_arm_link_hash_entry): Add plt_thumb_refcount
2283         and plt_got_offset.
2284         (elf32_arm_link_hash_traverse): Fix typo.
2285         (elf32_arm_link_hash_table): Add obfd.
2286         (elf32_arm_link_hash_newfunc): Initialize new fields.
2287         (elf32_arm_copy_indirect_symbol): Copy plt_thumb_refcount.
2288         (elf32_arm_link_hash_table_create): Initialize obfd.
2289         (record_arm_to_thumb_glue): Mark the glue as a local ARM function.
2290         (record_thumb_to_arm_glue): Mark the glue as a local Thumb function.
2291         (bfd_elf32_arm_get_bfd_for_interworking): Verify that the
2292         interworking BFD is not dynamic.
2293         (bfd_elf32_arm_process_before_allocation): Handle R_ARM_PLT32.  Do
2294         not emit glue for PLT references.
2295         (elf32_arm_final_link_relocate): Handle Thumb functions.  Do not
2296         emit glue for PLT references.  Support the Thumb PLT prefix.
2297         (elf32_arm_gc_sweep_hook): Handle R_ARM_THM_PC22 and
2298         plt_thumb_refcount.
2299         (elf32_arm_check_relocs): Likewise.
2300         (elf32_arm_adjust_dynamic_symbol): Handle Thumb functions and
2301         plt_thumb_refcount.
2302         (allocate_dynrelocs): Handle Thumb PLT references.
2303         (elf32_arm_finish_dynamic_symbol): Likewise.
2304         (elf32_arm_symbol_processing): New function.
2305         (elf_backend_symbol_processing): Define.
2306
2307 2004-11-16  Richard Sandiford  <rsandifo@redhat.com>
2308
2309         * elf-bfd.h (eh_cie_fde): Add new fields: add_augmentation_size and
2310         add_fde_encoding.  Remove need_relative.
2311         * elf-eh-frame.c (extra_augmentation_string_bytes)
2312         (extra_augmentation_data_bytes, size_of_output_cie_fde): New functions.
2313         (_bfd_elf_discard_section_eh_frame): Consider changing the FDE encoding
2314         in cases where the CIE has no existing 'R' augmentation.  Use
2315         size_of_output_cie_fde when assigning offsets.  Use the final offset
2316         as the new section size.
2317         (_bfd_elf_eh_frame_section_offset): Remove need_relative handling.
2318         Account for any extra augmentation bytes in the returned offset.
2319         (_bfd_elf_write_section_eh_frame): Rework so that the entries are
2320         moved before being modified.  Pad growing entries with DW_CFA_nops.
2321         Add 'z' and 'R' augmentations as directed by add_augmentation_size
2322         and add_fde_encoding.
2323
2324 2004-11-15  Mark Mitchell  <mark@codesourcery.com>
2325
2326         * elf32-arm.c (elf32_arm_relocate_section): Use
2327         arm_real_reloc_type.
2328
2329 2004-11-16  Richard Sandiford  <rsandifo@redhat.com>
2330
2331         * elfxx-mips.c (mips_elf_create_dynamic_relocation): Return early
2332         for discard relocations; don't add an R_MIPS_NONE to the main body
2333         of .rel.dyn.
2334
2335 2004-11-04  Paul Brook  <paul@codesourcery.com>
2336
2337         * elf-bfd.h (_bfd_elf_slurp_version_tables): Update prototype.
2338         * elf.c (_bfd_elf_print_private_bfd_data): Pass extra argument.
2339         (_bfd_elf_slurp_version_tables): Add extra argument.  Create extra
2340         default version definition for unversioned symbols.
2341         * elfcode.h (elf_slurp_symbol_table): Pass extra argument.
2342         * elflink.c (elf_link_add_object_symbols): Pass extra argument to
2343         _bfd_elf_slurp_version_tables.  Set default version for unversioned
2344         imported symbols.
2345
2346 2004-11-15  Paul Brook  <paul@codesourcery.com>
2347
2348         * elflink.c (elf_link_add_object_symbols): Don't assume version
2349         indices are consecutive.
2350
2351 2004-11-14  Richard Sandiford  <rsandifo@redhat.com>
2352
2353         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Deal with
2354         composite relocations against the personality data.
2355
2356 2004-11-13  Paul Brook  <paul@codesourcery.com>
2357
2358         * bfd/elf32-arm.c (elf32_arm_final_link_relocate): Resolve
2359         R_ARM_PREL31 relocations to PLT entries.
2360         (elf32_arm_relocate_section, elf32_arm_gc_sweep_hook): Ditto.
2361         (elf32_arm_check_relocs): Ditto.
2362
2363 2004-11-12  Bob Wilson  <bob.wilson@acm.org>
2364
2365         * xtensa-isa.c (xtensa_interface_class_id): New.
2366
2367 2004-11-11  Bob Wilson  <bob.wilson@acm.org>
2368
2369         * elf32-xtensa.c (property_table_compare): Remove assertion about
2370         entries with the same address and non-zero size.
2371         (xtensa_read_table_entries): Report such entries as errors.
2372
2373 2004-11-11  Mark Mitchell  <mark@codesourcery.com>
2374
2375         * elf32-arm.c (elf32_arm_final_link_relocate): Correct logic for
2376         R_ARM_RELATIVE on Symbian OS.
2377
2378 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
2379
2380         * som.c (som_bfd_print_private_bfd_data): New function.
2381         (som_object_setup): Save the auxiliary header.  Don't assume that
2382         zero is an invalid entry point for a shared library.
2383         (som_object_p): Allocate the auxiliary header on the heap.
2384
2385         * elf32-arm.c (elf32_arm_begin_write_processing): Do not use a K&R
2386         declaration.
2387         (elf32_arm_symbian_modify_segment_map): Likewise.
2388
2389 2004-11-09  Daniel Jacobowitz  <dan@debian.org>
2390
2391         From David Poole <daveml@mbuf.com>:
2392         * elf32-arm.c (elf32_arm_readonly_dynrelocs): New function.
2393         (elf32_arm_size_dynamic_sections): Call it.
2394
2395 2004-11-09  Alan Modra  <amodra@bigpond.net.au>
2396
2397         * Makefile.am (SOURCE_HFILES): Remove elf32-arm.h.
2398         (ALL_MACHINES_CFILES): Fix typo.
2399         * Makefile.in: Regenerate.
2400         * po/SRC-POTFILES.in: Regenerate.
2401
2402 2004-11-08  Mark Mitchell  <mark@codesourcery.com>
2403
2404         * elf32-arm.c (elf32_arm_final_link_relocate): When generating an
2405         R_ARM_RELATIVE relocation for Symbian OS, mention the section
2406         symbol in the relocation.
2407
2408 2004-11-08  Inderpreet Singh  <inderpreetb@nioda.hcltech.com>
2409             Vineet Sharma  <vineets@noida.hcltech.com>
2410
2411         * coff-maxq.c: New File.
2412         * cpu-maxq.c: New File.
2413         * coffcode.h: Likewise.
2414         * config.bfd: Likewise.
2415         * configure.in (maxqcoff_vec): New target vector.
2416         * Makefile.am: Add support for maxq target.
2417         * configure.in: Likewise.
2418         * archures.c:. Likewise.
2419         * targets.c: Likewise.
2420         * bfd_in2.h : Regenerated.
2421         * Makefile.in: Regenerated.
2422         * configure: Regenerated.
2423         * doc/Makefile.in: Regenerated.
2424
2425 2004-11-08  Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
2426
2427         * coff-i386.c (coff_i386_reloc): Fix weak symbols.
2428         * cofflink.c (_bfd_coff_link_input_bfd): Don't process
2429         C_NT_WEAK aux entries.
2430         (_bfd_coff_generic_relocate_section): Handle undefined
2431         aliases.
2432
2433 2004-11-07  Andreas Schwab  <schwab@suse.de>
2434
2435         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Use
2436         SYMBOL_CALLS_LOCAL and check for undefweak symbols with
2437         non-default visibility.
2438
2439 2004-11-01  Mark Mitchell  <mark@codesourcery.com>
2440
2441         * elf32-arm.c (elf32_arm_symbian_begin_write_processing): Clear
2442         D_PAGED.
2443         (elf32_arm_symbian_modify_segment_map): Don't
2444         reset includes_filehdr and includes_phdrs here.
2445
2446 2004-11-04  Daniel Jacobowitz  <dan@debian.org>
2447
2448         * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Replace
2449         elfarm-nabi with elf32-arm.  Remove elfarm-oabi.
2450         (elf32-arm.lo): Replace elfarm-nabi.lo rule.  Remove elf32-arm.h
2451         dependency.
2452         * config.bfd: Move arm-*-oabi* and thumb-*-oabi* from obsolete list
2453         to a new removed list.  Remove normal configuration stanzas.
2454         * configure.in: (bfd_elf32_bigarm_vec, bfd_elf32_bigarm_symbian_vec)
2455         (bfd_elf32_littlearm_symbian_vec, bfd_elf32_littlearm_vec): Replace
2456         elfarm-nabi.lo with elf32-arm.lo.
2457         (bfd_elf32_bigarm_oabi_vec, bfd_elf32_littlearm_oabi_vec): Remove.
2458         * elf32-arm.c: Renamed from elfarm-nabi.c.  Inline elf32-arm.h.
2459         * elf32-arm.h: Remove.
2460         * elfarm-oabi.c: Remove.
2461         * targets.c (_bfd_target_vector): Remove bfd_elf32_bigarm_oabi_vec
2462         and bfd_elf32_littlearm_oabi_vec.
2463         * aclocal.m4, Makefile.in, configure, doc/Makefile.in: Regenerated.
2464
2465 2004-11-04  Hans-Peter Nilsson  <hp@axis.com>
2466
2467         * config.bfd: Support crisv32-*-* like cris-*-*.
2468         * archures.c (bfd_mach_cris_v0_v10, bfd_mach_cris_v32)
2469         (bfd_mach_cris_v10_v32): New macros.
2470         * cpu-cris.c: Tweak formatting.
2471         (get_compatible): New function.
2472         (N): New macro.
2473         (bfd_cris_arch_compat_v10_v32, bfd_cris_arch_v32): New
2474         bfd_arch_info_type:s.
2475         (bfd_cris_arch): Use bfd_mach_cris_v0_v10 for member mach,
2476         get_compatible for member compatible and link bfd_cris_arch_v32 as
2477         next.
2478         * elf32-cris.c (cris_elf_pcrel_reloc)
2479         (cris_elf_set_mach_from_flags): New functions.
2480         (cris_elf_howto_table) <R_CRIS_8_PCREL, R_CRIS_16_PCREL>
2481         <R_CRIS_32_PCREL>: Use cris_elf_pcrel_reloc.
2482         (cris_elf_grok_prstatus, cris_elf_grok_psinfo): Give correct
2483         numbers for bfd_mach_cris_v32.
2484         (PLT_ENTRY_SIZE_V32): New macro.
2485         (elf_cris_plt0_entry): Drop last comma in initializer.
2486         (elf_cris_plt0_entry_v32, elf_cris_plt_entry_v32)
2487         (elf_cris_pic_plt0_entry_v32, elf_cris_pic_plt_entry_v32): New
2488         PLT initializers.
2489         (cris_elf_relocate_section): Change all "%B(%A)" messages to
2490         "%B, section %A".
2491         (elf_cris_finish_dynamic_symbol): Do V32-specific PLT entries.
2492         (elf_cris_finish_dynamic_sections): Similar.
2493         (elf_cris_adjust_dynamic_symbol): Similar.
2494         (cris_elf_check_relocs): Change all "%B(%A)" messages to "%B,
2495         section %A".
2496         <switch with PIC relocs>: Emit error and return FALSE for
2497         bfd_mach_cris_v10_v32.
2498         <case R_CRIS_8_PCREL, case R_CRIS_16_PCREL, case R_CRIS_32_PCREL>:
2499         Emit warning when generating textrel reloc.
2500         (cris_elf_object_p): Call cris_elf_set_mach_from_flags.
2501         (cris_elf_final_write_processing): Set flags according to mach.
2502         (cris_elf_print_private_bfd_data): Display
2503         EF_CRIS_VARIANT_COMMON_V10_V32 and EF_CRIS_VARIANT_V32.
2504         (cris_elf_merge_private_bfd_data): Drop variables old_flags,
2505         new_flags.  Don't call cris_elf_final_write_processing.  Don't
2506         look at the actual elf header flags at all; use
2507         bfd_get_symbol_leading_char to check ibfd, obfd.  Trap difference
2508         in bfd_get_mach for ibfd and obfd and handle merging of compatible
2509         objects.
2510         (bfd_elf32_bfd_copy_private_bfd_data): Define.
2511         * reloc.c (BFD_RELOC_CRIS_SIGNED_8, BFD_RELOC_CRIS_UNSIGNED_8)
2512         (BFD_RELOC_CRIS_SIGNED_16, BFD_RELOC_CRIS_UNSIGNED_16)
2513         (BFD_RELOC_CRIS_LAPCQ_OFFSET): New relocs.
2514         * bfd-in2.h, libbfd.h: Regenerate.
2515
2516 2004-11-04  Alan Modra  <amodra@bigpond.net.au>
2517
2518         * elf64-ppc.h (ppc64_elf_edit_toc): Declare.
2519         * elf64-ppc.c (struct ppc_link_hash_entry <adjust_done>): Update
2520         comment.
2521         (struct adjust_toc_info): New.
2522         (adjust_toc_syms, ppc64_elf_edit_toc): New functions.
2523
2524 2004-11-03  Bob Wilson  <bob.wilson@acm.org>
2525
2526         * elf.c (assign_file_positions_for_segments): Set next_file_pos even
2527         if there are no segments.
2528
2529 2004-11-02  Daniel Jacobowitz  <dan@debian.org>
2530
2531         * config.bfd: Mark arm-*-oabi and thumb-*-oabi as obsolete.
2532
2533 2004-11-02  Nick Clifton  <nickc@redhat.com>
2534
2535         * elf32-iq2000.c: Convert to ISO C90 formatting.
2536
2537 2004-11-02  Hans-Peter Nilsson  <hp@axis.com>
2538
2539         * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.
2540
2541 2004-10-28  H.J. Lu  <hongjiu.lu@intel.com>
2542
2543         * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle weak
2544         undefined symbols for R_IA64_SECREL32MSB, R_IA64_SECREL32LSB,
2545         R_IA64_SECREL64MSB and R_IA64_SECREL64LSB.
2546
2547 2004-10-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2548
2549         * elf32-sh.c (tpoff): Take alignment into account.
2550
2551 2004-10-28  Nick Clifton  <nickc@redhat.com>
2552
2553         * elf32-iq2000.c (iq2000_elf_relocate_section): Do nothing when
2554         performing a relocatable link.
2555         (iq2000_elf_object_p): Do not set elf_bad_symtab.  This is only
2556         for MIPS ports under Irix.
2557
2558 2004-10-27  Richard Earnshaw  <rearnsha@arm.com>
2559
2560         * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Handle
2561         R_ARM_CALL and R_ARM_JUMP24 as aliases of R_ARM_PC24.
2562         (elf32_arm_final_link_relocate): Ditto.
2563         (arm_add_to_rel, elf32_arm_relocate_section): Ditto.
2564         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto
2565         (elf32_arm_adjust_dynamic_symbol): Ditto.
2566         * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_CALL and
2567         R_ARM_JUMP32.  Move R_ARM_R{REL32,ABS32,PC24,BASE}...
2568         (elf32_arm_r_howto): ... To here.
2569         (elf32_arm_howto_from_type): Use elf32_arm_r_howto.
2570
2571 2004-10-26  H.J. Lu  <hongjiu.lu@intel.com>
2572
2573         PR 475
2574         * elfxx-ia64.c (elfNN_ia64_relocate_section): Correct
2575         R_IA64_SECREL32MSB, R_IA64_SECREL32LSB, R_IA64_SECREL64MSB
2576         and R_IA64_SECREL64LSB.
2577
2578 2004-10-26  Paul Brook  <paul@codesourcery.com>
2579
2580         * elflink.c (elf_finalize_dynstr): Skip shared aux structure.
2581         (bfd_elf_size_dynamic_sections): Create default version definition.
2582         (elf_link_output_extsym): Adjust for default symbol version.
2583
2584 2004-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
2585
2586         * mmo.c: Adjust to ISO C.
2587
2588         * mmo.c (mmo_write_section_description): New function broken out
2589         of mmo_internal_write_section.
2590         (mmo_internal_write_section): For each of .text and .data, call
2591         mmo_write_section_description before outputting contents if it has
2592         nontrivially deducible vma or contents.
2593         (mmo_has_leading_or_trailing_zero_tetra_p): New function.
2594         (mmo_canonicalize_symtab): Adjust absolute symbols to .data
2595         symbols if found within the .data address range.
2596
2597 2004-10-24  Daniel Jacobowitz  <dan@debian.org>
2598
2599         * opncls.c (bfd_close): Return TRUE for BFD_IN_MEMORY.
2600
2601 2004-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
2602
2603         * mmo.c (File Layout): Correct place of misplaced blurb about
2604         special data.
2605
2606 2004-10-22  Mark Kettenis  <kettenis@gnu.org>
2607
2608         * config.bfd: Add mips64*-*-openbsd.
2609
2610 2004-10-21  Bob Wilson  <bob.wilson@acm.org>
2611
2612         * elf32-xtensa.c (ebb_propose_action): Put declarations before
2613         statements.
2614
2615 2004-10-21  H.J. Lu  <hongjiu.lu@intel.com>
2616
2617         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.94.
2618         * configure: Regenerate.
2619
2620 2004-10-21  H.J. Lu  <hongjiu.lu@intel.com>
2621
2622         PR 463
2623         * aoutx.h (aout_link_input_section_std): Pass proper hash entry
2624         to linker reloc_overflow callback.
2625         (aout_link_input_section_ext): Likewise.
2626         (aout_link_reloc_link_order): Likewise.
2627         * coff-a29k.c (coff_a29k_relocate_section): Likewise.
2628         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
2629         Likewise.
2630         (alpha_relocate_section): Likewise.
2631         * coff-arm.c (coff_arm_relocate_section): Likewise.
2632         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
2633         * coff-h8500.c (extra_case): Likewise.
2634         * coff-i960.c (coff_i960_relocate_section): Likewise.
2635         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2636         * coff-mips.c (mips_relocate_section): Likewise.
2637         * coff-or32.c (coff_or32_relocate_section): Likewise.
2638         * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2639         * coff-rs6000.c (xcoff_ppc_relocate_section): Likewise.
2640         * coff-sh.c (sh_relocate_section): Likewise.
2641         * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2642         * coff-w65.c (w65_reloc16_extra_cases): Likewise.
2643         * coff-z8k.c (extra_case): Likewise.
2644         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
2645         * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
2646         (_bfd_coff_generic_relocate_section): Likewise.
2647         * ecoff.c (ecoff_reloc_link_order): Likewise.
2648         * elf-hppa.h (elf_hppa_relocate_section): Likewise.
2649         * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
2650         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2651         * elf32-arm.h (elf32_arm_relocate_section): Likewise.
2652         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
2653         * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
2654         * elf32-cris.c (cris_elf_relocate_section): Likewise.
2655         * elf32-crx.c (elf32_crx_relocate_section): Likewise.
2656         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
2657         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
2658         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2659         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
2660         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
2661         * elf32-i370.c (i370_elf_relocate_section): Likewise.
2662         * elf32-i386.c (elf_i386_relocate_section): Likewise.
2663         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
2664         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
2665         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
2666         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2667         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
2668         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2669         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2670         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
2671         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
2672         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2673         * elf32-s390.c (elf_s390_relocate_section): Likewise.
2674         * elf32-sh.c (sh_elf_relocate_section): Likewise.
2675         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
2676         * elf32-v850.c (v850_elf_relocate_section): Likewise.
2677         * elf32-vax.c (elf_vax_relocate_section): Likewise.
2678         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
2679         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
2680         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
2681         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2682         * elf64-s390.c (elf_s390_relocate_section): Likewise.
2683         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2684         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
2685         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
2686         * elflink.c (elf_reloc_link_order): Likewise.
2687         * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
2688         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
2689         (_bfd_elf_mips_get_relocated_section_contents): Likewise.
2690         * linker.c (_bfd_generic_reloc_link_order): Likewise.
2691         * pdp11.c (pdp11_aout_link_input_section): Likewise.
2692         (aout_link_reloc_link_order): Likewise.
2693         * reloc.c (bfd_generic_get_relocated_section_contents):
2694         Likewise.
2695         * xcofflink.c (xcoff_reloc_link_order): Likewise.
2696         * simple.c (simple_dummy_reloc_overflow): Updated.
2697
2698 2004-10-20  Andreas Schwab  <schwab@suse.de>
2699
2700         * elf32-m68k.c (elf_m68k_plt_sym_val): New function.
2701         (elf_backend_plt_sym_val): Define.
2702
2703 2004-10-19  Danny Smith  <dannysmith@users.sourceforege.net>
2704
2705         * config.bfd: Set targ_underscore=yes for PE COFF targets
2706
2707 2004-10-19  Alan Modra  <amodra@bigpond.net.au>
2708
2709         * elf64-ppc.c (opd_entry_value): Handle --just-symbols objects.
2710         (ppc64_elf_edit_opd): Likewise.
2711
2712 2004-10-18  Mark Mitchell  <mark@codesourcery.com>
2713
2714         * elfarm-nabi.c (ELF_DYNAMIC_SEC_FLAGS): Add comment.
2715         * elflink.c (_bfd_elf_create_dynamic_sections): For a loaded PLT,
2716         set SEC_ALLOC and SEC_LOAD.
2717
2718 2004-10-18  Nick Clifton  <nickc@redhat.com>
2719
2720         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Compute
2721         'name' for relocs against both local and global symbols.
2722
2723 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
2724
2725         * bfd-in2.h: Regenerate.
2726         * bfd.c (struct bfd): Add no_export.
2727         * elflink.c (elf_link_add_object_symbols): Handle no_export.
2728
2729 2004-10-15  Alan Modra  <amodra@bigpond.net.au>
2730
2731         * config.bfd: Whitespace cleanup.
2732         * Makefile.am: Run "make dep-am"
2733         * Makefile.in: Regenerate.
2734
2735 2004-10-15  Jakub Jelinek  <jakub@redhat.com>
2736
2737         * elflink.c (struct already_linked_section): Removed.
2738         (try_match_symbols_in_sections, already_linked): Removed.
2739         (_bfd_elf_section_already_linked): Skip ^\.gnu\.linkonce\.[^.]*\.
2740         prefix of section names when finding already_linked_table
2741         chain.  Compare section names.  Instead of calling already_linked,
2742         do it inline and only for sections in the same already_linked_list.
2743
2744 2004-10-15  Alan Modra  <amodra@bigpond.net.au>
2745
2746         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Add "info"
2747         parameter.  If called after _bfd_elf_write_section_eh_frame,
2748         don't allow a -2 return unless need_* bit is already set, and
2749         handle offsets adjusted for output_offset.
2750         * elf-bfd.h (_bfd_elf_eh_frame_section_offset): Update prototype.
2751         * elf.c (_bfd_elf_section_offset): Update call.
2752
2753 2004-10-13  H.J. Lu  <hongjiu.lu@intel.com>
2754
2755         PR 440
2756         * coffcode.h (coff_compute_section_file_positions): Cast to
2757         bfd_vma when computing page alignment.
2758
2759 2004-10-13  Mark Mitchell  <mark@codesourcery.com>
2760
2761         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
2762         offsets, not VMAs, for DT_VERSYM, DT_VERDEF, DT_VERNEED.
2763
2764 2004-10-12  Mark Mitchell  <mark@codesourcery.com>
2765
2766         * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Make .rel.plt
2767         relocations use a virtual address, not a section offset.
2768
2769 2004-10-12  Bob Wilson  <bob.wilson@acm.org>
2770
2771         * elf32-xtensa.c (elf_xtensa_get_private_bfd_flags): Delete.
2772         (narrow_instruction, widen_instruction): Remove unnecessary calls to
2773         xtensa_format_encode.
2774         (ebb_propose_action): Inline call to ebb_add_proposed_action.
2775         (ebb_add_proposed_action): Delete.
2776
2777 2004-10-12  Bob Wilson  <bob.wilson@acm.org>
2778
2779         * elf32-xtensa.c: Use ISO C90 formatting.
2780
2781 2004-10-12  Paul Brook  <paul@codesourcery.com>
2782
2783         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Rephrase error
2784         message.
2785
2786 2004-10-12  Paul Brook  <paul@codesourcery.com>
2787
2788         * elf32-arm.h: Support EABI version 4 objects.
2789
2790 2004-10-12  Alan Modra  <amodra@bigpond.net.au>
2791
2792         PR 325
2793         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Place last in chain.
2794         Don't mark as default.
2795         (bfd_x86_64_arch): Don't mark as default.
2796
2797 2004-10-12  Alan Modra  <amodra@bigpond.net.au>
2798
2799         * elflink.c (enum action_discarded): New.
2800         (elf_section_complain_discarded): Delete.
2801         (elf_action_discarded): New function subsuming the above and also
2802         controlling reloc behaviour.
2803         (elf_link_input_bfd): Use it.
2804
2805 2004-10-11  Jakub Jelinek  <jakub@redhat.com>
2806
2807         * elf.c (bfd_section_from_shdr): Handle SHT_GNU_LIBLIST.
2808         (special_sections): Add .gnu.liblist and .gnu.conflict.
2809         (assign_section_numbers): Handle SHT_GNU_LIBLIST.
2810
2811 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
2812
2813         PR 233
2814         * elflink.c (elf_link_input_bfd): Try harder to support
2815         relocations against symbols in removed linkonce sections.
2816
2817 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
2818
2819         * elflink.c (elf_link_input_bfd): Revert PR 354 change.
2820
2821         PR 354
2822         * elflink.c (elf_link_input_bfd): Check that relocs in SEC_ALLOC
2823         sections do not reference symbols in non-SEC_ALLOC sections.
2824
2825 2004-10-11  Alan Modra  <amodra@bigpond.net.au>
2826
2827         PR 437
2828         * elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections.
2829         (_bfd_elf_link_omit_section_dynsym): Formatting.
2830
2831 2004-10-10  Alan Modra  <amodra@bigpond.net.au>
2832
2833         * libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while.
2834         * libbfd.h: Regnerate.
2835         * elf32-cris.c: Add missing semicolon to BFD_ASSERTs.
2836         * elf32-frv.c: Likewise.
2837         * elf32-m32r.c: Likewise.
2838         * elf32-ppc.c: Likewise.
2839         * elf64-hppa.c: Likewise.
2840         * elfxx-ia64.c: Likewise.
2841         * opncls.c: Likewise.
2842
2843 2004-10-10  Alan Modra  <amodra@bigpond.net.au>
2844
2845         * elf-bfd.h (struct eh_frame_hdr_info): Add offsets_adjusted.
2846         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust
2847         offsets stored in struct eh_cie_fde entries before doing other
2848         work.
2849
2850         * elf-bfd.h (struct eh_cie_fde): Add cie_inf, remove sec.
2851         (struct eh_frame_hdr_info): Add last_cie_inf, remove last_cie_offset.
2852         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete code
2853         setting offsets for removed CIEs.  Don't set "sec", instead set
2854         cie_inf for FDEs.  Keep a pointer to last struct eh_cie_fde for a
2855         CIE in hdr_info.  Only set make_relative and make_lsda_relative
2856         for CIEs.  Use pointers rather than array indices.
2857         (_bfd_elf_eh_frame_section_offset): Test/set make_relative,
2858         make_lsda_relative, need_* on cie_inf for FDEs.
2859         (_bfd_elf_write_section_eh_frame): Adjust offset and new_offset for
2860         section output_offset.  Delete cie_offset, instead use cie_inf
2861         pointer to CIE entry.  Use need_relative and need_lsda_relative on
2862         CIE entry for FDEs.  Use pointers rather than array indices.
2863
2864 2004-10-09  Alan Modra  <amodra@bigpond.net.au>
2865
2866         * coff-rs6000.c (rs6000coff_vec): Add initializer for
2867         bfd_is_target_special_symbol.
2868         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
2869         * som.c (som_bfd_is_target_special_symbol): Define.
2870
2871 2004-10-08  Nick Clifton  <nickc@redhat.com>
2872
2873         * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.93.
2874         * configure: Regenerate.
2875         * bfd-in2.h: Regenerate.
2876         * syms.c (bfd_is_target_special_symbol): New interface function.
2877         Returns true when a symbol should be considered to be special.
2878         * targets.c (bfd_target): Include bfd_is_target_special_symbol in
2879         the symbol jump table.
2880         * elf32-arm.h (elf32_arm_is_target_special_symbol): New function.
2881         Return true iff the symbol is a mapping symbol.
2882         (bfd_elf32_bfd_is_target_special_symbol): Define.
2883         * elfxx-target.h: Provide a default definition for
2884         bfd_is_target_special_symbol.
2885         * aout-target.h: Likewise.
2886         * aout-tic30.c: Likewise.
2887         * binary.c: Likewise.
2888         * coffcode.h: Likewise.
2889         * i386msdos.c: Likewise.
2890         * ieee.c: Likewise.
2891         * ihex.c: Likewise.
2892         * libaout.h: Likewise.
2893         * libbfd-in.h: Likewise
2894         * libecoff.h: Likewise.
2895         * mach-o.c: Likewise.
2896         * mmo.c: Likewise.
2897         * nlm-target.h: Likewise.
2898         * oasys.c: Likewise.
2899         * pef.c: Likewise.
2900         * ppcboot.c: Likewise.
2901         * srec.c: Likewise.
2902         * tekhex.c: Likewise.
2903         * versados.c: Likewise.
2904         * vms.c: Likewise.
2905         * xcoff-target.h: Likewise.
2906         * xsym.c: Likewise.
2907         * libbfd.h: Regenerate.
2908
2909 2004-10-08  Daniel Jacobowitz  <dan@debian.org>
2910
2911         * config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*.
2912         * elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function.
2913         (elf_backend_section_from_shdr): Define.
2914
2915 2004-10-08  Alan Modra  <amodra@bigpond.net.au>
2916
2917         * syms.c (bfd_is_local_label): Return false for file symbols.
2918
2919 2004-10-07  Bob Wilson  <bob.wilson@acm.org>
2920             David Heine  <dlheine@tensilica.com>
2921
2922         * elf32-xtensa.c (elf32xtensa_size_opt): New global variable.
2923         (xtensa_default_isa): Global variable moved here from xtensa-isa.c.
2924         (elf32xtensa_no_literal_movement): New global variable.
2925         (elf_howto_table): Add entries for new relocations.
2926         (elf_xtensa_reloc_type_lookup): Handle new relocations.
2927         (property_table_compare): When addresses are equal, compare sizes and
2928         various property flags.
2929         (property_table_matches): New.
2930         (xtensa_read_table_entries): Extend to read new property tables.  Add
2931         output_addr parameter to indicate that output addresses should be used.
2932         Use bfd_get_section_limit.
2933         (elf_xtensa_find_property_entry): New.
2934         (elf_xtensa_in_literal_pool): Use elf_xtensa_find_property_entry.
2935         (elf_xtensa_check_relocs): Handle new relocations.
2936         (elf_xtensa_do_reloc): Use bfd_get_section_limit.  Handle new
2937         relocations.  Use new xtensa-isa.h functions.
2938         (build_encoding_error_message): Remove encode_result parameter.  Add
2939         new target_address parameter used to detect alignment errors.
2940         (elf_xtensa_relocate_section): Use bfd_get_section_limit.  Clean up
2941         error handling.  Use new is_operand_relocation function.
2942         (elf_xtensa_combine_prop_entries, elf_xtensa_merge_private_bfd_data):
2943         Use underbar macro for error messages.  Formatting.
2944         (get_const16_opcode): New.
2945         (get_l32r_opcode): Add a separate flag for initialization.
2946         (get_relocation_opnd): Operand number is no longer explicit in the
2947         relocation.  Change to decode the opcode and analyze its operands.
2948         (get_relocation_slot): New.
2949         (get_relocation_opcode): Add bfd parameter.  Use bfd_get_section_limit.
2950         Use new xtensa-isa.h functions to handle multislot instructions.
2951         (is_l32r_relocation): Add bfd parameter.  Use is_operand_relocation.
2952         (get_asm_simplify_size, is_alt_relocation, is_operand_relocation,
2953         insn_decode_len, insn_decode_opcode, check_branch_target_aligned,
2954         check_loop_aligned, check_branch_target_aligned_address, narrowable,
2955         widenable, narrow_instruction, widen_instruction, op_single_fmt_table,
2956         get_single_format, init_op_single_format_table): New.
2957         (elf_xtensa_do_asm_simplify): Add error_message parameter and use it
2958         instead of calling _bfd_error_handler.  Use new xtensa-isa.h functions.
2959         (contract_asm_expansion): Add error_message parameter and pass it to
2960         elf_xtensa_do_asm_simplify.  Replace use of R_XTENSA_OP0 relocation
2961         with R_XTENSA_SLOT0_OP.
2962         (get_expanded_call_opcode): Extend to handle either L32R or CONST16
2963         instructions.  Use new xtensa-isa.h functions.
2964         (r_reloc struct): Add new virtual_offset field.
2965         (r_reloc_init): Add contents and content_length parameters.  Set
2966         virtual_offset field to zero.  Add contents to target_offset field for
2967         partial_inplace relocations.
2968         (r_reloc_is_defined): Check for null.
2969         (print_r_reloc): New debug function.
2970         (source_reloc struct): Replace xtensa_operand field with pair of the
2971         opcode and the operand position.  Add is_abs_literal field.
2972         (init_source_reloc): Specify operand by opcode/position pair.  Set
2973         is_abs_literal field.
2974         (source_reloc_compare): When target_offsets are equal, compare other
2975         fields to make sorting predictable.
2976         (literal_value struct): Add is_abs_literal field.
2977         (value_map_hash_table struct): Add has_last_loc and last_loc fields.
2978         (init_literal_value): New.
2979         (is_same_value): Replace with ...
2980         (literal_value_equal): ... this function.  Add comparisons of
2981         virtual_offset and is_abs_literal fields.
2982         (value_map_hash_table_init): Use bfd_zmalloc.  Check for allocation
2983         failure.  Initialize has_last_loc field.
2984         (value_map_hash_table_delete): New.
2985         (hash_literal_value): Rename to ...
2986         (literal_value_hash): ... this.  Include is_abs_literal flag and
2987         virtual_offset field in the hash value.
2988         (get_cached_value): Rename to ...
2989         (value_map_get_cached_value): ... this.  Update calls to
2990         literal_value_hash and literal_value_equal.
2991         (add_value_map): Check for allocation failure.  Update calls to
2992         value_map_get_cached_value and literal_value_hash.
2993         (text_action, text_action_list, text_action_t): New types.
2994         (find_fill_action, compute_removed_action_diff, adjust_fill_action,
2995         text_action_add, text_action_add_literal, offset_with_removed_text,
2996         offset_with_removed_text_before_fill, find_insn_action,
2997         print_action_list, print_removed_literals): New.
2998         (offset_with_removed_literals): Delete.
2999         (xtensa_relax_info struct): Add is_relaxable_asm_section, action_list,
3000         fix_array, fix_array_count, allocated_relocs, relocs_count, and
3001         allocated_relocs_count fields.
3002         (init_xtensa_relax_info): Initialize new fields.
3003         (reloc_bfd_fix struct): Add new translated field.
3004         (reloc_bfd_fix_init): Add translated parameter and use it to set the
3005         translated field.
3006         (fix_compare, cache_fix_array): New.
3007         (get_bfd_fix): Remove fix_list parameter and get all relax_info for the
3008         section via get_xtensa_relax_info.  Use cache_fix_array to set up
3009         sorted fix_array and use bsearch instead of linear search.
3010         (section_cache_t): New struct.
3011         (init_section_cache, section_cache_section, clear_section_cache): New.
3012         (ebb_t, ebb_target_enum, proposed_action, ebb_constraint): New types.
3013         (init_ebb_constraint, free_ebb_constraint, init_ebb, extend_ebb_bounds,
3014         extend_ebb_bounds_forward, extend_ebb_bounds_backward,
3015         insn_block_decodable_len, ebb_propose_action, ebb_add_proposed_action):
3016         New.
3017         (retrieve_contents): Use bfd_get_section_limit.
3018         (elf_xtensa_relax_section): Add relocations_analyzed flag.  Update call
3019         to compute_removed_literals.  Free value_map_hash_table when no longer
3020         needed.
3021         (analyze_relocations): Check is_relaxable_asm_section flag.  Call
3022         compute_text_actions for all sections.
3023         (find_relaxable_sections): Mark sections as relaxable if they contain
3024         ASM_EXPAND relocations that can be optimized.  Adjust r_reloc_init
3025         call.  Increment relax_info src_count field only for appropriate
3026         relocation types.  Remove is_literal_section check.
3027         (collect_source_relocs): Use bfd_get_section_limit.  Adjust calls to
3028         r_reloc_init and find_associated_l32r_irel.  Check
3029         is_relaxable_asm_section flag.  Handle L32R instructions with absolute
3030         literals.  Pass is_abs_literal flag to init_source_reloc.
3031         (is_resolvable_asm_expansion): Use bfd_get_section_limit.  Check for
3032         CONST16 instructions.  Adjust calls to r_reloc_init and
3033         pcrel_reloc_fits.  Handle weak symbols conservatively.
3034         (find_associated_l32r_irel): Add bfd parameter and pass it to
3035         is_l32r_relocation.
3036         (compute_text_actions, compute_ebb_proposed_actions,
3037         compute_ebb_actions, check_section_ebb_pcrels_fit,
3038         check_section_ebb_reduces, text_action_add_proposed,
3039         compute_fill_extra_space): New.
3040         (remove_literals): Replace with ...
3041         (compute_removed_literals): ... this function.  Call
3042         init_section_cache.  Use bfd_get_section_limit.  Sort internal_relocs.
3043         Call xtensa_read_table_entries to get the property table.  Skip
3044         relocations other than R_XTENSA_32 and R_XTENSA_PLT.  Use new
3045         is_removable_literal, remove_dead_literal, and
3046         identify_literal_placement functions.
3047         (get_irel_at_offset): Rewrite to use bsearch on sorted relocations
3048         instead of linear search.
3049         (is_removable_literal, remove_dead_literal,
3050         identify_literal_placement): New.
3051         (relocations_reach): Update check for literal not referenced by any
3052         PC-relative relocations.  Adjust call to pcrel_reloc_fits.
3053         (coalesce_shared_literal, move_shared_literal): New.
3054         (relax_section): Use bfd_get_section_limit.  Call
3055         translate_section_fixes.  Update calls to r_reloc_init and
3056         offset_with_removed_text.  Check new is_relaxable_asm_section flag.
3057         Add call to pin_internal_relocs.  Add special handling for
3058         R_XTENSA_ASM_SIMPLIFY and R_XTENSA_DIFF* relocs.  Use virtual_offset
3059         info to calculate new addend_displacement variable.  Replace code for
3060         deleting literals with more general code to perform the actions
3061         determined by the action_list for the section.
3062         (translate_section_fixes, translate_reloc_bfd_fix): New.
3063         (translate_reloc): Check new is_relaxable_asm_section flag.  Call
3064         find_removed_literal only if is_operand_relocation.  Update call to
3065         offset_with_removed_text.  Use new target_offset and removed_bytes
3066         variables.
3067         (move_literal): New.
3068         (relax_property_section):  Use bfd_get_section_limit.  Set new
3069         is_full_prop_section flag and handle new property tables.  Update calls
3070         to r_reloc_init and offset_with_removed_text.  Check
3071         is_relaxable_asm_section flag.  Handle expansion of zero-sized
3072         unreachable entries, with use of offset_with_removed_text_before_fill.
3073         For relocatable links, combine entries only for literal tables.
3074         (relax_section_symbols): Check is_relaxable_asm_section flag.  Update
3075         calls to offset_with_removed_text.  Translate st_size field for
3076         function symbols.
3077         (do_fix_for_relocatable_link): Change to return bfd_boolean to indicate
3078         failure.  Add contents parameter.  Update call to get_bfd_fix.  Update
3079         call to r_reloc_init.  Call _bfd_error_handler and return FALSE for
3080         R_XTENSA_ASM_EXPAND relocs.
3081         (do_fix_for_final_link): Add input_bfd and contents parameters.  Update
3082         call to get_bfd_fix.  Include offset from contents for partial_inplace
3083         relocations.
3084         (is_reloc_sym_weak): New.
3085         (pcrel_reloc_fits): Use new xtensa-isa.h functions.
3086         (prop_sec_len): New.
3087         (xtensa_is_property_section): Handle new property sections.
3088         (is_literal_section): Delete.
3089         (internal_reloc_compare): When r_offset matches, compare r_info and
3090         r_addend to make sorting predictable.
3091         (internal_reloc_matches): New.
3092         (xtensa_get_property_section_name): Handle new property sections.
3093         (xtensa_get_property_predef_flags): New.
3094         (xtensa_callback_required_dependence): Use bfd_get_section_limit.
3095         Update calls to xtensa_isa_init, is_l32r_relocation, and r_reloc_init.
3096         * xtensa-isa.c (xtensa_default_isa): Moved to elf32-xtensa.c.
3097         (xtisa_errno, xtisa_error_msg): New variables.
3098         (xtensa_isa_errno, xtensa_isa_error_msg): New.
3099         (xtensa_insnbuf_alloc): Add error handling.
3100         (xtensa_insnbuf_to_chars): Add num_chars parameter.  Update to
3101         use xtensa_format_decode.  Add error handling.
3102         (xtensa_insnbuf_from_chars): Add num_chars parameter.  Decode the
3103         instruction length to find the number of bytes to copy.
3104         (xtensa_isa_init): Add error handling.  Replace calls to
3105         xtensa_load_isa and xtensa_extend_isa with code to initialize lookup
3106         tables in the xtensa_modules structure.
3107         (xtensa_check_isa_config, xtensa_add_isa, xtensa_load_isa,
3108         xtensa_extend_isa): Delete.
3109         (xtensa_isa_free): Change to only free lookup tables.
3110         (opname_lookup_compare): Replace with ...
3111         (xtensa_isa_name_compare): ... this function.  Use strcasecmp.
3112         (xtensa_insn_maxlength): Rename to ...
3113         (xtensa_isa_maxlength): ... this.
3114         (xtensa_insn_length): Delete.
3115         (xtensa_insn_length_from_first_byte): Replace with ...
3116         (xtensa_isa_length_from_chars): ... this function.
3117         (xtensa_num_opcodes): Rename to ...
3118         (xtensa_isa_num_opcodes): ... this.
3119         (xtensa_isa_num_pipe_stages, xtensa_isa_num_formats,
3120         xtensa_isa_num_regfiles, xtensa_isa_num_stages,
3121         xtensa_isa_num_sysregs, xtensa_isa_num_interfaces,
3122         xtensa_isa_num_funcUnits, xtensa_format_name, xtensa_format_lookup,
3123         xtensa_format_decode, xtensa_format_encode, xtensa_format_length,
3124         xtensa_format_num_slots, xtensa_format_slot_nop_opcode,
3125         xtensa_format_get_slot, xtensa_format_set_slot): New functions.
3126         (xtensa_opcode_lookup): Add error handling.
3127         (xtensa_decode_insn): Replace with ...
3128         (xtensa_opcode_decode): ... this function, with new format and
3129         slot parameters.  Add error handling.
3130         (xtensa_encode_insn): Replace with ...
3131         (xtensa_opcode_encode): ... this function, which does the encoding via
3132         one of the entries in the "encode_fns" array.  Add error handling.
3133         (xtensa_opcode_name): Add error handling.
3134         (xtensa_opcode_is_branch, xtensa_opcode_is_jump, xtensa_opcode_is_loop,
3135         xtensa_opcode_is_call): New.
3136         (xtensa_num_operands): Replace with ...
3137         (xtensa_opcode_num_operands): ... this function.  Add error handling.
3138         (xtensa_opcode_num_stateOperands,
3139         xtensa_opcode_num_interfaceOperands, xtensa_opcode_num_funcUnit_uses,
3140         xtensa_opcode_funcUnit_use, xtensa_operand_name,
3141         xtensa_operand_is_visible): New.
3142         (xtensa_get_operand, xtensa_operand_kind): Delete.
3143         (xtensa_operand_inout): Add error handling and special-case for
3144         "sout" operands.
3145         (xtensa_operand_get_field, xtensa_operand_set_field): Rewritten to
3146         operate on one slot of an instruction.  Added error handling.
3147         (xtensa_operand_encode): Handle default operands with no encoding
3148         functions.  Check for success by comparing against decoded value.
3149         Add error handling.
3150         (xtensa_operand_decode): Handle default operands.  Return decoded value
3151         through argument pointer.  Add error handling.
3152         (xtensa_operand_is_register, xtensa_operand_regfile,
3153         xtensa_operand_num_regs, xtensa_operand_is_known_reg): New.
3154         (xtensa_operand_isPCRelative): Rename to ...
3155         (xtensa_operand_is_PCrelative): ... this.  Add error handling.
3156         (xtensa_operand_do_reloc, xtensa_operand_undo_reloc): Return value
3157         through argument pointer.  Add error handling.
3158         (xtensa_stateOperand_state, xtensa_stateOperand_inout,
3159         xtensa_interfaceOperand_interface, xtensa_regfile_lookup,
3160         xtensa_regfile_lookup_shortname, xtensa_regfile_name,
3161         xtensa_regfile_shortname, xtensa_regfile_view_parent,
3162         xtensa_regfile_num_bits, xtensa_regfile_num_entries,
3163         xtensa_state_lookup, xtensa_state_name, xtensa_state_num_bits,
3164         xtensa_state_is_exported, xtensa_sysreg_lookup,
3165         xtensa_sysreg_lookup_name, xtensa_sysreg_name, xtensa_sysreg_number,
3166         xtensa_sysreg_is_user, xtensa_interface_lookup, xtensa_interface_name,
3167         xtensa_interface_num_bits, xtensa_interface_inout,
3168         xtensa_interface_has_side_effect, xtensa_funcUnit_lookup,
3169         xtensa_funcUnit_name, xtensa_funcUnit_num_copies): New.
3170         * xtensa-modules.c: Rewrite to use new data structures.
3171         * reloc.c (BFD_RELOC_XTENSA_DIFF8, BFD_RELOC_XTENSA_DIFF16,
3172         BFD_RELOC_XTENSA_DIFF32, BFD_RELOC_XTENSA_SLOT0_OP,
3173         BFD_RELOC_XTENSA_SLOT1_OP, BFD_RELOC_XTENSA_SLOT2_OP,
3174         BFD_RELOC_XTENSA_SLOT3_OP, BFD_RELOC_XTENSA_SLOT4_OP,
3175         BFD_RELOC_XTENSA_SLOT5_OP, BFD_RELOC_XTENSA_SLOT6_OP,
3176         BFD_RELOC_XTENSA_SLOT7_OP, BFD_RELOC_XTENSA_SLOT8_OP,
3177         BFD_RELOC_XTENSA_SLOT9_OP, BFD_RELOC_XTENSA_SLOT10_OP,
3178         BFD_RELOC_XTENSA_SLOT11_OP, BFD_RELOC_XTENSA_SLOT12_OP,
3179         BFD_RELOC_XTENSA_SLOT13_OP, BFD_RELOC_XTENSA_SLOT14_OP,
3180         BFD_RELOC_XTENSA_SLOT0_ALT, BFD_RELOC_XTENSA_SLOT1_ALT,
3181         BFD_RELOC_XTENSA_SLOT2_ALT, BFD_RELOC_XTENSA_SLOT3_ALT,
3182         BFD_RELOC_XTENSA_SLOT4_ALT, BFD_RELOC_XTENSA_SLOT5_ALT,
3183         BFD_RELOC_XTENSA_SLOT6_ALT, BFD_RELOC_XTENSA_SLOT7_ALT,
3184         BFD_RELOC_XTENSA_SLOT8_ALT, BFD_RELOC_XTENSA_SLOT9_ALT,
3185         BFD_RELOC_XTENSA_SLOT10_ALT, BFD_RELOC_XTENSA_SLOT11_ALT,
3186         BFD_RELOC_XTENSA_SLOT12_ALT, BFD_RELOC_XTENSA_SLOT13_ALT,
3187         BFD_RELOC_XTENSA_SLOT14_ALT): Add new relocations.
3188         * Makefile.am (xtensa-isa.lo, xtensa-modules.lo): Update dependencies.
3189         * Makefile.in: Regenerate.
3190         * bfd-in2.h: Likewise.
3191         * libbfd.h: Likewise.
3192
3193 2004-10-07  Richard Sandiford  <rsandifo@redhat.com>
3194
3195         * elf64-mips.c (mips_elf64_write_rel): Use STN_UNDEF for relocs
3196         against the absolute section.
3197         (mips_elf64_write_rela): Likewise.
3198
3199 2004-10-07  Jan Beulich <jbeulich@novell.com>
3200
3201         * elf.c (elf_find_function): Don't generally check for matching
3202         section, just for non-file symbols.  Remove redunant comparison
3203         for the latter.
3204         * elf32-arm.h (arm_elf_find_function): Likewise.
3205
3206 2004-10-07  Jeff Baker  <jbaker@qnx.com>
3207
3208         * elflink.c (_bfd_elf_add_dynamic_entry): Add code to warn if
3209         adding a DT_TEXTREL to a shared object and --warn-shared-textrel
3210         was specified.
3211
3212 2004-10-04  Roland McGrath  <roland@redhat.com>
3213
3214         * hash.c (bfd_hash_set_default_size): Use const for table.
3215         Use size_t instead of int for variable compared to sizeof results.
3216
3217 2004-10-05  Alan Modra  <amodra@bigpond.net.au>
3218
3219         PR 425
3220         * syms.c (_bfd_stab_section_find_nearest_line): Ignore R_*_NONE relocs.
3221
3222 2004-10-01  Paul Brook  <paul@codesourcery.com>
3223
3224         * elf32-arm.h (elf32_arm_fake_sections,
3225         is_arm_elf_unwind_section_name, elf32_arm_section_from_shdr): New
3226         functions.
3227         (elf_backend_fake_sections, elf_backend_section_from_shdr): Define.
3228
3229 2004-10-01  Alan Modra  <amodra@bigpond.net.au>
3230
3231         * elf-bfd.h (struct eh_cie_fde): Add need_relative and
3232         need_lsda_relative.
3233         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Set
3234         need_relative or need_lsda_relative if we are processing an
3235         offset for a reloc on a FDE initial loc or LSDA field
3236         respectively.
3237         (_bfd_elf_write_section_eh_frame): Test need_relative and
3238         need_lsda_relative in place of corresponding make_* field
3239         when deciding to use pc-relative encodings.
3240
3241 2004-09-30  Paul Brook  <paul@codesourcery.com>
3242
3243         * elf32-arm.h (bfd_elf32_arm_set_target_relocs): Handle "abs"
3244         target2 relocation type.
3245
3246 2004-09-30  H.J. Lu  <hongjiu.lu@intel.com>
3247
3248         PR 414
3249         * elflink.c (_bfd_elf_merge_symbol): Check TLS symbol.
3250
3251 2004-09-30  Paul Brook  <paul@codesourcery.com>
3252
3253         * reloc.c: Add BFD_RELOC_ARM_SMI.
3254         * bfd-in2.h: Regenerate.
3255         * libbfd.h: Ditto.
3256
3257 2004-09-24  Alan Modra  <amodra@bigpond.net.au>
3258
3259         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Add output section
3260         vma and output offset to address.
3261         * simple.c (simple_save_output_info): Only set output section
3262         and offset for debug sections, or those not already set up by
3263         the linker.
3264         (bfd_simple_get_relocated_section_contents): Update comment.
3265
3266 2004-09-24  Alan Modra  <amodra@bigpond.net.au>
3267
3268         * elf.c (IS_LOADED): Delete.
3269         (assign_file_positions_for_segments): Just test SEC_LOAD instead.
3270         Restore SEC_HAS_CONTENTS test to the one place it was used prior
3271         to 2004-09-22.
3272
3273 2004-09-23  Alan Modra  <amodra@bigpond.net.au>
3274
3275         PR gas/396
3276         * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3277         bfd_mach_sparc_sparclet and bfd_mach_sparc_sparclite.  Remove
3278         redundant assignment of EM_SPARC.
3279
3280 2004-09-22  Brian Ford  <ford@vss.fsi.com>
3281
3282         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
3283         alignment for .rdata sections so sse[2] code works with gcc >= 3.3.3
3284         constants.
3285         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
3286
3287 2004-09-22  Alan Modra  <amodra@bigpond.net.au>
3288
3289         * elf32-ppc.c (ppc_elf_modify_segment_map): Delete.
3290         (elf_backend_modify_segment_map): Don't define.
3291
3292 2004-09-22  Alan Modra  <amodra@bigpond.net.au>
3293
3294         * elf.c (IS_LOADED): Define.
3295         (assign_file_positions_for_segments): Don't round up file offset of
3296         PT_LOAD segments containing no SEC_LOAD sections, instead round down.
3297         Delete code handling link script adjustment of lma.  Do the adjust
3298         in later code handling similar ajustments.  Remove dead code error
3299         check.  Warn if section lma would require a negative offset
3300         adjustment.  Tweak lma adjustment to use p_filesz rather than p_memsz.
3301         Use p_vaddr + p_memsz inside section loop in place of voff.  Don't
3302         update voff in section loop.  Change voff in segment loop to be an
3303         adjustment on top of "off".  Set sec->filepos and update "off" later.
3304         Test for loadable sections consistently using IS_LOADED.  Similarly,
3305         test for alloc-only sections other than .tbss consistently.
3306         Don't bother checking SEC_ALLOC in PT_LOAD segments.  Remove FIXME.
3307         Tidy PT_NOTE handling.  Use %B and %A in error messages.
3308         (assign_file_positions_except_relocs): Use %B in error message.
3309
3310 2004-09-17  H.J. Lu  <hongjiu.lu@intel.com>
3311
3312         * Makefile.am (AUTOMAKE_OPTIONS): Require 1.9.
3313         (CONFIG_STATUS_DEPENDENCIES): New.
3314         (Makefile): Removed.
3315         (config.status): Likewise.
3316         * Makefile.in: Regenerated.
3317
3318 2004-09-17  Paul Brook  <paul@codesourcery.com>
3319
3320         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add prototype.
3321         (bfd_elf32_arm_process_before_allocation): Update prototype.
3322         * bfd-in2.h: Regenerate.
3323         * bfd/elf32-arm.h (elf32_arm_link_hash_table): Add target2_reloc.
3324         (elf32_arm_link_hash_table_create): Set it.
3325         (bfd_elf32_arm_process_before_allocation): Remove target1_is_rel.
3326         (bfd_elf32_arm_set_target_relocs): New function.
3327         (arm_real_reloc_type): New function.
3328         (elf32_arm_final_link_relocate): Use it.  Handle R_ARM_PREL31 and
3329         R_ARM_GOT_PREL.  Remove R_ARM_TARGET1.
3330         (elf32_arm_gc_sweep_hook): Ditto.
3331         (elf32_arm_check_relocs): Ditto.
3332         (elf32_arm_relocate_section): Handle R_ARM_GOT_PREL.
3333         * elfarm-nabi.c (elf32_arm_howto_table): Add R_ARM_PREL31 and
3334         R_ARM_GOT_TARGET2.
3335         (elf32_arm_got_prel): New variable.
3336         (elf32_arm_howto_from_type): New function.
3337         (elf32_arm_info_to_howto): Use it.
3338         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_PREL31 and
3339         BFD_RELOC_ARM_TARGET2.
3340         * libbfd.h: Regenerate.
3341         * reloc.c: Add BFD_RELOC_ARM_TARGET2 and BFD_RELOC_ARM_PREL31.
3342
3343 2004-09-17  Alan Modra  <amodra@bigpond.net.au>
3344
3345         * ecoff.c: Update u.undef.next refs.
3346         * elf64-ppc.c: Likewise.
3347         * elflink.c: Likewise.
3348         * linker.c: Likewise.
3349         * xcofflink.c: Likewise.
3350
3351         * elf-bfd.h (struct elf_link_hash_entry): Rearrange.  Add FIXME to
3352         dynamic_def.  Combine weakdef and elf_hash_value.  Move vtable
3353         fields to indirect struct.
3354         * elf-m10300.c: Update u.weakdef refs.
3355         * elf32-arm.h: Likewise.
3356         * elf32-cris.c: Likewise.
3357         * elf32-frv.c: Likewise.
3358         * elf32-hppa.c: Likewise.
3359         * elf32-i370.c: Likewise.
3360         * elf32-i386.c: Likewise.
3361         * elf32-m32r.c: Likewise.
3362         * elf32-m68k.c: Likewise.
3363         * elf32-ppc.c: Likewise.
3364         * elf32-s390.c: Likewise.
3365         * elf32-sh.c: Likewise.
3366         * elf32-sparc.c: Likewise.
3367         * elf32-vax.c: Likewise.
3368         * elf32-xtensa.c: Likewise.
3369         * elf64-alpha.c: Likewise.
3370         * elf64-hppa.c: Likewise.
3371         * elf64-ppc.c: Likewise.
3372         * elf64-s390.c: Likewise.
3373         * elf64-sh64.c: Likewise.
3374         * elf64-sparc.c: Likewise.
3375         * elf64-x86-64.c: Likewise.
3376         * elfxx-ia64.c: Likewise.
3377         * elfxx-mips.c: Likewise.
3378         * elflink.c: Likewise.  Also u.elf_hash_value.
3379         (elf_gc_propagate_vtable_entries_used): Update for h->vtable
3380         indirection.
3381         (elf_gc_smash_unused_vtentry_relocs): Likewise.
3382         (bfd_elf_gc_record_vtinherit): Alloc vtable.
3383         (bfd_elf_gc_record_vtentry): Likewise.
3384         * elf.c (_bfd_elf_link_hash_newfunc): Use memset.
3385
3386 2004-09-17  Alan Modra  <amodra@bigpond.net.au>
3387
3388         * Makefile.am: Run "make dep-am".
3389         * Makefile.in: Regenerate.
3390         * bfd-in2.h: Regenerate.
3391         * po/SRC-POTFILES.in: Regenerate.
3392         * po/bfd.pot: Regenerate.
3393
3394 2004-09-16  Alan Modra  <amodra@bigpond.net.au>
3395
3396         * elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
3397         with bitfields.  Make "type" and "other" bitfields too.
3398         (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR,
3399         ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC,
3400         ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED,
3401         ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF,
3402         ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK,
3403         ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK,
3404         ELF_LINK_POINTER_EQUALITY_NEEDED): Delete.
3405         (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update.
3406         * elf-hppa.h: Update all uses of elf_link_hash_flags.
3407         * elf-m10300.c: Likewise.
3408         * elf.c: Likewise.
3409         * elf32-arm.h: Likewise.
3410         * elf32-cris.c: Likewise.
3411         * elf32-frv.c: Likewise.
3412         * elf32-hppa.c: Likewise.
3413         * elf32-i370.c: Likewise.
3414         * elf32-i386.c: Likewise.
3415         * elf32-m32r.c: Likewise.
3416         * elf32-m68k.c: Likewise.
3417         * elf32-ppc.c: Likewise.
3418         * elf32-s390.c: Likewise.
3419         * elf32-sh-symbian.c: Likewise.
3420         * elf32-sh.c: Likewise.
3421         * elf32-sh64.c: Likewise.
3422         * elf32-sparc.c: Likewise.
3423         * elf32-vax.c: Likewise.
3424         * elf32-xtensa.c: Likewise.
3425         * elf64-alpha.c: Likewise.
3426         * elf64-hppa.c: Likewise.
3427         * elf64-ppc.c: Likewise.
3428         * elf64-s390.c: Likewise.
3429         * elf64-sh64.c: Likewise.
3430         * elf64-sparc.c: Likewise.
3431         * elf64-x86-64.c: Likewise.
3432         * elflink.c: Likewise.
3433         * elfxx-ia64.c: Likewise.
3434         * elfxx-mips.c: Likewise.
3435         * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92.
3436         * configure: Regenerate.
3437         * aclocal.m4: Regenerate.
3438
3439 2004-09-16  Alan Modra  <amodra@bigpond.net.au>
3440
3441         * elf32-arm.h (elf32_arm_gc_sweep_hook): Add #ifndef OLD_ARM_ABI
3442         around uses of R_ARM_TARGET1.
3443         (elf32_arm_check_relocs): Likewise.
3444
3445 2004-09-13  Paul Brook  <paul@codesourcery.com>
3446
3447         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
3448         prototype.
3449         * bfd-in2.h: Regenerate.
3450         * libbfd.h: Regenerate.
3451         * elf32-arm.h (elf32_arm_link_hash_table): Add target1_is_rel.
3452         (elf32_arm_link_hash_table_create): Set target1_is_rel.
3453         (bfd_elf32_arm_process_before_allocation): Ditto.
3454         (elf32_arm_final_link_relocate): Handle R_ARM_TARGET1.
3455         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
3456         * elfarm-nabi.c (elf32_arm_howto_table): Rename RELABS to TARGET1.
3457         * reloc.c: Ditto.
3458
3459 2004-09-10  Joel Brobecker  <brobecker@gnat.com>
3460
3461         * hpux-core.c (thread_section_p): New function.
3462         (hpux_core_core_file_p): Fix computation of offset in call
3463         to bfd_seek. Create a ".reg" section from an arbitrary
3464         ".reg/<id>" section if none was created after having read
3465         all sections.
3466
3467 2004-09-11  Andreas Schwab  <schwab@suse.de>
3468
3469         * acinclude.m4: Fix spelling of ACX_NONCANONICAL_*.
3470         * aclocal.m4: Rebuild.
3471         * configure: Rebuild.
3472
3473 2004-09-10  Joel Brobecker  <brobecker@gnat.com>
3474
3475         * section.c (bfd_sections_find_if): Fix parameter name in
3476         comment to match code.
3477
3478 2004-09-10  Alan Modra  <amodra@bigpond.net.au>
3479
3480         * elf.c  (assign_file_positions_except_relocs): Assign relocs
3481         stored in a bfd section.
3482
3483 2004-09-08  Hans-Peter Nilsson  <hp@axis.com>
3484
3485         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Reset
3486         h->gotplt_refcount to 0, not -1.
3487
3488 2004-09-07  Hans-Peter Nilsson  <hp@axis.com>
3489
3490         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
3491         case R_CRIS_32_GOTPLT>: For internal error message, handle NULL
3492         symname.
3493         (cris_elf_check_relocs) <case R_CRIS_32_PLT_PCREL>: Don't try to
3494         handle symbol visibility here.
3495
3496 2004-09-07  Alan Modra  <amodra@bigpond.net.au>
3497
3498         * elf64-ppc.c (struct ppc_link_hash_table): Add stub_globals.
3499         (is_ppc64_elf_target): Rename from is_ppc64_target.  Update all
3500         callers.
3501         (ppc_stub_name): Remove trailing "+0" on stub name.
3502         (create_linkage_sections): Create relocations for
3503         branch lookup table when --emit-relocs as well as when --shared.
3504         (ppc_build_one_stub): Emit relocs for long branch stubs.  Adjust
3505         relbrlt test.  For --emit-stub-syms, always output a sym even when
3506         one already exists on a plt call stub.  Put stub type in the stub
3507         symbol name.
3508         (ppc_size_one_stub): Size long branch stub relocs.  Adjust relbrlt
3509         test.
3510         (ppc64_elf_size_stubs): Count global sym stubs added.  Zero
3511         reloc_count in stub sections.  Adjust relbrlt test.
3512         (ppc64_elf_build_stubs): Adjust relbrlt test.  Tweak stats output.
3513         * elflink.c (bfd_elf_size_dynamic_sections): Fix comment typo.
3514         (elf_link_input_bfd): Ignore symbol index zero relocs when checking
3515         for relocs against discarded symbols.  Fix comments.
3516
3517 2004-09-06  Mark Mitchell  <mark@codesourcery.com>
3518
3519         * elf-bfd.h (_bfd_elf_make_dynamic_segment): Declare it.
3520         * elf.c (_bfd_elf_make_dynamic_segment): New function, split out
3521         from ...
3522         (map_sections_to_segments): ... here.  Use it.  Assign a file
3523         position to the .dynamic section if it is not loadable, but part
3524         of the PT_DYNAMIC segment.
3525         * elf32-arm.h (elf32_arm_finish_dynamic_sections): Use file
3526         offsets, not VMAs, for the BPABI.  Do not fill in the header in
3527         the .got.plt section for the BPABI.
3528         * elfarm-nabi.c (elf32_arm_symbian_modify_segment_map): Add a
3529         PT_DYNAMIC segment.
3530         (elf_backend_want_got_plt): Define to zero for Symbian OS.
3531
3532 2004-09-06  Nick Clifton  <nickc@redhat.com>
3533
3534         * elflink.c (elf_link_add_object_symbols): Set the error code to
3535         bfd_error_wrong_format when the input format does not match the
3536         output format.
3537
3538 2004-09-06  Alan Modra  <amodra@bigpond.net.au>
3539
3540         * elf64-ppc.c (is_ppc64_target): New function, extracted from..
3541         (ppc64_elf_check_directives): ..here.
3542         (ppc64_elf_size_dynamic_sections): Use it here to check bfd type
3543         before accessing ppc64_elf_tdata.
3544         (ppc64_elf_finish_dynamic_sections): And here too.
3545
3546 2004-09-04  Alan Modra  <amodra@bigpond.net.au>
3547
3548         * bfd.c (_bfd_default_error_handler): Correct loop exit.
3549
3550 2004-09-03  Mark Mitchell  <mark@codesourcery.com>
3551
3552         * config.bfd (arm*-*-symbianelf*): Use OS-specific target vectors.
3553         * configure.in (bfd_elf32_bigarm_symbian_vec): Add it.
3554         (bfd_elf32_littlearm_symbian_vec): Likewise.
3555         * configure: Regenerated.
3556         * elf-bfd.h (elf_backend_data): Add dynamic_sec_flags.
3557         * elf32-arm.h (PLT_HEADER_SIZE): Do not define.
3558         (PLT_ENTRY_SIZE): Likewise.
3559         (bfd_vma_elf32_arm_symbian_plt_entry): New
3560         variable.
3561         (elf32_arm_link_hash_table): Add plt_header_size, plt_entry_size,
3562         and symbian_p.
3563         (create_got_section): Don't create sections when generating BPABI
3564         objects.
3565         (elf32_arm_create_dynamic_sections): Tidy.
3566         (elf32_arm_link_hash_table_create): Set plt_header_size,
3567         plt_entry_size, and symbian_p.
3568         (elf32_arm_check_relocs): Do not mark .rel.dyn as loadable when
3569         generating BPABI objects.
3570         (allocate_dynrelocs): Use htab->plt_header_size, not
3571         PLT_HEADER_SIZE.  Do not add to .got.plt when
3572         generating BPABI objects.
3573         (elf32_arm_finish_dynamic_symbol): Generate Symbian OS PLTs.
3574         * elfarm-nabi.c: Add SymbianOS target vectors.
3575         * elflink.c (_bfd_elf_create_got_section): Use dynamic_sec_flags.
3576         (_bfd_elf_link_create_dynamic_sections): Likewise.
3577         * elfxx-target.h (ELF_DYNAMIC_SEC_FLAGS): New macro.
3578         (elfNN_bed): Use it.
3579         * targets.c (bfd_elf32_bigarm_symbian_vec): New variable.
3580         (bfd_elf32_littlearm_symbian_vec): Likewise.
3581         (_bfd_target_vector): Add them.
3582
3583 2004-09-03  Nick Clifton  <nickc@redhat.com>
3584
3585         PR 360
3586         * coffcode.h (handle_COMDAT): Replace abort with an warning
3587         message and allow the scan to continue.
3588
3589 2004-09-02  Alan Modra  <amodra@bigpond.net.au>
3590
3591         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Use static_syms passed
3592         in when reading relocs, not our sorted syms.  Remove unnecessary
3593         var.
3594
3595 2004-08-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
3596
3597         * elf.c (special_sections): Add .gnu.linkonce.b modelled on .bss.
3598
3599 2004-08-30  Nathanael Nerode  <neroden@gcc.gnu.org>
3600
3601         * acinclude.m4: Require AC_CANONICAL_TARGET, not AC_CANONICAL_SYSTEM.
3602         Include ../config/acx.m4 and use ACX_NONCANONICAL_* where appropriate;
3603         replace uses of *_alias with *_noncanonical.
3604         * aclocal.m4: Rebuild with aclocal 1.4p6.
3605         * Makefile.in: Rebuild with automake 1.4p6.
3606         * doc/Makefile.in: Rebuild with automake 1.4p6.
3607         * configure.in: Autoupdate with autoupdate 2.59.
3608         * config.in: Regenerate with autoheader 2.59.
3609         * configure: Regnerate with autoconf 2.59.
3610
3611 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
3612
3613         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Copy input
3614         symbol pointer arrays before modifying.
3615
3616 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
3617
3618         * bfd.c (bfd_get_synthetic_symtab): Pass counts and both symbol tables.
3619         * elf-bfd.h (_bfd_elf_get_synthetic_symtab): Adjust.
3620         * elf.c (_bfd_elf_get_synthetic_symtab): Adjust.
3621         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Adjust.
3622         * targets.c (struct bfd_target <_bfd_get_synthetic_symtab>): Adjust.
3623         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't read symbols.
3624         Use both symbol tables on non-relocatable objects.  Use a common
3625         error exit.  Fix "mid" warning.
3626         * libbfd.h: Regenerate.
3627         * bfd-in2.h: Regenerate.
3628
3629 2004-08-28  Alan Modra  <amodra@bigpond.net.au>
3630
3631         * elf64-ppc.c (ppc64_elf_branch_reloc): Check .opd is in a regular
3632         object file.
3633         (struct sfpr_def_parms): Save some space.
3634         (sfpr_define): Here too.
3635
3636         * elf64-ppc.c (compare_symbols): Put section syms first.
3637         (sym_exists_at): New function.
3638         (ppc64_elf_get_synthetic_symtab): Use relocs to find code entry
3639         points only for relocatable files.  Use .opd section contents
3640         otherwise.  Generally clean up the code.
3641
3642 2004-08-27  Alan Modra  <amodra@bigpond.net.au>
3643
3644         * elf64-ppc.c (STD_R0_0R1, STD_R0_0R12, LD_R0_0R1, LD_R0_0R12,
3645         LI_R12_0, STVX_VR0_R12_R0, LVX_VR0_R12_R0, MTLR_R0, SFPR_MAX): Define.
3646         (struct sfpr_def_parms): New.
3647         (sfpr_define): New function.
3648         (savegpr0, savegpr0_tail, restgpr0, restgpr0_tail): New functions.
3649         (savegpr1, savegpr1_tail, restgpr1, restgpr1_tail): New functions.
3650         (savefpr, savefpr0_tail, restfpr, restfpr0_tail): New functions.
3651         (savefpr1_tail, restfpr1_tail): New functions.
3652         (savevr, savevr_tail, restvr, restvr_tail): New functions.
3653         (MIN_SAVE_FPR, MAX_SAVE_FPR): Don't define.
3654         (ppc64_elf_func_desc_adjust): Use sfpr_define in place of existing
3655         code.  Define all ABI mandated _save and _rest functions.
3656
3657 2004-08-26  Paul Brook  <paul@codesourcery.com>
3658
3659         * elf32-arm.h (INTERWORK_FLAG): Return true for EABIv3 objects.
3660
3661 2004-08-26  Alan Modra  <amodra@bigpond.net.au>
3662
3663         * elf32-m32r.c (m32r_elf_relocate_section): Don't compare with
3664         TRUE or FALSE.
3665
3666 2004-08-26  Alan Modra  <amodra@bigpond.net.au>
3667
3668         * elf32-i386.c (elf_i386_relocate_section): Tweak last change so
3669         that pcrel correction is applied for R_386_PC32.
3670
3671 2004-08-25  Alan Modra  <amodra@bigpond.net.au>
3672
3673         * elf32-i386.c (elf_i386_relocate_section): Zero section contents
3674         for R_386_32 and R_386_PC32 relocs against symbols defined in
3675         discarded sections.
3676
3677 2004-08-25  Dmitry Diky  <diwil@spec.ru>
3678
3679         * reloc.c (BFD_RELOC_MSP430_2X_PCREL,BFD_RELOC_MSP430_RL_PCREL):
3680         Add new relocations.
3681         * bfd-in2.h: Regenerate.
3682         * libbfd.h: Regenerate.
3683         * elf32-msp430.c: Clean-up code.
3684         (elf_msp430_howto_table): Add new relocation entries.
3685         (bfd_elf32_bfd_reloc_type_lookup): New relocation handlers.
3686         (msp430_elf_relax_section): New function.
3687         (msp430_elf_relax_delete_bytes): New function.
3688         (msp430_elf_symbol_address_p): New function.
3689
3690 2004-08-24  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
3691
3692         * elf32-m32r.c (m32r_elf_relocate_section): Handle
3693         R_M32R_SDA16_RELA in the same way as R_M32R_SDA16.
3694
3695 2004-08-20  Daniel Jacobowitz  <dan@debian.org>
3696
3697         * elflink.c (_bfd_elf_section_already_linked): Handle
3698         SEC_LINK_DUPLICATES_SAME_CONTENTS.
3699
3700 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
3701
3702         * config.bfd (arm*-*-symbianelf*): New target.
3703         (arm*-*-eabi*): Likewise.
3704
3705 2004-08-19  Alan Modra  <amodra@bigpond.net.au>
3706
3707         * elf64-ppc.c (ppc_get_stub_entry): Change third param to a
3708         "struct ppc_link_hash_entry *".
3709         (ppc64_elf_relocate_section): Ditto for type of h.  Introduce h_elf
3710         to satisfy RELOC_FOR_GLOBAL_SYMBOL.
3711
3712 2004-08-19  Jakub Jelinek  <jakub@redhat.com>
3713
3714         * elf64-ppc.c (ppc64_elf_edit_opd): Support 16 byte long .opd
3715         entries (where fd_aux overlaps next entry's fd_func).
3716         Add non_overlapping argument, use it.
3717         (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, adjust_opd_syms,
3718         ppc64_elf_size_stubs, ppc64_elf_relocate_section,
3719         ppc64_elf_output_symbol_hook): Use address / 8 instead of address / 24
3720         as indexes into opd_sym_map/opd_adjust array.
3721         * elf64-ppc.h (ppc64_elf_edit_opd): Adjust prototype.
3722
3723 2004-08-18  Alan Modra  <amodra@bigpond.net.au>
3724
3725         * elf64-ppc.c (func_desc_adjust): Give undefined dot-symbols a value
3726         if we can look up their function descriptor in a regular file.
3727
3728 2004-08-18  Nick Clifton  <nickc@redhat.com>
3729
3730         PR 324
3731         * cofflink.c (coff_link_add_symbols): Check that the comdat
3732         pointer in the coff_section_data structure has been initialised
3733         before using it.
3734
3735 2004-08-18  Alan Modra  <amodra@bigpond.net.au>
3736
3737         PR 338
3738         * elflink.c (bfd_elf_record_link_assignment): Add comment about
3739         changing bfd_link_hash_undefined to bfd_link_hash_new.
3740
3741 2004-08-17  Jakub Jelinek  <jakub@redhat.com>
3742
3743         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define
3744         if not yet defined.
3745         * elf64-ppc.c (bfd_elf64_get_synthetic_symtab): Define.
3746         (synthetic_opd, synthetic_relocatable): New variables.
3747         (compare_symbols, compare_relocs): New helper routines.
3748         (ppc64_elf_get_synthetic_symtab): New function.
3749         * bfd.c (bfd_get_synthetic_symtab): Rename dynsyms argument
3750         to relsyms.
3751         * bfd-in2.h: Regenerated.
3752         * elf.c (_bfd_elf_get_synthetic_symtab): Rename dynsyms argument
3753         to relsyms.  Return 0 if abfd is relocatable.
3754
3755 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
3756
3757         * elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections.
3758
3759 2004-08-17  Nick Clifton  <nickc@redhat.com>
3760
3761         * (is_arm_mapping_symbol_name): New function - return true
3762         when a symbol name matches the requirements for an ARM mapping
3763         symbol name.
3764         (arm_elf_find_function): New function based on
3765         elf_find_function in elf.c but skipping ARM mapping symbols
3766         and including thumb function symbols.
3767         (elf32_arm_find_nearest_line): Use arm_elf_find_function.
3768         (elf32_arm_output_symbol_hook): Use is_arm_mapping_symbol_name.
3769
3770 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
3771
3772         * elf64-ppc.c (ppc64_elf_branch_reloc): New function.
3773         (ppc64_elf_howto_raw): Use ppc64_elf_branch_reloc.
3774         (ppc64_elf_brtaken_reloc): Here too.
3775
3776 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
3777
3778         * elf64-ppc.c (add_symbol_adjust): Correct mismatched function
3779         symbol visibility.
3780         (ppc64_elf_check_directives): Check that we have the right hash
3781         table before proceeding.
3782
3783 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
3784
3785         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add "deleted_section".
3786         (adjust_opd_syms): Attach opd syms for deleted entries to one of
3787         the sections that will be discarded.
3788
3789 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
3790
3791         * elflink.c (elf_section_complain_discarded): Ignore .fixup.
3792
3793 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
3794
3795         * bfd.c (_bfd_default_error_handler): Account for doubled '%' in
3796         free space available.
3797
3798 2004-08-16  Alan Modra  <amodra@bigpond.net.au>
3799
3800         * pdp11.c (struct pdp11_aout_reloc_external): Delete.  Replace
3801         occurrences with bfd_byte * thoughout file.
3802
3803         * coff-rs6000.c (do_shared_object_padding): Warning fix.
3804         (xcoff_write_armap_big): Likewise.
3805         (xcoff_write_archive_contents_old): Likewise.
3806         (xcoff_write_archive_contents_big): Likewise.
3807
3808         * elf64-mmix.c (mmix_elf_get_section_contents): Delete declaration.
3809
3810 2004-08-13  Nick Clifton  <nickc@redhat.com>
3811
3812         * elf32-arm.h: Convert to ISO C90.
3813
3814 2004-08-13  Alan Modra  <amodra@bigpond.net.au>
3815
3816         PR 293
3817         * elf32-hppa.c (elf32_hppa_hide_symbol): Use init_refcount to
3818         zero the plt field.
3819
3820 2004-08-13  Alan Modra  <amodra@bigpond.net.au>
3821
3822         * bfd.c (_bfd_default_error_handler): Handle %A and %B.
3823         (bfd_archive_filename, bfd_get_section_ident): Delete.
3824         * ecofflink.c (bfd_ecoff_debug_accumulate_other): Don't call
3825         bfd_archive_filename.
3826         * elflink.c (elf_link_input_bfd): Don't use callbacks->error_handler
3827         to warn about symbols in discarded sections.  Use _bfd_error_handler.
3828         * aout-adobe.c (aout_adobe_callback): See below.
3829         * aout-cris.c (swap_ext_reloc_in): ..
3830         * coff-arm.c (find_thumb_glue, find_arm_glue,
3831         coff_arm_relocate_section, bfd_arm_process_before_allocation,
3832         coff_arm_merge_private_bfd_data, _bfd_coff_arm_set_private_flags,
3833         coff_arm_copy_private_bfd_data): ..
3834         * coff-i860.c (i860_reloc_processing): ..
3835         * coff-mcore.c (mcore_coff_unsupported_reloc,
3836         coff_mcore_relocate_section): ..
3837         * coff-ppc.c (coff_ppc_relocate_section): ..
3838         * coff-rs6000.c (xcoff_create_csect_from_smclas
3839         * coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
3840         sh_swap_insns, sh_relocate_section): ..
3841         * coff-tic54x.c (tic54x_reloc_processing): ..
3842         * coff-tic80.c (coff_tic80_relocate_section): ..
3843         * coff64-rs6000.c (xcoff64_create_csect_from_smclas): ..
3844         * coffcode.h (styp_to_sec_flags, coff_slurp_line_table,
3845         coff_slurp_symbol_table, coff_classify_symbol,
3846         coff_slurp_reloc_table): ..
3847         * coffgen.c (_bfd_coff_read_string_table): ..
3848         * cofflink.c (coff_link_add_symbols, _bfd_coff_link_input_bfd,
3849         _bfd_coff_generic_relocate_section): ..
3850         * cpu-arm.c (bfd_arm_merge_machines): ..
3851         * cpu-sh.c (sh_merge_bfd_arch): ..
3852         * elf-hppa.h (elf_hppa_relocate_section): ..
3853         * elf.c (bfd_elf_string_from_elf_section, setup_group,
3854         _bfd_elf_setup_group_pointers, bfd_section_from_shdr,
3855         assign_section_numbers, _bfd_elf_symbol_from_bfd_symbol,
3856         copy_private_bfd_data, _bfd_elf_validate_reloc): ..
3857         * elf32-arm.h (find_thumb_glue, find_arm_glue,
3858         bfd_elf32_arm_process_before_allocation, elf32_thumb_to_arm_stub,
3859         elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate,
3860         elf32_arm_relocate_section, elf32_arm_set_private_flags,
3861         elf32_arm_copy_private_bfd_data, elf32_arm_merge_private_bfd_data): ..
3862         * elf32-cris.c (cris_elf_relocate_section, cris_elf_check_relocs,
3863         cris_elf_merge_private_bfd_data
3864         * elf32-frv.c (elf32_frv_relocate_section, elf32_frv_check_relocs): ..
3865         * elf32-gen.c (elf32_generic_link_add_symbols): ..
3866         * elf32-hppa.c (hppa_add_stub, hppa_build_one_stub,
3867         elf32_hppa_check_relocs, get_local_syms, final_link_relocate,
3868         elf32_hppa_relocate_section): ..
3869         * elf32-i370.c (i370_elf_merge_private_bfd_data,
3870         i370_elf_check_relocs, i370_elf_relocate_section): ..
3871         * elf32-i386.c (elf_i386_info_to_howto_rel, elf_i386_check_relocs,
3872         elf_i386_relocate_section): ..
3873         * elf32-m32r.c (m32r_elf_relocate_section,
3874         m32r_elf_merge_private_bfd_data): ..
3875         * elf32-m68hc1x.c (m68hc12_add_stub,
3876         _bfd_m68hc11_elf_merge_private_bfd_data): ..
3877         * elf32-m68k.c (elf_m68k_relocate_section): ..
3878         * elf32-mcore.c (mcore_elf_unsupported_reloc,
3879         mcore_elf_relocate_section): ..
3880         * elf32-ppc.c (ppc_elf_merge_private_bfd_data, bad_shared_reloc,
3881         ppc_elf_check_relocs, ppc_elf_relocate_section,
3882         ppc_elf_begin_write_processing): ..
3883         * elf32-s390.c (elf_s390_check_relocs, invalid_tls_insn,
3884         elf_s390_relocate_section): ..
3885         * elf32-sh-symbian.c (sh_symbian_import_as,
3886         sh_symbian_process_embedded_commands,
3887         sh_symbian_relocate_section): ..
3888         * elf32-sh.c (sh_elf_relax_section, sh_elf_relax_delete_bytes,
3889         sh_elf_swap_insns, sh_elf_relocate_section, sh_elf_check_relocs,
3890         sh_elf_merge_private_data): ..
3891         * elf32-sparc.c (elf32_sparc_check_relocs,
3892         elf32_sparc_relocate_section,
3893         elf32_sparc_merge_private_bfd_data): ..
3894         * elf32-v850.c (v850_elf_check_relocs,
3895         v850_elf_merge_private_bfd_data): ..
3896         * elf32-xtensa.c (elf_xtensa_check_relocs,
3897         elf_xtensa_relocate_section, elf_xtensa_merge_private_bfd_data): ..
3898         * elf64-alpha.c (elf64_alpha_relax_with_lituse,
3899         elf64_alpha_relax_got_load, elf64_alpha_size_got_sections,
3900         elf64_alpha_relocate_section_r, elf64_alpha_relocate_section): ..
3901         * elf64-gen.c (elf64_generic_link_add_symbols): ..
3902         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data, ppc_add_stub,
3903         ppc64_elf_check_relocs, ppc64_elf_edit_opd,
3904         ppc64_elf_relocate_section): ..
3905         * elf64-s390.c (elf_s390_check_relocs, invalid_tls_insn,
3906         elf_s390_relocate_section): ..
3907         * elf64-sh64.c (sh_elf64_relocate_section): ..
3908         * elf64-sparc.c (sparc64_elf_check_relocs,
3909         sparc64_elf_add_symbol_hook, sparc64_elf_relocate_section,
3910         sparc64_elf_merge_private_bfd_data): ..
3911         * elf64-x86-64.c (elf64_x86_64_check_relocs,
3912         elf64_x86_64_relocate_section): ..
3913         * elflink.c (_bfd_elf_add_default_symbol,
3914         _bfd_elf_link_assign_sym_version, elf_link_read_relocs_from_section,
3915         _bfd_elf_link_output_relocs, elf_link_add_object_symbols,
3916         bfd_elf_size_dynamic_sections, elf_link_output_extsym,
3917         elf_get_linked_section_vma, elf_fixup_link_order,
3918         bfd_elf_final_link, bfd_elf_gc_record_vtinherit,
3919         bfd_elf_gc_record_vtinherit, _bfd_elf_section_already_linked): ..
3920         * elfxx-ia64.c (elfNN_ia64_relax_section,
3921         elfNN_ia64_relocate_section, elfNN_ia64_merge_private_bfd_data): ..
3922         * elfxx-mips.c (mips_elf_perform_relocation,
3923         _bfd_mips_elf_check_relocs,
3924         _bfd_mips_elf_merge_private_bfd_data): ..
3925         * ieee.c (ieee_slurp_external_symbols): ..
3926         * ihex.c (ihex_bad_byte, ihex_scan, ihex_read_section): ..
3927         * libbfd.c (_bfd_generic_verify_endian_match): ..
3928         * linker.c (_bfd_generic_link_add_one_symbol,
3929         _bfd_generic_section_already_linked): ..
3930         * pdp11.c (translate_to_native_sym_flags): ..
3931         * pe-mips.c (coff_pe_mips_relocate_section): ..
3932         * peicode.h (pe_ILF_build_a_bfd): ..
3933         * srec.c (srec_bad_byte): ..
3934         * stabs.c (_bfd_link_section_stabs): ..
3935         * xcofflink.c (xcoff_link_add_symbols, xcoff_link_input_bfd): ..
3936         Replace all uses of bfd_archive_filename and bfd_get_section_ident
3937         with corresponding %B and %A in _bfd_error_handler format string.
3938         Replace occurrences of "fprintf (stderr," with _bfd_error_handler
3939         calls to use %A and %B.  Fix "against symbol .. from section" and
3940         similar error messages.  Combine multiple _bfd_error_handler calls
3941         where they were separated due to bfd_archive_filename deficiencies.
3942         * bfd-in2.h: Regenerate.
3943
3944 2004-08-12  H.J. Lu  <hongjiu.lu@intel.com>
3945
3946         * elf32-i386.c (elf_i386_relocate_section): Report unrecognized
3947         relocation.
3948
3949 2004-08-10  Alan Modra  <amodra@bigpond.net.au>
3950
3951         * elf64-ppc.c (struct ppc_link_hash_entry): Add was_undefined.
3952         (struct ppc_link_hash_table): Remove no_multi_toc, multi_toc_needed.
3953         Make emit_stub_syms, stub_error and has_14bit_branch bit-fields.
3954         Add twiddled_syms.
3955         (link_hash_newfunc): Init was_undefined.
3956         (add_symbol_adjust): Don't set undefined dot symbols to defweak;
3957         Use undefweak instead.
3958         (ppc64_elf_check_directives): Fix undefs chain.
3959         (ppc64_elf_next_toc_section): Remove no_multi_toc and multi_toc_needed
3960         references.
3961         (ppc64_elf_size_stubs): Adjust for add_symbol_adjust change.
3962         (undo_symbol_twiddle, ppc64_elf_restore_symbols): New functions.
3963         * elf64-ppc.h (ppc64_elf_restore_symbols): Declare.
3964
3965 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3966
3967         * elf64-x86-64.c (elf64_x86_64_relocate_section): For -fno-pic
3968         error, test input_section flags rather than sec.
3969
3970 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
3971
3972         * elf-bfd.h (struct elf_backend_data): Add
3973         elf_backend_archive_symbol_lookup.
3974         (_bfd_elf_archive_symbol_lookup): Declare.
3975         * elflink.c (_bfd_elf_archive_symbol_lookup): New function..
3976         (elf_link_add_archive_symbols): ..extracted from here.  Call the
3977         backend version.
3978         * elfxx-target.h (elf_backend_archive_symbol_lookup): Provide default.
3979         (elfNN_bed): Init new field.
3980         * elf64-ppc.c (elf_backend_check_directives): Define.
3981         (elf_backend_archive_symbol_lookup): Define.
3982         (struct ppc_link_hash_table): Add tls_get_add_fd.  Make tls_get_add
3983         a ppc_link_hash_entry pointer.
3984         (get_fdh): Move.
3985         (ppc64_elf_archive_symbol_lookup, opd_entry_value): New functions.
3986         (add_symbol_adjust, ppc64_elf_check_directives): New functions.
3987         (ppc64_elf_check_relocs, ppc64_elf_gc_mark_hook, func_desc_adjust,
3988         ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup,
3989         ppc64_elf_tls_optimize, allocate_dynrelocs, ppc_type_of_stub,
3990         ppc_build_one_stub, ppc64_elf_size_stubs, ppc64_elf_relocate_section,
3991         ppc64_elf_finish_dynamic_symbol): Handle branch relocs to function
3992         descriptor symbols.
3993
3994 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
3995
3996         * elf64-ppc.c (struct ppc_link_hash_entry): Expand adjust_done comment.
3997         (ppc64_elf_add_symbol_hook): Test for NULL section.
3998         (get_sym_h): Formatting.
3999         (ppc64_elf_size_stubs): Include reloc addend in value stored as
4000         stub target_value.
4001
4002         * elf64-ppc.c (ppc64_elf_relocate_section): Combine handling of
4003         long branch stubs with code handling plt and r2off branch stubs.
4004
4005 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4006
4007         * elf-bfd.h (_bfd_elf_gc_mark): Declare.
4008         * elflink.c (elf_link_input_bfd): Formatting.
4009         (_bfd_elf_gc_mark): Rename from elf_gc_mark and make global.  Adjust
4010         all callers.
4011         * elf64-ppc.c (struct ppc_link_hash_entry): Remove is_entry.
4012         (link_hash_newfunc): Don't set it.
4013         (ppc64_elf_copy_indirect_symbol): Nor copy it.
4014         (ppc64_elf_mark_entry_syms): Delete.
4015         (ppc64_elf_gc_mark_hook): Mark entry syms here.  Also mark opd
4016         sections.  Use get_opd_info.
4017         * elf64-ppc.h (ppc64_elf_mark_entry_syms): Delete.
4018
4019 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
4020
4021         * elf64-ppc.c (adjust_opd_syms): Fix merge error.
4022
4023         * elf64-ppc.c (struct ppc_link_hash_table): Remove have_undefweak.
4024         (func_desc_adjust): Don't set have_undefweak.
4025         (ppc64_elf_func_desc_adjust): Don't add an extr nop to sfpr.
4026         (ppc64_elf_relocate_section): NOP out calls to undefweak functions.
4027
4028         * elf64-ppc.c (struct ppc_link_hash_entry): Make "oh" a
4029         "struct ppc_link_hash_entry *".  Adjust all references.
4030         (ppc64_elf_hide_symbol): Correct a comment.
4031
4032         * elf64-ppc.c (get_opd_info): New function.
4033         (adjust_opd_syms): Use get_opd_info.  Define removed symbols as zero.
4034         (ppc64_elf_edit_opd): Use get_opd_info.  Check that sym has a dot
4035         before calling get_fdh.  Test fdh rather than h before dereferencing
4036         fdh.  Mark removed symbols in opd_adjust.
4037         (ppc64_elf_tls_optimize): Don't bother with opd adjustment here.
4038         (ppc64_elf_relocate_section): Use get_opd_info, and handle removed
4039         opd symbols.
4040         (ppc64_elf_output_symbol_hook): Likewise.
4041
4042 2004-08-06  Paul Brook  <paul@codesourcery.com>
4043
4044         * elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations.
4045         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32,
4046         BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32.
4047         * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32
4048         and BFD_RELOC_ARM_SBREL32.
4049         * bfd-in2.h, bbfd.h: Regenerate.
4050
4051 2004-08-01  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4052
4053         * elfxx-mips.c (mips_elf_calculate_relocation): Test only for
4054         the dynamic link symbol actually in use.
4055
4056 2004-08-01  Stephane Carrez  <stcarrez@nerim.fr>
4057
4058         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Handle bfd_link_hash_new
4059
4060 2004-07-31  Joel Brobecker  <brobecker@gnat.com>
4061             Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
4062
4063         * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Handle
4064         SHN_MIPS_TEXT and SHN_MIPS_DATA.
4065
4066 2004-07-30  H.J. Lu  <hongjiu.lu@intel.com>
4067             Nick Clifton  <nickc@redhat.com>
4068
4069         PR 290
4070         * bfd.c (_bfd_default_error_handler): Make it global.
4071
4072         * elf-bfd.h (elf_backend_data): Add link_order_error_handler.
4073
4074         * elf.c (assign_section_numbers): Cope gracefully with sections
4075         which have SHF_LINK_ORDER set but no sh_link set up.
4076         * elflink.c (elf_get_linked_section_vma): Likewise.
4077
4078         * elfxx-ia64.c (elf_backend_link_order_error_handler): New. Set
4079         it to NULL.
4080
4081         * elfxx-target.h (elf_backend_link_order_error_handler): New.
4082         Set it to _bfd_default_error_handler.
4083         (elfNN_bed): Add elf_backend_link_order_error_handler.
4084
4085         * libbfd-in.h (_bfd_default_error_handler): New.
4086
4087         * libbfd.h: Regenerated.
4088
4089 2004-07-30  Jakub Jelinek  <jakub@redhat.com>
4090
4091         * archures.c (bfd_mach_sparc_64bit_p): Define.
4092         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Use it.
4093         * bfd-in2.h: Rebuilt.
4094
4095 2004-07-29  Alexandre Oliva  <aoliva@redhat.com>
4096
4097         Introduce SH2a support.
4098         2004-02-18  Corinna Vinschen  <vinschen@redhat.com>
4099         * archures.c (bfd_mach_sh2a_nofpu): New.
4100         * bfd-in2.h: Rebuilt.
4101         * cpu-sh.c (SH2A_NOFPU_NEXT): New.
4102         (arch_info_struct): Add sh2a_nofpu.
4103         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a_nofpu.
4104         2003-12-29  DJ Delorie  <dj@redhat.com>
4105         * reloc.c: Add relocs for sh2a.
4106         * bfd-in2.h: Regenerate.
4107         * libbfd.hh: Regenerate.
4108         2003-12-01  Michael Snyder  <msnyder@redhat.com>
4109         * archures.c (bfd_mach_sh2a): New.
4110         * bfd-in2.h: Rebuilt.
4111         * cpu-sh.c (SH_NEXT, SH2_NEXT, etc.): Change defines to enums.
4112         (SH2A_NEXT): New.
4113         (arch_info_struct): Add sh2a.
4114         * elf32-sh.c (sh_elf_set_mach_from_flags): Handle sh2a.
4115
4116 2004-07-28  Nick Clifton  <nickc@redhat.com>
4117             John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4118
4119         PR 273
4120         * som.c (setup_sections): Improve estimation of space sizes in
4121         relocatable objects.
4122
4123 2004-07-27  Jason Thorpe  <thorpej@wasabisystems.com>
4124         * config.bfd (hppa*-*-netbsd*): Set targ_defvec to
4125         bfd_elf32_hppa_nbsd_vec.  Add bfd_elf32_hppa_linux_vec
4126         to targ_selvecs.
4127         * configure.in (bfd_elf32_hppa_nbsd_vec): Add case.
4128         * configure: Regenerate.
4129         * elf32-hppa.c (elf32_hppa_object_p): Add "elf32-hppa-netbsd"
4130         case that accepts OSABI=NetBSD and OSABI=SysV.
4131         (elf32_hppa_set_gp): For "elf32-hppa-netbsd", set the GP to
4132         the base of .got or .data (if .got does not exist).
4133         (elf32_hppa_post_process_headers): For elf32-hppa-netbsd,
4134         set OSABI=NetBSD.
4135         (TARGET_BIG_SYM): Add bfd_elf32_hppa_nbsd_vec case.
4136         (TARGET_BIG_NAME): Add "elf32-hppa-netbsd" case.
4137         * targets.c (bfd_elf32_hppa_nbsd_vec): Add extern declaration.
4138         (_bfd_target_vector): Add bfd_elf32_hppa_nbsd_vec.
4139
4140 2004-07-27  H.J. Lu  <hongjiu.lu@intel.com>
4141
4142         PR 161/251
4143         * elf-bfd.h (bfd_elf_section_data): Add sec_group.
4144         (elf_sec_group): Defined.
4145         (bfd_elf_match_symbols_in_sections): New prototype.
4146         (_bfd_elf_setup_group_pointers): Likewise.
4147
4148         * elf.c (bfd_elf_discard_group): Abort.
4149         (bfd_elf_set_group_contents): Also include relocation sections.
4150         Remove zero-fill for ld -r.
4151         (_bfd_elf_setup_group_pointers): New function.
4152         (elf_sort_elf_symbol): Likewise.
4153         (elf_sym_name_compare): Likewise.
4154         (bfd_elf_match_symbols_in_sections): Likewise.
4155
4156         * elfcode.h (elf_object_p): Call _bfd_elf_setup_group_pointers.
4157
4158         * elflink.c (match_group_member): New.
4159         (elf_link_input_bfd): Check group member for discarded section.
4160         (try_match_symbols_in_sections): New function.
4161         (already_linked): Likewise.
4162         (_bfd_elf_section_already_linked): Support mixing comdat group
4163         and linkonce section.
4164
4165         * libbfd-in.h (bfd_section_already_linked_table_traverse): New.
4166         * linker.c (bfd_section_already_linked_table_traverse): New.
4167
4168         * libbfd.h: Regenerated.
4169
4170 2004-07-27  Tomer Levi  <Tomer.Levi@nsc.com>
4171
4172         * reloc.c: Add BFD_RELOC_CRX_SWITCH8, BFD_RELOC_CRX_SWITCH16,
4173         BFD_RELOC_CRX_SWITCH32.
4174         * bfd-in2.h: Regenerate.
4175         * libbfd.h: Regenerate.
4176         * elf32-crx.c: Support relocation/relaxation of
4177         BFD_RELOC_CRX_SWITCH* types.
4178
4179 2004-07-27  Alan Modra  <amodra@bigpond.net.au>
4180
4181         * elf64-ppc.c: Correct "Linker stubs" comment.
4182
4183 2004-07-26  H.J. Lu  <hongjiu.lu@intel.com>
4184
4185         * elf-bfd.h (bfd_elf_section_data): Add a pointer for the
4186         linked-to section.
4187         (elf_linked_to_section): New.
4188
4189         * elf.c (assign_section_numbers): Set up sh_link for
4190         SHF_LINK_ORDER.
4191
4192         * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set sh_info
4193         to sh_link for SHT_IA_64_UNWIND sections.
4194
4195 2004-07-22  H.J. Lu  <hongjiu.lu@intel.com>
4196
4197         * elflink.c (elf_fixup_link_order): Add _() to error message.
4198
4199 2004-07-22  H.J. Lu  <hongjiu.lu@intel.com>
4200
4201         * elflink.c (elf_fixup_link_order): Issue a warning and flag
4202         an error if failed.
4203
4204 2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>
4205
4206         * aout-adobe.c (aout_32_section_already_linked): Defined.
4207         * aout-target.h (MY_section_already_linked): Likewise.
4208         * aout-tic30.c (MY_section_already_linked): Likewise.
4209         * binary.c (binary_section_already_linked): Likewise.
4210         * bout.c (b_out_section_already_linked): Likewise.
4211         * coff-alpha.c (_bfd_ecoff_section_already_linked): Likewise.
4212         * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
4213         * coffcode.h (coff_section_already_linked): Likewise.
4214         * i386msdos.c (msdos_section_already_linked): Likewise.
4215         * i386os9k.c (os9k_section_already_linked): Likewise.
4216         * ieee.c (ieee_section_already_linked): Likewise.
4217         * ihex.c (ihex_section_already_linked): Likewise.
4218         * mach-o.c (bfd_mach_o_section_already_linked): Likewise.
4219         * mmo.c (mmo_section_already_linked): Likewise.
4220         * nlm-target.h (nlm_section_already_linked): Likewise.
4221         * oasys.c (oasys_section_already_linked): Likewise.
4222         * pef.c (bfd_pef_section_already_linked): Likewise.
4223         * ppcboot.c (ppcboot_section_already_linked): Likewise.
4224         * som.c (som_bfd_discard_group): Likewise.
4225         * srec.c (srec_section_already_linked): Likewise.
4226         * tekhex.c (tekhex_section_already_linked): Likewise.
4227         * versados.c (versados_section_already_linked): Likewise.
4228         * vms.c (vms_section_already_linked): Likewise.
4229         * coff-target.h (_bfd_xcoff_section_already_linked): Likewise.
4230         * xsym.c (bfd_sym_section_already_linked): Likewise.
4231
4232         * bfd-in.h (bfd_section_already_linked_table_init): New.
4233         (bfd_section_already_linked_table_free): Likewise.
4234
4235         * coff-rs6000.c (rs6000coff_vec): Add
4236         _bfd_generic_section_already_linked.
4237         (pmac_xcoff_vec): Likewise.
4238         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
4239         (aix5coff64_vec): Likewise.
4240
4241         * elf-bfd.h (_bfd_elf_section_already_linked): New prototype.
4242         * elflink.c (_bfd_elf_section_already_linked): New function.
4243
4244         * elfxx-target.h (bfd_elfNN_section_already_linked): Defined.
4245
4246         * libbfd-in.h (_bfd_nolink_section_already_linked): Defined.
4247         (_bfd_generic_section_already_linked): New.
4248         (bfd_section_already_linked_hash_entry): Likewise.
4249         (bfd_section_already_linked): Likewise.
4250         (bfd_section_already_linked_table_lookup): Likewise.
4251         (bfd_section_already_linked_table_insert): Likewise.
4252
4253         * linker.c (bfd_section_already_linked): New.
4254         (_bfd_section_already_linked_table): Likewise.
4255         (bfd_section_already_linked_table_lookup): Likewise.
4256         (bfd_section_already_linked_table_insert): Likewise.
4257         (already_linked_newfunc): Likewise.
4258         (bfd_section_already_linked_table_init): Likewise.
4259         (bfd_section_already_linked_table_free): Likewise.
4260         (_bfd_generic_section_already_linked): Likewise.
4261
4262         * section.c (bfd_section): Remove comdat.
4263         (bfd_comdat_info): Moved to ...
4264         * bfd-in.h (coff_comdat_info): Here.
4265         (bfd_coff_get_comdat_section): New.
4266         * coffgen.c (bfd_coff_get_comdat_section): Likewise.
4267         * libcoff-in.h (coff_section_tdata): Add comdat.
4268         * coffcode.h (handle_COMDAT): Updated.
4269         * cofflink.c (coff_link_add_symbols): Likewise.
4270         * ecoff.c (bfd_debug_section): Likewise.
4271
4272         * targets.c (bfd_target): Add _section_already_linked.
4273         (BFD_JUMP_TABLE_LINK): Updated.
4274
4275         * bfd-in2.h: Regenerated.
4276         * libbfd.h: Likewise.
4277         * libcoff.h: Likewise.
4278
4279 2003-07-21  Paul Brook  <paul@codesourcery.com>
4280
4281         * elflink.c (elf_get_linked_section_vma, compare_link_order,
4282         elf_fixup_link_order): New functions.
4283         (bfd_elf_final_link): Call elf_fixup_link_order.
4284
4285 2004-07-21  Alexandre Oliva  <aoliva@redhat.com>
4286
4287         * elf-bfd.h (ELF_COMMON_DEF_P): New.
4288         * elflink.c (_bfd_elf_symbol_refs_local_p): Use it to handle
4289         common definitions.
4290         * elf-m10300.c: Use SYMBOL_REFERENCES_LOCAL instead of
4291         _bfd_elf_symbol_refs_local_p.
4292         * elf32-frv.c (FRVFDPIC_SYM_LOCAL): Remove hack for common
4293         symbols.
4294
4295 2004-07-19  H.J. Lu  <hongjiu.lu@intel.com>
4296
4297         * bfd-in.h (dynamic_lib_link_class): Add DYN_NO_ADD_NEEDED and
4298         DYN_NO_NEEDED.
4299         (bfd_elf_get_dyn_lib_class): New prototype.
4300         * elf.c (bfd_elf_get_dyn_lib_class): New function.
4301
4302         * elflink.c (elf_link_add_object_symbols): Check DYN_AS_NEEDED,
4303         DYN_DT_NEEDED and DYN_NO_NEEDED bits to see if a DT_NEEDED
4304         entry is needed. Issue an error if a DT_NEEDED entry is needed
4305         for a file marked DYN_NO_NEEDED.
4306         (elf_link_check_versioned_symbol): Check the DYN_DT_NEEDED bit
4307         for DT_NEEDED tags.
4308
4309         * bfd-in2.h: Regenerated.
4310
4311 2004-07-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4312
4313         * elflink.c (elf_section_complain_discarded): Don't complain in
4314         .PARISC.unwind.
4315
4316 2004-07-10  James E Wilson  <wilson@specifixinc.com>
4317
4318         * elfxx-ia64.c (elfNN_ia64_relax_ldxmov): Remove abfd parameter.
4319         (elfNN_ia64_install_value, elfNN_ia64_relax_brl): Likewise.
4320         (elfNN_ia64_relax_section, elfNN_ia64_relocate_section,
4321         elfNN_ia64_finish_dynamic_symbol, elfNN_ia64_finish_dynamic_sections):
4322         Fix callers.
4323         (elfNN_ia64_relax_brl): Change bfd_get_64 to bfd_getl64.  Change
4324         bfd_put_64 to bfd_putl64.
4325         (elfNN_ia64_relax_ldxmov, elfNN_ia64_install_value): Likewise.
4326
4327 2004-07-09  H.J. Lu  <hongjiu.lu@intel.com>
4328
4329         PR 240
4330         * elfxx-ia64.c (elfNN_ia64_relax_section): Only warn br in
4331         .init/.fini sections when trying to relax it.
4332
4333 2004-07-09  Jie Zhang  <zhangjie@magima.com.cn>
4334
4335         * elf.c (assign_file_positions_for_segments): Make sure the
4336         .dynamic section is the first section in the PT_DYNAMIC segment.
4337
4338 2004-07-09  Nick Clifton  <nickc@redhat.com>
4339
4340         * config.bfd: Change sh-sybmian-elf to sh-*-symbianelf.
4341         * elf32-sh-symbian.c: Rename the sh_find_elf_flags and
4342         sh_elf_get_flags_from_mach functions so that they do not conflict
4343         when this target is built with other sh-elf targets.
4344         * elf32-sh.c (sh_elf_get_flags_from_mach): Remove bogus
4345         suppression of this function.
4346         (sh_elf_find_flags): Likewise.
4347
4348 2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
4349
4350         * Makefile.am (ALL_MACHINES): Add cpu-crx.lo.
4351         (ALL_MACHINES_CFILES): Add cpu-crx.c.
4352         (BFD32_BACKENDS): Add elf32-crx.lo.
4353         (BFD32_BACKENDS_CFILES): Add elf32-crx.c.
4354         (cpu-crx.lo): New target.
4355         (elf32-crx.lo): New target.
4356         * Makefile.in: Regenerate.
4357         * archures.c (bfd_architecture): Add bfd_{arch,mach}_crx.
4358         (bfd_archures_list): Add bfd_crx_arch.
4359         * bfd-in2.h: Regenerate.
4360         * config.bfd: Handle crx-*-elf*, crx*.
4361         * configure.in: Handle bfd_elf32_crx_vec.
4362         * configure: Regenerate.
4363         * cpu-crx.c: New file.
4364         * elf32-crx.c: Likewise.
4365         * libbfd.h: Regenerate.
4366         * reloc.c: Add BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8,
4367         BFD_RELOC_CRX_REL8_CMP, BFD_RELOC_CRX_REL16, BFD_RELOC_CRX_REL24,
4368         BFD_RELOC_CRX_REL32, BFD_RELOC_CRX_REGREL12, BFD_RELOC_CRX_REGREL22,
4369         BFD_RELOC_CRX_REGREL28, BFD_RELOC_CRX_REGREL32, BFD_RELOC_CRX_ABS16,
4370         BFD_RELOC_CRX_ABS32, BFD_RELOC_CRX_NUM8, BFD_RELOC_CRX_NUM16,
4371         BFD_RELOC_CRX_NUM32, BFD_RELOC_CRX_IMM16 and BFD_RELOC_CRX_IMM32
4372         * targets.c (bfd_elf32_crx_vec): Declare.
4373         (bfd_target_vector): Add bfd_elf32_crx_vec.
4374
4375 2004-07-06  Nick Clifton  <nickc@redhat.com>
4376
4377         * config.bfd: Add sh-symbian-elf target.
4378         * configure.in: Add bfd_elf32_shl_symbian_vec.
4379         * configure: Regenerate.
4380         * elf-bfd.h (struct elf_backend_data): Add new field
4381         'check_directives'.
4382         * elflink.c (elf_link_add_object_symbols): Invoke the
4383         check_directives function, if defined.
4384         * elfxx-target.h: Provide a default, NULL definition for
4385         check_directives.
4386         * targets.c: Add bfd_elf32_shl_symbian_vec.
4387         * elf32-sh.c (sh_elf_swap_insns): Protect against unnecessary
4388         definition.
4389         (elf32_shlin_grok_prstatus, elf32_shlib_grok_psinfo,
4390         * sh_elf_get_flags_from_mach, sh_elf_find_flags): Likewise.
4391         (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Only define if they have
4392         not already been defined.
4393         * elf32-sh64.c: Use SH_TARGET_ALREADY_DEFINED.
4394         * sh-symbian.c: New file.  Provide functions to support the
4395         * sh-symbian-elf target.
4396         * Makefile.am: Add elf32-sh-symbian.c
4397         * Makefile.in: Regenerate.
4398
4399 2004-07-05  Andrew Stubbs <andrew.stubbs@superh.com>
4400
4401         * elf32-sh.c: Include ../opcodes/sh-opc.h.
4402         * Makefile.am: Ran make dep-am.
4403         * Makefile.in: Ran make dep-in.
4404
4405 2004-07-03  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
4406
4407         * cofflink.c (_bfd_coff_generic_relocate_section): Resolve PE weak
4408         externals properly.
4409
4410 2004-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4411
4412         * config.bfd: Add want64 to configuration target s390-*-linux*.
4413
4414 2004-07-01  H.J. Lu  <hongjiu.lu@intel.com>
4415
4416         * bfd.c (bfd_get_section_ident): New.
4417
4418         * elflink.c (elf_link_read_relocs_from_section): Call
4419         bfd_get_section_ident to identify the section when reporting
4420         error.
4421         (_bfd_elf_link_output_relocs): Likewise.
4422         (elf_link_output_extsym): Likewise.
4423         (elf_link_input_bfd): Likewise.
4424         (bfd_elf_gc_record_vtinherit): Likewise.
4425
4426         * bfd-in2.h: Regenerated.
4427
4428 2004-07-01  Jie Zhang  <zhangjie@magima.com.cn>
4429             Nick Clifton  <nickc@redhat.com>
4430
4431         PR 204
4432         * elfxx-mips.c (_bfd_mips_elf_final_link): Pass the correct number
4433         of section symbols to mips_elf_sort_hash_table ().
4434
4435 2004-07-01  Alan Modra  <amodra@bigpond.net.au>
4436
4437         * elflink.c (elf_section_ignore_discarded_relocs): Revert last
4438         change.  Comment.
4439         (elf_section_complain_discarded): New function.  Handle
4440         .gcc_except_table too.
4441         (elf_link_input_bfd): Rewrite handling of relocs against symbols
4442         in discarded sections.
4443         * elf-bfd.h (elf_discarded_section): Protect macro arg.
4444
4445 2004-06-30  James E Wilson  <wilson@specifixinc.com>
4446
4447         * elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff.  Initialize
4448         to NULL.  Call get_pltoff if NULL and NEED_PLTOFF is true.
4449
4450 2004-06-30  H.J. Lu  <hongjiu.lu@intel.com>
4451
4452         PR 233
4453         * elflink.c (elf_link_input_bfd): Issue an error for non-debug
4454         local references to discarded sections and report their
4455         locations.
4456
4457 2004-06-30  Alan Modra  <amodra@bigpond.net.au>
4458
4459         * elflink.c (elf_section_ignore_discarded_relocs): Don't test
4460         sec_info_type, test section name instead.
4461
4462 2004-06-29  H.J. Lu  <hongjiu.lu@intel.com>
4463
4464         PR 240
4465         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch
4466         in .init/.fini sections.
4467
4468 2004-06-29  Bob Wilson  <bob.wilson@acm.org>
4469
4470         * elf32-xtensa.c (elf_xtensa_relocate_section): Use
4471         bfd_get_section_limit.
4472
4473 2004-06-29  Bob Wilson  <bob.wilson@acm.org>
4474
4475         * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Don't change the
4476         output section size.
4477
4478 2004-06-29  Alan Modra  <amodra@bigpond.net.au>
4479
4480         * elf64-mmix.c (mmix_set_relaxable_size): Save original size in
4481         rawsize.
4482         (mmix_elf_perform_relocation): Adjust for above change.
4483         (mmix_elf_relocate_section): Likewise.
4484         (mmix_elf_relax_section): Likewise.  Use output_section->rawsize.
4485         (mmix_elf_get_section_contents): Delete.
4486         (bfd_elf64_get_section_contents): Delete.
4487         (mmix_elf_relocate_section): Zero stub area.
4488         * linker.c (default_indirect_link_order): Alloc max of section size
4489         and rawsize.
4490         * simple.c (bfd_simple_get_relocated_section_contents): Likewise.
4491         * section.c (bfd_malloc_and_get_section): Likewise.
4492         (struct bfd_section): Update rawsize comment.
4493         * bfd-in2.h: Regenerate.
4494
4495         * reloc16.c (bfd_coff_reloc16_relax_section): Set rawsize.
4496
4497 2004-06-29  Alan Modra  <amodra@bigpond.net.au>
4498
4499         * bfd-in.h (bfd_get_section_limit): Define.
4500         * reloc.c (bfd_perform_relocation, bfd_install_relocation)
4501         (_bfd_final_link_relocate): Use bfd_get_section_limit.
4502         * aout-tic30.c (tic30_aout_final_link_relocate): Likewise.
4503         * coff-arm.c (coff_arm_relocate_section): Likewise.
4504         * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise.
4505         * cpu-ns32k.c (do_ns32k_reloc): Likewise.
4506         (bfd_ns32k_final_link_relocate): Likewise.
4507         * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise.
4508         * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise.
4509         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc)
4510         (i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise.
4511         * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc)
4512         (m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise.
4513         * elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise.
4514         * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
4515         * elf32-or32.c (or32_elf_consth_reloc): Likewise.
4516         * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise.
4517         * elf32-s390.c (s390_elf_ldisp_reloc): Likewise.
4518         * elf32-sh.c (sh_elf_reloc_loop): Likewise.
4519         * elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise.
4520         (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise.
4521         * elf32-v850.c (v850_elf_reloc): Likewise.
4522         * elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise.
4523         * elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise.
4524         * elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise.
4525         * elf64-mips.c (mips_elf64_gprel32_reloc)
4526         (mips16_gprel_reloc): Likewise.
4527         * elf64-mmix.c (mmix_elf_reloc): Likewise.
4528         * elf64-s390.c (s390_elf_ldisp_reloc): Likewise.
4529         * elf64-sparc.c (init_insn_reloc): Likewise.
4530         * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
4531         * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp)
4532         (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc)
4533         (_bfd_mips_elf_generic_reloc): Likewise.
4534         * bfd-in2.h: Regenerate.
4535
4536 2004-06-28  Alan Modra  <amodra@bigpond.net.au>
4537
4538         * bfd-in.h (struct stab_info): Move from stabs.c.
4539         * stabs.c (struct stab_link_includes_table): Delete.
4540         (stab_link_includes_lookup): Delete.
4541         (_bfd_write_section_stabs, _bfd_write_stab_strings): Remove one
4542         level of indirection from sinfo parm.
4543         (_bfd_link_section_stabs): Likewise.  Set SEC_LINKER_CREATED on
4544         stabstr section.  Adjust hash table accesses.
4545         * coff-ppc.c (ppc_bfd_coff_final_link): Do include rawsize in contents
4546         alloc.  Adjust stab_info test.
4547         * cofflink.c (_bfd_coff_link_hash_table_init): Clear stab_info.
4548         (_bfd_coff_final_link): Adjust stab_info test.
4549         (_bfd_coff_link_input_bfd): Ignore SEC_LINKER_CREATED sections.
4550         * elf-bfd.h (struct elf_link_hash_table): Include struct stab_info
4551         in place.
4552         * libcoff-in.h (struct coff_link_hash_table): Likewise.
4553         * elf.c (_bfd_elf_link_hash_table_init): Clear stab_info.
4554         * elflink.c (bfd_elf_final_link): Don't attempt to link linker created
4555         stabstr section.  Adjust stab_info test.
4556         * libbfd-in.h (_bfd_link_section_stabs, _bfd_write_section_stabs)
4557         (_bfd_write_stab_strings): Adjust prototypes.
4558         * libbfd.h: Regenerate.
4559         * libcoff.h: Regenerate.
4560         * bfd-in2.h: Regenerate.
4561
4562 2004-06-27  Mark Kettenis  <kettenis@gnu.org>
4563
4564         From Miod Vallat <miod@online.fr>:
4565         * aoutx.h (NAME(aout,machine_type)): Handle bfd_arch_m88k.
4566
4567 2004-06-26  Alexandre Oliva  <aoliva@redhat.com>
4568
4569         * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): Delete.
4570         (struct elf32_mn10300_link_hash_entry): Remove
4571         pcrel_relocs_copied.
4572         (mn10300_elf_check_relocs): Only reserve dynamic relocations for
4573         R_MN10300_32.  Don't adjust pcrel_relocs_copied.
4574         (mn10300_elf_final_link_relocate): Fail for direct, pc-relative
4575         and gotoff relocations if the symbol doesn't bind locally.  Use
4576         _bfd_elf_symbol_refs_local_p to test.  Don't create dynamic
4577         relocation for PCREL32.
4578         (mn10300_elf_relocate_section): Use _bfd_elf_symbol_refs_local_p
4579         to test whether a symbol binds locally.
4580         (elf32_mn10300_link_hash_newfunc): Don't initialize
4581         pcrel_relocs_copied.
4582         (_bfd_mn10300_elf_discard_copies): Delete.
4583         (_bfd_mn10300_elf_size_dynamic_sections): Don't call it.
4584
4585 2004-06-26  Mark Kettenis  <kettenis@gnu.org>
4586
4587         * config.bfd: Replace m88k-*-openbsd* with m88*-*-openbsd*.
4588
4589 2004-06-25  Joel Brobecker  <brobecker@gnat.com>
4590
4591         * som.c (som_set_reloc_info): Correct small typo.
4592
4593 2004-06-25  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
4594
4595         * elf32-m32r.c (m32r_elf_howto_table): Support R_M32R_GOTOFF.
4596         (m32r_elf_relocate_section): Changed for R_M32R_GOTOFF.
4597         (m32r_elf_gcsweep_hook): Likewise.
4598         (m32r_elf_check_relocs): Likewise.
4599         (m32r_elf_howto_table): Added R_M32R_GOTOFF_HI_ULO,
4600         R_M32R_GOTOFF_HI_SLO and R_M32R_GOTOFF_LO.
4601         * reloc.c: Added BFD_RELOC_M32R_GOTOFF_HI_ULO,
4602         BFD_RELOC_M32R_GOTOFF_HI_SLO and BFD_RELOC_M32R_GOTOFF_LO.
4603         * bfd-in2.h: Regenerated.
4604         * libbfd.h: Regenerated.
4605
4606 2004-06-24  H.J. Lu  <hongjiu.lu@intel.com>
4607
4608         * elf64-x86-64.c (elf64_x86_64_check_relocs): Warn overflow
4609         relocation symbol.
4610         (elf64_x86_64_relocate_section): Issue an error for
4611         R_X86_64_PC8, R_X86_64_PC16 and R_X86_64_PC32 relocations
4612         against global symbols when building shared library.
4613
4614 2004-06-24  Alan Modra  <amodra@bigpond.net.au>
4615
4616         * section.c (struct sec): Rename "_cooked_size" to "size".
4617         Rename "_raw_size" to "rawsize".
4618         (STD_SECTION): Adjust comments.
4619         (bfd_set_section_size, bfd_get_section_contents): Use size.
4620         (bfd_malloc_and_get_section): New function.
4621         * bfd-in.h (bfd_section_size, bfd_get_section_size): Use size.
4622         * coff-sh.c (sh_relax_section): Alloc coff_section_data struct early.
4623         Correctly free reloc and contents memory.
4624         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME
4625         and fake CIE now that we can shink section size to zero.
4626         (_bfd_elf_write_section_eh_frame): Likewise..
4627         * elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents.
4628         * elf-m10300.c (mn10300_elf_final_link_relocate): Don't use
4629         _bfd_stab_section_offset.  Use _bfd_elf_section_offset.
4630         * stabs.c (_bfd_stab_section_offset_): Remove unused args and
4631         unneeded indirection.
4632         * elf.c (_bfd_elf_section_offset): .. and update call.
4633         * libbfd-in.h (_bfd_stab_section_offset): Update prototype.
4634         * libbfd.h: Regenerate.
4635         * bfd-in2.h: Regenerate.
4636
4637         Replace occurrences of "_raw_size" and "_cooked_size" in most places
4638         with "size".  Set new "rawsize" for stabs, eh_frame, and SEC_MERGE
4639         sections.  Use "rawsize", if non-zero, for bfd_get_section_contents
4640         calls if the section might be a stabs, eh_frame, or SEC_MERGE section.
4641         Similarly use "rawsize", if non-zero, in reloc functions to validate
4642         reloc addresses.  Use new bfd_malloc_and_get_section in most places
4643         where bfd_get_section_contents was called.  Expand all occurrences of
4644         bfd_section_size and bfd_get_section_size.  Rename "raw_size" var in
4645         grok_prstatus and similar functions to "size".
4646         * aix386-core.c (aix386_core_file_p): ..
4647         * aix5ppc-core.c (xcoff64_core_p): ..
4648         * aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents,
4649         aout_adobe_set_section_contents): ..
4650         * aout-target.h (callback): ..
4651         * aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate,
4652         MY_bfd_final_link): ..
4653         * aoutf1.h (sunos4_core_file_p): ..
4654         * aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic,
4655         adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags,
4656         final_link, aout_link_input_section): ..
4657         * binary.c (binary_object_p, binary_canonicalize_symtab,
4658         binary_set_section_contents): ..
4659         * bout.c (b_out_callback, b_out_write_object_contents,
4660         b_out_set_section_contents, b_out_bfd_relax_section,
4661         b_out_bfd_get_relocated_section_contents): ..
4662         * cisco-core.c (cisco_core_file_validate): ..
4663         * coff-alpha.c (alpha_ecoff_object_p,
4664         alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): ..
4665         * coff-arm.c (coff_arm_relocate_section,
4666         bfd_arm_allocate_interworking_sections): ..
4667         * coff-h8300.c (h8300_reloc16_extra_cases,
4668         h8300_bfd_link_add_symbols): ..
4669         * coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): ..
4670         * coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section,
4671         ppc_bfd_coff_final_link): ..
4672         * coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): ..
4673         * coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
4674         sh_align_loads, sh_coff_get_relocated_section_contents): ..
4675         * coff64-rs6000.c (xcoff64_write_object_contents,
4676         xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): ..
4677         * coffcode.h (coff_compute_section_file_positions,
4678         coff_write_object_contents): ..
4679         * coffgen.c (make_a_section_from_file, coff_write_symbols,
4680         coff_section_symbol, build_debug_section): ..
4681         * cofflink.c (coff_link_add_symbols, _bfd_coff_final_link,
4682         process_embedded_commands, _bfd_coff_link_input_bfd,
4683         _bfd_coff_write_global_sym): ..
4684         * cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): ..
4685         * cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): ..
4686         * dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): ..
4687         * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
4688         _bfd_dwarf2_find_nearest_line): ..
4689         * ecoff.c (bfd_debug_section, ecoff_set_symbol_info,
4690         ecoff_compute_section_file_positions,
4691         _bfd_ecoff_write_object_contents, ecoff_indirect_link_order): ..
4692         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame,
4693         _bfd_elf_discard_section_eh_frame_hdr,
4694         _bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset,
4695         _bfd_elf_write_section_eh_frame,
4696         _bfd_elf_write_section_eh_frame_hdr): ..
4697         * elf-hppa.h (elf_hppa_sort_unwind): ..
4698         * elf-m10200.c (mn10200_elf_relax_section,
4699         mn10200_elf_relax_delete_bytes,
4700         mn10200_elf_get_relocated_section_contents): ..
4701         * elf-m10300.c (_bfd_mn10300_elf_create_got_section,
4702         mn10300_elf_check_relocs, mn10300_elf_relax_section,
4703         mn10300_elf_relax_delete_bytes,
4704         mn10300_elf_get_relocated_section_contents,
4705         _bfd_mn10300_elf_adjust_dynamic_symbol,
4706         _bfd_mn10300_elf_discard_copies,
4707         _bfd_mn10300_elf_size_dynamic_sections,
4708         _bfd_mn10300_elf_finish_dynamic_sections): ..
4709         * elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list,
4710         _bfd_elf_make_section_from_phdr, elf_fake_sections,
4711         bfd_elf_set_group_contents, map_sections_to_segments,
4712         elf_sort_sections, assign_file_positions_for_segments,
4713         SECTION_SIZE, copy_private_bfd_data,
4714         _bfd_elf_get_dynamic_reloc_upper_bound,
4715         _bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect,
4716         _bfd_elfcore_make_pseudosection, elfcore_grok_prstatus,
4717         elfcore_grok_lwpstatus, elfcore_grok_win32pstatus,
4718         elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs,
4719         _bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): ..
4720         * elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect,
4721         bfd_elf32_arm_process_before_allocation,
4722         elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs,
4723         elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections,
4724         elf32_arm_write_section): ..
4725         * elf32-cris.c (cris_elf_grok_prstatus,
4726         elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook,
4727         elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol,
4728         cris_elf_check_relocs, elf_cris_size_dynamic_sections,
4729         elf_cris_discard_excess_dso_dynamics,
4730         elf_cris_discard_excess_program_dynamics): ..
4731         * elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): ..
4732         * elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): ..
4733         * elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup,
4734         _frv_create_got_section, _frvfdpic_assign_plt_entries,
4735         elf32_frvfdpic_size_dynamic_sections,
4736         elf32_frvfdpic_modify_segment_map,
4737         elf32_frvfdpic_finish_dynamic_sections): ..
4738         * elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes,
4739         elf32_h8_get_relocated_section_contents): ..
4740         * elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub,
4741         elf32_hppa_adjust_dynamic_symbol, allocate_plt_static,
4742         allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections,
4743         elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs,
4744         elf32_hppa_finish_dynamic_sections): ..
4745         * elf32-i370.c (i370_elf_adjust_dynamic_symbol,
4746         i370_elf_size_dynamic_sections, i370_elf_check_relocs,
4747         i370_elf_finish_dynamic_sections): ..
4748         * elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol,
4749         allocate_dynrelocs, elf_i386_size_dynamic_sections,
4750         elf_i386_relocate_section, elf_i386_finish_dynamic_sections): ..
4751         * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
4752         i860_howto_highadj_reloc, i860_howto_splitn_reloc): ..
4753         * elf32-ip2k.c (ip2k_is_switch_table_128,
4754         ip2k_relax_switch_table_128, ip2k_is_switch_table_256,
4755         ip2k_relax_switch_table_256, ip2k_elf_relax_section,
4756         adjust_all_relocations, ip2k_elf_relax_delete_bytes): ..
4757         * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc,
4758         m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol,
4759         allocate_dynrelocs, m32r_elf_size_dynamic_sections,
4760         m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections,
4761         m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
4762         m32r_elf_get_relocated_section_contents): ..
4763         * elf32-m68hc11.c (m68hc11_elf_build_one_stub,
4764         m68hc11_elf_size_one_stub, m68hc11_elf_relax_section,
4765         m68hc11_elf_relax_delete_bytes): ..
4766         * elf32-m68hc12.c (m68hc12_elf_build_one_stub,
4767         m68hc12_elf_size_one_stub): ..
4768         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs,
4769         elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): ..
4770         * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook,
4771         elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections,
4772         elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): ..
4773         * elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
4774         elf32_mips_grok_prstatus): ..
4775         * elf32-or32.c (or32_elf_consth_reloc): ..
4776         * elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc,
4777         elf_create_pointer_linker_section, ppc_elf_create_linker_section,
4778         ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol,
4779         allocate_dynrelocs, ppc_elf_size_dynamic_sections,
4780         ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus,
4781         ppc_elf_final_write_processing): ..
4782         * elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
4783         allocate_dynrelocs, elf_s390_size_dynamic_sections,
4784         elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): ..
4785         * elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section,
4786         sh_elf_relax_delete_bytes, sh_elf_align_loads,
4787         sh_elf_adjust_dynamic_symbol, allocate_dynrelocs,
4788         sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents,
4789         sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): ..
4790         * elf32-sh64-com.c (sh64_address_in_cranges,
4791         sh64_get_contents_type): ..
4792         * elf32-sh64.c (sh64_find_section_for_address,
4793         sh64_elf_final_write_processing): ..
4794         * elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc,
4795         sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol,
4796         allocate_dynrelocs, elf32_sparc_size_dynamic_sections,
4797         elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): ..
4798         * elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): ..
4799         * elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol,
4800         elf_vax_size_dynamic_sections, elf_vax_discard_copies,
4801         elf_vax_instantiate_got_entries, elf_vax_relocate_section,
4802         elf_vax_finish_dynamic_sections): ..
4803         * elf32-xstormy16.c (xstormy16_elf_24_reloc,
4804         xstormy16_elf_check_relocs, xstormy16_relax_plt_check,
4805         xstormy16_elf_relax_section, xstormy16_elf_always_size_sections,
4806         xstormy16_elf_finish_dynamic_sections): ..
4807         * elf32-xtensa.c (xtensa_read_table_entries,
4808         elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size,
4809         elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc,
4810         bfd_elf_xtensa_reloc, elf_xtensa_relocate_section,
4811         elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections,
4812         elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus,
4813         get_relocation_opcode, retrieve_contents, find_relaxable_sections,
4814         collect_source_relocs, is_resolvable_asm_expansion, remove_literals,
4815         relax_section, shrink_dynamic_reloc_sections, relax_property_section,
4816         xtensa_callback_required_dependence): ..
4817         * elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section,
4818         elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol,
4819         elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets,
4820         elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1,
4821         elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes,
4822         elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1,
4823         elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel,
4824         elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): ..
4825         * elf64-hppa.c (allocate_dynrel_entries,
4826         elf64_hppa_size_dynamic_sections,
4827         elf64_hppa_finish_dynamic_sections): ..
4828         * elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc,
4829         mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table,
4830         elf64_mips_grok_prstatus): ..
4831         * elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc,
4832         mmix_elf_relocate_section, mmix_elf_final_link,
4833         mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation,
4834         mmix_elf_relax_section, mmix_elf_get_section_contents): ..
4835         * elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus,
4836         ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust,
4837         ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd,
4838         allocate_dynrelocs, ppc64_elf_size_dynamic_sections,
4839         ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section,
4840         toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs,
4841         ppc64_elf_build_stubs, ppc64_elf_relocate_section,
4842         ppc64_elf_finish_dynamic_sections): ..
4843         * elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
4844         allocate_dynrelocs, elf_s390_size_dynamic_sections,
4845         elf_s390_finish_dynamic_sections): ..
4846         * elf64-sh64.c (sh_elf64_get_relocated_section_contents,
4847         sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol,
4848         sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections,
4849         sh64_elf64_finish_dynamic_sections): ..
4850         * elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc,
4851         sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol,
4852         sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section,
4853         sparc64_elf_finish_dynamic_symbol,
4854         sparc64_elf_finish_dynamic_sections): ..
4855         * elf64-x86-64.c (elf64_x86_64_grok_prstatus,
4856         elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs,
4857         elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section,
4858         elf64_x86_64_finish_dynamic_sections): ..
4859         * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): ..
4860         * elfcode.h (elf_slurp_reloc_table): ..
4861         * elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag,
4862         elf_finalize_dynstr, elf_link_add_object_symbols,
4863         bfd_elf_size_dynamic_sections, elf_link_sort_relocs,
4864         elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): ..
4865         * elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
4866         elf32_mips_grok_prstatus): ..
4867         * elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries,
4868         elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc,
4869         elfNN_ia64_choose_gp, elfNN_ia64_final_link,
4870         elfNN_ia64_finish_dynamic_sections): ..
4871         * elfxx-mips.c (mips_elf_create_procedure_table,
4872         mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp,
4873         _bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc,
4874         mips_elf_global_got_index, mips_elf_multi_got,
4875         mips_elf_create_compact_rel_section, mips_elf_calculate_relocation,
4876         mips_elf_allocate_dynamic_relocations,
4877         mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections,
4878         _bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol,
4879         _bfd_mips_elf_always_size_sections,
4880         _bfd_mips_elf_size_dynamic_sections,
4881         _bfd_mips_elf_finish_dynamic_symbol,
4882         _bfd_mips_elf_finish_dynamic_sections,
4883         _bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info,
4884         _bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents,
4885         _bfd_elf_mips_get_relocated_section_contents,
4886         _bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): ..
4887         * hp300hpux.c (callback): ..
4888         * hppabsd-core.c (make_bfd_asection): ..
4889         * hpux-core.c (make_bfd_asection): ..
4890         * i386linux.c (linux_link_create_dynamic_sections,
4891         bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): ..
4892         * i386msdos.c (msdos_write_object_contents): ..
4893         * i386os9k.c (os9k_callback, os9k_write_object_contents,
4894         os9k_set_section_contents): ..
4895         * ieee.c (parse_expression, ieee_slurp_external_symbols,
4896         ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data,
4897         ieee_write_section_part, do_with_relocs, do_as_repeat,
4898         do_without_relocs, ieee_write_debug_part, init_for_output,
4899         ieee_set_section_contents): ..
4900         * ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): ..
4901         * irix-core.c (do_sections, make_bfd_asection): ..
4902         * libaout.h (aout_section_merge_with_text_p): ..
4903         * libbfd.c (_bfd_generic_get_section_contents,
4904         _bfd_generic_get_section_contents_in_window): ..
4905         * linker.c (default_indirect_link_order): ..
4906         * lynx-core.c (make_bfd_asection): ..
4907         * m68klinux.c (linux_link_create_dynamic_sections,
4908         bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): ..
4909         * mach-o.c (bfd_mach_o_make_bfd_section,
4910         bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib,
4911         bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab,
4912         bfd_mach_o_scan_read_segment): ..
4913         * merge.c (_bfd_add_merge_section, record_section, merge_strings,
4914         _bfd_merge_sections): ..
4915         * mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc,
4916         mmo_map_set_sizes, mmo_canonicalize_symtab,
4917         mmo_internal_write_section, mmo_write_object_contents): ..
4918         * netbsd-core.c (netbsd_core_file_p): ..
4919         * nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import,
4920         nlm_alpha_set_public_section): ..
4921         * nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): ..
4922         * nlm32-sparc.c (nlm_sparc_write_import): ..
4923         * nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in,
4924         nlm_compute_section_file_positions): ..
4925         * oasys.c (oasys_object_p, oasys_slurp_section_data,
4926         oasys_write_sections, oasys_write_data, oasys_set_section_contents): ..
4927         * opncls.c (get_debug_link_info): ..
4928         * osf-core.c (make_bfd_asection): ..
4929         * pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic,
4930         adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs,
4931         final_link, aout_link_input_section): ..
4932         * peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out,
4933         pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): ..
4934         * pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section,
4935         bfd_pef_scan_start_address, bfd_pef_parse_symbols): ..
4936         * ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): ..
4937         * ptrace-core.c (ptrace_unix_core_file_p): ..
4938         * reloc.c (bfd_perform_relocation, bfd_install_relocation,
4939         _bfd_final_link_relocate, bfd_generic_relax_section,
4940         bfd_generic_get_relocated_section_contents): ..
4941         * reloc16.c (bfd_coff_reloc16_relax_section,
4942         bfd_coff_reloc16_get_relocated_section_c): ..
4943         * riscix.c (riscix_some_aout_object_p): ..
4944         * rs6000-core.c (read_hdr, make_bfd_asection): ..
4945         * sco5-core.c (make_bfd_asection): ..
4946         * simple.c (bfd_simple_get_relocated_section_contents): ..
4947         * som.c (som_object_setup, setup_sections, som_prep_headers,
4948         som_write_fixups, som_begin_writing, bfd_section_from_som_symbol,
4949         som_set_reloc_info, som_get_section_contents,
4950         som_bfd_link_split_section): ..
4951         * sparclinux.c (linux_link_create_dynamic_sections,
4952         bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): ..
4953         * srec.c (srec_scan, srec_read_section, srec_get_section_contents): ..
4954         * stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs,
4955         _bfd_write_stab_strings, _bfd_stab_section_offset): ..
4956         * sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections,
4957         bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs,
4958         sunos_scan_ext_relocs, sunos_scan_dynamic_symbol,
4959         sunos_write_dynamic_symbol, sunos_check_dynamic_reloc,
4960         sunos_finish_dynamic_link): ..
4961         * syms.c (_bfd_stab_section_find_nearest_line): ..
4962         * tekhex.c (first_phase, tekhex_set_section_contents,
4963         tekhex_write_object_contents): ..
4964         * trad-core.c (trad_unix_core_file_p): ..
4965         * versados.c (process_esd, process_otr, process_otr): ..
4966         * vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): ..
4967         * vms-misc.c (add_new_contents): ..
4968         * vms-tir.c (check_section, new_section, _bfd_vms_write_tir): ..
4969         * vms.c (vms_set_section_contents): ..
4970         * xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols,
4971         xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms,
4972         _bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): ..
4973         * xsym.c (bfd_sym_scan): .. See above.
4974
4975 2004-06-21  H.J. Lu  <hongjiu.lu@intel.com>
4976
4977         * elfxx-ia64.c (elfNN_ia64_relax_section): Add addend when
4978         calling _bfd_merged_section_offset only for section symbols.
4979
4980 2004-06-22  Alan Modra  <amodra@bigpond.net.au>
4981
4982         * elf32-ppc.c (ppc_elf_relax_section): Implement reference code
4983         for handling SEC_MERGE symbols in relax_section.
4984
4985 2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
4986
4987         2003-05-15  Richard Sandiford  <rsandifo@redhat.com>
4988         * cpu-h8300.c (compatible): Allow h8300s and h8300sx code to be
4989         linked together. Mark the result as h8300sx code.
4990
4991 2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
4992
4993         * elf-bfd.h (struct elf_backend_data): Added
4994         elf_backend_omit_section_dynsym.
4995         (_bfd_elf_link_omit_section_dynsym): Declare.
4996         * elf32-frv.c (_frvfdpic_link_omit_section_dynsym): New.
4997         (elf_backend_omit_section_dynsym): Use it for frvfdpic.
4998         * elflink.c (_bfd_elf_link_omit_section_dynsym): Split out of...
4999         (_bfd_elf_link_renumber_dynsyms): ... this function.
5000         * elfxx-target.h (elf_backend_omit_section_dynsym): Default to
5001         _bfd_elf_link_omit_section_dynsym).
5002         (elfNN_bed): Added elf_backend_omit_section_dynsym.
5003
5004 2004-06-21  Nick Clifton  <nickc@redhat.com>
5005
5006         * coffcode.h (styp_to_sec_flags): Ignore IMAGE_SCN_MEM_NOT_PAGED
5007         flags.
5008
5009 2004-06-17  Jerome Guitton  <guitton@gnat.com>
5010
5011         * bfd-in.h (bfd_cache_close_all): New function declaration.
5012         * bfd-in2.h: Regenerate.
5013         * cache.c (bfd_cache_close_all): New function definition.
5014
5015 2004-06-16  Mark Kettenis  <kettenis@gnu.org>
5016
5017         * configure.in: Don't set COREFILE to trad-core.lo for FreeBSD
5018         4.10 and beyond.
5019         * configure: Regenerate.
5020
5021 2004-06-16  Daniel Jacobowitz  <dan@debian.org>
5022
5023         * elf32-ppc.c (ppc_elf_create_linker_section): Create symbols in
5024         the pre-existing section.
5025
5026 2004-06-15  Alan Modra  <amodra@bigpond.net.au>
5027
5028         * section.c (struct sec): Remove usused flags.  Reorganize a little.
5029         (bfd_get_section_size_before_reloc): Delete.
5030         (bfd_get_section_size_after_reloc): Delete.
5031         (STD_SECTION): Update.
5032         (bfd_get_section_size_now): Delete.
5033         (bfd_set_section_contents): Don't referece reloc_done.
5034         (bfd_get_section_contents): Remove reloc_done comment.
5035         * bout.c (b_out_bfd_get_relocated_section_contents): Don't set
5036         reloc_done.
5037         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise.
5038         * ecoff.c (bfd_debug_section): Update initializer.
5039         * elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Ditto.
5040         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
5041         * bfd-in.h (bfd_section_size): Expand.
5042         (bfd_get_section_size): New macro.
5043         * bfd-in2.h: Regenerate.
5044         * coff64-rs6000.c (xcoff64_write_object_contents): Replace
5045         bfd_get_section_size_before_reloc with bfd_get_section_size.
5046         * coffcode.h (coff_write_object_contents): Likewise.
5047         * coffgen.c (build_debug_section): Likewise.
5048         * dwarf1.c (parse_line_table): Likewise.
5049         (_bfd_dwarf1_find_nearest_line): Likewise.
5050         * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
5051         * i386msdos.c (msdos_write_object_contents): Likewise.
5052         * pdp11.c (squirt_out_relocs): Likewise.
5053         * elf32-sh64.c (sh64_find_section_for_address): Remove comment.
5054         * elf64-mmix.c (mmix_elf_final_link): Update comment.
5055
5056 2004-06-14  Chris Demetriou  <cgd@broadcom.com>
5057
5058         * elf32-mips.c (elf_mips_gnu_pcrel32): Add (undoing 2004-04-24
5059         removal) with updated comment.
5060         (bfd_elf32_bfd_reloc_type_lookup): Add back case for
5061         BFD_RELOC_32_PCREL.
5062         (mips_elf32_rtype_to_howto): Add back case for R_MIPS_PC32.
5063         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
5064
5065 2004-06-12  Alan Modra  <amodra@bigpond.net.au>
5066
5067         * elf64-x86-64.c (elf64_x86_64_relocate_section): Ignore reloc
5068         overflow on branches to undefweaks.
5069
5070 2004-06-11  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
5071
5072         * coff-alpha.c (alpha_relocate_section): Set used_by_bfd directly
5073         as ecoff_section_data() does not return a valid lvalue.
5074
5075 2004-06-09  Alexandre Oliva  <aoliva@redhat.com>
5076
5077         * elflink.c (elf_sort_symbol): Compare section id, not pointers.
5078         (elf_link_add_object_symbols): Likewise.
5079
5080         * elf-m10300.c (_bfd_mn10300_elf_reloc_type_class): New.
5081         (elf_backend_reloc_type_class): New.
5082
5083 2004-06-08  Mark Kettenis  <kettenis@gnu.org>
5084
5085         * configure.in (hppa*-*-netbsd*, hppa*-*-openbsd): Set COREFILE to
5086         netbsd-core.lo.
5087         * configure: Regenerate.
5088
5089 2004-06-07  Daniel Jacobowitz  <dan@debian.org>
5090
5091         From:  Albert Chin-A-Young  <china@thewrittenword.com>
5092         * bfd/elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields
5093         to unsigned int.
5094
5095 2004-05-29  H.J. Lu  <hongjiu.lu@intel.com>
5096
5097         * elfxx-ia64.c (elfNN_ia64_relax_section): Undo the last
5098         change.
5099
5100 2004-05-28  DJ Delorie  <dj@redhat.com>
5101
5102         * elf-m10300.c (mn10300_elf_relax_section): Preserve reloc addend
5103         for linking, but otherwise adjust reloc for merged sections.
5104
5105 2004-05-28  H.J. Lu  <hongjiu.lu@intel.com>
5106
5107         * elfxx-ia64.c (elfNN_ia64_relax_section): Properly call
5108         _bfd_merged_section_offset for local symbols.
5109
5110 2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
5111
5112         * Makefile.am: Regenerate dependencies.
5113         * Makefile.in: Regenerate.
5114         * archures.c: Add bfd_mach_sh3_nommu .
5115         * bfd-in2.h: Regenerate.
5116         * cpu-sh.c: Add sh3-nommu architecture.
5117         (bfd_to_arch_table): Create new table.
5118         (sh_get_arch_from_bfd_mach): Create new function.
5119         (sh_get_arch_up_from_bfd_mach): Create new function.
5120         (sh_merge_bfd_arch): Create new function.
5121         * elf32-sh.c (sh_ef_bfd_table): Add table.
5122         (sh_elf_check_relocs): Replace switch statement with
5123         use of sh_ef_bfd_table .
5124         (sh_elf_get_flags_from_mach): Add new function.
5125         (sh_find_elf_flags): Likewise.
5126         (sh_elf_copy_private_data): Replace most of non-elf contents
5127         with a call to sh_merge_bfd_arch() .
5128
5129 2004-05-27  Michael Chastain  <mec.gnu@mindspring.com>
5130
5131         * Makefile.am (bfdver.h): Use explicit filename, not $< .
5132         * Makefile.in: Regenerate.
5133
5134 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
5135
5136         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Avoid
5137         custom calling conventions for dynamic symbols.
5138         (mn10300_elf_relax_section): Avoid relaxing a function as a local
5139         symbol if it's an alias to a global one.
5140
5141 2004-05-26  H.J. Lu  <hongjiu.lu@intel.com>
5142
5143         * elf.c (_bfd_elf_make_section_from_shdr): Undo the last
5144         change.
5145
5146 2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
5147
5148         * elf-m10300.c (mn10300_elf_relax_section): Don't test isym within
5149         loop over hashes.
5150
5151 2004-05-26  Alan Modra  <amodra@bigpond.net.au>
5152
5153         * elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE
5154         for SHT_GROUP sections.
5155
5156 2004-05-25  Alan Modra  <amodra@bigpond.net.au>
5157
5158         * elflink.c (elf_link_add_object_symbols): Don't set up merge
5159         section data here..
5160         * elf.c (_bfd_elf_merge_sections): .. Do it here instead.
5161         * merge.c: Formatting.  Remove unnecessary casts.  Expand
5162         bfd_get_section_alignment macro.
5163         (struct sec_merge_sec_info): Rename "first" to "first_str".  Update
5164         use throughout file.
5165         (_bfd_add_merge_section): Rename from _bfd_merge_section.  Update
5166         comment.  Abort on dynamic or non-SEC_MERGE input.  Don't test
5167         section name to determine sinfo group, instead test output section
5168         and alignment.
5169         (_bfd_merge_sections): Add struct bfd_link_info param.  Call
5170         _bfd_strip_section_from_output rather than just twiddling flags.
5171         * libbfd-in.h (_bfd_add_merge_section): Rename, update comment.
5172         (_bfd_merge_sections): Update prototype.
5173         * libbfd.h: Regenerate.
5174
5175 2004-05-24  Mark Kettenis  <kettenis@gnu.org>
5176
5177         * netbsd-core.c: Correctly indent section that sets architecture
5178         from machine ID.
5179
5180         From Miod Vallat <miod@online.fr>:
5181         * m88kopenbsd.c: New file.
5182         * targets.c (m88k_openbsd_vec): New.
5183         * config.bfd: Add m88k-*-openbsd*.
5184         * configure.in (m88k-*-openbsd*): Set COREFILE to netbsd-core.lo.
5185         (m88kopenbsd_vec): New.
5186         * configure: Regenerate.
5187         * Makefile.am (BFD32_BACKENDS): Add m88kopenbsd.lo.
5188         (BFD32_BACKENDS_CFILES): Add m88kopenbsd.c.
5189         Run "make dep-am".
5190         * Makefile.in: Regenerate.
5191         * po/SRC-POTFILES.in: Regenerate.
5192
5193 2004-05-24  Nick Clifton  <nickc@redhat.com>
5194
5195         * hash.c: Remove bogus node "Changing the default Hash Table Size"
5196         introduced by hash table size patch.
5197
5198 2004-05-22  Ben Elliston  <bje@au.ibm.com>
5199
5200         * configure.in (is_release): Remove.
5201         (bfd_version_date, bfd_version, bfd_version_string): Likewise.
5202         (AC_OUTPUT): Don't output bfdver.h from version.h.
5203         * configure: Regenerate.
5204         * Makefile.am (RELEASE): New variable.
5205         (bfdver.h): New target.
5206         * Makefile.in: Regenerate.
5207         * doc/Makefile.in: Likewise.
5208
5209 2004-05-22  Ben Elliston  <bje@au.ibm.com>
5210
5211         * Makefile.am (config.status): Don't depend on version.h.
5212         * Makefile.in: Regenerate.
5213
5214 2004-05-22  Alan Modra  <amodra@bigpond.net.au>
5215
5216         * merge.c (_bfd_merged_section_offset): Remove "addend" param.
5217         * libbfd-in.h (_bfd_merged_section_offset): Adjust prototype.
5218         * libbfd.h: Regenerate.
5219         * elf.c (_bfd_elf_rela_local_sym): Adjust call.
5220         (_bfd_elf_rel_local_sym): Likewise.
5221         * elflink.c (_bfd_elf_link_sec_merge_syms): Likewise.
5222         (elf_link_input_bfd): Likewise.
5223         * elf32-ppc.c (ppc_elf_relax_section): Likewise.
5224         * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
5225         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
5226         (elfNN_ia64_relocate_section): Likewise.
5227
5228 2004-05-21  Andy Chittenden  <achittenden@bluearc.com>
5229
5230         * hash.c (bfd_default_hash_table_size): New variable.
5231         (bfd_hash_table_init): Use new variable instead of DEFAULT_SIZE.
5232         (bfd_hash_set_default_size): New function.  Set the default size
5233         to a selected prime number close to the argument.  Document new
5234         function.
5235         * bfd-in.h: Add prototype for  bfd_hash_set_default_size.
5236         * bfd-in2.h: Regenerate.
5237         * Makefile.am (hash.lo): Add dependency upon libiberty.h.
5238         * Makefile.in: Regenerate.
5239
5240 2004-05-21  Mark Kettenis  <kettenis@gnu.org>
5241
5242         * libaout.h (machine_type): Add M_88K_OPENBSD and M_HPPA_OPENBSD.
5243         * netbsd-core.c (netbsd_core_file_p): Set architecture for alpha,
5244         arm, m68k, m88k and hppa core files.
5245
5246 2004-05-21  Nick Clifton  <nickc@redhat.com>
5247
5248         * bfdio.c (bfd_bread): Do not use iovec if it is NULL.
5249         (bfd_bwrite): Likewise.
5250         (bfd_tell): Likewise.
5251         (bfd_flush): Likewise.
5252         (bfd_stat): Likewise.
5253         (bfd_seek): Likewise.
5254         (bfd_get_mtime): Likewise.
5255         (bfd_get_size): Likewise.
5256
5257 2004-05-19  Ben Elliston  <bje@au.ibm.com>
5258
5259         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Comment correction.
5260
5261 2004-05-19  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
5262
5263         * archive.c (_bfd_get_elt_at_filepos): Cope with a nested archives.
5264         (bfd_generic_openr_next_archived_file): Likewise.
5265
5266 2004-05-17  Bob Wilson  <bob.wilson@acm.org>
5267
5268         * elf32-xtensa.c (xtensa_get_property_section_name): Determine linkonce
5269         section names by inserting a new substring after .gnu.linkonce, except
5270         for .gnu.linkonce.t.* where the "t." is replaced.
5271
5272 2004-05-17  Adam Nemet  <anemet@lnxw.com>
5273
5274         * config.bfd (sparc-*-lynxos* case): Add to obsolete list.
5275         (m68-*-lynxos* case): Likewise.
5276         (powerpc-*-lyxnos* case): New case.
5277         (i[3-7]86-*-lynxos* case): Update to LynxOS 4.0 ELF.
5278
5279 2004-05-17  David Heine  <dlheine@tensilica.com>
5280
5281         * aout-target.h (MY_bfd_copy_private_header_data): Define.
5282         * aout-tic30.c (MY_bfd_copy_private_header_data): Define.
5283         * bfd.c (bfd_copy_private_header_data): Define.
5284         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add entries for new
5285         interface.
5286         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
5287         * coffcode.h (coff_bfd_copy_private_header_data): Define.
5288         * elf-bfd.h (_bfd_elf_copy_private_header_data): Declare.
5289         * elf.c (_bfd_elf_copy_private_section_data): Remove code to set up
5290         segments by calling copy_private_bfd_data.
5291         (_bfd_elf_copy_private_header_data): Define.
5292         * elfxx-target.h (bfd_elfNN_bfd_copy_private_header_data): Define.
5293         * libbfd-in.h (_bfd_generic_bfd_copy_private_header_data): Define.
5294         * libecoff.h (_bfd_ecoff_bfd_copy_private_header_data): Define.
5295         * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Define.
5296         * mmo.c (mmo_bfd_copy_private_header_data): Define.
5297         * ppcboot.c (ppcboot_bfd_copy_private_header_data): Define.
5298         * som.c (som_bfd_copy_private_header_data): Define.
5299         * targets.c (BFD_JUMP_TABLE_COPY): Add _bfd_copy_private_header_data.
5300         * vms.c (vms_bfd_copy_private_header_data): Define.
5301         * bfd-in2.h: Regenerate.
5302         * libbfd.h: Regenerate.
5303
5304 2004-05-15  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
5305
5306         * elfxx-mips.c (MINUS_TWO): Define.
5307         (mips_elf_higher, mips_elf_highest,
5308         mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for
5309         some bfd_vma values.
5310         (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup.
5311
5312 2004-05-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5313
5314         * som.c (log2): Rename to exact_log2.  Adjust all callers.
5315
5316 2004-05-13  Paul Brook  <paul@codesourcery.com>
5317
5318         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle
5319         dwarf3 format CIE entries.  Remove comment about the size of the
5320         ra_column field.  It is now correctly deduced.
5321
5322 2004-05-13  Joel Sherrill <joel@oarcorp.com>
5323
5324         * config.bfd (or32-*-rtems*): Switch to elf.
5325
5326 2004-05-13  Nick Clifton  <nickc@redhat.com>
5327
5328         * po/fr.po: Updated French translation.
5329
5330 2004-05-11  Jakub Jelinek  <jakub@redhat.com>
5331
5332         * elflink.c (bfd_elf_final_link): Don't output STT_SECTION symbol
5333         into .dynsym if elf_section_data (sec)->dynindx <= 0.
5334         Adjust counting of last_local.
5335         (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections
5336         other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt
5337         created by the linker nor !SHF_ALLOC.
5338
5339         * elf32-i386.c (elf_i386_finish_dynamic_sections): Point
5340         DT_PLTGOT to the start of the .got.plt section instead of the
5341         .got output section.  Set sh_entsize for .got section in addition
5342         to .got.plt.
5343         (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
5344         is at sgot->output_section->vma.
5345         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point
5346         DT_PLTGOT to the start of the .got.plt section instead of the
5347         .got output section.
5348         (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
5349         is at sgot->output_section->vma.  Set sh_entsize for .got section
5350         in addition to .got.plt.
5351         * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO.
5352         (bfd_section_from_phdr): Likewise.
5353         (map_sections_to_segments): Likewise.
5354         (assign_file_positions_for_segments): Likewise.
5355         (get_program_header_size): Likewise.
5356         * elflink.c (bfd_elf_size_dynamic_sections): Set
5357         elf_tdata (output_bfd)->relro from info->relro.
5358         * elf-bfd.h (struct elf_obj_tdata): Add relro field.
5359
5360 2004-05-08  Alexandre Oliva  <aoliva@redhat.com>
5361
5362         * elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get
5363         a zero symndx for which we hadn't accounted a dynamic relocation.
5364         (_frvfdpic_add_rofixup): Likewise.
5365
5366 2004-05-07  Brian Ford  <ford@vss.fsi.com>
5367             DJ Delorie  <dj@redhat.com>
5368
5369         * coffcode.h (coff_write_object_contents) [COFF_IMAGE_WITH_PE]:
5370         Propagate IMAGE_FILE_LARGE_ADDRESS_AWARE.
5371         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Recognize
5372         IMAGE_FILE_LARGE_ADDRESS_AWARE.  Use PE defines.
5373
5374 2004-05-07  Alexandre Oliva  <aoliva@redhat.com>
5375
5376         * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Return
5377         immediately if there's no link info.
5378         (elf32_frvfdpic_copy_private_bfd_data): New.
5379         (bfd_elf32_bfd_copy_private_bfd_data): Use it for frvfdpic.
5380
5381 2004-05-06  Zack Weinberg  <zack@codesourcery.com>
5382
5383         * dwarf2.c (add_line_info): Also set info->filename to NULL if
5384         filename argument is null; do not call strlen on a null pointer.
5385
5386 2004-05-06  Daniel Jacobowitz  <drow@mvista.com>
5387
5388         * elf32-arm.h (elf32_arm_relocate_section): Remove R_ARM_PLT32
5389         special case.
5390
5391 2004-05-05  Alexandre Oliva  <aoliva@redhat.com>
5392
5393         * configure.in (bfd_elf32_frvfdpic_vec): New.
5394         * configure: Rebuilt.
5395         * targets.c (bfd_elf32_frvfdpic_vec): New.
5396         * config.bfd: Enable it on frv-*-elf and frv-*-*linux*, as default
5397         on the latter.
5398         * elf32-frv.c: Prefix all identifiers added for FDPIC support with
5399         frvfdpic instead of frv.  Rearrange elf-target macros such that
5400         the FDPIC-specific ones are only defined for this new target
5401         vector.
5402         (bfd_elf32_frvfdpic_vec): Declare.
5403         (IS_FDPIC): New.
5404         (elf32_frv_relocate_section): Use it to enable segment checking
5405         and to control rofixup emission.  Add output section vma to
5406         applied relocation in non-LOAD non-ALLOC sections.  Use
5407         _bfd_error_handler for errors.
5408         (_frv_create_got_section): Create .rel.got and .rofixup only in
5409         FDPIC.  Create non-dynamic _gp at .got+2048 in non-FDPIC, like the
5410         linker script.
5411         (elf32_frvfdpic_size_dynamic_sections): Assume FDPIC.
5412         (elf32_frvfdpic_modify_segment_map): Likewise.
5413         (elf32_frv_finish_dynamic_sections): New, do-nothing.
5414         (elf32_frvfdpic_finish_dynamic_sections): Assume FDPIC.  Improve
5415         error message if we miscompute the rofixup size.
5416         (frvfdpic_elf_use_relative_eh_frame): Assume FDPIC.
5417         (frvfdpic_elf_encode_eh_address): Likewise.
5418         (elf32_frv_check_relocs): Reject FDPIC-only relocs in non-FDPIC.
5419         Record relocs only in FDPIC.  Make sure _gp is defined for GPREL
5420         relocs.  Reject unknown relocation types.
5421         (elf32_frv_object_p): Make sure target vector matches FDPIC bits.
5422         (frv_elf_merge_private_bfd_data): Likewise.
5423         (ELF_MAXPAGESIZE): Revert to 0x1000 for elf32-frv; keep it as
5424         0x4000 for newly-added elf32-frvfdpic.
5425
5426 2004-05-05  Nick Clifton  <nickc@redhat.com>
5427
5428         PR/136
5429         * cache.c (bfd_cache_lookup_worker): Call abort() rather than
5430         returning NULL as most users of this function do not check its
5431         return value.
5432         * hppabsd-core.c (hppabsd_core_core_file_p): Do not check result
5433         of bfd_cache_lookup().
5434         * sco5-core.c (sco5_core_file_p): Likewise.
5435         * trad-core.c (trad_unix_core_file_p): Likewise.
5436
5437 2004-05-05  Nick Clifton  <nickc@redhat.com>
5438
5439         * cache.c (bfd_cache_lookup): Improve formatting.
5440         * archive.c: Fix formatting.
5441
5442 2004-05-05  Peter Barada  <peter@the-baradas.com>
5443
5444         * bfd_archures.c(bfd_architecture): Add 521x,5249,547x,548x.
5445         * cpu-m68k.c(bfd_m68k_arch): Likewise.
5446         * bfd-in2.h(bfd_architecture): Regenerate.
5447
5448 2004-05-03  Alan Modra  <amodra@bigpond.net.au>
5449
5450         * elf.c (_bfd_elf_rela_local_sym): Set kept_section for excluded
5451         SEC_MERGE sections.
5452         * elflink.c (elf_link_input_bfd): Adjust output reloc index for
5453         those against discarded link-once and SEC_MERGE section symbols.
5454
5455 2004-05-02  H.J. Lu  <hongjiu.lu@intel.com>
5456
5457         * section.c (bfd_get_section_by_name_if): New.
5458         * bfd-in2.h: Regenerated.
5459
5460 2004-05-02  Alan Modra  <amodra@bigpond.net.au>
5461
5462         * som.c (som_bfd_is_group_section): Define.
5463
5464 2004-05-01  Alan Modra  <amodra@bigpond.net.au>
5465
5466         * section.c (bfd_make_section_anyway): Copy the whole
5467         bfd_hash_entry, not just "next" from existing entry.
5468
5469 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
5470
5471         * elf.c (bfd_section_from_shdr): Maintain the section order in
5472         a section group.
5473         (special_sections): Add ".note.GNU-stack".
5474         (elf_fake_sections): Handle section group for relocatable
5475         link..
5476
5477 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
5478
5479         * section.c (bfd_sections_find_if): New.
5480         * bfd-in2.h: Regenerated.
5481
5482 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
5483
5484         * section.c (bfd_make_section_anyway): Add all sections to hash tab.
5485
5486         * elf-bfd.h (bfd_elf_is_group_section): Declare.
5487         * elf.c (bfd_elf_is_group_section): New function.
5488         * elfxx-target.h (bfd_elfNN_bfd_is_group_section
5489         * section.c (bfd_generic_is_group_section): New function.
5490         * targets.c (struct bfd_target): Add _bfd_is_group_section field.
5491         (BFD_JUMP_TABLE_LINK): Adjust.
5492         * aout-adobe.c (aout_32_bfd_is_group_section): Define.
5493         * aout-target.h (MY_bfd_is_group_section): Define.
5494         * aout-tic30.c (MY_bfd_is_group_section): Define.
5495         * bfd.c (bfd_is_group_section): Define.
5496         * binary.c (binary_bfd_is_group_section): Define.
5497         * bout.c (b_out_bfd_is_group_section): Define.
5498         * coff-alpha.c (_bfd_ecoff_bfd_is_group_section): Define.
5499         * coff-mips.c (_bfd_ecoff_bfd_is_group_section): Define.
5500         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Adjust.
5501         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Adjust.
5502         * coffcode.h (coff_bfd_is_group_section): Define.
5503         * i386msdos.c (msdos_bfd_is_group_section): Define.
5504         * i386os9k.c (os9k_bfd_is_group_section): Define.
5505         * ieee.c (ieee_bfd_is_group_section): Define.
5506         * ihex.c (ihex_bfd_is_group_section): Define.
5507         * libbfd-in.h (_bfd_nolink_bfd_is_group_section): Define.
5508         * mach-o.c (bfd_mach_o_bfd_is_group_section): Define.
5509         * mmo.c (mmo_bfd_is_group_section): Define.
5510         * nlm-target.h (nlm_bfd_is_group_section): Define.
5511         * oasys.c (oasys_bfd_is_group_section): Define.
5512         * pef.c (bfd_pef_bfd_is_group_section): Define.
5513         * ppcboot.c (ppcboot_bfd_is_group_section): Define.
5514         * srec.c (srec_bfd_is_group_section): Define.
5515         * tekhex.c (tekhex_bfd_is_group_section): Define.
5516         * versados.c (versados_bfd_is_group_section): Define.
5517         * vms.c (vms_bfd_is_group_section): Define.
5518         * xsym.c (bfd_sym_bfd_is_group_section): Define.
5519         * bfd-in2.h: Regenerate.
5520         * libbfd.h: Regenerate.
5521
5522 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
5523
5524         * elflink.c (elf_gc_mark): Follow indirect and warning syms.
5525
5526 2004-04-30  Hans-Peter Nilsson  <hp@axis.com>
5527
5528         * configure.in: Update version to 2.15.91.
5529         * configure: Regenerate.
5530
5531 2004-04-29  Brian Ford  <ford@vss.fsi.com>
5532
5533         * bfd.c (bfd_get_sign_extend_vma): Add pe[i]-i386 case to DJGPP hack.
5534         * coffcode.h (DOT_DEBUG, GNU_LINKONCE_WI): Define.
5535         [!COFF_WITH_PE] (sec_to_styp_flags, styp_to_sec_flags): Use them.
5536         (coff_compute_section_file_positions) [RS6000COFF_C]: Likewise.
5537         [COFF_WITH_PE] (sec_to_styp_flags): Handle DWARF 2/3 .debug* and
5538         .gnu.linkonce.wi. sections.
5539         * pe-i386.c (COFF_SUPPORT_GNU_LINKONCE): Define.
5540         (COFF_SECTION_ALIGNMENT_ENTRIES): Add entries for .debug and
5541         .gnu.linkonce.wi..
5542         * pei-i386.c (COFF_SUPPORT_GNU_LINKONCE): Likewise.
5543         (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
5544
5545 2004-04-28  Chris Demetriou  <cgd@broadcom.com>
5546
5547         * reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
5548         * bfd-in2.h: Regenerate.
5549         * libbfd.h: Likewise.
5550
5551 2004-04-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5552
5553         * som.c (struct som_misc_symbol_info): Add is_comdat, is_common and
5554         dup_common fields.
5555         (setup_sections): Use som_subspace_dictionary_record struct instead
5556         subspace_dictionary_record.  Set SEC_LINK_ONCE if subspace is
5557         is_comdat, is_common or dup_common.
5558         (som_prep_headers): Use som_subspace_dictionary_record struct.  Set
5559         is_comdat, is_common and dup_common in section subspace_dict from
5560         copy_data.
5561         (som_begin_writing): Use som_subspace_dictionary_record struct.
5562         (som_finish_writing): Likewise.
5563         (som_bfd_derive_misc_symbol_info): Add support to set is_comdat,
5564         is_common and dup_common flags in info for symbol.  Add comment
5565         regarding linker support for these fields.  Slightly reorganize
5566         function.
5567         (som_build_and_write_symbol_table): Set is_comdat, is_common and
5568         dup_common fields in symbol table from symbol info.
5569         (bfd_som_set_subsection_attributes): Add comdat, common and dup_common
5570         arguments.  Set corresponding fields in copy_data.  Change all callers.
5571         (som_bfd_ar_write_symbol_stuff): Set dup_common flag in library
5572         symbol table.
5573         (som_vec): Add SEC_LINK_ONCE to applicable section flags.
5574         * som.h (som_subspace_dictionary_record): Define.
5575         (som_copyable_section_data_struct): Add is_comdat, is_common and
5576         dup_common fields.
5577         (som_section_data_struct): Use som_subspace_dictionary_record struct
5578         instead of subspace_dictionary_record.
5579         (bfd_boolean bfd_som_set_subsection_attributes): Adjust prototype.
5580
5581 2004-04-27  Bob Wilson  <bob.wilson@acm.org>
5582
5583         * elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size
5584         if set.  Check reloc_done flag before applying relocations.  Use
5585         output addresses, both when applying relocations and when comparing
5586         against the specified section.
5587         (elf_xtensa_relocate_section): Use output address to check if dynamic
5588         reloc is in a literal pool.  Set section's reloc_done flag.
5589
5590 2004-04-27  H.J. Lu  <hongjiu.lu@intel.com>
5591
5592         * elf32-sh64.c (elf_backend_section_flags): New. Defined.
5593         (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges
5594         section.
5595         (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges
5596         section.
5597
5598 2004-04-27  Alan Modra  <amodra@bigpond.net.au>
5599
5600         * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign
5601         structure field removed in 2004-04-24 patch.
5602         * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix.
5603
5604         * elf-bfd.h (struct elf_backend_data <elf_backend_section_flags>):
5605         Constify hdr arg.
5606         * elf32-arm.h (elf32_arm_section_flags): Likewise.
5607         * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
5608         * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise.
5609         * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section
5610         field before calling elf_backend_section_flags.
5611
5612 2004-04-24  Chris Demetriou  <cgd@broadcom.com>
5613
5614         * elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16)
5615         (elf_mips_gnu_pcrel64, elf_mips_gnu_pcrel32): Remove.
5616         (bfd_elf32_bfd_reloc_type_lookup): Remove cases for
5617         BFD_RELOC_PCREL_HI16_S, BFD_RELOC_PCREL_LO16, BFD_RELOC_64_PCREL,
5618         and BFD_RELOC_32_PCREL.
5619         (mips_elf32_rtype_to_howto): Remove cases for R_MIPS_GNU_REL_HI16,
5620         R_MIPS_GNU_REL_LO16, R_MIPS_PC64, R_MIPS_PC32.
5621         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
5622         (_bfd_mips_elf_lo16_reloc): Remove handling for R_MIPS_GNU_REL_HI16.
5623         (mips_elf_next_relocation): Move comment about matching HI/LO
5624         relocations to...
5625         (_bfd_mips_elf_relocate_section): Here.  Remove handling for
5626         R_MIPS_GNU_REL_HI16.
5627
5628 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
5629
5630         * coff-mips.c (mips_relhi_reloc, mips_rello_reloc)
5631         (mips_switch_reloc, mips_read_relocs, mips_relax_section)
5632         (mips_relax_pcrel16, PCREL16_EXPANSION_ADJUSTMENT): Remove.
5633         (mips_relocate_hi): Remove now-unused 'adjust' and 'pcrel' arguments,
5634         and update comments to reflect current usage.
5635         (mips_howto_table): Remove entries for MIPS_R_RELHI, MIPS_R_RELLO,
5636         and MIPS_R_SWITCH, as well as several empty entries.  Update comment
5637         for MIPS_R_PCREL16.
5638         (mips_ecoff_swap_reloc_in, mips_ecoff_swap_reloc_out)
5639         (mips_adjust_reloc_out, mips_bfd_reloc_type_lookup): Remove support
5640         for MIPS_R_SWITCH, MIPS_R_RELLO, and MIPS_R_RELHI relocations.
5641         (mips_adjust_reloc_in): Likewise, adjust maximum accepted relocation
5642         type number to be MIPS_R_PCREL16.
5643         (mips_relocate_section): Remove support for link-time relaxation
5644         of branches used by embedded-PIC.  Remove support for MIPS_R_SWITCH,
5645         MIPS_R_RELLO, and MIPS_R_RELHI relocations.
5646         (_bfd_ecoff_bfd_relax_section): Redefine to bfd_generic_relax_section.
5647         * ecoff.c (ecoff_indirect_link_order): Remove support for link-time
5648         relaxation of branches used by embedded-PIC.
5649         * ecofflink.c (bfd_ecoff_debug_accumulate): Likewise.
5650         * libecoff.h (struct ecoff_section_tdata): Remove embedded-PIC
5651         related members, update comment.
5652         * pe-mips.c: Remove disabled (commented-out and #if 0'd)
5653         code related to embedded-PIC.
5654         * elfxx-mips.c (_bfd_mips_elf_read_ecoff_info): Remove
5655         initialization of now-removed 'adjust' member of
5656         'struct ecoff_debug_info'.
5657
5658 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
5659
5660         * elfxx-mips.c (mips_elf_get_global_gotsym_index): Remove.
5661
5662 2004-04-21  Philip Blundell  <pb@nexus.co.uk>
5663
5664         * elf32-arm.h (elf32_arm_check_relocs): Don't output REL32
5665         relocs for locally defined symbols during -shared final link.
5666         (elf32_arm_final_link_relocate): Likewise.
5667
5668 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
5669
5670         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Copy also
5671         ELF_LINK_POINTER_EQUALITY_NEEDED.
5672         (elf64_x86_64_check_relocs): Set ELF_LINK_POINTER_EQUALITY_NEEDED
5673         if r_type is not R_X86_64_PC32.
5674         (elf64_x86_64_finish_dynamic_symbol): If
5675         ELF_LINK_POINTER_EQUALITY_NEEDED is not set, clear st_value of
5676         SHN_UNDEF symbols.
5677
5678 2004-04-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5679
5680         * elf32-sh.c (sh_elf_plt_sym_val): New function.
5681         (elf_backend_plt_sym_val): Define.
5682
5683 2004-04-22  Andrew Cagney  <cagney@redhat.com>
5684
5685         * opncls.c (bfd_alloc): Fix type of "wanted" in doco.
5686
5687 2004-04-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5688
5689         * hpux-core.c (hpux_core_core_file_p): Add cast in call to
5690         make_bfd_asection.
5691         * som.c (som_set_section_contents): Constantify second argument.
5692         (hppa_som_gen_reloc_type): Abort for unsupported selectors.
5693         (som_object_setup): Rework to avoid warning.
5694         (setup_sections, som_write_fixups, bfd_section_from_som_symbol):
5695         Likewise.
5696
5697 2004-04-22  Andrew Cagney  <cagney@redhat.com>
5698
5699         * cache.c (bfd_cache_close): Check for a previously closed file.
5700
5701 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
5702
5703         * bfd.c (bfd_get_synthetic_symtab): Define.
5704         * targets.c (BFD_JUMP_TABLE_DYNAMIC): Add
5705         NAME##_get_synthetic_symtab.
5706         (struct bfd_target): Add _bfd_get_synthetic_symtab.
5707         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define.
5708         * elf-bfd.h (struct elf_backend_data): Add plt_sym_val and
5709         relplt_name fields.
5710         (_bfd_elf_get_synthetic_symtab): New prototype.
5711         * elfcode.h (elf_get_synthetic_symtab): Define.
5712         * elf.c (_bfd_elf_get_synthetic_symtab): New function.
5713         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define.
5714         (elf_backend_plt_sym_val, elf_backend_relplt_name): Define.
5715         (elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name.
5716         * bfd-in2.h: Rebuilt.
5717         * libbfd.h: Rebuilt.
5718         * elf32-i386.c (elf_i386_plt_sym_val): New function.
5719         (elf_backend_plt_sym_val): Define.
5720         * elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function.
5721         (elf_backend_plt_sym_val): Define.
5722         * elf32-s390.c (elf_s390_plt_sym_val): New function.
5723         (elf_backend_plt_sym_val): Define.
5724         * elf64-s390.c (elf_s390_plt_sym_val): New function.
5725         (elf_backend_plt_sym_val): Define.
5726         * elf32-sparc (elf32_sparc_plt_sym_val): New function.
5727         (elf_backend_plt_sym_val): Define.
5728         * elf64-sparc.c (sparc64_elf_plt_sym_val): New function.
5729         (elf_backend_plt_sym_val): Define.
5730         * elf32-ppc.c (ppc_elf_plt_sym_val): New function.
5731         (elf_backend_plt_sym_val): Define.
5732         * aout-target.h (MY_get_synthetic_symtab): Define.
5733         * aout-tic30.c (MY_get_synthetic_symtab): Define.
5734         * coff-rs6000.c (rs6000coff_vec): Add
5735         _bfd_nodynamic_get_synthetic_symtab.
5736         (pmac_xcoff_vec): Likewise.
5737         * coff64-rs6000.c (rs6000coff64_vec): Add
5738         _bfd_nodynamic_get_synthetic_symtab.
5739         (aix5coff64_vec): Likewise.
5740         * sunos.c (MY_get_synthetic_symtab): Define.
5741         * vms.c (vms_get_synthetic_symtab): Define.
5742
5743 2004-04-22  Nick Clifton  <nickc@redhat.com>
5744
5745         * bfd.c (bfd_archive_filename): Return NULL on NULL input.
5746
5747 2004-04-22  Peter Barada <peter@the-baradas.com>
5748
5749         * archures.c: Add bfd_mach_mcfv4e to bfd_architecture.
5750         * bfd2-in.h: Regenerate.
5751         * cpu-m68k.c: Add 'm68k:mcfv4e' to arch_info_struct[].
5752
5753 2004-04-21  Chris Demetriou  <cgd@broadcom.com>
5754
5755         * coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove.
5756         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove.
5757         * bfd-in.h (bfd_mips_ecoff_create_embedded_relocs)
5758         (bfd_mips_elf32_create_embedded_relocs): Remove prototypes
5759         * bfd-in2.h: Regenerate.
5760
5761 2004-04-21  Bob Wilson  <bob.wilson@acm.org>
5762
5763         * elf32-xtensa.c (is_same_value): Add final_static_link argument and
5764         require relocations against a weak symbol to reference the same
5765         symbol hash entry if not a final, static link.
5766         (get_cached_value, add_value_map): Add final_static_link argument.
5767         (remove_literals): Pass final_static_link argument as needed.
5768
5769 2004-04-21  Andrew Cagney  <cagney@redhat.com>
5770
5771         * opncls.c (_bfd_new_bfd_contained_in): Copy "iovec".
5772         (struct opncls, opncls_btell, opncls_bseek, opncls_bread)
5773         (opncls_bwrite, opncls_bclose, opncls_bflush)
5774         (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a
5775         bfd iovec that uses function callbacks.
5776         (bfd_close): Use the iovec's bclose.
5777         * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite)
5778         (cache_bclose, cache_bflush, cache_bstat)
5779         (cache_iovec): New functions and global variable, implement a
5780         cache "iovec", where applicable set bfd_error.
5781         (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec.
5782         * bfdio.c (struct bfd_iovec): Define.
5783         (real_read): Delete function.
5784         (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat)
5785         (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec",
5786         assume that bread and bwrite set bfd_error.
5787         * bfd.c (struct bfd): Add "iovec", update comments.
5788         * bfd-in2.h, libbfd.h: Re-generate.
5789
5790 2004-04-21  Andrew Cagney  <cagney@redhat.com>
5791
5792         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
5793
5794 2004-04-21  Eric Botcazou  <ebotcazou@act-europe.fr>
5795
5796         * elflink.c (elf_gc_mark_dynamic_ref_symbol): New function.
5797         (bfd_elf_gc_sections): Fail if a shared object is being created.
5798         Do not fail if dynamic sections have been created.  Instead call
5799         elf_gc_mark_dynamic_ref_symbol to mark sections that contain
5800         dynamically referenced symbols.  Do not mark the whole graph
5801         rooted at .eh_frame, only the section proper.
5802
5803 2004-04-20  DJ Delorie  <dj@redhat.com>
5804
5805         * reloc.c: Add BFD_RELOC_32_SECREL.
5806         * bfd-in2.h: Regenerate.
5807         * libbfd.h: Likewise.
5808         * coff-i386.c (howto_table) [COFF_WITH_PE]: Add R_SECREL32.
5809         (coff_i386_rtype_to_howto) [COFF_WITH_PE]: Handle it.
5810         (coff_i386_reloc_type_lookup) [COFF_WITH_PE]: Likewise.
5811
5812 2004-04-19  Jakub Jelinek  <jakub@redhat.com>
5813
5814         * elf32-sparc.c (elf32_sparc_relocate_section): Handle
5815         relocs against hidden/protected undefweak symbols properly.
5816         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
5817
5818 2004-04-18  Mark Kettenis  <kettenis@gnu.org>
5819
5820         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
5821         * netbsd-core.c (netbsd_core_file_p): Set architecture for PowerPC
5822         core files.
5823
5824 2004-04-17  Brian Ford  <ford@vss.fsi.com>
5825
5826         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the first non-zero
5827         filepos for the SizeOfHeaders field.
5828         (_bfd_XXi_swap_scnhdr_out): Correct section flags lossage on reloc
5829         overflow.
5830         (_bfd_XXi_swap_sym_in): Remove redundant section flags assignment.
5831
5832 2004-04-16  Alan Modra  <amodra@bigpond.net.au>
5833
5834         * simple.c (bfd_simple_get_relocated_section_contents): Don't
5835         change reloc_done.  Set and restore _cooked_size.
5836         (RETURN): Delete.
5837
5838 2004-04-15  Mark Kettenis  <kettenis@gnu.org>
5839
5840         * netbsd-core.c (netbsd_core_file_p): Set architecture for VAX
5841         core files.
5842
5843 2004-04-15  Nick Clifton  <nickc@redhat.com>
5844
5845         * bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
5846
5847 2004-04-15  Alan Modra  <amodra@bigpond.net.au>
5848
5849         * elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change.
5850
5851 2004-04-15  H.J. Lu  <hongjiu.lu@intel.com>
5852
5853         * elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only
5854         when it is a definition.
5855
5856 2004-04-14  Alan Modra  <amodra@bigpond.net.au>
5857
5858         * elf32-sparc.c (elf32_sparc_relocate_section): Don't abort
5859         when statically linking PIC code.
5860         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
5861
5862 2004-04-11  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
5863
5864         * config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets.
5865         * configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3*
5866         targets amd aout_mips_big_vec, aout_mips_little_vec target vectors.
5867         * configure: Regenerate.
5868
5869 2004-04-08  Richard Sandiford  <rsandifo@redhat.com>
5870
5871         * elflink.c: Include libiberty.h.
5872         * Makefile.am (elflink.lo): Depend on libiberty.h.
5873         * Makefile.in: Regenerate.
5874
5875 2004-04-06  Daniel Jacobowitz  <drow@mvista.com>
5876
5877         * elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use
5878         ".MIPS.stubs".
5879
5880 2004-04-05  H.J. Lu  <hongjiu.lu@intel.com>
5881
5882         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always
5883         reserve the memory for dynamic linker
5884
5885 2004-04-05  Mark Kettenis  <kettenis@gnu.org>
5886
5887         * netbsd-core.c (CORE_WCOOKIE_OFFSET): New define.
5888         (netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc.
5889
5890 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
5891
5892         * elf32-cr16c.c (elf32_cr16c_relocate_section): Use
5893         RELOC_FOR_GLOBAL_SYMBOL.
5894         (elf32_cr16c_add_symbol_hook): Remove const from Elf_Internal_Sym.
5895
5896 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
5897
5898         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
5899         R_ARM_ALU* only if OLD_ARM_ABI is not defined.
5900
5901 2004-04-01  Paul Brook  <paul@codesourcery.com>
5902
5903         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update.
5904         * elf32-arm.h (struct elf32_elf_section_map): New.
5905         (struct _arm_elf_section_data): New.
5906         (elf32_arm_section_data): Define.
5907         (struct elf32_arm_link_hash_table): Add byteswap_code.
5908         (elf32_arm_link_hash_table_create): Initialize byteswap_code.
5909         (bfd_elf32_arm_process_before_allocation): Add byteswap_code.
5910         (elf32_arm_post_process_headers): Set EF_ARM_BE8.
5911         (elf32_arm_output_symbol_hook, elf32_arm_new_section_hook,
5912         elf32_arm_compare_mapping, elf32_arm_write_section): New functions.
5913         (bfd_elf32_new_section_hook, elf_backend_write_section,
5914         elf_backend_link_output_symbol_hook): Define.
5915
5916 2004-04-01  Andy Chittenden  <achittenden@bluearc.com>
5917
5918         * stabs.c (struct stab_link_includes_totals): Add field 'symb'
5919         that keeps the characters in a B_INCL..B_EINCL range.
5920         (_bfd_link_section_stabs): When computing the sum of the
5921         characters in a B_INCL..B_EINCL range also keep a copy of those
5922         characters.  Use this information to distinguish between
5923         include sections that have the same sum and the same length
5924         but which are nevertheless unique.
5925
5926 2004-03-31  Paul Brook  <paul@codesourcery.com>
5927
5928         * elf32-arm.h (elf32_arm_final_link_relocate): Add R_ARM_ALU*.
5929         * elfarm-nabi.c (elf32_arm_howto_table): Ditto.
5930
5931 2004-03-31  Andy Chittenden <achittenden@bluearc.com>
5932
5933         * stabs.c (struct stab_link_includes_totals): Rename field 'total'
5934         to 'sum_chars' and add field 'num_chars'.
5935         (_bfd_link_section_stabs): When computing the sum of the
5936         characters in a B_INCL..B_EINCL range also keep a count of the
5937         number of characters.  Use this information to help distinguish
5938         between include sections when have the same sum but which
5939         nevertheless are still unique.
5940
5941 2004-03-31  Mattias Engdegård  <mattias@virtutech.se>
5942
5943         * stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs.
5944
5945 2004-03-30  Galit Heller  <Galit.Heller@nsc.com>
5946             Tomer Levi    <Tomer.Levi@nsc.com>
5947
5948         * Makefile.am (ALL_MACHINES): Add cpu-cr16c.lo.
5949         (ALL_MACHINES_CFILES): Add cpu-cr16c.c.
5950         (BFD32_BACKENDS): Add elf32-cr16c.lo.
5951         (BFD32_BACKENDS_CFILES): Add elf32-cr16c.c.
5952         (cpu-cr16c.lo): New target.
5953         (elf32-cr16c.lo): Likewise.
5954         * Makefile.in: Regenerate.
5955         * archures.c (bfd_architecture): Add bfd_{arch,mach}_cr16c.
5956         (bfd_archures_list): Add bfd_cr16c_arch.
5957         * config.bfd: Handle cr16c-*-elf*.
5958         * configure.in: Handle bfd_elf32_cr16c_vec.
5959         * configure: Regenerate.
5960         * reloc.c: Add BFD_RELOC_16C_NUM08, BFD_RELOC_16C_NUM08_C,
5961         BFD_RELOC_16C_NUM16, BFD_RELOC_16C_NUM16_C,
5962         BFD_RELOC_16C_NUM32, BFD_RELOC_16C_NUM32_C,
5963         BFD_RELOC_16C_DISP04, BFD_RELOC_16C_DISP04_C,
5964         BFD_RELOC_16C_DISP08, BFD_RELOC_16C_DISP08_C,
5965         BFD_RELOC_16C_DISP16, BFD_RELOC_16C_DISP16_C,
5966         BFD_RELOC_16C_DISP24, BFD_RELOC_16C_DISP24_C,
5967         BFD_RELOC_16C_DISP24a, BFD_RELOC_16C_DISP24a_C,
5968         BFD_RELOC_16C_REG04, BFD_RELOC_16C_REG04_C,
5969         BFD_RELOC_16C_REG04a, BFD_RELOC_16C_REG04a_C,
5970         BFD_RELOC_16C_REG14, BFD_RELOC_16C_REG14_C,
5971         BFD_RELOC_16C_REG16, BFD_RELOC_16C_REG16_C,
5972         BFD_RELOC_16C_REG20, BFD_RELOC_16C_REG20_C,
5973         BFD_RELOC_16C_ABS20, BFD_RELOC_16C_ABS20_C,
5974         BFD_RELOC_16C_ABS24, BFD_RELOC_16C_ABS24_C,
5975         BFD_RELOC_16C_IMM04, BFD_RELOC_16C_IMM04_C,
5976         BFD_RELOC_16C_IMM16, BFD_RELOC_16C_IMM16_C,
5977         BFD_RELOC_16C_IMM20, BFD_RELOC_16C_IMM20_C,
5978         BFD_RELOC_16C_IMM24, BFD_RELOC_16C_IMM24_C,
5979         BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C.
5980         * targets.c (bfd_elf32_cr16c_vec): Declare.
5981         (bfd_target_vector): Add bfd_elf32_cr16c_vec.
5982         * cpu-cr16c.c: New file.
5983         * elf32-cr16c.c: Likewise.
5984         * libbfd.h: Regenerate.
5985         * bfd-in2.h: Likewise.
5986
5987 2004-03-30  Jakub Jelinek  <jakub@redhat.com>
5988
5989         * elf.c (map_sections_to_segments): Fix handling of .tbss.
5990
5991 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
5992
5993         * Makefile.am: Remove all mention of elflink.h.
5994         * Makefile.in: Regenerate.
5995         * bfd-in.h (bfd_elf_discard_info): Declare.
5996         (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete.
5997         * bfd-in2.h: Regenerate.
5998         * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol,
5999         bfd_elf32_link_record_dynamic_symbol,
6000         bfd_elf64_link_record_dynamic_symbol,
6001         _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link,
6002         bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol,
6003         _bfd_elf32_link_record_local_dynamic_symbol,
6004         _bfd_elf64_link_record_local_dynamic_symbol,
6005         _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets,
6006         _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link,
6007         _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry,
6008         _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets,
6009         _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry,
6010         _bfd_elf32_reloc_symbol_deleted_p,
6011         _bfd_elf64_reloc_symbol_deleted_p): Delete.
6012         (bfd_elf_link_record_dynamic_symbol,
6013         bfd_elf_link_record_local_dynamic_symbol,
6014         bfd_elf_final_link, bfd_elf_gc_sections,
6015         bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry,
6016         bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link,
6017         bfd_elf_reloc_symbol_deleted_p): Declare.
6018         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
6019         * elf32-arm.h: Update for changed function names.  Remove local
6020         WILL_CALL_FINISH_DYNAMIC_SECTION define.
6021         * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c,
6022         * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c,
6023         * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c,
6024         * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
6025         * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
6026         * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c,
6027         * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c,
6028         * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise.
6029         * elfxx-target.h (bfd_elfNN_bfd_final_link): Define.
6030         (bfd_elfNN_print_symbol): Define.
6031         * elfcode.h: Don't include elflink.h.
6032         (elf_bfd_discard_info, elf_reloc_symbol_deleted_p,
6033         elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections,
6034         elf_gc_common_finalize_got_offsets, elf_gc_common_final_link,
6035         elf_gc_record_vtinherit, elf_gc_record_vtentry,
6036         elf_link_record_local_dynamic_symbol): Don't define.
6037         * elflink.c: Update for changed function names.  Move elflink.h
6038         code here.
6039         * elflink.h: Delete file.
6040         * po/SRC-POTFILES.in: Regenerate.
6041         * po/bfd.pot: Regenerate.
6042
6043 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6044
6045         * elf64-mmix.c (mmix_elf_relocate_section): Restore code setting
6046         "name" for global syms accidentally removed in 2004-03-20 change.
6047
6048 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
6049
6050         * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field.
6051         * elflink.h: Replace all occurrences of sizeof (Elf_External_*)
6052         where Elf_External_* is different for 64 and 32 bit, with
6053         corresponding elf_size_info field.
6054         (struct elf_final_link_info): Use "bfd_byte *" instead
6055         of "Elf_External_Sym *" for external_syms and symbuf.
6056         (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local
6057         vars and use instead of ELF_R_INFO and ELF_R_TYPE macros.
6058         (struct elf_link_sort_rela): Add "sym_mask" alias for "offset".
6059         (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM.
6060         (elf_link_sort_cmp2): Adjust.
6061         (elf_link_sort_relocs): Set up r_sym_mask local var instead of
6062         using ELF_R_SYM macro.  Set u.sym_mask.
6063         (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro
6064         version, elf_stringtab_init.  Ditto for bfd_section_from_elf_index
6065         vs. section_from_elf_index.  Adjust Elf_External_Sym pointer
6066         arithmetic.  Pass bed to elf_link_flush_output_syms.  Adjust
6067         Elf_External_Dyn pointer arithmentic.  Use bed swap_dyn_in and
6068         swap_syn_out functions.  Rearrange dyn swap in/out switch.
6069         (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic.
6070         Pass bed to elf_link_flush_output_syms.  Use bed swap_symbol_out.
6071         (elf_link_flush_output_syms): Add elf_backend_data arg.
6072         (elf_link_check_versioned_symbol): Likewise.
6073         (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol.
6074         Adjust Elf_External_Sym pointer arithmetic.  Use bed swap_symbol_out.
6075         (elf_link_input_bfd): Use bfd_section_from_elf_index.  Set up
6076         r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM,
6077         ELF_R_TYPE and ELF_R_INFO macros.
6078         (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation
6079         based on size rather than using ELF_R_INFO.
6080         (elf_gc_mark): Set up r_sym_shift local var and use instead of
6081         ELF_R_SYM macro.
6082         (struct alloc_got_off_arg): New.
6083         (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of
6084         ARCH_SIZE.  Pass get entry size down to elf_gc_allocate_got_offsets.
6085         (elf_gc_allocate_got_offsets): Adjust.
6086         (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of
6087         ELF_R_SYM.  Use bfd_section_from_elf_index.
6088         (elf_bfd_discard_info): Set cookie.r_sym_shift.
6089         * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete.
6090         (elf_slurp_symbol_table): Use bfd_section_from_elf_index.
6091
6092 2004-03-26  Stan Shebs  <shebs@apple.com>
6093
6094         Remove MPW support, no longer used.
6095         * config.bfd (powerpc-*-mpw*): Remove configuration.
6096         * mpw-config.in, mpw-make.sed: Remove files.
6097         * ecoffswap.h [MPW_C]: Remove MPW-C-friendly version of code.
6098
6099 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
6100
6101         * elf64-ppc.c (elf_backend_add_symbol_hook): Define.
6102         (ppc64_elf_add_symbol_hook): New function.
6103         * elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
6104         const from Elf_Internal_Sym param.
6105         * elflink.c (elf_link_add_object_symbols): Adjust.
6106         * elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
6107         * elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
6108         * elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
6109         * elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
6110         * elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
6111         * elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
6112         * elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
6113         * elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
6114         * elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
6115         * elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
6116         * elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
6117         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
6118         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
6119         * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
6120         * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
6121         * elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
6122
6123 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
6124
6125         * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.
6126         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete.
6127         (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete.
6128         (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete.
6129         (bfd_elf64_bfd_link_add_symbols): Delete.
6130         (bfd_elf_link_add_symbols): Declare.
6131         * elfcode.h (elf_bfd_link_add_symbols): Delete.
6132         * elflink.c: Include safe-ctype.h.
6133         (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag,
6134         make static.
6135         (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static.
6136         (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make
6137         static.
6138         (elf_link_add_archive_symbols): Rename from
6139         _bfd_elf_link_add_archive_symbols, make static.
6140         (elf_link_add_object_symbols): New function.  Corresponding
6141         elflink.h function converted to use elf_size_info.
6142         (bfd_elf_link_add_symbols): Likewise.
6143         (bfd_elf_size_dynamic_sections): Adjust.
6144         * elflink.h (elf_bfd_link_add_symbols): Delete.
6145         (elf_link_add_object_symbols): Delete.
6146         * elf32-gen.c (elf32_generic_link_add_symbols): Call
6147         bfd_elf_link_add_symbols.
6148         * elf64-gen.c (elf64_generic_link_add_symbols): Likewise.
6149
6150 2004-03-25  Alan Modra  <amodra@bigpond.net.au>
6151
6152         * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed
6153         and chained shared libs only if dynsym.  Clear dynsym on forced-local.
6154
6155         * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare.
6156         (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete.
6157         (_bfd_elf_add_dt_needed_tag): Declare.
6158         (_bfd_elf_sort_symbol): Declare.
6159         (_bfd_elf_finalize_dynstr): Declare.
6160         (RELOC_FOR_GLOBAL_SYM): Formatting.
6161         * elfcode.h (elf_add_dynamic_entry): Delete.
6162         * elflink.c (_bfd_elf_add_dynamic_entry): New function.  Corresponding
6163         elflink.h function converted to use elf_size_info.
6164         (_bfd_elf_add_dt_needed_tag): Likewise.
6165         (_bfd_elf_sort_symbol): Likewise.
6166         (_bfd_elf_finalize_dynstr): Likewise.
6167         (compute_bucket_count): Likewise.
6168         (bfd_elf_size_dynamic_sections): Likewise.  Check result of
6169         _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref.
6170         (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from..
6171         * elflink.h: ..here.
6172         (sort_symbol, add_dt_needed_tag): Delete.
6173         (elf_add_dynamic_entry, elf_finalize_dynstr): Delete.
6174         (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete.
6175         Update all users.
6176         * elf32-arm.h (add_dynamic_entry): Update.  Remove casts.
6177         * elf32-cris.c (add_dynamic_entry): Likewise.
6178         * elf32-hppa.c (add_dynamic_entry): Likewise.
6179         * elf32-i370.c (add_dynamic_entry): Likewise.
6180         * elf32-i386.c (add_dynamic_entry): Likewise.
6181         * elf32-m32r.c (add_dynamic_entry): Likewise.
6182         * elf32-m68k.c (add_dynamic_entry): Likewise.
6183         * elf32-ppc.c (add_dynamic_entry): Likewise.
6184         * elf32-s390.c (add_dynamic_entry): Likewise.
6185         * elf32-sh.c (add_dynamic_entry): Likewise.
6186         * elf32-sparc.c (add_dynamic_entry): Likewise.
6187         * elf32-vax.c (add_dynamic_entry): Likewise.
6188         * elf32-xtensa.c (add_dynamic_entry): Likewise.
6189         * elf64-alpha.c (add_dynamic_entry): Likewise.
6190         * elf64-hppa.c (add_dynamic_entry): Likewise.
6191         * elf64-ppc.c (add_dynamic_entry): Likewise.
6192         * elf64-s390.c (add_dynamic_entry): Likewise.
6193         * elf64-sparc.c (add_dynamic_entry): Likewise.
6194         * elf64-x86-64.c (add_dynamic_entry): Likewise.
6195         * elfxx-ia64.c (add_dynamic_entry): Likewise.
6196         * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
6197         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
6198         * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise.
6199         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
6200
6201 2004-03-23  Paul Brook  <paul@codesourcery.com>
6202
6203         * elf32-arm.h (arm_print_private_bfd_data): Add EABI v3.
6204
6205 2004-03-22  Bob Wilson  <bob.wilson@acm.org>
6206
6207         * elf32-xtensa.c (elf_xtensa_check_relocs): Remove code to read
6208         literal tables and check for relocs outside of literal pools.
6209         (elf_xtensa_make_sym_local): Don't clear ELF_LINK_NON_GOT_REF flag.
6210         (elf_xtensa_fix_refcounts): Don't check ELF_LINK_NON_GOT_REF or
6211         set DF_TEXTREL.
6212         (elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry.
6213         (elf_xtensa_relocate_section): Read literal tables and check for
6214         dynamic relocations in read-only sections and not in literal pools.
6215
6216 2004-03-23  Alan Modra  <amodra@bigpond.net.au>
6217
6218         PR 51.
6219         * linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char.
6220
6221 2004-03-22  Hans-Peter Nilsson  <hp@axis.com>
6222
6223         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
6224         R_CRIS_16_GOTPLT>: Also error if there's no PLT for a symbol
6225         not defined by the executable, or defined in a DSO.
6226         <eliding run-time relocation of .got>: Initialize GOT entry for a
6227         function symbol or ELF_LINK_HASH_NEEDS_PLT statically in an
6228         executable.
6229         (cris_elf_gc_sweep_hook): Improve fallthrough marking.
6230         (elf_cris_try_fold_plt_to_got): Improve head comment.  Do not fold
6231         a PLT reloc to GOT for an executable.
6232         (elf_cris_adjust_dynamic_symbol): Only fold a .got.plt entry with
6233         .got for a DSO and explain why.
6234         (elf_cris_discard_excess_program_dynamics): Also lose GOT-relocs
6235         and unreferenced symbols for which a PLT is defined.  Adjust
6236         dynamic-symbol pruning correspondingly, to make sure we don't lose
6237         a dynamic symbol also defined by a DSO.
6238
6239 2004-03-22  Alan Modra  <amodra@bigpond.net.au>
6240
6241         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add input_bfd, input_section
6242         and rel args.  Group input and output args.  Wrap to 80 columns.
6243         * elf-m10200.c, elf-m10300.c, elf32-arm.h, elf32-avr.c,
6244         elf32-cris.c, elf32-d10v.c, elf32-fr30.c, elf32-h8300.c,
6245         elf32-hppa.c, elf32-i386.c, elf32-i860.c, elf32-ip2k.c,
6246         elf32-iq2000.c, elf32-m68hc1x.c, elf32-m68k.c, elf32-mcore.c,
6247         elf32-msp430.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
6248         elf32-sparc.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c,
6249         elf32-xtensa.c, elf64-alpha.c, elf64-mmix.c, elf64-ppc.c,
6250         elf64-s390.c, elf64-sparc.c, elf64-x86-64.c, elfxx-ia64.c: Update
6251         RELOC_FOR_GLOBAL_SYMBOL invocation.
6252
6253 2004-03-20  H.J. Lu  <hongjiu.lu@intel.com>
6254
6255         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if
6256         unresolved symbols in objects aren't allowed.
6257
6258         * elf-hppa.h (elf_hppa_relocate_section): Properly handle
6259         unresolved symbols.
6260         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
6261         (elf_hppa_unmark_useless_dynamic_symbols):
6262         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
6263         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
6264         (elf32_hppa_relocate_section): Likewise.
6265         * elf32-i370.c (i370_elf_relocate_section): Likewise.
6266         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
6267         * elf32-sh.c (sh_elf_relocate_section): Likewise.
6268         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
6269         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
6270
6271         * elf-m10200.c (mn10200_elf_relocate_section): Use
6272         RELOC_FOR_GLOBAL_SYMBOL.
6273         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
6274         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
6275         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
6276         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
6277         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
6278         * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise.
6279         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
6280         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
6281         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
6282         * elf32-v850.c (v850_elf_relocate_section): Likewise.
6283         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
6284         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
6285
6286 2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6287
6288         * elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32.
6289         (final_link_relocate): Likewise.
6290         * elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for
6291         R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations.
6292
6293 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
6294
6295         * Makefile.am: Run "make dep-am".
6296         * Makefile.in: Regenerate.
6297         * aclocal.m4: Regenerate.
6298         * config.in: Regenerate.
6299         * po/bfd.pot: Regenerate.
6300
6301 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
6302             H.J. Lu  <hongjiu.lu@intel.com>
6303
6304         * elflink.c (_bfd_elf_merge_symbol): Revert last change.  Move
6305         type and size change code to where it was previously.  Remove
6306         dt_needed param.  Treat old weak syms as strong if new sym is
6307         from a shared lib, even when old sym is from another shared
6308         lib.  Remove unnecessary tests of oldweak and newweak.  Correct
6309         comments.
6310         (_bfd_elf_add_default_symbol): Remove dt_needed param.  Update
6311         _bfd_elf_merge_symbol calls.
6312         * elflink.h (elf_link_add_object_symbols): Update calls.  Remove
6313         dt_needed local var.  Update comments.
6314         * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype.
6315         (_bfd_elf_add_default_symbol): Likewise.
6316
6317         * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle
6318         strong syms in one shared object overriding weak syms in another.
6319
6320 2004-03-18  Alan Modra  <amodra@bigpond.net.au>
6321
6322         * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field.  Add
6323         dyn_lib_class field.  Rearrange for better packing.
6324         (elf_dt_soname): Delete.
6325         (elf_dyn_lib_class): Define.
6326         * elf.c (bfd_elf_set_dt_needed_name): Update comment.
6327         (bfd_elf_set_dt_needed_soname): Delete.
6328         (bfd_elf_set_dyn_lib_class): New function.
6329         * elflink.h (add_dt_needed_tag): New function.  Split out from..
6330         (elf_link_add_object_symbols): ..here.  Rename "name" to "soname".
6331         Use elf_dyn_lib_class to set dt_needed and add_needed.  Move fallback
6332         initialization of soname.
6333         (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of
6334         elf_dt_soname.
6335         * bfd-in.h (enum dynamic_lib_link_class): New.
6336         (bfd_elf_set_dt_needed_soname): Delete.
6337         (bfd_elf_set_dyn_lib_class): Declare.
6338         * bfd-in2.h: Regenerate.
6339
6340         * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling.
6341         (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs.
6342         * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in
6343         symbol loop.  Instead use add_needed to flag tag as written.
6344
6345 2004-03-17  Nathan Sidwell  <nathan@codesourcery.com>
6346
6347         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
6348         logic for null_input_bfd detection.
6349
6350 2004-03-17  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
6351
6352         * config.bfd: Switch sh-*-rtems* to ELF.  Add sh-*-rtemscoff*.
6353
6354 2004-03-16  Mark Kettenis  <kettenis@gnu.org>
6355
6356         * netbsd-core.c (netbsd_core_file_p) [CORE_FPU_OFFSET]: Remove
6357         code.
6358
6359 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6360
6361         * elflink.c (elf_link_read_relocs_from_section): Don't use
6362         NUM_SHDR_ENTRIES in end of reloc calc.  Move NULL shdr check..
6363         (_bfd_elf_link_read_relocs): ..to here.
6364         * elf32-ppc.c (ppc_elf_relax_section): Formatting.
6365
6366 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6367
6368         * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override
6369         values selected in configure.host.  Require both to be defined
6370         before setting BFD_HOST_64_BIT_DEFINED.  Protect assignment to
6371         corresponding BFD_HOST vars with quotes.
6372         <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc;
6373         Always require BFD_HOST_64_BIT_DEFINED.
6374         <file_ptr type>: Find off_t size before emitting message.  Combine
6375         off_t and ftello64 conditional.
6376         * configure: Regenerate.
6377
6378 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
6379
6380         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer
6381         aliasing warning.  Remove trailing whitespace throughout file.
6382
6383 2004-03-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
6384
6385         * elf-hppa.h (elf_hppa_relocate_section): Pass input_bfd instead of
6386         input_section in calls to get_dyn_name.
6387         * elf64-hppa.c (get_dyn_name): Change type of first argument to "bfd *".        Use section id of first section in input BFD to build dynamic name for
6388         local symbols.
6389         (elf64_hppa_check_relocs): Pass abfd in call to get_dyn_name.
6390
6391 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
6392
6393         * bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
6394         (BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
6395         (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
6396         (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
6397         (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
6398         * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
6399         (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
6400         when using long.
6401         * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
6402         (bfd_getb64): Return bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
6403         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
6404         (bfd_putb64): Accept bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
6405         (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
6406         * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
6407         (read_8_bytes, read_indirect_string, read_address): Likewise.
6408         (read_abbrevs, parse_comp_unit): Likewise.
6409         * targets.c (struct bfd_target): Likewise.
6410         * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
6411         * hppabsd-core.c: Likewise.  Formatting.
6412         * hpux-core.c: Likewise.
6413         * irix-core.c: Likewise.
6414         * netbsd-core.c: Likewise.
6415         * osf-core.c: Likewise.
6416         * ptrace-core.c: Likewise.
6417         * sco5-core.c: Likewise.
6418         * trad-core.c: Likewise.
6419         * configure: Regenerate.
6420         * bfd-in2.h: Regenerate.
6421
6422 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
6423
6424         * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
6425         (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
6426         (bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
6427         (bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
6428         (bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
6429         (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
6430         (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
6431         * libbfd.c: Likewise in function definitions.
6432         (bfd_put_8): Mask with 0xff rather than casting to char.
6433         (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
6434         (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
6435         (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
6436         (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
6437         (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
6438         (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
6439         * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
6440         (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
6441         (H_GET_64, H_GET_32, H_GET_16): Likewise.
6442         (H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
6443         * archive.c (do_slurp_coff_armap): Update swap prototype.
6444         * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
6445         (tic54x_getl_signed_32): Likewise.
6446         (tic54x_putl32): Likewise.  Mask with 0xff rather than casting to char.
6447         * mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
6448         * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
6449         (bfd_getp_signed_32, bfd_putp32): Likewise.
6450         * targets.c (struct bfd_target): Use void* in place of bfd_byte* for
6451         bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
6452         bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
6453         bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
6454         bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
6455         bfd_h_getx_signed_16, bfd_h_putx16.
6456         * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
6457         * hppabsd-core.c: Similarly.  Rename NO_SIGNED_GET to NO_GETS.
6458         * hpux-core.c: Likewise.
6459         * irix-core.c: Likewise.
6460         * netbsd-core.c: Likewise.
6461         * osf-core.c: Likewise.
6462         * ptrace-core.c: Likewise.
6463         * sco5-core.c: Likewise.
6464         * trad-core.c: Likewise.
6465         * bfd-in2.h: Regenerate.
6466
6467 2004-03-15  Matt Thomas  <matt@3am-software.com>
6468
6469         * config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is
6470         selected.
6471
6472 2004-03-13  Mark Kettenis  <kettenis@gnu.org>
6473
6474         * config.bfd: Add x86_64-*-openbsd*.
6475         * configure.in (x86_64-*-openbsd*): Set COREFILE to
6476         netbsd-core.lo.
6477         * configure: Regenerate.
6478
6479 2004-03-12  Nick Clifton  <nickc@redhat.com>
6480             Dave Murphy  <wintermute2k4@ntlworld.com>
6481
6482         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks
6483         if the input bfd does not contain any code.
6484
6485 2004-03-09  Steve Ellcey  <sje@cup.hp.com>
6486
6487         * elfxx-ia64.c (plt_full_entry): Change ld8 to ld8.acq.
6488
6489 2004-03-05  Fred Fish  <fnf@redhat.com>
6490
6491         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Just force
6492         mips16 symbols to be even rather than testing first for even/odd.
6493         (_bfd_mips_elf_link_output_symbol_hook): Ditto.
6494
6495 2004-03-05  Nathan Sidwell  <nathan@codesourcery.com>
6496
6497         * elf.c (map_sections_to_segments): Ignore .tbss sections for
6498         layout purposes.
6499
6500 2004-03-03  Alexandre Oliva  <aoliva@redhat.com>
6501
6502         * elflink.c (bfd_elf_record_link_assignment): Mark undefweak and
6503         undefined symbols as hash_new.
6504
6505 2003-03-03  Andrew Stubbs  <andrew.stubbs@superh.com>
6506
6507         * archures.c: Add bfd_mach_sh4_nommu_nofpu.
6508         * cpu-sh.c: Ditto.
6509         * elf32-sh.c: Ditto.
6510         * bfd-in2.h: Regenerate.
6511
6512 2004-03-02  Alexandre Oliva  <aoliva@redhat.com>
6513
6514         * elf32-frv.c (struct frv_pic_relocs_info): Added fixups and
6515         dynrelocs.
6516         (_frv_count_got_plt_entries): Initialize them.
6517         (frv_pic_relocs_info_find): Add insert argument.  Adjust all
6518         callers.
6519         (frv_pic_relocs_info_for_global): Likewise.
6520         (frv_pic_relocs_info_for_local): Likewise.
6521         (frv_pic_merge_early_relocs_info): New.
6522         (_frv_resolve_final_relocs_info): Use it in case one entry maps to
6523         another.
6524         (_frv_add_dyn_reloc): Add entry argument.  Adjust all callers.
6525         Check that we don't exceed the allocated count for entry.
6526         (_frv_add_rofixup): Likewise.
6527         (_frv_emit_got_relocs_plt_entries): Adjust for coding standards.
6528         (elf32_frv_finish_dynamic_sections): Improve error message in case
6529         we emit too few rofixup entries.
6530
6531 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
6532
6533         * archures.c (bfd_mach_fr450): New.
6534         * bfd-in2.h: Regenerate.
6535         * cpu-frv.c (arch_info_450): New bfd_arch_info_type.
6536         (arch_info_500): Link to it.
6537         * elf32-frv.c (elf32_frv_machine, frv_elf_merge_private_bfd_data)
6538         (frv_elf_print_private_bfd_data): Handle fr405 and fr450 header flags.
6539         (frv_elf_arch_extension_p): New function.
6540         (frv_elf_merge_private_bfd_data): Use it.
6541
6542 2004-02-28  H.J. Lu  <hongjiu.lu@intel.com>
6543
6544         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype.
6545
6546         * elflink.h (is_global_data_symbol_definition): Moved to
6547         elflink.c.
6548         (elf_link_is_defined_archive_symbol): Likewise.
6549         (elf_link_add_archive_symbols): Likewise. Renamed to
6550         _bfd_elf_link_add_archive_symbols.
6551
6552         * elflink.c (elf_link_is_defined_archive_symbol): Get the size
6553         of ELF symbol table entry from backend.
6554         (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols
6555         instead of elf_link_add_object_symbols.
6556
6557 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
6558
6559         * elf-bfd.h (struct elf_backend_data): Added
6560         elf_backend_can_make_relative_eh_frame,
6561         elf_backend_can_make_lsda_relative_eh_frame and
6562         elf_backend_encode_eh_address.
6563         (_bfd_elf_encode_eh_address): Declare.
6564         (_bfd_elf_can_make_relative): Declare.
6565         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new
6566         hooks to decide whether to attempt to make_relative and
6567         make_lsda_relative.
6568         (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address.
6569         (_bfd_elf_can_make_relative): New.
6570         (_bfd_elf_encode_eh_address): New.
6571         * elf32-frv.c (frv_elf_use_relative_eh_frame): New.
6572         (frv_elf_encode_eh_address): New.
6573         (elf_backend_can_make_relative_eh_frame): Define.
6574         (elf_backend_can_make_lsda_relative_eh_frame): Define.
6575         (elf_backend_encode_eh_address): Define.
6576         * elfxx-target.h
6577         (elf_backend_can_make_relative_eh_frame): Define.
6578         (elf_backend_can_make_lsda_relative_eh_frame): Define.
6579         (elf_backend_encode_eh_address): Define.
6580         (elfNN_bed): Add them.
6581
6582 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
6583
6584         * elf32-frv.c (elf32_frv_howto_table) <R_FRV_LABEL16>: Set
6585         complain_on_overflow to signed.
6586
6587 2004-02-27  H.J. Lu  <hongjiu.lu@intel.com>
6588
6589         * elflink.h (sort_symbol): New.
6590         (elf_link_add_object_symbols): Use a sorted symbol array for
6591         weakdef.
6592
6593 2004-02-27  Jakub Jelinek  <jakub@redhat.com>
6594
6595         * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
6596         for pc relative relocs.
6597         (elf_s390_relocate_section): Likewise.
6598         * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
6599         for pc relative relocs.
6600         (elf_s390_relocate_section): Likewise.
6601
6602 2004-02-26  H.J. Lu  <hongjiu.lu@intel.com>
6603
6604         * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to
6605         count_dyn_reloc.
6606
6607 2004-02-25  H.J. Lu  <hongjiu.lu@intel.com>
6608
6609         * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
6610         field to track if a relocation is against readonly section.
6611         (count_dyn_reloc): Take a new argument for rent->reltext.
6612         (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
6613         (get_reloc_section): Don't set ia64_info->reltext here.
6614         (allocate_dynrel_entries): Set ia64_info->reltext here.
6615
6616 2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
6617
6618         * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
6619         (_frv_emit_got_relocs_plt_entries): Decay relocation to protected
6620         function's descriptor to symbol+offset, and map local undefweak
6621         symbol to NULL function descriptor.
6622         (elf32_frv_relocate_section): Likewise.
6623
6624 2004-02-23  Mark Kettenis  <kettenis@gnu.org>
6625
6626         * libaout.h (enum machine_type): Add M_SPARC64_NETBSD and
6627         M_X86_64_NETBSD.
6628         * netbsd-core.c (M_SPARC64_OPENBSD): Define.
6629         (netbsd_core_file_p): Set architecture from machine ID for
6630         selected machines.
6631
6632 2004-02-23  Jakub Jelinek  <jakub@redhat.com>
6633
6634         * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
6635         DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
6636
6637 2004-02-21  H.J. Lu  <hongjiu.lu@intel.com>
6638
6639         * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined
6640         symbols with non-default visibility.
6641
6642 2004-02-21  Danny Smith  <daanysmith@users.sourceforge.net>
6643
6644         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
6645         IMAGE_SCN_MEM_WRITE on known sections only.
6646
6647 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
6648
6649         * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
6650         symbols used in PIE relocs.
6651
6652 2004-02-19  Jakub Jelinek  <jakub@redhat.com>
6653
6654         * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear
6655         .plt sh_entsize.
6656
6657 2004-02-18  Daniel Jacobowitz  <drow@mvista.com>
6658
6659         * configure.in: Update version to 2.15.90.
6660         * configure: Regenerate.
6661
6662 2004-02-17  Daniel Jacobowitz  <drow@mvista.com>
6663             Richard Sandiford  <rsandifo@redhat.com>
6664
6665         * elfxx-mips.c (mips_elf_calculate_relocation): Use
6666         _bfd_elf_symbol_refs_local_p to decide whether to decay
6667         a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend.
6668         (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE
6669         relocs if the symbol wasn't defined by a regular object file.
6670         Don't check the symbol's dynindx.
6671
6672 2004-02-16  Andrew Cagney  <cagney@redhat.com>
6673
6674         * bfd-in.h (file_ptr, ufile_ptr): Configure type using
6675         @bfd_file_ptr@.
6676         * bfd-in2.h: Re-generate.
6677
6678 2004-02-14  Andrew Cagney  <cagney@redhat.com>
6679
6680         * configure.host (HDEFINES): When hppa*-*-hpux*, define
6681         _LARGEFILE64_SOURCE.
6682
6683 2004-02-13  Andrew Cagney  <cagney@redhat.com>
6684
6685         * elf.c (vma_page_aligned_bias): New function.
6686         (assign_file_positions_except_relocs)
6687         (assign_file_positions_for_segments): Replace broken modulo
6688         arithmetic with call to vma_page_aligned_bias.
6689
6690 2004-02-11  Andrew Cagney  <cagney@redhat.com>
6691
6692         * bfd-in.h: Update copyright.
6693         (bfd_tell): Change return type to file_ptr.
6694         * bfd-in2.h: Re-generate.
6695         * cache.c: Update copyright.
6696         (bfd_cache_lookup_worker): Use real_fseek, do not cast offset
6697         parameter.
6698         (close_one): Use real_ftell.
6699         * bfdio.c: Update copyright.
6700         (real_ftell, real_fseek): New functions.
6701         (bfd_tell): Use real_fseek and real_ftell, change return type to
6702         file_ptr.
6703         (bfd_seek): Use real_ftell and real_fseek, change type of
6704         file_position to a file_ptr.
6705         * libbfd-in.h: Update copyright.
6706         (real_ftell, real_fseek): Declare.
6707         * libbfd.h: Re-generate.
6708
6709         * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64,
6710         fseeko and fseeko64.  Determine bfd_file_ptr.
6711         * configure: Re-generate.
6712         * config.in: Re-generate.
6713
6714 2004-02-09  Anil Paranjpe  <anilp1@KPITCummins.com>
6715
6716         * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w.
6717         * elf32-h8300.c: Likewise.
6718
6719 2004-02-09  Christian Vogel <vogelchr@vogel.cx>
6720             Nick Clifton  <nickc@redhat.com>
6721
6722         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
6723         GOT entries with no associated GOT subsection.
6724
6725 2004-02-09  Richard Sandiford  <rsandifo@redhat.com>
6726
6727         * bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
6728         * elf.c (swap_out_syms): Use it to decide whether local section
6729         symbols should be named.
6730         * elfxx-target.h (elf_backend_name_local_section_symbols): New macro.
6731         * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare.
6732         (elf_backend_name_local_section_symbols): Define.
6733         * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New.
6734
6735 2004-01-30  H.J. Lu  <hongjiu.lu@intel.com>
6736
6737         * elfxx-ia64.c (elfNN_ia64_relax_brl): New function.
6738         (elfNN_ia64_relax_section): Optimize brl to br during the relax
6739         finalize pass.
6740
6741 2004-01-30  Alexandre Oliva  <aoliva@redhat.com>
6742
6743         * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
6744         to bfd_link_hash_entry passed by reference to
6745         _bfd_generic_link_add_one_symbol.
6746
6747 2004-01-25  H.J. Lu  <hongjiu.lu@intel.com>
6748
6749         * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
6750         relocations against dynamic symbols.
6751
6752 2004-01-23  Daniel Jacobowitz  <drow@mvista.com>
6753
6754         * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
6755         change.
6756
6757 2004-01-21  Tom Rix  <tcrix@worldnet.att.net>
6758
6759         * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw.
6760         * bfd-in2.h, libbfd.h: Rebuilt.
6761
6762 2004-01-20  Danny Smith  <dannysmith@users.sourceforge.net>
6763
6764         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
6765         IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
6766         flag has been cleared.
6767
6768 2004-01-19  Kazu Hirata  <kazu@cs.umass.edu>
6769
6770         * coff-h8300.c: Add and adjust comments about relaxation.
6771         * elf32-h8300.c: Likewise.
6772
6773 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
6774
6775         * coff-h8300.c: Fix comment typos.
6776         * elf32-h8300.c: Likewise.
6777
6778 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
6779
6780         * coff-h8300.c: Add comments about relaxation.
6781         * elf32-h8300.c: Likewise.
6782
6783 2004-01-14  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
6784
6785         * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
6786         throughout.
6787         * aclocal.m4: Regenerate.
6788         * configure: Regenerate.
6789
6790 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
6791
6792         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call
6793         mips_elf64_rtype_to_howto instead of using howto_table.
6794
6795 2004-01-13  Daniel Jacobowitz  <drow@mvista.com>
6796
6797         * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
6798         the .plt section.
6799         (elf32_arm_check_relocs): Don't increment the PLT refcount for
6800         relocs which would not use the PLT.
6801
6802 2004-01-13  Alan Modra  <amodra@bigpond.net.au>
6803
6804         * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
6805         (ppc64_elf_gc_sweep_hook): Likewise.
6806         (ppc64_elf_size_dynamic_sections): Test for .plt directly.
6807
6808 2004-01-12  Anil Paranjpe  <anilp1@KPITCummins.com>
6809
6810         Adds linker relaxation support for bit manipulation insns like
6811         band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
6812         bst, btst, bxor.
6813         * elf32-h8300.c: Opcode for bit manipulation insn is checked in
6814         elf32_h8_relax_section function while relxation for aa:16 and aa:32.
6815         * coff-h8300.c: Opcode for bit manipulation insn is checked in
6816         h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
6817
6818 2004-01-12  Alan Modra  <amodra@bigpond.net.au>
6819
6820         * dwarf2.c: Convert to C90, remove unneeded casts and prototypes.
6821
6822 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
6823
6824         * elf32-h8300.c: Fix formatting.
6825
6826 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
6827
6828         * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no
6829         dynamic object is present.  Declare r_symndx and h in an inner
6830         scope.
6831         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
6832
6833 2004-01-09  Daniel Jacobowitz  <drow@mvista.com>
6834
6835         * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count.
6836         (elf32_arm_copy_indirect_symbol): Don't copy pc_count.
6837         (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs
6838         identically.  Do not emit PC24 relocations for shared libraries.
6839         (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs
6840         identically.  Don't adjust pc_count.
6841         (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically.
6842         Set ELF_LINK_HASH_NEEDS_PLT for both.  Don't adjust pc_count; don't
6843         adjust count for branch relocations.
6844         (allocate_dynrelocs): Correct typo in call to
6845         WILL_CALL_FINISH_DYNAMIC_SYMBOL.  Never allocate space for
6846         PC24 or PLT32 relocs when linking.
6847
6848 2004-01-09  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
6849
6850         * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D
6851         relocation howto with ARM_26 one for consistency.
6852         (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations
6853         that will be converted to ARM_26D ones, since we always want 'done'
6854         relocations to be reflected in section's data.
6855         (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction
6856         offset.
6857         (_bfd_final_link_relocate): Do not modify "inplace" data, if not
6858         requested.
6859
6860 2004-01-08  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
6861
6862         * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that
6863         are not partial_inplace during a relocatable link.
6864
6865 2004-01-08  Kazu Hirata  <kazu@cs.umass.edu>
6866
6867         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early
6868         if no dynamic object is present.  Declare r_symndx and h in an
6869         inner scope.
6870
6871 2004-01-07  H.J. Lu  <hongjiu.lu@intel.com>
6872
6873         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install
6874         trampoline if it is known out of range.
6875
6876 2004-01-06  Alexandre Oliva  <aoliva@redhat.com>
6877
6878         2003-12-17  Alexandre Oliva  <aoliva@redhat.com>
6879         * elf32-frv.c (_frv_osec_readonly_p): New.
6880         (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for
6881         undefweak symbol.
6882         (_frv_count_got_plt_entries): Adjust expected count accordingly.
6883         (elf32_frv_relocate_section): Likewise.  Error out if attempting
6884         to emit rofixups or dynamic relocs in read-only segments.  Use
6885         _bfd_elf_section_offset to adjust r_offsets in rofixups and
6886         dynamic relocations.
6887         2003-12-12  Alexandre Oliva  <aoliva@redhat.com>
6888         * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic
6889         relocations or fixups involving merged sections correctly.  Avoid
6890         crash when undefined symbol is referenced by R_FRV_32 or
6891         R_FRV_FUNCDESC_VALUE.
6892         2003-12-02  Alexandre Oliva  <aoliva@redhat.com>
6893         * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of
6894         input section holding local symbol to addend of R_FRV_32 or
6895         R_FRV_FUNCDESC_VALUE dynamic relocation.
6896         2003-11-27  Alexandre Oliva  <aoliva@redhat.com>
6897         * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg.
6898         (elf32_frv_always_size_sections): Don't store pointer to
6899         __stacksize symbol in sec_info.
6900         (elf32_frv_modify_segment_map): Look it up here.
6901         2003-11-26  Alexandre Oliva  <aoliva@redhat.com>
6902         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address
6903         of the lazy PLT entry, not only its offset, as the low word of a
6904         function descriptor.
6905         2003-11-10  Alexandre Oliva  <aoliva@redhat.com>
6906         * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize
6907         if a hash table entry already exists but is not a definition.
6908         2003-11-05  Alexandre Oliva  <aoliva@redhat.com>
6909         * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc.
6910         (_frv_add_rofixup): Don't inline.
6911         (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address
6912         for undefweak symbols.
6913         (elf32_frv_relocate_section): Avoid crash while computing
6914         relocation when linking with shared library.  Only emit rofixups
6915         and dynamic relocations for alloc&load sections.  Mark binaries
6916         with inter-segment relocations for relocation as a unit.
6917         (_frv_create_got_section): Rename .rofixup.got to .rofixup.
6918         (DEFAULT_STACK_SIZE): New.
6919         (_frv_count_got_plt_entries): Fix thinko in deciding whether to
6920         emit rofixups or dynamic relocs when linking dynamic non-PIE
6921         executables.
6922         (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and
6923         shared libs too.  Reserve the last entry for the GOT pointer.
6924         (elf32_frv_finish_dynamic_sections): Emit it.
6925         (elf32_frv_always_size_sections): New.
6926         (elf32_frv_modify_segment_map): New.
6927         (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC
6928         sections.
6929         (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set.
6930         (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC.
6931         (elf_backend_always_size_sections): New.
6932         (elf_backend_modify_segment_map): New.
6933         2003-10-31  Alexandre Oliva  <aoliva@redhat.com>
6934         * config.bfd: Added frv-*-*linux*.
6935         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for
6936         ABS section, instead of crashing.
6937         (elf32_frv_relocate_section): Don't crash before warning about
6938         different segments in non-PIC relocation.
6939         2003-10-17  Alexandre Oliva  <aoliva@redhat.com>
6940         * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24
6941         relocs to undefweak symbols.
6942         (elf32_frv_relocate_section): Ditto for undefined symbols.
6943         2003-10-06  Alexandre Oliva  <aoliva@redhat.com>
6944         * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure
6945         gotfixup section was created.
6946         2003-09-30  Alexandre Oliva  <aoliva@redhat.com>
6947         * elf32-frv.c (elf32_frv_howto_table): Change GOT12,
6948         FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to
6949         complain_overflow_signed.
6950         * elf32-frv.c (_frv_add_rofixup): Do not error out if contents
6951         have not been allocated.
6952         (_frv_emit_got_relocs_plt_entries): Return non-void.  Assert
6953         privfd only if dynamic sections were created.
6954         (elf32_frv_relocate_section): Compute gprel_segment, and use it
6955         for GPREL relocs.  When linking relocatable FDPIC executables,
6956         emit warnings for relocations that would be illegal on PIE or
6957         shared libraries.  Emit rofixup for R_FRV_32 only if input object
6958         is not FDPIC.
6959         (_frv_create_got_section): Define _gp symbol in the rofixup
6960         section.
6961         (elf32_frv_finish_dynamic_sections): If rofixups needed but
6962         dynamic sections missing, error out requesting -melf32frvfd.
6963         2003-09-19  Alexandre Oliva  <aoliva@redhat.com>
6964         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange
6965         computation of addends from section and global or local symbol
6966         value.  Change return type to bfd_boolean, and return a failure if
6967         a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a
6968         nonzero addend is required.
6969         (elf32_frv_relocate_section): Likewise.  Print error for
6970         unsupported nonzero addends.
6971         2003-09-18  Alexandre Oliva  <aoliva@redhat.com>
6972         * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections,
6973         force everything local.
6974         (_frv_emit_got_relocs_plt_entries): Cope with NULL sec.
6975         * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup.
6976         (frv_gotfixup_section): New.
6977         (FRV_SYM_LOCAL): Accept undefweak and local common symbols.
6978         (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd
6979         and relocsfdv.
6980         (_frv_add_rofixup): New.
6981         (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE
6982         fdpic executables.  Use FRV_SYM_LOCAL more widely to simplify and
6983         improve some ugly conditions.
6984         (elf32_frv_relocate_section): Likewise.  Reject inter-segment
6985         relocations in fdpic.
6986         (_frv_create_got_section): Create .rofixup.got section.
6987         (struct _frv_dynamic_got_info): Added fixups.
6988         (_frv_count_got_plt_entries): Account in-GOT relocations into
6989         relocs32, relocsfd and relocsfdv.  Account them into relocs or
6990         fixups, as appropriate.
6991         (elf32_frv_size_dynamic_sections): Size rofixup section.  Simplify
6992         sizing of gotrel.
6993         (elf32_frv_finish_dynamic_sections): Verify that the right number
6994         of relocations and fixups was generated.
6995         (elf32_frv_check_relocs): Compute relocs32, relocsfd and
6996         relocsfdv.
6997         * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of
6998         SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL.
6999         (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function
7000         descriptor of a (formerly-)global symbol is local.
7001         (struct frv_pic_relocs_info): Adjust comments.
7002         (_frv_emit_got_relocs_plt_entries): Adjust.
7003         (elf32_frv_relocate_section): Likewise.
7004         (_frv_count_got_plt_entries): Likewise.
7005         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global
7006         symbol's value to addend in the common preamble.  Decay dynamic
7007         symbols to section+offset if they bind or call locally, for GOT
7008         and FUNCDESC_VALUE, respectively.
7009         (elf32_frv_relocate_section): Likewise.
7010         (elf32_frv_check_relocs): Don't register as dynamic symbols of
7011         internal or hidden visibility.
7012         2003-09-17  Alexandre Oliva  <aoliva@redhat.com>
7013         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as
7014         argument, so as to not call _bfd_elf_rel_local_sym to compute it.
7015         (elf32_frv_relocate_section): Pass relocation addend in.  Use
7016         original relocation addend to look up the got relocs/plt entries
7017         table.  Do not call _bfd_elf_rel_local_sym.  Don't error out when
7018         processing relocations that reference .scommon symbols.
7019         2003-09-15  Alexandre Oliva  <aoliva@redhat.com>
7020         Introduce support for dynamic linking.
7021         * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits.
7022         (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto,
7023         elf32_frv_rel_funcdesc_value_howto): New REL descriptors.
7024         (frv_reloc_type_lookup): Return REL howtos for executables and
7025         dynamic libraries.
7026         (frv_info_to_howto_rel): New.
7027         (struct frv_elf_link_hash_table): New.
7028         (frv_hash_table, frv_got_section, frv_gotrel_section,
7029         frv_plt_section, frv_pltrel_section, frv_relocs_info,
7030         frv_got_initial_offset, frv_plt_initial_offset): New macros.
7031         (frv_elf_link_hash_table_create): New.
7032         (struct frv_pic_relocs_info): New.
7033         (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New.
7034         (frv_pic_relocs_info_find): New.
7035         (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local):
7036         New.
7037         (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New.
7038         (_frv_add_dyn_reloc, _frv_osec_to_segment): New.
7039         (_frv_emit_got_relocs_plt_entries): New.
7040         (elf32_frv_relocate_section): Add support for dynamic linking.
7041         Handle new relocations.
7042         (_frv_create_got_section): New.
7043         (elf32_frv_create_dynamic_sections): New.
7044         (ELF_DYNAMIC_INTERPRETER): New.
7045         (struct _frv_dynamic_got_info): New.
7046         (_frv_count_got_plt_entries): New.
7047         (struct _frv_dynamic_got_plt_info): New.
7048         (_frv_compute_got_alloc_data): New.
7049         (_frv_get_got_entry, _frv_get_fd_entry): New.
7050         (_frv_assign_got_entries, _frv_assign_plt_entries): New.
7051         (_frv_resolve_final_relocs_info): New.
7052         (elf32_frv_size_dynamic_sections): New.
7053         (elf32_frv_finish_dynamic_sections): New.
7054         (elf32_frv_adjust_dynamic_symbol): New.
7055         (elf32_frv_finish_dynamic_symbol): New.
7056         (elf32_frv_check_relocs): Handle new relocs.  Explain how the
7057         whole thing works.
7058         (elf_info_to_howto_rel): Define.
7059         (bfd_elf32_bfd_link_hash_table_create): Define.
7060         (elf_backend_create_dynamic_sections): Define.
7061         (elf_backend_adjust_dynamic_symbol): Define.
7062         (elf_backend_size_dynamic_sections): Define.
7063         (elf_backend_finish_dynamic_symbol): Define.
7064         (elf_backend_finish_dynamic_sections): Define.
7065         (elf_backend_want_got_sym): Define.
7066         (elf_backend_got_header_size): Define.
7067         (elf_backend_want_got_plt): Define.
7068         (elf_backend_plt_readonly): Define.
7069         (elf_backend_want_plt_sym): Define.
7070         (elf_backend_plt_header_size): Define.
7071         (elf_backend_may_use_rel_p): Define.
7072         (elf_backend_may_use_rela_p): Define.
7073         (elf_backend_default_use_rela_p): Define.
7074         2003-08-08  Alexandre Oliva  <aoliva@redhat.com>
7075         * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12,
7076         R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12,
7077         R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New.
7078         (frv_reloc_map): Map the corresponding BFD relocs to them.
7079         (frv_reloc_type_lookup): ... and back to BFD relocs.
7080         * reloc.c: New relocs.
7081         * bfd-in2.h, libbfd.h: Rebuilt.
7082         2003-08-04  Alexandre Oliva  <aoliva@redhat.com>
7083         * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
7084         R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
7085         R_FRV_FUNCDESC_GOTLO): New.
7086         (frv_reloc_map): Map the corresponding BFD relocs to them.
7087         (frv_reloc_type_lookup): ... and back to BFD relocs.
7088         * reloc.c: New relocs.
7089         * bfd-in2.h, libbfd.h: Rebuilt.
7090
7091 2004-01-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
7092
7093         * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7094         targets to support pages of up to 64kB.
7095         (elf32_bed): Redefine to get a separate backend data structure for
7096         traditional targets.
7097         * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7098         targets to support pages of up to 64kB.
7099         (elf64_bed): Redefine to get a separate backend data structure for
7100         traditional targets.
7101         * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
7102         targets to support pages of up to 64kB.
7103         (elf32_bed): Redefine to get a separate backend data structure for
7104         traditional targets.
7105
7106 2004-01-04  Mark Kettenis  <kettenis@gnu.org>
7107
7108         * elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
7109
7110 2004-01-02  Mark Kettenis  <kettenis@gnu.org>
7111
7112         * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD.
7113         (elf_i386_grok_psinfo): Likewise.
7114
7115 2004-01-02  Bernardo Innocenti  <bernie@develer.com>
7116
7117         * config.bfd: Add m68k-uClinux target.
7118
7119 2004-01-01  Grant Edwards <grante@visi.com>
7120
7121         * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored.
7122         * elf32-h8300.c (elf32_h8_gc_mark_hook): New function.
7123         (elf32_h8_gc_sweep_hook): New function.
7124         (elf_backend_gc_mark_hook): Define.
7125         (elf_backend_gc_sweep_hook): Define.
7126         (elf_backend_can_gc_sections): Define.
7127
7128 For older changes see ChangeLog-0203
7129 \f
7130 Local Variables:
7131 mode: change-log
7132 left-margin: 8
7133 fill-column: 74
7134 version-control: never
7135 End: