* section.c (bfd_make_section_anyway): Copy the whole
[external/binutils.git] / bfd / ChangeLog
1 2004-05-01  Alan Modra  <amodra@bigpond.net.au>
2
3         * section.c (bfd_make_section_anyway): Copy the whole
4         bfd_hash_entry, not just "next" from existing entry.
5
6 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
7
8         * elf.c (bfd_section_from_shdr): Maintain the section order in
9         a section group.
10         (special_sections): Add ".note.GNU-stack".
11         (elf_fake_sections): Handle section group for relocatable
12         link..
13
14 2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
15
16         * section.c (bfd_sections_find_if): New.
17         * bfd-in2.h: Regenerated.
18
19 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
20
21         * section.c (bfd_make_section_anyway): Add all sections to hash tab.
22
23         * elf-bfd.h (bfd_elf_is_group_section): Declare.
24         * elf.c (bfd_elf_is_group_section): New function.
25         * elfxx-target.h (bfd_elfNN_bfd_is_group_section
26         * section.c (bfd_generic_is_group_section): New function.
27         * targets.c (struct bfd_target): Add _bfd_is_group_section field.
28         (BFD_JUMP_TABLE_LINK): Adjust.
29         * aout-adobe.c (aout_32_bfd_is_group_section): Define.
30         * aout-target.h (MY_bfd_is_group_section): Define.
31         * aout-tic30.c (MY_bfd_is_group_section): Define.
32         * bfd.c (bfd_is_group_section): Define.
33         * binary.c (binary_bfd_is_group_section): Define.
34         * bout.c (b_out_bfd_is_group_section): Define.
35         * coff-alpha.c (_bfd_ecoff_bfd_is_group_section): Define.
36         * coff-mips.c (_bfd_ecoff_bfd_is_group_section): Define.
37         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Adjust.
38         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Adjust.
39         * coffcode.h (coff_bfd_is_group_section): Define.
40         * i386msdos.c (msdos_bfd_is_group_section): Define.
41         * i386os9k.c (os9k_bfd_is_group_section): Define.
42         * ieee.c (ieee_bfd_is_group_section): Define.
43         * ihex.c (ihex_bfd_is_group_section): Define.
44         * libbfd-in.h (_bfd_nolink_bfd_is_group_section): Define.
45         * mach-o.c (bfd_mach_o_bfd_is_group_section): Define.
46         * mmo.c (mmo_bfd_is_group_section): Define.
47         * nlm-target.h (nlm_bfd_is_group_section): Define.
48         * oasys.c (oasys_bfd_is_group_section): Define.
49         * pef.c (bfd_pef_bfd_is_group_section): Define.
50         * ppcboot.c (ppcboot_bfd_is_group_section): Define.
51         * srec.c (srec_bfd_is_group_section): Define.
52         * tekhex.c (tekhex_bfd_is_group_section): Define.
53         * versados.c (versados_bfd_is_group_section): Define.
54         * vms.c (vms_bfd_is_group_section): Define.
55         * xsym.c (bfd_sym_bfd_is_group_section): Define.
56         * bfd-in2.h: Regenerate.
57         * libbfd.h: Regenerate.
58
59 2004-04-30  Alan Modra  <amodra@bigpond.net.au>
60
61         * elflink.c (elf_gc_mark): Follow indirect and warning syms.
62
63 2004-04-30  Hans-Peter Nilsson  <hp@axis.com>
64
65         * configure.in: Update version to 2.15.91.
66         * configure: Regenerate.
67
68 2004-04-29  Brian Ford  <ford@vss.fsi.com>
69
70         * bfd.c (bfd_get_sign_extend_vma): Add pe[i]-i386 case to DJGPP hack.
71         * coffcode.h (DOT_DEBUG, GNU_LINKONCE_WI): Define.
72         [!COFF_WITH_PE] (sec_to_styp_flags, styp_to_sec_flags): Use them.
73         (coff_compute_section_file_positions) [RS6000COFF_C]: Likewise.
74         [COFF_WITH_PE] (sec_to_styp_flags): Handle DWARF 2/3 .debug* and
75         .gnu.linkonce.wi. sections.
76         * pe-i386.c (COFF_SUPPORT_GNU_LINKONCE): Define.
77         (COFF_SECTION_ALIGNMENT_ENTRIES): Add entries for .debug and
78         .gnu.linkonce.wi..
79         * pei-i386.c (COFF_SUPPORT_GNU_LINKONCE): Likewise.
80         (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
81
82 2004-04-28  Chris Demetriou  <cgd@broadcom.com>
83
84         * reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
85         * bfd-in2.h: Regenerate.
86         * libbfd.h: Likewise.
87
88 2004-04-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
89
90         * som.c (struct som_misc_symbol_info): Add is_comdat, is_common and
91         dup_common fields.
92         (setup_sections): Use som_subspace_dictionary_record struct instead
93         subspace_dictionary_record.  Set SEC_LINK_ONCE if subspace is
94         is_comdat, is_common or dup_common.
95         (som_prep_headers): Use som_subspace_dictionary_record struct.  Set
96         is_comdat, is_common and dup_common in section subspace_dict from
97         copy_data.
98         (som_begin_writing): Use som_subspace_dictionary_record struct.
99         (som_finish_writing): Likewise.
100         (som_bfd_derive_misc_symbol_info): Add support to set is_comdat,
101         is_common and dup_common flags in info for symbol.  Add comment
102         regarding linker support for these fields.  Slightly reorganize
103         function.
104         (som_build_and_write_symbol_table): Set is_comdat, is_common and
105         dup_common fields in symbol table from symbol info.
106         (bfd_som_set_subsection_attributes): Add comdat, common and dup_common
107         arguments.  Set corresponding fields in copy_data.  Change all callers.
108         (som_bfd_ar_write_symbol_stuff): Set dup_common flag in library
109         symbol table.
110         (som_vec): Add SEC_LINK_ONCE to applicable section flags.
111         * som.h (som_subspace_dictionary_record): Define.
112         (som_copyable_section_data_struct): Add is_comdat, is_common and
113         dup_common fields.
114         (som_section_data_struct): Use som_subspace_dictionary_record struct
115         instead of subspace_dictionary_record.
116         (bfd_boolean bfd_som_set_subsection_attributes): Adjust prototype.
117
118 2004-04-27  Bob Wilson  <bob.wilson@acm.org>
119
120         * elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size
121         if set.  Check reloc_done flag before applying relocations.  Use
122         output addresses, both when applying relocations and when comparing
123         against the specified section.
124         (elf_xtensa_relocate_section): Use output address to check if dynamic
125         reloc is in a literal pool.  Set section's reloc_done flag.
126
127 2004-04-27  H.J. Lu  <hongjiu.lu@intel.com>
128
129         * elf32-sh64.c (elf_backend_section_flags): New. Defined.
130         (sh64_elf_set_mach_from_flags): Remove the kludge for .cranges
131         section.
132         (sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges
133         section.
134
135 2004-04-27  Alan Modra  <amodra@bigpond.net.au>
136
137         * elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign
138         structure field removed in 2004-04-24 patch.
139         * elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix.
140
141         * elf-bfd.h (struct elf_backend_data <elf_backend_section_flags>):
142         Constify hdr arg.
143         * elf32-arm.h (elf32_arm_section_flags): Likewise.
144         * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
145         * elfxx-ia64.c (elfNN_ia64_section_flags): Likewise.
146         * elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section
147         field before calling elf_backend_section_flags.
148
149 2004-04-24  Chris Demetriou  <cgd@broadcom.com>
150
151         * elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16)
152         (elf_mips_gnu_pcrel64, elf_mips_gnu_pcrel32): Remove.
153         (bfd_elf32_bfd_reloc_type_lookup): Remove cases for
154         BFD_RELOC_PCREL_HI16_S, BFD_RELOC_PCREL_LO16, BFD_RELOC_64_PCREL,
155         and BFD_RELOC_32_PCREL.
156         (mips_elf32_rtype_to_howto): Remove cases for R_MIPS_GNU_REL_HI16,
157         R_MIPS_GNU_REL_LO16, R_MIPS_PC64, R_MIPS_PC32.
158         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
159         (_bfd_mips_elf_lo16_reloc): Remove handling for R_MIPS_GNU_REL_HI16.
160         (mips_elf_next_relocation): Move comment about matching HI/LO
161         relocations to...
162         (_bfd_mips_elf_relocate_section): Here.  Remove handling for
163         R_MIPS_GNU_REL_HI16.
164
165 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
166
167         * coff-mips.c (mips_relhi_reloc, mips_rello_reloc)
168         (mips_switch_reloc, mips_read_relocs, mips_relax_section)
169         (mips_relax_pcrel16, PCREL16_EXPANSION_ADJUSTMENT): Remove.
170         (mips_relocate_hi): Remove now-unused 'adjust' and 'pcrel' arguments,
171         and update comments to reflect current usage.
172         (mips_howto_table): Remove entries for MIPS_R_RELHI, MIPS_R_RELLO,
173         and MIPS_R_SWITCH, as well as several empty entries.  Update comment
174         for MIPS_R_PCREL16.
175         (mips_ecoff_swap_reloc_in, mips_ecoff_swap_reloc_out)
176         (mips_adjust_reloc_out, mips_bfd_reloc_type_lookup): Remove support
177         for MIPS_R_SWITCH, MIPS_R_RELLO, and MIPS_R_RELHI relocations.
178         (mips_adjust_reloc_in): Likewise, adjust maximum accepted relocation
179         type number to be MIPS_R_PCREL16.
180         (mips_relocate_section): Remove support for link-time relaxation
181         of branches used by embedded-PIC.  Remove support for MIPS_R_SWITCH,
182         MIPS_R_RELLO, and MIPS_R_RELHI relocations.
183         (_bfd_ecoff_bfd_relax_section): Redefine to bfd_generic_relax_section.
184         * ecoff.c (ecoff_indirect_link_order): Remove support for link-time
185         relaxation of branches used by embedded-PIC.
186         * ecofflink.c (bfd_ecoff_debug_accumulate): Likewise.
187         * libecoff.h (struct ecoff_section_tdata): Remove embedded-PIC
188         related members, update comment.
189         * pe-mips.c: Remove disabled (commented-out and #if 0'd)
190         code related to embedded-PIC.
191         * elfxx-mips.c (_bfd_mips_elf_read_ecoff_info): Remove
192         initialization of now-removed 'adjust' member of
193         'struct ecoff_debug_info'.
194
195 2004-04-23  Chris Demetriou  <cgd@broadcom.com>
196
197         * elfxx-mips.c (mips_elf_get_global_gotsym_index): Remove.
198
199 2004-04-21  Philip Blundell  <pb@nexus.co.uk>
200
201         * elf32-arm.h (elf32_arm_check_relocs): Don't output REL32
202         relocs for locally defined symbols during -shared final link.
203         (elf32_arm_final_link_relocate): Likewise.
204
205 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
206
207         * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Copy also
208         ELF_LINK_POINTER_EQUALITY_NEEDED.
209         (elf64_x86_64_check_relocs): Set ELF_LINK_POINTER_EQUALITY_NEEDED
210         if r_type is not R_X86_64_PC32.
211         (elf64_x86_64_finish_dynamic_symbol): If
212         ELF_LINK_POINTER_EQUALITY_NEEDED is not set, clear st_value of
213         SHN_UNDEF symbols.
214
215 2004-04-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
216
217         * elf32-sh.c (sh_elf_plt_sym_val): New function.
218         (elf_backend_plt_sym_val): Define.
219
220 2004-04-22  Andrew Cagney  <cagney@redhat.com>
221
222         * opncls.c (bfd_alloc): Fix type of "wanted" in doco.
223
224 2004-04-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
225
226         * hpux-core.c (hpux_core_core_file_p): Add cast in call to 
227         make_bfd_asection.
228         * som.c (som_set_section_contents): Constantify second argument.
229         (hppa_som_gen_reloc_type): Abort for unsupported selectors.
230         (som_object_setup): Rework to avoid warning.
231         (setup_sections, som_write_fixups, bfd_section_from_som_symbol):
232         Likewise.
233
234 2004-04-22  Andrew Cagney  <cagney@redhat.com>
235
236         * cache.c (bfd_cache_close): Check for a previously closed file.
237
238 2004-04-22  Jakub Jelinek  <jakub@redhat.com>
239
240         * bfd.c (bfd_get_synthetic_symtab): Define.
241         * targets.c (BFD_JUMP_TABLE_DYNAMIC): Add
242         NAME##_get_synthetic_symtab.
243         (struct bfd_target): Add _bfd_get_synthetic_symtab.
244         * libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define.
245         * elf-bfd.h (struct elf_backend_data): Add plt_sym_val and
246         relplt_name fields.
247         (_bfd_elf_get_synthetic_symtab): New prototype.
248         * elfcode.h (elf_get_synthetic_symtab): Define.
249         * elf.c (_bfd_elf_get_synthetic_symtab): New function.
250         * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define.
251         (elf_backend_plt_sym_val, elf_backend_relplt_name): Define.
252         (elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name.
253         * bfd-in2.h: Rebuilt.
254         * libbfd.h: Rebuilt.
255         * elf32-i386.c (elf_i386_plt_sym_val): New function.
256         (elf_backend_plt_sym_val): Define.
257         * elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function.
258         (elf_backend_plt_sym_val): Define.
259         * elf32-s390.c (elf_s390_plt_sym_val): New function.
260         (elf_backend_plt_sym_val): Define.
261         * elf64-s390.c (elf_s390_plt_sym_val): New function.
262         (elf_backend_plt_sym_val): Define.
263         * elf32-sparc (elf32_sparc_plt_sym_val): New function.
264         (elf_backend_plt_sym_val): Define.
265         * elf64-sparc.c (sparc64_elf_plt_sym_val): New function.
266         (elf_backend_plt_sym_val): Define.
267         * elf32-ppc.c (ppc_elf_plt_sym_val): New function.
268         (elf_backend_plt_sym_val): Define.
269         * aout-target.h (MY_get_synthetic_symtab): Define.
270         * aout-tic30.c (MY_get_synthetic_symtab): Define.
271         * coff-rs6000.c (rs6000coff_vec): Add
272         _bfd_nodynamic_get_synthetic_symtab.
273         (pmac_xcoff_vec): Likewise.
274         * coff64-rs6000.c (rs6000coff64_vec): Add
275         _bfd_nodynamic_get_synthetic_symtab.
276         (aix5coff64_vec): Likewise.
277         * sunos.c (MY_get_synthetic_symtab): Define.
278         * vms.c (vms_get_synthetic_symtab): Define.
279
280 2004-04-22  Nick Clifton  <nickc@redhat.com>
281
282         * bfd.c (bfd_archive_filename): Return NULL on NULL input.
283
284 2004-04-22  Peter Barada <peter@the-baradas.com>
285
286         * archures.c: Add bfd_mach_mcfv4e to bfd_architecture.
287         * bfd2-in.h: Regenerate.
288         * cpu-m68k.c: Add 'm68k:mcfv4e' to arch_info_struct[].
289
290 2004-04-21  Chris Demetriou  <cgd@broadcom.com>
291
292         * coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove.
293         * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove.
294         * bfd-in.h (bfd_mips_ecoff_create_embedded_relocs)
295         (bfd_mips_elf32_create_embedded_relocs): Remove prototypes
296         * bfd-in2.h: Regenerate.
297
298 2004-04-21  Bob Wilson  <bob.wilson@acm.org>
299
300         * elf32-xtensa.c (is_same_value): Add final_static_link argument and
301         require relocations against a weak symbol to reference the same
302         symbol hash entry if not a final, static link.
303         (get_cached_value, add_value_map): Add final_static_link argument.
304         (remove_literals): Pass final_static_link argument as needed.
305
306 2004-04-21  Andrew Cagney  <cagney@redhat.com>
307
308         * opncls.c (_bfd_new_bfd_contained_in): Copy "iovec".
309         (struct opncls, opncls_btell, opncls_bseek, opncls_bread)
310         (opncls_bwrite, opncls_bclose, opncls_bflush)
311         (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a
312         bfd iovec that uses function callbacks.
313         (bfd_close): Use the iovec's bclose.
314         * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite)
315         (cache_bclose, cache_bflush, cache_bstat)
316         (cache_iovec): New functions and global variable, implement a
317         cache "iovec", where applicable set bfd_error.
318         (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec.
319         * bfdio.c (struct bfd_iovec): Define.
320         (real_read): Delete function.
321         (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat)
322         (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec",
323         assume that bread and bwrite set bfd_error.
324         * bfd.c (struct bfd): Add "iovec", update comments.
325         * bfd-in2.h, libbfd.h: Re-generate.
326
327 2004-04-21  Andrew Cagney  <cagney@redhat.com>
328
329         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
330
331 2004-04-21  Eric Botcazou  <ebotcazou@act-europe.fr>
332
333         * elflink.c (elf_gc_mark_dynamic_ref_symbol): New function.
334         (bfd_elf_gc_sections): Fail if a shared object is being created.
335         Do not fail if dynamic sections have been created.  Instead call
336         elf_gc_mark_dynamic_ref_symbol to mark sections that contain
337         dynamically referenced symbols.  Do not mark the whole graph
338         rooted at .eh_frame, only the section proper.
339
340 2004-04-20  DJ Delorie  <dj@redhat.com>
341
342         * reloc.c: Add BFD_RELOC_32_SECREL.
343         * bfd-in2.h: Regenerate.
344         * libbfd.h: Likewise.
345         * coff-i386.c (howto_table) [COFF_WITH_PE]: Add R_SECREL32.
346         (coff_i386_rtype_to_howto) [COFF_WITH_PE]: Handle it.
347         (coff_i386_reloc_type_lookup) [COFF_WITH_PE]: Likewise.
348
349 2004-04-19  Jakub Jelinek  <jakub@redhat.com>
350
351         * elf32-sparc.c (elf32_sparc_relocate_section): Handle
352         relocs against hidden/protected undefweak symbols properly.
353         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
354
355 2004-04-18  Mark Kettenis  <kettenis@gnu.org>
356
357         * libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
358         * netbsd-core.c (netbsd_core_file_p): Set architecture for PowerPC
359         core files.
360
361 2004-04-17  Brian Ford  <ford@vss.fsi.com>
362
363         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the first non-zero
364         filepos for the SizeOfHeaders field.
365         (_bfd_XXi_swap_scnhdr_out): Correct section flags lossage on reloc
366         overflow.
367         (_bfd_XXi_swap_sym_in): Remove redundant section flags assignment.
368
369 2004-04-16  Alan Modra  <amodra@bigpond.net.au>
370
371         * simple.c (bfd_simple_get_relocated_section_contents): Don't
372         change reloc_done.  Set and restore _cooked_size.
373         (RETURN): Delete.
374
375 2004-04-15  Mark Kettenis  <kettenis@gnu.org>
376
377         * netbsd-core.c (netbsd_core_file_p): Set architecture for VAX
378         core files.
379
380 2004-04-15  Nick Clifton  <nickc@redhat.com>
381
382         * bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
383
384 2004-04-15  Alan Modra  <amodra@bigpond.net.au>
385
386         * elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change.
387
388 2004-04-15  H.J. Lu  <hongjiu.lu@intel.com>
389
390         * elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only
391         when it is a definition.
392
393 2004-04-14  Alan Modra  <amodra@bigpond.net.au>
394
395         * elf32-sparc.c (elf32_sparc_relocate_section): Don't abort
396         when statically linking PIC code.
397         * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
398
399 2004-04-11  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
400
401         * config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets.
402         * configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3*
403         targets amd aout_mips_big_vec, aout_mips_little_vec target vectors.
404         * configure: Regenerate.
405
406 2004-04-08  Richard Sandiford  <rsandifo@redhat.com>
407
408         * elflink.c: Include libiberty.h.
409         * Makefile.am (elflink.lo): Depend on libiberty.h.
410         * Makefile.in: Regenerate.
411
412 2004-04-06  Daniel Jacobowitz  <drow@mvista.com>
413
414         * elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use
415         ".MIPS.stubs".
416
417 2004-04-05  H.J. Lu  <hongjiu.lu@intel.com>
418
419         * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always
420         reserve the memory for dynamic linker
421
422 2004-04-05  Mark Kettenis  <kettenis@gnu.org>
423
424         * netbsd-core.c (CORE_WCOOKIE_OFFSET): New define.
425         (netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc.
426
427 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
428
429         * elf32-cr16c.c (elf32_cr16c_relocate_section): Use
430         RELOC_FOR_GLOBAL_SYMBOL.
431         (elf32_cr16c_add_symbol_hook): Remove const from Elf_Internal_Sym.
432
433 2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
434
435         * elf32-arm.h (elf32_arm_final_link_relocate): Handle
436         R_ARM_ALU* only if OLD_ARM_ABI is not defined.
437
438 2004-04-01  Paul Brook  <paul@codesourcery.com>
439
440         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update.
441         * elf32-arm.h (struct elf32_elf_section_map): New.
442         (struct _arm_elf_section_data): New.
443         (elf32_arm_section_data): Define.
444         (struct elf32_arm_link_hash_table): Add byteswap_code.
445         (elf32_arm_link_hash_table_create): Initialize byteswap_code.
446         (bfd_elf32_arm_process_before_allocation): Add byteswap_code.
447         (elf32_arm_post_process_headers): Set EF_ARM_BE8.
448         (elf32_arm_output_symbol_hook, elf32_arm_new_section_hook,
449         elf32_arm_compare_mapping, elf32_arm_write_section): New functions.
450         (bfd_elf32_new_section_hook, elf_backend_write_section,
451         elf_backend_link_output_symbol_hook): Define.
452
453 2004-04-01  Andy Chittenden  <achittenden@bluearc.com>
454
455         * stabs.c (struct stab_link_includes_totals): Add field 'symb'
456         that keeps the characters in a B_INCL..B_EINCL range.
457         (_bfd_link_section_stabs): When computing the sum of the
458         characters in a B_INCL..B_EINCL range also keep a copy of those
459         characters.  Use this information to distinguish between
460         include sections that have the same sum and the same length
461         but which are nevertheless unique.
462
463 2004-03-31  Paul Brook  <paul@codesourcery.com>
464
465         * elf32-arm.h (elf32_arm_final_link_relocate): Add R_ARM_ALU*.
466         * elfarm-nabi.c (elf32_arm_howto_table): Ditto.
467
468 2004-03-31  Andy Chittenden <achittenden@bluearc.com>
469
470         * stabs.c (struct stab_link_includes_totals): Rename field 'total'
471         to 'sum_chars' and add field 'num_chars'.
472         (_bfd_link_section_stabs): When computing the sum of the
473         characters in a B_INCL..B_EINCL range also keep a count of the
474         number of characters.  Use this information to help distinguish
475         between include sections when have the same sum but which
476         nevertheless are still unique.
477
478 2004-03-31  Mattias EngdegÃ¥rd  <mattias@virtutech.se>
479
480         * stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs.
481
482 2004-03-30  Galit Heller  <Galit.Heller@nsc.com>
483             Tomer Levi    <Tomer.Levi@nsc.com>
484
485         * Makefile.am (ALL_MACHINES): Add cpu-cr16c.lo.
486         (ALL_MACHINES_CFILES): Add cpu-cr16c.c.
487         (BFD32_BACKENDS): Add elf32-cr16c.lo.
488         (BFD32_BACKENDS_CFILES): Add elf32-cr16c.c.
489         (cpu-cr16c.lo): New target.
490         (elf32-cr16c.lo): Likewise.
491         * Makefile.in: Regenerate.
492         * archures.c (bfd_architecture): Add bfd_{arch,mach}_cr16c.
493         (bfd_archures_list): Add bfd_cr16c_arch.
494         * config.bfd: Handle cr16c-*-elf*.
495         * configure.in: Handle bfd_elf32_cr16c_vec.
496         * configure: Regenerate.
497         * reloc.c: Add BFD_RELOC_16C_NUM08, BFD_RELOC_16C_NUM08_C,
498         BFD_RELOC_16C_NUM16, BFD_RELOC_16C_NUM16_C,
499         BFD_RELOC_16C_NUM32, BFD_RELOC_16C_NUM32_C,
500         BFD_RELOC_16C_DISP04, BFD_RELOC_16C_DISP04_C,
501         BFD_RELOC_16C_DISP08, BFD_RELOC_16C_DISP08_C,
502         BFD_RELOC_16C_DISP16, BFD_RELOC_16C_DISP16_C,
503         BFD_RELOC_16C_DISP24, BFD_RELOC_16C_DISP24_C,
504         BFD_RELOC_16C_DISP24a, BFD_RELOC_16C_DISP24a_C,
505         BFD_RELOC_16C_REG04, BFD_RELOC_16C_REG04_C,
506         BFD_RELOC_16C_REG04a, BFD_RELOC_16C_REG04a_C,
507         BFD_RELOC_16C_REG14, BFD_RELOC_16C_REG14_C,
508         BFD_RELOC_16C_REG16, BFD_RELOC_16C_REG16_C,
509         BFD_RELOC_16C_REG20, BFD_RELOC_16C_REG20_C,
510         BFD_RELOC_16C_ABS20, BFD_RELOC_16C_ABS20_C,
511         BFD_RELOC_16C_ABS24, BFD_RELOC_16C_ABS24_C,
512         BFD_RELOC_16C_IMM04, BFD_RELOC_16C_IMM04_C,
513         BFD_RELOC_16C_IMM16, BFD_RELOC_16C_IMM16_C,
514         BFD_RELOC_16C_IMM20, BFD_RELOC_16C_IMM20_C,
515         BFD_RELOC_16C_IMM24, BFD_RELOC_16C_IMM24_C,
516         BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C.
517         * targets.c (bfd_elf32_cr16c_vec): Declare.
518         (bfd_target_vector): Add bfd_elf32_cr16c_vec.
519         * cpu-cr16c.c: New file.
520         * elf32-cr16c.c: Likewise.
521         * libbfd.h: Regenerate.
522         * bfd-in2.h: Likewise.
523
524 2004-03-30  Jakub Jelinek  <jakub@redhat.com>
525
526         * elf.c (map_sections_to_segments): Fix handling of .tbss.
527
528 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
529
530         * Makefile.am: Remove all mention of elflink.h.
531         * Makefile.in: Regenerate.
532         * bfd-in.h (bfd_elf_discard_info): Declare.
533         (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete.
534         * bfd-in2.h: Regenerate.
535         * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol,
536         bfd_elf32_link_record_dynamic_symbol,
537         bfd_elf64_link_record_dynamic_symbol,
538         _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link,
539         bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol,
540         _bfd_elf32_link_record_local_dynamic_symbol,
541         _bfd_elf64_link_record_local_dynamic_symbol,
542         _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets,
543         _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link,
544         _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry,
545         _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets,
546         _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry,
547         _bfd_elf32_reloc_symbol_deleted_p,
548         _bfd_elf64_reloc_symbol_deleted_p): Delete.
549         (bfd_elf_link_record_dynamic_symbol,
550         bfd_elf_link_record_local_dynamic_symbol,
551         bfd_elf_final_link, bfd_elf_gc_sections,
552         bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry,
553         bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link,
554         bfd_elf_reloc_symbol_deleted_p): Declare.
555         (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
556         * elf32-arm.h: Update for changed function names.  Remove local
557         WILL_CALL_FINISH_DYNAMIC_SECTION define.
558         * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c,
559         * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c,
560         * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c,
561         * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
562         * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
563         * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c,
564         * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c,
565         * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise.
566         * elfxx-target.h (bfd_elfNN_bfd_final_link): Define.
567         (bfd_elfNN_print_symbol): Define.
568         * elfcode.h: Don't include elflink.h.
569         (elf_bfd_discard_info, elf_reloc_symbol_deleted_p,
570         elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections,
571         elf_gc_common_finalize_got_offsets, elf_gc_common_final_link,
572         elf_gc_record_vtinherit, elf_gc_record_vtentry,
573         elf_link_record_local_dynamic_symbol): Don't define.
574         * elflink.c: Update for changed function names.  Move elflink.h
575         code here.
576         * elflink.h: Delete file.
577         * po/SRC-POTFILES.in: Regenerate.
578         * po/bfd.pot: Regenerate.
579
580 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
581
582         * elf64-mmix.c (mmix_elf_relocate_section): Restore code setting
583         "name" for global syms accidentally removed in 2004-03-20 change.
584
585 2004-03-27  Alan Modra  <amodra@bigpond.net.au>
586
587         * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field.
588         * elflink.h: Replace all occurrences of sizeof (Elf_External_*)
589         where Elf_External_* is different for 64 and 32 bit, with
590         corresponding elf_size_info field.
591         (struct elf_final_link_info): Use "bfd_byte *" instead
592         of "Elf_External_Sym *" for external_syms and symbuf.
593         (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local
594         vars and use instead of ELF_R_INFO and ELF_R_TYPE macros.
595         (struct elf_link_sort_rela): Add "sym_mask" alias for "offset".
596         (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM.
597         (elf_link_sort_cmp2): Adjust.
598         (elf_link_sort_relocs): Set up r_sym_mask local var instead of
599         using ELF_R_SYM macro.  Set u.sym_mask.
600         (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro
601         version, elf_stringtab_init.  Ditto for bfd_section_from_elf_index
602         vs. section_from_elf_index.  Adjust Elf_External_Sym pointer
603         arithmetic.  Pass bed to elf_link_flush_output_syms.  Adjust
604         Elf_External_Dyn pointer arithmentic.  Use bed swap_dyn_in and
605         swap_syn_out functions.  Rearrange dyn swap in/out switch.
606         (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic.
607         Pass bed to elf_link_flush_output_syms.  Use bed swap_symbol_out.
608         (elf_link_flush_output_syms): Add elf_backend_data arg.
609         (elf_link_check_versioned_symbol): Likewise.
610         (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol.
611         Adjust Elf_External_Sym pointer arithmetic.  Use bed swap_symbol_out.
612         (elf_link_input_bfd): Use bfd_section_from_elf_index.  Set up
613         r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM,
614         ELF_R_TYPE and ELF_R_INFO macros.
615         (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation
616         based on size rather than using ELF_R_INFO.
617         (elf_gc_mark): Set up r_sym_shift local var and use instead of
618         ELF_R_SYM macro.
619         (struct alloc_got_off_arg): New.
620         (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of
621         ARCH_SIZE.  Pass get entry size down to elf_gc_allocate_got_offsets.
622         (elf_gc_allocate_got_offsets): Adjust.
623         (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of
624         ELF_R_SYM.  Use bfd_section_from_elf_index.
625         (elf_bfd_discard_info): Set cookie.r_sym_shift.
626         * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete.
627         (elf_slurp_symbol_table): Use bfd_section_from_elf_index.
628
629 2004-03-26  Stan Shebs  <shebs@apple.com>
630
631         Remove MPW support, no longer used.
632         * config.bfd (powerpc-*-mpw*): Remove configuration.
633         * mpw-config.in, mpw-make.sed: Remove files.
634         * ecoffswap.h [MPW_C]: Remove MPW-C-friendly version of code.
635
636 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
637
638         * elf64-ppc.c (elf_backend_add_symbol_hook): Define.
639         (ppc64_elf_add_symbol_hook): New function.
640         * elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
641         const from Elf_Internal_Sym param.
642         * elflink.c (elf_link_add_object_symbols): Adjust.
643         * elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
644         * elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
645         * elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
646         * elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
647         * elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
648         * elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
649         * elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
650         * elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
651         * elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
652         * elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
653         * elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
654         * elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
655         * elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
656         * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
657         * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
658         * elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
659
660 2004-03-26  Alan Modra  <amodra@bigpond.net.au>
661
662         * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.
663         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete.
664         (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete.
665         (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete.
666         (bfd_elf64_bfd_link_add_symbols): Delete.
667         (bfd_elf_link_add_symbols): Declare.
668         * elfcode.h (elf_bfd_link_add_symbols): Delete.
669         * elflink.c: Include safe-ctype.h.
670         (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag,
671         make static.
672         (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static.
673         (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make
674         static.
675         (elf_link_add_archive_symbols): Rename from
676         _bfd_elf_link_add_archive_symbols, make static.
677         (elf_link_add_object_symbols): New function.  Corresponding
678         elflink.h function converted to use elf_size_info.
679         (bfd_elf_link_add_symbols): Likewise.
680         (bfd_elf_size_dynamic_sections): Adjust.
681         * elflink.h (elf_bfd_link_add_symbols): Delete.
682         (elf_link_add_object_symbols): Delete.
683         * elf32-gen.c (elf32_generic_link_add_symbols): Call
684         bfd_elf_link_add_symbols.
685         * elf64-gen.c (elf64_generic_link_add_symbols): Likewise.
686
687 2004-03-25  Alan Modra  <amodra@bigpond.net.au>
688
689         * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed
690         and chained shared libs only if dynsym.  Clear dynsym on forced-local.
691
692         * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare.
693         (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete.
694         (_bfd_elf_add_dt_needed_tag): Declare.
695         (_bfd_elf_sort_symbol): Declare.
696         (_bfd_elf_finalize_dynstr): Declare.
697         (RELOC_FOR_GLOBAL_SYM): Formatting.
698         * elfcode.h (elf_add_dynamic_entry): Delete.
699         * elflink.c (_bfd_elf_add_dynamic_entry): New function.  Corresponding
700         elflink.h function converted to use elf_size_info.
701         (_bfd_elf_add_dt_needed_tag): Likewise.
702         (_bfd_elf_sort_symbol): Likewise.
703         (_bfd_elf_finalize_dynstr): Likewise.
704         (compute_bucket_count): Likewise.
705         (bfd_elf_size_dynamic_sections): Likewise.  Check result of
706         _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref.
707         (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from..
708         * elflink.h: ..here.
709         (sort_symbol, add_dt_needed_tag): Delete.
710         (elf_add_dynamic_entry, elf_finalize_dynstr): Delete.
711         (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete.
712         Update all users.
713         * elf32-arm.h (add_dynamic_entry): Update.  Remove casts.
714         * elf32-cris.c (add_dynamic_entry): Likewise.
715         * elf32-hppa.c (add_dynamic_entry): Likewise.
716         * elf32-i370.c (add_dynamic_entry): Likewise.
717         * elf32-i386.c (add_dynamic_entry): Likewise.
718         * elf32-m32r.c (add_dynamic_entry): Likewise.
719         * elf32-m68k.c (add_dynamic_entry): Likewise.
720         * elf32-ppc.c (add_dynamic_entry): Likewise.
721         * elf32-s390.c (add_dynamic_entry): Likewise.
722         * elf32-sh.c (add_dynamic_entry): Likewise.
723         * elf32-sparc.c (add_dynamic_entry): Likewise.
724         * elf32-vax.c (add_dynamic_entry): Likewise.
725         * elf32-xtensa.c (add_dynamic_entry): Likewise.
726         * elf64-alpha.c (add_dynamic_entry): Likewise.
727         * elf64-hppa.c (add_dynamic_entry): Likewise.
728         * elf64-ppc.c (add_dynamic_entry): Likewise.
729         * elf64-s390.c (add_dynamic_entry): Likewise.
730         * elf64-sparc.c (add_dynamic_entry): Likewise.
731         * elf64-x86-64.c (add_dynamic_entry): Likewise.
732         * elfxx-ia64.c (add_dynamic_entry): Likewise.
733         * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
734         * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
735         * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise.
736         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
737
738 2004-03-23  Paul Brook  <paul@codesourcery.com>
739
740         * elf32-arm.h (arm_print_private_bfd_data): Add EABI v3.
741
742 2004-03-22  Bob Wilson  <bob.wilson@acm.org>
743
744         * elf32-xtensa.c (elf_xtensa_check_relocs): Remove code to read
745         literal tables and check for relocs outside of literal pools.
746         (elf_xtensa_make_sym_local): Don't clear ELF_LINK_NON_GOT_REF flag.
747         (elf_xtensa_fix_refcounts): Don't check ELF_LINK_NON_GOT_REF or
748         set DF_TEXTREL.
749         (elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry.
750         (elf_xtensa_relocate_section): Read literal tables and check for
751         dynamic relocations in read-only sections and not in literal pools.
752
753 2004-03-23  Alan Modra  <amodra@bigpond.net.au>
754
755         PR 51.
756         * linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char.
757
758 2004-03-22  Hans-Peter Nilsson  <hp@axis.com>
759
760         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_GOTPLT,
761         R_CRIS_16_GOTPLT>: Also error if there's no PLT for a symbol
762         not defined by the executable, or defined in a DSO.
763         <eliding run-time relocation of .got>: Initialize GOT entry for a
764         function symbol or ELF_LINK_HASH_NEEDS_PLT statically in an
765         executable.
766         (cris_elf_gc_sweep_hook): Improve fallthrough marking.
767         (elf_cris_try_fold_plt_to_got): Improve head comment.  Do not fold
768         a PLT reloc to GOT for an executable.
769         (elf_cris_adjust_dynamic_symbol): Only fold a .got.plt entry with
770         .got for a DSO and explain why.
771         (elf_cris_discard_excess_program_dynamics): Also lose GOT-relocs
772         and unreferenced symbols for which a PLT is defined.  Adjust
773         dynamic-symbol pruning correspondingly, to make sure we don't lose
774         a dynamic symbol also defined by a DSO.
775
776 2004-03-22  Alan Modra  <amodra@bigpond.net.au>
777
778         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add input_bfd, input_section
779         and rel args.  Group input and output args.  Wrap to 80 columns.
780         * elf-m10200.c, elf-m10300.c, elf32-arm.h, elf32-avr.c,
781         elf32-cris.c, elf32-d10v.c, elf32-fr30.c, elf32-h8300.c,
782         elf32-hppa.c, elf32-i386.c, elf32-i860.c, elf32-ip2k.c,
783         elf32-iq2000.c, elf32-m68hc1x.c, elf32-m68k.c, elf32-mcore.c,
784         elf32-msp430.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
785         elf32-sparc.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c,
786         elf32-xtensa.c, elf64-alpha.c, elf64-mmix.c, elf64-ppc.c,
787         elf64-s390.c, elf64-sparc.c, elf64-x86-64.c, elfxx-ia64.c: Update
788         RELOC_FOR_GLOBAL_SYMBOL invocation.
789
790 2004-03-20  H.J. Lu  <hongjiu.lu@intel.com>
791
792         * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if
793         unresolved symbols in objects aren't allowed.
794
795         * elf-hppa.h (elf_hppa_relocate_section): Properly handle
796         unresolved symbols.
797         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
798         (elf_hppa_unmark_useless_dynamic_symbols):
799         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
800         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
801         (elf32_hppa_relocate_section): Likewise.
802         * elf32-i370.c (i370_elf_relocate_section): Likewise.
803         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
804         * elf32-sh.c (sh_elf_relocate_section): Likewise.
805         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
806         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
807
808         * elf-m10200.c (mn10200_elf_relocate_section): Use
809         RELOC_FOR_GLOBAL_SYMBOL.
810         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
811         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
812         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
813         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
814         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
815         * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise.
816         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
817         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
818         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
819         * elf32-v850.c (v850_elf_relocate_section): Likewise.
820         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
821         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
822
823 2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
824
825         * elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32.
826         (final_link_relocate): Likewise.
827         * elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for
828         R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations.
829
830 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
831
832         * Makefile.am: Run "make dep-am".
833         * Makefile.in: Regenerate.
834         * aclocal.m4: Regenerate.
835         * config.in: Regenerate.
836         * po/bfd.pot: Regenerate.
837
838 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
839             H.J. Lu  <hongjiu.lu@intel.com>
840
841         * elflink.c (_bfd_elf_merge_symbol): Revert last change.  Move
842         type and size change code to where it was previously.  Remove
843         dt_needed param.  Treat old weak syms as strong if new sym is
844         from a shared lib, even when old sym is from another shared
845         lib.  Remove unnecessary tests of oldweak and newweak.  Correct
846         comments.
847         (_bfd_elf_add_default_symbol): Remove dt_needed param.  Update
848         _bfd_elf_merge_symbol calls.
849         * elflink.h (elf_link_add_object_symbols): Update calls.  Remove
850         dt_needed local var.  Update comments.
851         * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype.
852         (_bfd_elf_add_default_symbol): Likewise.
853
854         * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle
855         strong syms in one shared object overriding weak syms in another.
856
857 2004-03-18  Alan Modra  <amodra@bigpond.net.au>
858
859         * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field.  Add
860         dyn_lib_class field.  Rearrange for better packing.
861         (elf_dt_soname): Delete.
862         (elf_dyn_lib_class): Define.
863         * elf.c (bfd_elf_set_dt_needed_name): Update comment.
864         (bfd_elf_set_dt_needed_soname): Delete.
865         (bfd_elf_set_dyn_lib_class): New function.
866         * elflink.h (add_dt_needed_tag): New function.  Split out from..
867         (elf_link_add_object_symbols): ..here.  Rename "name" to "soname".
868         Use elf_dyn_lib_class to set dt_needed and add_needed.  Move fallback
869         initialization of soname.
870         (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of
871         elf_dt_soname.
872         * bfd-in.h (enum dynamic_lib_link_class): New.
873         (bfd_elf_set_dt_needed_soname): Delete.
874         (bfd_elf_set_dyn_lib_class): Declare.
875         * bfd-in2.h: Regenerate.
876
877         * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling.
878         (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs.
879         * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in
880         symbol loop.  Instead use add_needed to flag tag as written.
881
882 2004-03-17  Nathan Sidwell  <nathan@codesourcery.com>
883
884         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
885         logic for null_input_bfd detection.
886
887 2004-03-17  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
888
889         * config.bfd: Switch sh-*-rtems* to ELF.  Add sh-*-rtemscoff*.
890
891 2004-03-16  Mark Kettenis  <kettenis@gnu.org>
892
893         * netbsd-core.c (netbsd_core_file_p) [CORE_FPU_OFFSET]: Remove
894         code.
895
896 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
897
898         * elflink.c (elf_link_read_relocs_from_section): Don't use
899         NUM_SHDR_ENTRIES in end of reloc calc.  Move NULL shdr check..
900         (_bfd_elf_link_read_relocs): ..to here.
901         * elf32-ppc.c (ppc_elf_relax_section): Formatting.
902
903 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
904
905         * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override
906         values selected in configure.host.  Require both to be defined
907         before setting BFD_HOST_64_BIT_DEFINED.  Protect assignment to
908         corresponding BFD_HOST vars with quotes.
909         <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc;
910         Always require BFD_HOST_64_BIT_DEFINED.
911         <file_ptr type>: Find off_t size before emitting message.  Combine
912         off_t and ftello64 conditional.
913         * configure: Regenerate.
914
915 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
916
917         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer
918         aliasing warning.  Remove trailing whitespace throughout file.
919
920 2004-03-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
921
922         * elf-hppa.h (elf_hppa_relocate_section): Pass input_bfd instead of
923         input_section in calls to get_dyn_name.
924         * 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
925         local symbols.
926         (elf64_hppa_check_relocs): Pass abfd in call to get_dyn_name.
927
928 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
929
930         * bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
931         (BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here.
932         (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t.
933         (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t.
934         (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t.
935         * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8.
936         (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set
937         when using long.
938         * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t.
939         (bfd_getb64): Return bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
940         (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
941         (bfd_putb64): Accept bfd_uint64_t.  Enable when BFD_HOST_64_BIT.
942         (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise.
943         * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t.
944         (read_8_bytes, read_indirect_string, read_address): Likewise.
945         (read_abbrevs, parse_comp_unit): Likewise.
946         * targets.c (struct bfd_target): Likewise.
947         * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use.
948         * hppabsd-core.c: Likewise.  Formatting.
949         * hpux-core.c: Likewise.
950         * irix-core.c: Likewise.
951         * netbsd-core.c: Likewise.
952         * osf-core.c: Likewise.
953         * ptrace-core.c: Likewise.
954         * sco5-core.c: Likewise.
955         * trad-core.c: Likewise.
956         * configure: Regenerate.
957         * bfd-in2.h: Regenerate.
958
959 2004-03-15  Alan Modra  <amodra@bigpond.net.au>
960
961         * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
962         (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
963         (bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
964         (bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
965         (bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
966         (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
967         (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
968         * libbfd.c: Likewise in function definitions.
969         (bfd_put_8): Mask with 0xff rather than casting to char.
970         (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
971         (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
972         (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
973         (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
974         (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
975         (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
976         * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
977         (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
978         (H_GET_64, H_GET_32, H_GET_16): Likewise.
979         (H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
980         * archive.c (do_slurp_coff_armap): Update swap prototype.
981         * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
982         (tic54x_getl_signed_32): Likewise.
983         (tic54x_putl32): Likewise.  Mask with 0xff rather than casting to char.
984         * mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
985         * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
986         (bfd_getp_signed_32, bfd_putp32): Likewise.
987         * targets.c (struct bfd_target): Use void* in place of bfd_byte* for
988         bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
989         bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
990         bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
991         bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
992         bfd_h_getx_signed_16, bfd_h_putx16.
993         * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
994         * hppabsd-core.c: Similarly.  Rename NO_SIGNED_GET to NO_GETS.
995         * hpux-core.c: Likewise.
996         * irix-core.c: Likewise.
997         * netbsd-core.c: Likewise.
998         * osf-core.c: Likewise.
999         * ptrace-core.c: Likewise.
1000         * sco5-core.c: Likewise.
1001         * trad-core.c: Likewise.
1002         * bfd-in2.h: Regenerate.
1003
1004 2004-03-15  Matt Thomas  <matt@3am-software.com>
1005
1006         * config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is
1007         selected.
1008
1009 2004-03-13  Mark Kettenis  <kettenis@gnu.org>
1010
1011         * config.bfd: Add x86_64-*-openbsd*.
1012         * configure.in (x86_64-*-openbsd*): Set COREFILE to
1013         netbsd-core.lo.
1014         * configure: Regenerate.
1015
1016 2004-03-12  Nick Clifton  <nickc@redhat.com>
1017             Dave Murphy  <wintermute2k4@ntlworld.com>
1018
1019         * elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks
1020         if the input bfd does not contain any code.
1021
1022 2004-03-09  Steve Ellcey  <sje@cup.hp.com>
1023
1024         * elfxx-ia64.c (plt_full_entry): Change ld8 to ld8.acq.
1025
1026 2004-03-05  Fred Fish  <fnf@redhat.com>
1027
1028         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Just force
1029         mips16 symbols to be even rather than testing first for even/odd.
1030         (_bfd_mips_elf_link_output_symbol_hook): Ditto.
1031
1032 2004-03-05  Nathan Sidwell  <nathan@codesourcery.com>
1033
1034         * elf.c (map_sections_to_segments): Ignore .tbss sections for
1035         layout purposes.
1036
1037 2004-03-03  Alexandre Oliva  <aoliva@redhat.com>
1038
1039         * elflink.c (bfd_elf_record_link_assignment): Mark undefweak and
1040         undefined symbols as hash_new.
1041
1042 2003-03-03  Andrew Stubbs  <andrew.stubbs@superh.com>
1043
1044         * archures.c: Add bfd_mach_sh4_nommu_nofpu.
1045         * cpu-sh.c: Ditto.
1046         * elf32-sh.c: Ditto.
1047         * bfd-in2.h: Regenerate.
1048
1049 2004-03-02  Alexandre Oliva  <aoliva@redhat.com>
1050
1051         * elf32-frv.c (struct frv_pic_relocs_info): Added fixups and
1052         dynrelocs.
1053         (_frv_count_got_plt_entries): Initialize them.
1054         (frv_pic_relocs_info_find): Add insert argument.  Adjust all
1055         callers.
1056         (frv_pic_relocs_info_for_global): Likewise.
1057         (frv_pic_relocs_info_for_local): Likewise.
1058         (frv_pic_merge_early_relocs_info): New.
1059         (_frv_resolve_final_relocs_info): Use it in case one entry maps to
1060         another.
1061         (_frv_add_dyn_reloc): Add entry argument.  Adjust all callers.
1062         Check that we don't exceed the allocated count for entry.
1063         (_frv_add_rofixup): Likewise.
1064         (_frv_emit_got_relocs_plt_entries): Adjust for coding standards.
1065         (elf32_frv_finish_dynamic_sections): Improve error message in case
1066         we emit too few rofixup entries.
1067
1068 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
1069
1070         * archures.c (bfd_mach_fr450): New.
1071         * bfd-in2.h: Regenerate.
1072         * cpu-frv.c (arch_info_450): New bfd_arch_info_type.
1073         (arch_info_500): Link to it.
1074         * elf32-frv.c (elf32_frv_machine, frv_elf_merge_private_bfd_data)
1075         (frv_elf_print_private_bfd_data): Handle fr405 and fr450 header flags.
1076         (frv_elf_arch_extension_p): New function.
1077         (frv_elf_merge_private_bfd_data): Use it.
1078
1079 2004-02-28  H.J. Lu  <hongjiu.lu@intel.com>
1080
1081         * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype.
1082
1083         * elflink.h (is_global_data_symbol_definition): Moved to
1084         elflink.c.
1085         (elf_link_is_defined_archive_symbol): Likewise.
1086         (elf_link_add_archive_symbols): Likewise. Renamed to
1087         _bfd_elf_link_add_archive_symbols.
1088
1089         * elflink.c (elf_link_is_defined_archive_symbol): Get the size
1090         of ELF symbol table entry from backend.
1091         (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols
1092         instead of elf_link_add_object_symbols.
1093
1094 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
1095
1096         * elf-bfd.h (struct elf_backend_data): Added
1097         elf_backend_can_make_relative_eh_frame,
1098         elf_backend_can_make_lsda_relative_eh_frame and
1099         elf_backend_encode_eh_address.
1100         (_bfd_elf_encode_eh_address): Declare.
1101         (_bfd_elf_can_make_relative): Declare.
1102         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new
1103         hooks to decide whether to attempt to make_relative and
1104         make_lsda_relative.
1105         (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address.
1106         (_bfd_elf_can_make_relative): New.
1107         (_bfd_elf_encode_eh_address): New.
1108         * elf32-frv.c (frv_elf_use_relative_eh_frame): New.
1109         (frv_elf_encode_eh_address): New.
1110         (elf_backend_can_make_relative_eh_frame): Define.
1111         (elf_backend_can_make_lsda_relative_eh_frame): Define.
1112         (elf_backend_encode_eh_address): Define.
1113         * elfxx-target.h
1114         (elf_backend_can_make_relative_eh_frame): Define.
1115         (elf_backend_can_make_lsda_relative_eh_frame): Define.
1116         (elf_backend_encode_eh_address): Define.
1117         (elfNN_bed): Add them.
1118
1119 2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
1120
1121         * elf32-frv.c (elf32_frv_howto_table) <R_FRV_LABEL16>: Set
1122         complain_on_overflow to signed.
1123
1124 2004-02-27  H.J. Lu  <hongjiu.lu@intel.com>
1125
1126         * elflink.h (sort_symbol): New.
1127         (elf_link_add_object_symbols): Use a sorted symbol array for
1128         weakdef.
1129
1130 2004-02-27  Jakub Jelinek  <jakub@redhat.com>
1131
1132         * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
1133         for pc relative relocs.
1134         (elf_s390_relocate_section): Likewise.
1135         * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
1136         for pc relative relocs.
1137         (elf_s390_relocate_section): Likewise.
1138
1139 2004-02-26  H.J. Lu  <hongjiu.lu@intel.com>
1140
1141         * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to
1142         count_dyn_reloc.
1143
1144 2004-02-25  H.J. Lu  <hongjiu.lu@intel.com>
1145
1146         * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
1147         field to track if a relocation is against readonly section.
1148         (count_dyn_reloc): Take a new argument for rent->reltext.
1149         (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
1150         (get_reloc_section): Don't set ia64_info->reltext here.
1151         (allocate_dynrel_entries): Set ia64_info->reltext here.
1152
1153 2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
1154
1155         * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
1156         (_frv_emit_got_relocs_plt_entries): Decay relocation to protected
1157         function's descriptor to symbol+offset, and map local undefweak
1158         symbol to NULL function descriptor.
1159         (elf32_frv_relocate_section): Likewise.
1160
1161 2004-02-23  Mark Kettenis  <kettenis@gnu.org>
1162
1163         * libaout.h (enum machine_type): Add M_SPARC64_NETBSD and
1164         M_X86_64_NETBSD.
1165         * netbsd-core.c (M_SPARC64_OPENBSD): Define.
1166         (netbsd_core_file_p): Set architecture from machine ID for
1167         selected machines.
1168
1169 2004-02-23  Jakub Jelinek  <jakub@redhat.com>
1170
1171         * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
1172         DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
1173
1174 2004-02-21  H.J. Lu  <hongjiu.lu@intel.com>
1175
1176         * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined
1177         symbols with non-default visibility.
1178
1179 2004-02-21  Danny Smith  <daanysmith@users.sourceforge.net>
1180
1181         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
1182         IMAGE_SCN_MEM_WRITE on known sections only.
1183
1184 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1185
1186         * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
1187         symbols used in PIE relocs.
1188
1189 2004-02-19  Jakub Jelinek  <jakub@redhat.com>
1190
1191         * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear
1192         .plt sh_entsize.
1193
1194 2004-02-18  Daniel Jacobowitz  <drow@mvista.com>
1195
1196         * configure.in: Update version to 2.15.90.
1197         * configure: Regenerate.
1198
1199 2004-02-17  Daniel Jacobowitz  <drow@mvista.com>
1200             Richard Sandiford  <rsandifo@redhat.com>
1201
1202         * elfxx-mips.c (mips_elf_calculate_relocation): Use
1203         _bfd_elf_symbol_refs_local_p to decide whether to decay
1204         a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend.
1205         (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE
1206         relocs if the symbol wasn't defined by a regular object file.
1207         Don't check the symbol's dynindx.
1208
1209 2004-02-16  Andrew Cagney  <cagney@redhat.com>
1210
1211         * bfd-in.h (file_ptr, ufile_ptr): Configure type using
1212         @bfd_file_ptr@.
1213         * bfd-in2.h: Re-generate.
1214
1215 2004-02-14  Andrew Cagney  <cagney@redhat.com>
1216
1217         * configure.host (HDEFINES): When hppa*-*-hpux*, define
1218         _LARGEFILE64_SOURCE.
1219
1220 2004-02-13  Andrew Cagney  <cagney@redhat.com>
1221
1222         * elf.c (vma_page_aligned_bias): New function.
1223         (assign_file_positions_except_relocs)
1224         (assign_file_positions_for_segments): Replace broken modulo
1225         arithmetic with call to vma_page_aligned_bias.
1226
1227 2004-02-11  Andrew Cagney  <cagney@redhat.com>
1228
1229         * bfd-in.h: Update copyright.
1230         (bfd_tell): Change return type to file_ptr.
1231         * bfd-in2.h: Re-generate.
1232         * cache.c: Update copyright.
1233         (bfd_cache_lookup_worker): Use real_fseek, do not cast offset
1234         parameter.
1235         (close_one): Use real_ftell.
1236         * bfdio.c: Update copyright.
1237         (real_ftell, real_fseek): New functions.
1238         (bfd_tell): Use real_fseek and real_ftell, change return type to
1239         file_ptr.
1240         (bfd_seek): Use real_ftell and real_fseek, change type of
1241         file_position to a file_ptr.
1242         * libbfd-in.h: Update copyright.
1243         (real_ftell, real_fseek): Declare.
1244         * libbfd.h: Re-generate.
1245
1246         * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64,
1247         fseeko and fseeko64.  Determine bfd_file_ptr.
1248         * configure: Re-generate.
1249         * config.in: Re-generate.
1250
1251 2004-02-09  Anil Paranjpe  <anilp1@KPITCummins.com>
1252
1253         * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w.
1254         * elf32-h8300.c: Likewise.
1255
1256 2004-02-09  Christian Vogel <vogelchr@vogel.cx>
1257             Nick Clifton  <nickc@redhat.com>
1258
1259         * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
1260         GOT entries with no associated GOT subsection.
1261
1262 2004-02-09  Richard Sandiford  <rsandifo@redhat.com>
1263
1264         * bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
1265         * elf.c (swap_out_syms): Use it to decide whether local section
1266         symbols should be named.
1267         * elfxx-target.h (elf_backend_name_local_section_symbols): New macro.
1268         * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare.
1269         (elf_backend_name_local_section_symbols): Define.
1270         * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New.
1271
1272 2004-01-30  H.J. Lu  <hongjiu.lu@intel.com>
1273
1274         * elfxx-ia64.c (elfNN_ia64_relax_brl): New function.
1275         (elfNN_ia64_relax_section): Optimize brl to br during the relax
1276         finalize pass.
1277
1278 2004-01-30  Alexandre Oliva  <aoliva@redhat.com>
1279
1280         * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
1281         to bfd_link_hash_entry passed by reference to
1282         _bfd_generic_link_add_one_symbol.
1283
1284 2004-01-25  H.J. Lu  <hongjiu.lu@intel.com>
1285
1286         * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
1287         relocations against dynamic symbols.
1288
1289 2004-01-23  Daniel Jacobowitz  <drow@mvista.com>
1290
1291         * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
1292         change.
1293
1294 2004-01-21  Tom Rix  <tcrix@worldnet.att.net>
1295
1296         * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw.
1297         * bfd-in2.h, libbfd.h: Rebuilt.
1298
1299 2004-01-20  Danny Smith  <dannysmith@users.sourceforge.net>
1300
1301         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
1302         IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
1303         flag has been cleared.
1304
1305 2004-01-19  Kazu Hirata  <kazu@cs.umass.edu>
1306
1307         * coff-h8300.c: Add and adjust comments about relaxation.
1308         * elf32-h8300.c: Likewise.
1309
1310 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
1311
1312         * coff-h8300.c: Fix comment typos.
1313         * elf32-h8300.c: Likewise.
1314
1315 2004-01-16  Kazu Hirata  <kazu@cs.umass.edu>
1316
1317         * coff-h8300.c: Add comments about relaxation.
1318         * elf32-h8300.c: Likewise.
1319
1320 2004-01-14  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1321
1322         * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
1323         throughout.
1324         * aclocal.m4: Regenerate.
1325         * configure: Regenerate.
1326
1327 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
1328
1329         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call
1330         mips_elf64_rtype_to_howto instead of using howto_table.
1331
1332 2004-01-13  Daniel Jacobowitz  <drow@mvista.com>
1333
1334         * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
1335         the .plt section.
1336         (elf32_arm_check_relocs): Don't increment the PLT refcount for
1337         relocs which would not use the PLT.
1338
1339 2004-01-13  Alan Modra  <amodra@bigpond.net.au>
1340
1341         * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
1342         (ppc64_elf_gc_sweep_hook): Likewise.
1343         (ppc64_elf_size_dynamic_sections): Test for .plt directly.
1344
1345 2004-01-12  Anil Paranjpe  <anilp1@KPITCummins.com>
1346
1347         Adds linker relaxation support for bit manipulation insns like
1348         band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
1349         bst, btst, bxor.
1350         * elf32-h8300.c: Opcode for bit manipulation insn is checked in
1351         elf32_h8_relax_section function while relxation for aa:16 and aa:32.
1352         * coff-h8300.c: Opcode for bit manipulation insn is checked in
1353         h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
1354
1355 2004-01-12  Alan Modra  <amodra@bigpond.net.au>
1356
1357         * dwarf2.c: Convert to C90, remove unneeded casts and prototypes.
1358
1359 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
1360
1361         * elf32-h8300.c: Fix formatting.
1362
1363 2004-01-11  Kazu Hirata  <kazu@cs.umass.edu>
1364
1365         * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no
1366         dynamic object is present.  Declare r_symndx and h in an inner
1367         scope.
1368         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
1369
1370 2004-01-09  Daniel Jacobowitz  <drow@mvista.com>
1371
1372         * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count.
1373         (elf32_arm_copy_indirect_symbol): Don't copy pc_count.
1374         (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs
1375         identically.  Do not emit PC24 relocations for shared libraries.
1376         (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs
1377         identically.  Don't adjust pc_count.
1378         (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically.
1379         Set ELF_LINK_HASH_NEEDS_PLT for both.  Don't adjust pc_count; don't
1380         adjust count for branch relocations.
1381         (allocate_dynrelocs): Correct typo in call to
1382         WILL_CALL_FINISH_DYNAMIC_SYMBOL.  Never allocate space for
1383         PC24 or PLT32 relocs when linking.
1384
1385 2004-01-09  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
1386
1387         * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D
1388         relocation howto with ARM_26 one for consistency.
1389         (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations
1390         that will be converted to ARM_26D ones, since we always want 'done'
1391         relocations to be reflected in section's data.
1392         (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction
1393         offset.
1394         (_bfd_final_link_relocate): Do not modify "inplace" data, if not
1395         requested.
1396
1397 2004-01-08  Dmitry Semyonov  <Dmitry.Semyonov@oktet.ru>
1398
1399         * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that
1400         are not partial_inplace during a relocatable link.
1401
1402 2004-01-08  Kazu Hirata  <kazu@cs.umass.edu>
1403
1404         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early
1405         if no dynamic object is present.  Declare r_symndx and h in an
1406         inner scope.
1407
1408 2004-01-07  H.J. Lu  <hongjiu.lu@intel.com>
1409
1410         * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install
1411         trampoline if it is known out of range.
1412
1413 2004-01-06  Alexandre Oliva  <aoliva@redhat.com>
1414
1415         2003-12-17  Alexandre Oliva  <aoliva@redhat.com>
1416         * elf32-frv.c (_frv_osec_readonly_p): New.
1417         (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for
1418         undefweak symbol.
1419         (_frv_count_got_plt_entries): Adjust expected count accordingly.
1420         (elf32_frv_relocate_section): Likewise.  Error out if attempting
1421         to emit rofixups or dynamic relocs in read-only segments.  Use
1422         _bfd_elf_section_offset to adjust r_offsets in rofixups and
1423         dynamic relocations.
1424         2003-12-12  Alexandre Oliva  <aoliva@redhat.com>
1425         * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic
1426         relocations or fixups involving merged sections correctly.  Avoid
1427         crash when undefined symbol is referenced by R_FRV_32 or
1428         R_FRV_FUNCDESC_VALUE.
1429         2003-12-02  Alexandre Oliva  <aoliva@redhat.com>
1430         * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of
1431         input section holding local symbol to addend of R_FRV_32 or
1432         R_FRV_FUNCDESC_VALUE dynamic relocation.
1433         2003-11-27  Alexandre Oliva  <aoliva@redhat.com>
1434         * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg.
1435         (elf32_frv_always_size_sections): Don't store pointer to
1436         __stacksize symbol in sec_info.
1437         (elf32_frv_modify_segment_map): Look it up here.
1438         2003-11-26  Alexandre Oliva  <aoliva@redhat.com>
1439         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address
1440         of the lazy PLT entry, not only its offset, as the low word of a
1441         function descriptor.
1442         2003-11-10  Alexandre Oliva  <aoliva@redhat.com>
1443         * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize
1444         if a hash table entry already exists but is not a definition.
1445         2003-11-05  Alexandre Oliva  <aoliva@redhat.com>
1446         * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc.
1447         (_frv_add_rofixup): Don't inline.
1448         (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address
1449         for undefweak symbols.
1450         (elf32_frv_relocate_section): Avoid crash while computing
1451         relocation when linking with shared library.  Only emit rofixups
1452         and dynamic relocations for alloc&load sections.  Mark binaries
1453         with inter-segment relocations for relocation as a unit.
1454         (_frv_create_got_section): Rename .rofixup.got to .rofixup.
1455         (DEFAULT_STACK_SIZE): New.
1456         (_frv_count_got_plt_entries): Fix thinko in deciding whether to
1457         emit rofixups or dynamic relocs when linking dynamic non-PIE
1458         executables.
1459         (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and
1460         shared libs too.  Reserve the last entry for the GOT pointer.
1461         (elf32_frv_finish_dynamic_sections): Emit it.
1462         (elf32_frv_always_size_sections): New.
1463         (elf32_frv_modify_segment_map): New.
1464         (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC
1465         sections.
1466         (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set.
1467         (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC.
1468         (elf_backend_always_size_sections): New.
1469         (elf_backend_modify_segment_map): New.
1470         2003-10-31  Alexandre Oliva  <aoliva@redhat.com>
1471         * config.bfd: Added frv-*-*linux*.
1472         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for
1473         ABS section, instead of crashing.
1474         (elf32_frv_relocate_section): Don't crash before warning about
1475         different segments in non-PIC relocation.
1476         2003-10-17  Alexandre Oliva  <aoliva@redhat.com>
1477         * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24
1478         relocs to undefweak symbols.
1479         (elf32_frv_relocate_section): Ditto for undefined symbols.
1480         2003-10-06  Alexandre Oliva  <aoliva@redhat.com>
1481         * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure
1482         gotfixup section was created.
1483         2003-09-30  Alexandre Oliva  <aoliva@redhat.com>
1484         * elf32-frv.c (elf32_frv_howto_table): Change GOT12,
1485         FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to
1486         complain_overflow_signed.
1487         * elf32-frv.c (_frv_add_rofixup): Do not error out if contents
1488         have not been allocated.
1489         (_frv_emit_got_relocs_plt_entries): Return non-void.  Assert
1490         privfd only if dynamic sections were created.
1491         (elf32_frv_relocate_section): Compute gprel_segment, and use it
1492         for GPREL relocs.  When linking relocatable FDPIC executables,
1493         emit warnings for relocations that would be illegal on PIE or
1494         shared libraries.  Emit rofixup for R_FRV_32 only if input object
1495         is not FDPIC.
1496         (_frv_create_got_section): Define _gp symbol in the rofixup
1497         section.
1498         (elf32_frv_finish_dynamic_sections): If rofixups needed but
1499         dynamic sections missing, error out requesting -melf32frvfd.
1500         2003-09-19  Alexandre Oliva  <aoliva@redhat.com>
1501         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange
1502         computation of addends from section and global or local symbol
1503         value.  Change return type to bfd_boolean, and return a failure if
1504         a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a
1505         nonzero addend is required.
1506         (elf32_frv_relocate_section): Likewise.  Print error for
1507         unsupported nonzero addends.
1508         2003-09-18  Alexandre Oliva  <aoliva@redhat.com>
1509         * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections,
1510         force everything local.
1511         (_frv_emit_got_relocs_plt_entries): Cope with NULL sec.
1512         * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup.
1513         (frv_gotfixup_section): New.
1514         (FRV_SYM_LOCAL): Accept undefweak and local common symbols.
1515         (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd
1516         and relocsfdv.
1517         (_frv_add_rofixup): New.
1518         (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE
1519         fdpic executables.  Use FRV_SYM_LOCAL more widely to simplify and
1520         improve some ugly conditions.
1521         (elf32_frv_relocate_section): Likewise.  Reject inter-segment
1522         relocations in fdpic.
1523         (_frv_create_got_section): Create .rofixup.got section.
1524         (struct _frv_dynamic_got_info): Added fixups.
1525         (_frv_count_got_plt_entries): Account in-GOT relocations into
1526         relocs32, relocsfd and relocsfdv.  Account them into relocs or
1527         fixups, as appropriate.
1528         (elf32_frv_size_dynamic_sections): Size rofixup section.  Simplify
1529         sizing of gotrel.
1530         (elf32_frv_finish_dynamic_sections): Verify that the right number
1531         of relocations and fixups was generated.
1532         (elf32_frv_check_relocs): Compute relocs32, relocsfd and
1533         relocsfdv.
1534         * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of
1535         SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL.
1536         (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function
1537         descriptor of a (formerly-)global symbol is local.
1538         (struct frv_pic_relocs_info): Adjust comments.
1539         (_frv_emit_got_relocs_plt_entries): Adjust.
1540         (elf32_frv_relocate_section): Likewise.
1541         (_frv_count_got_plt_entries): Likewise.
1542         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global
1543         symbol's value to addend in the common preamble.  Decay dynamic
1544         symbols to section+offset if they bind or call locally, for GOT
1545         and FUNCDESC_VALUE, respectively.
1546         (elf32_frv_relocate_section): Likewise.
1547         (elf32_frv_check_relocs): Don't register as dynamic symbols of
1548         internal or hidden visibility.
1549         2003-09-17  Alexandre Oliva  <aoliva@redhat.com>
1550         * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as
1551         argument, so as to not call _bfd_elf_rel_local_sym to compute it.
1552         (elf32_frv_relocate_section): Pass relocation addend in.  Use
1553         original relocation addend to look up the got relocs/plt entries
1554         table.  Do not call _bfd_elf_rel_local_sym.  Don't error out when
1555         processing relocations that reference .scommon symbols.
1556         2003-09-15  Alexandre Oliva  <aoliva@redhat.com>
1557         Introduce support for dynamic linking.
1558         * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits.
1559         (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto,
1560         elf32_frv_rel_funcdesc_value_howto): New REL descriptors.
1561         (frv_reloc_type_lookup): Return REL howtos for executables and
1562         dynamic libraries.
1563         (frv_info_to_howto_rel): New.
1564         (struct frv_elf_link_hash_table): New.
1565         (frv_hash_table, frv_got_section, frv_gotrel_section,
1566         frv_plt_section, frv_pltrel_section, frv_relocs_info,
1567         frv_got_initial_offset, frv_plt_initial_offset): New macros.
1568         (frv_elf_link_hash_table_create): New.
1569         (struct frv_pic_relocs_info): New.
1570         (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New.
1571         (frv_pic_relocs_info_find): New.
1572         (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local):
1573         New.
1574         (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New.
1575         (_frv_add_dyn_reloc, _frv_osec_to_segment): New.
1576         (_frv_emit_got_relocs_plt_entries): New.
1577         (elf32_frv_relocate_section): Add support for dynamic linking.
1578         Handle new relocations.
1579         (_frv_create_got_section): New.
1580         (elf32_frv_create_dynamic_sections): New.
1581         (ELF_DYNAMIC_INTERPRETER): New.
1582         (struct _frv_dynamic_got_info): New.
1583         (_frv_count_got_plt_entries): New.
1584         (struct _frv_dynamic_got_plt_info): New.
1585         (_frv_compute_got_alloc_data): New.
1586         (_frv_get_got_entry, _frv_get_fd_entry): New.
1587         (_frv_assign_got_entries, _frv_assign_plt_entries): New.
1588         (_frv_resolve_final_relocs_info): New.
1589         (elf32_frv_size_dynamic_sections): New.
1590         (elf32_frv_finish_dynamic_sections): New.
1591         (elf32_frv_adjust_dynamic_symbol): New.
1592         (elf32_frv_finish_dynamic_symbol): New.
1593         (elf32_frv_check_relocs): Handle new relocs.  Explain how the
1594         whole thing works.
1595         (elf_info_to_howto_rel): Define.
1596         (bfd_elf32_bfd_link_hash_table_create): Define.
1597         (elf_backend_create_dynamic_sections): Define.
1598         (elf_backend_adjust_dynamic_symbol): Define.
1599         (elf_backend_size_dynamic_sections): Define.
1600         (elf_backend_finish_dynamic_symbol): Define.
1601         (elf_backend_finish_dynamic_sections): Define.
1602         (elf_backend_want_got_sym): Define.
1603         (elf_backend_got_header_size): Define.
1604         (elf_backend_want_got_plt): Define.
1605         (elf_backend_plt_readonly): Define.
1606         (elf_backend_want_plt_sym): Define.
1607         (elf_backend_plt_header_size): Define.
1608         (elf_backend_may_use_rel_p): Define.
1609         (elf_backend_may_use_rela_p): Define.
1610         (elf_backend_default_use_rela_p): Define.
1611         2003-08-08  Alexandre Oliva  <aoliva@redhat.com>
1612         * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12,
1613         R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12,
1614         R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New.
1615         (frv_reloc_map): Map the corresponding BFD relocs to them.
1616         (frv_reloc_type_lookup): ... and back to BFD relocs.
1617         * reloc.c: New relocs.
1618         * bfd-in2.h, libbfd.h: Rebuilt.
1619         2003-08-04  Alexandre Oliva  <aoliva@redhat.com>
1620         * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
1621         R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
1622         R_FRV_FUNCDESC_GOTLO): New.
1623         (frv_reloc_map): Map the corresponding BFD relocs to them.
1624         (frv_reloc_type_lookup): ... and back to BFD relocs.
1625         * reloc.c: New relocs.
1626         * bfd-in2.h, libbfd.h: Rebuilt.
1627
1628 2004-01-05  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
1629
1630         * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
1631         targets to support pages of up to 64kB.
1632         (elf32_bed): Redefine to get a separate backend data structure for
1633         traditional targets.
1634         * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
1635         targets to support pages of up to 64kB.
1636         (elf64_bed): Redefine to get a separate backend data structure for
1637         traditional targets.
1638         * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
1639         targets to support pages of up to 64kB.
1640         (elf32_bed): Redefine to get a separate backend data structure for
1641         traditional targets.
1642
1643 2004-01-04  Mark Kettenis  <kettenis@gnu.org>
1644
1645         * elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
1646
1647 2004-01-02  Mark Kettenis  <kettenis@gnu.org>
1648
1649         * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD.
1650         (elf_i386_grok_psinfo): Likewise.
1651
1652 2004-01-02  Bernardo Innocenti  <bernie@develer.com>
1653
1654         * config.bfd: Add m68k-uClinux target.
1655
1656 2004-01-01  Grant Edwards <grante@visi.com>
1657
1658         * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored.
1659         * elf32-h8300.c (elf32_h8_gc_mark_hook): New function.
1660         (elf32_h8_gc_sweep_hook): New function.
1661         (elf_backend_gc_mark_hook): Define.
1662         (elf_backend_gc_sweep_hook): Define.
1663         (elf_backend_can_gc_sections): Define.
1664
1665 For older changes see ChangeLog-0203
1666 \f
1667 Local Variables:
1668 mode: change-log
1669 left-margin: 8
1670 fill-column: 74
1671 version-control: never
1672 End: