a283f597d1870a89aba8c68531a05b0f160f2e0e
[external/binutils.git] / bfd / ChangeLog
1 2008-02-12  Nick Clifton  <nickc@redhat.com>
2
3         PR ld/5692
4         * elf-bfd.h (enum elf_object_id): New enum, used to identify
5         target specific extensions to the elf_obj_tdata structure.
6         (struct elf_obj_tdata): New field 'object_id'.
7         (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
8         macros for accessing fields in the elf_obj_tdata structure.
9         (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
10         (bfd_elf_allocate_object): New function.
11         * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
12         and implement by calling bfd_elf_allocate_object.
13         (bfd_elf_allocate_object): New function: Allocates an
14         elf_obj_tdata structure, possibly with a target specific
15         extension.
16         * elfxx-target.h (bfd_elfNN_mkobject): Use
17         bfd_elf_make_generic_object as the default value.
18         * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
19         for consistency with other, similar structures.
20         (is_arm_elf): New macro.  Checks a BFD to make sure that is an ARM
21         ELF bfd.
22         (elf32_arm_mkobject): Call bfd_elf_allocate_object.
23         (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
24         the bfd being processed.
25         (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
26         (bfd_elf32_arm_set_target_relocs): Likewise.
27         (bfd_elf32_arm_final_link_relocate): Likewise.
28         (bfd_elf32_arm_copy_private_bfd_data): Likewise.
29         (bfd_elf32_arm_merge_eabi_attributes): Likewise.
30         (bfd_elf32_arm_merge_private_bfd_data): Likewise.
31         (bfd_elf32_arm_check_relocs): Likewise.
32         (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
33         (bfd_elf32_arm_size_dynamic_sections): Likewise.
34         (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
35         (bfd_elf32_arm_init_maps): Likewise.
36         (bfd_elf32_arm_final_link_relocate): Likewise.
37         (bfd_elf32_arm_relocate_section): Likewise.
38         (bfd_elf32_arm_gc_sweep_hook): Likewise.
39         (bfd_elf32_arm_check_relocs): Likewise.
40         (bfd_elf32_arm_size_dynamic_sections): Likewise.
41         * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
42         (is_i386_elf): New macro.  Checks a BFD to make sure that is an x86
43         ELF bfd.
44         (elf_i386_check_relocs): Use is_i386_elf macro to check    the bfd
45         being processed.
46         (elf_i386_size_dynamic_sections): Likewise.
47         (elf_i386_relocate_section): Likewise.
48         (elf_i386_check_relocs): Use elf_symtab_hdr.
49         (elf_i386_gc_sweep_hook): Likewise.
50         (elf_i386_size_dynamic_sections): Likewise.
51         (elf_i386_relocate_section): Likewise.
52         * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
53         (elf_create_pointer_linker_section): Use is_ppc_elf_target to
54         verify that the bfd before accessing target specific fields.
55         (ppc_elf_check_relocs): Likewise.
56         (elf_finish_pointer_linker_section): Likewise.
57         (elf_create_pointer_linker_section): Use elf_symtab_hdr.
58         (ppc_elf_check_relocs): Likewise.
59         (ppc_elf_gc_sweep_hook): Likewise.
60         (ppc_elf_tls_optimize): Likewise.
61         (ppc_elf_size_dynamic_sections): Likewise.
62         (ppc_elf_relax_section): Likewise.
63         (ppc_elf_relocate_section): Likewise.
64         * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
65         reminding programmers to keep this structure in sync with the one
66         defined in elf64-s390.c.
67         (elf_s390_mkobject): Call bfd_elf_allocate_object.
68         (is_s390_elf): New macro.  Checks a BFD to make sure that is an s390
69         ELF bfd.
70         (elf_s390_check_relocs): Use is_s390_elf macro to check    the bfd
71         being processed.
72         (elf_s390_size_dynamic_sections): Likewise.
73         (elf_s390_relocate_section): Likewise.
74         (elf_s390_check_relocs): Use elf_symtab_hdr.
75         (elf_s390_gc_sweep_hook): Likewise.
76         (elf_s390_size_dynamic_sections): Likewise.
77         (elf_s390_relocate_section): Likewise.   
78         * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
79         (is_sh_elf): New macro.  Checks a BFD to make sure that is an SH
80         ELF bfd.
81         (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
82         bfd being processed.
83         (sh_elf_relocate_section): Likewise.
84         (sh_elf_check_relocs): Likewise.
85         (sh_elf_copy_private_data): Likewise.
86         (sh_elf_relax_section): Use elf_symtab_hdr.
87         (sh_elf_size_dynamic_sections): Likewise.
88         (sh_elf_relocate_section): Likewise.
89         (sh_elf_get_relocated_section_contents): Likewise.
90         (sh_elf_gc_sweep_hook): Likewise.
91         (sh_elf_check_relocs): Likewise.
92         * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
93         (is_alpha_elf): New macro.  Checks a BFD to make sure that is an
94         Alpha ELF bfd.
95         (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
96         the bfd being processed.
97         (elf64_alpha_create_dynamic_section): Likewise.
98         (elf64_alpha_check_relocs): Likewise.
99         (elf64_alpha_size_got_sections): Likewise.
100         (elf64_alpha_relax_section): Likewise.
101         (elf64_alpha_relocate_section): Likewise.
102         (elf64_alpha_final_link): Likewise.
103         (elf64_alpha_check_relocs): Use elf_symtab_hdr.
104         (elf64_alpha_relax_section): Likewise.
105         (elf64_alpha_relocate_section_r): Likewise.
106         (elf64_alpha_relocate_section): Likewise.
107         * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
108         (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
109         being processed.
110         (opd_entry_value): Likewise.
111         (allocate_dynrelocs): Likewise.
112         (ppc64_elf_relocate_section): Likewise.
113         (ppc64_elf_check_relocs): Use elf_symtab_hdr.
114         (opd_entry_value): Likewise.
115         (ppc64_elf_gc_sweep_hook): Likewise.
116         (get_sym_h): Likewise.
117         (ppc64_elf_edit_opd): Likewise.
118         (ppc64_elf_tls_optimize): Likewise.
119         (ppc64_elf_edit_toc): Likewise.
120         (ppc64_elf_size_dynamic_sections): Likewise.
121         (toc_adjusting_stub_needed): Likewise.
122         (ppc64_elf_size_stubs): Likewise.
123         (ppc64_elf_relocate_section): Likewise.
124         * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
125         reminding programmers to keep this structure in sync with the one
126         defined in elf32-s390.c.
127         (elf_s390_mkobject): Call bfd_elf_allocate_object.
128         (is_s390_elf): New macro.  Checks a BFD to make sure that is an s390
129         ELF bfd.
130         (elf_s390_check_relocs): Use is_s390_elf macro to check    the bfd
131         being processed.
132         (elf_s390_size_dynamic_sections): Likewise.
133         (elf_s390_relocate_section): Likewise.   
134         (elf_s390_check_relocs): Use elf_symtab_hdr.
135         (elf_s390_gc_sweep_hook): Likewise.
136         (elf_s390_size_dynamic_sections): Likewise.
137         (elf_s390_relocate_section): Likewise.
138         * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
139         (is_x86_64_elf): New macro.  Checks a BFD to make sure that is an
140         x86_64 ELF bfd.
141         (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
142         being processed.
143         (elf64_x86_64_size_dynamic_sections): Likewise.
144         (elf64_x86_64_relocate_section): Likewise.
145         (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
146         (elf64_x86_64_gc_sweep_hook): Likewise.
147         (elf64_x86_64_size_dynamic_sections): Likewise.
148         (elf64_x86_64_relocate_section): Likewise.
149         * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
150         (is_sparc_elf): New macro.  Checks a BFD to make sure that is a Sparc
151         ELF bfd.
152         (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
153         bfd being processed.
154         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
155         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
156         (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
157         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
158         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
159         (_bfd_sparc_elf_relocate_section): Likewise. 
160
161 2008-02-12  Alan Modra  <amodra@bigpond.net.au>
162
163         PR 5303, 5755
164         * arange-set.c: Delete.
165         * arange-set.h: Delete.
166         * dwarf2.c: Revert 2007-09-21 changes.
167         * Makefile.am: Likewise.
168         * Makefile.in: Regenerate.
169         * po/SRC-POTFILES.in: Regenerate.
170
171 2008-02-11  Bernd Schmidt  <bernd.schmidt@analog.com>
172
173         * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
174         if necessary.
175         (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
176         mismatches are detected.
177
178         * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
179         emit invalid relocs or rofixup entries for deleted .eh_frame entries.
180
181 2008-02-11  Daniel Jacobowitz  <dan@codesourcery.com>
182
183         * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
184         was reached.
185         * srec.c (srec_scan): Calculate the checksum.  Complain on mismatch.
186
187 2008-02-07  Alan Modra  <amodra@bigpond.net.au>
188
189         * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
190         of _ovly_buf_table size.
191         (spu_elf_build_stubs): Use low bit of .size as "present" bit.
192         Adjust initialisations relating to _ovly_buf_table.
193
194 2008-02-04  Bob Wilson  <bob.wilson@acm.org>
195         
196         * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
197         relocation, do not continue processing it.  Ignore R_XTENSA_ASM_EXPAND
198         relocations against dynamic symbols.
199         (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
200         .xt.lit section.
201         
202 2008-02-04  Kai Tietz  <kai.tietz@onevision.com>
203             H.J. Lu  <hongjiu.lu@intel.com>
204
205         PR 5715
206         * warning.m4: Enable -Wno-format by default when using gcc on
207         mingw.
208         * configure: Regenerated.
209
210 2008-02-04  Adam Nemet  <anemet@caviumnetworks.com>
211
212         * archures.c: Update copyright.
213         (bfd_mach_mips_octeon): New macro.
214         * bfd-in2.h: Regenerate.
215         * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
216         (mips_set_isa_flags): Likewise.
217         (mips_mach_extensions): Add Octeon.
218         * cpu-mips.c: Update copyright.
219         (I_mipsocteon): New enum constant.
220         (arch_info_struct): Add Octeon.
221
222 2008-02-04  Alan Modra  <amodra@bigpond.net.au>
223
224         * elf32-spu.c (spu_elf_relocate_section): Correct return type.
225         Return error status on unexpected relocation errors.
226
227 2008-02-04  Alan Modra  <amodra@bigpond.net.au>
228
229         PR ld/5692
230         * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31.  Instead abort
231         on non-ELF input.
232         * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
233         processing on non-ELF input.
234
235 2008-01-31  Marc Gauthier  <marc@tensilica.com>
236
237         * config.bfd (xtensa*-*-*): Recognize processor variants.
238
239 2008-01-31  Nick Clifton  <nickc@redhat.com>
240
241         PR ld/5692
242         * elf.c (bfd_elf_get_elf_syms): Check the return value of
243         get_elf_backend_data.
244
245 2008-01-28  Fabian Groffen  <grobian@gentoo.org>
246
247         * config.bfd (x86_64-*-solaris2): Add support for this target.
248
249 2008-01-28  Alan Modra  <amodra@bigpond.net.au>
250
251         Rewrite SPU overlay handling code.  Put overlay calls stubs in the
252         overlays where possible.  Use a faster call stub, or optionally at
253         compile time, a more compact stub.  Double size of _ovly_buf_table
254         so that low bit of _ovly_table.buf can be used as a "present" bit.
255         Reserve an extra _ovly_table entry for index zero.
256         * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
257         add new ones.
258         (struct got_entry): New.
259         (struct spu_stub_hash_entry): Delete.
260         (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
261         (spu_elf_link_hash_table_create): Adjust for struct changes.
262         (spu_stub_name): Delete.
263         (spu_elf_find_overlays): Don't track sections from overlay regions.
264         Instead set ovl_buf number in spu elf section data.  Error if
265         overlays in one region don't start at the same address.  Adjust
266         for struct _spu_elf_section_data changes.
267         (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
268         (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
269         (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
270         (enum _insn_type): New.
271         (count_stub, build_stub): New functions.
272         (allocate_spuear_stubs): Use count_stub.
273         (build_spuear_stubs): Use build_stub.
274         (populate_stubs, sort_stubs): Delete.
275         (process_stubs): New function.
276         (write_one_stub): Delete.
277         (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
278         (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
279         (maybe_insert_function, check_function_ranges): Likewise.
280         (find_function, pasted_function, build_call_tree): Likewise.
281         (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
282         (spu_elf_modify_program_headers): Likewise.
283         (interesting_section): Detect stub sections differently.  Delete
284         htab param, adjust all callers.
285         (spu_elf_relocate_section): Rewrite stub handling.
286         (spu_elf_output_symbol_hook): Likewise.
287         (bfd_elf32_bfd_link_hash_table_free): Delete.
288         * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
289         output-only fields into a union.  Add ovl_buf.
290         (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
291
292 2008-01-25  DJ Delorie  <dj@redhat.com>
293
294         * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
295
296 2008-01-25  Kai Tietz  <kai.tietz@onevision.com>
297
298         * bfd-in.h: Add mingw I64 support.
299         * bfd-in2.h: Regenerated.
300         * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
301
302 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
303
304         PR 4453
305         * format.c (bfd_check_format_matches): Don't accept archives as
306         fully matching unless they have a map.
307
308 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
309
310         * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
311
312 2008-01-21  Alan Modra  <amodra@bigpond.net.au>
313
314         * ecoff.c (_bfd_ecoff_archive_p): Delete.
315         * libecoff.h (_bfd_ecoff_archive_p): Delete.
316         * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
317         * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
318         (ecoff_biglittle_vec): Likewise.
319
320 2008-01-19  Alan Modra  <amodra@bigpond.net.au>
321
322         PR 5646
323         * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
324         non-NULL before dereferencing.
325
326 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
327
328         PR 5604
329         * elf-bfd.h (struct elf_backend_data): Add gc_keep.  Remove param
330         names from others.
331         (_bfd_elf_gc_keep): Declare.
332         * elfxx-target.h (elf_backend_gc_keep): Define.
333         (elfNN_bed): Init new field.
334         * elflink.c (_bfd_elf_gc_keep): New function.
335         (bfd_elf_gc_sections): Call gc_keep.
336         * elf64-ppc.c (elf_backend_gc_keep): Define.
337         (struct _ppc64_elf_section_data): Move .opd related fields to
338         a struct so they don't occupy the same storage.  Adjust accesses
339         throughout file.
340         (ppc64_elf_gc_keep): New function, split out from..
341         (ppc64_elf_gc_mark_hook): ..here.  Don't call _bfd_elf_gc_mark
342         to mark .opd section, just set gc_mark.
343         (ppc64_elf_edit_opd): Remove no_opd_opt parm.  Don't set opd->adjust
344         unless we are changing .opd.  Test non-NULL opd->adjust at all
345         accesses throughout file.
346         * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
347
348 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
349
350         * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
351         * bfd-in2.h: Regenerate.
352
353 2008-01-11  Tristan Gingold  <gingold@adacore.com>
354             Eric Botcazou  <ebotcazou@adacore.com>
355
356         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
357         relocatable.
358         * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
359         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
360         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
361         * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
362         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
363         * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
364         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
365         * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
366         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
367         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
368         * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
369         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
370         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
371         * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
372         * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
373         * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
374         or executable output with relocations.
375
376 2008-01-09  Nick Clifton  <nickc@redhat.com>
377
378         PR gas/5552
379         * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
380         to FALSE for all relocs.
381
382 2008-01-09  Richard Sandiford  <rsandifo@nildram.co.uk>
383
384         PR ld/5526
385         * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
386         fields.  Rename u.cie.u.merged to u.cie.u.merged_with.
387         (eh_frame_sec_info): Add a cies field.
388         (eh_frame_hdr_info): Add a merge_cies field.
389         * elf-eh-frame.c (cie): Add a reloc_index member to the personality
390         union.
391         (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
392         of hdr_info->cies.
393         (_bfd_elf_parse_eh_frame): Remove tmp_cie.  Ccreate an array of
394         cie structures in all cases and use it instead of extended_cies.
395         If merging, store the cie array in sec_info->cies and point each
396         CIE's eh_fde_cie at the associated element.  Do not try to
397         calculate the value of the personality routine here; record the
398         offset of the relocation instead.  Do not merge CIEs here.
399         (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
400         (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
401         (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
402         (find_merged_cie): New function.
403         (_bfd_elf_gc_mark_fdes): Use it.  Free sec_info->cies.
404
405 2008-01-07  Nick Clifton  <nickc@redhat.com>
406
407         PR binutils/5535
408         * vms.c (vms_close_and_cleanup): Check for the presence of a
409         vms_private_data_struct before examining any of its fields.
410
411 2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>
412
413         PR ld/5522
414         * elflink.c (elf_link_input_bfd): Don't write out a section if
415         its output section is marked with SEC_NEVER_LOAD.
416
417 For older changes see ChangeLog-2007
418 \f
419 Local Variables:
420 mode: change-log
421 left-margin: 8
422 fill-column: 74
423 version-control: never
424 End: