1 2008-06-30 Richard Sandiford <rdsandiford@googlemail.com>
3 * syms.c (BSF_SYNTHETIC): New flag.
4 * elf.c (_bfd_elf_get_synthetic_symtab): Set it.
5 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
6 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
7 * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
9 * bfd-in2.h: Regenerate.
11 2008-06-30 Daniel Jacobowitz <dan@codesourcery.com>
13 * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
15 (arm_map_one_stub): Use | 1 when setting the low bit.
17 2008-06-29 Andreas Schwab <schwab@suse.de>
19 * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
20 addend on _GLOBAL_OFFSET_TABLE_.
22 2008-06-24 Daniel Jacobowitz <dan@codesourcery.com>
24 * elf32-arm.c (STUB_ENTRY_NAME): Define.
25 (arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
26 (arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
28 (struct elf32_arm_stub_hash_entry): Add output_name.
29 (arm_build_one_stub): Move offsets into the offset argument
30 of _bfd_final_link_relocate. Correct offset for
31 arm_thumb_arm_v4t_stub_long_branch.
32 (elf32_arm_size_stubs): Set stub_entry->output_name.
33 (elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
35 (elf32_arm_output_stub_sym): New.
36 (arm_map_one_stub): Correct formatting. Use elf32_arm_output_stub_sym.
38 2008-06-20 Alan Modra <amodra@bigpond.net.au>
40 * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
43 2008-06-20 Alan Modra <amodra@bigpond.net.au>
45 * elf32-spu.c (build_stub): Allow wraparound on stub branches.
46 (allocate_spuear_stubs, build_spuear_stubs): Return value from
47 count_stub/build_stub.
48 (spu_elf_build_stubs): Correct location of stub reloc error message.
50 2008-06-18 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
52 * elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD.
54 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
56 * configure: Regenerate.
58 2008-06-17 Alan Modra <amodra@bigpond.net.au>
60 * elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
61 (spu_elf_check_vma): Add extra_stack_space param, copy to htab.
62 (spu_elf_auto_overlay): Use it.
63 (RECURSE_UNMARK): Define as 0.
64 (unmark_overlay_section): Heed RECURSE_UNMARK.
65 * elf32-spu.h (spu_elf_check_vma): Update prototype.
67 2008-06-12 DJ Delorie <dj@redhat.com>
69 * elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.
71 2008-06-09 Paul Brook <paul@codesourcery.com>
74 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
77 2008-06-09 Christophe Lyon <christophe.lyon@st.com>
79 * elf32-arm.c (arm_stub_is_thumb): Define.
80 (elf32_arm_final_link_relocate): Handle near mode switching stubs.
82 2008-06-07 Alan Modra <amodra@bigpond.net.au>
84 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
87 2008-06-06 Paul Brook <paul@codesourcery.com>
90 * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
92 2008-06-06 Alan Modra <amodra@bigpond.net.au>
94 * elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
95 file names be unique. Specify archive:path in overlay script.
97 2008-06-05 Alan Modra <amodra@bigpond.net.au>
100 * elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
102 2008-06-04 Alan Modra <amodra@bigpond.net.au>
104 * elf.c (ignore_section_sym): Don't test section sym value here.
105 (elf_map_symbols): Instead check zero value here as was done prior
106 to 2006-05-26 change.
108 2008-06-04 Nick Clifton <nickc@redhat.com>
111 * elf32-avr.c (elf32_avr_relax_section): Handle the case where
112 there are no local symbols.
114 2008-06-04 Alan Modra <amodra@bigpond.net.au>
116 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
117 (process_stubs): Likewise.
118 (discover_functions): Don't used cached symbols.
119 (maybe_insert_function): Correct condition under which function
121 (mark_functions_via_relocs): Delete unused variable.
123 2008-05-30 Frediano Ziglio <frediano.ziglio@vodafone.com>
124 Nick Clifton <nickc@redhat.com>
127 * elf64-hppa.c (allocate_global_data_opd): Default to using the
128 dynamic symbol table for local function names in shared libraries.
130 2008-05-29 Jan Kratochvil <jan.kratochvil@redhat.com>
132 * elf.c (assign_file_positions_for_load_sections): Adjust pre-section
133 gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
135 2008-05-28 Alan Modra <amodra@bigpond.net.au>
137 * elf32-spu.c (spu_elf_object_p): New function.
138 (elf_backend_object_p): Define.
139 (build_stub): Correct second word of 8 byte overlay stubs.
140 (spu_elf_relocate_section): Formatting.
142 2008-05-24 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
144 * elf.c (elfcore_write_register_note): New function.
145 * elf-bfd.h (elfcore_write_register_note): New prototype.
147 2008-05-22 Christophe Lyon <christophe.lyon@st.com>
149 * elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
150 (elf32_arm_stub_add_mapping_symbol): Remove.
151 (elf32_arm_add_stub): Don't generate mapping symbols. Change
153 (elf32_arm_size_stubs): Use new elf32_arm_add_stub
154 prototype. Don't generate thumb to arm glue for calls.
155 (arm_map_one_stub): Define.
156 (elf32_arm_output_arch_local_syms): Generate mapping symbols for
159 2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
161 Add multi-GOT support for m68k.
162 * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
164 (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
165 struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
166 struct elf_m68k_multi_got): New data structures.
167 (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
168 allow_multigot_p, multi_got_): New fields.
169 (elf_m68k_multi_got): New macro.
170 (elf_m68k_link_hash_newfunc): Initialize new fields of
171 struct elf_m68k_link_hash_entry.
172 (elf_m68k_link_hash_table_create): Initialize new fields of
173 struct elf_m68k_link_hash_table.
174 (elf_m68k_link_hash_table_free): New static function implementing hook.
175 (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
176 static functions for struct elf_m68k_got.
177 (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
178 elf_m68k_got_entry_eq): New static functions for
179 struct elf_m68k_got_entry.
180 (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
181 ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
182 (enum elf_m68k_get_entry_howto): New enum.
183 (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
184 elf_m68k_remove_got_entry_type): New static functions for
185 struct elf_m68k_got_entry.
186 (elf_m68k_add_entry_to_got): New static function.
187 (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
188 elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
189 functions for struct elf_m68k_bfd2got_entry.
190 (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
191 elf_m68k_can_merge_gots): New traversal.
192 (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
193 elf_m68k_merge_gots): Ditto.
194 (struct elf_m68k_finalize_got_offsets_arg,
195 elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
196 (struct elf_m68k_partition_multi_got_arg,
197 elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
198 elf_m68k_partition_multi_got): Ditto.
199 (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
201 (elf_m68k_copy_indirect_symbol): New static function implementing
203 (elf_m68k_check_relocs): Update to add entries to multi-GOT.
204 (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
205 (elf_m68k_always_size_sections): Assign BFDs to GOTs.
206 (elf_m68k_relocate_section): Update to properly handle GOT relocations.
207 (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
209 (bfd_elf_m68k_set_target_options): New function.
210 (bfd_elf32_bfd_link_hash_table_free): Define hook.
211 (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
212 to skip generic calculation of GOT offsets.
213 (elf_backend_copy_indirect_symbol): Define hook.
214 * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
215 * bfd-in2.h: Regenerate.
217 2008-05-21 André Johansen <andrejoh@gmail.com>
220 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
221 for filenames in function tables and variable tables.
223 2008-05-19 Alan Modra <amodra@bigpond.net.au>
226 * elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
227 vma when all p_paddr fields are zero and there is more than
230 2008-05-15 Christophe Lyon <christophe.lyon@st.com>
232 Add long call support for ARM.
233 * elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
234 (THM2_MAX_BWD_BRANCH_OFFSET): Define.
235 (ARM_MAX_FWD_BRANCH_OFFSET): Define.
236 (ARM_MAX_BWD_BRANCH_OFFSET): Define.
237 (THM_MAX_FWD_BRANCH_OFFSET): Define.
238 (THM_MAX_BWD_BRANCH_OFFSET): Define.
239 (arm_long_branch_stub): Define.
240 (arm_pic_long_branch_stub): Define.
241 (arm_thumb_v4t_long_branch_stub): Define.
242 (arm_thumb_thumb_long_branch_stub): Define.
243 (arm_thumb_arm_v4t_long_branch_stub): Define.
244 (STUB_SUFFIX): Define.
245 (elf32_arm_stub_type): Define.
246 (elf32_arm_stub_hash_entry): Define.
247 (elf32_arm_link_hash_entry): Add stub_cache field.
248 (arm_stub_hash_lookup): Define.
249 (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
250 add_stub_section, layout_sections_again, stub_group, bfd_count,
251 top_index, input_list fields.
252 (elf32_arm_link_hash_newfunc): Init new field.
253 (stub_hash_newfunc): New function.
254 (elf32_arm_link_hash_table_create): Init stub_hash_table.
255 (elf32_arm_hash_table_free): New function.
256 (arm_type_of_stub): New function.
257 (elf32_arm_stub_name): New function.
258 (elf32_arm_get_stub_entry): New function.
259 (elf32_arm_stub_add_mapping_symbol): New function.
260 (elf32_arm_add_stub): New function.
261 (arm_build_one_stub): New function.
262 (arm_size_one_stub): New function.
263 (elf32_arm_setup_section_lists): New function.
264 (elf32_arm_next_input_section): New function.
265 (group_sections): New function.
266 (elf32_arm_size_stubs): New function.
267 (elf32_arm_build_stubs): New function.
268 (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
269 (bfd_elf32_arm_process_before_allocation): No longer handle
270 R_ARM_CALL and R_ARM_THM_CALL.
271 (using_thumb_only): New function.
272 (elf32_arm_final_link_relocate): Redirect calls to stub if range
273 exceeds encoding capabilities.
274 (bfd_elf32_bfd_link_hash_table_free): Define.
275 * bfd-in.h (R_ARM_max): Fix value to 130.
276 (elf32_arm_setup_section_lists): Protype.
277 (elf32_arm_next_input_section): Protype.
278 (elf32_arm_size_stubs): Protype.
279 (elf32_arm_build_stubs): Protype.
280 * bfd-in2.h: Regenerate.
282 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
284 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
285 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
287 2008-05-14 Alan Modra <amodra@bigpond.net.au>
289 * Makefile.am: Run "make dep-am".
290 * Makefile.in: Regenerate.
292 2008-05-14 Ulrich Weigand <uweigand@de.ibm.com>
293 Alan Modra <amodra@bigpond.net.au>
295 * elf32-ppc.c (section_covers_vma): New function.
296 (ppc_elf_get_synthetic_symtab): New function.
297 (bfd_elf32_get_synthetic_symtab): Define.
298 * elf64-ppc.c (section_covers_vma): New function.
299 (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
300 table entries, and __glink_PLTresolve on resolver stub.
301 (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
303 2008-05-12 Alan Modra <amodra@bigpond.net.au>
306 * elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
307 (must_be_dyn_reloc): New function.
308 (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
310 (ppc_elf_tls_optimize): Optimise pies.
311 (ppc_elf_relocate_section): Use a section symbol rather than no
312 symbol if possible for LD->IE TLS sequence, but don't error if
313 we must use no symbol.
314 * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
315 (must_be_dyn_reloc): Likewise.
316 (ppc64_elf_check_relocs): Likewise.
317 (ppc64_elf_tls_optimize): Likewise.
318 (ppc64_elf_relocate_section): Likewise.
320 2008-05-12 Alan Modra <amodra@bigpond.net.au>
322 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym.
324 2008-05-10 Paul Pluzhnikov <ppluzhnikov@google.com>
326 * elfcore.h (elf_core_file_p): Warn about core truncation.
328 2008-05-07 Bob Wilson <bob.wilson@acm.org>
330 * elf32-xtensa.c (xtensa_property_section_name): New.
331 (xtensa_make_property_section): New.
332 (xtensa_get_property_section): Make static. Do not create a new
333 section if it does not exist.
335 2008-05-08 Alan Modra <amodra@bigpond.net.au>
337 * elf32-spu.c (spu_elf_special_sections): Add "._ea".
338 (spu_elf_relocate_section): Handle relocations against symbols
339 defined in ._ea specially.
341 2008-05-03 Daniel Jacobowitz <dan@codesourcery.com>
343 * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
345 (elf32_arm_symbian_plt_sym_val): New.
346 (elf_backend_plt_sym_val): Define.
348 2008-05-03 Alan Modra <amodra@bigpond.net.au>
351 * elf.c (rewrite_elf_program_header): Rather than clearing
352 p_paddr_valid at end, don't set it in the first place. Delete
353 comment no longer relevant. When not p_paddr_valid, don't set
354 paddr from vaddr, and don't set p_vaddr_offset.
356 2008-05-01 Cary Coutant <ccoutant@google.com>
358 * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
359 corrupt string table.
361 2008-05-01 Joel Brobecker <brobecker@adacore.com>
363 * cache.c (cache_bread_1): Renames cache_bread.
364 (cache_bread): New function.
366 2008-05-01 Alan Modra <amodra@bigpond.net.au>
369 * elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
370 (assign_file_positions_for_load_sections): Combine nested "if".
371 (copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
372 when all header p_paddr fields are zero.
374 2008-04-30 Edmar Wienskoski <edmar@freescale.com>
376 * cpu-powerpc.c (bfd_powerpc_archs): Add e500mc entry.
378 2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
380 * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
381 (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
382 even if they are not loaded.
383 * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
386 2008-04-25 Jay Foad <jay.foad@gmail.com>
388 * reloc16.c (bfd_coff_reloc16_get_value): Add support for
389 undefined weak symbols.
391 2008-04-25 Nick Clifton <nickc@redhat.com>
393 * po/vi.po: Updated Vietnamese translation.
395 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
397 * aclocal.m4: Regenerate.
398 * configure: Regenerate.
400 2008-04-21 Cary Coutant <ccoutant@google.com>
402 * archive.c (_bfd_write_archive_contents): Fix incorrect use of
405 2008-04-21 Nathan Sidwell <nathan@codesourcery.com>
407 * elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
408 set the value of undefined symbols in shared objects.
409 (_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
410 undefined symbols unless pointer equality is needed.
412 2008-04-18 Dennis Roberts <dennis.roberts@sunquestinfo.com>
414 * aix5ppc-core.c: Define macros for the default architecture and
415 machine for matching core files.
416 (xcoff64_core_p): Set the architecture and machine to the default
417 values defined in the macros mentioned above.
418 * rs6000-core.c: Define macros to determine whether or not the
419 core file header uses the core_dumpxx header format.
420 (rs6000coff_core_p): Don't match core files that use the
421 core_dumpxx header format.
423 2008-04-16 Pedro Alves <pedro@codesourcery.com>
425 * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add.
427 2008-04-16 David S. Miller <davem@davemloft.net>
429 * reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
430 BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
431 BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
432 * libbfd.h: Regnerate.
433 * bfd-in2.h: Regenerate.
434 * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
436 (sparc_reloc_map): Likewise.
437 (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
439 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
440 (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
441 R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
442 R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
443 Simply ignore R_SPARC_GOTDATA_OP relocations.
445 2008-04-14 Aurelien Jarno <aurelien@aurel32.net>
447 * configure.in: Link with the PIC version of libiberty on
449 * configure: Regenerate.
451 2008-04-14 Edmar Wienskoski <edmar@freescale.com>
453 * archures.c: Add bfd_mach_ppc_e500mc.
454 * bfd-in2.h: Regenerate.
456 2008-04-08 Alan Modra <amodra@bigpond.net.au>
458 * elf32-spu.c (spu_elf_build_stubs): Correct error message.
459 (mark_functions_via_relocs): Remove premature init of symtab_hdr.
460 (collect_overlays): Commment typo fix.
462 2008-04-08 Kees Cook <kees@canonical.com>
464 * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
467 2008-04-08 Alan Modra <amodra@bigpond.net.au>
469 * elf32-spu.c: Include libiberty.h.
470 (struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
471 non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
472 spu_elf_relink, auto_overlay fields.
473 (AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
474 (needs_ovl_stub): Flip test so that call to non-function warning
475 is emitted during relocate_section rather than earlier.
476 (spu_elf_check_vma): Stash --auto-overlay parameters, and clear
477 auto_overlay if no section exceeds local store.
478 (struct call_info): Add count, max_depth, is_pasted fields.
479 (struct function_info): Add rodata, last_caller, call_count,
480 depth, new visit flags.
481 (insert_callee): Increment call count.
482 (copy_callee): New function.
483 (mark_functions_via_relocs): Investigate all reloc types to count
484 possible function pointer stubs for --auto-overlay. Track
485 last_caller and increment function call_count.
486 (pasted_function): Insert a "call" into call info for pasted section.
487 (remove_cycles): Track max depth of calls. Don't emit call graph
488 pruning warning for --auto-overlay.
489 (build_call_tree): Don't transfer_calls for --auto-overlay.
490 Adjust remove_cycles call.
491 (sort_calls, sort_lib, sort_bfds): New functions.
492 (struct _mos_param, struct _uos_param, struct _cl_param): New.
493 (mark_overlay_section, unmark_overlay_section): New functions.
494 (collect_lib_sectios, auto_ovl_lib_functions): New functions.
495 (collect_overlays, find_pasted_call): New functions.
496 (sum_stack): Deal with is_pasted "calls". Exit before printing
498 (spu_elf_auto_overlay): New function.
499 (spu_elf_final_link): Call spu_elf_auto_overlay.
500 * elf32-spu.h (spu_elf_check_vma): Update prototype.
502 2008-04-07 Alan Modra <amodra@bigpond.net.au>
504 * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
505 is defined in overlay section before creating a stub.
506 (build_spuear_stubs): Likewise.
507 (spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
509 2008-04-02 Alan Modra <amodra@bigpond.net.au>
511 * elf32-spu.c (insert_callee): Reorder call list so most recent
512 call is always first.
513 (interesting_section): Move.
514 (mark_functions_via_relocs): Fold interesting_section and
515 reloc_count tests in callers to here. Simplify output section
517 (discover_functions): Set "gaps" when no symbols and some
518 "interesting_section". Run pasted_function loop for no symbol
520 (for_each_node, transfer_calls): New functions.
521 (mark_non_root): Adjust to suit for_each_node.
522 (call_graph_traverse): Likewise. Fix memory leak. Rename to..
523 (remove_cycles): ..this.
524 (build_call_tree): Use for_each_node and transfer_calls.
525 (struct _sum_stack_param): New.
526 (sum_stack): Adjust to suit for_each_node. Return error on
527 malloc failure. Move code to print root node cumulative stack from..
528 (spu_elf_stack_analysis): ..here. Use for_each_node.
530 2008-03-31 Cary Coutant <ccoutant@google.com>
533 * archive.c (_bfd_slurp_extended_name_table): Change
534 ARFMAG[0] to ARFMAG[1].
535 (_bfd_construct_extended_name_table): Likewise.
537 2008-03-31 Daniel Jacobowitz <dan@codesourcery.com>
539 * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
540 (_bfd_mips_elf_check_relocs): Update comments. Always call
541 mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
543 2008-03-27 Cary Coutant <ccoutant@google.com>
545 Add support for thin archives.
546 * archive.c (_bfd_find_nested_archive): New function.
547 (get_extended_arelt_filename): Add origin parameter.
548 (_bfd_generic_read_ar_hdr_mag): Deal with extended name
549 combined with a file offset.
550 (append_relative_path): New function.
551 (_bfd_get_elt_at_filepos): Deal with external members and
553 (bfd_generic_openr_next_archived_file): Thin archives.
554 (bfd_generic_archive_p): Recognize new magic string.
555 (adjust_relative_path): New function.
556 (_bfd_construct_extended_name_table): Construct extended
557 names for thin archive members.
558 (_bfd_write_archive_contents): Emit new magic string, skip
559 copying files for thin archives.
560 * bfd-in.h (bfd_is_thin_archive): New macro.
561 * bfd.c (struct bfd): New fields for thin archives.
562 * libbfd-in.h (struct areltdata): New field for thin archives.
563 * opncls.c (bfd_close): Delete BFDs for nested archives.
565 2008-03-25 Bernd Schmidt <bernd.schmidt@analog.com>
567 * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
568 _bfd_final_link_relocate that also handles R_pcrel24 relocs.
569 (bfinfdpic_relocate_section, bfin_relocate_section): Use it.
571 2008-03-25 Nathan Sidwell <nathan@codesourcery.com>
573 * elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
574 in vxworks tls_vars sections.
575 (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
576 * elf32-i386.c (allocate_dynrelocs,
577 elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
578 * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
579 ppc_elf_relocate_section): Likewise.
580 * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
581 sh_elf_relocate_section): Likewise.
582 * elfxx-sparc.c (allocate_dynrelocs,
583 _bfd_sparc_elf_size_dynamic_sections,
584 _bfd_sparc_elf_relocate_section): Likewise.
586 2008-03-21 Adam Nemet <anemet@caviumnetworks.com>
588 * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
589 print the values from the dynamic section.
591 2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
593 * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
594 (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
596 2008-03-20 Alan Modra <amodra@bigpond.net.au>
598 * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
599 (spu_elf_find_overlays, spu_elf_size_stubs): Likewise
600 (process_stubs, discover_functions, build_call_tree): Likewise.
601 (spu_elf_stack_analysis): Likewise.
602 (spu_elf_check_vma): Likewise. Move.
603 (struct call_info): Make "is_tail" a bitfield.
604 (insert_callee): Clear fun->start and set fun->is_func if we find
606 * elf32-spu.h (spu_elf_create_sections): Update prototype.
607 (spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
609 2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
611 * aclocal.m4: Regenerate.
612 * configure: Likewise.
613 * Makefile.in: Likewise.
615 2008-03-16 H.J. Lu <hongjiu.lu@intel.com>
619 * elf32-i386.c (elf_i386_relocate_section): Issue an error
620 for R_386_GOTOFF relocaton against undefined hidden/internal
621 symbols when building a shared object.
623 * elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
624 error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
625 relocaton against undefined hidden/internal symbols when
626 building a shared object.
627 (elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
628 is referenced locally, but isn't defined in a regular file.
630 2008-03-15 H.J. Lu <hongjiu.lu@intel.com>
632 * bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO,
633 HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED,
634 BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY,
635 HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ...
638 * bfd.c (bfd): Change cacheable, target_defaulted, opened_once,
639 mtime_set, no_export, output_has_begun and has_armap to bit
642 * bfd-in2.h: Regenerated.
644 2008-03-14 Daniel Jacobowitz <dan@codesourcery.com>
646 * cache.c (close_one): Remove mtime hack.
648 2008-03-14 H.J. Lu <hongjiu.lu@intel.com>
651 * elfxx-ia64.c (elfNN_ia64_tprel_base): Remove BFD_ASSERT.
652 (elfNN_ia64_dtprel_base): Likewise.
653 (elfNN_ia64_relocate_section): Go to missing_tls_sec if
654 tls_sec is NULL before calling elfNN_ia64_tprel_base or
655 elfNN_ia64_dtprel_base. Report unsupported TLS relocations.
657 2008-03-14 Alan Modra <amodra@bigpond.net.au>
659 * elf32-spu.c (process_stubs, spu_elf_relocate_section): Move
661 (maybe_needs_stub): ..here, a new function that also omits stubs
663 (needs_ovl_stub): ..here. Create stubs for labels in code section
664 referenced by switch jump table.
665 (spu_elf_find_overlays): Set htab->ovly_load and htab->ovly_return.
666 (enum _insn_type): Delete.
667 (enum _stub_type): New.
668 (count_stub, build_stub): Adjust.
669 (allocate_spuear_stubs, build_spuear_stubs): Adjust.
671 2008-03-13 Alan Modra <amodra@bigpond.net.au>
673 * elf.c (_bfd_elf_make_section_from_shdr): Remove unnecessary cast.
674 (_bfd_elf_assign_file_position_for_section): Simplify align.
675 (_bfd_elf_init_reloc_shdr): Ensure shift expression wide enough
677 (elf_fake_sections, swap_out_syms): Likewise.
678 * elflink.c (bfd_elf_final_link): Likewise.
680 2008-03-13 Alan Modra <amodra@bigpond.net.au>
682 * Makefile.am: Run "make dep-am".
683 * Makefile.in: Regenerate.
684 * po/SRC-POTFILES.in: Regenerate.
686 2008-03-12 Bernd Schmidt <bernd.schmidt@analog.com>
688 From Jie Zhang <jie.zhang@analog.com>
689 * elf32-bfin.c (struct bfinfdpic_relocs_info): Make got17m4,
690 gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4, fdgoffhilo,
691 gotoff, call and sym not bitfields.
692 (bfinfdpic_gc_sweep_hook): New function; update the relocation
693 information for the relocations of the section being removed.
694 (bfinfdpic_check_relocs): Accumulate the number of relocations
695 which set got17m4, gothilo, fd, fdgot17m4, fdgothilo, fdgoff17m4,
696 fdgoffhilo, gotoff, call and sym fields.
697 (elf_backend_gc_sweep_hook): Redefine for FD-PIC.
699 2008-03-12 Alan Modra <amodra@bigpond.net.au>
702 * elf-bfd.h: Include elf/internal.h after elf/external.h.
703 * elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
704 (elf_swap_symbol_out): Adjust SHN_XINDEX test.
705 (elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
706 seen in external structs.
707 (valid_section_index_p): Delete.
708 (elf_object_p): Don't increment section numbers over reserved range.
709 Simplify test for valid sh_link, sh_info and e_shstrndx fields.
710 (elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
711 seen in external structs. Don't increment section numbers over
713 * elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
714 (bfd_section_from_shdr): Likewise.
715 (group_signature): Range check before accessing elf_elfsections.
716 (_bfd_elf_setup_sections): Likewise.
717 (bfd_section_from_shdr): Likewise.
718 (bfd_section_from_shdr): Don't increment section number over
720 (assign_file_positions_for_non_load_sections): Likewise.
721 (assign_file_positions_except_relocs): Likewise.
722 (_bfd_elf_write_object_contents): Likewise.
723 (assign_section_numbers): Likewise. Adjust for changed SHN_*.
724 (prep_headers): Delete unused variable.
725 * elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
726 for changed SHN_* values.
727 (check_dynsym, elf_link_input_bfd): Likewise.
728 (bfd_elf_final_link): Likewise. Don't skip over reserved section
730 (elf_fixup_link_order): Check that sh_link field is valid.
731 * elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
732 * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
733 accesssing elf_elfsections.
734 * elf32-avr.c (elf32_avr_size_stubs): Likewise.
735 * elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
736 * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
737 * elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
738 SHN_* defines. Test for SHN_BAD return from
739 _bfd_elf_section_from_bfd_section
741 2008-03-12 Alan Modra <amodra@bigpond.net.au>
743 * elf-bfd.h (_bfd_elf_section_from_bfd_section): Update prototype.
744 * elf.c (_bfd_elf_section_from_bfd_section): Return unsigned int,
746 (_bfd_elf_print_private_bfd_data): Test for SHN_BAD result from
747 _bfd_elf_section_from_bfd_section, not -1.
748 (swap_out_syms): Likewise.
749 * elflink.c (elf_link_add_object_symbols): Likewise.
750 (bfd_elf_get_bfd_needed_list): Likewise.
751 (bfd_elf_match_symbols_in_sections): Likewise.
752 (elf_link_add_object_symbols): Don't bother testing for symbols
753 using normal sections before calling bfd_section_from_elf_index.
754 (elf_link_input_bfd, bfd_elf_final_link): Likewise.
755 (bfd_elf_reloc_symbol_deleted_p): Likewise.
756 * elfcode.h (elf_slurp_symbol_table): Likewise.
757 * elf32-spu.c (get_sym_h): Likewise.
758 * elf32-xtensa.c (get_elf_r_symndx_section): Likewise.
759 * elf64-ppc.c (opd_entry_value, get_sym_h, ppc64_elf_edit_toc): Ditto.
760 * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
762 2008-03-11 Alan Modra <amodra@bigpond.net.au>
764 * elf32-spu.c (spu_elf_relocate_section): Test identical conditions
765 to those in process_stubs for overlay symbols.
767 2008-03-09 Paul Brook <paul@codesourcery.com>
769 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
772 2008-03-08 Paul Brook <paul@codesourcery.com>
774 * elf32-arm.c (insert_thumb_branch): Rewrite.
775 (elf32_thumb_to_arm_stub): Use new insert_thumb_branch.
777 2008-03-07 Paul Brook <paul@codesourcery.com>
779 * elf32-arm.c (elf32_arm_howto_table_1): Fix bitmasks for MOVW and
781 (elf32_arm_final_link_relocate): Fix off by one MOVW/MOVT sign
783 (elf32_arm_relocate_section): Handle MOVW and MOVT
784 relocations. Improve safety check for other weird relocations.
785 (elf32_arm_check_relocs): Only set h->needs_plt for branch/call
788 2008-03-03 Bob Wilson <bob.wilson@acm.org>
790 * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
791 only compute its value once.
793 2008-03-03 Alan Modra <amodra@bigpond.net.au>
795 * elf32-spu.c (struct got_entry): Add "addend" field.
796 (count_stub, build_stub): Use a new stub if relocation addend
797 differs from existing stubs for this symbol.
798 (process_stubs): Deal with addends.
799 (spu_elf_relocate_section, spu_elf_output_symbol_hook): Likewise.
801 2008-03-02 H.J. Lu <hongjiu.lu@intel.com>
804 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return true
805 for hidden and local symbols.
807 2008-03-03 Alan Modra <amodra@bigpond.net.au>
809 * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
810 undefined symbols with internal or hidden visibility.
811 (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL
812 rather than SYMBOL_REFERENCES_LOCAL on branches. Don't
813 return immediately on dynamic reloc error.
815 2008-03-01 Alan Modra <amodra@bigpond.net.au>
817 * elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
819 (get_relocs): New function, split out from..
820 (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if
821 emitrelocations. Remove indx temp.
822 (ppc_size_one_stub): Count new stub relocs.
823 (ppc64_elf_size_stubs): Count new glink reloc.
824 (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations.
825 (ppc64_elf_finish_dynamic_sections): Output glink relocs.
826 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic
829 2008-02-28 Alan Modra <amodra@bigpond.net.au>
831 * elf32-spu.c (mark_functions_via_relocs): Don't assume that
832 the "->start" pointer reaches to function origin, so that we
833 can handle functions split over more than two sections.
834 (build_call_tree): Likewise.
835 (pasted_function): Don't attempt to set fun->start back to the
836 function origin, just go back one section.
838 2008-02-27 Catherine Moore <clm@codesourcery.com>
840 * elf.c ( _bfd_elf_print_private_bfd_data): Call
841 elf_backend_get_target_dtag if defined.
842 * elf32-mips.c (elf_backend_get_target_dtag): Define.
843 * elf64-mips.c: Likewise.
844 * elfn32-mips.c: Likewise.
845 * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
846 * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
847 * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
848 * elfxx-target.h (elf_backend_get_target_dtag): Add default.
849 (elf_backend_data): Add elf_backend_get_target_dtag.
851 2008-02-26 Alan Modra <amodra@bigpond.net.au>
853 * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_needed
854 for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms,
855 and assume branch relocs are not dynamic when non-shared.
856 (readonly_dynrelocs): New function, split out from..
857 (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs.
858 (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries,
860 (allocate_dynrelocs): ..and don't set u.def for undefined weak.
861 Do allow dynamic relocs on undefined symbols.
862 (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs.
863 (ppc_elf_relocate_section): Mirror dynamic reloc changes in
865 (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak
866 plt symbols needing pointer_equality_needed.
868 2008-02-23 Alan Modra <amodra@bigpond.net.au>
870 * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.
872 2008-02-23 Alan Modra <amodra@bigpond.net.au>
874 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Copy
875 pointer_equality_needed.
876 (ppc_elf_check_relocs): Split out non-branch relocs from others
877 that might emit dynamic relocs. Set pointer_equality_needed
878 for their symbols. Don't set non_got_ref on branch reloc symbols.
879 (ppc_elf_hash_symbol): New function.
880 (elf_backend_hash_symbol): Define.
881 (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed.
882 Error if pointer_equality_needed on weak plt symbol.
884 2008-02-22 H.J. Lu <hongjiu.lu@intel.com>
887 * elflink.c (elf_create_symbuf): Correct buffer size and
890 2008-02-22 Nick Clifton <nickc@redhat.com>
893 * dwarf2.c: Revert previous patch. All of the allocate memory is
894 on an obstack which will be freed at some other time.
896 2008-02-20 Nick Clifton <nickc@redhat.com>
899 * libbfd.c (bfd_realloc_or_free): New function. Performs like
900 bfd_realloc, but if the (re)allocation fails, the pointer is
902 * libbfd-in.h: Prototype.
903 * libbfd.h: Regenerate.
904 * bfdio.c (bfd_bwrite): Use the new function.
905 (bfd_seek): Likewise.
906 * bfdwin.c:(bfd_get_file_window): Likewise.
907 * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
908 * elf32-ppc.c (ppc_elf_relax_section): Likewise.
909 * elf32-xtensa.c (vsprintf_msg): Likewise.
910 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
911 * stabs.c (_bfd_link_seciton_stabs): Likewise.
912 * vms-misc.c (_bfd_vms_get_record): Likewise.
913 * vms-tir.c (check_section): Likewise.
914 * vms.c (vms_new_section_hook): Likewise.
915 * elf32-arm.c (elf32_arm_section_map_add): Check that the
916 allocation of sec_data->map succeeded before using it.
917 * elflink.c (elf_link_output_sym): Do not overwrite finfo->
918 symshndxbuf until it is known that the reallocation succeeded.
920 2008-02-20 Diogo de Carvalho Kraemer <diogo@kraemer.eng.br>
921 Nick Clifton <nickc@redhat.com>
924 * dwarf2.c (read_abbrevs): Free the abbreviation table if we run
926 (decode_line_info): Free the line_info_table before returning a
928 (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
929 Free the line table. Free the function table. Free the variable
932 2008-02-17 Mark Kettenis <kettenis@gnu.org>
934 * elf.c (swap_out_syms): Avoid preprocessing directive within
937 2008-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
939 * elf.c (assign_file_positions_for_load_sections): Set the type of
940 PT_NOTE sections to SHT_NOTE.
942 2008-02-17 Ulrich Weigand <uweigand@de.ibm.com>
944 * simple.c (bfd_simple_get_relocated_section_contents): Set
945 link_info.output_bfd.
947 2008-02-16 Nathan Sidwell <nathan@codesourcery.com>
949 * dwarf2.c (find_line): Don't trust debug information after an
950 unparseable compilation unit.
952 2008-02-15 Alan Modra <amodra@bigpond.net.au>
955 * section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags.
956 * bfd-in2.h: Regenerate.
958 2008-02-15 Alan Modra <amodra@bigpond.net.au>
960 * elf-bfd.h (enum elf_object_id): Add HPPA_ELF_TDATA.
961 * elf.c (bfd_elf_allocate_object): Don't check for already allocated
963 * elf32-hppa.c (elf32_hppa_mkobject): New function.
964 (bfd_elf32_mkobject): Define.
965 * elf32-ppc.c (is_ppc_elf_target): Delete. Replace all uses with..
966 (is_ppc_elf): ..this new macro.
967 * elf64-ppc.c (is_ppc64_elf_target): Delete. Replace all uses with..
968 (is_ppc64_elf): ..this new macro.
970 2008-02-15 Alan Modra <amodra@bigpond.net.au>
972 * elflink.c: Replace all accesses to hash->creator field with
974 * cofflink.c: Likewise.
975 * coff-h8300.c: Likewise.
977 * elf32-m68hc1x.c: Likewise.
978 * elf32-ppc.c: Likewise.
979 * elf64-alpha.c: Likewise.
980 * elf64-ppc.c: Likewise.
981 * elf64-sparc.c: Likewise.
982 * elfxx-mips.c: Likewise.
983 * i386linux.c: Likewise.
984 * m68klinux.c: Likewise.
985 * sparclinux.c: Likewise.
987 * xcofflink.c: Likewise.
988 * linker.c: Likewise.
989 (_bfd_link_hash_table_init): Don't store creator.
991 2008-02-14 Peter Jones <pjones@redhat.com>
993 * efi-rtdrv-ia32.c: New file.
994 * efi-bsdrv-ia32.c: New file.
995 * efi-rtdrv-ia64.c: New file.
996 * efi-bsdrv-ia64.c: New file.
997 * efi-rtdrv-x86_64.c: New file.
998 * efi-bsdrv-x86_64.c: New file.
999 * peicode.h (pe_bfd_object_p): Add support for boot service and
1000 runtime service drivers.
1001 * libpei.h: Add macros for EFI formats, and rename the efi application
1002 format macros to disambiguate.
1003 * targets.c: Add bfd_target _vec externs.
1004 (_bfd_tar): Add EFI _vec entries.
1005 * config.bfd: Add EFI vectors into the selection routines.
1006 * configure.in: add EFI _vec entries.
1007 * configure: Regenerate.
1008 * Makefile.am: Add EFI files.
1009 * Makefile.in: Regenerate.
1011 2008-02-14 Nathan Sidwell <nathan@codesourcery.com>
1013 * dwarf1.c (struct dwarf1_debug): Add syms member.
1014 (alloc_dwarf1_unit, alloc_dwarf1_func): Check for out of memory.
1015 (parse_line_table, _bfd_dwarf1_find_nearest_line): Relocate
1016 section contents, check for out of memory.
1018 * dwarf1.c (struct dwarf1_debug): Change data pointers to bfd_byte.
1019 (parse_die): Change data pointers to bfd_byte.
1020 (parse_line_table, parse_functions_in_unit): Likewise.
1022 2008-02-14 Alan Modra <amodra@bigpond.net.au>
1024 * elflink.c (compute_bucket_count): Warning fixes.
1026 2008-02-12 DJ Delorie <dj@redhat.com>
1028 * elf32-iq2000.c (iq2000_elf_relocate_section): Adjust addend of
1029 relocation pointing to local symbol in merged section.
1031 * elf32-iq2000.c (iq2000_elf_relocate_offset16): New.
1032 (iq2000_elf_relocate_section): Call it.
1034 2008-02-12 Nick Clifton <nickc@redhat.com>
1037 * elf-bfd.h (enum elf_object_id): New enum, used to identify
1038 target specific extensions to the elf_obj_tdata structure.
1039 (struct elf_obj_tdata): New field 'object_id'.
1040 (elf_object_id, elf_program_header_size, elf_symtab_hdr): New
1041 macros for accessing fields in the elf_obj_tdata structure.
1042 (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object.
1043 (bfd_elf_allocate_object): New function.
1044 * elf.c (bfd_elf_mkobject): Rename to bfd_elf_make_generic_object
1045 and implement by calling bfd_elf_allocate_object.
1046 (bfd_elf_allocate_object): New function: Allocates an
1047 elf_obj_tdata structure, possibly with a target specific
1049 * elfxx-target.h (bfd_elfNN_mkobject): Use
1050 bfd_elf_make_generic_object as the default value.
1051 * elf32-arm.c (elf32_arm_obj_tdata): Rename to elf_arm_obj_tdata
1052 for consistency with other, similar structures.
1053 (is_arm_elf): New macro. Checks a BFD to make sure that is an ARM
1055 (elf32_arm_mkobject): Call bfd_elf_allocate_object.
1056 (bfd_elf32_arm_vfp11_erratum_scan): Use is_arm_elf macro to check
1057 the bfd being processed.
1058 (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1059 (bfd_elf32_arm_set_target_relocs): Likewise.
1060 (bfd_elf32_arm_final_link_relocate): Likewise.
1061 (bfd_elf32_arm_copy_private_bfd_data): Likewise.
1062 (bfd_elf32_arm_merge_eabi_attributes): Likewise.
1063 (bfd_elf32_arm_merge_private_bfd_data): Likewise.
1064 (bfd_elf32_arm_check_relocs): Likewise.
1065 (bfd_elf32_arm_gc_mark_extra_sections): Likewise.
1066 (bfd_elf32_arm_size_dynamic_sections): Likewise.
1067 (bfd_elf32_arm_process_before_allocation): Use elf_symtab_hdr.
1068 (bfd_elf32_arm_init_maps): Likewise.
1069 (bfd_elf32_arm_final_link_relocate): Likewise.
1070 (bfd_elf32_arm_relocate_section): Likewise.
1071 (bfd_elf32_arm_gc_sweep_hook): Likewise.
1072 (bfd_elf32_arm_check_relocs): Likewise.
1073 (bfd_elf32_arm_size_dynamic_sections): Likewise.
1074 * elf32-i386.c (elf_i386_mkobject): Call bfd_elf_allocate_object.
1075 (is_i386_elf): New macro. Checks a BFD to make sure that is an x86
1077 (elf_i386_check_relocs): Use is_i386_elf macro to check the bfd
1079 (elf_i386_size_dynamic_sections): Likewise.
1080 (elf_i386_relocate_section): Likewise.
1081 (elf_i386_check_relocs): Use elf_symtab_hdr.
1082 (elf_i386_gc_sweep_hook): Likewise.
1083 (elf_i386_size_dynamic_sections): Likewise.
1084 (elf_i386_relocate_section): Likewise.
1085 * elf32-ppc.c (ppc_elf_mkobject): Call bfd_elf_allocate_object.
1086 (elf_create_pointer_linker_section): Use is_ppc_elf_target to
1087 verify that the bfd before accessing target specific fields.
1088 (ppc_elf_check_relocs): Likewise.
1089 (elf_finish_pointer_linker_section): Likewise.
1090 (elf_create_pointer_linker_section): Use elf_symtab_hdr.
1091 (ppc_elf_check_relocs): Likewise.
1092 (ppc_elf_gc_sweep_hook): Likewise.
1093 (ppc_elf_tls_optimize): Likewise.
1094 (ppc_elf_size_dynamic_sections): Likewise.
1095 (ppc_elf_relax_section): Likewise.
1096 (ppc_elf_relocate_section): Likewise.
1097 * elf32-s390.c (struct elf_s390_obj_tdata): Add a comment
1098 reminding programmers to keep this structure in sync with the one
1099 defined in elf64-s390.c.
1100 (elf_s390_mkobject): Call bfd_elf_allocate_object.
1101 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
1103 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
1105 (elf_s390_size_dynamic_sections): Likewise.
1106 (elf_s390_relocate_section): Likewise.
1107 (elf_s390_check_relocs): Use elf_symtab_hdr.
1108 (elf_s390_gc_sweep_hook): Likewise.
1109 (elf_s390_size_dynamic_sections): Likewise.
1110 (elf_s390_relocate_section): Likewise.
1111 * elf32-sh.c (sh_elf_mkobject): Call bfd_elf_allocate_object.
1112 (is_sh_elf): New macro. Checks a BFD to make sure that is an SH
1114 (sh_elf_size_dynamic_sections): Use is_sh_elf macro to check the
1115 bfd being processed.
1116 (sh_elf_relocate_section): Likewise.
1117 (sh_elf_check_relocs): Likewise.
1118 (sh_elf_copy_private_data): Likewise.
1119 (sh_elf_relax_section): Use elf_symtab_hdr.
1120 (sh_elf_size_dynamic_sections): Likewise.
1121 (sh_elf_relocate_section): Likewise.
1122 (sh_elf_get_relocated_section_contents): Likewise.
1123 (sh_elf_gc_sweep_hook): Likewise.
1124 (sh_elf_check_relocs): Likewise.
1125 * elf64-alpha.c (elf64_alpha_mkobject): Call bfd_elf_allocate_object.
1126 (is_alpha_elf): New macro. Checks a BFD to make sure that is an
1128 (elf64_alpha_create_got_section): Use is_alpha_elf macro to check
1129 the bfd being processed.
1130 (elf64_alpha_create_dynamic_section): Likewise.
1131 (elf64_alpha_check_relocs): Likewise.
1132 (elf64_alpha_size_got_sections): Likewise.
1133 (elf64_alpha_relax_section): Likewise.
1134 (elf64_alpha_relocate_section): Likewise.
1135 (elf64_alpha_final_link): Likewise.
1136 (elf64_alpha_check_relocs): Use elf_symtab_hdr.
1137 (elf64_alpha_relax_section): Likewise.
1138 (elf64_alpha_relocate_section_r): Likewise.
1139 (elf64_alpha_relocate_section): Likewise.
1140 * elf64-ppc.c (ppc64_elf_mkobject): Call bfd_elf_allocate_object.
1141 (ppc64_elf_check_relocs): Use is_ppc64_elf_target to check the bfd
1143 (opd_entry_value): Likewise.
1144 (allocate_dynrelocs): Likewise.
1145 (ppc64_elf_relocate_section): Likewise.
1146 (ppc64_elf_check_relocs): Use elf_symtab_hdr.
1147 (opd_entry_value): Likewise.
1148 (ppc64_elf_gc_sweep_hook): Likewise.
1149 (get_sym_h): Likewise.
1150 (ppc64_elf_edit_opd): Likewise.
1151 (ppc64_elf_tls_optimize): Likewise.
1152 (ppc64_elf_edit_toc): Likewise.
1153 (ppc64_elf_size_dynamic_sections): Likewise.
1154 (toc_adjusting_stub_needed): Likewise.
1155 (ppc64_elf_size_stubs): Likewise.
1156 (ppc64_elf_relocate_section): Likewise.
1157 * elf64-s390.c (struct elf_s390_obj_tdata): Add a comment
1158 reminding programmers to keep this structure in sync with the one
1159 defined in elf32-s390.c.
1160 (elf_s390_mkobject): Call bfd_elf_allocate_object.
1161 (is_s390_elf): New macro. Checks a BFD to make sure that is an s390
1163 (elf_s390_check_relocs): Use is_s390_elf macro to check the bfd
1165 (elf_s390_size_dynamic_sections): Likewise.
1166 (elf_s390_relocate_section): Likewise.
1167 (elf_s390_check_relocs): Use elf_symtab_hdr.
1168 (elf_s390_gc_sweep_hook): Likewise.
1169 (elf_s390_size_dynamic_sections): Likewise.
1170 (elf_s390_relocate_section): Likewise.
1171 * elf64-x86_64.c (elf64_x86_64_mkobject): Call bfd_elf_allocate_object.
1172 (is_x86_64_elf): New macro. Checks a BFD to make sure that is an
1174 (elf64_x86_64_check_relocs): Use is_x86_64_elf macro to check the bfd
1176 (elf64_x86_64_size_dynamic_sections): Likewise.
1177 (elf64_x86_64_relocate_section): Likewise.
1178 (elf64_x86_64_check_relocs): Use elf_symtab_hdr.
1179 (elf64_x86_64_gc_sweep_hook): Likewise.
1180 (elf64_x86_64_size_dynamic_sections): Likewise.
1181 (elf64_x86_64_relocate_section): Likewise.
1182 * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Call bfd_elf_allocate_object.
1183 (is_sparc_elf): New macro. Checks a BFD to make sure that is a Sparc
1185 (_bfd_sparc_elf_check_relocs): Use is_sparc_elf macro to check the
1186 bfd being processed.
1187 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1188 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1189 (_bfd_sparc_elf_check_relocs): Use elf_symtab_hdr.
1190 (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1191 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
1192 (_bfd_sparc_elf_relocate_section): Likewise.
1194 2008-02-12 Alan Modra <amodra@bigpond.net.au>
1197 * arange-set.c: Delete.
1198 * arange-set.h: Delete.
1199 * dwarf2.c: Revert 2007-09-21 changes.
1200 * Makefile.am: Likewise.
1201 * Makefile.in: Regenerate.
1202 * po/SRC-POTFILES.in: Regenerate.
1204 2008-02-11 Bernd Schmidt <bernd.schmidt@analog.com>
1206 * elf32-bfin.c (bfin_relocate_section): Set up dynobj before using it
1208 (elf32_bfin_merge_private_bfd_data): Simplify, and ensure object type
1209 mismatches are detected.
1211 * elf32-bfin.c (bfinfdpic_relocate_section): Take more care not to
1212 emit invalid relocs or rofixup entries for deleted .eh_frame entries.
1214 2008-02-11 Daniel Jacobowitz <dan@codesourcery.com>
1216 * cache.c (cache_bread): Set bfd_error_file_truncated if EOF
1218 * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
1220 2008-02-07 Alan Modra <amodra@bigpond.net.au>
1222 * elf32-spu.c (spu_elf_size_stubs): Revert 2008-01-28 doubling
1223 of _ovly_buf_table size.
1224 (spu_elf_build_stubs): Use low bit of .size as "present" bit.
1225 Adjust initialisations relating to _ovly_buf_table.
1227 2008-02-04 Bob Wilson <bob.wilson@acm.org>
1229 * elf32-xtensa (elf_xtensa_relocate_section): After finding an invalid
1230 relocation, do not continue processing it. Ignore R_XTENSA_ASM_EXPAND
1231 relocations against dynamic symbols.
1232 (elf_xtensa_finish_dynamic_sections): Do not fail if there is no
1235 2008-02-04 Kai Tietz <kai.tietz@onevision.com>
1236 H.J. Lu <hongjiu.lu@intel.com>
1239 * warning.m4: Enable -Wno-format by default when using gcc on
1241 * configure: Regenerated.
1243 2008-02-04 Adam Nemet <anemet@caviumnetworks.com>
1245 * archures.c: Update copyright.
1246 (bfd_mach_mips_octeon): New macro.
1247 * bfd-in2.h: Regenerate.
1248 * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon.
1249 (mips_set_isa_flags): Likewise.
1250 (mips_mach_extensions): Add Octeon.
1251 * cpu-mips.c: Update copyright.
1252 (I_mipsocteon): New enum constant.
1253 (arch_info_struct): Add Octeon.
1255 2008-02-04 Alan Modra <amodra@bigpond.net.au>
1257 * elf32-spu.c (spu_elf_relocate_section): Correct return type.
1258 Return error status on unexpected relocation errors.
1260 2008-02-04 Alan Modra <amodra@bigpond.net.au>
1263 * elf.c (bfd_elf_get_elf_syms): Revert 2008-01-31. Instead abort
1265 * elf32-arm.c (elf32_arm_size_dynamic_sections): Skip glue
1266 processing on non-ELF input.
1268 2008-01-31 Marc Gauthier <marc@tensilica.com>
1270 * config.bfd (xtensa*-*-*): Recognize processor variants.
1272 2008-01-31 Nick Clifton <nickc@redhat.com>
1275 * elf.c (bfd_elf_get_elf_syms): Check the return value of
1276 get_elf_backend_data.
1278 2008-01-28 Fabian Groffen <grobian@gentoo.org>
1280 * config.bfd (x86_64-*-solaris2): Add support for this target.
1282 2008-01-28 Alan Modra <amodra@bigpond.net.au>
1284 Rewrite SPU overlay handling code. Put overlay calls stubs in the
1285 overlays where possible. Use a faster call stub, or optionally at
1286 compile time, a more compact stub. Double size of _ovly_buf_table
1287 so that low bit of _ovly_table.buf can be used as a "present" bit.
1288 Reserve an extra _ovly_table entry for index zero.
1289 * elf32-spu.c: (struct spu_link_hash_table): Delete a number of fields,
1291 (struct got_entry): New.
1292 (struct spu_stub_hash_entry): Delete.
1293 (stub_hash_newfunc, spu_elf_link_hash_table_free): Delete.
1294 (spu_elf_link_hash_table_create): Adjust for struct changes.
1295 (spu_stub_name): Delete.
1296 (spu_elf_find_overlays): Don't track sections from overlay regions.
1297 Instead set ovl_buf number in spu elf section data. Error if
1298 overlays in one region don't start at the same address. Adjust
1299 for struct _spu_elf_section_data changes.
1300 (SIZEOF_STUB1, SIZEOF_STUB2, ILA_79, ILA_78): Delete.
1301 (OVL_STUB_SIZE, BRSL, LNOP, ILA): Define.
1302 (needs_ovl_stub): Adjust for struct _spu_elf_section_data changes.
1303 (enum _insn_type): New.
1304 (count_stub, build_stub): New functions.
1305 (allocate_spuear_stubs): Use count_stub.
1306 (build_spuear_stubs): Use build_stub.
1307 (populate_stubs, sort_stubs): Delete.
1308 (process_stubs): New function.
1309 (write_one_stub): Delete.
1310 (spu_elf_size_stubs, spu_elf_build_stubs): Rewrite.
1311 (alloc_stack_info): Adjust for struct _spu_elf_section_data changes.
1312 (maybe_insert_function, check_function_ranges): Likewise.
1313 (find_function, pasted_function, build_call_tree): Likewise.
1314 (spu_elf_stack_analysis, spu_elf_modify_segment_map): Likewise.
1315 (spu_elf_modify_program_headers): Likewise.
1316 (interesting_section): Detect stub sections differently. Delete
1317 htab param, adjust all callers.
1318 (spu_elf_relocate_section): Rewrite stub handling.
1319 (spu_elf_output_symbol_hook): Likewise.
1320 (bfd_elf32_bfd_link_hash_table_free): Delete.
1321 * elf32-spu.h (struct _spu_elf_section_data): Move input-only and
1322 output-only fields into a union. Add ovl_buf.
1323 (spu_elf_size_stubs, spu_elf_build_stubs): Update prototypes.
1325 2008-01-25 DJ Delorie <dj@redhat.com>
1327 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): New.
1329 2008-01-25 Kai Tietz <kai.tietz@onevision.com>
1331 * bfd-in.h: Add mingw I64 support.
1332 * bfd-in2.h: Regenerated.
1333 * bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.
1335 2008-01-21 Alan Modra <amodra@bigpond.net.au>
1338 * format.c (bfd_check_format_matches): Don't accept archives as
1339 fully matching unless they have a map.
1341 2008-01-21 Alan Modra <amodra@bigpond.net.au>
1343 * elflink.c (_bfd_elf_link_output_relocs): Correct error return.
1345 2008-01-21 Alan Modra <amodra@bigpond.net.au>
1347 * ecoff.c (_bfd_ecoff_archive_p): Delete.
1348 * libecoff.h (_bfd_ecoff_archive_p): Delete.
1349 * coff-alpha.c (ecoffalpha_little_vec): Use bfd_generic_archive_p.
1350 * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
1351 (ecoff_biglittle_vec): Likewise.
1353 2008-01-19 Alan Modra <amodra@bigpond.net.au>
1356 * elf64-ppc.c (ppc64_elf_tls_optimize): Ensure htab->tls_get_addr
1357 non-NULL before dereferencing.
1359 2008-01-15 Alan Modra <amodra@bigpond.net.au>
1362 * elf-bfd.h (struct elf_backend_data): Add gc_keep. Remove param
1364 (_bfd_elf_gc_keep): Declare.
1365 * elfxx-target.h (elf_backend_gc_keep): Define.
1366 (elfNN_bed): Init new field.
1367 * elflink.c (_bfd_elf_gc_keep): New function.
1368 (bfd_elf_gc_sections): Call gc_keep.
1369 * elf64-ppc.c (elf_backend_gc_keep): Define.
1370 (struct _ppc64_elf_section_data): Move .opd related fields to
1371 a struct so they don't occupy the same storage. Adjust accesses
1373 (ppc64_elf_gc_keep): New function, split out from..
1374 (ppc64_elf_gc_mark_hook): ..here. Don't call _bfd_elf_gc_mark
1375 to mark .opd section, just set gc_mark.
1376 (ppc64_elf_edit_opd): Remove no_opd_opt parm. Don't set opd->adjust
1377 unless we are changing .opd. Test non-NULL opd->adjust at all
1378 accesses throughout file.
1379 * elf64-ppc.h (ppc64_elf_edit_opd): Update prototype.
1381 2008-01-15 Alan Modra <amodra@bigpond.net.au>
1383 * bfd-in.h (BFD_HOST_LONG_LONG): Delete.
1384 * bfd-in2.h: Regenerate.
1386 2008-01-11 Tristan Gingold <gingold@adacore.com>
1387 Eric Botcazou <ebotcazou@adacore.com>
1389 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Exit early if generating a
1391 * elf32-arm.c (elf32_arm_gc_sweep_hook): Likewise.
1392 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
1393 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
1394 * elf32-i386.c (elf_i386_gc_sweep_hook): Likewise.
1395 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
1396 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
1397 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
1398 * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
1399 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
1400 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
1401 * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
1402 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
1403 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Likewise.
1404 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
1405 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1406 * elflink.c (bfd_elf_gc_sections): Do not punt on relocatable output
1407 or executable output with relocations.
1409 2008-01-09 Nick Clifton <nickc@redhat.com>
1412 * elf32-fr30.c (fr30_elf_howto_table): Set partial_inplace field
1413 to FALSE for all relocs.
1415 2008-01-09 Richard Sandiford <rsandifo@nildram.co.uk>
1418 * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
1419 fields. Rename u.cie.u.merged to u.cie.u.merged_with.
1420 (eh_frame_sec_info): Add a cies field.
1421 (eh_frame_hdr_info): Add a merge_cies field.
1422 * elf-eh-frame.c (cie): Add a reloc_index member to the personality
1424 (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
1426 (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of
1427 cie structures in all cases and use it instead of extended_cies.
1428 If merging, store the cie array in sec_info->cies and point each
1429 CIE's eh_fde_cie at the associated element. Do not try to
1430 calculate the value of the personality routine here; record the
1431 offset of the relocation instead. Do not merge CIEs here.
1432 (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
1433 (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
1434 (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
1435 (find_merged_cie): New function.
1436 (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies.
1438 2008-01-07 Nick Clifton <nickc@redhat.com>
1441 * vms.c (vms_close_and_cleanup): Check for the presence of a
1442 vms_private_data_struct before examining any of its fields.
1444 2008-01-07 H.J. Lu <hongjiu.lu@intel.com>
1447 * elflink.c (elf_link_input_bfd): Don't write out a section if
1448 its output section is marked with SEC_NEVER_LOAD.
1450 For older changes see ChangeLog-2007
1456 version-control: never