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