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