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