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