* elf32-mips.c (elf_backend_write_section): Define.
[external/binutils.git] / bfd / ChangeLog
1 2008-07-24  Daniel Jacobowitz  <dan@codesourcery.com>
2
3         * elf32-mips.c (elf_backend_write_section): Define.
4
5 2008-07-24  Nick Clifton  <nickc@redhat.com>
6
7         * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
8         error assigning sections to segments.
9
10 2008-07-22  Nick Clifton  <nickc@redhat.com>
11
12         * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
13         adjoining pages to be included in the same segment.
14
15 2008-07-22  Simon Baldwin  <simonb@google.com>
16
17         * elflink.c (elf_link_output_extsym): Set st_size to zero for
18         symbols from dynamic libraries.
19
20 2008-07-21  H.J. Lu  <hongjiu.lu@intel.com>
21
22         PR ld/4424
23         * elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
24         to check if 2 inputs are compatible.
25
26 2008-07-21  Sterling Augustine  <sterling@tensilica.com>
27
28         * elf.c (assign_file_positions_for_load_sections): Print vma in
29         error message about overlapping section vmas.
30
31 2008-07-21  H.J. Lu  <hongjiu.lu@intel.com>
32
33         PR ld/6747
34         * elf32-frv.c (elf32_frv_relocate_section): Revert the change
35         for PR ld/6446 checked in by accident on May 21, 2008.
36
37 2008-07-21  Nick Clifton  <nickc@redhat.com>
38
39         * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
40         COFF_WITH_PE based SH ports.
41         * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
42         * arm-wince-pe.c (bfd_pe_print_pdata): Use
43         _bfd_pe_print_ce_compressed_pdata.
44         (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
45         to...
46         * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
47         _bfd_XX_print_ce_compressed_pdata.
48
49 2008-07-21  Alan Modra  <amodra@bigpond.net.au>
50
51         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
52         unwanted zero terminators.
53
54 2008-07-21  Alan Modra  <amodra@bigpond.net.au>
55
56         * elf32-spu.c (spu_elf_relocate_section): Expand
57         RELOC_FOR_GLOBAL_SYMBOL.  Don't warn about undefined symbols for
58         R_SPU_PPU32 and R_SPU_PPU64 relocations.
59
60 2008-07-21  Luis Machado  <luisgpm@br.ibm.com>
61
62         * elf-bfd.h: Declare elfcore_write_ppc_vsx.
63         * elf.c (elfcore_grok_ppc_vsx): New function.
64         (elfcore_write_ppc_vsx): New function
65         (elfcore_grok_note): Handle VSX notes.
66         (elfcore_write_register_note): Handle VSX notes.
67
68 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
69
70         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
71         * bfd-in2.h: Regenerate.
72         * elf32-arm.c (struct elf_arm_obj_tdata): Add field
73         no_wchar_size_warning.
74         (bfd_elf32_arm_set_target_relocs): Add new parameter
75         no_wchar_warn.
76         (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
77         for conflicting wchar_t attributes.  Do not warn if
78         --no-wchar-size-warning.  Make diagnostic text more specific.
79
80 2008-07-18  H.J. Lu  <hongjiu.lu@intel.com>
81
82         PR ld/6748
83         * elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
84         new fields added for ARM long call support.
85
86 2008-07-18  Danny Backx  <dannybackx@users.sourceforge.net>
87
88         * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
89         print compressed pdata structure as described on MSDN. This only
90         applies to a limited set of architectures (ARM, SH4).
91         (slurp_symtab, my_symbol_for_address): Define static helper
92         functions for pe_print_compressed_pdata.
93         * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
94         (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
95         * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
96         bfd_coff_backend_data, call the function if non-null.
97         * pei-mcore.c: Add target dependent initialisation for
98         bfd_coff_backend_data.
99         * coff-sh.c: Likewise.
100         * coff64-rs6000.c: Likewise.
101         * coff-rs6000.c: Likewise.
102         * libcoff-in.h: Likewise.
103         * cf-i386lynx.c: Likewise.
104         * coff-alpha.c: Likewise.
105         * coff-apollo.c: Likewise.
106         * coff-arm.c: Likewise.
107         * coff-aux.c: Likewise.
108         * coff-h8300.c: Likewise.
109         * coff-h8500.c: Likewise.
110         * coff-i386.c: Likewise.
111         * coff-i860.c: Likewise.
112         * coff-i960.c: Likewise.
113         * coff-ia64.c: Likewise.
114         * coff-m68k.c: Likewise.
115         * coff-m88k.c: Likewise.
116         * coff-maxq.c: Likewise.
117         * coff-mips.c: Likewise.
118         * coff-or32.c: Likewise.
119         * coff-sparc.c: Likewise.
120         * coff-tic30.c: Likewise.
121         * coff-tic4x.c: Likewise.
122         * coff-tic54x.c: Likewise.
123         * coff-tic80.c: Likewise.
124         * coff-w65.c: Likewise.
125         * coff-we32k.c: Likewise.
126         * coff-x86_64.c: Likewise.
127         * coff-z80.c: Likewise.
128         * coff-z8k.c: Likewise.
129         * pe-mcore.c: Likewise.
130         * pe-mips.c: Likewise.
131         * pe-ppc.c: Likewise.
132         * peXXigen.c: Likewise.
133         * pei-ppc.c: Likewise.
134         * libcoff.h: Regenerate.
135
136 2008-07-16  Bernd Schmidt  <bernd.schmidt@analog.com>
137
138         * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
139         bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
140         ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
141         struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
142         separate from non-FD-PIC.
143
144 2008-07-14  DJ Delorie  <dj@redhat.com>
145
146         * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
147         checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
148         relocs.
149         (mn10300_elf_relax_section): Correct jump offset check when target
150         is in a different section.
151
152 2008-07-15  Jie Zhang  <jie.zhang@analog.com>
153
154         * elf32-bfin.c (elf32_bfin_special_sections[]): New.
155         (elf_backend_special_sections): Define.
156
157 2008-07-13  Craig Silverstein  <csilvers@google.com>
158
159         PR binutils/6743
160         * dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
161         (find_line): Use info_ptr_memory instead of sec_info_ptr.
162         (_bfd_dwarf2_cleanup_debug_info): Likewise.
163
164 2008-07-12  Jie Zhang  <jie.zhang@analog.com>
165
166         Revert
167         2008-07-12  Jie Zhang  <jie.zhang@analog.com>
168         * elf.c (_bfd_elf_map_sections_to_segments): Don't put
169         executable sections into the same segment with other
170         read only sections if --sep-code.
171         * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
172         (elf32_bfin_data_in_l1): New variable.
173         (elf32_bfin_final_write_processing): New.
174         (elf32_bfin_special_sections[]): New.
175         (elf_backend_final_write_processing): Define.
176         (elf_backend_special_sections): Define.
177
178 2008-07-12  Jie Zhang  <jie.zhang@analog.com>
179
180         * elf.c (_bfd_elf_map_sections_to_segments): Don't put
181         executable sections into the same segment with other
182         read only sections if --sep-code.
183         * elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
184         (elf32_bfin_data_in_l1): New variable.
185         (elf32_bfin_final_write_processing): New.
186         (elf32_bfin_special_sections[]): New.
187         (elf_backend_final_write_processing): Define.
188         (elf_backend_special_sections): Define.
189
190 2008-07-11  Andreas Schwab  <schwab@suse.de>
191
192         * dwarf2.c (read_section): Take pointer to bfd_size_type instead
193         of unsigned long as last parameter.
194         (struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
195         dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
196         unsigned long.
197
198 2008-07-10  Richard Sandiford  <rdsandiford@googlemail.com>
199
200         * elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
201         for all relocation types.  Allow any type of relocation to refer to
202         __gnu_local_gp.
203
204 2008-07-10  Richard Sandiford  <rdsandiford@googlemail.com>
205
206         * elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
207         (mips_elf_calculate_relocation): Likewise.
208         (_bfd_mips_elf_add_symbol_hook): Likewise.
209         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
210         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
211
212 2008-07-10  Andreas Schwab  <schwab@suse.de>
213
214         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Add missing
215         paren.
216
217 2008-07-09  Craig Silverstein  <csilvers@google.com>
218
219         * Makefile.am (BFD32_LIBS): Add compress.lo.
220         (BFD32_LIBS_CFILES): Add compress.c.
221         (BFD_H_FILES): Likewise.
222         * Makefile.in: Regenerate.
223         * bfd-in2.h: Regenerate.
224         * config.in: Add HAVE_ZLIB_H
225         * configure.in: Add test for libz and zlib.h
226         * configure: Regenerate.
227         * dwarf2.c (read_section): New function.
228         (read_indirect_string): Call new function read_section.
229         (read_abbrevs): Likewise.
230         (decode_line_info): Likewise.
231         (read_debug_ranges): Likewise.
232         (find_line): Call new function read_section when just one
233         .zdebug_info section is found, otherwise read and compress
234         multiple sections.
235         (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
236         * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
237         (special_sections_z): New struct.
238         (special_sections): Refer to special_sections_z.
239         * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
240         sections named .zdebug_*.
241         (_bfd_mips_elf_fake_sections): Likewise.
242         * compress.c: New file.
243         (bfd_uncompress_section_contents): New function.
244
245 2008-07-07  Christophe Lyon  <christophe.lyon@st.com>
246
247         * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
248         the presence of a PLT.
249
250 2008-07-07  Alan Modra  <amodra@bigpond.net.au>
251
252         * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char.
253
254 2008-07-02  Alan Modra  <amodra@bigpond.net.au>
255
256         * elf32-ppc.c (is_pic_glink_stub): New function.
257         (ppc_elf_get_synthetic_symtab): Don't generate symbols when
258         multiple shared/pie stubs per plt entry.
259
260 2008-06-30  Richard Sandiford  <rdsandiford@googlemail.com>
261
262         * elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
263         bed->s->int_rels_per_ext_rel.
264
265 2008-06-30  Richard Sandiford  <rdsandiford@googlemail.com>
266
267         * syms.c (BSF_SYNTHETIC): New flag.
268         * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
269         * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
270         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
271         * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
272         for synthetic symbols.
273         * bfd-in2.h: Regenerate.
274
275 2008-06-30  Daniel Jacobowitz  <dan@codesourcery.com>
276
277         * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
278         Expand comments.
279         (arm_map_one_stub): Use | 1 when setting the low bit.
280
281 2008-06-29  Andreas Schwab  <schwab@suse.de>
282
283         * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
284         addend on _GLOBAL_OFFSET_TABLE_.
285
286 2008-06-24  Daniel Jacobowitz  <dan@codesourcery.com>
287
288         * elf32-arm.c (STUB_ENTRY_NAME): Define.
289         (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
290         (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
291         R_ARM_ABS32.
292         (struct elf32_arm_stub_hash_entry): Add output_name.
293         (arm_build_one_stub): Move offsets into the offset argument
294         of _bfd_final_link_relocate.  Correct offset for
295         arm_thumb_arm_v4t_stub_long_branch.
296         (elf32_arm_size_stubs): Set stub_entry->output_name.
297         (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
298         Update all callers.
299         (elf32_arm_output_stub_sym): New.
300         (arm_map_one_stub): Correct formatting.  Use elf32_arm_output_stub_sym.
301
302 2008-06-20  Alan Modra  <amodra@bigpond.net.au>
303
304         * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
305         non-branch insns.
306
307 2008-06-20  Alan Modra  <amodra@bigpond.net.au>
308
309         * elf32-spu.c (build_stub): Allow wraparound on stub branches.
310         (allocate_spuear_stubs, build_spuear_stubs): Return value from
311         count_stub/build_stub.
312         (spu_elf_build_stubs): Correct location of stub reloc error message.
313
314 2008-06-18  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
315
316         * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
317
318 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
319
320         * configure: Regenerate.
321
322 2008-06-17  Alan Modra  <amodra@bigpond.net.au>
323
324         * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
325         (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
326         (spu_elf_auto_overlay): Use it.
327         (RECURSE_UNMARK): Define as 0.
328         (unmark_overlay_section): Heed RECURSE_UNMARK.
329         * elf32-spu.h (spu_elf_check_vma): Update prototype.
330
331 2008-06-12  DJ Delorie  <dj@redhat.com>
332
333         * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
334
335 2008-06-09  Paul Brook  <paul@codesourcery.com>
336
337         bfd/
338         * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
339         libraries.
340
341 2008-06-09  Christophe Lyon  <christophe.lyon@st.com>
342
343         * elf32-arm.c (arm_stub_is_thumb): Define.
344         (elf32_arm_final_link_relocate): Handle near mode switching stubs.
345
346 2008-06-07  Alan Modra  <amodra@bigpond.net.au>
347
348         * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
349         to stack calculation.
350
351 2008-06-06  Paul Brook  <paul@codesourcery.com>
352
353         bfd/
354         * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
355
356 2008-06-06  Alan Modra  <amodra@bigpond.net.au>
357
358         * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
359         file names be unique.  Specify archive:path in overlay script.
360
361 2008-06-05  Alan Modra  <amodra@bigpond.net.au>
362
363         PR ld/6590
364         * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
365
366 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
367
368         * elf.c (ignore_section_sym): Don't test section sym value here.
369         (elf_map_symbols): Instead check zero value here as was done prior
370         to 2006-05-26 change.
371
372 2008-06-04  Nick Clifton  <nickc@redhat.com>
373
374         PR ld/6019
375         * elf32-avr.c (elf32_avr_relax_section): Handle the case where
376         there are no local symbols.
377
378 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
379
380         * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
381         (process_stubs): Likewise.
382         (discover_functions): Don't used cached symbols.
383         (maybe_insert_function): Correct condition under which function
384         array is realloc'd.
385         (mark_functions_via_relocs): Delete unused variable.
386
387 2008-05-30  Frediano Ziglio  <frediano.ziglio@vodafone.com>
388             Nick Clifton  <nickc@redhat.com>
389
390         PR ld/6511
391         * elf64-hppa.c (allocate_global_data_opd): Default to using the
392         dynamic symbol table for local function names in shared libraries.
393
394 2008-05-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
395
396         * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
397         gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
398
399 2008-05-28  Alan Modra  <amodra@bigpond.net.au>
400
401         * elf32-spu.c (spu_elf_object_p): New function.
402         (elf_backend_object_p): Define.
403         (build_stub): Correct second word of 8 byte overlay stubs.
404         (spu_elf_relocate_section): Formatting.
405
406 2008-05-24  Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>
407
408         * elf.c (elfcore_write_register_note): New function.
409         * elf-bfd.h (elfcore_write_register_note): New prototype.
410
411 2008-05-22  Christophe Lyon  <christophe.lyon@st.com>
412
413         * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
414         (elf32_arm_stub_add_mapping_symbol): Remove.
415         (elf32_arm_add_stub): Don't generate mapping symbols. Change
416         prototype.
417         (elf32_arm_size_stubs): Use new elf32_arm_add_stub
418         prototype. Don't generate thumb to arm glue for calls.
419         (arm_map_one_stub): Define.
420         (elf32_arm_output_arch_local_syms): Generate mapping symbols for
421         long calls stubs.
422
423 2008-05-21  Nick Clifton  <nickc@redhat.com>
424
425         * elf32-arm.c (group_sections): Reformat comments.
426
427         PR ld/6446
428         * elf32-frv.c (elf32_frv_relocate_section): Set EF_FRV_PIC by
429         default (for FDPIC). Clear it if any inter-segment relocations
430         are found.
431
432         * elf64-hppa.c (elf64_hppa_finalize_opd): Check NULL return
433         from elf_link_hash_lookup.
434
435 2008-05-21  Maxim Kuvyrkov  <maxim@codesourcery.com>
436
437         Add multi-GOT support for m68k.
438         * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
439         glist): New fields.
440         (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
441         struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
442         struct elf_m68k_multi_got): New data structures.
443         (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
444         allow_multigot_p, multi_got_): New fields.
445         (elf_m68k_multi_got): New macro.
446         (elf_m68k_link_hash_newfunc): Initialize new fields of
447         struct elf_m68k_link_hash_entry.
448         (elf_m68k_link_hash_table_create): Initialize new fields of
449         struct elf_m68k_link_hash_table.
450         (elf_m68k_link_hash_table_free): New static function implementing hook.
451         (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
452         static functions for struct elf_m68k_got.
453         (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
454         elf_m68k_got_entry_eq): New static functions for
455         struct elf_m68k_got_entry.
456         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
457         ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
458         (enum elf_m68k_get_entry_howto): New enum.
459         (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
460         elf_m68k_remove_got_entry_type): New static functions for
461         struct elf_m68k_got_entry.
462         (elf_m68k_add_entry_to_got): New static function.
463         (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
464         elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
465         functions for struct elf_m68k_bfd2got_entry.
466         (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
467         elf_m68k_can_merge_gots): New traversal.
468         (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
469         elf_m68k_merge_gots): Ditto.
470         (struct elf_m68k_finalize_got_offsets_arg,
471         elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
472         (struct elf_m68k_partition_multi_got_arg,
473         elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
474         elf_m68k_partition_multi_got): Ditto.
475         (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
476         functions.
477         (elf_m68k_copy_indirect_symbol): New static function implementing
478         a hook.
479         (elf_m68k_check_relocs): Update to add entries to multi-GOT.
480         (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
481         (elf_m68k_always_size_sections): Assign BFDs to GOTs.
482         (elf_m68k_relocate_section): Update to properly handle GOT relocations.
483         (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
484         of a global symbol.
485         (bfd_elf_m68k_set_target_options): New function.
486         (bfd_elf32_bfd_link_hash_table_free): Define hook.
487         (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
488         to skip generic calculation of GOT offsets.
489         (elf_backend_copy_indirect_symbol): Define hook.
490         * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
491         * bfd-in2.h: Regenerate.
492
493 2008-05-21  André Johansen  <andrejoh@gmail.com>
494
495         PR 868
496         * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
497         for filenames in function tables and variable tables.
498
499 2008-05-19  Alan Modra  <amodra@bigpond.net.au>
500
501         PR 2995, PR 6473
502         * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
503         vma when all p_paddr fields are zero and there is more than
504         one PT_LOAD header.
505
506 2008-05-15  Christophe Lyon  <christophe.lyon@st.com>
507
508         Add long call support for ARM.
509         * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
510         (THM2_MAX_BWD_BRANCH_OFFSET): Define.
511         (ARM_MAX_FWD_BRANCH_OFFSET): Define.
512         (ARM_MAX_BWD_BRANCH_OFFSET): Define.
513         (THM_MAX_FWD_BRANCH_OFFSET): Define.
514         (THM_MAX_BWD_BRANCH_OFFSET): Define.
515         (arm_long_branch_stub): Define.
516         (arm_pic_long_branch_stub): Define.
517         (arm_thumb_v4t_long_branch_stub): Define.
518         (arm_thumb_thumb_long_branch_stub): Define.
519         (arm_thumb_arm_v4t_long_branch_stub): Define.
520         (STUB_SUFFIX): Define.
521         (elf32_arm_stub_type): Define.
522         (elf32_arm_stub_hash_entry): Define.
523         (elf32_arm_link_hash_entry): Add stub_cache field.
524         (arm_stub_hash_lookup): Define.
525         (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
526         add_stub_section, layout_sections_again, stub_group, bfd_count,
527         top_index, input_list fields.
528         (elf32_arm_link_hash_newfunc): Init new field.
529         (stub_hash_newfunc): New function.
530         (elf32_arm_link_hash_table_create): Init stub_hash_table.
531         (elf32_arm_hash_table_free): New function.
532         (arm_type_of_stub): New function.
533         (elf32_arm_stub_name): New function.
534         (elf32_arm_get_stub_entry): New function.
535         (elf32_arm_stub_add_mapping_symbol): New function.
536         (elf32_arm_add_stub): New function.
537         (arm_build_one_stub): New function.
538         (arm_size_one_stub): New function.
539         (elf32_arm_setup_section_lists): New function.
540         (elf32_arm_next_input_section): New function.
541         (group_sections): New function.
542         (elf32_arm_size_stubs): New function.
543         (elf32_arm_build_stubs): New function.
544         (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
545         (bfd_elf32_arm_process_before_allocation): No longer handle
546         R_ARM_CALL and R_ARM_THM_CALL.
547         (using_thumb_only): New function.
548         (elf32_arm_final_link_relocate): Redirect calls to stub if range
549         exceeds encoding capabilities.
550         (bfd_elf32_bfd_link_hash_table_free): Define.
551         * bfd-in.h (R_ARM_max): Fix value to 130.
552         (elf32_arm_setup_section_lists): Protype.
553         (elf32_arm_next_input_section): Protype.
554         (elf32_arm_size_stubs): Protype.
555         (elf32_arm_build_stubs): Protype.
556         * bfd-in2.h: Regenerate.
557
558 2008-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
559
560         * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
561         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
562
563 2008-05-14  Alan Modra  <amodra@bigpond.net.au>
564
565         * Makefile.am: Run "make dep-am".
566         * Makefile.in: Regenerate.
567
568 2008-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
569             Alan Modra  <amodra@bigpond.net.au>
570
571         * elf32-ppc.c (section_covers_vma): New function.
572         (ppc_elf_get_synthetic_symtab): New function.
573         (bfd_elf32_get_synthetic_symtab): Define.
574         * elf64-ppc.c (section_covers_vma): New function.
575         (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
576         table entries, and __glink_PLTresolve on resolver stub.
577         (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
578
579 2008-05-12  Alan Modra  <amodra@bigpond.net.au>
580
581         PR 6443
582         * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
583         (must_be_dyn_reloc): New function.
584         (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
585         in pies.
586         (ppc_elf_tls_optimize): Optimise pies.
587         (ppc_elf_relocate_section): Use a section symbol rather than no
588         symbol if possible for LD->IE TLS sequence, but don't error if
589         we must use no symbol.
590         * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
591         (must_be_dyn_reloc): Likewise.
592         (ppc64_elf_check_relocs): Likewise.
593         (ppc64_elf_tls_optimize): Likewise.
594         (ppc64_elf_relocate_section): Likewise.
595
596 2008-05-12  Alan Modra  <amodra@bigpond.net.au>
597
598         * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
599
600 2008-05-10  Paul Pluzhnikov  <ppluzhnikov@google.com>
601
602         * elfcore.h (elf_core_file_p): Warn about core truncation.
603
604 2008-05-07  Bob Wilson  <bob.wilson@acm.org>
605
606         * elf32-xtensa.c (xtensa_property_section_name): New.
607         (xtensa_make_property_section): New.
608         (xtensa_get_property_section): Make static.  Do not create a new
609         section if it does not exist.
610
611 2008-05-08  Alan Modra  <amodra@bigpond.net.au>
612
613         * elf32-spu.c (spu_elf_special_sections): Add "._ea".
614         (spu_elf_relocate_section): Handle relocations against symbols
615         defined in ._ea specially.
616
617 2008-05-03  Daniel Jacobowitz  <dan@codesourcery.com>
618
619         * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
620         ARRAY_SIZE.
621         (elf32_arm_symbian_plt_sym_val): New.
622         (elf_backend_plt_sym_val): Define.
623
624 2008-05-03  Alan Modra  <amodra@bigpond.net.au>
625
626         PR 2995, PR 6473
627         * elf.c (rewrite_elf_program_header): Rather than clearing
628         p_paddr_valid at end, don't set it in the first place.  Delete
629         comment no longer relevant.  When not p_paddr_valid, don't set
630         paddr from vaddr, and don't set p_vaddr_offset.
631
632 2008-05-01  Cary Coutant  <ccoutant@google.com>
633
634         * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
635         corrupt string table.
636
637 2008-05-01  Joel Brobecker  <brobecker@adacore.com>
638
639         * cache.c (cache_bread_1): Renames cache_bread.
640         (cache_bread): New function.
641
642 2008-05-01  Alan Modra  <amodra@bigpond.net.au>
643
644         PR 2995, PR 6473
645         * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
646         (assign_file_positions_for_load_sections): Combine nested "if".
647         (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
648         when all header p_paddr fields are zero.
649
650 2008-04-30  Edmar Wienskoski  <edmar@freescale.com>
651
652         * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
653
654 2008-04-29  Daniel Jacobowitz  <dan@codesourcery.com>
655
656         * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
657         (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
658         even if they are not loaded.
659         * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
660         first.
661
662 2008-04-25  Jay Foad  <jay.foad@gmail.com>
663
664         * reloc16.c (bfd_coff_reloc16_get_value): Add support for
665         undefined weak symbols.
666
667 2008-04-25  Nick Clifton  <nickc@redhat.com>
668
669         * po/vi.po: Updated Vietnamese translation.
670
671 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
672
673         * aclocal.m4: Regenerate.
674         * configure: Regenerate.
675
676 2008-04-21  Cary Coutant  <ccoutant@google.com>
677
678         * archive.c (_bfd_write_archive_contents): Fix incorrect use of
679         ARFMAG.
680
681 2008-04-21  Nathan Sidwell  <nathan@codesourcery.com>
682
683         * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
684         set the value of undefined symbols in shared objects.
685         (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
686         undefined symbols unless pointer equality is needed.
687
688 2008-04-18  Dennis Roberts  <dennis.roberts@sunquestinfo.com>
689
690         * aix5ppc-core.c: Define macros for the default architecture and
691         machine for matching core files.
692         (xcoff64_core_p): Set the architecture and machine to the default
693         values defined in the macros mentioned above.
694         * rs6000-core.c: Define macros to determine whether or not the
695         core file header uses the core_dumpxx header format.
696         (rs6000coff_core_p): Don't match core files that use the
697         core_dumpxx header format.
698
699 2008-04-16  Pedro Alves  <pedro@codesourcery.com>
700
701         * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
702
703 2008-04-16  David S. Miller  <davem@davemloft.net>
704
705         * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
706         BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
707         BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
708         * libbfd.h: Regnerate.
709         * bfd-in2.h: Regenerate.
710         * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
711         GOTDATA relocations.
712         (sparc_reloc_map): Likewise.
713         (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
714         R_SPARC_GOT*.
715         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
716         (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
717         R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
718         R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
719         Simply ignore R_SPARC_GOTDATA_OP relocations.
720
721 2008-04-14  Aurelien Jarno  <aurelien@aurel32.net>
722
723         * configure.in: Link with the PIC version of libiberty on
724         Linux/MIPS hosts.
725         * configure: Regenerate.
726
727 2008-04-14  Edmar Wienskoski  <edmar@freescale.com>
728
729         * archures.c: Add bfd_mach_ppc_e500mc.
730         * bfd-in2.h: Regenerate.
731
732 2008-04-08  Alan Modra  <amodra@bigpond.net.au>
733
734         * elf32-spu.c (spu_elf_build_stubs): Correct error message.
735         (mark_functions_via_relocs): Remove premature init of symtab_hdr.
736         (collect_overlays): Commment typo fix.
737
738 2008-04-08  Kees Cook  <kees@canonical.com>
739
740         * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
741         in EXEC_P bfds.
742
743 2008-04-08  Alan Modra  <amodra@bigpond.net.au>
744
745         * elf32-spu.c: Include libiberty.h.
746         (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
747         non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
748         spu_elf_relink, auto_overlay fields.
749         (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
750         (needs_ovl_stub): Flip test so that call to non-function warning
751         is emitted during relocate_section rather than earlier.
752         (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
753         auto_overlay if no section exceeds local store.
754         (struct call_info): Add count, max_depth, is_pasted fields.
755         (struct function_info): Add rodata, last_caller, call_count,
756         depth, new visit flags.
757         (insert_callee): Increment call count.
758         (copy_callee): New function.
759         (mark_functions_via_relocs): Investigate all reloc types to count
760         possible function pointer stubs for --auto-overlay.  Track
761         last_caller and increment function call_count.
762         (pasted_function): Insert a "call" into call info for pasted section.
763         (remove_cycles): Track max depth of calls.  Don't emit call graph
764         pruning warning for --auto-overlay.
765         (build_call_tree): Don't transfer_calls for --auto-overlay.
766         Adjust remove_cycles call.
767         (sort_calls, sort_lib, sort_bfds): New functions.
768         (struct _mos_param, struct _uos_param, struct _cl_param): New.
769         (mark_overlay_section, unmark_overlay_section): New functions.
770         (collect_lib_sectios, auto_ovl_lib_functions): New functions.
771         (collect_overlays, find_pasted_call): New functions.
772         (sum_stack): Deal with is_pasted "calls".  Exit before printing
773         when --auto-overlay.
774         (spu_elf_auto_overlay): New function.
775         (spu_elf_final_link): Call spu_elf_auto_overlay.
776         * elf32-spu.h (spu_elf_check_vma): Update prototype.
777
778 2008-04-07  Alan Modra  <amodra@bigpond.net.au>
779
780         * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
781         is defined in overlay section before creating a stub.
782         (build_spuear_stubs): Likewise.
783         (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
784
785 2008-04-02  Alan Modra  <amodra@bigpond.net.au>
786
787         * elf32-spu.c (insert_callee): Reorder call list so most recent
788         call is always first.
789         (interesting_section): Move.
790         (mark_functions_via_relocs): Fold interesting_section and
791         reloc_count tests in callers to here.  Simplify output section
792         owner test.
793         (discover_functions): Set "gaps" when no symbols and some
794         "interesting_section".  Run pasted_function loop for no symbol
795         bfds.
796         (for_each_node, transfer_calls): New functions.
797         (mark_non_root): Adjust to suit for_each_node.
798         (call_graph_traverse): Likewise.  Fix memory leak.  Rename to..
799         (remove_cycles): ..this.
800         (build_call_tree): Use for_each_node and transfer_calls.
801         (struct _sum_stack_param): New.
802         (sum_stack): Adjust to suit for_each_node.  Return error on
803         malloc failure.  Move code to print root node cumulative stack from..
804         (spu_elf_stack_analysis): ..here.  Use for_each_node.
805
806 2008-03-31  Cary Coutant  <ccoutant@google.com>
807
808         PR 6006
809         * archive.c (_bfd_slurp_extended_name_table): Change
810         ARFMAG[0] to ARFMAG[1].
811         (_bfd_construct_extended_name_table): Likewise.
812
813 2008-03-31  Daniel Jacobowitz  <dan@codesourcery.com>
814
815         * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
816         (_bfd_mips_elf_check_relocs): Update comments.  Always call
817         mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
818
819 2008-03-27  Cary Coutant  <ccoutant@google.com>
820
821         Add support for thin archives.
822         * archive.c (_bfd_find_nested_archive): New function.
823         (get_extended_arelt_filename): Add origin parameter.
824         (_bfd_generic_read_ar_hdr_mag): Deal with extended name
825         combined with a file offset.
826         (append_relative_path): New function.
827         (_bfd_get_elt_at_filepos): Deal with external members and
828         nested archives.
829         (bfd_generic_openr_next_archived_file): Thin archives.
830         (bfd_generic_archive_p): Recognize new magic string.
831         (adjust_relative_path): New function.
832         (_bfd_construct_extended_name_table): Construct extended
833         names for thin archive members.
834         (_bfd_write_archive_contents): Emit new magic string, skip
835         copying files for thin archives.
836         * bfd-in.h (bfd_is_thin_archive): New macro.
837         * bfd.c (struct bfd): New fields for thin archives.
838         * libbfd-in.h (struct areltdata): New field for thin archives.
839         * opncls.c (bfd_close): Delete BFDs for nested archives.
840
841 2008-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
842
843         * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
844         _bfd_final_link_relocate that also handles R_pcrel24 relocs.
845         (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
846
847 2008-03-25  Nathan Sidwell  <nathan@codesourcery.com>
848
849         * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
850         in vxworks tls_vars sections.
851         (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
852         * elf32-i386.c (allocate_dynrelocs,
853         elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
854         * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
855         ppc_elf_relocate_section): Likewise.
856         * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
857         sh_elf_relocate_section): Likewise.
858         * elfxx-sparc.c (allocate_dynrelocs,
859         _bfd_sparc_elf_size_dynamic_sections,
860         _bfd_sparc_elf_relocate_section): Likewise.
861
862 2008-03-21  Adam Nemet  <anemet@caviumnetworks.com>
863
864         * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
865         print the values from the dynamic section.
866
867 2008-03-20  Richard Sandiford  <rsandifo@nildram.co.uk>
868
869         * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
870         (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
871
872 2008-03-20  Alan Modra  <amodra@bigpond.net.au>
873
874         * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
875         (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
876         (process_stubs, discover_functions, build_call_tree): Likewise.
877         (spu_elf_stack_analysis): Likewise.
878         (spu_elf_check_vma): Likewise.  Move.
879         (struct call_info): Make "is_tail" a bitfield.
880         (insert_callee): Clear fun->start and set fun->is_func if we find
881         a non-tail call.
882         * elf32-spu.h (spu_elf_create_sections): Update prototype.
883         (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
884
885 2008-03-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
886
887         * aclocal.m4: Regenerate.
888         * configure: Likewise.
889         * Makefile.in: Likewise.
890
891 2008-03-16  H.J. Lu  <hongjiu.lu@intel.com>
892
893         PR ld/5789
894         PR ld/5943
895         * elf32-i386.c  (elf_i386_relocate_section): Issue an error
896         for R_386_GOTOFF relocaton against undefined hidden/internal
897         symbols when building a shared object.
898
899         * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
900         error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
901         relocaton against undefined hidden/internal symbols when
902         building a shared object.
903         (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
904         is referenced locally, but isn't defined in a regular file.
905
906 2008-03-15  H.J. Lu  <hongjiu.lu@intel.com>
907
908         * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
909         HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
910         BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
911         HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
912         * bfd.c: Here.
913
914         * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
915         mtime_set, no_export, output_has_begun and has_armap to bit
916         field.
917
918         * bfd-in2.h: Regenerated.
919
920 2008-03-14  Daniel Jacobowitz  <dan@codesourcery.com>
921
922         * cache.c (close_one): Remove mtime hack.
923
924 2008-03-14  H.J. Lu  <hongjiu.lu@intel.com>
925
926         PR ld/5913
927         * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
928         (elfNN_ia64_dtprel_base): Likewise.
929         (elfNN_ia64_relocate_section): Go to missing_tls_sec if
930         tls_sec is NULL before calling elfNN_ia64_tprel_base or
931         elfNN_ia64_dtprel_base.  Report unsupported TLS relocations.
932
933 2008-03-14  Alan Modra  <amodra@bigpond.net.au>
934
935         * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
936         common code to..
937         (maybe_needs_stub): ..here, a new function that also omits stubs
938         for .eh_frame, and..
939         (needs_ovl_stub): ..here.  Create stubs for labels in code section
940         referenced by switch jump table.
941         (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
942         (enum _insn_type): Delete.
943         (enum _stub_type): New.
944         (count_stub, build_stub): Adjust.
945         (allocate_spuear_stubs, build_spuear_stubs): Adjust.
946
947 2008-03-13  Alan Modra  <amodra@bigpond.net.au>
948
949         * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
950         (_bfd_elf_assign_file_position_for_section): Simplify align.
951         (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
952         for sh_addralign.
953         (elf_fake_sections, swap_out_syms): Likewise.
954         * elflink.c (bfd_elf_final_link): Likewise.
955
956 2008-03-13  Alan Modra  <amodra@bigpond.net.au>
957
958         * Makefile.am: Run "make dep-am".
959         * Makefile.in: Regenerate.
960         * po/SRC-POTFILES.in: Regenerate.
961
962 2008-03-12  Bernd Schmidt  <bernd.schmidt@analog.com>
963
964         From Jie Zhang <jie.zhang@analog.com>
965         * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
966         gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
967         gotoff, call and sym not bitfields.
968         (bfinfdpic_gc_sweep_hook): New function; update the relocation
969         information for the relocations of the section being removed.
970         (bfinfdpic_check_relocs): Accumulate the number of relocations
971         which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
972         fdgoffhilo, gotoff, call and sym fields.
973         (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
974
975 2008-03-12  Alan Modra  <amodra@bigpond.net.au>
976
977         PR 5900
978         * elf-bfd.h: Include elf/internal.h after elf/external.h.
979         * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
980         (elf_swap_symbol_out): Adjust SHN_XINDEX test.
981         (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
982         seen in external structs.
983         (valid_section_index_p): Delete.
984         (elf_object_p): Don't increment section numbers over reserved range.
985         Simplify test for valid sh_link, sh_info and e_shstrndx fields.
986         (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
987         seen in external structs.  Don't increment section numbers over
988         reserved range.
989         * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
990         (bfd_section_from_shdr): Likewise.
991         (group_signature): Range check before accessing elf_elfsections.
992         (_bfd_elf_setup_sections): Likewise.
993         (bfd_section_from_shdr): Likewise.
994         (bfd_section_from_shdr): Don't increment section number over
995         reserved sections.
996         (assign_file_positions_for_non_load_sections): Likewise.
997         (assign_file_positions_except_relocs): Likewise.
998         (_bfd_elf_write_object_contents): Likewise.
999         (assign_section_numbers): Likewise.  Adjust for changed SHN_*.
1000         (prep_headers): Delete unused variable.
1001         * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
1002         for changed SHN_* values.
1003         (check_dynsym, elf_link_input_bfd): Likewise.
1004         (bfd_elf_final_link): Likewise.  Don't skip over reserved section
1005         range.
1006         (elf_fixup_link_order): Check that sh_link field is valid.
1007         * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
1008         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
1009         accesssing elf_elfsections.
1010         * elf32-avr.c (elf32_avr_size_stubs): Likewise.
1011         * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
1012         * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
1013         * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
1014         SHN_* defines.  Test for SHN_BAD return from
1015         _bfd_elf_section_from_bfd_section
1016
1017 2008-03-12  Alan Modra  <amodra@bigpond.net.au>
1018
1019         * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
1020         * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
1021         SHN_BAD on error.
1022         (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
1023         _bfd_elf_section_from_bfd_section, not -1.
1024         (swap_out_syms): Likewise.
1025         * elflink.c (elf_link_add_object_symbols): Likewise.
1026         (bfd_elf_get_bfd_needed_list): Likewise.
1027         (bfd_elf_match_symbols_in_sections): Likewise.
1028         (elf_link_add_object_symbols): Don't bother testing for symbols
1029         using normal sections before calling bfd_section_from_elf_index.
1030         (elf_link_input_bfd, bfd_elf_final_link): Likewise.
1031         (bfd_elf_reloc_symbol_deleted_p): Likewise.
1032         * elfcode.h (elf_slurp_symbol_table): Likewise.
1033         * elf32-spu.c (get_sym_h): Likewise.
1034         * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
1035         * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
1036         * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
1037
1038 2008-03-11  Alan Modra  <amodra@bigpond.net.au>
1039
1040         * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
1041         to those in process_stubs for overlay symbols.
1042
1043 2008-03-09  Paul Brook  <paul@codesourcery.com>
1044
1045         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
1046         Tag_VFP_arch values.
1047
1048 2008-03-08  Paul Brook  <paul@codesourcery.com>
1049
1050         * elf32-arm.c (insert_thumb_branch): Rewrite.
1051         (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
1052
1053 2008-03-07  Paul Brook  <paul@codesourcery.com>
1054
1055         * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
1056         MOVT relocations.
1057         (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
1058         extension.
1059         (elf32_arm_relocate_section): Handle MOVW and MOVT
1060         relocations.  Improve safety check for other weird relocations.
1061         (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
1062         relocations.
1063
1064 2008-03-03  Bob Wilson  <bob.wilson@acm.org>
1065
1066         * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
1067         only compute its value once.
1068
1069 2008-03-03  Alan Modra  <amodra@bigpond.net.au>
1070
1071         * elf32-spu.c (struct got_entry): Add "addend" field.
1072         (count_stub, build_stub): Use a new stub if relocation addend
1073         differs from existing stubs for this symbol.
1074         (process_stubs): Deal with addends.
1075         (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
1076
1077 2008-03-02  H.J. Lu  <hongjiu.lu@intel.com>
1078
1079         PR ld/5789
1080         * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
1081         for hidden and local symbols.
1082
1083 2008-03-03  Alan Modra  <amodra@bigpond.net.au>
1084
1085         * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
1086         undefined symbols with internal or hidden visibility.
1087         (ppc_elf_relocate_section): Likewise.  Use SYMBOL_CALLS_LOCAL
1088         rather than SYMBOL_REFERENCES_LOCAL on branches.  Don't
1089         return immediately on dynamic reloc error.
1090
1091 2008-03-01  Alan Modra  <amodra@bigpond.net.au>
1092
1093         * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
1094         if emitrelocations.
1095         (get_relocs): New function, split out from..
1096         (ppc_build_one_stub): ..here.  Add relocs on plt_branch stubs if
1097         emitrelocations.  Remove indx temp.
1098         (ppc_size_one_stub): Count new stub relocs.
1099         (ppc64_elf_size_stubs): Count new glink reloc.
1100         (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
1101         (ppc64_elf_finish_dynamic_sections): Output glink relocs.
1102         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
1103         glink code.
1104
1105 2008-02-28  Alan Modra  <amodra@bigpond.net.au>
1106
1107         * elf32-spu.c (mark_functions_via_relocs): Don't assume that
1108         the "->start" pointer reaches to function origin, so that we
1109         can handle functions split over more than two sections.
1110         (build_call_tree): Likewise.
1111         (pasted_function): Don't attempt to set fun->start back to the
1112         function origin, just go back one section.
1113
1114 2008-02-27  Catherine Moore  <clm@codesourcery.com>
1115
1116         * elf.c ( _bfd_elf_print_private_bfd_data): Call
1117         elf_backend_get_target_dtag if defined.
1118         * elf32-mips.c (elf_backend_get_target_dtag): Define.
1119         * elf64-mips.c: Likewise.
1120         * elfn32-mips.c: Likewise.
1121         * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
1122         * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
1123         * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
1124         * elfxx-target.h (elf_backend_get_target_dtag): Add default.
1125         (elf_backend_data): Add elf_backend_get_target_dtag.
1126
1127 2008-02-26  Alan Modra  <amodra@bigpond.net.au>
1128
1129         * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
1130         for R_PPC_REL32 syms.  Don't set non_got_ref on branch reloc syms,
1131         and assume branch relocs are not dynamic when non-shared.
1132         (readonly_dynrelocs): New function, split out from..
1133         (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
1134         (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
1135         clear non_got_ref..
1136         (allocate_dynrelocs): ..and don't set u.def for undefined weak.
1137         Do allow dynamic relocs on undefined symbols.
1138         (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
1139         (ppc_elf_relocate_section): Mirror dynamic reloc changes in
1140         check_relocs.
1141         (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
1142         plt symbols needing pointer_equality_needed.
1143
1144 2008-02-23  Alan Modra  <amodra@bigpond.net.au>
1145
1146         * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
1147
1148 2008-02-23  Alan Modra  <amodra@bigpond.net.au>
1149
1150         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
1151         pointer_equality_needed.
1152         (ppc_elf_check_relocs): Split out non-branch relocs from others
1153         that might emit dynamic relocs.  Set pointer_equality_needed
1154         for their symbols.  Don't set non_got_ref on branch reloc symbols.
1155         (ppc_elf_hash_symbol): New function.
1156         (elf_backend_hash_symbol): Define.
1157         (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
1158         Error if pointer_equality_needed on weak plt symbol.
1159
1160 2008-02-22  H.J. Lu  <hongjiu.lu@intel.com>
1161
1162         PR ld/5788
1163         * elflink.c (elf_create_symbuf): Correct buffer size and
1164         position.
1165
1166 2008-02-22  Nick Clifton  <nickc@redhat.com>
1167
1168         PR 868
1169         * dwarf2.c: Revert previous patch.  All of the allocate memory is
1170         on an obstack which will be freed at some other time.
1171
1172 2008-02-20  Nick Clifton  <nickc@redhat.com>
1173
1174         PR 868
1175         * libbfd.c (bfd_realloc_or_free): New function.  Performs like
1176         bfd_realloc, but if the (re)allocation fails, the pointer is
1177         freed.
1178         * libbfd-in.h: Prototype.
1179         * libbfd.h: Regenerate.
1180         * bfdio.c (bfd_bwrite): Use the new function.
1181         (bfd_seek): Likewise.
1182         * bfdwin.c:(bfd_get_file_window): Likewise.
1183         * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
1184         * elf32-ppc.c (ppc_elf_relax_section): Likewise.
1185         * elf32-xtensa.c (vsprintf_msg): Likewise.
1186         * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1187         * stabs.c (_bfd_link_seciton_stabs): Likewise.
1188         * vms-misc.c (_bfd_vms_get_record): Likewise.
1189         * vms-tir.c (check_section): Likewise.
1190         * vms.c (vms_new_section_hook): Likewise.
1191         * elf32-arm.c (elf32_arm_section_map_add): Check that the
1192         allocation of sec_data->map succeeded before using it.
1193         * elflink.c (elf_link_output_sym): Do not overwrite finfo->
1194         symshndxbuf until it is known that the reallocation succeeded.
1195
1196 2008-02-20  Diogo de Carvalho Kraemer  <diogo@kraemer.eng.br>
1197             Nick Clifton  <nickc@redhat.com>
1198
1199         PR 868
1200         * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
1201         out of memory.
1202         (decode_line_info): Free the line_info_table before returning a
1203         failure result.
1204         (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
1205         Free the line table.  Free the function table.  Free the variable
1206         table.
1207
1208 2008-02-17  Mark Kettenis  <kettenis@gnu.org>
1209
1210         * elf.c (swap_out_syms): Avoid preprocessing directive within
1211         macro arg.
1212
1213 2008-02-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
1214
1215         * elf.c (assign_file_positions_for_load_sections): Set the type of
1216         PT_NOTE sections to SHT_NOTE.
1217
1218 2008-02-17  Ulrich Weigand  <uweigand@de.ibm.com>
1219
1220         * simple.c (bfd_simple_get_relocated_section_contents): Set
1221         link_info.output_bfd.
1222
1223 2008-02-16  Nathan Sidwell  <nathan@codesourcery.com>
1224
1225         * dwarf2.c (find_line): Don't trust debug information after an
1226         unparseable compilation unit.
1227
1228 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
1229
1230         PR 5765
1231         * section.c (SEC_LINK_DUPLICATES): Correct.  Renumber following flags.
1232         * bfd-in2.h: Regenerate.
1233
1234 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
1235
1236         * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
1237         * elf.c (bfd_elf_allocate_object): Don't check for already allocated
1238         tdata.
1239         * elf32-hppa.c (elf32_hppa_mkobject): New function.
1240         (bfd_elf32_mkobject): Define.
1241         * elf32-ppc.c (is_ppc_elf_target): Delete.  Replace all uses with..
1242         (is_ppc_elf): ..this new macro.
1243         * elf64-ppc.c (is_ppc64_elf_target): Delete.  Replace all uses with..
1244         (is_ppc64_elf): ..this new macro.
1245
1246 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
1247
1248         * elflink.c: Replace all accesses to hash->creator field with
1249         output_bfd->xvec.
1250         * cofflink.c: Likewise.
1251         * coff-h8300.c: Likewise.
1252         * ecoff.c: Likewise.
1253         * elf32-m68hc1x.c: Likewise.
1254         * elf32-ppc.c: Likewise.
1255         * elf64-alpha.c: Likewise.
1256         * elf64-ppc.c: Likewise.
1257         * elf64-sparc.c: Likewise.
1258         * elfxx-mips.c: Likewise.
1259         * i386linux.c: Likewise.
1260         * m68klinux.c: Likewise.
1261         * sparclinux.c: Likewise.
1262         * sunos.c: Likewise.
1263         * xcofflink.c: Likewise.
1264         * linker.c: Likewise.
1265         (_bfd_link_hash_table_init): Don't store creator.
1266
1267 2008-02-14  Peter Jones  <pjones@redhat.com>
1268
1269         * efi-rtdrv-ia32.c: New file.
1270         * efi-bsdrv-ia32.c: New file.
1271         * efi-rtdrv-ia64.c: New file.
1272         * efi-bsdrv-ia64.c: New file.
1273         * efi-rtdrv-x86_64.c: New file.
1274         * efi-bsdrv-x86_64.c: New file.
1275         * peicode.h (pe_bfd_object_p): Add support for boot service and
1276         runtime service drivers.
1277         * libpei.h: Add macros for EFI formats, and rename the efi application
1278         format macros to disambiguate.
1279         * targets.c: Add bfd_target _vec externs.
1280         (_bfd_tar): Add EFI _vec entries.
1281         * config.bfd: Add EFI vectors into the selection routines.
1282         * configure.in: add EFI _vec entries.
1283         * configure: Regenerate.
1284         * Makefile.am: Add EFI files.
1285         * Makefile.in: Regenerate.
1286
1287 2008-02-14  Nathan Sidwell  <nathan@codesourcery.com>
1288
1289         * dwarf1.c (struct dwarf1_debug): Add syms member.
1290         (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
1291         (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
1292         section contents, check for out of memory.
1293
1294         * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
1295         (parse_die): Change data pointers to bfd_byte.
1296         (parse_line_table, parse_functions_in_unit): Likewise.
1297
1298 2008-02-14  Alan Modra  <amodra@bigpond.net.au>
1299
1300         * elflink.c (compute_bucket_count): Warning fixes.
1301
1302 2008-02-12  DJ Delorie  <dj@redhat.com>
1303
1304         * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
1305         relocation pointing to local symbol in merged section.
1306
1307         * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
1308         (iq2000_elf_relocate_section): Call it.
1309
1310 2008-02-12  Nick Clifton  <nickc@redhat.com>
1311
1312         PR ld/5692
1313         * elf-bfd.h (enum elf_object_id): New enum, used to identify
1314         target specific extensions to the elf_obj_tdata structure.
1315         (struct elf_obj_tdata): New field 'object_id'.
1316         (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
1317         macros for accessing fields in the elf_obj_tdata structure.
1318         (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
1319         (bfd_elf_allocate_object): New function.
1320         * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
1321         and implement by calling bfd_elf_allocate_object.
1322         (bfd_elf_allocate_object): New function: Allocates an
1323         elf_obj_tdata structure, possibly with a target specific
1324         extension.
1325         * elfxx-target.h (bfd_elfNN_mkobject): Use
1326         bfd_elf_make_generic_object as the default value.
1327         * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
1328         for consistency with other, similar structures.
1329         (is_arm_elf): New macro.  Checks a BFD to make sure that is an ARM
1330         ELF bfd.
1331         (elf32_arm_mkobject): Call bfd_elf_allocate_object.
1332         (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
1333         the bfd being processed.
1334         (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1335         (bfd_elf32_arm_set_target_relocs): Likewise.
1336         (bfd_elf32_arm_final_link_relocate): Likewise.
1337         (bfd_elf32_arm_copy_private_bfd_data): Likewise.
1338         (bfd_elf32_arm_merge_eabi_attributes): Likewise.
1339         (bfd_elf32_arm_merge_private_bfd_data): Likewise.
1340         (bfd_elf32_arm_check_relocs): Likewise.
1341         (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
1342         (bfd_elf32_arm_size_dynamic_sections): Likewise.
1343         (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
1344         (bfd_elf32_arm_init_maps): Likewise.
1345         (bfd_elf32_arm_final_link_relocate): Likewise.
1346         (bfd_elf32_arm_relocate_section): Likewise.
1347         (bfd_elf32_arm_gc_sweep_hook): Likewise.
1348         (bfd_elf32_arm_check_relocs): Likewise.
1349         (bfd_elf32_arm_size_dynamic_sections): Likewise.
1350         * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
1351         (is_i386_elf): New macro.  Checks a BFD to make sure that is an x86
1352         ELF bfd.
1353         (elf_i386_check_relocs): Use is_i386_elf macro to check    the bfd
1354         being processed.
1355         (elf_i386_size_dynamic_sections): Likewise.
1356         (elf_i386_relocate_section): Likewise.
1357         (elf_i386_check_relocs): Use elf_symtab_hdr.
1358         (elf_i386_gc_sweep_hook): Likewise.
1359         (elf_i386_size_dynamic_sections): Likewise.
1360         (elf_i386_relocate_section): Likewise.
1361         * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
1362         (elf_create_pointer_linker_section): Use is_ppc_elf_target to
1363         verify that the bfd before accessing target specific fields.
1364         (ppc_elf_check_relocs): Likewise.
1365         (elf_finish_pointer_linker_section): Likewise.
1366         (elf_create_pointer_linker_section): Use elf_symtab_hdr.
1367         (ppc_elf_check_relocs): Likewise.
1368         (ppc_elf_gc_sweep_hook): Likewise.
1369         (ppc_elf_tls_optimize): Likewise.
1370         (ppc_elf_size_dynamic_sections): Likewise.
1371         (ppc_elf_relax_section): Likewise.
1372         (ppc_elf_relocate_section): Likewise.
1373         * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
1374         reminding programmers to keep this structure in sync with the one
1375         defined in elf64-s390.c.
1376         (elf_s390_mkobject): Call bfd_elf_allocate_object.
1377         (is_s390_elf): New macro.  Checks a BFD to make sure that is an s390
1378         ELF bfd.
1379         (elf_s390_check_relocs): Use is_s390_elf macro to check    the bfd
1380         being processed.
1381         (elf_s390_size_dynamic_sections): Likewise.
1382         (elf_s390_relocate_section): Likewise.
1383         (elf_s390_check_relocs): Use elf_symtab_hdr.
1384         (elf_s390_gc_sweep_hook): Likewise.
1385         (elf_s390_size_dynamic_sections): Likewise.
1386         (elf_s390_relocate_section): Likewise.
1387         * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
1388         (is_sh_elf): New macro.  Checks a BFD to make sure that is an SH
1389         ELF bfd.
1390         (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
1391         bfd being processed.
1392         (sh_elf_relocate_section): Likewise.
1393         (sh_elf_check_relocs): Likewise.
1394         (sh_elf_copy_private_data): Likewise.
1395         (sh_elf_relax_section): Use elf_symtab_hdr.
1396         (sh_elf_size_dynamic_sections): Likewise.
1397         (sh_elf_relocate_section): Likewise.
1398         (sh_elf_get_relocated_section_contents): Likewise.
1399         (sh_elf_gc_sweep_hook): Likewise.
1400         (sh_elf_check_relocs): Likewise.
1401         * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
1402         (is_alpha_elf): New macro.  Checks a BFD to make sure that is an
1403         Alpha ELF bfd.
1404         (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
1405         the bfd being processed.
1406         (elf64_alpha_create_dynamic_section): Likewise.
1407         (elf64_alpha_check_relocs): Likewise.
1408         (elf64_alpha_size_got_sections): Likewise.
1409         (elf64_alpha_relax_section): Likewise.
1410         (elf64_alpha_relocate_section): Likewise.
1411         (elf64_alpha_final_link): Likewise.
1412         (elf64_alpha_check_relocs): Use elf_symtab_hdr.
1413         (elf64_alpha_relax_section): Likewise.
1414         (elf64_alpha_relocate_section_r): Likewise.
1415         (elf64_alpha_relocate_section): Likewise.
1416         * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
1417         (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
1418         being processed.
1419         (opd_entry_value): Likewise.
1420         (allocate_dynrelocs): Likewise.
1421         (ppc64_elf_relocate_section): Likewise.
1422         (ppc64_elf_check_relocs): Use elf_symtab_hdr.
1423         (opd_entry_value): Likewise.
1424         (ppc64_elf_gc_sweep_hook): Likewise.
1425         (get_sym_h): Likewise.
1426         (ppc64_elf_edit_opd): Likewise.
1427         (ppc64_elf_tls_optimize): Likewise.
1428         (ppc64_elf_edit_toc): Likewise.
1429         (ppc64_elf_size_dynamic_sections): Likewise.
1430         (toc_adjusting_stub_needed): Likewise.
1431         (ppc64_elf_size_stubs): Likewise.
1432         (ppc64_elf_relocate_section): Likewise.
1433         * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
1434         reminding programmers to keep this structure in sync with the one
1435         defined in elf32-s390.c.
1436         (elf_s390_mkobject): Call bfd_elf_allocate_object.
1437         (is_s390_elf): New macro.  Checks a BFD to make sure that is an s390
1438         ELF bfd.
1439         (elf_s390_check_relocs): Use is_s390_elf macro to check    the bfd
1440         being processed.
1441         (elf_s390_size_dynamic_sections): Likewise.
1442         (elf_s390_relocate_section): Likewise.
1443         (elf_s390_check_relocs): Use elf_symtab_hdr.
1444         (elf_s390_gc_sweep_hook): Likewise.
1445         (elf_s390_size_dynamic_sections): Likewise.
1446         (elf_s390_relocate_section): Likewise.
1447         * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
1448         (is_x86_64_elf): New macro.  Checks a BFD to make sure that is an
1449         x86_64 ELF bfd.
1450         (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
1451         being processed.
1452         (elf64_x86_64_size_dynamic_sections): Likewise.
1453         (elf64_x86_64_relocate_section): Likewise.
1454         (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
1455         (elf64_x86_64_gc_sweep_hook): Likewise.
1456         (elf64_x86_64_size_dynamic_sections): Likewise.
1457         (elf64_x86_64_relocate_section): Likewise.
1458         * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
1459         (is_sparc_elf): New macro.  Checks a BFD to make sure that is a Sparc
1460         ELF bfd.
1461         (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
1462         bfd being processed.
1463         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1464         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1465         (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
1466         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1467         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1468         (_bfd_sparc_elf_relocate_section): Likewise.
1469
1470 2008-02-12  Alan Modra  <amodra@bigpond.net.au>
1471
1472         PR 5303, 5755
1473         * arange-set.c: Delete.
1474         * arange-set.h: Delete.
1475         * dwarf2.c: Revert 2007-09-21 changes.
1476         * Makefile.am: Likewise.
1477         * Makefile.in: Regenerate.
1478         * po/SRC-POTFILES.in: Regenerate.
1479
1480 2008-02-11  Bernd Schmidt  <bernd.schmidt@analog.com>
1481
1482         * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
1483         if necessary.
1484         (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
1485         mismatches are detected.
1486
1487         * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
1488         emit invalid relocs or rofixup entries for deleted .eh_frame entries.
1489
1490 2008-02-11  Daniel Jacobowitz  <dan@codesourcery.com>
1491
1492         * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
1493         was reached.
1494         * srec.c (srec_scan): Calculate the checksum.  Complain on mismatch.
1495
1496 2008-02-07  Alan Modra  <amodra@bigpond.net.au>
1497
1498         * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
1499         of _ovly_buf_table size.
1500         (spu_elf_build_stubs): Use low bit of .size as "present" bit.
1501         Adjust initialisations relating to _ovly_buf_table.
1502
1503 2008-02-04  Bob Wilson  <bob.wilson@acm.org>
1504
1505         * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
1506         relocation, do not continue processing it.  Ignore R_XTENSA_ASM_EXPAND
1507         relocations against dynamic symbols.
1508         (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
1509         .xt.lit section.
1510
1511 2008-02-04  Kai Tietz  <kai.tietz@onevision.com>
1512             H.J. Lu  <hongjiu.lu@intel.com>
1513
1514         PR 5715
1515         * warning.m4: Enable -Wno-format by default when using gcc on
1516         mingw.
1517         * configure: Regenerated.
1518
1519 2008-02-04  Adam Nemet  <anemet@caviumnetworks.com>
1520
1521         * archures.c: Update copyright.
1522         (bfd_mach_mips_octeon): New macro.
1523         * bfd-in2.h: Regenerate.
1524         * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
1525         (mips_set_isa_flags): Likewise.
1526         (mips_mach_extensions): Add Octeon.
1527         * cpu-mips.c: Update copyright.
1528         (I_mipsocteon): New enum constant.
1529         (arch_info_struct): Add Octeon.
1530
1531 2008-02-04  Alan Modra  <amodra@bigpond.net.au>
1532
1533         * elf32-spu.c (spu_elf_relocate_section): Correct return type.
1534         Return error status on unexpected relocation errors.
1535
1536 2008-02-04  Alan Modra  <amodra@bigpond.net.au>
1537
1538         PR ld/5692
1539         * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31.  Instead abort
1540         on non-ELF input.
1541         * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
1542         processing on non-ELF input.
1543
1544 2008-01-31  Marc Gauthier  <marc@tensilica.com>
1545
1546         * config.bfd (xtensa*-*-*): Recognize processor variants.
1547
1548 2008-01-31  Nick Clifton  <nickc@redhat.com>
1549
1550         PR ld/5692
1551         * elf.c (bfd_elf_get_elf_syms): Check the return value of
1552         get_elf_backend_data.
1553
1554 2008-01-28  Fabian Groffen  <grobian@gentoo.org>
1555
1556         * config.bfd (x86_64-*-solaris2): Add support for this target.
1557
1558 2008-01-28  Alan Modra  <amodra@bigpond.net.au>
1559
1560         Rewrite SPU overlay handling code.  Put overlay calls stubs in the
1561         overlays where possible.  Use a faster call stub, or optionally at
1562         compile time, a more compact stub.  Double size of _ovly_buf_table
1563         so that low bit of _ovly_table.buf can be used as a "present" bit.
1564         Reserve an extra _ovly_table entry for index zero.
1565         * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
1566         add new ones.
1567         (struct got_entry): New.
1568         (struct spu_stub_hash_entry): Delete.
1569         (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
1570         (spu_elf_link_hash_table_create): Adjust for struct changes.
1571         (spu_stub_name): Delete.
1572         (spu_elf_find_overlays): Don't track sections from overlay regions.
1573         Instead set ovl_buf number in spu elf section data.  Error if
1574         overlays in one region don't start at the same address.  Adjust
1575         for struct _spu_elf_section_data changes.
1576         (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
1577         (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
1578         (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
1579         (enum _insn_type): New.
1580         (count_stub, build_stub): New functions.
1581         (allocate_spuear_stubs): Use count_stub.
1582         (build_spuear_stubs): Use build_stub.
1583         (populate_stubs, sort_stubs): Delete.
1584         (process_stubs): New function.
1585         (write_one_stub): Delete.
1586         (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
1587         (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
1588         (maybe_insert_function, check_function_ranges): Likewise.
1589         (find_function, pasted_function, build_call_tree): Likewise.
1590         (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
1591         (spu_elf_modify_program_headers): Likewise.
1592         (interesting_section): Detect stub sections differently.  Delete
1593         htab param, adjust all callers.
1594         (spu_elf_relocate_section): Rewrite stub handling.
1595         (spu_elf_output_symbol_hook): Likewise.
1596         (bfd_elf32_bfd_link_hash_table_free): Delete.
1597         * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
1598         output-only fields into a union.  Add ovl_buf.
1599         (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
1600
1601 2008-01-25  DJ Delorie  <dj@redhat.com>
1602
1603         * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
1604
1605 2008-01-25  Kai Tietz  <kai.tietz@onevision.com>
1606
1607         * bfd-in.h: Add mingw I64 support.
1608         * bfd-in2.h: Regenerated.
1609         * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
1610
1611 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
1612
1613         PR 4453
1614         * format.c (bfd_check_format_matches): Don't accept archives as
1615         fully matching unless they have a map.
1616
1617 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
1618
1619         * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
1620
1621 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
1622
1623         * ecoff.c (_bfd_ecoff_archive_p): Delete.
1624         * libecoff.h (_bfd_ecoff_archive_p): Delete.
1625         * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
1626         * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
1627         (ecoff_biglittle_vec): Likewise.
1628
1629 2008-01-19  Alan Modra  <amodra@bigpond.net.au>
1630
1631         PR 5646
1632         * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
1633         non-NULL before dereferencing.
1634
1635 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
1636
1637         PR 5604
1638         * elf-bfd.h (struct elf_backend_data): Add gc_keep.  Remove param
1639         names from others.
1640         (_bfd_elf_gc_keep): Declare.
1641         * elfxx-target.h (elf_backend_gc_keep): Define.
1642         (elfNN_bed): Init new field.
1643         * elflink.c (_bfd_elf_gc_keep): New function.
1644         (bfd_elf_gc_sections): Call gc_keep.
1645         * elf64-ppc.c (elf_backend_gc_keep): Define.
1646         (struct _ppc64_elf_section_data): Move .opd related fields to
1647         a struct so they don't occupy the same storage.  Adjust accesses
1648         throughout file.
1649         (ppc64_elf_gc_keep): New function, split out from..
1650         (ppc64_elf_gc_mark_hook): ..here.  Don't call _bfd_elf_gc_mark
1651         to mark .opd section, just set gc_mark.
1652         (ppc64_elf_edit_opd): Remove no_opd_opt parm.  Don't set opd->adjust
1653         unless we are changing .opd.  Test non-NULL opd->adjust at all
1654         accesses throughout file.
1655         * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
1656
1657 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
1658
1659         * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
1660         * bfd-in2.h: Regenerate.
1661
1662 2008-01-11  Tristan Gingold  <gingold@adacore.com>
1663             Eric Botcazou  <ebotcazou@adacore.com>
1664
1665         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
1666         relocatable.
1667         * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
1668         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
1669         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
1670         * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
1671         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
1672         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
1673         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
1674         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
1675         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
1676         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
1677         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
1678         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
1679         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
1680         * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
1681         * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1682         * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
1683         or executable output with relocations.
1684
1685 2008-01-09  Nick Clifton  <nickc@redhat.com>
1686
1687         PR gas/5552
1688         * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
1689         to FALSE for all relocs.
1690
1691 2008-01-09  Richard Sandiford  <rsandifo@nildram.co.uk>
1692
1693         PR ld/5526
1694         * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
1695         fields.  Rename u.cie.u.merged to u.cie.u.merged_with.
1696         (eh_frame_sec_info): Add a cies field.
1697         (eh_frame_hdr_info): Add a merge_cies field.
1698         * elf-eh-frame.c (cie): Add a reloc_index member to the personality
1699         union.
1700         (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
1701         of hdr_info->cies.
1702         (_bfd_elf_parse_eh_frame): Remove tmp_cie.  Ccreate an array of
1703         cie structures in all cases and use it instead of extended_cies.
1704         If merging, store the cie array in sec_info->cies and point each
1705         CIE's eh_fde_cie at the associated element.  Do not try to
1706         calculate the value of the personality routine here; record the
1707         offset of the relocation instead.  Do not merge CIEs here.
1708         (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
1709         (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
1710         (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
1711         (find_merged_cie): New function.
1712         (_bfd_elf_gc_mark_fdes): Use it.  Free sec_info->cies.
1713
1714 2008-01-07  Nick Clifton  <nickc@redhat.com>
1715
1716         PR binutils/5535
1717         * vms.c (vms_close_and_cleanup): Check for the presence of a
1718         vms_private_data_struct before examining any of its fields.
1719
1720 2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>
1721
1722         PR ld/5522
1723         * elflink.c (elf_link_input_bfd): Don't write out a section if
1724         its output section is marked with SEC_NEVER_LOAD.
1725
1726 For older changes see ChangeLog-2007
1727 \f
1728 Local Variables:
1729 mode: change-log
1730 left-margin: 8
1731 fill-column: 74
1732 version-control: never
1733 End: