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