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