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