* elflink.c (_bfd_elf_adjust_dynamic_symbol): Don't clear plt
[external/binutils.git] / bfd / ChangeLog
1 2009-08-10  Alan Modra  <amodra@bigpond.net.au>
2
3         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Don't clear plt
4         info for STT_GNU_IFUNC.
5         * elf32-ppc.c (ppc_elf_check_relocs): Count a needed plt entry
6         on got refs in case the symbol turns out to be ifunc.
7         (ppc_elf_gc_sweep_hook): Similarly.
8         (ppc_elf_adjust_dynamic_symbol): Adjust assertion.
9         (allocate_dynrelocs): Don't specially allocate got relocs for ifunc.
10         (ppc_elf_size_dynamic_sections): Likewise.
11         (ppc_elf_relocate_section): Likewise.
12
13 2006-08-09  Bernd Schmidt  <bernd.schmidt@analog.com>
14
15         From Mike Frysinger <michael.frysinger@analog.com>
16         * elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs,
17         bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook,
18         _bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section,
19         bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs,
20         bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs):
21         Adjust to match the renamed reloc definitions.
22         
23 2009-08-08  Alan Modra  <amodra@bigpond.net.au>
24
25         PR 10494
26         * elf.c (_bfd_elf_make_section_from_shdr): When setting up section
27         LMAs, use ELF_IS_SECTION_IN_SEGMENT to match sections with headers.
28
29 2009-08-07  Tom Tromey  <tromey@redhat.com>
30
31         * elf32-microblaze.c (microblaze_elf_check_relocs): Avoid strict
32         aliasing error.
33
34 2009-08-06  Michael Eager <eager@eagercon.com>
35
36         * Makefile.am: Add cpu-microblaze.{lo,c}, elf32-microblaze.{lo,c}.
37         * Makefile.in: Regenerate.
38         * archures.c: Add bfd_arch_microblaze.
39         * bfd-in2.h: Regenerate.
40         * config.bfd: Add microblaze target.
41         * configure.in: Add bfd_elf32_microblaze_vec target.
42         * configure: Regenerate.
43         * cpu-microblaze.c: New.
44         * elf32-microblaze.c: New.
45         * libbfd-in.h: Add prototype _bfd_dwarf2_fixup_section_debug_loc().
46         * libbfd.h: Regenerate.
47         * reloc.c: Add MICROBLAZE relocations.
48         * section.c: Add struct relax_table and relax_count to section.
49         * targets.c: Add bfd_elf32_microblaze_vec.
50
51 2009-08-06  Jakub Jelinek  <jakub@redhat.com>
52             Alan Modra  <amodra@bigpond.net.au>
53
54         PR binutils/10492
55         * elf.c (sym_is_global): Return true even for BSF_GNU_UNIQUE
56         symbols.
57         * elf32-mips.c (mips_elf_sym_is_global): Likewise.
58         * elfn32-mips.c (mips_elf_sym_is_global): Likewise.
59
60 2009-08-06  Nathan Sidwell  <nathan@codesourcery.com>
61
62         * elf32-arm.c (elf32_arm_size_stubs): Call layout_sections_again
63         at least once when fixing cortex-a8.
64
65 2009-08-05  Chao-ying Fu  <fu@mips.com>
66
67         * elf32-mips.c (mips_reloc_map): Add BFD_RELOC_MIPS_JALR.
68         * elfxx-mips.c (JAL_TO_BAL_P): New define to transform JAL to BAL
69         for CPUs.  It is true for RM9000.
70         (JALR_TO_BAL_P): New define to transform JALR to BAL.  It is true
71         for all CPUs.
72         (mips_elf_perform_relocation): Use JAL_TO_BAL_P and JALR_TO_BAL_P
73         to guard the transformation.
74
75 2009-08-05  Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
76
77         * elf32-spu.h (spu_elf_params): Add member emit_fixups.
78         (spu_elf_size_sections): Declare prototype.
79         * elf32-spu.c (spu_link_hash_table): Add member sfixup.
80         (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros.
81         (spu_elf_emit_fixup): New function.
82         (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32.
83         (spu_elf_size_sections): New function.
84
85 2009-08-05  Nathan Sidwell  <nathan@codesourcery.com>
86
87         * elf32-arm.c (elf32_arm_stub_type): Add arm_stub_a8_veneer_lwm.
88         (arm_build_one_stub): Build a8 veneers as a separate pass.
89         (cortex_a8_erratum_scan): Add prev_num_a8_fixes and stub_changed_p
90         parameters.  Use them to check if we create a different a8 fixup
91         than the previous pass.
92         (elf32_arm_size_stubs): Move scope of stub_changed and
93         prev_num_a8_fixes into main loop.
94         (elf32_arm_build_stubs): Build a8 veneers in a second pass.
95
96 2009-08-04  Alan Modra  <amodra@bigpond.net.au>
97
98         * elf32-ppc.c (ppc_elf_relax_section): Correct conditions under
99         which find_plt_ent is called.  Delete redundant code.
100
101 2009-08-03  H.J. Lu  <hongjiu.lu@intel.com>
102
103         PR binutils/10363
104         * elf.c (bfd_elf_string_from_elf_section): Return NULL on
105         invalid string offset.
106
107 2009-08-03  H.J. Lu  <hongjiu.lu@intel.com>
108
109         PR ld/10433
110         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Set got
111         to htab->init_got_offset and plt to htab->init_plt_offset
112         when discarding space for dynamic relocations.
113
114 2009-08-03  Alan Modra  <amodra@bigpond.net.au>
115
116         * elf32-ppc.c (struct plt_entry): Revise comments.
117         (ppc_elf_check_relocs): Don't create needless plt_entry info
118         for non-pie executables.  Don't test info->pie when info->shared
119         already covers that case.
120         (ppc_elf_gc_sweep_hook): Adjust for above change.
121         (add_stub_sym): Don't test info->pie when info->shared tested.
122         (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Likewise.
123         (write_glink_stub, ppc_elf_finish_dynamic_symbol): Likewise.
124         (ppc_elf_relax_section): Adjust find_plt_ent arguments.
125         (ppc_elf_relocate_section): Likewise.
126
127 2009-08-03  Alan Modra  <amodra@bigpond.net.au>
128
129         * elf32-ppc.c (ppc_elf_check_relocs): Always add a plt ref count
130         for local ifunc symbols in non-pie executables, regardless of
131         reloc type.  Don't specially create ifunc dyn relocs.  Tidy ifunc
132         code so that it's obvious that we only do anything special for
133         local ifunc syms.
134         (ppc_elf_gc_sweep_hook): Adjust to suit check_relocs changes.
135         (allocate_dynrelocs): Correct comment for syms defined in plt.
136         Don't specially allocate ifunc dyn relocs.
137         (ppc_elf_relax_section): Relax branches to ifunc plt entries too.
138         (ppc_elf_relocate_section): Set "relocation" value for ifunc
139         syms in non-pie executables.  No specially allocated dyn relocs
140         for ifunc to write.  Allow for local sym on R_PPC_RELAX32_PLT.
141         (ppc_elf_finish_dynamic_symbol): Set value of ifunc symbols in
142         a non-pie executable.
143
144 2009-08-02  H.J. Lu  <hongjiu.lu@intel.com>
145             Jakub Jelinek  <jakub@redhat.com>
146
147         PR ld/6443
148         * elf32-i386.c (elf_i386_tls_transition): Check executable
149         instead of shared for TLS when building PIE.
150         (elf_i386_check_relocs): Likewise.
151         (elf_i386_allocate_dynrelocs): Likewise.
152         (elf_i386_relocate_section): Likewise.
153
154         * elf64-x86-64.c (elf64_x86_64_tls_transition): Check executable
155         instead of shared for TLS when building PIE.
156         (elf64_x86_64_check_relocs): Likewise.
157         (elf64_x86_64_allocate_dynrelocs): Likewise.
158         (elf64_x86_64_relocate_section): Likewise.
159
160 2009-07-31  Anthony Green  <green@moxielogic.com>
161
162         * config.bfd (targ_cpu): Add moxie-uclinux support.
163
164 2009-07-31  Hans-Peter Nilsson  <hp@bitrange.com>
165
166         * linker.c (fix_syms): Consider SEC_LOAD when choosing section.
167
168 2009-07-30  Alan Modra  <amodra@bigpond.net.au>
169
170         * elf32-ppc.c (ppc_elf_check_relocs): Always set up sections
171         used by indirect function support.  Count dynamic relocs for
172         ifunc syms.
173         (ppc_elf_adjust_dynamic_symbol): Tweak for ifunc.
174         (allocate_dynrelocs): Allocate all non-dynamic ifunc plt entries
175         in iplt and their relocs in reliplt.  Don't make ifunc syms
176         dynamic.  Allocate got entry relocs for non-dynamic ifunc in
177         reliplt.  Handle other dynamic relocs for ifunc.
178         (ppc_elf_size_dynamic_sections): Alloc dyn relocs for static
179         ifunc in reliplt, likewise relocs for got against local ifunc.
180         Typo fix on reliplt size adjust.
181         (ppc_elf_relocate_section): Don't use plt scheme of allocating
182         relocs 1-1 with entries for iplt, instead just add using
183         reloc_count.  Write got relocs and dyn relocs for ifunc to reliplt.
184         Error on invalid ifunc dyn relocs.
185         (ppc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc plt
186         in iplt/reliplt.
187         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_JMP_IREL,
188         R_PPC64_REL16, R_PPC64_REL16_LO, R_PPC64_REL16_HI, R_PPC64_REL16_HA.
189         (ppc64_elf_reloc_type_lookup): Handle new relocs.
190         (ppc64_elf_check_relocs): Likewise.  Count dyn relocs for ifunc.
191         (allocate_dynrelocs): As for elf32-ppc.c above.
192         (ppc64_elf_size_dynamic_sections): Likewise.
193         (ppc_build_one_stub): Put non-dynamic ifunc plt call stubs in iplt,
194         and their relocs in reliplt.  Use R_PPC64_JMP_IREL.
195         (ppc_size_one_stub): Similarly.
196         (ppc64_elf_relocate_section): As for elf32-ppc.c above.  Handle new
197         relocs too.
198         (ppc64_elf_finish_dynamic_symbol): As for elf32-ppc.c above.
199
200 2009-07-29  Hans-Peter Nilsson  <hp@bitrange.com>
201
202         * elf64-mmix.c (mmix_elf_relax_section): Revert 2009-05-27
203         change.  Add note to head comment.
204
205 2009-07-28  Jan Beulich  <jbeulich@novell.com>
206
207         * archive.c (get_extended_arelt_filename): Remove redundant
208         range check on index.
209
210 2009-07-27  Doug Kwan  <dougkwan@google.com>
211
212         * elf32-arm.c (stub_hash_newfunc): Initialize field output_name.
213
214 2009-07-27  H.J. Lu  <hongjiu.lu@intel.com>
215
216         * archures.c bfd_*_arch): Sorted.
217         (bfd_archures_list): Likewise.
218
219 2009-07-27  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
220
221         * elf32-cr16.c (elf_cr16_final_link_relocate): Add code to handle
222         to R_cr16_NUM32 relocation.
223
224 2009-07-26  Michael Eager  <eager@eagercon.com>
225
226         * archures.c: Add bfd_mach_ppc_405
227         * bfd-in2.h: Same.
228
229 2009-07-25  H.J. Lu  <hongjiu.lu@intel.com>
230
231         * cpu-i386.c (bfd_x86_64_arch): Fix comment typos.
232         * cpu-l1om.c (bfd_l1om_arch): Likewise.
233
234 2009-07-25  H.J. Lu  <hongjiu.lu@intel.com>
235
236         * archures.c (bfd_architecture): Add bfd_arch_l1om.
237         (bfd_l1om_arch): New.
238         (bfd_archures_list): Add &bfd_l1om_arch.
239         * bfd-in2.h: Regenerated.
240
241         * config.bfd (targ64_selvecs): Add bfd_elf64_l1om_vec if
242         bfd_elf64_x86_64_vec is supported.  Add bfd_elf64_l1om_freebsd_vec
243         if bfd_elf64_x86_64_freebsd_vec is supported.
244         (targ_selvecs): Likewise.
245
246         * configure.in: Support bfd_elf64_l1om_vec and
247         bfd_elf64_l1om_freebsd_vec.
248         * configure: Regenerated.
249
250         * cpu-l1om.c: New.
251
252         * elf64-x86-64.c (elf64_l1om_elf_object_p): New.
253         (bfd_elf64_l1om_vec): Likewise.
254         (bfd_elf64_l1om_freebsd_vec): Likewise.
255
256         * Makefile.am (ALL_MACHINES): Add cpu-l1om.lo.
257         (ALL_MACHINES_CFILES): Add cpu-l1om.c.
258         * Makefile.in: Regenerated.
259
260         * targets.c (bfd_elf64_l1om_vec): New.
261         (bfd_elf64_l1om_freebsd_vec): Likewise.
262         (_bfd_target_vector): Add bfd_elf64_l1om_vec and
263         bfd_elf64_l1om_freebsd_vec.
264
265 2009-07-24  Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
266             Alan Modra  <amodra@bigpond.net.au>
267
268         * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define.
269         * bfd-in2.h: Regenerate.
270         * libbfd.h: Regenerate.
271         * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC.
272         (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC.
273         (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC.
274
275 2009-07-23  H.J. Lu  <hongjiu.lu@intel.com>
276
277         PR ld/10434
278         * elf64-x86-64.c (elf64_x86_64_check_relocs): Check executable
279         instead of shared for R_X86_64_TPOFF32.
280         (elf64_x86_64_relocate_section): Likewise.
281
282 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
283
284         * elf-bfd.h (struct elf_link_hash_entry): Add unique_global field.
285         * elf.c (swap_out_syms): Set binding to STB_GNU_UNIQUE for symbols
286         with the BSF_GNU_UNIQUE flag bit set.
287         * elfcode.h (elf_slurp_symbol_table): Set the BSF_GNU_UNIQUE flag
288         for symbols with STB_GNU_UNIQUE binding.
289         * elflink.c (_bfd_elf_merge_symbol): Set unique_global for symbols
290         with the STB_GNU_UNIQUE binding.
291         (elf_link_add_object_symbols): Set the BSF_GNU_UNIQUE flag for
292         symbols with STB_GNU_UNIQUE binding.  Set STB_GNU_UNIQUE for
293         symbols with the unique_global field set.
294         (elf_link_output_extsym): Set unique_global field for symbols with
295         the STB_GNU_UNIQUE binding.
296         * syms.c (struct bfd_symbol): Define BSF_GNU_UNIQUE flag bit.
297         (bfd_print_symbol_vandf): Print a 'u' character for BSF_GNU_UNIQUE
298         symbols.
299         (bfd_decode_symclass): Return a 'u' character for BSF_GNU_UNIQUE
300         symbols.
301         * bfd-in2.h: Regenerate.
302
303 2009-07-22  H.J. Lu  <hongjiu.lu@intel.com>
304
305          * elflink.c (elf_link_output_extsym): Revert the last change.
306
307 2009-07-22  H.J. Lu  <hongjiu.lu@intel.com>
308
309          PR ld/10433
310          * elflink.c (elf_link_output_extsym): Special case ifunc syms
311          when ref_regular, not def_regular.
312
313 2009-07-21  H.J. Lu  <hongjiu.lu@intel.com>
314
315          PR ld/10426
316          * elflink.c (elf_link_add_object_symbols): Turn an IFUNC symbol
317          from a DSO into a normal FUNC symbol.
318          (elf_link_output_extsym): Turn an undefined IFUNC symbol into
319          a normal FUNC symbol.
320
321 2009-07-17  Chao-ying Fu  <fu@mips.com>
322
323         * elfxx-mips.c (LOAD_INTERLOCKS_P): New define.
324         (_bfd_mips_elf_size_dynamic_sections): For CPUs without load
325         interlocking, the last PLT entry needs a nop in the branch delay slot.
326         (_bfd_mips_elf_finish_dynamic_symbol): For CPUs with load itnerlocking,
327         output the last two PLT entries in reverse order.
328
329 2009-07-16  H.J. Lu  <hongjiu.lu@intel.com>
330
331         * elf32-i386.c (elf_i386_relocate_section): Don't get local
332         STT_GNU_IFUNC symbol for relocatable link.
333         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
334
335 2009-07-10  H.J. Lu  <hongjiu.lu@intel.com>
336
337         * bfdio.c (bfd_iovec): Add comments for bmmap.
338         * bfd-in2.h: Regenerated.
339
340 2009-07-10  H.J. Lu  <hongjiu.lu@intel.com>
341
342         * Makefile.am: Run "make dep-am".
343         * Makefile.in: Regenerated.
344
345 2009-07-10  Doug Kwan  <dougkwan@google.com>
346
347         * elf32-arm.c (stub_hash_newfunc): Initialize fields
348         target_addend and orig_insn.
349
350 2009-07-10  Tom Tromey  <tromey@redhat.com>
351
352         * Makefile.am (dwarf2.lo): Use dwarf2.h, not elf/dwarf2.h.
353         (elf-eh-frame.lo): Likewise.
354         (elf32-bfin.lo): Likewise.
355         (elf32-frv.lo): Likewise.
356         (elf32-xc16x.lo): Likewise.
357         * Makefile.in: Rebuild.
358         * dwarf2.c: Included dwarf.h, not elf/dwarf2.h.
359         * elf-eh-frame.c: Likewise.
360         * elf32-bfin.c: Likewise.
361         * elf32-frv.c: Likewise.
362         * elf32-xc16x.c: Likewise.
363
364 2009-07-10  Julian Brown  <julian@codesourcery.com>
365
366         * elf32-arm.c (arm_build_one_stub): Use the hash entry of the
367         symbol a stub entry is derived from, not the entry for the stub
368         itself, in call to elf32_arm_final_link_relocate.
369
370 2009-07-10  H.J. Lu  <hongjiu.lu@intel.com>
371
372         * elf.c (_bfd_elf_get_synthetic_symtab): Remove leading zeros
373         when reporting  addends.
374
375 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
376
377         * elf32-spu.c (spu_elf_size_stubs): Do set up soft-icache manager
378         data even when no stubs.
379         (spu_elf_place_overlay_data, spu_elf_build_stubs): Adjust.
380
381 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
382
383         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_IRELATIVE.
384         (ppc_elf_get_synthetic_symtab): Report addend.
385         (PLT_IFUNC): Define.
386         (struct ppc_elf_link_hash_table): Add iplt and reliplt.
387         (ppc_elf_create_glink): New function.
388         (ppc_elf_create_dynamic_sections): Use it.
389         (ppc_elf_add_symbol_hook): Set has_ifunc_symbols.
390         (update_local_sym_info): Allocate space for local_plt array.
391         Don't bump local_got_refcounts for PLT_IFUNC.  Return local_plt
392         entry pointer.
393         (is_branch_reloc): New function.
394         (ppc_elf_check_relocs): Handle STT_GNU_IFUNC symbols.
395         (ppc_elf_gc_sweep_hook): Likewise.
396         (ppc_elf_adjust_dynamic_symbol): Likewise.
397         (allocate_dynrelocs): Likewise.
398         (ppc_elf_size_dynamic_sections): Likewise.
399         (ppc_elf_relocate_section): Likewise.
400         (branch_reloc_hash_match): Use is_branch_reloc.
401         (ppc_elf_tls_optimize): Adjust for local_plt.
402         (write_glink_stub): New function, extracted from..
403         (ppc_elf_finish_dynamic_symbol): ..here.  Handle STT_GNU_IFUNC.
404         (ppc_elf_finish_dynamic_sections): Only write plt resolver and
405         branch table when dynamic.
406         (elf_backend_post_process_headers): Define.
407         * elf64-ppc.c (elf_backend_post_process_headers): Define.
408         (ppc64_elf_howto_raw): Add R_PPC64_IRELATIVE.
409         (ppc64_elf_get_synthetic_symtab): Report addend.
410         (struct ppc_stub_hash_entry): Add plt_ent.
411         (PLT_IFUNC): Define.
412         (struct ppc_link_hash_table): Add iplt and reliplt.
413         (create_linkage_sections): Make .iplt and .rela.iplt sections.
414         (ppc64_elf_add_symbol_hook): Set has_ifunc_symbols.
415         (update_local_sym_info): Allocate space for local_plt array.
416         Don't bump local_got_ents for PLT_IFUNC.  Return local_plt
417         entry pointer.
418         (update_plt_info): Pass pointer to plt_entry rather than sym hash,
419         and don't change hash flags here.
420         (is_branch_reloc): New function.
421         (ppc64_elf_check_relocs): Handle STT_GNU_IFUNC.
422         (ppc64_elf_gc_sweep_hook): Likewise.
423         (ppc64_elf_adjust_dynamic_symbol): Likewise.
424         (allocate_dynrelocs): Likewise.
425         (ppc64_elf_size_dynamic_sections): Likewise.
426         (ppc_build_one_stub, ppc_size_one_stub): Likewise.
427         (ppc64_elf_size_stubs): Likewise.
428         (ppc64_elf_relocate_section): Likewise.
429         (get_sym_h): Adjust for local_plt.
430         (branch_reloc_hash_match): Use is_branch_reloc.
431         (ppc_type_of_stub): Pass plt_entry pointer and handle ifunc.
432         (ppc64_elf_toc): Ignore SEC_EXCLUDE sections.
433
434 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
435
436         * elf.c (_bfd_elf_get_synthetic_symtab): Report addends.
437
438 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
439
440         * elf-bfd.h (struct elf_link_hash_entry): Clarify ref_regular
441         and ref_regular_nonweak comment.
442         * elflink.c (elf_link_output_extsym): Special case ifunc syms
443         when def_regular, not ref_regular.
444         (elf_link_add_object_symbols): Don't set needs_plt on ifunc syms,..
445         * elf32-i386.c (elf_i386_check_relocs): ..set it here instead..
446         * elf64-x86-64.c (elf64_x86_64_check_relocs): ..and here.
447
448 2009-07-09  Alan Modra  <amodra@bigpond.net.au>
449
450         * elf32-spu.c (mark_functions_via_relocs): Init broken_cycle field
451         of malloc'd struct call_info.
452         (pasted_function): Likewise, priority too.
453
454 2009-07-07  Alan Modra  <amodra@bigpond.net.au>
455
456         * elf32-spu.c (spu_elf_auto_overlay): Take into account section
457         alignment when packing sections into overlays.
458
459 2009-07-03  Cary Coutant  <ccoutant@google.com>
460
461         * dwarf2.c (decode_line_info): Ignore DW_LNE_set_discriminator.
462
463 2009-07-03  Dave Korn  <dave.korn.cygwin@gmail.com>
464
465         * coffcode.h (sec_to_styp_flags):  Partially revert (functional
466         changes only) earlier patch:-
467
468   2009-06-25  Kai Tietz  <kai.tietz@onevision.com>
469
470           * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
471           give .debug and .reloc data characteristics.
472           (DOT_RELOC): New define for .reloc section string.
473           (coff_write_object_contents): Use DOT_RELOC instead of string.
474
475 2009-07-02  Tom Tromey  <tromey@redhat.com>
476
477         * aoutx.h (aout_get_external_symbols): Declare 'amt' locally.
478         * bfdwin.c (bfd_free_window): Cast to unsigned long.
479
480 2009-07-01  Nick Clifton  <nickc@redhat.com>
481
482         * elf-m10300.c: Remove trailing white space.
483         * reloc.c: Likewise.
484
485 2009-07-01  Douglas B Rupp  <rupp@gnat.com>
486
487         * bfd.m4 (BFD_HAVE_TIME_TYPE_MEMBER,
488         BFD_HAVE_SYS_STAT_TYPE_MEMBER): New config functions.
489         * configure.in: Use them.
490         * configure: Regenerate.
491         * config.in: Regnerate.
492         * vmsutil.c: Include sysdep.h, remove ansidecl.h.
493         #define _BSD_SOURCE. Add comments.
494         (vms_file_stats_name): Calculate creation date based on available
495         runtime data. Return 1 for version instead of 0.
496
497 2009-07-01  Nick Clifton  <nickc@redhat.com>
498
499         PR 10072
500         * elf32-arm.c (elf32_arm_final_link_relocate): Add code to handle
501         to R_ARM_THM_PC8 relocation.
502
503 2009-06-29  Nick Clifton  <nickc@redhat.com>
504
505         * elf-m10300.c (mn10300_elf_relax_section): Allow for the
506         different uses of the relocations addend when a symbol is in a
507         merged section.
508
509 2009-06-27  H.J. Lu  <hongjiu.lu@intel.com>
510
511         PR ld/10337
512         * elf.c (bfd_section_from_shdr): Don't change sh_link for
513         SHT_REL/SHT_RELA sections on executable nor shared library.
514         Treat SHT_REL/SHT_RELA sections with sh_link set to SHN_UNDEF
515         as a normal section.
516
517 2009-06-25  Nick Clifton  <nickc@redhat.com>
518
519         * elf-m10300.c (mn10300_elf_relax_section): Handle non-section
520         symbols with SEC_MERGE flag.
521
522 2009-06-25  Kai Tietz  <kai.tietz@onevision.com>
523
524         * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
525         give .debug and .reloc data characteristics.
526         (DOT_RELOC): New define for .reloc section string.
527         (coff_write_object_contents): Use DOT_RELOC instead of string.
528
529 2009-06-25  Tristan Gingold  <gingold@adacore.com>
530
531         * mach-o-target.c (bfd_mach_o_get_dynamic_symtab_upper_bound)
532         (bfd_mach_o_canonicalize_dynamic_symtab)
533         (bfd_mach_o_get_synthetic_symtab): Defines.
534         (TARGET_NAME_BACKEND): Add bfd_mach_o_print_thread entry.
535         (TARGET_NAME): Use Mach-O specific functions for dynamic.
536
537         * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_in): Fix howto indexes
538         for scattered relocations.
539         (bfd_mach_o_i386_print_thread): New function.
540         (bfd_mach_o_print_thread): Define.
541
542         * mach-o.c (text_section_names_xlat): Add an entry for __const.
543         (bfd_mach_o_canonicalize_one_reloc, bfd_mach_o_canonicalize_relocs): 
544         New functions extracted from ...
545         (bfd_mach_o_canonicalize_reloc): ... This.  Simplified.
546         (bfd_mach_o_get_dynamic_reloc_upper_bound): New function.
547         (bfd_mach_o_canonicalize_dynamic_reloc): New function.
548         (bfd_mach_o_i386_flavour_string): Adjusted after enum renaming.
549         (bfd_mach_o_ppc_flavour_string): Reindentation.  Add 64 bits cases.
550         (bfd_mach_o_scan_read_dylinker): Do not create a section anymore.
551         Set name_str field.
552         (bfd_mach_o_scan_read_dylib): Ditto.
553         (bfd_mach_o_scan_read_thread): Set mdata at declaration.  Add comments,
554         reindent.
555         (bfd_mach_o_scan_read_dysymtab): Set mdata at declaration.  Correctly
556         decode isym and flags on little endian targets.  Set dysymtab field.
557         (bfd_mach_o_scan_start_address): Adjust for enum names.
558         (bfd_mach_o_lookup_section): Do not look for segments anymore.
559         (bfd_mach_o_print_section): Display bfd section name.
560         (bfd_mach_o_print_segment): Display none if no name.
561         (bfd_mach_o_print_dysymtab): Display next index for local, external
562         and undefined symbols.
563         (bfd_mach_o_bfd_print_private_bfd_data): Adjust code by using name_str.
564         Display dylinker name. Display thread and unixthread commands content.
565         (bfd_mach_o_print_thread): New macro.
566
567         * mach-o.h (bfd_mach_o_mach_header_magic): Align numbers.
568         (bfd_mach_o_ppc_thread_flavour): Ditto.
569         (bfd_mach_o_i386_thread_flavour): Ditto.
570         (BFD_MACH_O_PPC_THREAD_STATE_NONE): New enum.
571         (BFD_MACH_O_x86_THREAD_STATE_NONE): Replaces
572         BFD_MACH_O_THREAD_STATE_NONE.
573         (bfd_mach_o_segment_command): Remove segment field.
574         (bfd_mach_o_thread_flavour): Field offset is now unsigned long.
575         (bfd_mach_o_dylinker_command): Remove section field, add name_str.
576         (bfd_mach_o_prebound_dylib_command): Ditto.
577         (bfd_mach_o_dylib_command): Ditto.
578         (bfd_mach_o_prebound_dylib_command): Remove section field.
579         (mach_o_data_struct): Add dysymtab field.
580         (bfd_mach_o_backend_data): Add _bfd_mach_o_print_thread field.
581         (bfd_mach_o_get_reloc_upper_bound, bfd_mach_o_canonicalize_reloc)
582         (bfd_mach_o_build_commands): Remove parameter names and attributes.
583         (bfd_mach_o_get_dynamic_reloc_upper_bound)
584         (bfd_mach_o_canonicalize_dynamic_reloc): New prototypes.
585
586 2009-06-25  Rafael Avila de Espindola  <espindola@google.com>
587
588         * plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type
589         field of struct dirent.
590
591 2009-06-23  Tristan Gingold  <gingold@adacore.com>
592
593         * vms.c (vms_get_synthetic_symtab): Remove duplicate definition
594         of this macro.  Fix indentation.
595
596 2009-06-22  Christophe Lyon  <christophe.lyon@st.com>
597
598         * elf32-arm.c (elf32_arm_size_stubs): Use PLT address as
599         destination for defined dynamic symbols when deciding whether to
600         insert a stub or not.
601         (allocate_dynrelocs): Make sure functions are not marked as Thumb
602         when actually accessed through a PLT, even when generating a
603         shared lib.
604
605 2009-06-22  Tristan Gingold  <gingold@adacore.com>
606
607         * mach-o.c (bfd_mach_o_canonicalize_reloc): Append a sentinel to
608         the relocs array.
609
610 2009-06-22  Alan Modra  <amodra@bigpond.net.au>
611
612         * elf32-ppc.c (ppc_elf_check_relocs): Handle R_PPC_RELAX* in switch.
613         * elf32-v850.c (v850_elf_relocate_section): Warning fix.
614
615 2009-06-22  Alan Modra  <amodra@bigpond.net.au>
616
617         * elf64-ppc.c (ppc64_elf_edit_opd): Avoid gcc warning.
618
619 2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>
620
621         * elflink.c (elf_link_add_object_symbols): Avoid warning
622         from -Wjump-misses-init in gcc 4.5.0.
623
624 2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>
625
626         * elf32-i386.c (elf_i386_check_relocs): Properly check local
627         symbol on error.
628         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
629
630 2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>
631
632         * elf32-i386.c (elf_i386_tls_transition): Add a parameter,
633         r_symndx.  Report local symbol name on error.
634         (elf_i386_check_relocs): Updated.  Report local symbol name on
635         error.
636         (elf_i386_gc_sweep_hook): Updated.
637         (elf_i386_relocate_section): Likewise.
638
639         * elf64-x86-64.c (elf64_x86_64_tls_transition): Add a parameter,
640         r_symndx.  Report local symbol name on error.
641         (elf64_x86_64_check_relocs): Updated.  Report local symbol name
642         on error.
643         (elf64_x86_64_gc_sweep_hook): Updated.
644         (elf64_x86_64_relocate_section): Likewise.
645
646 2009-06-19  Tristan Gingold  <gingold@adacore.com>
647
648         * mach-o.c (bfd_mach_o_print_private_header): Fix format character.
649
650 2009-06-19  Tristan Gingold  <gingold@adacore.com>
651
652         * mach-o.c (bfd_mach_o_scan_read_symtab_symbols): Add prototype.
653         (bfd_mach_o_version): Use bfd_mach_o_get_data instead of direct access.
654         (bfd_mach_o_valid): Ditto.
655         (bfd_mach_o_wide_p): Ditto.
656         (bfd_mach_o_canonicalize_reloc): Ditto.
657         (bfd_mach_o_build_commands): Ditto.
658         (bfd_mach_o_scan_read_thread): Ditto.
659         (bfd_mach_o_flatten_sections): Ditto.
660         (bfd_mach_o_scan_start_address): Ditto.
661         (bfd_mach_o_lookup_section): Ditto.
662         (bfd_mach_o_core_fetch_environment): Ditto.
663         (bfd_mach_o_write_contents): Ditto.  Handle reexport_dylib.
664         (bfd_mach_o_scan_write_relocs): Adjust for bfd_mach_o_get_data.
665         (bfd_mach_o_scan_write_symtab): Ditto.
666         Use macros instead of hard-coded values.
667         (bfd_mach_o_scan_read_symtab_symbol): Make the function static.
668         Use bfd_mach_o_get_data instead of direct access.  Use macros
669         instead of hard-coded values.
670         (bfd_mach_o_scan_read_symtab_strtab): Make the function static.
671         Remove sym argument and get section from mdata.
672         Move code into the else branch.
673         (bfd_mach_o_scan_read_symtab_symbols): Make the function static.
674         Remove sym argument and get section from mdata.  Adjust code.
675         (bfd_mach_o_scan_read_dylib): Move assertion into the created
676         switch (which replaces consecutive if statements).
677         (bfd_mach_o_scan_read_dysymtab): Rename seg to cmd.  Load
678         module table, table of content, indirect symbols and external
679         referenced symbols.
680         (bfd_mach_o_scan_read_symtab): Renames seg to symtab.  Set symtab
681         field.
682         (bfd_mach_o_scan_read_linkedit): New function.
683         (bfd_mach_o_scan_read_str): Ditto.
684         (bfd_mach_o_count_symbols): Simplify the code by using the symtab
685         field of mdata.
686         (bfd_mach_o_get_symtab_upper_bound): Remove check as
687         bfd_mach_o_count_symbols never returns an error.
688         (bfd_mach_o_canonicalize_symtab): Simplify the code by using the
689         symtab field (there might be only one symtab).
690         (bfd_mach_o_scan_read_command): Handle reexported dylib.
691         Handle sub frameworks, sub umbrella, sub library and sub client.
692         Read code signature and segment split info commands.
693         (bfd_mach_o_scan): Reindent.
694         (bfd_mach_o_xlat_name): New type.
695         (bfd_mach_o_print_flags): New function.
696         (bfd_mach_o_get_name): Ditto.
697         (bfd_mach_o_cpu_name): New variable.
698         (bfd_mach_o_filetype_name, bfd_mach_o_header_flags_name)
699         (bfd_mach_o_section_type_name)
700         (bfd_mach_o_section_attribute_name)
701         (bfd_mach_o_load_command_name): New variables.
702         (bfd_mach_o_print_private_header): New function.
703         (bfd_mach_o_print_section_map): New function extracted from
704         bfd_mach_o_print_private_bfd_data.
705         (bfd_mach_o_print_section): Ditto.  Print more infos.
706         (bfd_mach_o_print_segment): Ditto.
707         (bfd_mach_o_print_dysymtab): Ditto.
708         (bfd_mach_o_bfd_print_private_bfd_data): Reworked.  Handle
709         load weak dylib, reexport dylib and id dylib.
710         Handle code signature and segment_split info.
711         Handle sub frameworks, sub umbrella, sub library and sub client.
712         (bfd_mach_o_section_get_nbr_indirect): New function.
713
714         * mach-o.h (BFD_MACH_O_REFERENCE_MASK): New macro.  Add comment.
715         (bfd_mach_o_header_flags): New enum to define header flags.
716         (bfd_mach_o_section_attribute): New enum to replace ...
717         (BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC,
718         BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG,
719         BFD_MACH_O_S_SELF_MODIFYING_CODE, BFD_MACH_O_S_ATTR_LIVE_SUPPORT,
720         BFD_MACH_O_S_ATTR_NO_DEAD_STRIP, BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS,
721         BFD_MACH_O_S_ATTR_NO_TOC, BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): ...
722         these removed macros.
723         (BFD_MACH_O_NLIST_SIZE, BFD_MACH_O_NLIST_64_SIZE): New macros.
724         (bfd_mach_o_dylib_module): New type.
725         (BFD_MACH_O_DYLIB_MODULE_SIZE, BFD_MACH_O_DYLIB_MODULE_64_SIZE): New
726         macros.
727         (bfd_mach_o_dylib_table_of_content): New type.
728         (BFD_MACH_O_TABLE_OF_CONTENT_SIZE): New macro.
729         (bfd_mach_o_dylib_reference): New type.
730         (BFD_MACH_O_REFERENCE_SIZE): New macro.
731         (bfd_mach_o_dysymtab_command): Add fields for loaded and decoded
732         modules, toc, references and indirect syms.
733         (BFD_MACH_O_INDIRECT_SYMBOL_SIZE): New macro.
734         (bfd_mach_o_dylinker_command): Remove cmd and cmdsize fields (were
735         unused).  Add comment.
736         (bfd_mach_o_dylib_command): Ditto.
737         (bfd_mach_o_prebound_dylib_command): Ditto.
738         (bfd_mach_o_linkedit_command): New type.
739         (bfd_mach_o_str_command): New type.
740         (bfd_mach_o_load_command): Add linkedit and str fields.
741         (mach_o_data_struct): Add symtab field.
742         (bfd_get_mach_o_data): Renamed to ...
743         (bfd_mach_o_get_data): ... this new macro.
744         (bfd_mach_o_scan_read_symtab_symbol,
745         bfd_mach_o_scan_read_symtab_strtab,
746         bfd_mach_o_scan_read_symtab_symbols): Prototypes removed.
747
748         * mach-o-i386.c (bfd_mach_o_i386_mkobject): Use bfd_mach_o_get_data
749         instead of direct access.
750
751 2009-06-19  Alan Modra  <amodra@bigpond.net.au>
752
753         * elf32-ppc.c (ppc_elf_check_relocs): Allow local symbols for
754         R_PPC_PLTREL24 relocs.
755         (ppc_elf_relocate_section): Likewise.
756
757 2009-06-19  Alan Modra  <amodra@bigpond.net.au>
758
759         * elf32-ppc.c (find_plt_ent): Pass pointer to plist rather than
760         pointer to sym hash.  Update all uses.
761         (update_plt_info): Likewise.  Don't check addend here.
762
763 2009-06-18  H.J. Lu  <hongjiu.lu@intel.com>
764
765         * elf32-i386.c (elf_i386_check_relocs): Remove isymbuf and use
766         bfd_sym_from_r_symndx.
767         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
768
769 2009-06-18  Alan Modra  <amodra@bigpond.net.au>
770
771         * elf-bfd.h (struct sym_sec_cache): Delete.
772         (struct sym_cache): New.
773         (bfd_section_from_r_symndx): Delete prototype.
774         (bfd_sym_from_r_symndx): Define prototype.
775         * elf.c (bfd_section_from_r_symndx): Delete, replace with..
776         (bfd_sym_from_r_symndx): ..new function.
777         * elf32-arm.c: Update all uses of struct sym_sec_cache and
778         bfd_section_from_r_symndx to new struct and function.
779         * elf32-bfin.c: Likewise.
780         * elf32-hppa.c: Likewise.
781         * elf32-i386.c: Likewise.
782         * elf32-m32r.c: Likewise.
783         * elf32-m68hc1x.c: Likewise.
784         * elf32-m68hc1x.h: Likewise.
785         * elf32-m68k.c: Likewise.
786         * elf32-ppc.c: Likewise.
787         * elf32-s390.c: Likewise.
788         * elf32-sh.c: Likewise.
789         * elf64-ppc.c: Likewise.
790         * elf64-s390.c: Likewise.
791         * elf64-x86-64.c: Likewise.
792         * elfxx-sparc.c: Likewise.
793         * elfxx-sparc.h: Likewise.
794
795 2009-06-18  H.J. Lu  <hongjiu.lu@intel.com>
796
797         * elf32-i386.c (elf_i386_check_relocs): Cache or free isymbuf.
798         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
799
800 2009-06-18  Nick Clifton  <nickc@redhat.com>
801
802         * elflink.c (elf_link_sort_relocs): Return early if there are no
803         relocs to sort.
804
805 2009-06-18  Dave Korn  <dave.korn.cygwin@gmail.com>
806
807         Merge cegcc and mingw32ce target name changes from
808         CeGCC project:
809
810         2007-12-25  Pedro Alves  <pedro_alves@portugalmail.pt>
811
812         * config.bfd: Add arm*-*-cegcc* target.
813
814         2007-12-17  Pedro Alves  <pedro_alves@portugalmail.pt>
815
816         * config.bfd: Add arm-*-mingw32ce* target.
817
818 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
819
820         * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): New.
821         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Likewise.
822         * elf32-i386.c (elf_i386_allocate_dynrelocs): Use it.
823         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
824
825 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
826
827         * elf-bfd.h (_bfd_elf_create_ifunc_dyn_reloc): New.
828         * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Likewise.
829         * elf32-i386.c (elf_i386_check_relocs): Use it.
830         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
831
832 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
833
834         * elf-bfd.h (elf_dyn_relocs): New.
835
836         * elf32-i386.c (elf_i386_dyn_relocs): Removed.
837         (elf_i386_link_hash_entry): Replace elf_i386_dyn_relocs with
838         elf_dyn_relocs.
839         (elf_i386_copy_indirect_symbol): Likewise.
840         (elf_i386_check_relocs): Likewise.
841         (elf_i386_gc_sweep_hook): Likewise.
842         (elf_i386_allocate_dynrelocs): Likewise.
843         (elf_i386_readonly_dynrelocs): Likewise.
844         (elf_i386_size_dynamic_sections): Likewise.
845
846         * elf64-x86-64.c (elf64_x86_64_dyn_relocs): Removed.
847         (elf64_x86_64_link_hash_entry): Replace elf64_x86_64_dyn_relocs
848         with elf_dyn_relocs.
849         (elf64_x86_64_copy_indirect_symbol): Updated.
850         (elf64_x86_64_check_relocs): Likewise.
851         (elf64_x86_64_gc_sweep_hook): Likewise.
852         (elf64_x86_64_adjust_dynamic_symbol): Likewise.
853         (elf64_x86_64_allocate_dynrelocs): Likewise.
854         (elf64_x86_64_readonly_dynrelocs): Likewise.
855         (elf64_x86_64_size_dynamic_sections): Likewise.
856
857 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
858
859         * elf32-arm.c (create_got_section): Get existing .rela.got
860         section.
861         * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise.
862         * elf32-lm32.c (create_got_section): Likewise.
863         * elf32-m32r.c (create_got_section): Likewise.
864         * elf32-ppc.c (ppc_elf_create_got): Likewise.
865         * elf32-s390.c (create_got_section): Likewise.
866         * elf32-sh.c (create_got_section): Likewise.
867         * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise.
868         * elf64-s390.c (create_got_section): Likewise.
869         * elfxx-sparc.c (create_got_section): Likewise.
870
871         * elflink.c (_bfd_elf_create_got_section): Properly initialize
872         the GOT size.
873
874 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
875
876         * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): New.
877
878         * elf32-i386.c (elf_i386_local_hash): Removed.
879         (elf_i386_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
880         (elf_i386_get_local_sym_hash): Likewise.
881
882         * elf64-x86-64.c (elf64_x86_64_local_hash): Removed.
883         (elf64_x86_64_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
884         (elf64_x86_64_get_local_sym_hash): Likewise.
885         * elfxx-ia64.c (elfNN_ia64_local_htab_hash): Likewise.
886         (get_local_sym_hash): Likewise.
887
888 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
889
890         * elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
891         rel_got_sec and plt_sec.
892         (elfNN_ia64_relax_section): Updated.
893         (elfNN_ia64_create_dynamic_sections): Likewise.
894         (get_got): Likewise.
895         (allocate_dynrel_entries): Likewise.
896         (elfNN_ia64_size_dynamic_sections): Likewise.
897         (set_got_entry): Likewise.
898         (elfNN_ia64_choose_gp): Likewise.
899         (elfNN_ia64_relocate_section): Likewise.
900         (elfNN_ia64_finish_dynamic_symbol): Likewise.
901         (elfNN_ia64_finish_dynamic_sections): Likewise.
902
903 2009-06-16  Ulrich Weigand  <uweigand@de.ibm.com>
904
905         * elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits
906         also for calls.
907
908 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
909
910         * configure.in (elf): Add elf-ifunc.lo.
911
912         * configure: Regenerated.
913         * Makefile.in: Likewise.
914
915         * elf-bfd.h (elf_link_hash_table): Add sgot, sgotplt,
916         srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc.
917
918         * elf32-i386.c (elf_i386_link_hash_table): Remove sgot,
919         sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
920         irelifunc.
921         (elf_i386_link_hash_table_create): Likewise.
922         (elf_i386_create_dynamic_sections): Likewise.
923         (elf_i386_check_relocs): Likewise.
924         (elf_i386_allocate_dynrelocs): Likewise.
925         (elf_i386_size_dynamic_sections): Likewise.
926         (elf_i386_relocate_section): Likewise.
927         (elf_i386_finish_dynamic_symbol): Likewise.
928         (elf_i386_finish_dynamic_sections): Likewise.
929         (elf_i386_create_got_section): Removed.
930
931         * elf64-x86-64.c (elf64_x86_64_link_hash_table): Remove sgot,
932         sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
933         irelifunc.
934         (elf64_x86_64_compute_jump_table_size): Updated.
935         (elf64_x86_64_link_hash_table_create): Likewise.
936         (elf64_x86_64_create_dynamic_sections): Likewise.
937         (elf64_x86_64_check_relocs): Likewise.
938         (elf64_x86_64_allocate_dynrelocs): Likewise.
939         (elf64_x86_64_size_dynamic_sections): Likewise.
940         (elf64_x86_64_relocate_section): Likewise.
941         (elf64_x86_64_finish_dynamic_symbol): Likewise.
942         (elf64_x86_64_finish_dynamic_sections): Likewise.
943         (elf64_x86_64_create_got_section): Removed.
944
945         * elflink.c (_bfd_elf_create_got_section): Use log_file_align
946         for pointer alignment.  Set up section pointers.
947         (_bfd_elf_create_dynamic_sections): Likewise.
948         (_bfd_elf_create_ifunc_sections): Moved to ...
949         * elf-ifunc.c: Here.  New.
950
951         * Makefile.am (BFD32_BACKENDS): Add elf-ifunc.lo.
952         (BFD32_BACKENDS_CFILES): Add elf-ifunc.c.
953         Run "make dep-am".
954
955 2009-06-16  Doug Kwan  <dougkwan@google.com>
956
957         * elf32-arm.c (cortex_a8_erratum_scan): Change type of offset
958         to bfd_signed_vma.  Cast constant operands which are used in
959         offset related expressions to bfd_signed_vma type as appropriate.
960
961 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
962
963         * elf32-vax.c (elf_vax_plt_sym_val): New function.
964         (elf_backend_plt_sym_val): Define.
965
966 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
967
968         * elf32-vax.c (elf_vax_reloc_type_class): New function.
969         (elf_backend_reloc_type_class): Define.
970
971 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
972
973         * elf32-vax.c (elf_vax_relocate_section): For symbol references
974         from an executable to a shared library treat R_VAX_PC32
975         relocations as R_VAX_PLT32 ones.
976
977 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
978
979         * elf32-vax.c (elf_vax_instantiate_got_entries): Skip local
980         symbols in GOT space calculation.
981         (elf_vax_relocate_section): Adjust accordingly.
982
983 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
984
985         * elf32-vax.c (elf_vax_plt_entry): Set the entry mask to
986         include <R11:R2>.
987
988 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
989
990         * elf32-vax.c (elf_vax_check_relocs): Handle the visibility
991         attribute.
992         (elf_vax_relocate_section): Likewise.
993
994 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
995
996         * elf32-i386.c (elf_i386_allocate_dynrelocs): Update comments.
997         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
998
999 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
1000
1001         * elf32-i386.c (elf_i386_check_relocs): Reformat.
1002         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
1003
1004 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
1005
1006         * Makefile.am: Run "make dep-am".
1007         * Makefile.in: Regenerated.
1008
1009 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
1010
1011         * elf32-i386.c (elf_i386_allocate_dynrelocs): Fix a typo.
1012         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
1013
1014 2009-06-15  Nick Clifton  <nickc@redhat.com>
1015
1016         * po/ru.po: New Russian translation.
1017         * configure.in (ALL_LINGUAS): Add ru.
1018         * configure: Regenerate.
1019
1020 2009-06-14  H.J. Lu  <hongjiu.lu@intel.com>
1021
1022         * elf32-i386.c: Remove duplicated comments.
1023
1024 2009-06-14  H.J. Lu  <hongjiu.lu@intel.com>
1025
1026         PR ld/10270
1027         * elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow
1028         dynamic IFUNC pointer in non-shared object.  Use .got.plt
1029         for IFUNC definition in PIE.
1030         (elf_i386_allocate_dynrelocs): Resolve IFUNC definition in
1031         PIE locally.
1032
1033         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow
1034         dynamic IFUNC pointer in non-shared object.  Use .got.plt
1035         for IFUNC definition in PIE.
1036         (elf64_x86_64_relocate_section): Resolve IFUNC definition in
1037         PIE locally.
1038
1039 2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>
1040
1041         * elf32-i386.c (elf_i386_check_relocs): Properly report
1042         local symbol for unhandled relocation against STT_GNU_IFUNC
1043         symbol.
1044         (elf_i386_relocate_section): Likewise.
1045         * elf64-x86-64.c (elf64_x86_64_check_relocs):  Likewise.
1046         (elf64_x86_64_relocate_section): Likewise.
1047
1048 2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>
1049
1050         PR ld/10269
1051         * elf32-i386.c: Include "objalloc.h" and "hashtab.h".
1052         (elf_i386_link_hash_table): Add loc_hash_table and
1053         loc_hash_memory.
1054         (elf_i386_local_hash): New.
1055         (elf_i386_local_htab_hash): Likewise.
1056         (elf_i386_local_htab_eq): Likewise.
1057         (elf_i386_get_local_sym_hash): Likewise.
1058         (elf_i386_link_hash_table_free): Likewise.
1059         (elf_i386_allocate_local_dynrelocs): Likewise.
1060         (elf_i386_finish_local_dynamic_symbol): Likewise.
1061         (bfd_elf64_bfd_link_hash_table_free): Likewise.
1062         (elf_i386_link_hash_table_create): Create loc_hash_table and
1063         loc_hash_memory.
1064         (elf_i386_check_relocs): Handle local STT_GNU_IFUNC symbols.
1065         (elf_i386_size_dynamic_sections): Likewise.
1066         (elf_i386_relocate_section): Likewise.
1067         (elf_i386_finish_dynamic_sections): Likewise.
1068         (elf_i386_finish_dynamic_symbol): Check _DYNAMIC only if sym
1069         isn't NULL.
1070
1071         * elf64-x86-64.c: Include "objalloc.h" and "hashtab.h".
1072         (elf64_x86_64_link_hash_table): Add loc_hash_table and
1073         loc_hash_memory.
1074         (elf64_x86_64_local_hash): New.
1075         (elf64_x86_64_local_htab_hash): Likewise.
1076         (elf64_x86_64_local_htab_eq): Likewise.
1077         (elf64_x86_64_get_local_sym_hash): Likewise.
1078         (elf64_x86_64_link_hash_table_free): Likewise.
1079         (elf64_x86_64_allocate_local_dynrelocs): Likewise.
1080         (elf64_x86_64_finish_local_dynamic_symbol): Likewise.
1081         (bfd_elf64_bfd_link_hash_table_free): Likewise.
1082         (elf64_x86_64_link_hash_table_create): Create loc_hash_table
1083         and loc_hash_memory.
1084         (elf64_x86_64_check_relocs): Handle local STT_GNU_IFUNC
1085         symbols.
1086         (elf64_x86_64_size_dynamic_sections): Likewise.
1087         (elf64_x86_64_relocate_section): Likewise.
1088         (elf64_x86_64_finish_dynamic_sections): Likewise.
1089         (elf64_x86_64_finish_dynamic_symbol): Check _DYNAMIC only if
1090         sym isn't NULL.
1091
1092 2009-06-10  Philip Blundell  <philb@gnu.org>
1093
1094         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Avoid crash if
1095         elf_sec->this_hdr == NULL.
1096
1097 2009-06-12  Tristan Gingold  <gingold@adacore.com>
1098
1099         * reloc.c: Add BFD_RELOC_MACH_O_SECTDIFF and BFD_RELOC_MACH_O_PAIR.
1100         * bfd-in2.h: Regenerated.
1101         * libbfd.h: Regenerated.
1102
1103         * mach-o.c (FILE_ALIGN): New macro.
1104         (bfd_mach_o_canonicalize_symtab): Adjust for bfd_mach_o_asymbol.
1105         (bfd_mach_o_print_symbol): Ditto.
1106         (bfd_mach_o_scan_write_thread): Adjust type of variable offset.
1107         (bfd_mach_o_get_reloc_upper_bound): New function.
1108         (bfd_mach_o_canonicalize_reloc): Ditto.
1109         (bfd_mach_o_scan_write_relocs): Ditto.
1110         (bfd_mach_o_scan_write_section_32): Remove offset argument.
1111         (bfd_mach_o_scan_write_section_64): Ditto.
1112         (bfd_mach_o_scan_write_segment_32): Write relocs.  Fix size of data
1113         written for load command.  Do not compute section file offset.
1114         (bfd_mach_o_scan_write_segment_64): Ditto.
1115         (bfd_mach_o_scan_write_symtab): Compute file offset first.
1116         Adjust for bfd_mach_o_asymbol.  Move code to convert from BFD to
1117         Mach-O to ...
1118         (bfd_mach_o_mangle_symbols): ... this new function.
1119         (bfd_mach_o_write_contents): Be sure to have load commands built.
1120         Call bfd_mach_o_mangle_symbols.
1121         (bfd_mach_o_build_commands): Adjust for filelen field.
1122         Use FILE_ALIGN macro.  Clear section file offset if section is empty.
1123         Do not set symtab file offset anymore here.
1124         (bfd_mach_o_make_empty_symbol): Allocate a bfd_mach_o_asymbol.
1125         (bfd_mach_o_make_bfd_section): Set SEC_RELOC if has reloc.
1126         Set reloc_count and rel_filepos section fields.
1127         (bfd_mach_o_scan_read_section_32): Type of argument offset is now
1128         unsigned int.
1129         (bfd_mach_o_scan_read_section_64): Ditto.
1130         (bfd_mach_o_scan_read_section): Ditto.
1131         (bfd_mach_o_scan_read_symtab_symbol): Typr of argument s is now
1132         bfd_mach_o_asymbol.  Use unsigned int for file offset type.
1133         (bfd_mach_o_scan_read_symtab_symbol): Adjust for bfd_mach_o_asymbol.
1134         Handle weak-ref symbols.
1135         (bfd_mach_o_scan_read_symtab_symbols): Adjust for bfd_mach_o_asymbol.
1136         (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
1137         (bfd_mach_o_scan): Remove assignment to removed field.
1138         (bfd_mach_o_mkobject_init): Ditto.
1139         (bfd_mach_o_bfd_print_private_bfd_data): Adjust printf formatter.
1140         (bfd_mach_o_bfd_reloc_type_lookup): New macro.
1141         (bfd_mach_o_bfd_reloc_name_lookup): Ditto.
1142         (bfd_mach_o_swap_reloc_in): Ditto.
1143         (bfd_mach_o_swap_reloc_out): Ditto.
1144
1145         * mach-o.h (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY)
1146         (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY)
1147         (BFD_MACH_O_REFERENCE_FLAG_DEFINED)
1148         (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_DEFINED)
1149         (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY)
1150         (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY)
1151         (BFD_MACH_O_REFERENCED_DYNAMICALLY, BFD_MACH_O_N_DESC_DISCARDED)
1152         (BFD_MACH_O_N_NO_DEAD_STRIP, BFD_MACH_O_N_WEAK_REF)
1153         (BFD_MACH_O_N_WEAK_DEF): New macros.
1154         Add comments.
1155         (bfd_mach_o_section_type): Add new enumeration values.
1156         (BFD_MACH_O_S_SELF_MODIFYING_CODE)
1157         (BFD_MACH_O_S_ATTR_LIVE_SUPPORT)
1158         (BFD_MACH_O_S_ATTR_NO_DEAD_STRIP)
1159         (BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS, BFD_MACH_O_S_ATTR_NO_TOC): New
1160         macros.
1161         (BFD_MACH_O_GENERIC_RELOC_VANILLA)
1162         (BFD_MACH_O_GENERIC_RELOC_PAIR)
1163         (BFD_MACH_O_GENERIC_RELOC_SECTDIFF)
1164         (BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR)
1165         (BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF): Ditto.
1166         (BFD_MACH_O_RELENT_SIZE): Ditto.
1167         (BFD_MACH_O_R_PCREL, BFD_MACH_O_GET_R_LENGTH)
1168         (BFD_MACH_O_R_EXTERN, BFD_MACH_O_GET_R_TYPE)
1169         (BFD_MACH_O_GET_R_SYMBOLNUM, BFD_MACH_O_SET_R_LENGTH)
1170         (BFD_MACH_O_SET_R_TYPE, BFD_MACH_O_SET_R_SYMBOLNUM): Ditto.
1171         (BFD_MACH_O_SR_SCATTERED, BFD_MACH_O_SR_PCREL)
1172         (BFD_MACH_O_GET_SR_LENGTH, BFD_MACH_O_GET_SR_TYPE)
1173         (BFD_MACH_O_GET_SR_ADDRESS, BFD_MACH_O_SET_SR_LENGTH)
1174         (BFD_MACH_O_SET_SR_TYPE, BFD_MACH_O_SET_SR_ADDRESS): Ditto.
1175         (bfd_mach_o_reloc_info): New struct.
1176         (bfd_mach_o_asymbol): New struct.
1177         (bfd_mach_o_symtab_command): The symbols field is now of type
1178         bfd_mach_o_asymbol.
1179         (bfd_mach_o_load_command): The offset and len fields are now of type
1180         unsigned int.
1181         (mach_o_data_struct): Remove symbols, nsymbols and ibfd fields.
1182         Add a filelen field.  Add comments.
1183         (bfd_mach_o_backend_data): New struct.
1184         (bfd_mach_o_get_backend_data): New macro.
1185         (bfd_mach_o_scan_read_symtab_symbol): Parameter symbol now of type
1186         bfd_mach_o_asymbol.
1187         (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
1188         (bfd_mach_o_get_reloc_upper_bound): New prototype.
1189         (bfd_mach_o_canonicalize_reloc): Ditto.
1190         
1191         * mach-o-target.c (bfd_mach_o_bfd_is_local_label_name): Remove
1192         duplicated macro.  Now defined to _bfd_generic_is_local_label.
1193         (TARGET_NAME_BACKEND): New macro...
1194         (TARGET_NAME_BACKEND): ... used to name a new variable.
1195         (TARGET_NAME): Define relocs table using bfd_mach_o, reference
1196         Mach-O backend data.
1197
1198         * mach-o-i386.c (i386_howto_table): New variable.
1199         (bfd_mach_o_i386_swap_reloc_in): New function.
1200         (bfd_mach_o_i386_swap_reloc_out): Ditto.
1201         (bfd_mach_o_i386_bfd_reloc_type_lookup): Ditto.
1202         (bfd_mach_o_i386_bfd_reloc_name_lookup): Ditto.
1203         (bfd_mach_o_swap_reloc_in, bfd_mach_o_swap_reloc_out): New macros.
1204         (bfd_mach_o_bfd_reloc_type_lookup)
1205         (bfd_mach_o_bfd_reloc_name_lookup): Ditto.
1206
1207 2009-06-11  Eric Paris  <eparis@redhat.com>
1208             Nick Clifton  <nickc@redhat.com>
1209
1210         * opncls.c (_maybe_make_executable): New function.  Gives execute
1211         permission to an executable bfd that was opened for writing
1212         provided that it is a regular file.  Replaces common code found in...
1213         (bfd_close): here and ...
1214         (bfd_close_all_done): here.
1215
1216 2009-06-11  Anthony Green  <green@moxielogic.com>
1217
1218         * reloc.c: Add BFD_RELOC_MOXIE_10_PCREL.
1219         * bfd-in2.h: Rebuilt.
1220         * libbfd.h: Rebuilt.
1221         * elf32-moxie.c (moxie_elf_howto_table): Add R_MOXIE_PCREL10
1222         relocation support.
1223         (moxie_reloc_map): Ditto.
1224         Clean up copyright notice.
1225
1226 2009-06-10  Paul Pluzhnikov  <ppluzhnikov@google.com>
1227         
1228         * bfd-in2.h: bfd_mmap prototype.
1229         * bfdio.c (bfd_mmap): New function.
1230         * libbfd.h (bfd_iovec): Add bmmap.
1231         * cache.c (cache_bmmap): New function.
1232         (cache_iovec): Initialize bmmap member.
1233         * opencls.c (opncls_bmmap): New function.
1234         (opncls_iovec): Initialize bmmap member.        
1235         
1236 2009-06-09  Tristan Gingold  <gingold@adacore.com>
1237
1238         * mach-o.h (bfd_mach_o_symtab_command): Remove stabs_segment
1239         and stabstr_segment fields.
1240         (mach_o_be_vec, mach_o_le_vec): Removed
1241         (bfd_mach_o_version): New prototype.
1242
1243         * mach-o.c (bfd_mach_o_version): Make this function public.
1244         (mach_o_wide_p): New function.
1245         (bfd_mach_o_wide_p): Ditto.
1246         (bfd_mach_o_convert_section_name_to_bfd): Add prefix only for
1247         weird names.
1248         (bfd_mach_o_convert_section_name_to_mach_o): Fix typo in comment.
1249         Search in the list only if the name starts with a dot.
1250         (bfd_mach_o_write_header): Use mach_o_wide_p instead of hard-coded
1251         test.  Check bfd_seek status.
1252         (bfd_mach_o_scan_write_thread): Check bfd_seek status.
1253         (bfd_mach_o_scan_write_section_32): Ditto.
1254         (bfd_mach_o_scan_write_section_64): Ditto.
1255         (bfd_mach_o_scan_write_section): Removed.
1256         (bfd_mach_o_scan_write_segment): Split into ...
1257         (bfd_mach_o_scan_write_segment_32): ... this and ...
1258         (bfd_mach_o_scan_write_segment_64): ... this.  Check bfd_seek status.
1259         (bfd_mach_o_scan_write_symtab_symbols): Moved into ...
1260         (bfd_mach_o_scan_write_symtab): ... this.  Write symtab from BFD
1261         symbol table.  Now returns a boolean.
1262         (bfd_mach_o_write_contents): Set filetype.  Check bfd_seek status.
1263         Adjust for status type.
1264         (bfd_mach_o_build_commands): Use mach_o_wide_p instead of hard-coded
1265         test.  Write symbol table.  Numbers the sections.
1266         (bfd_mach_o_read_header): Check bfd_seek status.
1267         Use mach_o_wide_p instead of hard-coded test.
1268         (bfd_mach_o_scan_read_section_32): Check bfd_seek status.
1269         (bfd_mach_o_scan_read_section_64): Ditto.
1270         (bfd_mach_o_scan_read_symtab_symbol): Ditto.  Check bfd_seek status.
1271         Use BFD_MACH_O_N_TYPE instead of hard-coded value.  Correctly
1272         handled common symbols.
1273         (bfd_mach_o_scan_read_symtab_strtab): Check bfd_seek status.
1274         (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
1275         (bfd_mach_o_scan_read_dylinker): Ditto.
1276         (bfd_mach_o_scan_read_dylib): Ditto.
1277         (bfd_mach_o_scan_read_thread): Ditto.
1278         (bfd_mach_o_scan_read_symtab): Ditto.
1279         Do not create a section for the stabs.
1280         (bfd_mach_o_scan_read_uuid): Check bfd_seek status.
1281         (bfd_mach_o_scan_read_segment): Ditto.
1282         (bfd_mach_o_scan_read_command): Ditto.
1283         (bfd_mach_o_scan_start_address): Ditto.
1284         (bfd_mach_o_scan): Use mach_o_wide_p instead of hard-coded test.
1285         (bfd_mach_o_archive_p): Check bfd_seek status.
1286         (bfd_mach_o_core_fetch_environment): Ditto.
1287
1288         * mach-o-i386.c (bfd_mach_o_i386_mkobject): Don't set filetype.
1289
1290 2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>
1291
1292         * elf32-i386.c (elf_i386_link_hash_table): Add irelifunc.
1293         (elf_i386_link_hash_table_create): Initialize irelifunc.
1294         (elf_i386_check_relocs): Updated.  Set up irelifunc for
1295         shared objects.
1296         (elf_i386_allocate_dynrelocs): Use irelifunc for dynamic
1297         relocation for non-GOT reference of STT_GNU_IFUNC symbol in
1298         shared objects.
1299         (elf_i386_relocate_section): Likewise.
1300
1301         * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc.
1302         (elf64_x86_64_link_hash_table_create): Initialize irelifunc.
1303         (elf64_x86_64_check_relocs): Updated.  Set up irelifunc for
1304         shared objects.
1305         (elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic
1306         relocation for non-GOT reference of STT_GNU_IFUNC symbol in
1307         shared objects.
1308         (elf64_x86_64_relocate_section): Likewise.
1309
1310         * elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to
1311         ...
1312         (_bfd_elf_create_ifunc_sections): This.
1313
1314         * elflink.c (_bfd_elf_create_static_ifunc_sections): Renamed to
1315         ...
1316         (_bfd_elf_create_ifunc_sections): This.  Create .rel[a].ifunc
1317         for shared objects.
1318
1319 2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>
1320
1321         * elf32-i386.c (elf_i386_check_relocs): Make room for dynamic
1322         relocation for R_386_32 against STT_GNU_IFUNC symbol when
1323         building shared object.  Check info->executable instead of
1324         !info->shared when setting non_got_ref.
1325         (elf_i386_allocate_dynrelocs): Allocate dynamic relocation
1326         for non-GOT reference of STT_GNU_IFUNC symbol in shared
1327         object. Allocate GOT relocation agsinst STT_GNU_IFUNC
1328         symbol if needed.
1329         (elf_i386_relocate_section): Output dynamic relocation for
1330         R_386_32 against STT_GNU_IFUNC symbol to get the real
1331         function address when building shared object.
1332         (elf_i386_finish_dynamic_symbol): Output R_386_GLOB_DAT
1333         relocation for STT_GNU_IFUNC symbol in shared object.
1334
1335         * elf64-x86-64.c (elf64_x86_64_check_relocs): Make room for
1336         dynamic relocation for R_X86_64_64 against STT_GNU_IFUNC
1337         symbol when building shared object.  Check info->executable
1338         instead of !info->shared when setting non_got_ref.
1339         (elf64_x86_64_allocate_dynrelocs): Allocate dynamic relocation
1340         for non-GOT reference of STT_GNU_IFUNC symbol in shared
1341         library. Allocate GOT relocation agsinst STT_GNU_IFUNC symbol
1342         if needed.
1343         (elf64_x86_64_relocate_section): Output dynamic relocation
1344         for R_X86_64_64 against STT_GNU_IFUNC symbol to get the real
1345         function address when building shared object.
1346         (elf64_x86_64_finish_dynamic_symbol): Output R_X86_64_GLOB_DAT
1347         relocation for STT_GNU_IFUNC symbol in shared object.
1348
1349 2009-06-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
1350
1351         * Makefile.am: Run "make dep-am".
1352         (BFD32_BACKENDS): Add mach-o-i386.lo.
1353         (BFD32_BACKENDS_CFILES): Add mach-o-i386.c.
1354         * Makefile.in: Regenerate.
1355
1356 2009-06-06  Alan Modra  <amodra@bigpond.net.au>
1357
1358         * elf32-spu.c (spu_elf_relocate_section): Match overlay number
1359         when looking for soft-icache stubs.
1360
1361 2009-06-05  Tristan Gingold  <gingold@adacore.com>
1362
1363         * mach-o.h: Update copyright year.
1364         (bfd_mach_o_mach_header_magic): New enum.
1365         (bfd_mach_o_cpu_subtype): Now an enum.
1366         (BFD_MACH_O_HEADER_SIZE, BFD_MACH_O_HEADER_64_SIZE): New macros.
1367         (BFD_MACH_O_SECTION_SIZE, BFD_MACH_O_SECTION_64_SIZE): Ditto.
1368         (BFD_MACH_O_LC_SEGMENT_SIZE, BFD_MACH_O_LC_SEGMENT_64_SIZE): Ditto.
1369         (bfd_mach_o_load_command): Field type_required is now a boolean.
1370         Reindent prototypes.
1371         (bfd_mach_o_object_p, bfd_mach_o_core_p): Remove.
1372         (bfd_mach_o_bfd_copy_private_symbol_data): Add a prototype.
1373         (bfd_mach_o_bfd_copy_private_section_data): Ditto.
1374         (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
1375         (bfd_mach_o_get_symtab_upper_bound): Ditto.
1376         (bfd_mach_o_canonicalize_symtab): Ditto.
1377         (bfd_mach_o_get_symbol_info): Ditto.
1378         (bfd_mach_o_print_symbol): Ditto.
1379         (bfd_mach_o_bfd_print_private_bfd_data): Ditto.
1380         (bfd_mach_o_make_empty_symbol): Ditto.
1381         (bfd_mach_o_write_contents): Ditto.
1382
1383         * mach-o.c (bfd_mach_o_object_p, bfd_mach_o_core_p,
1384         bfd_mach_o_mkobject): Defines.
1385         (bfd_mach_o_valid): Returns FALSE/TRUE instead of 0/1.
1386         Do not check with target vector but with flavour.
1387         (struct mach_o_section_name_xlat): New declaration.
1388         (dwarf_section_names_xlat): Ditto.
1389         (text_section_names_xlat): Ditto.
1390         (data_section_names_xlat): Ditto.
1391         (struct mach_o_segment_name_xlat): Ditto.
1392         (segsec_names_xlat): Ditto.
1393         (bfd_mach_o_convert_section_name_to_bfd): New function.
1394         (bfd_mach_o_convert_section_name_to_mach_o): Ditto.
1395         (bfd_mach_o_bfd_copy_private_symbol_data): Make it public.
1396         (bfd_mach_o_bfd_copy_private_section_data): Ditto.
1397         (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
1398         Accept any input and output flavour.  Do not share private data
1399         anymore.
1400         (bfd_mach_o_count_symbols): Add a comment.
1401         (bfd_mach_o_get_symtab_upper_bound): Make it public.
1402         (bfd_mach_o_canonicalize_symtab): Ditto.
1403         (bfd_mach_o_get_symbol_info): Ditto.
1404         (bfd_mach_o_print_symbol): Ditto.
1405         (bfd_mach_o_write_header): Now returns a boolean instead of an int.
1406         Use constants instead of hard-coded values.
1407         (bfd_mach_o_scan_write_section_32): Use constants instead of hard-coded
1408         values.
1409         (bfd_mach_o_scan_write_section_64): Ditto.
1410         (bfd_mach_o_scan_write_segment): Ditto.
1411         Do not copy sections anymore.
1412         (bfd_mach_o_write_contents): Make it public.
1413         Remove dead code.  Rewrite typeflag assignment.
1414         (bfd_mach_o_build_commands): New function.
1415         (bfd_mach_o_set_section_contents): Ditto.
1416         (bfd_mach_o_make_empty_symbol): Make it public.
1417         (bfd_mach_o_read_header): Make it static.
1418         Convert to bfd_boolean.
1419         Use constants instead of hard-coded values.
1420         (bfd_mach_o_make_bfd_section): Call
1421         bfd_mach_o_convert_section_name_to_bfd to create name.
1422         (bfd_mach_o_scan_read_section_32): Use constants instead of hard-coded
1423         values.
1424         (bfd_mach_o_scan_read_section_64): Ditto.
1425         (bfd_mach_o_scan_read_segment): Do not create a bfd section for
1426         a segment anymore.  Use constants instead of hard-coded values.
1427         (bfd_mach_o_scan_read_command): Fix style.
1428         (bfd_mach_o_scan): Use constants instead of hard-coded values.
1429         Get rid of BFD_IO_FUNCS.
1430         (bfd_mach_o_mkobject_init): Renamed from bfd_mach_o_mkobject.
1431         (bfd_mach_o_header_p): Created from bfd_mach_o_object_p.
1432         (bfd_mach_o_gen_object_p): New function, replaces bfd_mach_o_object_p.
1433         (bfd_mach_o_object_p): Removed.
1434         (bfd_mach_o_gen_core_p): New function, replaces ...
1435         (bfd_mach_o_core_p): ... deleted.
1436         (bfd_mach_o_bfd_print_private_bfd_data): Make it public.
1437
1438         * mach-o-i386.c: New file.
1439         * config.bfd: Use mach_o_i386_vec as targ_defvec for ix86-darwin.
1440         * configure.in (TDEFINES): Add mach_o_i386_vec.
1441         * configure: Regenerated.
1442         * targets.c: Add mach_o_i386_vec.
1443
1444         * mach-o.c: Update copyright years.
1445         (BFD_IO_FUNCS): Remove (was not used).
1446         (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr, bfd_mach_o_slurp_armap
1447         bfd_mach_o_slurp_extended_name_table,
1448         bfd_mach_o_construct_extended_name_table,
1449         bfd_mach_o_truncate_arname, bfd_mach_o_write_armap,
1450         bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt,
1451         bfd_mach_o_update_armap_timestamp, bfd_mach_o_close_and_cleanup,
1452         bfd_mach_o_bfd_free_cached_info, bfd_mach_o_new_section_hook,
1453         bfd_mach_o_get_section_contents_in_window,
1454         bfd_mach_o_bfd_is_local_label_name,
1455         bfd_mach_o_bfd_is_target_special_symbol,
1456         bfd_mach_o_bfd_is_local_label_name, bfd_mach_o_get_lineno,
1457         bfd_mach_o_find_nearest_line, bfd_mach_o_find_inliner_info,
1458         bfd_mach_o_bfd_make_debug_symbol, bfd_mach_o_read_minisymbols,
1459         bfd_mach_o_minisymbol_to_symbol,
1460         bfd_mach_o_bfd_get_relocated_section_contents,
1461         bfd_mach_o_bfd_relax_section, bfd_mach_o_bfd_link_hash_table_create,
1462         bfd_mach_o_bfd_link_hash_table_free, bfd_mach_o_bfd_link_add_symbols,
1463         bfd_mach_o_bfd_link_just_syms, bfd_mach_o_bfd_final_link,
1464         bfd_mach_o_bfd_link_split_section, bfd_mach_o_set_arch_mach,
1465         bfd_mach_o_bfd_merge_private_bfd_data,
1466         bfd_mach_o_bfd_set_private_flags, bfd_mach_o_get_section_contents,
1467         bfd_mach_o_bfd_gc_sections, bfd_mach_o_bfd_merge_sections,
1468         bfd_mach_o_bfd_is_group_section, bfd_mach_o_bfd_discard_group,
1469         bfd_mach_o_section_already_linked, bfd_mach_o_bfd_define_common_symbol,
1470         bfd_mach_o_bfd_copy_private_header_data,
1471         bfd_mach_o_core_file_matches_executable_p): Move these defines ...
1472         * mach-o-target.c: ... here.
1473         Update copyright years.
1474
1475 2009-06-04  Alan Modra  <amodra@bigpond.net.au>
1476
1477         * dep-in.sed: Don't use \n in replacement part of s command.
1478         * Makefile.am (DEP1): LC_ALL for uniq.
1479         Run "make dep-am".
1480         * Makefile.in: Regenerate.
1481
1482 2009-06-03  H.J. Lu  <hongjiu.lu@intel.com>
1483
1484         * elf32-i386.c (elf_i386_allocate_dynrelocs): Remove check of
1485         h->plt.refcount > 0 on STT_GNU_IFUNC symbol.
1486         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
1487
1488 2009-06-03  H.J. Lu  <hongjiu.lu@intel.com>
1489
1490         * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate
1491         GOT entry for STT_GNU_IFUNC symbol with pointer equality.
1492         (elf_i386_relocate_section): Adjust R_386_GOT32 relocation
1493         against STT_GNU_IFUNC symbols for static executables.
1494         (elf_i386_finish_dynamic_symbol): Load GOT entry with
1495         PLT entry for STT_GNU_IFUNC symbol with pointer equality.
1496
1497         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Allocate
1498         GOT entry for STT_GNU_IFUNC symbol with pointer equality.
1499         (elf64_x86_64_finish_dynamic_symbol): Load GOT entry with
1500         PLT entry for STT_GNU_IFUNC symbol with pointer equality.
1501
1502 2009-06-02  Richard Sandiford  <r.sandiford@uk.ibm.com>
1503
1504         * coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined
1505         symbols to be left unimported when linking statically.
1506         * xcofflink.c (xcoff_link_add_symbols): Ignore global linkage
1507         code when linking statically.
1508
1509 2009-06-02  H.J. Lu  <hongjiu.lu@intel.com>
1510
1511         * elf32-i386.c (elf_i386_check_relocs): Increment
1512         got.refcount for R_386_GOT32/R_386_GOTOFF relocations
1513         against STT_GNU_IFUNC symbol.
1514         (elf_i386_allocate_dynrelocs): Set got.refcount to 0 if
1515         local STT_GNU_IFUNC definition is used.
1516         (elf_i386_relocate_section): Handle got.offset != -1 for
1517         R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC
1518         symbol.
1519
1520         * elf64-x86-64.c (elf64_x86_64_check_relocs): Increment
1521         got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64
1522         relocations against STT_GNU_IFUNC symbol.
1523         (elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if
1524         local STT_GNU_IFUNC definition is used.
1525         (elf64_x86_64_relocate_section): Handle got.offset != -1
1526         for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against
1527         STT_GNU_IFUNC symbol.
1528
1529 2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>
1530
1531         PR ld/10205
1532         * elf32-i386.c (elf_howto_table): Add R_386_IRELATIVE.
1533         (elf_i386_reloc_type_lookup): Likewise.
1534         (R_386_tls): Removed.
1535         (R_386_irelative): New.
1536         (R_386_vt_offset): Updated.
1537         (elf_i386_rtype_to_howto): Likewise.
1538         (elf_i386_link_hash_table): Add igotplt, iplt and irelplt.
1539         (elf_i386_link_hash_table_create): Initialize igotplt,
1540         iplt and irelplt.
1541         (elf_i386_check_relocs): Handle STT_GNU_IFUNC symbol first.
1542         (elf_i386_adjust_dynamic_symbol): Likewise.
1543         (elf_i386_allocate_dynrelocs): Likewise.
1544         (elf_i386_relocate_section): Likewise.
1545         (elf_i386_size_dynamic_sections): Set up .iplt and .igot.plt
1546         sections.
1547         (elf_i386_finish_dynamic_symbol): When building a static
1548         executable, use .iplt, .igot.plt and .rel.iplt sections for
1549         STT_GNU_IFUNC symbols.  Generate R_386_IRELATIVE relocation for
1550         locally defined STT_GNU_IFUNC symbol.
1551
1552         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_IRELATIVE.
1553         (x86_64_reloc_map): Likewise.
1554         (R_X86_64_standard): Updated.
1555         (elf64_x86_64_link_hash_table): Add igotplt, iplt and irelplt.
1556         (elf64_x86_64_link_hash_table_create): Initialize igotplt,
1557         iplt and irelplt.
1558         (elf64_x86_64_check_relocs): Handle STT_GNU_IFUNC symbol first.
1559         (elf64_x86_64_adjust_dynamic_symbol): Likewise.
1560         (elf64_x86_64_allocate_dynrelocs): Likewise.
1561         (elf64_x86_64_relocate_section): Likewise.
1562         (elf64_x86_64_size_dynamic_sections): Set up .iplt and .igot.plt
1563         sections.
1564         (elf64_x86_64_finish_dynamic_symbol): When building a static
1565         executable, use .iplt, .igot.plt and .rela.iplt sections for
1566         STT_GNU_IFUNC symbols.  Generate R_X86_64_IRELATIVE relocation
1567         for locally defined STT_GNU_IFUNC symbol.
1568
1569         * reloc.c (BFD_RELOC_386_IRELATIVE): New.
1570         (BFD_RELOC_X86_64_IRELATIVE): Likewise.
1571
1572         * bfd-in2.h: Regenerated.
1573         * libbfd.h: Likewise.
1574
1575 2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>
1576
1577         * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs.
1578         (_bfd_elf_make_ifunc_reloc_section): Removed.
1579         (_bfd_elf_is_ifunc_symbol): Likewise.
1580         (_bfd_elf_create_static_ifunc_sections): New.
1581
1582         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC
1583         symbol check to ...
1584         (elf_link_add_object_symbols): Here.
1585         (_bfd_elf_link_hash_hide_symbol): Don't clean plt on
1586         STT_GNU_IFUNC symbol.
1587         (elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol
1588         if a STT_GNU_IFUNC symbol is referenced in a non-shared object.
1589         (IFUNC_INFIX): Removed.
1590         (get_ifunc_reloc_section_name): Likewise.
1591         (_bfd_elf_make_ifunc_reloc_section): Likewise.
1592         (_bfd_elf_is_ifunc_symbol): Likewise.
1593         (_bfd_elf_create_static_ifunc_sections): New.
1594
1595 2009-05-29  H.J. Lu  <hongjiu.lu@intel.com>
1596
1597         * elf32-i386.c (link_hash_newfunc): Add elf_i386_ prefix.
1598         (create_got_section): Likewise.
1599         (allocate_dynrelocs): Likewise.
1600         (readonly_dynrelocs): Likewise.
1601         (set_tls_module_base): Likewise.
1602         (dtpoff_base): Likewise.
1603         (tpoff): Likewise.
1604         (elf_i386_link_hash_table_create): Updated.
1605         (elf_i386_create_dynamic_sections): Likewise.
1606         (elf_i386_check_relocs): Likewise.
1607         (elf_i386_size_dynamic_sections): Likewise.
1608         (elf_i386_relocate_section): Likewise.
1609
1610         * elf64-x86-64.c (link_hash_newfunc): Add elf64_x86_64_ prefix.
1611         (create_got_section): Likewise.
1612         (allocate_dynrelocs): Likewise.
1613         (readonly_dynrelocs): Likewise.
1614         (set_tls_module_base): Likewise.
1615         (dtpoff_base): Likewise.
1616         (tpoff): Likewise.
1617         (elf64_x86_64_link_hash_table_create): Updated.
1618         (elf64_x86_64_create_dynamic_sections): Likewise.
1619         (elf64_x86_64_check_relocs): Likewise.
1620         (elf64_x86_64_size_dynamic_sections): Likewise.
1621         (elf64_x86_64_relocate_section): Likewise.
1622
1623 2009-05-28  Nick Clifton  <nickc@redhat.com>
1624
1625         * targets.c (_bfd_target_vector): Only include plugin target in
1626         all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.
1627
1628 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
1629
1630         * elf32-spu.c (struct call_info): New member broken_cycle.
1631         (remove_cycle): Instead of physically removing call_info structures
1632         to break call graph cycles, mark them using the broken_cycle flag.
1633         (mark_overlay_section): Respect broken_cycle flag.
1634         (unmark_overlay_section): Likewise.
1635         (collect_lib_sections): Likewise.
1636         (collect_overlays): Likewise.
1637         (sum_stack): Likewise.
1638
1639 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
1640
1641         * elf32-spu.c (insert_callee): Accumulate incoming callee->count.
1642         (mark_functions_via_relocs): Initialize callee->count to 1.
1643         (pasted_function): Likewise.
1644         (spu_elf_auto_overlay): Honor call counts when determining number
1645         of stubs required in software i-cache mode.
1646
1647 2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
1648
1649         * plugin.c (program_name): Remove.
1650         (plugin_program_name): New.
1651         (bfd_plugin_set_program_name): New.
1652         (try_load_plugin): Use plugin_program_name.
1653         * plugin.h (bfd_plugin_set_program_name): New.
1654
1655 2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
1656
1657         * aclocal.m4: Include ../config/plugins.m4.
1658         * configure.in: Use AC_PLUGINS.
1659         * configure: Regenerate.
1660         * Makefile.in: Regenerate.
1661         * doc/Makefile.in: Regenerate.
1662
1663 2009-05-27  Nathan Sidwell  <nathan@codesourcery.com>
1664
1665         * elf32-ppc.c (ppc_elf_relax_section): Work with a partial
1666         link.
1667         * bout.c (b_out_bfd_relax_section): Reject relocatable links.
1668         * elf32-m10300.c (mn10300_elf_relax_section): Likewise.
1669         * elf32-avr.c (elf32_avr_relax_section): Likewise.
1670         * elf32-frv.c (elf32_avr_relax_section): Likewise.
1671         * elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
1672         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
1673         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
1674         * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
1675         * reloc.c (bfd_generic_relax_section): Likewise.
1676         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
1677         * vms.c (vms_bfd_relax_section): Likewise.
1678
1679 2009-05-26  H.J. Lu  <hongjiu.lu@intel.com>
1680
1681         * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New.
1682
1683         * elf32-i386.c (is_indirect_symbol): Renamed to ...
1684         * elflink.c (_bfd_elf_is_ifunc_symbol): This.
1685
1686         * elf32-i386.c (allocate_dynrelocs): Updated.
1687         (elf_i386_relocate_section): Likewise.
1688         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
1689         (elf64_x86_64_relocate_section): Likewise.
1690
1691         * elf64-x86-64.c (is_indirect_symbol): Removed.
1692
1693 2009-05-26  Nick Clifton  <nickc@redhat.com>
1694
1695         * po/id.po: Updated Indonesian translation.
1696
1697 2009-05-26  Rafael Avila de Espindola  <espindola@google.com>
1698
1699         * Makefile.am: Run "make dep-am".
1700         (AM_CPPFLAGS): New.
1701         (LIBDL): New.
1702         (ALL_MACHINES): Add cpu-plugin.lo.
1703         (ALL_MACHINES_CFILES): Add cpu-plugin.c.
1704         (BFD32_BACKENDS): Add plugin.lo.
1705         (BFD32_BACKENDS_CFILES): Add plugin.c.
1706         (libbfd_la_LIBADD): Add LIBDL
1707         * archures.c (bfd_architecture): Add bfd_arch_plugin.
1708         (bfd_plugin_arch): Declare.
1709         * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
1710         * bfd.c (bfd): Add plugin_data.
1711         * config.bfd: Handle the plugin target.
1712         * configure.in: Check for --enable-plugins.
1713         (LT_INIT): Use the dlopen option.
1714         * cpu-plugin.c: New.
1715         * plugin.c: New.
1716         * plugin.h: New.
1717         * targets.c (plugin_vec): Declare.
1718         (_bfd_target_vector): Add plugin_vec.
1719         * Makefile.in: Regenerate.
1720         * bfd-in2.h: Regenerate.
1721         * configure: Regenerate.
1722
1723 2009-05-26  Alan Modra  <amodra@bigpond.net.au>
1724
1725         * dep-in.sed: Don't modify .o to .lo here.  Output one filename
1726         per line with all lines having continuation backslash.  Prefix
1727         first line with "A", following lines with "B".
1728         * Makefile.am (DEP): Don't use dep.sed here.
1729         (DEP1): Run $MKDEP on single files, modify .o to .lo here.  Use
1730         dep.sed here on dependencies, sort and uniq.
1731         * Makefile.in: Regenerate.
1732
1733 2009-05-25  Tristan Gingold  <gingold@adacore.com>
1734
1735         * makefile.vms: Add verilog.obj to object list OBJS.
1736
1737 2009-05-24  Alan Modra  <amodra@bigpond.net.au>
1738
1739        * bfdio.c (bfd_seek): Formatting.  Ensure newly allocated memory
1740        for BFD_IN_MEMORY is cleared.
1741        (bfd_bwrite): Zero excess memory allocated.
1742
1743 2009-05-22  Julian Brown  <julian@codesourcery.com>
1744
1745         * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
1746         macros.
1747         (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
1748         (elf32_arm_stub_a8_veneer_blx): New stub sequences.
1749         (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
1750         arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
1751         (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
1752         (a8_erratum_fix, a8_erratum_reloc): New structs.
1753         (elf32_arm_link_hash_table): Add a8_erratum_fixes,
1754         num_a8_erratum_fixes, fix_cortex_a8 fields.
1755         (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
1756         (elf32_arm_add_stub): Split into two parts, creating...
1757         (elf32_arm_create_or_find_stub_sec): New function.
1758         (elf32_arm_final_link_relocate): Add forward declaration.
1759         (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
1760         relocations, multiple relocations per stub.
1761         (find_stub_size_and_template): New (using parts of arm_size_one_stub).
1762         (arm_size_one_stub): Use find_stub_size_and_template.
1763         (a8_reloc_compare): New.
1764         (find_thumb_glue): Add forward declaration.
1765         (cortex_a8_erratum_scan): New.
1766         (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
1767         (bfd_elf32_arm_set_cortex_a8_fix): New.
1768         (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
1769         (arm_map_one_stub): Add THUMB32_TYPE support.
1770         (a8_branch_to_stub_data): New.
1771         (make_branch_to_a8_stub): New.
1772         (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
1773         * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
1774         (bfd_elf32_arm_set_target_relocs): Add argument for controlling
1775         Cortex-A8 erratum workaround.
1776         * bfd-in2.h: Regenerate.
1777
1778 2009-05-22  Alan Modra  <amodra@bigpond.net.au>
1779
1780         * Makefile.am: Run "make dep-am".
1781         * Makefile.in: Regenerate.
1782         * po/SRC-POTFILES.in: Regenerate.
1783
1784 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
1785
1786         * elflink.c (elf_link_input_bfd): Correct *pindex change in last
1787         commit.
1788
1789 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
1790
1791         * elf-bfd.h (struct elf_backend_data
1792         <elf_backend_link_output_symbol_hook>): Return an int.
1793         * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
1794         symbols on deleted .opd entries.
1795         * elflink.c (elf_link_output_sym): Return without outputting sym
1796         if output_symbol_hook returns 2.
1797         (elf_link_output_extsym): Don't assign h->indx when symbol discarded.
1798         Abort if we must not discard sym.
1799         (elf_link_input_bfd): Similarly, don't set finfo->indices for
1800         local syms.
1801         (bfd_elf_final_link): Adjust elf_link_output_sym calls.
1802         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
1803         elf_backend_link_output_symbol_hook return type change.
1804         * elf32-arm.c (output_arch_syminfo): Likewise.
1805         (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
1806         (elf32_arm_output_arch_local_syms): Likewise.
1807         * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
1808         * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
1809         (bfd_score_elf_link_output_symbol_hook): Likewise.
1810         * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
1811         * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
1812         * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
1813         * elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
1814         * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
1815         * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
1816         * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
1817         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
1818         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
1819         * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
1820         * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
1821
1822 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
1823
1824         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
1825         out of range .opd symbols.
1826
1827 2009-05-21  Dave Korn  <dave.korn.cygwin@gmail.com>
1828
1829         * coffgen.c (coff_print_symbol):  Use bfd_fprintf_vma, not
1830         fprintf_vma directly.
1831         * peXXigen.c (pe_print_edata):  Likewise.
1832         (pe_print_pdata):  Likewise.
1833         (_bfd_XX_print_ce_compressed_pdata):  Likewise.
1834         (_bfd_XX_print_private_bfd_data_common):  Likewise.
1835
1836 2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>
1837
1838         * cofflink.c (process_embedded_commands):  Ignore "-aligncomm".
1839
1840 2009-05-15  Andrew Stubbs  <ams@codesourcery.com>
1841             Paul Brook  <paul@codesourcery.com>
1842
1843         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
1844         fix discarded sections.
1845
1846 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1847
1848         * elf32-spu.c (mark_overlay_section): Move .init and .fini
1849         sections into the software icache.
1850
1851 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1852
1853         * elf32-spu.c (build_stub): Always build "compact" sofware
1854         i-cache stubs.
1855
1856 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1857
1858         * elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
1859         (spu_elf_setup): Initialize it.
1860         (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
1861         Update to new-sytle cache manager data structures.
1862         (spu_elf_build_stubs): Generate new-style cache manager data
1863         structures and symbols.
1864         (spu_elf_auto_overlay): Update size computation.
1865
1866 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1867
1868         * elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
1869         segments first amongst the program headers.
1870
1871 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1872
1873         * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index
1874         into addresses for relocation types that look at high bits.  Remove
1875         special handling of relocation overflow warnings.
1876
1877 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1878
1879         * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the
1880         control flow graph between fragments of a function.
1881
1882 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
1883
1884         * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,
1885         generate only a 16-byte .toe section.
1886         (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
1887
1888 2009-05-14  Alan Modra  <amodra@bigpond.net.au>
1889
1890         * elf32-spu.c (spu_elf_size_stubs): Split out section placement to..
1891         (spu_elf_place_overlay_data): ..here.  New function.
1892         * elf32-spu.h (spu_elf_place_overlay_data): Declare.
1893
1894 2009-05-13  Andrew Jenner  <andrew@codesourcery.com>
1895
1896         * elf32-arm.c: Move sysdep.h to start of file.
1897
1898 2009-05-11  Ulrich Weigand  <uweigand@de.ibm.com>
1899
1900         * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
1901         start of overlays.
1902         (spu_elf_build_stubs): Don't define __icache_tagbase.  Define
1903         __icache_tag_array and __icache_tag_array_size.
1904
1905 2009-05-11  Masaki Muranaka  <monaka@monami-software.com>
1906
1907         * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Remove unnecessary
1908         ATTRIBUTE_UNUSED.
1909         (bfinfdpic_link_omit_section_dynsym): Likewise.
1910         (elf32_bfinfdpic_finish_dynamic_sections): Likewise.
1911
1912 2009-05-05  Paul Brook  <paul@codesourcery.com>
1913
1914         * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
1915         * bfd-in2.h: Regenerate.
1916         * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
1917         (_arm_elf_section_data): Add text and exidx fields.
1918         (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
1919         insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
1920         copy_exidx_entry): New functions.
1921         (elf32_arm_write_section): Fixup .ARM.exidx contents.
1922
1923 2009-05-05  Christophe lyon  <christophe.lyon@st.com>
1924
1925         * elf32-arm.c (DEF_STUBS): New helper define.
1926         (DEF_STUB): Likewise.
1927         (stub_def): New type.
1928         (stub_definitions): New array, containing stub template pointers
1929         and sizes.
1930         (arm_size_one_stub): Make use of stub_definitions.
1931
1932 2009-05-04  Dave Korn  <dave.korn.cygwin@gmail.com>
1933
1934         * elflink.c (find_version_for_sym):  Remove from here, ...
1935         * linker.c (bfd_find_version_for_sym):  ... rename, replace
1936         here, make public and update all callers.
1937         * bfd-in2.h:  Regenerate.
1938
1939 2009-04-30  Nick Clifton  <nickc@redhat.com>
1940
1941         * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
1942         section pointer.
1943         (struct elf_obj_data): Add has_ifunc_symbols boolean.
1944         * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
1945         into a STT_GNU_IFUNC symbol type.
1946         (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
1947         type.
1948         (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
1949         the binary contains ifunc symbols.
1950         * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
1951         symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
1952         * elf32-i386.c (is_indirect_function): New function.
1953         (elf_i386_check_relocs): Create an ifunc output section.
1954         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
1955         section if necessary.
1956         (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
1957         if necessary.
1958         (elf_i386_add_symbol_hook): New function. Set the
1959         has_ifunc_symbols field of the elf_obj_data structure if an ifunc
1960         symbol is encountered.
1961         (elf_backend_post_process_headers): Define.
1962         (elf_backend_add_symbol_hook): Define.
1963         (elf_i386_post_process_headers): Rename to
1964         elf_i388_fbsd_post_process_headers.
1965         * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
1966         (is_indirect_function): New function.
1967         (elf64_x86_64_check_relocs): Create an ifunc output section.
1968         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
1969         section if necessary.
1970         (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
1971         symbol if necessary.
1972         (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
1973         elf_obj_data structure if an ifunc symbol is encountered.
1974         (elf_backend_post_process_headers): Define.
1975         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
1976         if we have ifunc symbols to handle.
1977         (get_ifunc_reloc_section_name): New function.  Computes the name
1978         for an ifunc section.
1979         (_bfd_elf_make_ifunc_reloc_section): New function.  Creates a
1980         section to hold ifunc relocs.
1981         * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
1982         (bfd_print_symbol_vandf): Handle ifunc symbols.
1983         (bfd_decode_symclass): Likewise.
1984         * bfd-in2.h: Regenerate.
1985
1986 2009-04-30  Joseph Myers  <joseph@codesourcery.com>
1987
1988         * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
1989         MOVW and MOVT relocations in a shared library link.
1990
1991 2009-04-27  Anthony Green  <green@moxielogic.com>
1992
1993         * verilog.c: New file.
1994         * Makefile.am (BFD32_LIBS): Add verilog.c.
1995         (BFD32_LIBS_CFILES): Add verilog.c.
1996         (verilog.lo): New build rule.
1997         * Makefile.in: Rebuilt.
1998         * targets.c: Add verilog support.
1999         * bfd.c (tdata union): Add Verilog private data field.
2000         * bfd-in2.h: Regenerate.
2001
2002 2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2003
2004         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
2005         copy pe_opthdr.
2006
2007 2009-04-23  Matthias Klose  <doko@ubuntu.com>
2008
2009         * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
2010
2011 2009-04-22  Christophe Lyon  <christophe.lyon@st.com>
2012
2013         PR9743
2014         * elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24,
2015         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
2016         (elf32_arm_size_stubs): Likewise.
2017         (record_thumb_to_arm_glue): Deleted unused function.
2018         (bfd_elf32_arm_process_before_allocation): No longer handle
2019         R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here.
2020         (elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24,
2021         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
2022
2023 2009-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
2024
2025         * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED.
2026         (elf32_arm_write_section): Declare early.
2027         (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD.
2028         (arm_allocate_glue_section_space): Exclude empty sections.
2029         (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED.
2030         (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub
2031         BFD.
2032         (elf32_arm_output_glue_section, elf32_arm_final_link): New.
2033         (elf32_arm_merge_eabi_attributes): Skip the stub BFD.
2034         (elf32_arm_size_dynamic_sections): Allocate interworking
2035         sections here.
2036         (bfd_elf32_bfd_final_link): Define.
2037
2038 2009-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2039
2040         * coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K.
2041
2042         * coffcode.h (coff_compute_section_file_positions): Clear
2043         D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE.
2044
2045         * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and
2046         force_minimum_alignment.
2047
2048         * libcoff.h: Regenerated.
2049
2050         * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed.
2051         (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise.
2052
2053         * peicode.h (pe_mkobject): Don't set force_minimum_alignment
2054         nor target_subsystem.
2055
2056         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check
2057         force_minimum_alignment nor target_subsystem.
2058
2059 2009-04-21  Kai Tietz  <kai.tietz@onevision.com>
2060
2061         * coff-x86_64.c (PEI_HEADERS): Protect includes.
2062         (bfd_pe_print_pdata): Remove #ifdef PE variation.
2063         * pei-x86_64.c (PEI_HEADERS): Define to prevent double
2064         include in coff-x86_64.c of headers.
2065         (PDATA_ROW_SIZE): New define.
2066         (pex_regs[]): New static array.
2067         (pex64_get_runtime_function): New static function.
2068         (pex64_get_unwind_info): Likewise.
2069         (pex64_get_scope_entry): Likewise.
2070         (pex64_xdata_print_uwd_codes): Likewise.
2071         (pex64_get_section_by_rva): Likewise.
2072         (pex64_dump_xdata): Likewise.
2073         (pex64_bfd_print_pdata): Likewise.
2074         (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata.
2075         * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation.
2076         * libpei.h (_bfd_pex64_print_pdata): Removed declaration.
2077
2078 2009-04-19  Peter O'Gorman  <binutils@mlists.thewrittenword.com>
2079             Alan Modra  <amodra@bigpond.net.au>
2080             Dave Korn  <dave.korn.cygwin@gmail.com>
2081
2082         * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t
2083         long names and non-NUL-terminated strings.
2084
2085 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
2086
2087         * bfd-in2.h: Regenerated.
2088
2089 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
2090
2091         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace
2092         IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER.
2093
2094 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
2095
2096         PR binutils/10074
2097         * coffcode.h (bfd_pei_p): New.
2098
2099         * config.bfd: Remove bfd_efi_bsdrv_ia32_vec,
2100         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
2101         bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and
2102         bfd_efi_rtdrv_ia64_vec.  Replace bfd_efi_app_ia32_vec,
2103         bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with
2104         i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively.
2105
2106         * configure.in: Remove bfd_efi_bsdrv_ia32_vec,
2107         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
2108         bfd_efi_rtdrv_x86_64_vec,
2109         bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec.  Replace
2110         bfd_efi_ia64_vec with bfd_pei_ia64_vec.
2111         * targets.c: Likewise.
2112
2113         * configure: Regenerated.
2114         * libcoff.h: Likewise.
2115         * Makefile.in: Likewise.
2116
2117         * efi-app-ia32.c: Removed.
2118         * efi-app-x86_64.c: Likewise.
2119         * efi-bsdrv-ia32.c: Likewise.
2120         * efi-bsdrv-ia64.c: Likewise.
2121         * efi-bsdrv-x86_64.c: Likewise.
2122         * efi-rtdrv-ia32.c: Likewise.
2123         * efi-rtdrv-ia64.c: Likewise.
2124         * efi-rtdrv-x86_64.c: Likewise.
2125         * efi-rtdrv-ia32.c: Likewise.
2126
2127         * efi-app-ia64.c: Moved to ...
2128         * pei-ia64.c: This.
2129         (TARGET_SYM): Set to bfd_pei_ia64_vec.
2130         (TARGET_NAME): Set to pei-ia64.
2131
2132         * libpei.h (bfd_target_pei_p): Removed.
2133         (bfd_target_pei_arch): Likewise.
2134         (bfd_target_efi_app_p): Likewise.
2135         (bfd_target_efi_app_arch): Likewise.
2136         (bfd_target_efi_bsdrv_p): Likewise.
2137         (bfd_target_efi_bsdrv_arch): Likewise.
2138         (bfd_target_efi_rtdrv_p): Likewise.
2139         (bfd_target_efi_rtdrv_arch): Likewise.
2140         (bfd_pe_executable_p): Likewise.
2141
2142         * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo,
2143         efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo.
2144         (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c
2145         and efi-rtdrv-ia32.c.
2146         (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo,
2147         efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and
2148         efi-rtdrv-x86_64.lo. Add pei-ia64.lo.
2149         (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c,
2150         efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and
2151         efi-rtdrv-x86_64.c. Add pei-ia64.c.
2152         (efi-app-ia64.lo): Removed.
2153         (efi-bsdrv-ia32.lo): Likewise.
2154         (efi-rtdrv-ia32.lo): Likewise.
2155         (efi-app-ia64.lo): Likewise.
2156         (efi-bsdrv-ia64.lo): Likewise.
2157         (efi-rtdrv-ia64.lo): Likewise.
2158         (efi-app-x86_64.lo): Likewise.
2159         (efi-bsdrv-x86_64.lo): Likewise.
2160         (efi-rtdrv-x86_64.lo): Likewise.
2161         (pei-ia64.lo): New.
2162
2163         * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p
2164         with bfd_pei_p.
2165         (arch_type): Removed.
2166         (pe_arch): Likewise.
2167         (pe_bfd_object_p): Just return coff_object_p.
2168
2169         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace
2170         bfd_pe_executable_p with bfd_pei_p.
2171
2172 2009-04-17  Christophe Lyon  <christophe.lyon@st.com>
2173
2174         * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through
2175         PLT entries to an undefined symbol when generating a shared
2176         library.
2177
2178 2009-04-17  Nick Clifton  <nickc@redhat.com>
2179
2180         PR 9909
2181         * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.
2182
2183 2009-04-16  Richard Sandiford  <r.sandiford@uk.ibm.com>
2184
2185         * aout-adobe.c (aout_32_bfd_define_common_symbol): Define.
2186         * aout-target.h (MY_bfd_define_common_symbol): Likewise.
2187         * aout-tic30.c (MY_bfd_define_common_symbol): Likewise.
2188         * binary.c (binary_bfd_define_common_symbol): Likewise.
2189         * bout.c (b_out_bfd_define_common_symbol): Likewise.
2190         * coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
2191         * coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
2192         * coffcode.h (coff_bfd_define_common_symbol): Likewise.
2193         * elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise.
2194         * i386msdos.c (msdos_bfd_define_common_symbol): Likewise.
2195         * i386os9k.c (os9k_bfd_define_common_symbol): Likewise.
2196         * ieee.c (ieee_bfd_define_common_symbol): Likewise.
2197         * ihex.c (ihex_bfd_define_common_symbol): Likewise.
2198         * libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise.
2199         * mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise.
2200         * mmo.c (mmo_bfd_define_common_symbol): Likewise.
2201         * nlm-target.h (nlm_bfd_define_common_symbol): Likewise.
2202         * oasys.c (oasys_bfd_define_common_symbol): Likewise.
2203         * pef.c (bfd_pef_bfd_define_common_symbol): Likewise.
2204         * ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise.
2205         * som.c (som_bfd_define_common_symbol): Likewise.
2206         * srec.c (srec_bfd_define_common_symbol): Likewise.
2207         * tekhex.c (tekhex_bfd_define_common_symbol): Likewise.
2208         * versados.c (versados_bfd_define_common_symbol): Likewise.
2209         * vms.c (vms_bfd_define_common_symbol): Likewise.
2210         * xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise.
2211         * xsym.c (bfd_sym_bfd_define_common_symbol): Likewise.
2212         * coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol.
2213         (pmac_xcoff_vec): Likewise.
2214         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
2215         (aix5coff64_vec): Likewise.
2216         * linker.c (bfd_generic_define_common_symbol): New function.
2217         * targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol.
2218         (_bfd_define_common_symbol): New field.
2219         * libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare.
2220         * xcofflink.c (_bfd_xcoff_define_common_symbol): New function.
2221         (xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common
2222         symbols here.
2223         * bfd-in2.h: Regenerate.
2224         * libbfd.h: Likewise.
2225         * libcoff.h: Likewise.
2226
2227 2009-04-15  Anthony Green  <green@moxielogic.com>
2228
2229         * targets.c: Add moxie support.
2230         * Makefile.am: Ditto.
2231         * Makefile.in: Rebuilt.
2232         * cpu-moxie.c, elf32-moxie.c: New files.
2233         * archures.c: Add moxie support.
2234         * configure.in: Add moxie support.
2235         * configure: Rebuilt.
2236         * config.bfd, archures.c: Add moxie support.
2237         * bfd-in2.h: Rebuilt.
2238
2239 2009-04-15  Christophe Lyon  <christophe.lyon@st.com>
2240
2241         * elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM
2242         branch to an undef weak symbol into a jump to next instruction if
2243         a PLT entry will be created.
2244
2245 2009-04-14  Dave Korn  <dave.korn.cygwin@gmail.com>
2246
2247         * coffgen.c (make_a_section_from_file):  Set the backend long
2248         section names enable if long section names found on input.
2249         * coffcode.h:  Extend long section names documentation to match.
2250
2251 2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2252
2253         * elflink.c (elf_link_add_object_symbols): Warn alternate ELF
2254         machine code.
2255
2256 2009-04-07  DJ Delorie  <dj@redhat.com>
2257
2258         * archures.c: Add bfd_mach_mep_c5.
2259         * bfd-in2.h: Likewise.
2260         * cpu-mep.c: Add bfd_c5_arch.
2261         * elf32-mep.c: Support it.
2262
2263 2009-04-07  H.J. Lu  <hongjiu.lu@intel.com>
2264
2265         * elflink.c (_bfd_elf_section_already_linked): Add `\n' for
2266         info->callbacks->einfo.
2267         * linker.c (_bfd_generic_section_already_linked): Likewise.
2268
2269 2009-04-06  DJ Delorie  <dj@redhat.com>
2270
2271         * elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes.
2272
2273 2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>
2274
2275         * coff-x86_64.c (bfd_pe_print_pdata): Defined to
2276         _bfd_pex64_print_pdata only if PE is defined.
2277
2278         * libpei.h (_bfd_pep_print_x64_pdata): Renamed to ...
2279         (_bfd_pex64_print_pdata): This.
2280
2281         * peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ...
2282         (_bfd_pex64_print_pdata): This.  Defined only if COFF_WITH_pex64
2283         is defined.
2284
2285 2009-04-05  Kai Tietz  <kai.tietz@onevision.com>
2286
2287         * coff-x86_64.c (bfd_pe_print_pdata): Define as
2288         _bfd_pep_print_x64_pdata.
2289         * libpei.h (_bfd_pep_print_x64_pdata): Add prototype.
2290         * peXXigen.c (_bfd_pep_print_x64_pdata): New.
2291
2292 2009-04-02  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
2293
2294         * elf32-xtensa.c (relax_property_section): Always set r_offset
2295         to zero.
2296
2297 2009-04-02  Christophe Lyon  <christophe.lyon@st.com>
2298
2299         * elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb,
2300         elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long
2301         branch stubs.
2302         (elf32_arm_stub_type): New enum values for the two new stubs.
2303         (arm_type_of_stub): Make use of the two new stubs.
2304         (arm_size_one_stub): Handle the two new stubs.
2305
2306 2009-04-01  Matt Thomas  <matt@netbsd.org>
2307
2308         * elf32-vax.c (elf_vax_check_relocs): Do not put relocations against
2309         hidden symbols into the GOT or PLT.GOT.
2310         (elf_vax_relocate_section): Do not emit a PCREL reloc
2311         into a shared object if it is against a hidden symbol.
2312
2313 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
2314
2315         * xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
2316         and know_contains_shared_object_p.
2317         (xcoff_archive_contains_shared_object_p): Add an "info" parameter.
2318         Cache the result in the archive_info table.
2319         (xcoff_auto_export_p): Add an "info" parameter and update the
2320         call to xcoff_archive_contains_shared_object_p.
2321         (xcoff_mark_auto_exports): Update accordingly.
2322         (xcoff_post_gc_symbol): Likewise.
2323
2324 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
2325
2326         * xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
2327         rather than C_EXT.
2328
2329 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
2330
2331         * coff-rs6000.c (member_layout): New structure.
2332         (archive_iterator): Likewise.
2333         (member_layout_init): New function.
2334         (archive_iterator_begin): Likewise.
2335         (archive_iterator_next): Likewise.
2336         (xcoff_write_armap_old): Use the new iterator functions.
2337         (do_shared_object_padding): Delete.
2338         (xcoff_write_armap_big): Use the new iterator functions.  Simplify
2339         handling of arch_info.
2340         (xcoff_write_archive_contents_old): Allocate arelt_data in the
2341         first loop rather than the second.  Allocate a member header if
2342         there isn't one, then work out the stat information and length
2343         in the first loop too.  Use the new iterators for the second loop.
2344         (xcoff_write_archive_contents_big): Likewise.
2345
2346 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
2347
2348         * bfd-in.h (bfd_xcoff_split_import_path): Declare.
2349         (bfd_xcoff_set_archive_import_path): Likewise.
2350         * bfd-in2.h: Regenerate.
2351         * xcofflink.c: Include libiberty.h.
2352         (xcoff_archive_info): New structure.
2353         (xcoff_archive_info_hash): New function.
2354         (xcoff_archive_info_eq): Likewise.
2355         (xcoff_get_archive_info): Likewise.
2356         (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info.
2357         (bfd_xcoff_split_import_path): New function.
2358         (bfd_xcoff_set_archive_import_path): Likewise.
2359         (xcoff_set_import_path): Move earlier in file.
2360         (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive
2361         object to the the directory part of the bfd's filename.  Get the
2362         import path and filename of an archive object from the archive's
2363         xcoff_tdata, initializing it if necessary.  Update use of
2364         import_file_id.
2365         (bfd_link_input_bfd): Update use of import_file_id.
2366         (xcoff_write_global_symbol): Likewise.
2367
2368 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
2369
2370         * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
2371
2372 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
2373
2374         * xcofflink.c (xcoff_link_create_extra_sections): Don't create
2375         a .loader section for relocatable links.
2376         (xcoff_need_ldrel_p): New function.
2377         (xcoff_mark): Use it.
2378         (bfd_xcoff_link_count_reloc): Only count loader relocs if there's
2379         a loader section.
2380         (xcoff_build_ldsym): New function, split out from...
2381         (xcoff_build_ldsyms): ...here.  Rename to...
2382         (xcoff_post_gc_symbol): ...this.  Only export symbols, and only
2383         call xcoff_build_ldsym, if there's a loader section.
2384         (xcoff_build_loader_section): New function, extracted verbatim from...
2385         (bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
2386         there's a loader section.  Only add an __rtinit loader symbol
2387         if there's a loader section.  Update after above name change.
2388         (xcoff_symbol_section, xcoff_create_ldrel): New functions.
2389         (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
2390         and xcoff_create_ldrel.
2391         (xcoff_write_global_symbol): Use xcoff_create_ldrel.
2392         (xcoff_reloc_link_order): Likewise, but only call it if there's
2393         a loader section.  Use xcoff_symbol_section.
2394         (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
2395         if there's a loader section.
2396
2397 2009-04-01  Richard Sandiford  <rdsandiford@googlemail.com>
2398
2399         * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
2400
2401 2009-04-01  Christophe Lyon  <christophe.lyon@st.com>
2402
2403         * elf32-arm.c (group_sections): Rewrite loops for better
2404         readability.
2405
2406 2009-03-30  DJ Delorie  <dj@redhat.com>
2407
2408         * elflink.c (elf_link_input_bfd): Don't try to resolve complex
2409         relocs when doing a relocatable link.
2410
2411 2009-03-28  Mark Mitchell  <mark@codesourcery.com>
2412
2413         * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
2414         "ERROR:", in error messages.
2415         * cpu-arm.c (bfd_arm_merge_machines): Likewise.
2416         * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
2417         * elf32-arm.c (tag_cpu_arch_combine): Likewise.
2418         (elf32_arm_merge_eabi_attributes): Likewise.
2419         (elf32_arm_merge_private_bfd_data): Likewise.
2420
2421 2009-03-27  Nick Clifton  <nickc@redhat.com>
2422
2423         * section.c (bfd_get_section_contents): Detect and handle the case
2424         where a section has the SEC_IN_MEMORY flag set but no actual
2425         contents allocated.
2426
2427 2009-03-26  Alan Modra  <amodra@bigpond.net.au>
2428
2429         PR 6494
2430         * elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO
2431         p_filesz and p_memsz are equal.  Use p_memsz as the segment size.
2432         (assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO
2433         if we don't find matching PT_LOAD when copying.
2434
2435 2009-03-25  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
2436
2437         * elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
2438         the reloc descriptions.
2439
2440 2009-03-25  Hans-Peter Nilsson  <hp@axis.com>
2441
2442         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
2443         <R_CRIS_16_GOT_GD, case R_CRIS_32_GOT_GD>: Handle COMMON symbols.
2444         <case R_CRIS_16_TPREL, R_CRIS_32_TPREL>: Ditto.
2445
2446 2009-03-24  H.J. Lu  <hongjiu.lu@intel.com>
2447
2448         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static.
2449         (bfd_i386_arch_intel_syntax): Likewise.
2450         (i8086_arch): Likewise.
2451         (bfd_x86_64_arch): Likewise.
2452
2453 2009-03-24  Hans-Peter Nilsson  <hp@axis.com>
2454
2455         * elf32-cris.c (cris_elf_relocate_section): <case
2456         R_CRIS_16_DTPREL, R_CRIS_32_DTPREL>: Allow use of non-local
2457         symbols for non-allocated sections.  Don't check whether to
2458         generate R_CRIS_DTPMOD for non-allocated sections.
2459         (cris_elf_gc_sweep_hook) <case R_CRIS_32_DTPREL>: Don't
2460         handle relocation GC:ing if applied to non-allocated section.
2461         (cris_elf_check_relocs): Similar.
2462
2463         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
2464         <R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: Don't include the TLS size
2465         when emitting a known TP offset in the GOT.
2466
2467 2009-03-23  Alan Modra  <amodra@bigpond.net.au>
2468
2469         * elf64-ppc.c (synthetic_opd): Delete.
2470         (compare_symbols): Look for .opd name rather than section match.
2471         (ppc64_elf_get_synthetic_symtab): Likewise.
2472
2473 2009-03-21  Alan Modra  <amodra@bigpond.net.au>
2474
2475         * elf32-ppc.c (is_pic_glink_stub): Delete.
2476         (is_nonpic_glink_stub): New function.
2477         (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather
2478         than first pic one.
2479         (struct ppc_elf_link_hash_table <glink_pltresolve>): Comment fix.
2480
2481 2009-03-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2482             Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
2483
2484         * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_*
2485         macros for visibilty and locality checks.
2486         (elf_s390_adjust_dynamic_symbol): Likewise.
2487         (allocate_dynrelocs): Likewise.
2488         (elf_s390_relocate_section): Likewise.
2489         (elf_s390_finish_dynamic_symbol): Likewise.
2490         * elf64-s390.c (elf_s390_check_relocs): Likewise.
2491         (elf_s390_adjust_dynamic_symbol): Likewise.
2492         (allocate_dynrelocs): Likewise.
2493         (elf_s390_relocate_section): Likewise.
2494         (elf_s390_finish_dynamic_symbol): Likewise.
2495
2496 2009-03-19  Kai Tietz  <kai.tietz@onevision.com>
2497
2498         * bfd-in2.h: Regenerated.
2499         * coffcode.h (sec_to_styp_flags): For pe-coff add SEC_READONLY
2500         for debugging sections and map memory read/write dependent on
2501         SEC_COFF_NOREAD.
2502         (styp_to_sec_flags): Set SEC_COFF_NOREAD for sections
2503         without memory read flags set.
2504         * section.c: Add SEC_COFF_NOREAD to section flags.
2505
2506 2009-03-19  Andreas Schwab  <schwab@linux-m68k.org>
2507
2508         * elf32-hppa.c (final_link_relocate): Cast bfd_vma values to long
2509         for format string.
2510
2511 2009-03-19  Alan Modra  <amodra@bigpond.net.au>
2512
2513         * elf32-spu.c (spu_elf_find_overlays): Separate error return from
2514         "no overlays" return.  If there are overlays, create overlay
2515         manager entry symbols here, so that..
2516         (spu_elf_build_stubs): ..we don't need to set them up here.
2517         Simplify entry symbol tests.
2518         * elf32-spu.h (spu_elf_find_overlays): Update prototype.
2519
2520 2009-03-18  Mark Kettenis  <kettenis@gnu.org>
2521
2522         * elf.c (elfcore_grok_openbsd_procinfo)
2523         (elfcore_grok_openbsd_note): New functions.
2524         (elf_parse_notes): Handle notes from OpenBSD ELF core files.
2525
2526 2009-03-18  Alan Modra  <amodra@bigpond.net.au>
2527
2528         * vms-hdr.c: Don't include alloca.h.
2529         * elf32-m68hc1x.c: Include alloca-conf.h.
2530         * xsym.c: Likewise.
2531         * elf64-hppa.c: Likewise.  Remove existing #if's handling alloca.
2532         * som.c: Likewise.
2533         * Makefile.am: Run "make dep-am".
2534         * Makefile.in: Regenerate.
2535
2536 2009-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
2537
2538         * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test.
2539
2540 2009-03-17  Alan Modra  <amodra@bigpond.net.au>
2541
2542         * elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit.
2543         Add compact_stub.
2544         (emum _ovly_flavour): Delete ovly_compact, ovly_none.
2545         * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and
2546         ovly_return fields with ovly_entry[2].  Adjust all users.
2547         (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler
2548         when soft-icache.
2549         (spu_elf_build_stubs): Likewise.
2550         (ovl_stub_size): Change arg to spu_elf_params pointer.  Adjust for
2551         ovly_flavour changes.  Update all callers.
2552         (ovl_stub_size_log2): New function.
2553         (build_stub): Handle compact icache stubs.  Use different manager
2554         entry point for stubs in non-icache area.
2555         (spu_elf_size_stubs): Don't allocate space for indirect branch
2556         descriptors.
2557         (spu_elf_build_stubs): And don't built them.
2558
2559 2009-03-16  Andrew Stubbs  <ams@codesourcery.com>
2560
2561         * dwarf2.c (read_section): Always use rawsize, if available.
2562
2563 2009-03-16  Alan Modra  <amodra@bigpond.net.au>
2564
2565         * simple.c (bfd_simple_get_relocated_section_contents): Use larger
2566         of rawsize and size for buffer.
2567
2568 2009-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
2569
2570         * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay
2571         parameter just because fixed sections fit into local store.
2572         (spu_elf_auto_overlay): Do not declare as "noreturn".  Skip
2573         generating overlays if fixed sections plus reserved stack
2574         and heap space fit into local store.
2575
2576 2009-03-15  Alan Modra  <amodra@bigpond.net.au>
2577
2578         * elf32-spu.c (build_stub): Correct icache set_id.
2579         (spu_elf_relocate_section): Likewise.
2580
2581 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2582
2583         * xcofflink.c (xcoff_link_check_archive_element): Only free the
2584         symbol table if it was created by the current call.
2585
2586 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2587
2588         * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors
2589         class XMC_DS rather than XMC_UA.
2590
2591 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2592
2593         * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
2594         bfd_boolean export_defineds parameter with an unsigned int
2595         auto_export_flags parameter.
2596         * bfd-in2.h: Regenerate.
2597         * xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
2598         split out from xcoff_build_ldsyms.
2599         (xcoff_covered_by_expall_p): New function.
2600         (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
2601         but with extra code to handle -bexpfull and -bexpall.
2602         (xcoff_mark_auto_exports): New function.
2603         (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
2604         a function should be automatically exported.
2605         (bfd_xcoff_size_dynamic_sections): Replace the export_defineds
2606         parameter with an auto_export_flags parameter.  Update ldinfo
2607         accordingly.  Use xcoff_mark_auto_exports to mark all automatically-
2608         exported symbols.
2609
2610 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2611
2612         * xcofflink.c (xcoff_mark_symbol_by_name): New function.
2613         (bfd_xcoff_size_dynamic_sections): Use it to mark the entry,
2614         init and fini functions.  Do garbage collection for objects
2615         without an entry point too.
2616
2617 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2618
2619         * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
2620         check whether a symbol has csect information.
2621         (coff_print_aux): Likewise.
2622         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
2623         information for C_AIX_WEAKEXT too.
2624         (_bfd_xcoff_swap_aux_out): Likewise.
2625         (xcoff_reloc_type_br): Handle defweak symbols too.
2626         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
2627         information for C_AIX_WEAKEXT too.
2628         (_bfd_xcoff64_swap_aux_out): Likewise.
2629         (xcoff64_reloc_type_br): Handle defweak symbols too.
2630         * coffgen.c (coff_print_symbol): Handle auxillary function
2631         information for C_AIX_WEAKEXT too.
2632         * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
2633         instead of BSF_GLOBAL if the L_WEAK flag is set.
2634         (xcoff_dynamic_definition_p): New function.
2635         (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
2636         defines h.  Don't change h if ldsym isn't the definition.  Otherwise,
2637         always take the symbol class from the ldsym.  Use weak bfd symbol
2638         types for weak ldsyms.
2639         (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
2640         Fix the check for whether a definition is from a shared object.
2641         Allow redefinitions of weak symbols.
2642         (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
2643         (xcoff_keep_symbol_p): Likewise.
2644         (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
2645         (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
2646         Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
2647         but mark them as L_WEAK.
2648         (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
2649         instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.
2650
2651 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2652
2653         * xcofflink.c (xcoff_mark): When walking the relocations,
2654         only mark the target symbol or the target section, not both.
2655         (xcoff_final_definition_p): New function.
2656         (xcoff_keep_symbol_p): Use it to check whether an external XCOFF
2657         symbol is a valid definition of the associated output symbol.
2658         Use XCOFF_ALLOCATED to stop the same hash table entry having
2659         two output symbols.
2660         (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when
2661         keeping a symbol.
2662         (xcoff_link_input_bfd): Use xcoff_final_definition_p.
2663
2664 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2665
2666         * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute
2667         symbols as XMC_XO.
2668
2669 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2670
2671         * libcoff-in.h (xcoff_tdata): Add a lineno_counts field.
2672         * libcoff.h: Regenerate.
2673         * xcofflink.c (xcoff_link_add_symbols): Record per-symbol
2674         line-number counts in the bfd's lineno_counts field.
2675         Don't keep per-csect line-number counts.
2676         (xcoff_sweep): Don't update per-csect line-number counts.
2677         (bfd_xcoff_size_dynamic_sections): Count the number of line-number
2678         entries in each output section.
2679         (xcoff_link_input_bfd): Get the number of line numbers from
2680         the bfd's lineno_counts field, rather than recalculating it
2681         from scratch.  Fix the range check when updating C_BINCL and
2682         C_EINCL symbols.
2683         (_bfd_xcoff_bfd_final_link): Don't count the output line numbers
2684         here.  Don't expect csects to have line-number counts.
2685
2686 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2687
2688         * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
2689         * libcoff.h: Regenerate.
2690         * xcofflink.c (xcoff_keep_symbol_p): New function, using the
2691         "skip" logic from xcoff_link_input_bfd.
2692         (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
2693         objects in a dynamic link, rather than checking whether csectpp
2694         is null.  Always allocate debug_index for other objects,
2695         and always go through the loop.  Update the type of debug_index
2696         after the change above.  Read the auxillary csect information
2697         and use xcoff_keep_symbol_p to decide whether a symbol should
2698         be kept.  Set its debug_index to -2 if not.
2699         (xcoff_link_input_bfd): Update the type of debug_index after
2700         the change above and always expect it to be nonnull.  Use it to
2701         test whether a symbol should be stripped, rather than making the
2702         decision here.  Postpone all symbol creation to the second pass.
2703
2704 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2705
2706         * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
2707         creating a descriptor.
2708         (xcoff_sweep): Don't mark toc_section unless it's needed.
2709         (bfd_xcoff_size_dynamic_sections): Skip the toc_section
2710         when marking every bfd.
2711         (xcoff_link_input_bfd): Skip all TOC anchors.
2712         (xcoff_toc_section_p, xcoff_find_tc0): New functions.
2713         (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
2714         to -1; call xcoff_find_tc0 instead.
2715
2716 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2717
2718         * libcoff-in.h (xcoff_section_tdata): Update commentary.
2719         * libcoff.h: Regenerate.
2720         * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
2721         symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
2722         the previous symbol's csect.  Treat last_symndx as an inclusive value
2723         and simplify its handling.
2724         (xcoff_mark): Treat last_symndx as an inclusive value.  Only mark
2725         symbols with the right csect.  Don't mark rsec when processing
2726         relocations against undefined or absolute sections.
2727         (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
2728         of bfd_und_section_ptr.
2729         (xcoff_link_input_bfd): Likewise.
2730
2731 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2732
2733         * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
2734         against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
2735         flag is set.  Assert that all undefined symbols are either
2736         imported or defined by a dynamic object.
2737         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
2738         * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
2739         handling to all relocations.  Only set XCOFF_CALLED for function
2740         symbols.
2741         (xcoff_find_function): New function, split out from...
2742         (bfd_xcoff_export_symbol) ...here.
2743         (xcoff_set_import_path): New function, split out from...
2744         (bfd_xcoff_import_symbol): ...here.  Remove assertion for old
2745         meaning of XCOFF_CALLED.
2746         (xcoff_mark_symbol): If we mark an undefined and unimported
2747         symbol, find some way of defining it.  If the symbol is a function
2748         descriptor, fill in its definition automatically.  If the symbol
2749         is a function, mark its descriptor and allocate room for global
2750         linkage code.  Otherwise mark the symbol as implicitly imported.
2751         Move the code for creating function descriptors from...
2752         (xcoff_build_ldsyms): ...here.  Use XCOFF_WAS_UNDEFINED to
2753         check for symbols that were implicitly defined.
2754         (xcoff_mark): Don't count any dynamic relocations against
2755         function symbols.
2756         (bfd_xcoff_size_dynamic_sections): Save the rtld parameter
2757         in the xcoff link info.
2758         (xcoff_link_input_bfd): Remove handling of undefined and
2759         unexported symbols.
2760
2761 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2762
2763         * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
2764         if the target is absolute.  Fix comment typo.
2765         (xcoff_ppc_relocate_section): Remove FIXME.
2766         * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
2767         if the target is absolute.
2768
2769 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2770
2771         * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
2772         R_POS and R_NEG relocations against absolute symbols to the
2773         .loader section.
2774
2775 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2776
2777         * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
2778         to 2 for bfd_mach_ppc_620.
2779
2780 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
2781
2782         * config.bfd: Treat AIX 6+ in the same way as AIX 5.
2783         * configure.in: Likewise.
2784         * configure: Regenerate.
2785
2786 2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
2787
2788         PR binutils/9945
2789         * elf.c (assign_section_numbers): Generate symbol table if there
2790         is any relocation in output.
2791         (_bfd_elf_compute_section_file_positions): Likewise.
2792
2793 2009-03-13  Nick Clifton  <nickc@redhat.com>
2794
2795         PR 9934
2796         * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
2797         * elflink.c (elf_link_read_relocs_from_section): Use
2798         NUM_SHDR_ENTRIES.  Gracefully handle the case where there are
2799         relocs but no symbol table.
2800         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
2801
2802 2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>
2803
2804         PR ld/9938
2805         * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
2806         to check ___tls_get_addr.
2807
2808         * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
2809         strncmp to check __tls_get_addr.
2810
2811 2009-03-12  Andrew Stubbs  <ams@codesourcery.com>
2812
2813         * dwarf2.c (read_section): Always check the offset, even when the
2814         section has been read before.
2815
2816 2009-03-11  H.J. Lu  <hongjiu.lu@intel.com>
2817
2818         * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
2819         comments.
2820
2821 2009-03-11  Chris Demetriou  <cgd@google.com>
2822
2823         * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
2824         * bfd-in2.h: Regenerate.
2825         * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
2826         flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
2827         mode.
2828         (bsd_write_armap): Likewise.
2829         (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
2830         flag is set, do nothing.
2831         (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
2832         for timestamp.
2833
2834 2009-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
2835
2836         * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
2837         used to update stack pointer.
2838
2839 2009-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2840
2841         PR binutils/9921
2842         * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
2843         for unknown symbols in absolute section.
2844
2845 2009-03-06  Nick Clifton  <nickc@redhat.com>
2846
2847         * po/es.po: Updated Spanish translation.
2848
2849 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
2850
2851         * elf32-arm.c (group_sections): Take next section size into
2852         account before accepting to group it.
2853
2854 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
2855
2856         * elf32-arm.c (arm_type_of_stub): Handle long branches targetting
2857         PLT entries.
2858         (elf32_arm_final_link_relocate): Likewise.
2859
2860 2009-03-05  Moritz Kroll  <Moritz.Kroll@gmx.de>
2861
2862         PR 9923
2863         * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
2864
2865 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
2866
2867         * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
2868         * section.c (struct bfd_section): Add has_tls_get_addr_call.
2869         (BFD_FAKE_SECTION): Init new flag.
2870         * ecoff.c (bfd_debug_section): Likewise.
2871         * bfd-in2.h: Regenerate.
2872         * libbfd.h: Regenerate.
2873         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
2874         (ppc_elf_reloc_type_lookup): Handle new relocs.
2875         (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
2876         without marker relocs.
2877         (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
2878         if section has no old-style calls.
2879         (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
2880         Don't try to optimize new-style __tls_get_addr call when handling
2881         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
2882         relocs.
2883         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
2884         (ppc64_elf_reloc_type_lookup): Handle new relocs.
2885         (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
2886         without marker relocs.
2887         (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
2888         if section has no old-style calls.  Set toc_ref for new relocs as
2889         appropriate.
2890         (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
2891         Don't try to optimize new-style __tls_get_addr call when handling
2892         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
2893         relocs.
2894
2895 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
2896
2897         PR 6768
2898         * configure.in: Test for ld --as-needed support.  Link shared
2899         libbfd against libm.
2900         * configure: Regenerate.
2901
2902 2009-03-03  Alan Modra  <amodra@bigpond.net.au>
2903
2904         * Makefile.am: Run "make dep-am".
2905         * Makefile.in: Regenerate.
2906
2907 2009-03-02  Qinwei  <qinwei@sunnorth.com.cn>
2908
2909         * elf32-score7.c: New file.
2910         * elf32-score.h: New file.
2911         * elf32-score.c: Add code to support score 7.  Set score7 as the
2912         default.
2913         * cpu-score.c: Add score7 architecure.
2914         (compatibile): New function.
2915         * Makefile.am: Add rules for building elf32-score7 object.
2916         * Makefile.in: Regenerate.
2917         * configure.in: Add elf32-score7 object to score vectors.
2918         * configure: Regenerate.
2919         * reloc.c: Add score7 relocs.
2920         * archures.c: Add score3 and score7 machine numbers.
2921         * bfd-in2.h: Regenerate.
2922         * libbfd.h: Regenerate.
2923
2924 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2925
2926         * configure: Regenerate.
2927
2928 2009-03-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2929
2930         * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
2931         (elf32_hppa_check_relocs): Use it.
2932
2933         * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
2934         elf64-hppa.c.
2935         (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
2936         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
2937         (elf_hppa_is_dynamic_loader_symbol): Likewise.
2938         (elf_hppa_record_segment_addrs): Likewise.
2939         (elf_hppa_final_link): Likewise.
2940         (elf_hppa_relocate_insn): Likewise.
2941         (elf_hppa_final_link_relocate): Likewise.
2942         (elf64_hppa_relocate_section): Likewise.
2943         * elf64-hppa.c: Insert above.
2944
2945 2009-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2946
2947         * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
2948         (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
2949         (elf_hppa_relocate_section): Likewise.
2950         * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
2951         from struct elf_link_hash_entry.  Add count field.
2952         (struct elf64_hppa_dyn_hash_table): Delete.
2953         (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
2954         (elf64_hppa_hash_table): Rename to hppa_link_hash_table.
2955         (hppa_elf_hash_entry, eh_name): Define.
2956         (elf64_hppa_new_dyn_hash_entry): Delete.
2957         (elf64_hppa_dyn_hash_lookup): Delete.
2958         (elf64_hppa_dyn_hash_traverse): Delete.
2959         (get_dyn_name): Delete.
2960         (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
2961         of struct elf64_hppa_dyn_hash_entry *.
2962         (elf64_hppa_finalize_dlt, llocate_global_data_dlt,
2963         allocate_global_data_plt, allocate_global_data_stub,
2964         allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
2965         Likewise.
2966         (hppa64_link_hash_newfunc): New.
2967         (elf64_hppa_hash_table_create): Rework.
2968         (count_dyn_reloc): Likewise.
2969         (hppa64_elf_local_refcounts): New.
2970         (elf64_hppa_check_relocs): Rework using standard technique for recording
2971         local DLT, PLT and OPD reference counts.
2972         (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
2973         elf_link_hash_entry *.
2974         (elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
2975         allocate_global_data_plt, allocate_global_data_stub,
2976         allocate_global_data_opd, allocate_dynrel_entries,
2977         elf64_hppa_adjust_dynamic_symbol,
2978         elf64_hppa_mark_milli_and_exported_functions): Likewise.
2979         (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
2980         Use hppa_link_hash_table.  Rework.
2981         (elf64_hppa_link_output_symbol_hook): Rework.
2982         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
2983         elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
2984         elf64_hppa_finish_dynamic_sections): Likewise.
2985
2986 2009-02-26  Christophe Lyon  <christophe.lyon@st.com>
2987
2988         * elf32-arm.c (stub_reloc_type): Removed.
2989         (insn_sequence): Renamed reloc_type field to r_type.
2990         (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
2991         (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
2992         (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
2993         (elf32_arm_stub_type): Add new enum entries for the new stubs.
2994         (arm_stub_is_thumb): Catch new stubs.
2995         (arm_type_of_stub): Handle new stubs.
2996         (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
2997         (bfd_elf32_arm_process_before_allocation): Remove useless
2998         condition.
2999
3000 2009-02-25  H.J. Lu  <hongjiu.lu@intel.com>
3001
3002         * elf.c (elf_find_function): Use is_function_type to check
3003         function symbol.
3004
3005 2009-02-24  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
3006
3007         * xtensa-modules.c: Revert to previous version 1.11 due
3008         to inadvertant commit.
3009
3010 2009-02-24  Sterling Augustine  <sterling@tensilica.com>
3011
3012         * elf32-xtensa.c (text_action_add): Separate test for action
3013         type.  Break if saved action is ta_widen_insn at same offset.
3014
3015 2009-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
3016
3017         * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
3018         to elf32_arm_stub_long_branch_any_arm_pic.
3019         (elf32_arm_stub_long_branch_any_thumb_pic): New.
3020         (enum elf32_arm_stub_type, arm_type_of_stub)
3021         (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
3022         separately.
3023
3024 2009-02-24  Joseph Myers  <joseph@codesourcery.com>
3025
3026         * elf32-arm.c (PREV_SEC): Update comment.
3027         (group_sections): Rename argument to stubs_always_after_branch.
3028         Reverse the list and place stubs at the end of input sections.
3029         Undefine NEXT_SEC.
3030         (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
3031
3032 2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
3033
3034         * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
3035         Fix formatting.
3036         (arm_size_one_stub): Remove unnecessary break.
3037         (arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.
3038
3039 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
3040
3041         * elf32-arm.c (stub_insn_type): New type.
3042         (stub_reloc_type): Likewise.
3043         (insn_sequence): Likewise.
3044         (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
3045         (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
3046         (elf32_arm_stub_long_branch_thumb_only): Likewise.
3047         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
3048         (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
3049         (elf32_arm_stub_long_branch_any_any_pic): Likewise.
3050         (elf32_arm_stub_hash_entry): Add new helper fields.
3051         (stub_hash_newfunc): Initialize these new fields.
3052         (arm_build_one_stub): Encode Arm and Thumb instructions separately
3053         to take endianness into account.
3054         (arm_size_one_stub): Compute size of stubs using insn_sequence.
3055         (arm_map_one_stub): Code is now more generic, thanks to
3056         insn_sequence.
3057
3058 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
3059
3060         * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
3061         code.
3062         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
3063         (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
3064         BLX is not available. Fix typo in warning message. Add comments
3065         and improve formatting.
3066         (arm_build_one_stub): Adjust to new
3067         elf32_arm_stub_long_branch_v4t_thumb_arm stub.
3068         (arm_map_one_stub): Likewise.
3069
3070 2009-02-23  Tristan Gingold  <gingold@adacore.com>
3071             Eric Botcazou  <ebotcazou@adacore.com>
3072             Douglas B Rupp  <rupp@gnat.com>
3073
3074         * vms.h: Update copyright year, fix comments, reorder declarations.
3075         (_bfd_save_vms_section): Remove the prototype.
3076         (EGPS_S_V_NO_SHIFT): New constant.
3077         (bfd_vms_set_section_flags): New prototype.
3078         (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New
3079         constants.
3080         (EGSY_S_W_FLAGS): Ditto.
3081         (EGSY_S_V_QUAD_VAL): Ditto.
3082         (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto.
3083         (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX,
3084         EGST_S_B_NAMLNG): Ditto.
3085         (ESRF_S_B_NAMLNG): Ditto.
3086         (ETIR_S_C_HEADER_SIZE): Ditto.
3087         (EGPS_S_V_ALLOC_64BIT): Ditto.
3088         (DST_S_C_EPILOG): Ditto.
3089         (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto.
3090         (DST_S_C_SRC_INCRLNUM_B): Ditto.
3091         (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto.
3092         (DST_S_L_PCLINE_UNSLONG): Ditto.
3093         (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto
3094         (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto
3095         (DST_S_C_SOURCE_HEADER_SIZE): Ditto.
3096         (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto.
3097         (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto.
3098         (DST_S_B_SRC_UNSBYTE): Ditto.
3099         (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto.
3100         Add prototypes.
3101         (vms_section, vms_reloc): Remove types.
3102         (hdr_struc): Replaced by ...
3103         (hdr_struct): ... new type.
3104         (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants.
3105         (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto.
3106         (EMH_DATE_LENGTH): Ditto.
3107         (eom_struc): Replaced by ...
3108         (eom_struct): ... new type.
3109         (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants.
3110         (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto.
3111         (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto.
3112         (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto.
3113         (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto.
3114         (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto.
3115         (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto.
3116         (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto.
3117         (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto.
3118         (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto.
3119         (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto.
3120         (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto.
3121         (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto.
3122         (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto.
3123         (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto.
3124         (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto.
3125         (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto.
3126         (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH)
3127         (DBG_S_C_DMT_PSECT_SIZE): Ditto.
3128         (enum file_type_enum): New type.
3129         (struct location_struct): Removed.
3130         (struct fileinfo, struct srecinfo, struct lineinfo): New types.
3131         (struct funcinfo, struct module): Ditto.
3132         (struct vms_private_data_struct): Update fields.
3133         (struct vms_section_data_struct): New type.
3134
3135         * vms.c: Update copyright year, fix comments,
3136         Fix includes for DECC, add prototypes.
3137         (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove
3138         some initializers.
3139         Use flavour to set is_vax, location_stack is removed.
3140         (struct pair): Declare.
3141         (fill_section_ptr): Initialize variables at declaration.
3142         Add guard to set SECTION_SYM flag, handlde und section.
3143         (vms_fixup_sections): Use struct pair for fill_section_ptr argument.
3144         (_bfd_vms_slurp_object_records): New function, replaces previous
3145         vms_object_p.
3146         (vms_slurp_module): New function.
3147         (vms_slurp_image): Ditto.
3148         (vms_object_p): Complete rewrite.
3149         (vms_mkobject): Use is_vax field to slect architecture.
3150         (free_reloc_stream): New function.
3151         (vms_convert_to_var): Ditto.
3152         (vms_convert_to_var_1): Ditto.
3153         (vms_convert_to_var_unix_filename): Ditto.
3154         (vms_close_and_cleanup): Call free_reloc_stream, convert file to
3155         VAR format on VMS.
3156         (vms_new_section_hook): Set alignment to 0, allocate private data.
3157         (vms_get_section_contents): Load content.
3158         (vms_get_symbol_info): Handle undefined section.
3159         (vms_find_nearest_line): Handle.
3160         (alloc_reloc_stream): New function.
3161         (vms_slurp_reloc_table): Ditto.
3162         (vms_get_reloc_upper_bound): Make it real.
3163         (vms_canonicalize_reloc): Do the real work.
3164         (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA,
3165         ALPHA_R_BOH.
3166         (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH.
3167         (vms_set_arch_mach): Check arch.
3168         (vms_set_section_contents): Copy the content after allocation.
3169         (vms_alpha_vec): Update object flags.
3170
3171         * vms-tir.c: Update copyright year, fix comments,
3172         add prototypes for new functions.
3173         (dst_define_location): New function.
3174         (dst_restore_location): New function.
3175         (dst_retrieve_location): New function.
3176         (dst_check_allocation): New function.
3177         (image_dump): Call dst_check_allocation.
3178         (image_write_b): Ditto.
3179         (image_write_w): Ditto.
3180         (image_write_l): Ditto.
3181         (image_write_q): Ditto.
3182         (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW,
3183         STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC,
3184         CTL_STKDL.
3185         Call error handler instead of abort if name is not known.
3186         (etir_sta): Add quarter_relocs argument and set it.
3187         Fix cast.
3188         (etir_sto): Ditto.
3189         (etir_opr): Ditto, return FALSE in case of error.
3190         (etir_ctl): Add quarter_relocs argument and set it, fix cast.
3191         Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL.
3192         (etir_stc): Add quarter_relocs argument and set it, fix cast.
3193         Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA.
3194         Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL.
3195         Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS.
3196         Return FALSE in case of error.
3197         (tir_sta): Change sign of psect.
3198         (tir_ctl): Ditto.
3199         (tir_cmd): Fix cast. Makes tir_table static const.
3200         (etir_cmd): Add quarter_relocs argument, makes etir_table const,
3201         add argument to explain.
3202         (analyze_etir): Initialize maxptr, add quarter_relocs
3203         declaration, move some declarations into inner scopes.
3204         Handle quarter_relocs and STO_IMM.
3205         (_bfd_vms_slurp_tir): Use constant instead of hard-coded values.
3206         (_bfd_vms_slurp_relocs): New function.
3207         (_bfd_vms_decode_relocs): New function.
3208         (sto_imm): Rewritten.
3209         (start_first_etbt_record): New function.
3210         (start_another_etbt_record): Ditto.
3211         (etir_output_check): Ditto.
3212         (defer_reloc_p): Ditto.
3213         (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to
3214         a for-loop.  Correctly deals with contents, deals with .vmsdebug,
3215         rewritte relocations handling.
3216         (_bfd_vms_write_tbt): Removed.
3217         (_bfd_vms_write_dbg): Ditto.
3218
3219         * vms-misc.c: Update copyright year, Fix comments.
3220         (_bfd_vms_get_header_values): Use 'size' instead of 'length'.
3221         (maybe_adjust_record_pointer_for_object): New function.
3222         (_bfd_vms_get_first_record): New function, replaces ...
3223         (_bfd_vms_get_record): ..  removed.
3224         (_bfd_vms_get_object_record): New function.
3225         (_bfd_vms_get_object_record): New function.
3226         (vms_get_remaining_object_record): New function, replaces ...
3227         (_bfd_vms_get_next_record): ... removed.
3228         (add_new_contents): Removed.
3229         (_bfd_save_vms_section): Removed.
3230         (_bfd_get_vms_section): Removed.
3231         (_bfd_vms_output_flush): Write in VAR format.
3232         (new_symbol): Don't make UND section.
3233
3234         * vms-hdr.c: Update copyright year, update list of record handled.
3235         (_bfd_vms_slurp_hdr): rec_length renamed to rec_size.
3236         (_bfd_vms_write_hdr): Strip vms and unix patches,
3237         add comments, truncate module name at 31 characters,
3238         use constants instead of hard-coded value,
3239         write BFD version instead of a fixed string.
3240         (_bfd_vms_slurp_ihd): New function.
3241         (_bfd_vms_slurp_isd): Ditto.
3242         (_bfd_vms_slurp_ihs): Ditto.
3243         (new_module): Ditto.
3244         (parse_module): Ditto
3245         (build_module_list): Ditto.
3246         (module_find_nearest_line): Ditto.
3247         (_bfd_vms_find_nearest_dst_line): Ditto.
3248         (vms_slurp_debug): Ditto.
3249         (_bfd_vms_slurp_dbg): Ditto.
3250         (_bfd_vms_slurp_tbt): Ditto.
3251         (_bfd_vms_write_dbg): Ditto.
3252         (_bfd_vms_write_tbt): Ditto.
3253
3254         * vms-gsd.c: Update copyright year, update list of records handled.
3255         (EVAX_LITERALS_NAME): New macro.
3256         (evax_section_flags): Add an entry for EVAX_LITERALS_NAME.
3257         (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd.
3258         (register_universal_symbol): New function and prototype.
3259         (_bfd_vms_slurp_gsd): Fix indentations and casts,
3260         improve debug messages,
3261         use constants instead of hard-coded value,
3262         fix missing endianness conversion,
3263         handle global symbol (SYMG).
3264         (bfd_vms_set_section_flags): New function.
3265         (_bfd_vms_write_gsd): Don't write .vmsdebug section,
3266         handle section literals,
3267         fix indentation,
3268         handle section bfd and vms flags,
3269         don't output LIB$INITIALIZE symbol,
3270         fix handling of weak symbols,
3271         fix evax vs vax procedure descriptor,
3272         handle absolute symbols.
3273
3274         * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR,
3275         BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations.
3276
3277         * makefile.vms (DEFS): Fix flags for VMS.
3278
3279         * bfdio.c (real_fopen): Handle multiple VMS fopen attributes.
3280
3281         * bfd-in2.h: Regenerated.
3282         * libbfd.h: Regenerated.
3283
3284 2009-02-20  Cary Coutant  <ccoutant@google.com>
3285
3286         * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime
3287         in struct stat.
3288
3289 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
3290
3291         PR gas/7059
3292         * coffcode.h (coff_write_object_contents):  Don't let the string
3293         table offset overflow the s_name field when using long section names.
3294
3295 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
3296
3297         * coff-alpha.c (alpha_ecoff_backend_data):  Initialise fields which
3298         control long section name handling with ECOFF_NO_LONG_SECTION_NAMES.
3299         * coff-mips.c (mips_ecoff_backend_data):  Likewise.
3300         * coff-rs6000.c (bfd_xcoff_backend_data):  Initialise fields which
3301         control long section name handling with XCOFF_NO_LONG_SECTION_NAMES.
3302         (bfd_pmac_xcoff_backend_data):  Likewise.
3303         * coff64-rs6000.c (bfd_xcoff_backend_data):  Likewise.
3304         (bfd_xcoff_aix5_backend_data):  Likewise.
3305         (xcoff64_write_object_contents):  Delete unused long_section_names
3306         local variable.
3307         * coff-sh.c (bfd_coff_small_swap_table):  Initialise long section
3308         name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire
3309         struct non-const.
3310         * coffcode.h (documentation):  Update to describe long section names.
3311         (COFFLONGSECTIONCATHELPER):  New helper macro.
3312         (BLANKOR1TOODD):  Likewise.
3313         (COFF_ENABLE_LONG_SECTION_NAMES):  Likewise.
3314         (COFF_LONG_SECTION_NAMES_SETTER):  Likewise.
3315         (COFF_DEFAULT_LONG_SECTION_NAMES):  Likewise.
3316         (bfd_coff_set_long_section_names_allowed):  New function.
3317         (bfd_coff_set_long_section_names_disallowed):  Likewise.
3318         (struct bfd_coff_backend_data):  Add new backend hook function
3319         pointer _bfd_coff_set_long_section_names.
3320         (bfd_coff_set_long_section_names):  New backend hook.
3321         (coff_write_object_contents):  Only generate long section names if
3322         bfd_coff_long_section_names() indicates they are currently enabled.
3323         (bfd_coff_std_swap_table):  Make non-const, and initialise long
3324         section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
3325         (ticoff0_swap_table):  Likewise to both.
3326         (ticoff1_swap_table):  Again, likewise to both.
3327         * coffgen.c (make_a_section_from_file):  Allow long section names
3328         as inputs even if not currently allowed for outputs.
3329         * ecoff.c (_bfd_ecoff_no_long_sections):  New function.
3330         * efi-app-ia32.c (COFF_LONG_SECTION_NAMES):  Define to 0, not blank.
3331         * efi-app-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3332         * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3333         * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
3334         * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3335         * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3336         * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
3337         * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3338         * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3339         * pei-arm.c (COFF_LONG_SECTION_NAMES):  Likewise.
3340         * pei-i386.c (COFF_LONG_SECTION_NAMES):  Likewise.
3341         * pei-mcore.c (COFF_LONG_SECTION_NAMES):  Likewise.
3342         * pei-mips.c (COFF_LONG_SECTION_NAMES):  Likewise.
3343         * pei-ppc.c (COFF_LONG_SECTION_NAMES):  Likewise.
3344         * pei-sh.c (COFF_LONG_SECTION_NAMES):  Likewise.
3345         * pei-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
3346         * libcoff-in.h:  Update copyright year to cause updated copyright
3347         year in generated libcoff.h, and fix typo.
3348         * libcoff.h:  Regenerated.
3349         * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES):  New macro.
3350         (_bfd_ecoff_no_long_sections):  Add prototype.
3351         * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES):  New macro.
3352         * pe-mips.c (COFF_LONG_SECTION_NAMES):  Define empty if not already
3353         defined by an including .c file.
3354         * ticoff.h (ticoff0_swap_table):  Make non-const, and initialise
3355         long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
3356         (ticoff1_swap_table):  Likewise to both.
3357
3358 2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
3359
3360         * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
3361         stub. Catch default case error.
3362         (arm_map_one_stub): Add missing Thumb mapping symbol.
3363
3364 2009-02-18  Bjoern Haase  <bjoern.m.haase@web.de>
3365
3366         PR 9841
3367         * elf32-avr.c: Handle case where no local symbos exist correctly.
3368
3369 2009-02-16  Christophe Lyon  <christophe.lyon@st.com>
3370
3371         bfd/
3372         * elf32-arm.c (arm_long_branch_stub,
3373         arm_thumb_v4t_long_branch_stub,
3374         arm_thumb_thumb_long_branch_stub,
3375         arm_thumb_arm_v4t_long_branch_stub,
3376         arm_thumb_arm_v4t_short_branch_stub,
3377         arm_pic_long_branch_stub):
3378         Renamed to elf32_arm_stub_long_branch_any_any,
3379         elf32_arm_stub_long_branch_v4t_arm_thumb,
3380         elf32_arm_stub_long_branch_thumb_only,
3381         elf32_arm_stub_long_branch_v4t_thumb_arm,
3382         elf32_arm_stub_short_branch_v4t_thumb_arm,
3383         elf32_arm_stub_long_branch_any_any_pic.
3384         (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
3385         arm_thumb_thumb_stub_long_branch,
3386         arm_thumb_arm_v4t_stub_long_branch,
3387         arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
3388         Renamed to arm_stub_long_branch_any_any,
3389         arm_stub_long_branch_v4t_arm_thumb,
3390         arm_stub_long_branch_thumb_only,
3391         arm_stub_long_branch_v4t_thumb_arm,
3392         arm_stub_short_branch_v4t_thumb_arm,
3393         arm_stub_long_branch_any_any_pic.
3394
3395 2009-02-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
3396
3397         * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used
3398         in branch offset check.
3399
3400 2009-02-15  Alan Modra  <amodra@bigpond.net.au>
3401
3402         * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,
3403         add toc.symndx and toc.add.
3404         (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here.
3405         Set up toc.add.
3406         (get_tls_mask): Add toc_addend param, set from toc.add.  Adjust all
3407         callers.
3408         (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd.
3409         (branch_reloc_hash_match): New function, extracted from..
3410         (ppc64_elf_tls_optimize): ..here.
3411         (ppc64_elf_relocate_section): Properly set addends when optimizing
3412         tls sequences.  Avoid unnecessary reading and writing of insns.
3413         Only redo reloc when symbol changed.  Bypass symbol checks when
3414         using tlsld_got.
3415         * elf32-ppc.c (ppc_elf_tls_setup): Correct comment.
3416         (branch_reloc_hash_match): New function, extracted from..
3417         (ppc_elf_tls_optimize): ..here.
3418         (ppc_elf_relocate_section): Avoid unnecessary reading of insns.
3419         Don't clear addend on zapped __tls_get_addr reloc.
3420
3421 2009-02-12  Nick Clifton  <nickc@redhat.com>
3422
3423         PR 9827
3424         * elflink.c (bfd_elf_final_link): When counting the relocations,
3425         if the header size has not been set yet then assume that it will
3426         match the output section's reloc type.
3427
3428 2009-02-12  Nathan Sidwell  <nathan@codesourcery.com>
3429
3430         * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
3431         relocatable link.
3432
3433 2009-02-09  Alan Modra  <amodra@bigpond.net.au>
3434
3435         * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
3436         (find_function): Likewise.
3437         (pasted_function): Don't error if no prior function found.
3438         (discover_functions): Revert 2008-12-10 change.  Extend first
3439         function range to start of section.
3440
3441 2009-02-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
3442
3443         * elf64-hppa.c: Remove PARAMS macro.  Replace PTR with void *.  Convert
3444         functions to C90.
3445         * elf64-hppa.h: Likewise.
3446
3447 2009-02-06  Joseph Myers  <joseph@codesourcery.com>
3448
3449         * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
3450         .sbss handling.
3451
3452 2009-02-04  Alan Modra  <amodra@bigpond.net.au>
3453
3454         * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.
3455         Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
3456
3457 2009-02-03  Sandip Matte  <sandip@rmicorp.com>
3458
3459         * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
3460         * archures.c (bfd_mach_mips_xlr): Define.
3461         * bfd-in2.h: Regenerate.
3462         * cpu-mips.c (I_xlr): Define.
3463         (arch_info_struct): Add XLR entry.
3464         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
3465         (mips_set_isa_flags): Handle bfd_mach_mips_xlr
3466         (mips_mach_extensions): Add XLR entry.
3467
3468 2009-02-03  Eric B. Weddington  <eric.weddington@atmel.com>
3469
3470         * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound.
3471
3472 2009-02-03  Carlos O'Donell  <carlos@codesourcery.com>
3473
3474         * configure.in: AC_SUBST pdfdir.
3475         * Makefile.am: Add install-pdf, install-pdf-am
3476         and install-pdf-recursive targets. Define pdfdir.
3477         * doc/Makefile.am: Define pdf__strip_dir. Add
3478         install-pdf and install-pdf-am targets.
3479         * po/Make-in: Add install-pdf target.
3480         * configure: Regenerate.
3481         * Makefile.in: Regenerate
3482         * doc/Makefile.in: Regenerate.
3483
3484 2009-02-03  Maxim Kuvyrkov  <maxim@codesourcery.com>
3485
3486         * bfd-in2.h: Regenerate.
3487         * elf32-m68k.c: Handle 2-slot GOT entries.  Rename variables and
3488         fields from n_entries to n_slots where appropriate, update comments.
3489         (HOWTO): Add TLS relocations.
3490         (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
3491         (enum elf_m68k_got_offset_size): New enum.
3492         (struct elf_m68k_got_entry.type): Move field to ...
3493         (struct elf_m68k_got_entry_key): ... here.  Update all uses.
3494         (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static
3495         functions.
3496         (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static
3497         functions.
3498         (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
3499         fields into n_entries array.  Update comments.
3500         (elf_m68k_init_got): Simplify, update all uses.
3501         (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update.
3502         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
3503         GOT entries; update name, update all uses.
3504         (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto.
3505         (elf_m68k_get_got_entry): Update.
3506         (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
3507         simplify.
3508         (elf_m68k_remove_got_entry_type): Simplify.
3509         (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update.
3510         (elf_m68k_can_merge_gots): Update.
3511         (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
3512         (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot
3513         GOT entries, simplify.
3514         (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same.
3515         (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
3516         field, remove obsoleted local_n_entries field.
3517         (elf_m68k_partition_multi_got_2): New static function.
3518         (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it;
3519         update.
3520         (elf_m68k_remove_got_entry_type): Update.
3521         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
3522         (elf_m68k_check_relocs): Handle TLS relocations.  Remove unnecessary
3523         update of sgot->size and srelgot->size.
3524         (elf_m68k_gc_sweep_hook): Update.
3525         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
3526         (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle
3527         TLS relocations.
3528         * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
3529         * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
3530
3531 2009-02-02  DJ Delorie  <dj@redhat.com>
3532
3533         * elf32-mep.c (config_names): Regenerate configuration.
3534
3535 2009-02-02  Alan Modra  <amodra@bigpond.net.au>
3536
3537         * elf-bfd.h (bfd_elf_get_str_section): Don't declare.
3538         (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
3539         * elf.c (bfd_elf_get_str_section): Make static.
3540         (bfd_elf_find_section): Delete.
3541         * libbfd.h: Regenerate.
3542
3543 2009-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
3544
3545         * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
3546         (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.
3547
3548 2009-01-31  Alan Modra  <amodra@bigpond.net.au>
3549
3550         * elflink.c (on_needed_list): New function.
3551         (elf_link_add_object_symbols): Link in --as-needed libs if they
3552         satisfy undefined symbols in other libs.
3553
3554 2009-01-30  Julian Brown  <julian@codesourcery.com>
3555
3556         * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
3557         EXEC_P or DYNAMIC flags, and skip sections which are being linked
3558         with --just-symbols (-R).
3559
3560 2009-01-29  Adam Nemet  <anemet@caviumnetworks.com>
3561
3562         * dwarf2.c (read_rangelist): Use read_address to read low_pc and
3563         high_pc in order to properly sign-extend VMAs.
3564
3565 2009-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
3566             Mark Shinwell  <shinwell@codesourcery.com>
3567             Catherine Moore  <clm@codesourcery.com>
3568
3569         * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
3570
3571 2009-01-28  Catherine Moore <clm@codesourcery.com>
3572
3573         * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
3574         SEC_LOAD for dynamic relocation sections.
3575
3576 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
3577
3578         * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table
3579         (info)->tls_size, not elf_hash_table (info)->tls_sec->size for
3580         the size of local TLS data.
3581
3582 2009-01-27  Andreas Schwab  <schwab@suse.de>
3583
3584         * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
3585         architectures in the archive.
3586
3587 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
3588
3589         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
3590         <R_CRIS_32_DTPREL>: Correct relocation value.
3591
3592         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
3593         <R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
3594         symbols with non-default visibility.
3595
3596 2009-01-26  Nathan Sidwell  <nathan@codesourcery.com>
3597
3598         * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs
3599         describing the trampolines.
3600         (ppc_elf_relocate_section): Update relocs to describe the
3601         trampolines.
3602
3603 2009-01-25  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
3604
3605         * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that
3606         branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F
3607         and R_PARISC_PCREL12F relocations.
3608
3609 2009-01-24  Alan Modra  <amodra@bigpond.net.au>
3610
3611         PR 6022
3612         * elflink.c (find_version_for_sym): New function split out from,
3613         but without export_dynamic test, ..
3614         (_bfd_elf_link_assign_sym_version): ..here.
3615         (_bfd_elf_export_symbol): Use it.
3616
3617 2009-01-23  Alan Modra  <amodra@bigpond.net.au>
3618
3619         * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
3620         (struct elf_info_failed, struct elf_find_verdep_info): Move to..
3621         * elflink.c: ..here, somewhat modified.
3622         * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
3623         _bfd_elf_link_find_version_dependencies,
3624         _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
3625         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
3626         _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
3627         declare..
3628         * elflink.c: ..and make static here.
3629         (_bfd_elf_link_find_version_dependencies): Adjust for removal
3630         of output_bfd from struct elf_find_verdep_info.
3631         (_bfd_elf_link_assign_sym_version): Similarly adjust to use
3632         struct elf_info_failed.
3633         (bfd_elf_size_dynamic_sections): Adjust.
3634
3635 2009-01-22  Alan Modra  <amodra@bigpond.net.au>
3636
3637         PR 6832
3638         * dwarf2.c (find_line): Don't update stash->sec_info_ptr until
3639         after comp_unit_find_line call.
3640
3641 2009-01-21  Nick Clifton  <nickc@redhat.com>
3642
3643         PR 9769
3644         * vmsutil.c (vms_file_stats_name): Remove use of unsupported
3645         tm_gmtoff field in struct tm.
3646
3647 2009-01-21  Alan Modra  <amodra@bigpond.net.au>
3648
3649         * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
3650         * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
3651         sections in soft-icache lines unless non_ia_text.  Don't add
3652         rodata if doing so would exceed line size.
3653
3654 2009-01-19  Hans-Peter Nilsson  <hp@axis.com>
3655
3656         * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
3657         types than bfd_link_hash_indirect, before early return, call
3658         _bfd_elf_link_hash_copy_indirect.
3659
3660 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
3661
3662         * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
3663         * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
3664         * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
3665         (elf_backend_obj_attrs_order): New define.
3666         * elfxx-target.h (elf_backend_obj_attrs_order): New define.
3667         (elfNN_bed): Add elf_backend_obj_attrs_order.
3668
3669 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
3670
3671         * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
3672         (obj_attr_size): Likewise.
3673         (write_obj_attribute): Likewise.
3674         (_bfd_elf_copy_obj_attributes): Likewise.
3675         (_bfd_elf_parse_attributes): Likewise.
3676         * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
3677         (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
3678         (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
3679         (ATTR_TYPE_HAS_NO_DEFAULT): New define.
3680         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
3681         with macros.
3682
3683 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
3684
3685         * elf-attrs.c (is_default_attr): Support defaultless attributes.
3686         (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
3687         (bfd_elf_add_obj_attr_string): Likewise.
3688         (bfd_elf_add_obj_attr_int_string): Likewise.
3689         (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
3690         * elf-bfd.h (struct obj_attribute): Document new flag bit.
3691         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
3692         Tag_nodefaults has no default value.
3693         (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
3694         comment to reflect the new state.
3695
3696 2009-01-19  Alan Modra  <amodra@bigpond.net.au>
3697
3698         PR 9695
3699         * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC.
3700         (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC.
3701         (adjust_z_magix): Delete dead code handling QMAGIC.
3702
3703 2009-01-16  Kai Tietz  <kai.tietz@onevision.com>
3704
3705         * coffcode.h (styp_to_sec_flags): Correct interpretation of
3706         IMAGE_SCN_MEM_DISCARDABLE.
3707
3708 2009-01-16  Alan Modra  <amodra@bigpond.net.au>
3709
3710         * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute
3711         SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS.
3712         * configure.in (commonbfdlib): Delete.
3713         (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/
3714         (SHARED_LIBADD): Rename from WIN32LIBADD.  Add pic libiberty if such
3715         is available, not just for linux.
3716         * po/SRC-POTFILES.in: Regenerate.
3717         * Makefile.in: Regenerate.
3718         * configure: Regenerate.
3719
3720 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
3721             Julian Brown   <julian@codesourcery.com>
3722
3723         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
3724         ARM attributes in ABI 2.07.
3725         * elf32-arm.c (get_secondary_compatible_arch): New function.
3726         (set_secondary_compatible_arch): New function.
3727         (tag_cpu_arch_combine): New function.
3728         (elf32_arm_copy_one_eabi_other_attribute): Delete function.
3729         (elf32_arm_copy_eabi_other_attribute_list): Delete function.
3730         (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
3731         make it fit with order_01243.
3732         Add support for Tag_also_compatible_with,
3733         Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
3734         Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
3735         Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
3736         Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
3737         Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
3738         Tag_VFP_arch and Tag_ABI_FP_16bit_format.
3739         Rework the way unknown attributes are handled.
3740         Defer errors until all attributes have been processed.
3741
3742 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
3743
3744         * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
3745         bfd_elf_add_obj_attr_int_string.
3746         Read Tag_compatibility from its new location in the attribute array,
3747         rather than the attribute list.
3748         (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
3749         bfd_elf_add_obj_attr_int_string.
3750         (_bfd_elf_parse_attributes): Likewise.
3751         (_bfd_elf_merge_object_attributes): There's now only one
3752         Tag_compatibility, and it's in the array, not the list.
3753         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
3754         Tag_compatibility.
3755         (bfd_elf_add_obj_attr_compat): Rename to
3756         bfd_elf_add_obj_attr_int_string.
3757         (bfd_elf_add_proc_attr_compat): Rename to
3758         bfd_elf_add_proc_attr_int_string.
3759         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
3760         Tag_compatibility.
3761
3762 2009-01-15  Douglas B Rupp  <rupp@gnat.com>
3763
3764         * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo
3765         (BFD32_BACKENDS_CFILES): Add new file vmsutil.c
3766         (vmsutil.lo): Add dependency rule.
3767         * Makefile.in: Regenerate.
3768         * config.bfd (ia64*-*-*vms*): Add case.
3769         * configure.in (bfd_elf64_ia64_vms_vec): Add case.
3770         * configure: Regenerate.
3771         * vmsutil.c: New file.
3772         * vmsutil.h: New file.
3773         * elf-bfd.h (struct bfd_elf_special_section): Change type of
3774         attr to bfd_vma.
3775         * elfxx-ia64.c (elfNN_vms_post_process_headers,
3776         elfNN_vms_section_processing, elfNN_vms_final_write_processing,
3777         elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr,
3778         elfNN_vms_object_p): New functions
3779         * targets.c (bfd_elf64_ia64_vms_vec): New target.
3780
3781 2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>
3782
3783         PR ld/9727
3784         * elflink.c (elf_gc_sweep): Exclude the group section if the
3785         first member of the section group is excluded.
3786
3787 2009-01-14  Alan Modra  <amodra@bigpond.net.au>
3788
3789         PR 9735
3790         * syms.c (_bfd_stab_section_find_nearest_line): Don't free
3791         saved filename, use bfd_alloc rather than bfd_malloc for it.
3792
3793 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
3794
3795         * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.
3796
3797 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
3798
3799         * elf32-spu.c (remove_cycles): Always set call->max_depth.
3800
3801 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
3802
3803         * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.
3804
3805 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
3806
3807         * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2,
3808         num_lines_log2.
3809         (struct got_entry): Add br_addr.
3810         (struct call_info): Add priority.
3811         (struct function_info): Add lr_store and sp_adjust.
3812         (spu_elf_setup): Init line_size_log2 and num_lines_log2.
3813         (spu_elf_find_overlays): For soft-icache, mark any section within cache
3814         area as an overlay, and check that no other overlays exist.  Look up
3815         icache overlay manager entry sym.
3816         (BRA_STUBS, BRA, BRASL): Define.
3817         (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub.
3818         (needs_ovl_stub): Adjust for soft-icache.  Return priority encoded
3819         in branch insn.
3820         (count_stub, build_stub): Support soft-icache.
3821         (build_spuear_stubs, process_stubs): Adjust build_stub call.
3822         (spu_elf_size_stubs): Size soft-icache stubs.
3823         (overlay_index): New function.
3824         (spu_elf_build_stubs): Make static.  Support soft-icache.
3825         (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache.
3826         (find_function_stack_adjust): Save lr store and stack adjust insn
3827         offsets.
3828         (maybe_insert_function): Adjust find_function_stack_adjust call.
3829         (mark_functions_via_relocs): Retrieve priority.
3830         (remove_cycles): Only warn about pruned arcs when stack_analysis.
3831         (sort_calls): Sort by priority first.
3832         (mark_overlay_section): Ignore .ovl.init.
3833         (sum_stack): Only print when stack_analysis.
3834         (print_one_overlay_section): New function, extracted from..
3835         (spu_elf_auto_overlay): ..here.  Support soft-icache overlays.
3836         (spu_elf_stack_analysis): Only print when htab->stack_analysis.
3837         (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive
3838         analysis.  Call spu_elf_build_stubs.
3839         (spu_elf_relocate_section): For soft-icache encode overlay index
3840         into addresses.
3841         (spu_elf_output_symbol_hook): Support soft-icache.
3842         (spu_elf_modify_program_headers: Likewise.
3843
3844         * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis.  Rename
3845         num_regions to num_lines.  Add line_size and max_branch.
3846         (enum _ovly_flavour): Add ovly_soft_icache.
3847         (spu_elf_build_stubs): Delete.
3848
3849 2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
3850
3851         * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
3852         relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
3853
3854 2009-01-07  Hans-Peter Nilsson  <hp@axis.com>
3855
3856         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
3857         <case R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: For a symbol defined in
3858         the program, the known offset starts at the negative size of the
3859         TLS section.
3860         <case R_CRIS_32_IE, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>:
3861         Similar.
3862
3863 2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
3864
3865         * config.bfd: Add lm32-*-rtems*.
3866
3867 2009-01-03  H.J. Lu  <hongjiu.lu@intel.com>
3868
3869         * coff-ppc.c: Add 2009 to Copyright.
3870         * elf32-cris.c: Likewise.
3871         * elflink.c: Likewise.
3872
3873 2009-01-03  Hans-Peter Nilsson  <hp@axis.com>
3874
3875         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename
3876         gotplt_index to rela_plt_index.  Adjust for R_CRIS_DTPMOD entry.
3877
3878 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
3879
3880         PR ld/9679
3881         * elflink.c (elf_merge_st_other): New.
3882         (_bfd_elf_merge_symbol): Use it on skipped weak definitions and
3883         hide them if needed.
3884         (elf_link_add_object_symbols): Updated.
3885
3886 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
3887
3888         PR ld/9676
3889         * elflink.c (elf_link_add_object_symbols): Update def_dynamic,
3890         ref_dynamic and dynamic_def fields when setting def_regular
3891         to 1.
3892
3893 2009-01-02  Curtis Mackie  <curtmackevo@gmail.com>
3894
3895         PR 9682
3896         * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string
3897         literal.
3898
3899 For older changes see ChangeLog-2008
3900 \f
3901 Local Variables:
3902 mode: change-log
3903 left-margin: 8
3904 fill-column: 74
3905 version-control: never
3906 End: