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