bfd/
[external/binutils.git] / bfd / ChangeLog
1 2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>
2
3         * elf32-i386.c (elf_i386_link_hash_table): Add irelifunc.
4         (elf_i386_link_hash_table_create): Initialize irelifunc.
5         (elf_i386_check_relocs): Updated.  Set up irelifunc for
6         shared objects.
7         (elf_i386_allocate_dynrelocs): Use irelifunc for dynamic
8         relocation for non-GOT reference of STT_GNU_IFUNC symbol in
9         shared objects.
10         (elf_i386_relocate_section): Likewise.
11
12         * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc.
13         (elf64_x86_64_link_hash_table_create): Initialize irelifunc.
14         (elf64_x86_64_check_relocs): Updated.  Set up irelifunc for
15         shared objects.
16         (elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic
17         relocation for non-GOT reference of STT_GNU_IFUNC symbol in
18         shared objects.
19         (elf64_x86_64_relocate_section): Likewise.
20
21         * elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to
22         ...
23         (_bfd_elf_create_ifunc_sections): This.
24
25         * elflink.c (_bfd_elf_create_static_ifunc_sections): Renamd to
26         ...
27         (_bfd_elf_create_ifunc_sections): This.  Create .rel[a].ifunc
28         for shared objects.
29
30 2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>
31
32         * elf32-i386.c (elf_i386_check_relocs): Make room for dynamic
33         relocation for R_386_32 against STT_GNU_IFUNC symbol when
34         building shared object.  Check info->executable instead of
35         !info->shared when setting non_got_ref.
36         (elf_i386_allocate_dynrelocs): Allocate dynamic relocation
37         for non-GOT reference of STT_GNU_IFUNC symbol in shared
38         object. Allocate GOT relocation agsinst STT_GNU_IFUNC
39         symbol if needed.
40         (elf_i386_relocate_section): Output dynamic relocation for
41         R_386_32 against STT_GNU_IFUNC symbol to get the real
42         function address when building shared object.
43         (elf_i386_finish_dynamic_symbol): Output R_386_GLOB_DAT
44         relocation for STT_GNU_IFUNC symbol in shared object.
45
46         * elf64-x86-64.c (elf64_x86_64_check_relocs): Make room for
47         dynamic relocation for R_X86_64_64 against STT_GNU_IFUNC
48         symbol when building shared object.  Check info->executable
49         instead of !info->shared when setting non_got_ref.
50         (elf64_x86_64_allocate_dynrelocs): Allocate dynamic relocation
51         for non-GOT reference of STT_GNU_IFUNC symbol in shared
52         library. Allocate GOT relocation agsinst STT_GNU_IFUNC symbol
53         if needed.
54         (elf64_x86_64_relocate_section): Output dynamic relocation
55         for R_X86_64_64 against STT_GNU_IFUNC symbol to get the real
56         function address when building shared object.
57         (elf64_x86_64_finish_dynamic_symbol): Output R_X86_64_GLOB_DAT
58         relocation for STT_GNU_IFUNC symbol in shared object.
59
60 2009-06-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
61
62         * Makefile.am: Run "make dep-am".
63         (BFD32_BACKENDS): Add mach-o-i386.lo.
64         (BFD32_BACKENDS_CFILES): Add mach-o-i386.c.
65         * Makefile.in: Regenerate.
66
67 2009-06-06  Alan Modra  <amodra@bigpond.net.au>
68
69         * elf32-spu.c (spu_elf_relocate_section): Match overlay number
70         when looking for soft-icache stubs.
71
72 2009-06-05  Tristan Gingold  <gingold@adacore.com>
73
74         * mach-o.h: Update copyright year.
75         (bfd_mach_o_mach_header_magic): New enum.
76         (bfd_mach_o_cpu_subtype): Now an enum.
77         (BFD_MACH_O_HEADER_SIZE, BFD_MACH_O_HEADER_64_SIZE): New macros.
78         (BFD_MACH_O_SECTION_SIZE, BFD_MACH_O_SECTION_64_SIZE): Ditto.
79         (BFD_MACH_O_LC_SEGMENT_SIZE, BFD_MACH_O_LC_SEGMENT_64_SIZE): Ditto.
80         (bfd_mach_o_load_command): Field type_required is now a boolean.
81         Reindent prototypes.
82         (bfd_mach_o_object_p, bfd_mach_o_core_p): Remove.
83         (bfd_mach_o_bfd_copy_private_symbol_data): Add a prototype.
84         (bfd_mach_o_bfd_copy_private_section_data): Ditto.
85         (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
86         (bfd_mach_o_get_symtab_upper_bound): Ditto.
87         (bfd_mach_o_canonicalize_symtab): Ditto.
88         (bfd_mach_o_get_symbol_info): Ditto.
89         (bfd_mach_o_print_symbol): Ditto.
90         (bfd_mach_o_bfd_print_private_bfd_data): Ditto.
91         (bfd_mach_o_make_empty_symbol): Ditto.
92         (bfd_mach_o_write_contents): Ditto.
93
94         * mach-o.c (bfd_mach_o_object_p, bfd_mach_o_core_p,
95         bfd_mach_o_mkobject): Defines.
96         (bfd_mach_o_valid): Returns FALSE/TRUE instead of 0/1.
97         Do not check with target vector but with flavour.
98         (struct mach_o_section_name_xlat): New declaration.
99         (dwarf_section_names_xlat): Ditto.
100         (text_section_names_xlat): Ditto.
101         (data_section_names_xlat): Ditto.
102         (struct mach_o_segment_name_xlat): Ditto.
103         (segsec_names_xlat): Ditto.
104         (bfd_mach_o_convert_section_name_to_bfd): New function.
105         (bfd_mach_o_convert_section_name_to_mach_o): Ditto.
106         (bfd_mach_o_bfd_copy_private_symbol_data): Make it public.
107         (bfd_mach_o_bfd_copy_private_section_data): Ditto.
108         (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
109         Accept any input and output flavour.  Do not share private data
110         anymore.
111         (bfd_mach_o_count_symbols): Add a comment.
112         (bfd_mach_o_get_symtab_upper_bound): Make it public.
113         (bfd_mach_o_canonicalize_symtab): Ditto.
114         (bfd_mach_o_get_symbol_info): Ditto.
115         (bfd_mach_o_print_symbol): Ditto.
116         (bfd_mach_o_write_header): Now returns a boolean instead of an int.
117         Use constants instead of hard-coded values.
118         (bfd_mach_o_scan_write_section_32): Use constants instead of hard-coded
119         values.
120         (bfd_mach_o_scan_write_section_64): Ditto.
121         (bfd_mach_o_scan_write_segment): Ditto.
122         Do not copy sections anymore.
123         (bfd_mach_o_write_contents): Make it public.
124         Remove dead code.  Rewrite typeflag assignment.
125         (bfd_mach_o_build_commands): New function.
126         (bfd_mach_o_set_section_contents): Ditto.
127         (bfd_mach_o_make_empty_symbol): Make it public.
128         (bfd_mach_o_read_header): Make it static.
129         Convert to bfd_boolean.
130         Use constants instead of hard-coded values.
131         (bfd_mach_o_make_bfd_section): Call
132         bfd_mach_o_convert_section_name_to_bfd to create name.
133         (bfd_mach_o_scan_read_section_32): Use constants instead of hard-coded
134         values.
135         (bfd_mach_o_scan_read_section_64): Ditto.
136         (bfd_mach_o_scan_read_segment): Do not create a bfd section for
137         a segment anymore.  Use constants instead of hard-coded values.
138         (bfd_mach_o_scan_read_command): Fix style.
139         (bfd_mach_o_scan): Use constants instead of hard-coded values.
140         Get rid of BFD_IO_FUNCS.
141         (bfd_mach_o_mkobject_init): Renamed from bfd_mach_o_mkobject.
142         (bfd_mach_o_header_p): Created from bfd_mach_o_object_p.
143         (bfd_mach_o_gen_object_p): New function, replaces bfd_mach_o_object_p.
144         (bfd_mach_o_object_p): Removed.
145         (bfd_mach_o_gen_core_p): New function, replaces ...
146         (bfd_mach_o_core_p): ... deleted.
147         (bfd_mach_o_bfd_print_private_bfd_data): Make it public.
148
149         * mach-o-i386.c: New file.
150         * config.bfd: Use mach_o_i386_vec as targ_defvec for ix86-darwin.
151         * configure.in (TDEFINES): Add mach_o_i386_vec.
152         * configure: Regenerated.
153         * targets.c: Add mach_o_i386_vec.
154
155         * mach-o.c: Update copyright years.
156         (BFD_IO_FUNCS): Remove (was not used).
157         (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr, bfd_mach_o_slurp_armap
158         bfd_mach_o_slurp_extended_name_table,
159         bfd_mach_o_construct_extended_name_table,
160         bfd_mach_o_truncate_arname, bfd_mach_o_write_armap,
161         bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt,
162         bfd_mach_o_update_armap_timestamp, bfd_mach_o_close_and_cleanup,
163         bfd_mach_o_bfd_free_cached_info, bfd_mach_o_new_section_hook,
164         bfd_mach_o_get_section_contents_in_window,
165         bfd_mach_o_bfd_is_local_label_name,
166         bfd_mach_o_bfd_is_target_special_symbol,
167         bfd_mach_o_bfd_is_local_label_name, bfd_mach_o_get_lineno,
168         bfd_mach_o_find_nearest_line, bfd_mach_o_find_inliner_info,
169         bfd_mach_o_bfd_make_debug_symbol, bfd_mach_o_read_minisymbols,
170         bfd_mach_o_minisymbol_to_symbol,
171         bfd_mach_o_bfd_get_relocated_section_contents,
172         bfd_mach_o_bfd_relax_section, bfd_mach_o_bfd_link_hash_table_create,
173         bfd_mach_o_bfd_link_hash_table_free, bfd_mach_o_bfd_link_add_symbols,
174         bfd_mach_o_bfd_link_just_syms, bfd_mach_o_bfd_final_link,
175         bfd_mach_o_bfd_link_split_section, bfd_mach_o_set_arch_mach,
176         bfd_mach_o_bfd_merge_private_bfd_data,
177         bfd_mach_o_bfd_set_private_flags, bfd_mach_o_get_section_contents,
178         bfd_mach_o_bfd_gc_sections, bfd_mach_o_bfd_merge_sections,
179         bfd_mach_o_bfd_is_group_section, bfd_mach_o_bfd_discard_group,
180         bfd_mach_o_section_already_linked, bfd_mach_o_bfd_define_common_symbol,
181         bfd_mach_o_bfd_copy_private_header_data,
182         bfd_mach_o_core_file_matches_executable_p): Move these defines ...
183         * mach-o-target.c: ... here.
184         Update copyright years.
185
186 2009-06-04  Alan Modra  <amodra@bigpond.net.au>
187
188         * dep-in.sed: Don't use \n in replacement part of s command.
189         * Makefile.am (DEP1): LC_ALL for uniq.
190         Run "make dep-am".
191         * Makefile.in: Regenerate.
192
193 2009-06-03  H.J. Lu  <hongjiu.lu@intel.com>
194
195         * elf32-i386.c (elf_i386_allocate_dynrelocs): Remove check of
196         h->plt.refcount > 0 on STT_GNU_IFUNC symbol.
197         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
198
199 2009-06-03  H.J. Lu  <hongjiu.lu@intel.com>
200
201         * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate
202         GOT entry for STT_GNU_IFUNC symbol with pointer equality.
203         (elf_i386_relocate_section): Adjust R_386_GOT32 relocation
204         against STT_GNU_IFUNC symbols for static executables.
205         (elf_i386_finish_dynamic_symbol): Load GOT entry with
206         PLT entry for STT_GNU_IFUNC symbol with pointer equality.
207
208         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Allocate
209         GOT entry for STT_GNU_IFUNC symbol with pointer equality.
210         (elf64_x86_64_finish_dynamic_symbol): Load GOT entry with
211         PLT entry for STT_GNU_IFUNC symbol with pointer equality.
212
213 2009-06-02  Richard Sandiford  <r.sandiford@uk.ibm.com>
214
215         * coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined
216         symbols to be left unimported when linking statically.
217         * xcofflink.c (xcoff_link_add_symbols): Ignore global linkage
218         code when linking statically.
219
220 2009-06-02  H.J. Lu  <hongjiu.lu@intel.com>
221
222         * elf32-i386.c (elf_i386_check_relocs): Increment
223         got.refcount for R_386_GOT32/R_386_GOTOFF relocations
224         against STT_GNU_IFUNC symbol.
225         (elf_i386_allocate_dynrelocs): Set got.refcount to 0 if
226         local STT_GNU_IFUNC definition is used.
227         (elf_i386_relocate_section): Handle got.offset != -1 for
228         R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC
229         symbol.
230
231         * elf64-x86-64.c (elf64_x86_64_check_relocs): Increment
232         got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64
233         relocations against STT_GNU_IFUNC symbol.
234         (elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if
235         local STT_GNU_IFUNC definition is used.
236         (elf64_x86_64_relocate_section): Handle got.offset != -1
237         for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against
238         STT_GNU_IFUNC symbol.
239
240 2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>
241
242         PR ld/10205
243         * elf32-i386.c (elf_howto_table): Add R_386_IRELATIVE.
244         (elf_i386_reloc_type_lookup): Likewise.
245         (R_386_tls): Removed.
246         (R_386_irelative): New.
247         (R_386_vt_offset): Updated.
248         (elf_i386_rtype_to_howto): Likewise.
249         (elf_i386_link_hash_table): Add igotplt, iplt and irelplt.
250         (elf_i386_link_hash_table_create): Initialize igotplt,
251         iplt and irelplt.
252         (elf_i386_check_relocs): Handle STT_GNU_IFUNC symbol first.
253         (elf_i386_adjust_dynamic_symbol): Likewise.
254         (elf_i386_allocate_dynrelocs): Likewise.
255         (elf_i386_relocate_section): Likewise.
256         (elf_i386_size_dynamic_sections): Set up .iplt and .igot.plt
257         sections.
258         (elf_i386_finish_dynamic_symbol): When building a static
259         executable, use .iplt, .igot.plt and .rel.iplt sections for
260         STT_GNU_IFUNC symbols.  Generate R_386_IRELATIVE relocation for
261         locally defined STT_GNU_IFUNC symbol.
262
263         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_IRELATIVE.
264         (x86_64_reloc_map): Likewise.
265         (R_X86_64_standard): Updated.
266         (elf64_x86_64_link_hash_table): Add igotplt, iplt and irelplt.
267         (elf64_x86_64_link_hash_table_create): Initialize igotplt,
268         iplt and irelplt.
269         (elf64_x86_64_check_relocs): Handle STT_GNU_IFUNC symbol first.
270         (elf64_x86_64_adjust_dynamic_symbol): Likewise.
271         (elf64_x86_64_allocate_dynrelocs): Likewise.
272         (elf64_x86_64_relocate_section): Likewise.
273         (elf64_x86_64_size_dynamic_sections): Set up .iplt and .igot.plt
274         sections.
275         (elf64_x86_64_finish_dynamic_symbol): When building a static
276         executable, use .iplt, .igot.plt and .rela.iplt sections for
277         STT_GNU_IFUNC symbols.  Generate R_X86_64_IRELATIVE relocation
278         for locally defined STT_GNU_IFUNC symbol.
279
280         * reloc.c (BFD_RELOC_386_IRELATIVE): New.
281         (BFD_RELOC_X86_64_IRELATIVE): Likewise.
282
283         * bfd-in2.h: Regenerated.
284         * libbfd.h: Likewise.
285
286 2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>
287
288         * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs.
289         (_bfd_elf_make_ifunc_reloc_section): Removed.
290         (_bfd_elf_is_ifunc_symbol): Likewise.
291         (_bfd_elf_create_static_ifunc_sections): New.
292
293         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC
294         symbol check to ...
295         (elf_link_add_object_symbols): Here.
296         (_bfd_elf_link_hash_hide_symbol): Don't clean plt on
297         STT_GNU_IFUNC symbol.
298         (elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol
299         if a STT_GNU_IFUNC symbol is referenced in a non-shared object.
300         (IFUNC_INFIX): Removed.
301         (get_ifunc_reloc_section_name): Likewise.
302         (_bfd_elf_make_ifunc_reloc_section): Likewise.
303         (_bfd_elf_is_ifunc_symbol): Likewise.
304         (_bfd_elf_create_static_ifunc_sections): New.
305
306 2009-05-29  H.J. Lu  <hongjiu.lu@intel.com>
307
308         * elf32-i386.c (link_hash_newfunc): Add elf_i386_ prefix.
309         (create_got_section): Likewise.
310         (allocate_dynrelocs): Likewise.
311         (readonly_dynrelocs): Likewise.
312         (set_tls_module_base): Likewise.
313         (dtpoff_base): Likewise.
314         (tpoff): Likewise.
315         (elf_i386_link_hash_table_create): Updated.
316         (elf_i386_create_dynamic_sections): Likewise.
317         (elf_i386_check_relocs): Likewise.
318         (elf_i386_size_dynamic_sections): Likewise.
319         (elf_i386_relocate_section): Likewise.
320
321         * elf64-x86-64.c (link_hash_newfunc): Add elf64_x86_64_ prefix.
322         (create_got_section): Likewise.
323         (allocate_dynrelocs): Likewise.
324         (readonly_dynrelocs): Likewise.
325         (set_tls_module_base): Likewise.
326         (dtpoff_base): Likewise.
327         (tpoff): Likewise.
328         (elf64_x86_64_link_hash_table_create): Updated.
329         (elf64_x86_64_create_dynamic_sections): Likewise.
330         (elf64_x86_64_check_relocs): Likewise.
331         (elf64_x86_64_size_dynamic_sections): Likewise.
332         (elf64_x86_64_relocate_section): Likewise.
333
334 2009-05-28  Nick Clifton  <nickc@redhat.com>
335
336         * targets.c (_bfd_target_vector): Only include plugin target in
337         all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.
338
339 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
340
341         * elf32-spu.c (struct call_info): New member broken_cycle.
342         (remove_cycle): Instead of physically removing call_info structures
343         to break call graph cycles, mark them using the broken_cycle flag.
344         (mark_overlay_section): Respect broken_cycle flag.
345         (unmark_overlay_section): Likewise.
346         (collect_lib_sections): Likewise.
347         (collect_overlays): Likewise.
348         (sum_stack): Likewise.
349
350 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
351
352         * elf32-spu.c (insert_callee): Accumulate incoming callee->count.
353         (mark_functions_via_relocs): Initialize callee->count to 1.
354         (pasted_function): Likewise.
355         (spu_elf_auto_overlay): Honor call counts when determining number
356         of stubs required in software i-cache mode.
357
358 2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
359
360         * plugin.c (program_name): Remove.
361         (plugin_program_name): New.
362         (bfd_plugin_set_program_name): New.
363         (try_load_plugin): Use plugin_program_name.
364         * plugin.h (bfd_plugin_set_program_name): New.
365
366 2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
367
368         * aclocal.m4: Include ../config/plugins.m4.
369         * configure.in: Use AC_PLUGINS.
370         * configure: Regenerate.
371         * Makefile.in: Regenerate.
372         * doc/Makefile.in: Regenerate.
373
374 2009-05-27  Nathan Sidwell  <nathan@codesourcery.com>
375
376         * elf32-ppc.c (ppc_elf_relax_section): Work with a partial
377         link.
378         * bout.c (b_out_bfd_relax_section): Reject relocatable links.
379         * elf32-m10300.c (mn10300_elf_relax_section): Likewise.
380         * elf32-avr.c (elf32_avr_relax_section): Likewise.
381         * elf32-frv.c (elf32_avr_relax_section): Likewise.
382         * elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
383         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
384         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
385         * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
386         * reloc.c (bfd_generic_relax_section): Likewise.
387         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
388         * vms.c (vms_bfd_relax_section): Likewise.
389
390 2009-05-26  H.J. Lu  <hongjiu.lu@intel.com>
391
392         * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New.
393
394         * elf32-i386.c (is_indirect_symbol): Renamed to ...
395         * elflink.c (_bfd_elf_is_ifunc_symbol): This.
396
397         * elf32-i386.c (allocate_dynrelocs): Updated.
398         (elf_i386_relocate_section): Likewise.
399         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
400         (elf64_x86_64_relocate_section): Likewise.
401
402         * elf64-x86-64.c (is_indirect_symbol): Removed.
403
404 2009-05-26  Nick Clifton  <nickc@redhat.com>
405
406         * po/id.po: Updated Indonesian translation.
407
408 2009-05-26  Rafael Avila de Espindola  <espindola@google.com>
409
410         * Makefile.am: Run "make dep-am".
411         (AM_CPPFLAGS): New.
412         (LIBDL): New.
413         (ALL_MACHINES): Add cpu-plugin.lo.
414         (ALL_MACHINES_CFILES): Add cpu-plugin.c.
415         (BFD32_BACKENDS): Add plugin.lo.
416         (BFD32_BACKENDS_CFILES): Add plugin.c.
417         (libbfd_la_LIBADD): Add LIBDL
418         * archures.c (bfd_architecture): Add bfd_arch_plugin.
419         (bfd_plugin_arch): Declare.
420         * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
421         * bfd.c (bfd): Add plugin_data.
422         * config.bfd: Handle the plugin target.
423         * configure.in: Check for --enable-plugins.
424         (LT_INIT): Use the dlopen option.
425         * cpu-plugin.c: New.
426         * plugin.c: New.
427         * plugin.h: New.
428         * targets.c (plugin_vec): Declare.
429         (_bfd_target_vector): Add plugin_vec.
430         * Makefile.in: Regenerate.
431         * bfd-in2.h: Regenerate.
432         * configure: Regenerate.
433
434 2009-05-26  Alan Modra  <amodra@bigpond.net.au>
435
436         * dep-in.sed: Don't modify .o to .lo here.  Output one filename
437         per line with all lines having continuation backslash.  Prefix
438         first line with "A", following lines with "B".
439         * Makefile.am (DEP): Don't use dep.sed here.
440         (DEP1): Run $MKDEP on single files, modify .o to .lo here.  Use
441         dep.sed here on dependencies, sort and uniq.
442         * Makefile.in: Regenerate.
443
444 2009-05-25  Tristan Gingold  <gingold@adacore.com>
445
446         * makefile.vms: Add verilog.obj to object list OBJS.
447
448 2009-05-24  Alan Modra  <amodra@bigpond.net.au>
449
450        * bfdio.c (bfd_seek): Formatting.  Ensure newly allocated memory
451        for BFD_IN_MEMORY is cleared.
452        (bfd_bwrite): Zero excess memory allocated.
453
454 2009-05-22  Julian Brown  <julian@codesourcery.com>
455
456         * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
457         macros.
458         (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
459         (elf32_arm_stub_a8_veneer_blx): New stub sequences.
460         (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
461         arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
462         (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
463         (a8_erratum_fix, a8_erratum_reloc): New structs.
464         (elf32_arm_link_hash_table): Add a8_erratum_fixes,
465         num_a8_erratum_fixes, fix_cortex_a8 fields.
466         (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
467         (elf32_arm_add_stub): Split into two parts, creating...
468         (elf32_arm_create_or_find_stub_sec): New function.
469         (elf32_arm_final_link_relocate): Add forward declaration.
470         (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
471         relocations, multiple relocations per stub.
472         (find_stub_size_and_template): New (using parts of arm_size_one_stub).
473         (arm_size_one_stub): Use find_stub_size_and_template.
474         (a8_reloc_compare): New.
475         (find_thumb_glue): Add forward declaration.
476         (cortex_a8_erratum_scan): New.
477         (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
478         (bfd_elf32_arm_set_cortex_a8_fix): New.
479         (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
480         (arm_map_one_stub): Add THUMB32_TYPE support.
481         (a8_branch_to_stub_data): New.
482         (make_branch_to_a8_stub): New.
483         (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
484         * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
485         (bfd_elf32_arm_set_target_relocs): Add argument for controlling
486         Cortex-A8 erratum workaround.
487         * bfd-in2.h: Regenerate.
488
489 2009-05-22  Alan Modra  <amodra@bigpond.net.au>
490
491         * Makefile.am: Run "make dep-am".
492         * Makefile.in: Regenerate.
493         * po/SRC-POTFILES.in: Regenerate.
494
495 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
496
497         * elflink.c (elf_link_input_bfd): Correct *pindex change in last
498         commit.
499
500 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
501
502         * elf-bfd.h (struct elf_backend_data
503         <elf_backend_link_output_symbol_hook>): Return an int.
504         * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
505         symbols on deleted .opd entries.
506         * elflink.c (elf_link_output_sym): Return without outputting sym
507         if output_symbol_hook returns 2.
508         (elf_link_output_extsym): Don't assign h->indx when symbol discarded.
509         Abort if we must not discard sym.
510         (elf_link_input_bfd): Similarly, don't set finfo->indices for
511         local syms.
512         (bfd_elf_final_link): Adjust elf_link_output_sym calls.
513         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
514         elf_backend_link_output_symbol_hook return type change.
515         * elf32-arm.c (output_arch_syminfo): Likewise.
516         (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
517         (elf32_arm_output_arch_local_syms): Likewise.
518         * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
519         * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
520         (bfd_score_elf_link_output_symbol_hook): Likewise.
521         * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
522         * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
523         * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
524         * elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
525         * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
526         * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
527         * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
528         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
529         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
530         * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
531         * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
532
533 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
534
535         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
536         out of range .opd symbols.
537
538 2009-05-21  Dave Korn  <dave.korn.cygwin@gmail.com>
539
540         * coffgen.c (coff_print_symbol):  Use bfd_fprintf_vma, not
541         fprintf_vma directly.
542         * peXXigen.c (pe_print_edata):  Likewise.
543         (pe_print_pdata):  Likewise.
544         (_bfd_XX_print_ce_compressed_pdata):  Likewise.
545         (_bfd_XX_print_private_bfd_data_common):  Likewise.
546
547 2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>
548
549         * cofflink.c (process_embedded_commands):  Ignore "-aligncomm".
550
551 2009-05-15  Andrew Stubbs  <ams@codesourcery.com>
552             Paul Brook  <paul@codesourcery.com>
553
554         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
555         fix discarded sections.
556
557 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
558
559         * elf32-spu.c (mark_overlay_section): Move .init and .fini
560         sections into the software icache.
561
562 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
563
564         * elf32-spu.c (build_stub): Always build "compact" sofware
565         i-cache stubs.
566
567 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
568
569         * elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
570         (spu_elf_setup): Initialize it.
571         (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
572         Update to new-sytle cache manager data structures.
573         (spu_elf_build_stubs): Generate new-style cache manager data
574         structures and symbols.
575         (spu_elf_auto_overlay): Update size computation.
576
577 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
578
579         * elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
580         segments first amongst the program headers.
581
582 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
583
584         * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index
585         into addresses for relocation types that look at high bits.  Remove
586         special handling of relocation overflow warnings.
587
588 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
589
590         * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the
591         control flow graph between fragments of a function.
592
593 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
594
595         * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,
596         generate only a 16-byte .toe section.
597         (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
598
599 2009-05-14  Alan Modra  <amodra@bigpond.net.au>
600
601         * elf32-spu.c (spu_elf_size_stubs): Split out section placement to..
602         (spu_elf_place_overlay_data): ..here.  New function.
603         * elf32-spu.h (spu_elf_place_overlay_data): Declare.
604
605 2009-05-13  Andrew Jenner  <andrew@codesourcery.com>
606
607         * elf32-arm.c: Move sysdep.h to start of file.
608
609 2009-05-11  Ulrich Weigand  <uweigand@de.ibm.com>
610
611         * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
612         start of overlays.
613         (spu_elf_build_stubs): Don't define __icache_tagbase.  Define
614         __icache_tag_array and __icache_tag_array_size.
615
616 2009-05-11  Masaki Muranaka  <monaka@monami-software.com>
617
618         * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Remove unnecessary
619         ATTRIBUTE_UNUSED.
620         (bfinfdpic_link_omit_section_dynsym): Likewise.
621         (elf32_bfinfdpic_finish_dynamic_sections): Likewise.
622
623 2009-05-05  Paul Brook  <paul@codesourcery.com>
624
625         * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
626         * bfd-in2.h: Regenerate.
627         * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
628         (_arm_elf_section_data): Add text and exidx fields.
629         (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
630         insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
631         copy_exidx_entry): New functions.
632         (elf32_arm_write_section): Fixup .ARM.exidx contents.
633
634 2009-05-05  Christophe lyon  <christophe.lyon@st.com>
635
636         * elf32-arm.c (DEF_STUBS): New helper define.
637         (DEF_STUB): Likewise.
638         (stub_def): New type.
639         (stub_definitions): New array, containing stub template pointers
640         and sizes.
641         (arm_size_one_stub): Make use of stub_definitions.
642
643 2009-05-04  Dave Korn  <dave.korn.cygwin@gmail.com>
644
645         * elflink.c (find_version_for_sym):  Remove from here, ...
646         * linker.c (bfd_find_version_for_sym):  ... rename, replace
647         here, make public and update all callers.
648         * bfd-in2.h:  Regenerate.
649
650 2009-04-30  Nick Clifton  <nickc@redhat.com>
651
652         * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
653         section pointer.
654         (struct elf_obj_data): Add has_ifunc_symbols boolean.
655         * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
656         into a STT_GNU_IFUNC symbol type.
657         (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
658         type.
659         (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
660         the binary contains ifunc symbols.
661         * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
662         symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
663         * elf32-i386.c (is_indirect_function): New function.
664         (elf_i386_check_relocs): Create an ifunc output section.
665         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
666         section if necessary.
667         (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
668         if necessary.
669         (elf_i386_add_symbol_hook): New function. Set the
670         has_ifunc_symbols field of the elf_obj_data structure if an ifunc
671         symbol is encountered.
672         (elf_backend_post_process_headers): Define.
673         (elf_backend_add_symbol_hook): Define.
674         (elf_i386_post_process_headers): Rename to
675         elf_i388_fbsd_post_process_headers.
676         * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
677         (is_indirect_function): New function.
678         (elf64_x86_64_check_relocs): Create an ifunc output section.
679         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
680         section if necessary.
681         (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
682         symbol if necessary.
683         (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
684         elf_obj_data structure if an ifunc symbol is encountered.
685         (elf_backend_post_process_headers): Define.
686         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
687         if we have ifunc symbols to handle.
688         (get_ifunc_reloc_section_name): New function.  Computes the name
689         for an ifunc section.
690         (_bfd_elf_make_ifunc_reloc_section): New function.  Creates a
691         section to hold ifunc relocs.
692         * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
693         (bfd_print_symbol_vandf): Handle ifunc symbols.
694         (bfd_decode_symclass): Likewise.
695         * bfd-in2.h: Regenerate.
696
697 2009-04-30  Joseph Myers  <joseph@codesourcery.com>
698
699         * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
700         MOVW and MOVT relocations in a shared library link.
701
702 2009-04-27  Anthony Green  <green@moxielogic.com>
703
704         * verilog.c: New file.
705         * Makefile.am (BFD32_LIBS): Add verilog.c.
706         (BFD32_LIBS_CFILES): Add verilog.c.
707         (verilog.lo): New build rule.
708         * Makefile.in: Rebuilt.
709         * targets.c: Add verilog support.
710         * bfd.c (tdata union): Add Verilog private data field.
711         * bfd-in2.h: Regenerate.
712
713 2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>
714
715         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
716         copy pe_opthdr.
717
718 2009-04-23  Matthias Klose  <doko@ubuntu.com>
719
720         * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
721
722 2009-04-22  Christophe Lyon  <christophe.lyon@st.com>
723
724         PR9743
725         * elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24,
726         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
727         (elf32_arm_size_stubs): Likewise.
728         (record_thumb_to_arm_glue): Deleted unused function.
729         (bfd_elf32_arm_process_before_allocation): No longer handle
730         R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here.
731         (elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24,
732         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
733
734 2009-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
735
736         * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED.
737         (elf32_arm_write_section): Declare early.
738         (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD.
739         (arm_allocate_glue_section_space): Exclude empty sections.
740         (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED.
741         (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub
742         BFD.
743         (elf32_arm_output_glue_section, elf32_arm_final_link): New.
744         (elf32_arm_merge_eabi_attributes): Skip the stub BFD.
745         (elf32_arm_size_dynamic_sections): Allocate interworking
746         sections here.
747         (bfd_elf32_bfd_final_link): Define.
748
749 2009-04-21  H.J. Lu  <hongjiu.lu@intel.com>
750
751         * coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K.
752
753         * coffcode.h (coff_compute_section_file_positions): Clear
754         D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE.
755
756         * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and
757         force_minimum_alignment.
758
759         * libcoff.h: Regenerated.
760
761         * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed.
762         (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise.
763
764         * peicode.h (pe_mkobject): Don't set force_minimum_alignment
765         nor target_subsystem.
766
767         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check
768         force_minimum_alignment nor target_subsystem.
769
770 2009-04-21  Kai Tietz  <kai.tietz@onevision.com>
771
772         * coff-x86_64.c (PEI_HEADERS): Protect includes.
773         (bfd_pe_print_pdata): Remove #ifdef PE variation.
774         * pei-x86_64.c (PEI_HEADERS): Define to prevent double
775         include in coff-x86_64.c of headers.
776         (PDATA_ROW_SIZE): New define.
777         (pex_regs[]): New static array.
778         (pex64_get_runtime_function): New static function.
779         (pex64_get_unwind_info): Likewise.
780         (pex64_get_scope_entry): Likewise.
781         (pex64_xdata_print_uwd_codes): Likewise.
782         (pex64_get_section_by_rva): Likewise.
783         (pex64_dump_xdata): Likewise.
784         (pex64_bfd_print_pdata): Likewise.
785         (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata.
786         * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation.
787         * libpei.h (_bfd_pex64_print_pdata): Removed declaration.
788
789 2009-04-19  Peter O'Gorman  <binutils@mlists.thewrittenword.com>
790             Alan Modra  <amodra@bigpond.net.au>
791             Dave Korn  <dave.korn.cygwin@gmail.com>
792
793         * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t
794         long names and non-NUL-terminated strings.
795
796 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
797
798         * bfd-in2.h: Regenerated.
799
800 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
801
802         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace
803         IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER.
804
805 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
806
807         PR binutils/10074
808         * coffcode.h (bfd_pei_p): New.
809
810         * config.bfd: Remove bfd_efi_bsdrv_ia32_vec,
811         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
812         bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and
813         bfd_efi_rtdrv_ia64_vec.  Replace bfd_efi_app_ia32_vec,
814         bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with
815         i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively.
816
817         * configure.in: Remove bfd_efi_bsdrv_ia32_vec,
818         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
819         bfd_efi_rtdrv_x86_64_vec,
820         bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec.  Replace
821         bfd_efi_ia64_vec with bfd_pei_ia64_vec.
822         * targets.c: Likewise.
823
824         * configure: Regenerated.
825         * libcoff.h: Likewise.
826         * Makefile.in: Likewise.
827
828         * efi-app-ia32.c: Removed.
829         * efi-app-x86_64.c: Likewise.
830         * efi-bsdrv-ia32.c: Likewise.
831         * efi-bsdrv-ia64.c: Likewise.
832         * efi-bsdrv-x86_64.c: Likewise.
833         * efi-rtdrv-ia32.c: Likewise.
834         * efi-rtdrv-ia64.c: Likewise.
835         * efi-rtdrv-x86_64.c: Likewise.
836         * efi-rtdrv-ia32.c: Likewise.
837
838         * efi-app-ia64.c: Moved to ...
839         * pei-ia64.c: This.
840         (TARGET_SYM): Set to bfd_pei_ia64_vec.
841         (TARGET_NAME): Set to pei-ia64.
842
843         * libpei.h (bfd_target_pei_p): Removed.
844         (bfd_target_pei_arch): Likewise.
845         (bfd_target_efi_app_p): Likewise.
846         (bfd_target_efi_app_arch): Likewise.
847         (bfd_target_efi_bsdrv_p): Likewise.
848         (bfd_target_efi_bsdrv_arch): Likewise.
849         (bfd_target_efi_rtdrv_p): Likewise.
850         (bfd_target_efi_rtdrv_arch): Likewise.
851         (bfd_pe_executable_p): Likewise.
852
853         * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo,
854         efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo.
855         (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c
856         and efi-rtdrv-ia32.c.
857         (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo,
858         efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and
859         efi-rtdrv-x86_64.lo. Add pei-ia64.lo.
860         (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c,
861         efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and
862         efi-rtdrv-x86_64.c. Add pei-ia64.c.
863         (efi-app-ia64.lo): Removed.
864         (efi-bsdrv-ia32.lo): Likewise.
865         (efi-rtdrv-ia32.lo): Likewise.
866         (efi-app-ia64.lo): Likewise.
867         (efi-bsdrv-ia64.lo): Likewise.
868         (efi-rtdrv-ia64.lo): Likewise.
869         (efi-app-x86_64.lo): Likewise.
870         (efi-bsdrv-x86_64.lo): Likewise.
871         (efi-rtdrv-x86_64.lo): Likewise.
872         (pei-ia64.lo): New.
873
874         * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p
875         with bfd_pei_p.
876         (arch_type): Removed.
877         (pe_arch): Likewise.
878         (pe_bfd_object_p): Just return coff_object_p.
879
880         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace
881         bfd_pe_executable_p with bfd_pei_p.
882
883 2009-04-17  Christophe Lyon  <christophe.lyon@st.com>
884
885         * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through
886         PLT entries to an undefined symbol when generating a shared
887         library.
888
889 2009-04-17  Nick Clifton  <nickc@redhat.com>
890
891         PR 9909
892         * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.
893
894 2009-04-16  Richard Sandiford  <r.sandiford@uk.ibm.com>
895
896         * aout-adobe.c (aout_32_bfd_define_common_symbol): Define.
897         * aout-target.h (MY_bfd_define_common_symbol): Likewise.
898         * aout-tic30.c (MY_bfd_define_common_symbol): Likewise.
899         * binary.c (binary_bfd_define_common_symbol): Likewise.
900         * bout.c (b_out_bfd_define_common_symbol): Likewise.
901         * coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
902         * coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
903         * coffcode.h (coff_bfd_define_common_symbol): Likewise.
904         * elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise.
905         * i386msdos.c (msdos_bfd_define_common_symbol): Likewise.
906         * i386os9k.c (os9k_bfd_define_common_symbol): Likewise.
907         * ieee.c (ieee_bfd_define_common_symbol): Likewise.
908         * ihex.c (ihex_bfd_define_common_symbol): Likewise.
909         * libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise.
910         * mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise.
911         * mmo.c (mmo_bfd_define_common_symbol): Likewise.
912         * nlm-target.h (nlm_bfd_define_common_symbol): Likewise.
913         * oasys.c (oasys_bfd_define_common_symbol): Likewise.
914         * pef.c (bfd_pef_bfd_define_common_symbol): Likewise.
915         * ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise.
916         * som.c (som_bfd_define_common_symbol): Likewise.
917         * srec.c (srec_bfd_define_common_symbol): Likewise.
918         * tekhex.c (tekhex_bfd_define_common_symbol): Likewise.
919         * versados.c (versados_bfd_define_common_symbol): Likewise.
920         * vms.c (vms_bfd_define_common_symbol): Likewise.
921         * xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise.
922         * xsym.c (bfd_sym_bfd_define_common_symbol): Likewise.
923         * coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol.
924         (pmac_xcoff_vec): Likewise.
925         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
926         (aix5coff64_vec): Likewise.
927         * linker.c (bfd_generic_define_common_symbol): New function.
928         * targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol.
929         (_bfd_define_common_symbol): New field.
930         * libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare.
931         * xcofflink.c (_bfd_xcoff_define_common_symbol): New function.
932         (xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common
933         symbols here.
934         * bfd-in2.h: Regenerate.
935         * libbfd.h: Likewise.
936         * libcoff.h: Likewise.
937
938 2009-04-15  Anthony Green  <green@moxielogic.com>
939
940         * targets.c: Add moxie support.
941         * Makefile.am: Ditto.
942         * Makefile.in: Rebuilt.
943         * cpu-moxie.c, elf32-moxie.c: New files.
944         * archures.c: Add moxie support.
945         * configure.in: Add moxie support.
946         * configure: Rebuilt.
947         * config.bfd, archures.c: Add moxie support.
948         * bfd-in2.h: Rebuilt.
949
950 2009-04-15  Christophe Lyon  <christophe.lyon@st.com>
951
952         * elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM
953         branch to an undef weak symbol into a jump to next instruction if
954         a PLT entry will be created.
955
956 2009-04-14  Dave Korn  <dave.korn.cygwin@gmail.com>
957
958         * coffgen.c (make_a_section_from_file):  Set the backend long
959         section names enable if long section names found on input.
960         * coffcode.h:  Extend long section names documentation to match.
961
962 2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>
963
964         * elflink.c (elf_link_add_object_symbols): Warn alternate ELF
965         machine code.
966
967 2009-04-07  DJ Delorie  <dj@redhat.com>
968
969         * archures.c: Add bfd_mach_mep_c5.
970         * bfd-in2.h: Likewise.
971         * cpu-mep.c: Add bfd_c5_arch.
972         * elf32-mep.c: Support it.
973
974 2009-04-07  H.J. Lu  <hongjiu.lu@intel.com>
975
976         * elflink.c (_bfd_elf_section_already_linked): Add `\n' for
977         info->callbacks->einfo.
978         * linker.c (_bfd_generic_section_already_linked): Likewise.
979
980 2009-04-06  DJ Delorie  <dj@redhat.com>
981
982         * elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes.
983
984 2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>
985
986         * coff-x86_64.c (bfd_pe_print_pdata): Defined to
987         _bfd_pex64_print_pdata only if PE is defined.
988
989         * libpei.h (_bfd_pep_print_x64_pdata): Renamed to ...
990         (_bfd_pex64_print_pdata): This.
991
992         * peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ...
993         (_bfd_pex64_print_pdata): This.  Defined only if COFF_WITH_pex64
994         is defined.
995
996 2009-04-05  Kai Tietz  <kai.tietz@onevision.com>
997
998         * coff-x86_64.c (bfd_pe_print_pdata): Define as
999         _bfd_pep_print_x64_pdata.
1000         * libpei.h (_bfd_pep_print_x64_pdata): Add prototype.
1001         * peXXigen.c (_bfd_pep_print_x64_pdata): New.
1002
1003 2009-04-02  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
1004
1005         * elf32-xtensa.c (relax_property_section): Always set r_offset
1006         to zero.
1007
1008 2009-04-02  Christophe Lyon  <christophe.lyon@st.com>
1009
1010         * elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb,
1011         elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long
1012         branch stubs.
1013         (elf32_arm_stub_type): New enum values for the two new stubs.
1014         (arm_type_of_stub): Make use of the two new stubs.
1015         (arm_size_one_stub): Handle the two new stubs.
1016
1017 2009-04-01  Matt Thomas  <matt@netbsd.org>
1018
1019         * elf32-vax.c (elf_vax_check_relocs): Do not put relocations against
1020         hidden symbols into the GOT or PLT.GOT.
1021         (elf_vax_relocate_section): Do not emit a PCREL reloc
1022         into a shared object if it is against a hidden symbol.
1023
1024 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
1025
1026         * xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
1027         and know_contains_shared_object_p.
1028         (xcoff_archive_contains_shared_object_p): Add an "info" parameter.
1029         Cache the result in the archive_info table.
1030         (xcoff_auto_export_p): Add an "info" parameter and update the
1031         call to xcoff_archive_contains_shared_object_p.
1032         (xcoff_mark_auto_exports): Update accordingly.
1033         (xcoff_post_gc_symbol): Likewise.
1034
1035 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
1036
1037         * xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
1038         rather than C_EXT.
1039
1040 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
1041
1042         * coff-rs6000.c (member_layout): New structure.
1043         (archive_iterator): Likewise.
1044         (member_layout_init): New function.
1045         (archive_iterator_begin): Likewise.
1046         (archive_iterator_next): Likewise.
1047         (xcoff_write_armap_old): Use the new iterator functions.
1048         (do_shared_object_padding): Delete.
1049         (xcoff_write_armap_big): Use the new iterator functions.  Simplify
1050         handling of arch_info.
1051         (xcoff_write_archive_contents_old): Allocate arelt_data in the
1052         first loop rather than the second.  Allocate a member header if
1053         there isn't one, then work out the stat information and length
1054         in the first loop too.  Use the new iterators for the second loop.
1055         (xcoff_write_archive_contents_big): Likewise.
1056
1057 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
1058
1059         * bfd-in.h (bfd_xcoff_split_import_path): Declare.
1060         (bfd_xcoff_set_archive_import_path): Likewise.
1061         * bfd-in2.h: Regenerate.
1062         * xcofflink.c: Include libiberty.h.
1063         (xcoff_archive_info): New structure.
1064         (xcoff_archive_info_hash): New function.
1065         (xcoff_archive_info_eq): Likewise.
1066         (xcoff_get_archive_info): Likewise.
1067         (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info.
1068         (bfd_xcoff_split_import_path): New function.
1069         (bfd_xcoff_set_archive_import_path): Likewise.
1070         (xcoff_set_import_path): Move earlier in file.
1071         (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive
1072         object to the the directory part of the bfd's filename.  Get the
1073         import path and filename of an archive object from the archive's
1074         xcoff_tdata, initializing it if necessary.  Update use of
1075         import_file_id.
1076         (bfd_link_input_bfd): Update use of import_file_id.
1077         (xcoff_write_global_symbol): Likewise.
1078
1079 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
1080
1081         * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
1082
1083 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
1084
1085         * xcofflink.c (xcoff_link_create_extra_sections): Don't create
1086         a .loader section for relocatable links.
1087         (xcoff_need_ldrel_p): New function.
1088         (xcoff_mark): Use it.
1089         (bfd_xcoff_link_count_reloc): Only count loader relocs if there's
1090         a loader section.
1091         (xcoff_build_ldsym): New function, split out from...
1092         (xcoff_build_ldsyms): ...here.  Rename to...
1093         (xcoff_post_gc_symbol): ...this.  Only export symbols, and only
1094         call xcoff_build_ldsym, if there's a loader section.
1095         (xcoff_build_loader_section): New function, extracted verbatim from...
1096         (bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
1097         there's a loader section.  Only add an __rtinit loader symbol
1098         if there's a loader section.  Update after above name change.
1099         (xcoff_symbol_section, xcoff_create_ldrel): New functions.
1100         (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
1101         and xcoff_create_ldrel.
1102         (xcoff_write_global_symbol): Use xcoff_create_ldrel.
1103         (xcoff_reloc_link_order): Likewise, but only call it if there's
1104         a loader section.  Use xcoff_symbol_section.
1105         (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
1106         if there's a loader section.
1107
1108 2009-04-01  Richard Sandiford  <rdsandiford@googlemail.com>
1109
1110         * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
1111
1112 2009-04-01  Christophe Lyon  <christophe.lyon@st.com>
1113
1114         * elf32-arm.c (group_sections): Rewrite loops for better
1115         readability.
1116
1117 2009-03-30  DJ Delorie  <dj@redhat.com>
1118
1119         * elflink.c (elf_link_input_bfd): Don't try to resolve complex
1120         relocs when doing a relocatable link.
1121
1122 2009-03-28  Mark Mitchell  <mark@codesourcery.com>
1123
1124         * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
1125         "ERROR:", in error messages.
1126         * cpu-arm.c (bfd_arm_merge_machines): Likewise.
1127         * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
1128         * elf32-arm.c (tag_cpu_arch_combine): Likewise.
1129         (elf32_arm_merge_eabi_attributes): Likewise.
1130         (elf32_arm_merge_private_bfd_data): Likewise.
1131
1132 2009-03-27  Nick Clifton  <nickc@redhat.com>
1133
1134         * section.c (bfd_get_section_contents): Detect and handle the case
1135         where a section has the SEC_IN_MEMORY flag set but no actual
1136         contents allocated.
1137
1138 2009-03-26  Alan Modra  <amodra@bigpond.net.au>
1139
1140         PR 6494
1141         * elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO
1142         p_filesz and p_memsz are equal.  Use p_memsz as the segment size.
1143         (assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO
1144         if we don't find matching PT_LOAD when copying.
1145
1146 2009-03-25  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
1147
1148         * elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
1149         the reloc descriptions.
1150
1151 2009-03-25  Hans-Peter Nilsson  <hp@axis.com>
1152
1153         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
1154         <R_CRIS_16_GOT_GD, case R_CRIS_32_GOT_GD>: Handle COMMON symbols.
1155         <case R_CRIS_16_TPREL, R_CRIS_32_TPREL>: Ditto.
1156
1157 2009-03-24  H.J. Lu  <hongjiu.lu@intel.com>
1158
1159         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static.
1160         (bfd_i386_arch_intel_syntax): Likewise.
1161         (i8086_arch): Likewise.
1162         (bfd_x86_64_arch): Likewise.
1163
1164 2009-03-24  Hans-Peter Nilsson  <hp@axis.com>
1165
1166         * elf32-cris.c (cris_elf_relocate_section): <case
1167         R_CRIS_16_DTPREL, R_CRIS_32_DTPREL>: Allow use of non-local
1168         symbols for non-allocated sections.  Don't check whether to
1169         generate R_CRIS_DTPMOD for non-allocated sections.
1170         (cris_elf_gc_sweep_hook) <case R_CRIS_32_DTPREL>: Don't
1171         handle relocation GC:ing if applied to non-allocated section.
1172         (cris_elf_check_relocs): Similar.
1173
1174         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
1175         <R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: Don't include the TLS size
1176         when emitting a known TP offset in the GOT.
1177
1178 2009-03-23  Alan Modra  <amodra@bigpond.net.au>
1179
1180         * elf64-ppc.c (synthetic_opd): Delete.
1181         (compare_symbols): Look for .opd name rather than section match.
1182         (ppc64_elf_get_synthetic_symtab): Likewise.
1183
1184 2009-03-21  Alan Modra  <amodra@bigpond.net.au>
1185
1186         * elf32-ppc.c (is_pic_glink_stub): Delete.
1187         (is_nonpic_glink_stub): New function.
1188         (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather
1189         than first pic one.
1190         (struct ppc_elf_link_hash_table <glink_pltresolve>): Comment fix.
1191
1192 2009-03-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1193             Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1194
1195         * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_*
1196         macros for visibilty and locality checks.
1197         (elf_s390_adjust_dynamic_symbol): Likewise.
1198         (allocate_dynrelocs): Likewise.
1199         (elf_s390_relocate_section): Likewise.
1200         (elf_s390_finish_dynamic_symbol): Likewise.
1201         * elf64-s390.c (elf_s390_check_relocs): Likewise.
1202         (elf_s390_adjust_dynamic_symbol): Likewise.
1203         (allocate_dynrelocs): Likewise.
1204         (elf_s390_relocate_section): Likewise.
1205         (elf_s390_finish_dynamic_symbol): Likewise.
1206
1207 2009-03-19  Kai Tietz  <kai.tietz@onevision.com>
1208
1209         * bfd-in2.h: Regenerated.
1210         * coffcode.h (sec_to_styp_flags): For pe-coff add SEC_READONLY
1211         for debugging sections and map memory read/write dependent on
1212         SEC_COFF_NOREAD.
1213         (styp_to_sec_flags): Set SEC_COFF_NOREAD for sections
1214         without memory read flags set.
1215         * section.c: Add SEC_COFF_NOREAD to section flags.
1216
1217 2009-03-19  Andreas Schwab  <schwab@linux-m68k.org>
1218
1219         * elf32-hppa.c (final_link_relocate): Cast bfd_vma values to long
1220         for format string.
1221
1222 2009-03-19  Alan Modra  <amodra@bigpond.net.au>
1223
1224         * elf32-spu.c (spu_elf_find_overlays): Separate error return from
1225         "no overlays" return.  If there are overlays, create overlay
1226         manager entry symbols here, so that..
1227         (spu_elf_build_stubs): ..we don't need to set them up here.
1228         Simplify entry symbol tests.
1229         * elf32-spu.h (spu_elf_find_overlays): Update prototype.
1230
1231 2009-03-18  Mark Kettenis  <kettenis@gnu.org>
1232
1233         * elf.c (elfcore_grok_openbsd_procinfo)
1234         (elfcore_grok_openbsd_note): New functions.
1235         (elf_parse_notes): Handle notes from OpenBSD ELF core files.
1236
1237 2009-03-18  Alan Modra  <amodra@bigpond.net.au>
1238
1239         * vms-hdr.c: Don't include alloca.h.
1240         * elf32-m68hc1x.c: Include alloca-conf.h.
1241         * xsym.c: Likewise.
1242         * elf64-hppa.c: Likewise.  Remove existing #if's handling alloca.
1243         * som.c: Likewise.
1244         * Makefile.am: Run "make dep-am".
1245         * Makefile.in: Regenerate.
1246
1247 2009-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
1248
1249         * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test.
1250
1251 2009-03-17  Alan Modra  <amodra@bigpond.net.au>
1252
1253         * elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit.
1254         Add compact_stub.
1255         (emum _ovly_flavour): Delete ovly_compact, ovly_none.
1256         * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and
1257         ovly_return fields with ovly_entry[2].  Adjust all users.
1258         (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler
1259         when soft-icache.
1260         (spu_elf_build_stubs): Likewise.
1261         (ovl_stub_size): Change arg to spu_elf_params pointer.  Adjust for
1262         ovly_flavour changes.  Update all callers.
1263         (ovl_stub_size_log2): New function.
1264         (build_stub): Handle compact icache stubs.  Use different manager
1265         entry point for stubs in non-icache area.
1266         (spu_elf_size_stubs): Don't allocate space for indirect branch
1267         descriptors.
1268         (spu_elf_build_stubs): And don't built them.
1269
1270 2009-03-16  Andrew Stubbs  <ams@codesourcery.com>
1271
1272         * dwarf2.c (read_section): Always use rawsize, if available.
1273
1274 2009-03-16  Alan Modra  <amodra@bigpond.net.au>
1275
1276         * simple.c (bfd_simple_get_relocated_section_contents): Use larger
1277         of rawsize and size for buffer.
1278
1279 2009-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
1280
1281         * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay
1282         parameter just because fixed sections fit into local store.
1283         (spu_elf_auto_overlay): Do not declare as "noreturn".  Skip
1284         generating overlays if fixed sections plus reserved stack
1285         and heap space fit into local store.
1286
1287 2009-03-15  Alan Modra  <amodra@bigpond.net.au>
1288
1289         * elf32-spu.c (build_stub): Correct icache set_id.
1290         (spu_elf_relocate_section): Likewise.
1291
1292 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1293
1294         * xcofflink.c (xcoff_link_check_archive_element): Only free the
1295         symbol table if it was created by the current call.
1296
1297 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1298
1299         * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors
1300         class XMC_DS rather than XMC_UA.
1301
1302 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1303
1304         * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
1305         bfd_boolean export_defineds parameter with an unsigned int
1306         auto_export_flags parameter.
1307         * bfd-in2.h: Regenerate.
1308         * xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
1309         split out from xcoff_build_ldsyms.
1310         (xcoff_covered_by_expall_p): New function.
1311         (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
1312         but with extra code to handle -bexpfull and -bexpall.
1313         (xcoff_mark_auto_exports): New function.
1314         (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
1315         a function should be automatically exported.
1316         (bfd_xcoff_size_dynamic_sections): Replace the export_defineds
1317         parameter with an auto_export_flags parameter.  Update ldinfo
1318         accordingly.  Use xcoff_mark_auto_exports to mark all automatically-
1319         exported symbols.
1320
1321 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1322
1323         * xcofflink.c (xcoff_mark_symbol_by_name): New function.
1324         (bfd_xcoff_size_dynamic_sections): Use it to mark the entry,
1325         init and fini functions.  Do garbage collection for objects
1326         without an entry point too.
1327
1328 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1329
1330         * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
1331         check whether a symbol has csect information.
1332         (coff_print_aux): Likewise.
1333         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
1334         information for C_AIX_WEAKEXT too.
1335         (_bfd_xcoff_swap_aux_out): Likewise.
1336         (xcoff_reloc_type_br): Handle defweak symbols too.
1337         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
1338         information for C_AIX_WEAKEXT too.
1339         (_bfd_xcoff64_swap_aux_out): Likewise.
1340         (xcoff64_reloc_type_br): Handle defweak symbols too.
1341         * coffgen.c (coff_print_symbol): Handle auxillary function
1342         information for C_AIX_WEAKEXT too.
1343         * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
1344         instead of BSF_GLOBAL if the L_WEAK flag is set.
1345         (xcoff_dynamic_definition_p): New function.
1346         (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
1347         defines h.  Don't change h if ldsym isn't the definition.  Otherwise,
1348         always take the symbol class from the ldsym.  Use weak bfd symbol
1349         types for weak ldsyms.
1350         (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
1351         Fix the check for whether a definition is from a shared object.
1352         Allow redefinitions of weak symbols.
1353         (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
1354         (xcoff_keep_symbol_p): Likewise.
1355         (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
1356         (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
1357         Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
1358         but mark them as L_WEAK.
1359         (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
1360         instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.
1361
1362 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1363
1364         * xcofflink.c (xcoff_mark): When walking the relocations,
1365         only mark the target symbol or the target section, not both.
1366         (xcoff_final_definition_p): New function.
1367         (xcoff_keep_symbol_p): Use it to check whether an external XCOFF
1368         symbol is a valid definition of the associated output symbol.
1369         Use XCOFF_ALLOCATED to stop the same hash table entry having
1370         two output symbols.
1371         (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when
1372         keeping a symbol.
1373         (xcoff_link_input_bfd): Use xcoff_final_definition_p.
1374
1375 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1376
1377         * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute
1378         symbols as XMC_XO.
1379
1380 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1381
1382         * libcoff-in.h (xcoff_tdata): Add a lineno_counts field.
1383         * libcoff.h: Regenerate.
1384         * xcofflink.c (xcoff_link_add_symbols): Record per-symbol
1385         line-number counts in the bfd's lineno_counts field.
1386         Don't keep per-csect line-number counts.
1387         (xcoff_sweep): Don't update per-csect line-number counts.
1388         (bfd_xcoff_size_dynamic_sections): Count the number of line-number
1389         entries in each output section.
1390         (xcoff_link_input_bfd): Get the number of line numbers from
1391         the bfd's lineno_counts field, rather than recalculating it
1392         from scratch.  Fix the range check when updating C_BINCL and
1393         C_EINCL symbols.
1394         (_bfd_xcoff_bfd_final_link): Don't count the output line numbers
1395         here.  Don't expect csects to have line-number counts.
1396
1397 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1398
1399         * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
1400         * libcoff.h: Regenerate.
1401         * xcofflink.c (xcoff_keep_symbol_p): New function, using the
1402         "skip" logic from xcoff_link_input_bfd.
1403         (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
1404         objects in a dynamic link, rather than checking whether csectpp
1405         is null.  Always allocate debug_index for other objects,
1406         and always go through the loop.  Update the type of debug_index
1407         after the change above.  Read the auxillary csect information
1408         and use xcoff_keep_symbol_p to decide whether a symbol should
1409         be kept.  Set its debug_index to -2 if not.
1410         (xcoff_link_input_bfd): Update the type of debug_index after
1411         the change above and always expect it to be nonnull.  Use it to
1412         test whether a symbol should be stripped, rather than making the
1413         decision here.  Postpone all symbol creation to the second pass.
1414
1415 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1416
1417         * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
1418         creating a descriptor.
1419         (xcoff_sweep): Don't mark toc_section unless it's needed.
1420         (bfd_xcoff_size_dynamic_sections): Skip the toc_section
1421         when marking every bfd.
1422         (xcoff_link_input_bfd): Skip all TOC anchors.
1423         (xcoff_toc_section_p, xcoff_find_tc0): New functions.
1424         (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
1425         to -1; call xcoff_find_tc0 instead.
1426
1427 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1428
1429         * libcoff-in.h (xcoff_section_tdata): Update commentary.
1430         * libcoff.h: Regenerate.
1431         * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
1432         symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
1433         the previous symbol's csect.  Treat last_symndx as an inclusive value
1434         and simplify its handling.
1435         (xcoff_mark): Treat last_symndx as an inclusive value.  Only mark
1436         symbols with the right csect.  Don't mark rsec when processing
1437         relocations against undefined or absolute sections.
1438         (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
1439         of bfd_und_section_ptr.
1440         (xcoff_link_input_bfd): Likewise.
1441
1442 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1443
1444         * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
1445         against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
1446         flag is set.  Assert that all undefined symbols are either
1447         imported or defined by a dynamic object.
1448         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
1449         * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
1450         handling to all relocations.  Only set XCOFF_CALLED for function
1451         symbols.
1452         (xcoff_find_function): New function, split out from...
1453         (bfd_xcoff_export_symbol) ...here.
1454         (xcoff_set_import_path): New function, split out from...
1455         (bfd_xcoff_import_symbol): ...here.  Remove assertion for old
1456         meaning of XCOFF_CALLED.
1457         (xcoff_mark_symbol): If we mark an undefined and unimported
1458         symbol, find some way of defining it.  If the symbol is a function
1459         descriptor, fill in its definition automatically.  If the symbol
1460         is a function, mark its descriptor and allocate room for global
1461         linkage code.  Otherwise mark the symbol as implicitly imported.
1462         Move the code for creating function descriptors from...
1463         (xcoff_build_ldsyms): ...here.  Use XCOFF_WAS_UNDEFINED to
1464         check for symbols that were implicitly defined.
1465         (xcoff_mark): Don't count any dynamic relocations against
1466         function symbols.
1467         (bfd_xcoff_size_dynamic_sections): Save the rtld parameter
1468         in the xcoff link info.
1469         (xcoff_link_input_bfd): Remove handling of undefined and
1470         unexported symbols.
1471
1472 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1473
1474         * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
1475         if the target is absolute.  Fix comment typo.
1476         (xcoff_ppc_relocate_section): Remove FIXME.
1477         * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
1478         if the target is absolute.
1479
1480 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1481
1482         * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
1483         R_POS and R_NEG relocations against absolute symbols to the
1484         .loader section.
1485
1486 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1487
1488         * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
1489         to 2 for bfd_mach_ppc_620.
1490
1491 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
1492
1493         * config.bfd: Treat AIX 6+ in the same way as AIX 5.
1494         * configure.in: Likewise.
1495         * configure: Regenerate.
1496
1497 2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
1498
1499         PR binutils/9945
1500         * elf.c (assign_section_numbers): Generate symbol table if there
1501         is any relocation in output.
1502         (_bfd_elf_compute_section_file_positions): Likewise.
1503
1504 2009-03-13  Nick Clifton  <nickc@redhat.com>
1505
1506         PR 9934
1507         * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
1508         * elflink.c (elf_link_read_relocs_from_section): Use
1509         NUM_SHDR_ENTRIES.  Gracefully handle the case where there are
1510         relocs but no symbol table.
1511         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
1512
1513 2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>
1514
1515         PR ld/9938
1516         * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
1517         to check ___tls_get_addr.
1518
1519         * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
1520         strncmp to check __tls_get_addr.
1521
1522 2009-03-12  Andrew Stubbs  <ams@codesourcery.com>
1523
1524         * dwarf2.c (read_section): Always check the offset, even when the
1525         section has been read before.
1526
1527 2009-03-11  H.J. Lu  <hongjiu.lu@intel.com>
1528
1529         * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
1530         comments.
1531
1532 2009-03-11  Chris Demetriou  <cgd@google.com>
1533
1534         * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
1535         * bfd-in2.h: Regenerate.
1536         * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
1537         flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
1538         mode.
1539         (bsd_write_armap): Likewise.
1540         (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
1541         flag is set, do nothing.
1542         (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
1543         for timestamp.
1544
1545 2009-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
1546
1547         * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
1548         used to update stack pointer.
1549
1550 2009-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1551
1552         PR binutils/9921
1553         * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
1554         for unknown symbols in absolute section.
1555
1556 2009-03-06  Nick Clifton  <nickc@redhat.com>
1557
1558         * po/es.po: Updated Spanish translation.
1559
1560 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
1561
1562         * elf32-arm.c (group_sections): Take next section size into
1563         account before accepting to group it.
1564
1565 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
1566
1567         * elf32-arm.c (arm_type_of_stub): Handle long branches targetting
1568         PLT entries.
1569         (elf32_arm_final_link_relocate): Likewise.
1570
1571 2009-03-05  Moritz Kroll  <Moritz.Kroll@gmx.de>
1572
1573         PR 9923
1574         * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
1575
1576 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
1577
1578         * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
1579         * section.c (struct bfd_section): Add has_tls_get_addr_call.
1580         (BFD_FAKE_SECTION): Init new flag.
1581         * ecoff.c (bfd_debug_section): Likewise.
1582         * bfd-in2.h: Regenerate.
1583         * libbfd.h: Regenerate.
1584         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
1585         (ppc_elf_reloc_type_lookup): Handle new relocs.
1586         (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
1587         without marker relocs.
1588         (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
1589         if section has no old-style calls.
1590         (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
1591         Don't try to optimize new-style __tls_get_addr call when handling
1592         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
1593         relocs.
1594         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
1595         (ppc64_elf_reloc_type_lookup): Handle new relocs.
1596         (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
1597         without marker relocs.
1598         (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
1599         if section has no old-style calls.  Set toc_ref for new relocs as
1600         appropriate.
1601         (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
1602         Don't try to optimize new-style __tls_get_addr call when handling
1603         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
1604         relocs.
1605
1606 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
1607
1608         PR 6768
1609         * configure.in: Test for ld --as-needed support.  Link shared
1610         libbfd against libm.
1611         * configure: Regenerate.
1612
1613 2009-03-03  Alan Modra  <amodra@bigpond.net.au>
1614
1615         * Makefile.am: Run "make dep-am".
1616         * Makefile.in: Regenerate.
1617
1618 2009-03-02  Qinwei  <qinwei@sunnorth.com.cn>
1619
1620         * elf32-score7.c: New file.
1621         * elf32-score.h: New file.
1622         * elf32-score.c: Add code to support score 7.  Set score7 as the
1623         default.
1624         * cpu-score.c: Add score7 architecure.
1625         (compatibile): New function.
1626         * Makefile.am: Add rules for building elf32-score7 object.
1627         * Makefile.in: Regenerate.
1628         * configure.in: Add elf32-score7 object to score vectors.
1629         * configure: Regenerate.
1630         * reloc.c: Add score7 relocs.
1631         * archures.c: Add score3 and score7 machine numbers.
1632         * bfd-in2.h: Regenerate.
1633         * libbfd.h: Regenerate.
1634
1635 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1636
1637         * configure: Regenerate.
1638
1639 2009-03-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1640
1641         * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
1642         (elf32_hppa_check_relocs): Use it.
1643
1644         * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
1645         elf64-hppa.c.
1646         (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
1647         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
1648         (elf_hppa_is_dynamic_loader_symbol): Likewise.
1649         (elf_hppa_record_segment_addrs): Likewise.
1650         (elf_hppa_final_link): Likewise.
1651         (elf_hppa_relocate_insn): Likewise.
1652         (elf_hppa_final_link_relocate): Likewise.
1653         (elf64_hppa_relocate_section): Likewise.
1654         * elf64-hppa.c: Insert above.
1655
1656 2009-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1657
1658         * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
1659         (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
1660         (elf_hppa_relocate_section): Likewise.
1661         * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
1662         from struct elf_link_hash_entry.  Add count field.
1663         (struct elf64_hppa_dyn_hash_table): Delete.
1664         (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
1665         (elf64_hppa_hash_table): Rename to hppa_link_hash_table.
1666         (hppa_elf_hash_entry, eh_name): Define.
1667         (elf64_hppa_new_dyn_hash_entry): Delete.
1668         (elf64_hppa_dyn_hash_lookup): Delete.
1669         (elf64_hppa_dyn_hash_traverse): Delete.
1670         (get_dyn_name): Delete.
1671         (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
1672         of struct elf64_hppa_dyn_hash_entry *.
1673         (elf64_hppa_finalize_dlt, llocate_global_data_dlt,
1674         allocate_global_data_plt, allocate_global_data_stub,
1675         allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
1676         Likewise.
1677         (hppa64_link_hash_newfunc): New.
1678         (elf64_hppa_hash_table_create): Rework.
1679         (count_dyn_reloc): Likewise.
1680         (hppa64_elf_local_refcounts): New.
1681         (elf64_hppa_check_relocs): Rework using standard technique for recording
1682         local DLT, PLT and OPD reference counts.
1683         (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
1684         elf_link_hash_entry *.
1685         (elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
1686         allocate_global_data_plt, allocate_global_data_stub,
1687         allocate_global_data_opd, allocate_dynrel_entries,
1688         elf64_hppa_adjust_dynamic_symbol,
1689         elf64_hppa_mark_milli_and_exported_functions): Likewise.
1690         (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
1691         Use hppa_link_hash_table.  Rework.
1692         (elf64_hppa_link_output_symbol_hook): Rework.
1693         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
1694         elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
1695         elf64_hppa_finish_dynamic_sections): Likewise.
1696
1697 2009-02-26  Christophe Lyon  <christophe.lyon@st.com>
1698
1699         * elf32-arm.c (stub_reloc_type): Removed.
1700         (insn_sequence): Renamed reloc_type field to r_type.
1701         (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
1702         (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
1703         (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
1704         (elf32_arm_stub_type): Add new enum entries for the new stubs.
1705         (arm_stub_is_thumb): Catch new stubs.
1706         (arm_type_of_stub): Handle new stubs.
1707         (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
1708         (bfd_elf32_arm_process_before_allocation): Remove useless
1709         condition.
1710
1711 2009-02-25  H.J. Lu  <hongjiu.lu@intel.com>
1712
1713         * elf.c (elf_find_function): Use is_function_type to check
1714         function symbol.
1715
1716 2009-02-24  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
1717
1718         * xtensa-modules.c: Revert to previous version 1.11 due
1719         to inadvertant commit.
1720
1721 2009-02-24  Sterling Augustine  <sterling@tensilica.com>
1722
1723         * elf32-xtensa.c (text_action_add): Separate test for action
1724         type.  Break if saved action is ta_widen_insn at same offset.
1725
1726 2009-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
1727
1728         * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
1729         to elf32_arm_stub_long_branch_any_arm_pic.
1730         (elf32_arm_stub_long_branch_any_thumb_pic): New.
1731         (enum elf32_arm_stub_type, arm_type_of_stub)
1732         (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
1733         separately.
1734
1735 2009-02-24  Joseph Myers  <joseph@codesourcery.com>
1736
1737         * elf32-arm.c (PREV_SEC): Update comment.
1738         (group_sections): Rename argument to stubs_always_after_branch.
1739         Reverse the list and place stubs at the end of input sections.
1740         Undefine NEXT_SEC.
1741         (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
1742
1743 2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
1744
1745         * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
1746         Fix formatting.
1747         (arm_size_one_stub): Remove unnecessary break.
1748         (arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.
1749
1750 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
1751
1752         * elf32-arm.c (stub_insn_type): New type.
1753         (stub_reloc_type): Likewise.
1754         (insn_sequence): Likewise.
1755         (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
1756         (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
1757         (elf32_arm_stub_long_branch_thumb_only): Likewise.
1758         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
1759         (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
1760         (elf32_arm_stub_long_branch_any_any_pic): Likewise.
1761         (elf32_arm_stub_hash_entry): Add new helper fields.
1762         (stub_hash_newfunc): Initialize these new fields.
1763         (arm_build_one_stub): Encode Arm and Thumb instructions separately
1764         to take endianness into account.
1765         (arm_size_one_stub): Compute size of stubs using insn_sequence.
1766         (arm_map_one_stub): Code is now more generic, thanks to
1767         insn_sequence.
1768
1769 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
1770
1771         * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
1772         code.
1773         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
1774         (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
1775         BLX is not available. Fix typo in warning message. Add comments
1776         and improve formatting.
1777         (arm_build_one_stub): Adjust to new
1778         elf32_arm_stub_long_branch_v4t_thumb_arm stub.
1779         (arm_map_one_stub): Likewise.
1780
1781 2009-02-23  Tristan Gingold  <gingold@adacore.com>
1782             Eric Botcazou  <ebotcazou@adacore.com>
1783             Douglas B Rupp  <rupp@gnat.com>
1784
1785         * vms.h: Update copyright year, fix comments, reorder declarations.
1786         (_bfd_save_vms_section): Remove the prototype.
1787         (EGPS_S_V_NO_SHIFT): New constant.
1788         (bfd_vms_set_section_flags): New prototype.
1789         (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New
1790         constants.
1791         (EGSY_S_W_FLAGS): Ditto.
1792         (EGSY_S_V_QUAD_VAL): Ditto.
1793         (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto.
1794         (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX,
1795         EGST_S_B_NAMLNG): Ditto.
1796         (ESRF_S_B_NAMLNG): Ditto.
1797         (ETIR_S_C_HEADER_SIZE): Ditto.
1798         (EGPS_S_V_ALLOC_64BIT): Ditto.
1799         (DST_S_C_EPILOG): Ditto.
1800         (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto.
1801         (DST_S_C_SRC_INCRLNUM_B): Ditto.
1802         (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto.
1803         (DST_S_L_PCLINE_UNSLONG): Ditto.
1804         (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto
1805         (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto
1806         (DST_S_C_SOURCE_HEADER_SIZE): Ditto.
1807         (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto.
1808         (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto.
1809         (DST_S_B_SRC_UNSBYTE): Ditto.
1810         (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto.
1811         Add prototypes.
1812         (vms_section, vms_reloc): Remove types.
1813         (hdr_struc): Replaced by ...
1814         (hdr_struct): ... new type.
1815         (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants.
1816         (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto.
1817         (EMH_DATE_LENGTH): Ditto.
1818         (eom_struc): Replaced by ...
1819         (eom_struct): ... new type.
1820         (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants.
1821         (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto.
1822         (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto.
1823         (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto.
1824         (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto.
1825         (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto.
1826         (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto.
1827         (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto.
1828         (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto.
1829         (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto.
1830         (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto.
1831         (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto.
1832         (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto.
1833         (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto.
1834         (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto.
1835         (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto.
1836         (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto.
1837         (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH)
1838         (DBG_S_C_DMT_PSECT_SIZE): Ditto.
1839         (enum file_type_enum): New type.
1840         (struct location_struct): Removed.
1841         (struct fileinfo, struct srecinfo, struct lineinfo): New types.
1842         (struct funcinfo, struct module): Ditto.
1843         (struct vms_private_data_struct): Update fields.
1844         (struct vms_section_data_struct): New type.
1845
1846         * vms.c: Update copyright year, fix comments,
1847         Fix includes for DECC, add prototypes.
1848         (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove
1849         some initializers.
1850         Use flavour to set is_vax, location_stack is removed.
1851         (struct pair): Declare.
1852         (fill_section_ptr): Initialize variables at declaration.
1853         Add guard to set SECTION_SYM flag, handlde und section.
1854         (vms_fixup_sections): Use struct pair for fill_section_ptr argument.
1855         (_bfd_vms_slurp_object_records): New function, replaces previous
1856         vms_object_p.
1857         (vms_slurp_module): New function.
1858         (vms_slurp_image): Ditto.
1859         (vms_object_p): Complete rewrite.
1860         (vms_mkobject): Use is_vax field to slect architecture.
1861         (free_reloc_stream): New function.
1862         (vms_convert_to_var): Ditto.
1863         (vms_convert_to_var_1): Ditto.
1864         (vms_convert_to_var_unix_filename): Ditto.
1865         (vms_close_and_cleanup): Call free_reloc_stream, convert file to
1866         VAR format on VMS.
1867         (vms_new_section_hook): Set alignment to 0, allocate private data.
1868         (vms_get_section_contents): Load content.
1869         (vms_get_symbol_info): Handle undefined section.
1870         (vms_find_nearest_line): Handle.
1871         (alloc_reloc_stream): New function.
1872         (vms_slurp_reloc_table): Ditto.
1873         (vms_get_reloc_upper_bound): Make it real.
1874         (vms_canonicalize_reloc): Do the real work.
1875         (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA,
1876         ALPHA_R_BOH.
1877         (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH.
1878         (vms_set_arch_mach): Check arch.
1879         (vms_set_section_contents): Copy the content after allocation.
1880         (vms_alpha_vec): Update object flags.
1881
1882         * vms-tir.c: Update copyright year, fix comments,
1883         add prototypes for new functions.
1884         (dst_define_location): New function.
1885         (dst_restore_location): New function.
1886         (dst_retrieve_location): New function.
1887         (dst_check_allocation): New function.
1888         (image_dump): Call dst_check_allocation.
1889         (image_write_b): Ditto.
1890         (image_write_w): Ditto.
1891         (image_write_l): Ditto.
1892         (image_write_q): Ditto.
1893         (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW,
1894         STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC,
1895         CTL_STKDL.
1896         Call error handler instead of abort if name is not known.
1897         (etir_sta): Add quarter_relocs argument and set it.
1898         Fix cast.
1899         (etir_sto): Ditto.
1900         (etir_opr): Ditto, return FALSE in case of error.
1901         (etir_ctl): Add quarter_relocs argument and set it, fix cast.
1902         Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL.
1903         (etir_stc): Add quarter_relocs argument and set it, fix cast.
1904         Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA.
1905         Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL.
1906         Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS.
1907         Return FALSE in case of error.
1908         (tir_sta): Change sign of psect.
1909         (tir_ctl): Ditto.
1910         (tir_cmd): Fix cast. Makes tir_table static const.
1911         (etir_cmd): Add quarter_relocs argument, makes etir_table const,
1912         add argument to explain.
1913         (analyze_etir): Initialize maxptr, add quarter_relocs
1914         declaration, move some declarations into inner scopes.
1915         Handle quarter_relocs and STO_IMM.
1916         (_bfd_vms_slurp_tir): Use constant instead of hard-coded values.
1917         (_bfd_vms_slurp_relocs): New function.
1918         (_bfd_vms_decode_relocs): New function.
1919         (sto_imm): Rewritten.
1920         (start_first_etbt_record): New function.
1921         (start_another_etbt_record): Ditto.
1922         (etir_output_check): Ditto.
1923         (defer_reloc_p): Ditto.
1924         (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to
1925         a for-loop.  Correctly deals with contents, deals with .vmsdebug,
1926         rewritte relocations handling.
1927         (_bfd_vms_write_tbt): Removed.
1928         (_bfd_vms_write_dbg): Ditto.
1929
1930         * vms-misc.c: Update copyright year, Fix comments.
1931         (_bfd_vms_get_header_values): Use 'size' instead of 'length'.
1932         (maybe_adjust_record_pointer_for_object): New function.
1933         (_bfd_vms_get_first_record): New function, replaces ...
1934         (_bfd_vms_get_record): ..  removed.
1935         (_bfd_vms_get_object_record): New function.
1936         (_bfd_vms_get_object_record): New function.
1937         (vms_get_remaining_object_record): New function, replaces ...
1938         (_bfd_vms_get_next_record): ... removed.
1939         (add_new_contents): Removed.
1940         (_bfd_save_vms_section): Removed.
1941         (_bfd_get_vms_section): Removed.
1942         (_bfd_vms_output_flush): Write in VAR format.
1943         (new_symbol): Don't make UND section.
1944
1945         * vms-hdr.c: Update copyright year, update list of record handled.
1946         (_bfd_vms_slurp_hdr): rec_length renamed to rec_size.
1947         (_bfd_vms_write_hdr): Strip vms and unix patches,
1948         add comments, truncate module name at 31 characters,
1949         use constants instead of hard-coded value,
1950         write BFD version instead of a fixed string.
1951         (_bfd_vms_slurp_ihd): New function.
1952         (_bfd_vms_slurp_isd): Ditto.
1953         (_bfd_vms_slurp_ihs): Ditto.
1954         (new_module): Ditto.
1955         (parse_module): Ditto
1956         (build_module_list): Ditto.
1957         (module_find_nearest_line): Ditto.
1958         (_bfd_vms_find_nearest_dst_line): Ditto.
1959         (vms_slurp_debug): Ditto.
1960         (_bfd_vms_slurp_dbg): Ditto.
1961         (_bfd_vms_slurp_tbt): Ditto.
1962         (_bfd_vms_write_dbg): Ditto.
1963         (_bfd_vms_write_tbt): Ditto.
1964
1965         * vms-gsd.c: Update copyright year, update list of records handled.
1966         (EVAX_LITERALS_NAME): New macro.
1967         (evax_section_flags): Add an entry for EVAX_LITERALS_NAME.
1968         (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd.
1969         (register_universal_symbol): New function and prototype.
1970         (_bfd_vms_slurp_gsd): Fix indentations and casts,
1971         improve debug messages,
1972         use constants instead of hard-coded value,
1973         fix missing endianness conversion,
1974         handle global symbol (SYMG).
1975         (bfd_vms_set_section_flags): New function.
1976         (_bfd_vms_write_gsd): Don't write .vmsdebug section,
1977         handle section literals,
1978         fix indentation,
1979         handle section bfd and vms flags,
1980         don't output LIB$INITIALIZE symbol,
1981         fix handling of weak symbols,
1982         fix evax vs vax procedure descriptor,
1983         handle absolute symbols.
1984
1985         * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR,
1986         BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations.
1987
1988         * makefile.vms (DEFS): Fix flags for VMS.
1989
1990         * bfdio.c (real_fopen): Handle multiple VMS fopen attributes.
1991
1992         * bfd-in2.h: Regenerated.
1993         * libbfd.h: Regenerated.
1994
1995 2009-02-20  Cary Coutant  <ccoutant@google.com>
1996
1997         * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime
1998         in struct stat.
1999
2000 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
2001
2002         PR gas/7059
2003         * coffcode.h (coff_write_object_contents):  Don't let the string
2004         table offset overflow the s_name field when using long section names.
2005
2006 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
2007
2008         * coff-alpha.c (alpha_ecoff_backend_data):  Initialise fields which
2009         control long section name handling with ECOFF_NO_LONG_SECTION_NAMES.
2010         * coff-mips.c (mips_ecoff_backend_data):  Likewise.
2011         * coff-rs6000.c (bfd_xcoff_backend_data):  Initialise fields which
2012         control long section name handling with XCOFF_NO_LONG_SECTION_NAMES.
2013         (bfd_pmac_xcoff_backend_data):  Likewise.
2014         * coff64-rs6000.c (bfd_xcoff_backend_data):  Likewise.
2015         (bfd_xcoff_aix5_backend_data):  Likewise.
2016         (xcoff64_write_object_contents):  Delete unused long_section_names
2017         local variable.
2018         * coff-sh.c (bfd_coff_small_swap_table):  Initialise long section
2019         name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire
2020         struct non-const.
2021         * coffcode.h (documentation):  Update to describe long section names.
2022         (COFFLONGSECTIONCATHELPER):  New helper macro.
2023         (BLANKOR1TOODD):  Likewise.
2024         (COFF_ENABLE_LONG_SECTION_NAMES):  Likewise.
2025         (COFF_LONG_SECTION_NAMES_SETTER):  Likewise.
2026         (COFF_DEFAULT_LONG_SECTION_NAMES):  Likewise.
2027         (bfd_coff_set_long_section_names_allowed):  New function.
2028         (bfd_coff_set_long_section_names_disallowed):  Likewise.
2029         (struct bfd_coff_backend_data):  Add new backend hook function
2030         pointer _bfd_coff_set_long_section_names.
2031         (bfd_coff_set_long_section_names):  New backend hook.
2032         (coff_write_object_contents):  Only generate long section names if
2033         bfd_coff_long_section_names() indicates they are currently enabled.
2034         (bfd_coff_std_swap_table):  Make non-const, and initialise long
2035         section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
2036         (ticoff0_swap_table):  Likewise to both.
2037         (ticoff1_swap_table):  Again, likewise to both.
2038         * coffgen.c (make_a_section_from_file):  Allow long section names
2039         as inputs even if not currently allowed for outputs.
2040         * ecoff.c (_bfd_ecoff_no_long_sections):  New function.
2041         * efi-app-ia32.c (COFF_LONG_SECTION_NAMES):  Define to 0, not blank.
2042         * efi-app-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2043         * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2044         * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
2045         * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2046         * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2047         * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
2048         * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2049         * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2050         * pei-arm.c (COFF_LONG_SECTION_NAMES):  Likewise.
2051         * pei-i386.c (COFF_LONG_SECTION_NAMES):  Likewise.
2052         * pei-mcore.c (COFF_LONG_SECTION_NAMES):  Likewise.
2053         * pei-mips.c (COFF_LONG_SECTION_NAMES):  Likewise.
2054         * pei-ppc.c (COFF_LONG_SECTION_NAMES):  Likewise.
2055         * pei-sh.c (COFF_LONG_SECTION_NAMES):  Likewise.
2056         * pei-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
2057         * libcoff-in.h:  Update copyright year to cause updated copyright
2058         year in generated libcoff.h, and fix typo.
2059         * libcoff.h:  Regenerated.
2060         * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES):  New macro.
2061         (_bfd_ecoff_no_long_sections):  Add prototype.
2062         * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES):  New macro.
2063         * pe-mips.c (COFF_LONG_SECTION_NAMES):  Define empty if not already
2064         defined by an including .c file.
2065         * ticoff.h (ticoff0_swap_table):  Make non-const, and initialise
2066         long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
2067         (ticoff1_swap_table):  Likewise to both.
2068
2069 2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
2070
2071         * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
2072         stub. Catch default case error.
2073         (arm_map_one_stub): Add missing Thumb mapping symbol.
2074
2075 2009-02-18  Bjoern Haase  <bjoern.m.haase@web.de>
2076
2077         PR 9841
2078         * elf32-avr.c: Handle case where no local symbos exist correctly.
2079
2080 2009-02-16  Christophe Lyon  <christophe.lyon@st.com>
2081
2082         bfd/
2083         * elf32-arm.c (arm_long_branch_stub,
2084         arm_thumb_v4t_long_branch_stub,
2085         arm_thumb_thumb_long_branch_stub,
2086         arm_thumb_arm_v4t_long_branch_stub,
2087         arm_thumb_arm_v4t_short_branch_stub,
2088         arm_pic_long_branch_stub):
2089         Renamed to elf32_arm_stub_long_branch_any_any,
2090         elf32_arm_stub_long_branch_v4t_arm_thumb,
2091         elf32_arm_stub_long_branch_thumb_only,
2092         elf32_arm_stub_long_branch_v4t_thumb_arm,
2093         elf32_arm_stub_short_branch_v4t_thumb_arm,
2094         elf32_arm_stub_long_branch_any_any_pic.
2095         (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
2096         arm_thumb_thumb_stub_long_branch,
2097         arm_thumb_arm_v4t_stub_long_branch,
2098         arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
2099         Renamed to arm_stub_long_branch_any_any,
2100         arm_stub_long_branch_v4t_arm_thumb,
2101         arm_stub_long_branch_thumb_only,
2102         arm_stub_long_branch_v4t_thumb_arm,
2103         arm_stub_short_branch_v4t_thumb_arm,
2104         arm_stub_long_branch_any_any_pic.
2105
2106 2009-02-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2107
2108         * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used
2109         in branch offset check.
2110
2111 2009-02-15  Alan Modra  <amodra@bigpond.net.au>
2112
2113         * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,
2114         add toc.symndx and toc.add.
2115         (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here.
2116         Set up toc.add.
2117         (get_tls_mask): Add toc_addend param, set from toc.add.  Adjust all
2118         callers.
2119         (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd.
2120         (branch_reloc_hash_match): New function, extracted from..
2121         (ppc64_elf_tls_optimize): ..here.
2122         (ppc64_elf_relocate_section): Properly set addends when optimizing
2123         tls sequences.  Avoid unnecessary reading and writing of insns.
2124         Only redo reloc when symbol changed.  Bypass symbol checks when
2125         using tlsld_got.
2126         * elf32-ppc.c (ppc_elf_tls_setup): Correct comment.
2127         (branch_reloc_hash_match): New function, extracted from..
2128         (ppc_elf_tls_optimize): ..here.
2129         (ppc_elf_relocate_section): Avoid unnecessary reading of insns.
2130         Don't clear addend on zapped __tls_get_addr reloc.
2131
2132 2009-02-12  Nick Clifton  <nickc@redhat.com>
2133
2134         PR 9827
2135         * elflink.c (bfd_elf_final_link): When counting the relocations,
2136         if the header size has not been set yet then assume that it will
2137         match the output section's reloc type.
2138
2139 2009-02-12  Nathan Sidwell  <nathan@codesourcery.com>
2140
2141         * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
2142         relocatable link.
2143
2144 2009-02-09  Alan Modra  <amodra@bigpond.net.au>
2145
2146         * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
2147         (find_function): Likewise.
2148         (pasted_function): Don't error if no prior function found.
2149         (discover_functions): Revert 2008-12-10 change.  Extend first
2150         function range to start of section.
2151
2152 2009-02-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2153
2154         * elf64-hppa.c: Remove PARAMS macro.  Replace PTR with void *.  Convert
2155         functions to C90.
2156         * elf64-hppa.h: Likewise.
2157
2158 2009-02-06  Joseph Myers  <joseph@codesourcery.com>
2159
2160         * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
2161         .sbss handling.
2162
2163 2009-02-04  Alan Modra  <amodra@bigpond.net.au>
2164
2165         * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.
2166         Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
2167
2168 2009-02-03  Sandip Matte  <sandip@rmicorp.com>
2169
2170         * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
2171         * archures.c (bfd_mach_mips_xlr): Define.
2172         * bfd-in2.h: Regenerate.
2173         * cpu-mips.c (I_xlr): Define.
2174         (arch_info_struct): Add XLR entry.
2175         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
2176         (mips_set_isa_flags): Handle bfd_mach_mips_xlr
2177         (mips_mach_extensions): Add XLR entry.
2178
2179 2009-02-03  Eric B. Weddington  <eric.weddington@atmel.com>
2180
2181         * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound.
2182
2183 2009-02-03  Carlos O'Donell  <carlos@codesourcery.com>
2184
2185         * configure.in: AC_SUBST pdfdir.
2186         * Makefile.am: Add install-pdf, install-pdf-am
2187         and install-pdf-recursive targets. Define pdfdir.
2188         * doc/Makefile.am: Define pdf__strip_dir. Add
2189         install-pdf and install-pdf-am targets.
2190         * po/Make-in: Add install-pdf target.
2191         * configure: Regenerate.
2192         * Makefile.in: Regenerate
2193         * doc/Makefile.in: Regenerate.
2194
2195 2009-02-03  Maxim Kuvyrkov  <maxim@codesourcery.com>
2196
2197         * bfd-in2.h: Regenerate.
2198         * elf32-m68k.c: Handle 2-slot GOT entries.  Rename variables and
2199         fields from n_entries to n_slots where appropriate, update comments.
2200         (HOWTO): Add TLS relocations.
2201         (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
2202         (enum elf_m68k_got_offset_size): New enum.
2203         (struct elf_m68k_got_entry.type): Move field to ...
2204         (struct elf_m68k_got_entry_key): ... here.  Update all uses.
2205         (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static
2206         functions.
2207         (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static
2208         functions.
2209         (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
2210         fields into n_entries array.  Update comments.
2211         (elf_m68k_init_got): Simplify, update all uses.
2212         (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update.
2213         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
2214         GOT entries; update name, update all uses.
2215         (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto.
2216         (elf_m68k_get_got_entry): Update.
2217         (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
2218         simplify.
2219         (elf_m68k_remove_got_entry_type): Simplify.
2220         (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update.
2221         (elf_m68k_can_merge_gots): Update.
2222         (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
2223         (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot
2224         GOT entries, simplify.
2225         (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same.
2226         (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
2227         field, remove obsoleted local_n_entries field.
2228         (elf_m68k_partition_multi_got_2): New static function.
2229         (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it;
2230         update.
2231         (elf_m68k_remove_got_entry_type): Update.
2232         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
2233         (elf_m68k_check_relocs): Handle TLS relocations.  Remove unnecessary
2234         update of sgot->size and srelgot->size.
2235         (elf_m68k_gc_sweep_hook): Update.
2236         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
2237         (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle
2238         TLS relocations.
2239         * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
2240         * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
2241
2242 2009-02-02  DJ Delorie  <dj@redhat.com>
2243
2244         * elf32-mep.c (config_names): Regenerate configuration.
2245
2246 2009-02-02  Alan Modra  <amodra@bigpond.net.au>
2247
2248         * elf-bfd.h (bfd_elf_get_str_section): Don't declare.
2249         (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
2250         * elf.c (bfd_elf_get_str_section): Make static.
2251         (bfd_elf_find_section): Delete.
2252         * libbfd.h: Regenerate.
2253
2254 2009-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
2255
2256         * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
2257         (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.
2258
2259 2009-01-31  Alan Modra  <amodra@bigpond.net.au>
2260
2261         * elflink.c (on_needed_list): New function.
2262         (elf_link_add_object_symbols): Link in --as-needed libs if they
2263         satisfy undefined symbols in other libs.
2264
2265 2009-01-30  Julian Brown  <julian@codesourcery.com>
2266
2267         * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
2268         EXEC_P or DYNAMIC flags, and skip sections which are being linked
2269         with --just-symbols (-R).
2270
2271 2009-01-29  Adam Nemet  <anemet@caviumnetworks.com>
2272
2273         * dwarf2.c (read_rangelist): Use read_address to read low_pc and
2274         high_pc in order to properly sign-extend VMAs.
2275
2276 2009-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
2277             Mark Shinwell  <shinwell@codesourcery.com>
2278             Catherine Moore  <clm@codesourcery.com>
2279
2280         * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
2281
2282 2009-01-28  Catherine Moore <clm@codesourcery.com>
2283
2284         * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
2285         SEC_LOAD for dynamic relocation sections.
2286
2287 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
2288
2289         * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table
2290         (info)->tls_size, not elf_hash_table (info)->tls_sec->size for
2291         the size of local TLS data.
2292
2293 2009-01-27  Andreas Schwab  <schwab@suse.de>
2294
2295         * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
2296         architectures in the archive.
2297
2298 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
2299
2300         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
2301         <R_CRIS_32_DTPREL>: Correct relocation value.
2302
2303         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
2304         <R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
2305         symbols with non-default visibility.
2306
2307 2009-01-26  Nathan Sidwell  <nathan@codesourcery.com>
2308
2309         * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs
2310         describing the trampolines.
2311         (ppc_elf_relocate_section): Update relocs to describe the
2312         trampolines.
2313
2314 2009-01-25  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2315
2316         * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that
2317         branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F
2318         and R_PARISC_PCREL12F relocations.
2319
2320 2009-01-24  Alan Modra  <amodra@bigpond.net.au>
2321
2322         PR 6022
2323         * elflink.c (find_version_for_sym): New function split out from,
2324         but without export_dynamic test, ..
2325         (_bfd_elf_link_assign_sym_version): ..here.
2326         (_bfd_elf_export_symbol): Use it.
2327
2328 2009-01-23  Alan Modra  <amodra@bigpond.net.au>
2329
2330         * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
2331         (struct elf_info_failed, struct elf_find_verdep_info): Move to..
2332         * elflink.c: ..here, somewhat modified.
2333         * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
2334         _bfd_elf_link_find_version_dependencies,
2335         _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
2336         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
2337         _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
2338         declare..
2339         * elflink.c: ..and make static here.
2340         (_bfd_elf_link_find_version_dependencies): Adjust for removal
2341         of output_bfd from struct elf_find_verdep_info.
2342         (_bfd_elf_link_assign_sym_version): Similarly adjust to use
2343         struct elf_info_failed.
2344         (bfd_elf_size_dynamic_sections): Adjust.
2345
2346 2009-01-22  Alan Modra  <amodra@bigpond.net.au>
2347
2348         PR 6832
2349         * dwarf2.c (find_line): Don't update stash->sec_info_ptr until
2350         after comp_unit_find_line call.
2351
2352 2009-01-21  Nick Clifton  <nickc@redhat.com>
2353
2354         PR 9769
2355         * vmsutil.c (vms_file_stats_name): Remove use of unsupported
2356         tm_gmtoff field in struct tm.
2357
2358 2009-01-21  Alan Modra  <amodra@bigpond.net.au>
2359
2360         * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
2361         * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
2362         sections in soft-icache lines unless non_ia_text.  Don't add
2363         rodata if doing so would exceed line size.
2364
2365 2009-01-19  Hans-Peter Nilsson  <hp@axis.com>
2366
2367         * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
2368         types than bfd_link_hash_indirect, before early return, call
2369         _bfd_elf_link_hash_copy_indirect.
2370
2371 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
2372
2373         * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
2374         * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
2375         * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
2376         (elf_backend_obj_attrs_order): New define.
2377         * elfxx-target.h (elf_backend_obj_attrs_order): New define.
2378         (elfNN_bed): Add elf_backend_obj_attrs_order.
2379
2380 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
2381
2382         * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
2383         (obj_attr_size): Likewise.
2384         (write_obj_attribute): Likewise.
2385         (_bfd_elf_copy_obj_attributes): Likewise.
2386         (_bfd_elf_parse_attributes): Likewise.
2387         * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
2388         (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
2389         (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
2390         (ATTR_TYPE_HAS_NO_DEFAULT): New define.
2391         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
2392         with macros.
2393
2394 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
2395
2396         * elf-attrs.c (is_default_attr): Support defaultless attributes.
2397         (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
2398         (bfd_elf_add_obj_attr_string): Likewise.
2399         (bfd_elf_add_obj_attr_int_string): Likewise.
2400         (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
2401         * elf-bfd.h (struct obj_attribute): Document new flag bit.
2402         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
2403         Tag_nodefaults has no default value.
2404         (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
2405         comment to reflect the new state.
2406
2407 2009-01-19  Alan Modra  <amodra@bigpond.net.au>
2408
2409         PR 9695
2410         * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC.
2411         (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC.
2412         (adjust_z_magix): Delete dead code handling QMAGIC.
2413
2414 2009-01-16  Kai Tietz  <kai.tietz@onevision.com>
2415
2416         * coffcode.h (styp_to_sec_flags): Correct interpretation of
2417         IMAGE_SCN_MEM_DISCARDABLE.
2418
2419 2009-01-16  Alan Modra  <amodra@bigpond.net.au>
2420
2421         * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute
2422         SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS.
2423         * configure.in (commonbfdlib): Delete.
2424         (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/
2425         (SHARED_LIBADD): Rename from WIN32LIBADD.  Add pic libiberty if such
2426         is available, not just for linux.
2427         * po/SRC-POTFILES.in: Regenerate.
2428         * Makefile.in: Regenerate.
2429         * configure: Regenerate.
2430
2431 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
2432             Julian Brown   <julian@codesourcery.com>
2433
2434         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
2435         ARM attributes in ABI 2.07.
2436         * elf32-arm.c (get_secondary_compatible_arch): New function.
2437         (set_secondary_compatible_arch): New function.
2438         (tag_cpu_arch_combine): New function.
2439         (elf32_arm_copy_one_eabi_other_attribute): Delete function.
2440         (elf32_arm_copy_eabi_other_attribute_list): Delete function.
2441         (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
2442         make it fit with order_01243.
2443         Add support for Tag_also_compatible_with,
2444         Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
2445         Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
2446         Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
2447         Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
2448         Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
2449         Tag_VFP_arch and Tag_ABI_FP_16bit_format.
2450         Rework the way unknown attributes are handled.
2451         Defer errors until all attributes have been processed.
2452
2453 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
2454
2455         * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
2456         bfd_elf_add_obj_attr_int_string.
2457         Read Tag_compatibility from its new location in the attribute array,
2458         rather than the attribute list.
2459         (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
2460         bfd_elf_add_obj_attr_int_string.
2461         (_bfd_elf_parse_attributes): Likewise.
2462         (_bfd_elf_merge_object_attributes): There's now only one
2463         Tag_compatibility, and it's in the array, not the list.
2464         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
2465         Tag_compatibility.
2466         (bfd_elf_add_obj_attr_compat): Rename to
2467         bfd_elf_add_obj_attr_int_string.
2468         (bfd_elf_add_proc_attr_compat): Rename to
2469         bfd_elf_add_proc_attr_int_string.
2470         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
2471         Tag_compatibility.
2472
2473 2009-01-15  Douglas B Rupp  <rupp@gnat.com>
2474
2475         * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo
2476         (BFD32_BACKENDS_CFILES): Add new file vmsutil.c
2477         (vmsutil.lo): Add dependency rule.
2478         * Makefile.in: Regenerate.
2479         * config.bfd (ia64*-*-*vms*): Add case.
2480         * configure.in (bfd_elf64_ia64_vms_vec): Add case.
2481         * configure: Regenerate.
2482         * vmsutil.c: New file.
2483         * vmsutil.h: New file.
2484         * elf-bfd.h (struct bfd_elf_special_section): Change type of
2485         attr to bfd_vma.
2486         * elfxx-ia64.c (elfNN_vms_post_process_headers,
2487         elfNN_vms_section_processing, elfNN_vms_final_write_processing,
2488         elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr,
2489         elfNN_vms_object_p): New functions
2490         * targets.c (bfd_elf64_ia64_vms_vec): New target.
2491
2492 2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>
2493
2494         PR ld/9727
2495         * elflink.c (elf_gc_sweep): Exclude the group section if the
2496         first member of the section group is excluded.
2497
2498 2009-01-14  Alan Modra  <amodra@bigpond.net.au>
2499
2500         PR 9735
2501         * syms.c (_bfd_stab_section_find_nearest_line): Don't free
2502         saved filename, use bfd_alloc rather than bfd_malloc for it.
2503
2504 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
2505
2506         * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.
2507
2508 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
2509
2510         * elf32-spu.c (remove_cycles): Always set call->max_depth.
2511
2512 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
2513
2514         * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.
2515
2516 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
2517
2518         * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2,
2519         num_lines_log2.
2520         (struct got_entry): Add br_addr.
2521         (struct call_info): Add priority.
2522         (struct function_info): Add lr_store and sp_adjust.
2523         (spu_elf_setup): Init line_size_log2 and num_lines_log2.
2524         (spu_elf_find_overlays): For soft-icache, mark any section within cache
2525         area as an overlay, and check that no other overlays exist.  Look up
2526         icache overlay manager entry sym.
2527         (BRA_STUBS, BRA, BRASL): Define.
2528         (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub.
2529         (needs_ovl_stub): Adjust for soft-icache.  Return priority encoded
2530         in branch insn.
2531         (count_stub, build_stub): Support soft-icache.
2532         (build_spuear_stubs, process_stubs): Adjust build_stub call.
2533         (spu_elf_size_stubs): Size soft-icache stubs.
2534         (overlay_index): New function.
2535         (spu_elf_build_stubs): Make static.  Support soft-icache.
2536         (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache.
2537         (find_function_stack_adjust): Save lr store and stack adjust insn
2538         offsets.
2539         (maybe_insert_function): Adjust find_function_stack_adjust call.
2540         (mark_functions_via_relocs): Retrieve priority.
2541         (remove_cycles): Only warn about pruned arcs when stack_analysis.
2542         (sort_calls): Sort by priority first.
2543         (mark_overlay_section): Ignore .ovl.init.
2544         (sum_stack): Only print when stack_analysis.
2545         (print_one_overlay_section): New function, extracted from..
2546         (spu_elf_auto_overlay): ..here.  Support soft-icache overlays.
2547         (spu_elf_stack_analysis): Only print when htab->stack_analysis.
2548         (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive
2549         analysis.  Call spu_elf_build_stubs.
2550         (spu_elf_relocate_section): For soft-icache encode overlay index
2551         into addresses.
2552         (spu_elf_output_symbol_hook): Support soft-icache.
2553         (spu_elf_modify_program_headers: Likewise.
2554
2555         * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis.  Rename
2556         num_regions to num_lines.  Add line_size and max_branch.
2557         (enum _ovly_flavour): Add ovly_soft_icache.
2558         (spu_elf_build_stubs): Delete.
2559
2560 2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
2561
2562         * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
2563         relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
2564
2565 2009-01-07  Hans-Peter Nilsson  <hp@axis.com>
2566
2567         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
2568         <case R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: For a symbol defined in
2569         the program, the known offset starts at the negative size of the
2570         TLS section.
2571         <case R_CRIS_32_IE, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>:
2572         Similar.
2573
2574 2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
2575
2576         * config.bfd: Add lm32-*-rtems*.
2577
2578 2009-01-03  H.J. Lu  <hongjiu.lu@intel.com>
2579
2580         * coff-ppc.c: Add 2009 to Copyright.
2581         * elf32-cris.c: Likewise.
2582         * elflink.c: Likewise.
2583
2584 2009-01-03  Hans-Peter Nilsson  <hp@axis.com>
2585
2586         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename
2587         gotplt_index to rela_plt_index.  Adjust for R_CRIS_DTPMOD entry.
2588
2589 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
2590
2591         PR ld/9679
2592         * elflink.c (elf_merge_st_other): New.
2593         (_bfd_elf_merge_symbol): Use it on skipped weak definitions and
2594         hide them if needed.
2595         (elf_link_add_object_symbols): Updated.
2596
2597 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
2598
2599         PR ld/9676
2600         * elflink.c (elf_link_add_object_symbols): Update def_dynamic,
2601         ref_dynamic and dynamic_def fields when setting def_regular
2602         to 1.
2603
2604 2009-01-02  Curtis Mackie  <curtmackevo@gmail.com>
2605
2606         PR 9682
2607         * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string
2608         literal.
2609
2610 For older changes see ChangeLog-2008
2611 \f
2612 Local Variables:
2613 mode: change-log
2614 left-margin: 8
2615 fill-column: 74
2616 version-control: never
2617 End: