OSDN Git Service

5d283c9a2b7fb2d91ffeaff67ac8cdd5b70fdec5
[pf3gnuchains/pf3gnuchains3x.git] / bfd / ChangeLog
1 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
2
3         Fix -Wshadow warnings (seen on ppc-aix)
4         * xcofflink.c: Replace finfo by flinfo throughout.
5
6 2009-12-31  Cary Coutant  <ccoutant@google.com>
7
8         * dwarf2.c (struct line_sequence): New struct.
9         (struct line_info_table): Add num_sequences, remove last_line,
10         add sequences.
11         (add_line_info): Add new sequences as necessary.
12         (compare_sequences): New function.
13         (sort_line_sequences): New function.
14         (decode_line_info): Initialize new fields in line table.
15         Call sort_line_sequences.
16         (lookup_address_in_line_info_table): Binary search for proper
17         sequence.
18
19 2009-12-28  Daniel Gutson  <dgutson@codesourcery.com>
20
21         * elf32-arm.c (elf32_arm_final_link_relocate): limits
22         fixed.
23
24 2009-12-28  Daniel Gutson  <dgutson@codesourcery.com>
25
26         * elf-attrs.c (_bfd_elf_merge_object_attributes): Error
27         message rephrased.
28
29 2009-12-21  Alan Modra  <amodra@gmail.com>
30
31         * elf64-ppc.c: Delete my email address.
32
33 2009-12-18  Ulrich Weigand  <uweigand@de.ibm.com>
34
35         * elf.c (elfcore_grok_s390_high_gprs): New function.
36         (elfcore_grok_note): Handle NT_S390_HIGH_GPRS notes.
37         (elfcore_write_s390_high_gprs): New function.
38         (elfcore_write_register_note): Call it.
39
40 2009-12-17  Alan Modra  <amodra@bigpond.net.au>
41
42         PR ld/11088
43         * elf32-ppc.c (update_plt_info): Clear sec here when addend is
44         less than 32768..
45         (ppc_elf_check_relocs): ..rather than doing so here.  Ignore new
46         relax relocs.
47         (ppc_elf_gc_sweep_hook): Don't segfault when symbol hiding has
48         removed plt_entry records.
49         (ppc_elf_tls_setup): Handle PIE calls to __tls_get_addr correctly.
50         (ppc_elf_tls_optimize): Likewise.  Also dec __tls_get_addr refcount
51         when optimizing code using new tlsgd and tlsld marker relocs.
52         (ppc_elf_relax_section): Differentiate relaxed PLTREL24 relocs
53         from ADDR24 relocs using plt or glink.  Don't clear the addend
54         for R_PPC_RELAX_PLTREL24.
55         (ppc_elf_relocate_section): Correctly handle addends on relaxed
56         PLTREL24 relocs.
57
58 2009-12-17  Alan Modra  <amodra@bigpond.net.au>
59
60         PR ld/11088
61         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Don't abort if symbol
62         hiding has nulled out plt.plist.
63
64 2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>
65
66         * opncls.c (bfd_opnr_iovec): Replace _XXX with XXX_P in
67         parameters.
68
69         * tekhex.c (pass_over): Replace eof with is_eof.
70
71 2009-12-15  Tristan Gingold  <gingold@adacore.com>
72
73         * mach-o.h (bfd_mach_o_uuid_command): Remove section field.
74         * mach-o.c (bfd_mach_o_scan_read_uuid): Do not create a section
75         from this command.
76
77 2009-12-15  Tristan Gingold  <gingold@adacore.com>
78
79         * mach-o.c (struct mach_o_section_name_xlat): Add flags field.
80         (dwarf_section_names_xlat): Add section flags.
81         (text_section_names_xlat): Ditto.
82         (data_section_names_xlat): Ditto.
83         (bfd_mach_o_convert_section_name_to_bfd): Now return name and section
84         flags by reference.
85         (bfd_mach_o_make_bfd_section): Use section flags when know, otherwise
86         try to guess.
87
88 2009-12-14  Doug Kwan  <dougkwan@google.com>
89
90         * opncls.c (bfd_opnr_iovec): Rename parameters to avoid shawdowed
91         variable warnings.
92         * bfd-in2.h: Regnenerate.
93
94 2009-12-12  Nick Clifton  <nickc@redhat.com>
95
96         * coff-arm.c (coff_arm_rtype_to_howto): Fix shadowed variable
97         warning.
98
99 2009-12-11  Tristan Gingold  <gingold@adacore.com>
100
101         * som.c (bfd_som_set_subsection_attributes)
102         (bfd_section_from_som_symbol, som_reloc_queue_fix): Fix shadowed
103         variable warnings.
104         * cache.c (close_one): Likewise.
105
106 2009-12-11  Nick Clifton  <nickc@redhat.com>
107
108         * warning.m4 (GCC_WARN_CFLAGS): Add -Wshadow.
109         * configure: Regenerate.
110         * Makefile.in: Regenerate.
111         * doc/Makefile.in: Regenerate.
112         * aout-arm.c: Fix shadowed variable warnings.
113         * aout-tic30.c: Likewise.
114         * aoutx.h: Likewise.
115         * archive.c: Likewise.
116         * coff-alpha.c: Likewise.
117         * coff-i386.c: Likewise.
118         * coff-x86_64.c: Likewise.
119         * coffgen.c: Likewise.
120         * dwarf2.c: Likewise.
121         * ecoff.c: Likewise.
122         * elf-eh-frame.c: Likewise.
123         * elf-m10300.c: Likewise.
124         * elf.c: Likewise.
125         * elf32-arm.c: Likewise.
126         * elf32-avr.c: Likewise.
127         * elf32-bfin.c: Likewise.
128         * elf32-cr16.c: Likewise.
129         * elf32-i386.c: Likewise.
130         * elf32-ip2k.c: Likewise.
131         * elf32-lm32.c: Likewise.
132         * elf32-m68hc1x.c: Likewise.
133         * elf32-microblaze.c: Likewise.
134         * elf32-ppc.c: Likewise.
135         * elf32-rx.c: Likewise.
136         * elf32-score.c: Likewise.
137         * elf32-score7.c: Likewise.
138         * elf32-sh.c: Likewise.
139         * elf32-spu.c: Likewise.
140         * elf32-v850.c: Likewise.
141         * elf32-xtensa.c: Likewise.
142         * elf64-hppa.c: Likewise.
143         * elf64-ppc.c: Likewise.
144         * elf64-x86-64.c: Likewise.
145         * elflink.c: Likewise.
146         * elfxx-ia64.c: Likewise.
147         * elfxx-mips.c: Likewise.
148         * elfxx-sparc.c: Likewise.
149         * hash.c: Likewise.
150         * ieee.c: Likewise.
151         * libbfd.c: Likewise.
152         * mach-o.c: Likewise.
153         * merge.c: Likewise.
154         * nlm32-sparc.c: Likewise.
155         * oasys.c: Likewise.
156         * opncls.c: Likewise.
157         * pdp11.c: Likewise.
158         * peXXigen.c: Likewise.
159         * pef.c: Likewise.
160         * versados.c: Likewise.
161         * vms-gsd.c: Likewise.
162         * vms-hdr.c: Likewise.
163         * vms-tir.c: Likewise.
164         * vms.c: Likewise.
165         * xcofflink.c: Likewise.
166         * xsym.c: Likewise.
167         * xtensa-isa.c: Likewise.
168
169 2009-12-10  Maciej W. Rozycki  <macro@codesourcery.com>
170
171         * elfxx-mips.c (mips_elf_calculate_relocation): Correct handling
172         of undefined symbols.
173
174 2009-12-09  Daniel Jacobowitz  <dan@codesourcery.com>
175
176         * elf32-arm.c (elf32_arm_next_input_section): Skip sections without
177         SEC_CODE.
178
179 2009-12-08  Alan Modra  <amodra@bigpond.net.au>
180
181         * elf.c (write_zeros): New function.
182         (assign_file_positions_for_load_sections): Allocate file space for
183         NOBITS sections that are followed by PROGBITS sections in a segment.
184
185 2009-12-03  Tristan Gingold  <gingold@adacore.com>
186
187         * mach-o.c (bfd_mach_o_make_bfd_section): Force debug flags for
188         all sections of the __DWARF segment.
189
190 2009-12-03  Alan Modra  <amodra@bigpond.net.au>
191
192         PR ld/11047
193         * elf32-ppc.c (ppc_elf_relocate_section): Delete __tls_get_addr
194         symbol reference from relocs belonging to calls that are
195         optimized away.
196         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
197
198 2009-12-02  Jerker Bäck  <jerker.back@gmail.com>
199
200         PR binutils/11017
201         * coff-i386.h (COFF_PAGE_SIZE): Definition moved to coff/i386.h
202
203 2009-11-30  Joseph Myers  <joseph@codesourcery.com>
204
205         * configure: Regenerate.
206
207 2009-11-26  Per Øyvind Karlsen <peroyvind@mandriva.org>
208
209         * plugin.c (bfd_plugin_bfd_copy_link_hash_symbol_type): Define.
210
211 2009-11-24  Joel Brobecker  <brobecker@adacore.com>
212
213         * acinclude.m4: Add include of ../config/zlib.m4.
214         * configure.in: AM_ZLIB to check for zlib support.
215         * configure: Regenerate.
216
217 2009-11-23  Paul Brook  <paul@codesourcery.com>
218
219         * libbfd-in.h (_bfd_generic_copy_link_hash_symbol_type): Add
220         prototype.
221         * elf-bfd.h (_bfd_elf_copy_link_hash_symbol_type): Add prototype.
222         * linker.c (_bfd_generic_copy_link_hash_symbol_type): New function.
223         * elflink.c (_bfd_elf_copy_link_hash_symbol_type): New function.
224         * targets.c (BFD_JUMP_TABLE_LINK, struct bfd_target): Add
225         _copy_link_hash_symbol_type.
226         * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Add
227         _bfd_generic_copy_link_hash_symbol_type.
228         * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add
229         _bfd_generic_copy_link_hash_symbol_type.
230         * aout-adobe.c (aout_32_bfd_copy_link_hash_symbol_type): Define.
231         * aout-target.h (MY_bfd_copy_link_hash_symbol_type): Define.
232         * aout-tic30.c (MY_bfd_copy_link_hash_symbol_type): Define.
233         * binary.c (binary_bfd_copy_link_hash_symbol_type): Define.
234         * bout.c (b_out_bfd_copy_link_hash_symbol_type): Define.
235         * coffcode.h (coff_bfd_copy_link_hash_symbol_type): Define.
236         * elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type): Define.
237         * i386msdos.c (msdos_bfd_copy_link_hash_symbol_type): Define.
238         * i386os9k.c (os9k_bfd_copy_link_hash_symbol_type): Define.
239         * ieee.c (ieee_bfd_copy_link_hash_symbol_type): Define.
240         * ihex.c (ihex_bfd_copy_link_hash_symbol_type): Define.
241         * libecoff.h (_bfd_ecoff_bfd_copy_link_hash_symbol_type): Define.
242         * mach-o.c (bfd_mach_o_bfd_copy_link_hash_symbol_type): Define.
243         * mmo.c (mmo_bfd_copy_link_hash_symbol_type): Define.
244         * nlm-target.h (nlm_bfd_copy_link_hash_symbol_type): Define.
245         * oasys.c (oasys_bfd_copy_link_hash_symbol_type): Define.
246         * pef.c (bfd_pef_bfd_copy_link_hash_symbol_type): Define.
247         * ppcboot.c (ppcboot_bfd_copy_link_hash_symbol_type): Define.
248         * som.c (som_bfd_copy_link_hash_symbol_type): Define.
249         * srec.c (srec_bfd_copy_link_hash_symbol_type): Define.
250         * tekhex.c (tekhex_bfd_copy_link_hash_symbol_type): Define.
251         * versados.c (versados_bfd_copy_link_hash_symbol_type): Define.
252         * vms.c (vms_bfd_copy_link_hash_symbol_type): Define.
253         * xsym.c (bfd_sym_bfd_copy_link_hash_symbol_type): Define.
254         * bfd-in2.h: Regenerate.
255         * libbfd.h: Regenerate.
256
257 2009-11-19  Tristan Gingold  <gingold@adacore.com>
258
259         * coff-rs6000.c (rs6000coff_vec): Use generic routines instead of
260         hard-coded casts.
261         (pmac_xcoff_vec): Ditto.
262         * coff64-rs6000.c (rs6000coff64_vec): Ditto.
263         (aix5coff64_vec): Ditto.
264
265 2009-11-18  Alan Modra  <amodra@bigpond.net.au>
266
267         * bfd-in.h (_bfd_elf_ppc_at_tls_transform): Declare.
268         * bfd-in2.h: Regenerate.
269         * elf64-ppc.c (ppc64_elf_relocate_section): Move code for R_PPC64_TLS
270         insn optimisation to..
271         * elf32-ppc.c (_bfd_elf_ppc_at_tls_transform): ..here.  New function.
272         (ppc_elf_relocate_section): Use it.
273
274 2009-11-18  Alan Modra  <amodra@bigpond.net.au>
275
276         * targets.c: Don't include alloca-conf.h.
277         (bfd_get_target_info): Don't use alloca.
278
279 2009-11-17  H.J. Lu  <hongjiu.lu@intel.com>
280
281         PR ld/10955
282         * elfxx-ia64.c (elfNN_ia64_update_short_info): Also skip ABS
283         sections.
284
285 2009-11-17  H.J. Lu  <hongjiu.lu@intel.com>
286
287         PR ld/10955
288         * elfxx-ia64.c (elfNN_ia64_link_hash_table): Update comments.
289         (elfNN_ia64_update_short_info): Remove "->output_section" from
290         ia64_info->max_short_sec and ia64_info->min_short_sec.
291         (elfNN_ia64_choose_gp): Likewise.
292         (elfNN_ia64_relax_section): Pass tsec->output_section to
293         elfNN_ia64_update_short_info.
294
295 2009-11-17  H.J. Lu  <hongjiu.lu@intel.com>
296
297         PR ld/10955
298         * elfxx-ia64.c (elfNN_ia64_link_hash_table): Add max_short_sec,
299         max_short_offset, min_short_sec and min_short_offset.
300         (elfNN_ia64_update_short_info): New.
301         (elfNN_ia64_relax_section): Update max_short_sec,
302         max_short_offset, min_short_sec and min_short_offset.
303         (elfNN_ia64_choose_gp): Use min_short_sec/max_short_sec if
304         they are set.
305
306 2009-11-17  Paul Brook  <paul@codesourcery.com>
307             Daniel Jacobowitz  <dan@codesourcery.com>
308
309         * elf32-arm.c (using_thumb_only, arch_has_arm_nop,
310         arch_has_thumb2_nop): Handle TAG_CPU_ARCH_V7E_M.
311         (tag_cpu_arch_combine): Ditto. Correct MAX_TAG_CPU_ARCH test.
312
313 2009-11-17  Ulrich Weigand  <uweigand@de.ibm.com>
314
315         * elf32-spu.c (struct spu_link_hash_table): Remove overlay_fixed,
316         reserved, and extra_stack_space members.
317         (spu_elf_auto_overlay): Use auto_overlay_fixed, auto_overlay_reserved,
318         and extra_stack_space members of htab->params instead.
319
320 2009-11-17  Tristan Gingold  <gingold@adacore.com>
321
322         * targets.c: Include alloca-conf.h
323
324 2009-11-16  Kai Tietz  <kai.tietz@onevision.com>
325
326         * targets.c (bfd_get_target_info): New function.
327         (_bfd_find_arch_match): New function.
328         * bfd-in2.h: Regenerated.
329
330 2009-11-12  Nick Clifton  <nickc@redhat.com>
331
332         * po/ru.po: Updates Russian translation.
333
334 2009-11-11  Nick Clifton  <nickc@redhat.com>
335
336         * po/id.po: Updated Indonesian translation.
337
338 2009-11-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
339
340         * configure.in: Call ACX_LARGEFILE.  Stop calling AC_PLUGINS,
341         AC_SYS_LARGEFILE and checking the Solaris largefile exception.
342         * aclocal.m4: Regenerate.
343         * configure: Regenerate.
344
345 2009-11-09  H.J. Lu  <hongjiu.lu@intel.com>
346
347         PR ld/10911
348         * elflink.c (elf_link_output_extsym): Don't return on
349         STT_GNU_IFUNC symbol when stripping.
350
351 2009-11-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
352
353         * elf32-hppa.c (elf32_hppa_final_link): Don't sort unwind information
354         in a relocatable link.
355         * elf64-hppa.c (elf_hppa_final_link): Likewise.
356
357 2009-11-05  Nick Clifton  <nickc@redhat.com>
358
359         * elflink.c (elf_link_add_object_symbols): Improve error
360         message generated when a symbol is left unresolved because a
361         --no-add-needed command line option has prevented the
362         inclusion of the DSO defining it.
363
364 2009-11-03  Alan Modra  <amodra@bigpond.net.au>
365             Ulrich Weigand  <uweigand@de.ibm.com>
366
367         * elf32-spu.c (mark_functions_via_relocs): Handle non-branch relocs
368         (jump tables or other references to code labels) as well.
369
370 2009-11-02  Paul Brook  <paul@codesourcery.com>
371
372         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle VFPv4
373         attributes.
374
375 2009-11-02  Alan Modra  <amodra@bigpond.net.au>
376
377         * elflink.c (elf_link_add_object_symbols): Don't force debug
378         symbols local.
379
380 2009-10-29  Johan Kristell  <johankri@axis.com>
381
382         * elf32-cris.c (cris_elf_plt_sym_val): New function.
383         (elf_backend_plt_sym_val): Define.
384
385 2009-10-27  Kai Tietz  <kai.tietz@onevision.com>
386
387         * peXXigen.c (bfdver.h): Add include.
388         (LINKER_VERSION): Do calculation based on BFD_VERSION.
389
390 2009-10-25  Maciej W. Rozycki  <macro@linux-mips.org>
391
392         * elf32-vax.c (elf_vax_relocate_section): Correct assertion.
393
394 2009-10-25  Maciej W. Rozycki  <macro@linux-mips.org>
395
396         * elf32-vax.c (elf_vax_plt_entry): Fix formatting.
397
398 2009-10-25  Maciej W. Rozycki  <macro@linux-mips.org>
399
400         * elf32-vax.c (elf_vax_relocate_section): Fix a typo.
401
402 2009-10-23  Kai Tietz  <kai.tietz@onevision.com>
403
404         * coff-x86_64.c (coff_amd64_rtype_to_howto): Subtract offset
405         of R_AMD64_PCRLONG_<X> relocations from addend.
406
407 2009-10-23  Alan Modra  <amodra@bigpond.net.au>
408
409         * plugin.c: Produce empty object if not BFD_SUPPORTS_PLUGINS.
410
411 2009-10-20  Alan Modra  <amodra@bigpond.net.au>
412
413         PR binutils/10802
414         * opncls.c (_maybe_make_executable): Make DYNAMIC files executable.
415
416 2009-10-19  Hans-Peter Nilsson  <hp@axis.com>
417
418         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_DTPREL>:
419         Don't subtract the size of the TLS block for non-shared objects
420         from the relocation.
421
422 2009-10-17  Arnold Metselaar  <arnold.metselaar@planet.nl>
423
424         * coff-z80.c (z80coff_vec): Allow sections to be of type
425         SEC_CODE or SEC_DATA
426
427 2009-10-16  Alan Modra  <amodra@bigpond.net.au>
428
429         PR binutils/10785
430         * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Don't bfd_alloc
431         bim and bim->buffer.  bfd_malloc instead.
432         * peicode.h (pe_ILF_build_a_bfd): Similarly.
433         (ILF_DATA_SIZE): Don't include bim.
434         * opncls.c (bfd_close): Test bim->buffer non-NULL before freeing.
435
436 2009-10-14  Alan Modra  <amodra@bigpond.net.au>
437
438         * aoutx.h (aout_link_check_ar_symbols): Typo fix.
439
440 2009-10-13  H.J. Lu  <hongjiu.lu@intel.com>
441
442         PR binutils/10763
443         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Declare plt
444         earlier.
445
446 2009-10-13  Alan Modra  <amodra@bigpond.net.au>
447
448         * elflink.c (_bfd_elf_merge_symbol): Revert previous patch.
449
450 2009-10-12  Roland McGrath  <roland@frob.com>
451
452         * elflink.c (elf_link_add_object_symbols, _bfd_elf_merge_symbol):
453         Fix %s that should be %B in several message formats.
454
455 2009-10-10  Alan Modra  <amodra@bigpond.net.au>
456
457         * cofflink.c (_bfd_coff_link_input_bfd): Skip section symbols for
458         excluded output sections.
459
460 2009-10-09  Tristan Gingold  <gingold@adacore.com>
461
462         * mach-o.c (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_RPATH.
463         (bfd_mach_o_bfd_print_private_bfd_data): Ditto.
464
465 2009-10-09  Tristan Gingold  <gingold@adacore.com>
466
467         * mach-o.c (bfd_mach_o_scan_read_symtab_symbols): Rename to
468         bfd_mach_o_read_symtab_symbols.
469         (bfd_mach_o_scan_write_thread): Rename to bfd_mach_o_write_thread.
470         (bfd_mach_o_scan_write_relocs): Rename to bfd_mach_o_write_relocs.
471         (bfd_mach_o_scan_write_section_32): Rename to
472         bfd_mach_o_write_section_32.
473         (bfd_mach_o_scan_write_section_64): Rename to
474         bfd_mach_o_write_section_64.
475         (bfd_mach_o_scan_write_segment_32): Rename to
476         bfd_mach_o_write_segment_32.
477         (bfd_mach_o_scan_write_segment_64): Rename to
478         bfd_mach_o_write_segment_64.
479         (bfd_mach_o_scan_write_symtab): Rename to bfd_mach_o_write_symtab.
480         (bfd_mach_o_scan_read_section_32): Rename to
481         bfd_mach_o_read_section_32.
482         (bfd_mach_o_scan_read_section_64): Rename to
483         bfd_mach_o_read_section_64.
484         (bfd_mach_o_scan_read_section): Rename to bfd_mach_o_read_section.
485         (bfd_mach_o_scan_read_symtab_strtab): Rename to
486         bfd_mach_o_read_symtab_strtab.
487         (bfd_mach_o_scan_read_symtab_symbol): Rename to
488         bfd_mach_o_read_symtab_symbol.
489         (bfd_mach_o_scan_read_dysymtab_symbol): Rename to
490         bfd_mach_o_read_dysymtab_symbol.
491         (bfd_mach_o_scan_read_dylinker): Rename to bfd_mach_o_read_dylinker.
492         (bfd_mach_o_scan_read_dylib): Rename to bfd_mach_o_read_dylib.
493         (bfd_mach_o_scan_read_prebound_dylib): Rename to
494         bfd_mach_o_read_prebound_dylib.
495         (bfd_mach_o_scan_read_thread): Rename to bfd_mach_o_read_thread.
496         (bfd_mach_o_scan_read_dysymtab): Rename to bfd_mach_o_read_dysymtab.
497         (bfd_mach_o_scan_read_symtab): Rename to bfd_mach_o_read_symtab.
498         (bfd_mach_o_scan_read_uuid): Rename to bfd_mach_o_read_uuid.
499         (bfd_mach_o_scan_read_linkedit): Rename to bfd_mach_o_read_linkedit.
500         (bfd_mach_o_scan_read_str): Rename to bfd_mach_o_read_str.
501         (bfd_mach_o_scan_read_dyld_info): Rename to bfd_mach_o_read_dyld_info.
502         (bfd_mach_o_scan_read_segment): Rename to bfd_mach_o_read_segment.
503         (bfd_mach_o_scan_read_segment_32): Rename to
504         bfd_mach_o_read_segment_32.
505         (bfd_mach_o_scan_read_segment_64): Rename to
506         bfd_mach_o_read_segment_64.
507         (bfd_mach_o_scan_read_command): Rename to bfd_mach_o_read_command.
508         * mach-o.h (bfd_mach_o_scan_read_dysymtab_symbol): Rename to
509         bfd_mach_o_read_dysymtab_symbol.
510
511 2009-10-09  Tristan Gingold  <gingold@adacore.com>
512
513         * mach-o.c (bfd_mach_o_section_get_entry_size): Moved.
514         (bfd_mach_o_section_get_nbr_indirect): Ditto.
515         (bfd_mach_o_get_synthetic_symtab): New function.
516         (bfd_mach_o_print_private_header): Print the number of commands
517         in decimal.
518         * mach-o.h (bfd_mach_o_get_synthetic_symtab): Add prototype.
519         * mach-o-target.c: Do not defined bfd_mach_o_get_synthetic_symtab.
520
521 2009-10-08  Tristan Gingold  <gingold@adacore.com>
522
523         * config.bfd: Add bfd_mach_o_i386_vec in x86_64-darwin targ_selvecs.
524
525 2009-10-06  H.J. Lu  <hongjiu.lu@intel.com>
526
527         * bfd-in2.h: Regenerated.
528
529 2009-10-02  Alan Modra  <amodra@bigpond.net.au>
530
531         * aout-cris.c (N_SHARED_LIB): Don't define.
532         * hp300bsd.c (N_SHARED_LIB): Don't define.
533         * i386bsd.c (N_SHARED_LIB): Don't define.
534         * i386linux.c (N_SHARED_LIB): Don't define.
535         * i386lynx.c (N_SHARED_LIB): Don't define.
536         * m68klinux.c (N_SHARED_LIB): Don't define.
537         * m88kmach3.c (N_SHARED_LIB): Don't define.
538         * mipsbsd.c (N_SHARED_LIB): Don't define.
539         * newsos3.c (N_SHARED_LIB): Don't define.
540         * pc532-mach.c (N_SHARED_LIB): Don't define.
541         * pdp11.c (N_SHARED_LIB): Don't define.
542         * sparclinux.c (N_SHARED_LIB): Don't define.
543         * vaxbsd.c (N_SHARED_LIB): Don't define.
544
545 2009-10-01  Dave Korn  <dave.korn.cygwin@gmail.com>
546
547         * cofflink.c (_bfd_coff_generic_relocate_section): Look for the aux
548         symbol for a weak undef in the auxbfd, not the input bfd.
549
550 2009-10-01  Ulrich Weigand  <uweigand@de.ibm.com>
551
552         * elf32-spu.c (spu_elf_auto_overlay): Insert icache linker script
553         after .toe instead of before .text section.  Set the LMA of all
554         overlay sections to their icache IA address.
555         (spu_elf_find_overlays): Determine icache set id without reference
556         to the LMA.
557
558 2009-09-30  Tristan Gingold  <gingold@adacore.com>
559
560         * configure.com: Use hosts/alphavms.h on both alpha and ia64 VMS.
561
562 2009-09-29  H.J. Lu  <hongjiu.lu@intel.com>
563
564         * elf64-x86-64.c (elf64_x86_64_append_rela): New.
565         (elf64_x86_64_relocate_section): Use it.
566         (elf64_x86_64_finish_dynamic_symbol): Likewise.
567
568 2009-09-29  DJ Delorie  <dj@redhat.com>
569
570         * Makefile.am (ALL_MACHINES): Add cpu-rx.lo.
571         (ALL_MACHINES_CFILES): Add cpu-rx.c.
572         (BFD32_BACKENDS): Add elf32-rx.lo.
573         (BFD32_BACKENDS_CFILES): Add elf32-rx.c.
574         * archures.c (bfd_architecture): Add bfd_arch_rx and bfd_mach_rx.
575         Export bfd_rx_arch.
576         (bfd_archures_list): Add bfd_rx_arch.
577         * config.bfd: Add entry for rx-*-elf.
578         * configure.in: Add entries for bfd_elf32_rx_le_vec and
579         bfd_elf32_rx_be_vec.
580         * reloc.c: Add RX relocations.
581         * targets.c: Add RX target vectors.
582         * Makefile.in: Regenerate.
583         * bfd-in2.h: Regenerate.
584         * configure: Regenerate.
585         * libbfd.h: Regenerate.
586         * cpu-rx.c: New file.
587         * elf32-rx.c: New file.
588
589 2009-09-29 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
590
591         * elf32-cr16.c (elf32_cr16_relocate_section): Removed
592         info->relocatable to fix the ld/testsuites/ld-elf/linkonce1 test case.
593
594 2009-09-28  Nick Clifton  <nickc@redhat.com>
595
596         PR 10478: Accepting Solaris binaries.
597         * elf.c (bfd_section_from_shdr): Allow SHN_BEFORE and SHN_AFTER
598         section link values in x86 binaries.
599         * elfcode.h (elf_object_p): Likewise.
600
601 2009-09-28  Philippe De Muyter  <phdm@macqel.be>
602
603         * elf32-m68k.c (elf_m68k_final_write_processing): New function.
604         (elf_backend_final_write_processing): Macro defined as above function.
605
606 2009-09-25  Martin Thuresson  <martint@google.com>
607
608         Update sources to make alpha and arm targets compile cleanly with
609         -Wc++-compat:
610         * ecoff.c: Add casts.
611         * ecofflink.c: Add casts.
612         * elf64-alpha.c: Add casts.
613         (struct alpha_elf_got_entry, struct alpha_elf_reloc_entry): Move
614         to top level.
615         (SKIP_HOWTO): Use enum name.
616         * elf32-arm.c: Add casts.
617         (elf32_arm_vxworks_bed): Update code to avoid multiple
618         declarations.
619         (struct map_stub): Move to top level.
620
621 2009-09-24  H.J. Lu  <hongjiu.lu@intel.com>
622
623         PR ld/10630
624         * elflink.c (elf_link_output_extsym): Turn off visibility on
625         local symbol.
626         (bfd_elf_final_link): Turn off visibility on dynamic local
627         symbol.
628
629 2009-09-24  Alan Modra  <amodra@bigpond.net.au>
630
631         PR binutils/10654
632         * dwarf2.c (lookup_address_in_line_info_table): Remove workaround
633         for invalid location lists generated by gcc-2.95 and Intel 6.0 C++.
634         Remove "function" parm, adjust caller.
635
636 2009-09-23  Matt Rice  <ratmice@gmail.com>
637
638         * bfd-in.h (bfd_elf_size_dynamic_sections): Add audit and depaudit
639         arguments.
640         * elflink.c (bfd_elf_size_dynamic_sections): Generate DT_AUDIT,
641         DT_DEPAUDIT from audit/depaudit arguments.
642         (elf_finalize_dynstr): Finalize DT_AUDIT and DT_DEPAUDIT strtab entries.
643         (elf_link_add_object_symbols): Set dt_audit target data when finding a
644         DT_AUDIT.
645         * bfd-in2.h: Regenerate.
646         * bfd-elf.h: Add dt_audit to elf_obj_tdata, and elf_dt_audit macro.
647
648 2009-09-23  Jie Zhang  <jie.zhang@analog.com>
649
650         * elf32-bfin.c (_bfinfdpic_size_got_plt): Make sure empty
651         .rel.plt and .plt sections are removed.
652         (elf32_bfinfdpic_size_dynamic_sections): Remove empty .dynbss
653         section.  Remove the duplicated removing of empty .rel.plt
654         section.
655
656 2009-09-21  Richard Sandiford  <rdsandiford@googlemail.com>
657
658         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Extend previous
659         patch to handle the new personality relaxation.
660
661 2009-09-21  Richard Sandiford  <rdsandiford@googlemail.com>
662
663         * elf-eh-frame.c (make_pc_relative): New function.
664         (_bfd_elf_write_section_eh_frame): Use it.
665
666 2009-09-21  Alan Modra  <amodra@bigpond.net.au>
667
668         * elf32-ppc.c (TLS_GET_ADDR_GLINK_SIZE): Define.
669         (ADD_3_12_2, BEQLR, CMPWI_11_0, LWZ_11_3, LWZ_12_3): Define.
670         (MR_0_3, MR_3_0): Define.
671         (struct ppc_elf_link_hash_table): Add no_tls_get_addr_opt.
672         (ppc_elf_select_plt_layout): Save emit_stub_syms param earlier.
673         (ppc_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash
674         table.  Check for presense of __tls_get_addr_opt
675         (allocate_dynrelocs): Increase glink entry size for __tls_get_addr.
676         (ppc_elf_size_dynamic_sections): Add DT_PPC_TLS_OPT tag.
677         (write_glink_stub): Add param p.
678         (ppc_elf_relocate_section): Adjust write_glink_stub call.
679         (ppc_elf_finish_dynamic_symbol): Emit special glink call stub for
680         __tls_get_addr.
681         * elf32-ppc.h (ppc_elf_tls_setup): Update prototype.
682         * elf64-ppc.c (struct ppc_link_hash_table): Add no_tls_get_addr_opt.
683         (ppc64_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash
684         table.  Check for presense of __tls_get_addr_opt.
685         (ppc64_elf_size_dynamic_sections): Add DT_PPC64_TLS_OPT tag.
686         (LD_R11_0R3, LD_R12_0R3, MR_R0_R3, CMPDI_R11_0, ADD_R3_R12_R13,
687         BEQLR, MR_R3_R0, MFLR_R11, STD_R11_0R1, BCTRL, LD_R11_0R1,
688         LD_R2_0R1, MTLR_R11): Define.
689         (build_tls_get_addr_stub): New function.
690         (ppc_build_one_stub): Call it.
691         (ppc_size_one_stub): Add extra size for __tls_get_addr stub.
692         (ppc64_elf_relocate_section): Don't change nop to ld 2,40(1) for
693         __tls_get_addr plt call.
694         * elf64-ppc.h (ppc64_elf_tls_setup): Update prototype.
695
696 2009-09-19  Richard Sandiford  <rdsandiford@googlemail.com>
697
698         * elf-bfd.h (eh_cie_fde): Add personality_offset and
699         make_per_encoding_relative to the CIE structure.  Add a padding field.
700         * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Use 0x70
701         rather than 0xf0 when masking out the base address encoding
702         Record the offset of personality data from the start of the CIE.
703         Remove a repeated elf_backend_can_make_relative_eh_frame check.
704         (find_merged_cie): Take an info argument.  If the personality
705         binds locally, try converting an absolute personality into
706         a local one.
707         (_bfd_elf_discard_section_eh_frame): Use 0x70 rather than 0xf0
708         when masking out the base address encoding.  Update the call to
709         find_merged_cie.
710         (_bfd_elf_eh_frame_section_offset): Discard relocations against
711         the personality data if we are converting into PC-relative form.
712         (_bfd_elf_write_section_eh_frame): Use 0x70 rather than 0xf0
713         when masking out the base address encoding.  Handle
714         make_per_encoding_relative.
715
716 2009-09-18  Alan Modra  <amodra@bigpond.net.au>
717
718         PR ld/10406
719         * elf32-ppc.c (ppc_elf_howto_raw): Make R_PPC_EMB_SDAI16 and
720         R_PPC_EMB_SDA2I16 complain_overflow_signed.
721         (create_sdata_sym): Pass info rather than htab.
722         Update all callers.  Ensure symbols are hidden.
723         (ppc_elf_check_relocs): Allow SDAREL16 when shared.
724         (ppc_elf_size_dynamic_sections): When shared, equate _SDA_BASE_ to
725         _GLOBAL_OFFSET_TABLE_.
726         (elf_finish_pointer_linker_section): Don't assume that sdata base
727         symbol is always at 0x8000 offset.  Don't subtract the addend here.
728         (is_static_defined): New function.
729         (ppc_elf_relocate_section): Verify symbol base used in SDA relocs
730         is statically defined.  Clear addend for EMB_SDAI16 and EMB_SDA2I16
731         relocs.  Downgrade error on unexpected section for EMB_SDA2REL
732         reloc symbols to a warning.
733
734 2009-09-18  Nick Clifton  <nickc@redhat.com>
735
736         * po/es.po: Updated Spanish translation.
737         * po/vi.po: Updated Vietnamese translation.
738
739 2009-09-18  Alan Modra  <amodra@bigpond.net.au>
740
741         * elf64-ppc.c (follow_link, elf_follow_link, ppc_follow_link): New
742         functions.  Use throughout.
743         (ppc64_elf_copy_indirect_symbol): Set direct symbol "oh" field
744         from indirect symbol.
745         (lookup_fdh): Rename from get_fdh.  Follow indirect sym links.
746         (add_symbol_adjust): Simplify.
747         (defined_code_entry, defined_func_desc): New functions.
748         (ppc64_elf_gc_keep): Follow indirect sym links.  Use defined_code_entry.
749         (ppc64_elf_gc_mark_dynamic_ref): Use defined_func_desc and
750         defined_code_entry to follow indirect sym links.
751         (ppc64_elf_gc_mark_hook, func_desc_adjust): Likewise.
752         (ppc_type_of_stub): Follow indirect sym links.
753         (toc_adjusting_stub_needed): Likewise.
754         (ppc_build_one_stub): Likewise.  Make undefined dot-symbols weak
755         rather than defining them at stub.
756         (ppc64_elf_relocate_section): Rewrite call test to avoid multiple
757         assignments in test.
758
759 2009-09-16  Tristan Gingold  <gingold@adacore.com>
760
761         * mach-o.h (bfd_mach_o_filetype): Add new constants from darwin10.
762         Reindent.
763         * mach-o.c (bfd_mach_o_cpu_name): Reindent.
764         (bfd_mach_o_filetype_name): Complete with new constants.  Reindent.
765         (bfd_mach_o_print_private_header): Use fputs instead of fprintf
766         when possible to avoid warnings.
767         (bfd_mach_o_print_section_map): Ditto.
768         (bfd_mach_o_section_get_entry_size): New function.
769         (bfd_mach_o_section_get_nbr_indirect): Simplify using the newly
770         added function.
771         (bfd_mach_o_print_dysymtab): Print address of indirect symbols.
772
773 2009-09-14  Nick Clifton  <nickc@redhat.com>
774
775         * po/fi.po: Updated Finnish translation.
776
777 2009-09-11  Nick Clifton  <nickc@redhat.com>
778
779         * po/bfd.pot: Updated by the Translation project.
780
781 2009-09-11  Philippe De Muyter  <phdm@macqel.be>
782
783         * binary.c (binary_object_p): Remove bfd_external_binary_architecture
784         hack.  objcopy `-B' (`--binary-architecture') option is now handled
785         in a generic way.
786
787 2009-09-11  Nick Clifton  <nickc@redhat.com>
788
789         * rs6000-core.c (read_hdr): Fix typo in recent C++ compatibility
790         changes.
791
792 2009-09-11  Jie Zhang  <jie.zhang@analog.com>
793
794         * elf32-bfin.c (bfinfdpic_relocs_info_find): Just return
795         NULL if `ht' is NULL.
796
797 2009-09-09  Martin Thuresson  <martin@mtme.org>
798
799         Update sources to compile cleanly with -Wc++-compat:
800         * aoutx.h: Add casts.
801         * archive.c: Add casts.
802         * archive64.c: Add casts.
803         * archures.c: Add casts.
804         * bfd-in2.h: Regenerated.
805         * bfd.c: Add casts. (enum bfd_direction): Move out to top level.
806         * bfdio.c: Add casts.
807         * binary.c: Add casts.
808         * cache.c (cache_bseek,cache_bread_1,cache_bwrite): Updated
809         parameter to use enum value instead of int.
810         * coffcode.h: Add casts.
811         * coffgen.c: Add casts.
812         * cofflink.c: Add casts.
813         * compress.c: Add casts.
814         * dwarf1.c: Add casts.
815         * dwarf2.c: Add casts. (struct dwarf2_debug): Rename member bfd to
816         bfd_ptr. Update code to use new name.
817         * elf-attrs.c: Add casts.
818         * elf-bfd.h (elf_link_virtual_table_entry): Gives name to
819         anonymous struct. (union gotplt_union, struct
820         elf_link_virtual_table_entry): Move to top level.
821         * elf-eh-frame.c: Add casts.
822         * elf-strtab.c: Add casts.
823         * elf.c: Add casts. (_bfd_elm_make_Section_from_phdr): Change
824         argument name from typename to type_name.
825         * elf32-i386.c: Add casts.
826         * elf64-x86-64.c: Add casts.
827         * elfcode.h: Add casts.
828         * elfcore.h: Add casts.
829         * elflink.c: Add casts.
830         * format.c: Add casts.
831         * hash.c: Add casts.
832         * ihex.c: Add casts.
833         * libaout.h (enum aout_subformat, enum aout_magic): Move to top
834         level.
835         * libbfd.c: Add casts.
836         * linker.c: Add casts.
837         * merge.c: Add casts.
838         * opncls.c: Add casts.
839         * peXXigen.c: Add casts.
840         * peicode.h: Add casts.
841         * reloc.c: Add casts.
842         * section.c: Add casts.
843         * simple.c: Add casts.
844         * srec.c: Add casts.
845         * stabs.c: Add casts.
846         * syms.c: Add casts.
847         * targets.c: Add casts.
848         * tekhex.c: Add casts.
849         * verilog.c: Add casts.
850
851 2009-09-09  Paolo Bonzini  <bonzini@gnu.org>
852
853         * configure: Regenerate.
854
855 2009-09-09  Daniel Jacobowitz  <dan@codesourcery.com>
856
857         * elf32-arm.c (elf32_arm_final_link_relocate): Set sym_flags
858         for the mode of target PLT entries.
859         (allocate_dynrelocs): Only adjust symbol type if setting its
860         value.
861
862 2009-09-09  Paolo Bonzini  <bonzini@gnu.org>
863
864         * configure: Regenerate.
865
866 2009-09-09  Nick Clifton  <nickc@redhat.com>
867
868         PR 10478:
869         * elf.c (bfd_section_from_shdr): Do not reject sparc binaries with
870         section headers containing sh_link values of SHN_BEFORE or
871         SHN_AFTER.
872         * elfcode.h (elf_object_p): Likewise.
873
874 2009-09-09  Tristan Gingold  <gingold@adacore.com>
875
876         Handle DYLD_INFO introduced by Darwin10.
877         * mach-o.h (bfd_mach_o_load_command_type): Add
878         BFD_MACH_O_LC_DYLD_INFO.
879         (bfd_mach_o_dyld_info_command): New type.
880         (bfd_mach_o_load_command): Add dyld_info field.
881         * mach-o.c (bfd_mach_o_scan_read_str): Reduce size of buf.
882         (bfd_mach_o_scan_read_dyld_info): New function.
883         (bfd_mach_o_scan_read_command): Handle BFD_MACH_O_LC_DYLD_INFO.
884         (bfd_mach_o_bfd_print_private_bfd_data): Ditto.
885         (bfd_mach_o_load_command_name): AddB FD_MACH_O_LC_DYLD_INFO.
886         (bfd_mach_o_print_dyld_info): New function.
887
888 2009-09-09  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
889
890         * elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the
891         linkonce or linker script discarded section.
892
893 2009-09-09  Alan Modra  <amodra@bigpond.net.au>
894
895         * elf32-xtensa.c (elf_xtensa_relax_section): Delete -r check.
896
897 2009-09-07  Andreas Schwab  <schwab@linux-m68k.org>
898
899         * elf32-m68k.c (rtype_to_howto): If the reloc index is out of
900         range call the bfd error hander and use R_68K_NONE instead.
901
902 2009-09-07  Tristan Gingold  <gingold@adacore.com>
903
904         * po/SRC-POTFILES.in: Regenerate.
905         * po/bfd.pot: Regenerate.
906
907         * bfd.m4 (BFD_HAVE_TIME_TYPE_MEMBER,
908         BFD_HAVE_SYS_STAT_TYPE_MEMBER): Moved to gas/acinclude.m4
909         * configure.in: Move tests for tm_gmtoff, st_mtim.tv_sec and
910         st_mtim.tv_nsec to gas/configure.in
911         (bfd_elf64_ia64_vms_vec): Remove vmsutil.lo
912         * configure: Regenerate.
913         * config.in: Regenerate.
914         * vmsutil.c: Moved to gas/config/te-vms.c
915         * vmsutil.h: Removed.
916         * Makefile.am (BFD32_BACKENDS_CFILES): Remove vmsutil.c
917         (BFD32_BACKENDS): Remove vmsutil.lo
918         * Makefile.in: Regenerate.
919
920 2009-09-05  Eli Zaretskii  <eliz@gnu.org>
921
922         * coffcode.h: Include libiberty.h.
923
924 2009-09-05  Martin Thuresson  <martin@mtme.org>
925
926         * coff-arm.c (coff_arm_relocate_section)
927         (record_thumb_to_arm_glue, bfd_arm_process_before_allocation):
928         Change member name class to symbol_class.
929         * coff-i960.c (coff_i960_relocate_section) Rename variable
930         class to class_val. Change member name class to symbol_class.
931         * coff-rs6000.c (_bfd_xcoff_swap_aux_in)
932         (_bfd_xcoff_swap_aux_out): Rename arguments class to in_class.
933         * coff-stgo32.c (adjust_aux_in_post)
934         (adjust_aux_out_pre, adjust_aux_out_post): Rename arguments class
935         to in_class.
936         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in)
937         (_bfd_xcoff64_swap_aux_out): Rename arguments class to in_class.
938         * coffcode.h (coff_pointerize_aux_hook): Rename variable class
939         to n_sclass.
940         * coffgen.c (coff_write_symbol, coff_pointerize_aux): Rename
941         variables named class to n_sclass. (coff_write_symbols): Rename
942         variable class to sym_class. (bfd_coff_set_symbol_class): Rename
943         argument class to symbol_class.
944         * cofflink.c (_bfd_coff_link_hash_newfunc)
945         (coff_link_add_symbols, _bfd_coff_link_input_bfd)
946         (_bfd_coff_write_global_sym, _bfd_coff_generic_relocate_section):
947         Update code to use renamed members.
948         * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Rename
949         argument class to in_class.
950         * libcoff-in.h (struct coff_link_hash_entry, struct
951         coff_debug_merge_type) Renamed members class to symbol_class and
952         type_class.
953         * libcoff.h Regenerated.
954         * peXXigen.c: (_bfd_XXi_swap_aux_in, _bfd_XXi_swap_aux_out):
955         Rename argument class to in_class.
956         * pef.c (bfd_pef_parse_imported_symbol): Update code to use
957         renamed members.
958         * pef.h (struct bfd_pef_imported_symbol): Changed name of
959         member class to symbol_class.
960
961 2009-09-04  H.J. Lu  <hongjiu.lu@intel.com>
962
963         * configure: Regenerated.
964
965 2009-09-04  Tristan Gingold  <gingold@adacore.com>
966
967         * configure.in: Bump version to 2.20.51
968
969 2009-09-04  Alan Modra  <amodra@bigpond.net.au>
970
971         * elf32-spu.c (spu_elf_relocate_section): Correct 2009-07-24 logic.
972
973 2009-09-04  Jie Zhang  <jie.zhang@analog.com>
974
975         * elf32-bfin.c (elf32_bfinfdpic_create_dynamic_sections): Always
976         create .rela.bss.
977         (elf32_bfinfdpic_size_dynamic_sections): Set SEC_EXCLUDE flag
978         for empty .rela.bss and .rel.plt sections.
979
980 2009-09-03  Adam Nemet  <anemet@caviumnetworks.com>
981
982         * elfxx-mips.c (mips_elf_calculate_relocation): Don't relocate
983         R_MIPS_JALR unless symbol resolves locally.
984
985 2009-09-03  Adam Nemet  <anemet@caviumnetworks.com>
986
987         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Don't set
988         has_static_relocs for R_MIPS_JALR.
989
990 2009-09-03  Maciej W. Rozycki  <macro@codesourcery.com>
991
992         * elf64-mips.c (mips_elf64_howto_table_rela): Add support for
993         R_MIPS_TLS_DTPMOD64 and R_MIPS_TLS_TPREL64, replacing the
994         respective stubs.
995
996 2009-09-01  H.J. Lu  <hongjiu.lu@intel.com>
997
998         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Declare
999         plt earlier.
1000
1001 2009-09-01  Tristan Gingold  <gingold@adacore.com>
1002
1003         * makefile.vms: Ported to Itanium VMS.  Remove useless variable and
1004         dependencies.  Reindent.
1005         * configure.com: Ported to Itanium VMS.  Now generates a build.com
1006         to build without make.  Add messages but make edit silent.
1007         * hosts/alphavms.h: Add a prototype for stpcpy.
1008         * vms.c: Add a missing include for Alpha VMS.
1009         * elfxx-ia64.c (ELF_OSABI): Define for OpenVMS.
1010
1011 2009-08-31  Jan Beulich  <jbeulich@novell.com>
1012
1013         * elf-bfd.h (bfd_elf_get_default_section_type): Declare.
1014         * elf.c (bfd_elf_get_default_section_type): New.
1015         (elf_fake_sections): Use bfd_elf_get_default_section_type.
1016
1017 2009-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1018
1019         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert the
1020         accidental checkin.
1021         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likwise.
1022
1023 2009-08-30  Alan Modra  <amodra@bigpond.net.au>
1024
1025         PR ld/10569
1026         * bfd.c (bfd_emul_get_maxpagesize): Don't abort.
1027         (bfd_emul_get_commonpagesize): Likewise.
1028
1029 2009-08-29  Martin Thuresson  <martin@mtme.org>
1030
1031         * elf32-arm.c (struct stub_def): Rename member template to
1032         template_sequence. (arm_build_one_stub,
1033         find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub):
1034         Rename variable template to template_sequence.
1035         * elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl):
1036         Rename variable template to template_val.
1037         * aoutx.h (NAME (aout, make_empty_symbol)): Rename variable
1038         new to new_symbol.
1039         * coffgen.c (coff_make_empty_symbol)
1040         (coff_bfd_make_debug_symbol): Rename variable new to new_symbol.
1041         * cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable
1042         new to new_insn.
1043         * ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new
1044         to new_symbol.
1045         * elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument
1046         new to new_reloc.
1047         * hash.c (bfd_hash_lookup): Rename variable new to new_string.
1048         * ieee.c (ieee_make_empty_symbol): Rename variable new to
1049         new_symbol.
1050         * linker.c (bfd_new_link_order): Rename variable new to
1051         new_lo.
1052         * mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to
1053         symbol.
1054         * oasys.c (oasys_make_empty_symbol): Rename variable new to
1055         new_symbol_type.
1056         * pdp11.c (NAME (aout, make_empty_symbol)): Rename variable
1057         new to new_symbol_type.
1058         * plugin.c (bfd_plugin_make_empty_symbol): Rename variable new
1059         to new_symbol.
1060         * rs6000-core.c (CoreHdr, VmInfo): Rename union member new to
1061         new_dump.
1062         (read_hdr, rs6000coff_core_p)
1063         (rs6000coff_core_file_matches_executable_p)
1064         (rs6000coff_core_file_failing_command)
1065         (rs6000coff_core_file_failing_signal): Updated function to use new
1066         union member name.
1067         * som.c (som_make_empty_symbol): Rename variable new to
1068         new_symbol_type.
1069         * syms.c (_bfd_generic_make_empty_symbol): Rename variable new
1070         to new_symbol.
1071         * tekhex.c (first_phase, tekhex_make_empty_symbol): Rename
1072         variable new to new_symbol.
1073
1074 2009-08-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1075
1076         * acinclude.m4 (AM_INSTALL_LIBBFD): Call AM_SUBST_NOTMAKE for
1077         bfdlibdir and bfdincludedir.
1078         * Makefile.am (bfdlibdir, bfdincludedir): Move definition ...
1079         [INSTALL_LIBBFD]: ... here, ...
1080         [INSTALL_LIBBFD]: ... and empty overrides here.
1081         [!INSTALL_LIBBFD]: (rpath_bfdlibdir): New variable.
1082         [!INSTALL_LIBBFD] (libbfd_la_LDFLAGS): Use it.
1083         * Makefile.in: Regenerate.
1084         * configure: Regenerate.
1085
1086 2009-08-26  Maxim Kuvyrkov  <maxim@codesourcery.com>
1087
1088         * elf32-m68k.c: Rewrite initialization of GOT entries for TLS
1089         relocations.  Rewrite output of dynamic TLS relocations.
1090         (DTP_OFFSET, TP_OFFSET): New constants.
1091         (dtpoff_base): Update.
1092         (tpoff): Rename to tpoff_base, update.
1093         (elf_m68k_init_got_entry_static, elf_m68k_init_got_entry_local_shared):
1094         New functions.  Move code from elf_m68k_relocate_section here.
1095         (elf_m68k_relocate_section): Update.
1096         (elf_m68k_finish_dynamic_symbol): Fix handling of local TLS symbols.
1097
1098 2009-08-26  Maxim Kuvyrkov  <maxim@codesourcery.com>
1099
1100         * elf32-m68k.c (elf_m68k_copy_indirect_symbol): Propagate
1101         non_got_ref value.
1102         (elf_m68k_check_relocs): Handle dynamic TLS relocations.
1103         Handle non_got_ref field.
1104         (elf_m68k_adjust_dynamic_symbol): Handle non_got_ref field.
1105
1106 2009-08-26  Alan Modra  <amodra@bigpond.net.au>
1107
1108         PR ld/10518
1109         * linker.c (bfd_find_version_for_sym): Revert warning.
1110
1111 2009-08-26  Alan Modra  <amodra@bigpond.net.au>
1112
1113         PR ld/10518
1114         * linker.c (bfd_find_version_for_sym): Override a "*" match by any
1115         other wildcard match.  Warn on multiple wildcard matches.
1116
1117 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1118
1119         * Makefile.am (libbfd_la_LDFLAGS): Initialize early, to allow
1120         appending.
1121         [INSTALL_LIBBFD] (bfdlib_LTLIBRARIES, bfdinclude_HEADERS): Set
1122         only in this condition.
1123         [!INSTALL_LIBBFD] (noinst_LTLIBRARIES, libbfd_la_LDFLAGS): New,
1124         to build but not install libbfd.la in this condition.
1125         (install-bfdlibLTLIBRARIES, uninstall-bfdlibLTLIBRARIES)
1126         (install_libbfd, install_libbfd): Remove.
1127         * Makefile.in: Regenerate.
1128         * doc/Makefile.am (AM_CPPFLAGS): Renamed from ...
1129         (INCLUDES): ... this.
1130         ($(MKDOC)): Adjust.
1131         * doc/Makefile.in: Regenerate.
1132
1133         * Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, instead use
1134         no-dist and foreign.
1135         (EXTRA_libbfd_la_SOURCES): New, list $(CFILES) to allow
1136         dependency tracking to work for them.
1137         (targets.lo, archures.lo, dwarf.lo): Rewrite to
1138         use automake dependency tracking mechanism.
1139         (MKDEP, DEP, DEP1, dep.sed, dep, dep-in, dep-am): Remove.
1140         (mkdep section): Remove.
1141         (BUILT_SOURCES): New, list $(BUILD_HFILES).
1142         * Makefile.in: Regenerate.
1143         * po/SRC-POTFILES.in, po/bfd.pot: Regenerate.
1144
1145         * Makefile.am (datarootdir, docdir, htmldor, pdfdir)
1146         (install-pdf, install-pdf-recursive, install-html)
1147         (install-html-recursive): Remove.
1148         * Makefile.in: Regenerate.
1149
1150         * Makefile.in: Regenerate.
1151         * aclocal.m4: Likewise.
1152         * config.in: Likewise.
1153         * configure: Likewise.
1154
1155 2009-08-21  Daniel Gutson  <dgutson@codesourcery.com>
1156
1157         * elf32-arm.c (arch_has_thumb2_nop): New function.
1158         (arch_has_arm_nop): New function.
1159         (elf32_arm_final_link_relocate): NOP opcodes changed.
1160
1161 2009-08-16  Doug Evans  <dje@google.com>
1162
1163         * opncls.c (bfd_close): Until BFD_IN_MEMORY has an iovec,
1164         at least don't leak memory.
1165
1166 2009-08-13  DJ Delorie  <dj@redhat.com>
1167
1168         * elf32-m32c.c (m32c_elf_relax_delete_bytes): Adjust symbol sizes
1169         if needed.
1170
1171 2009-08-12  Nick Clifton  <nickc@redhat.com>
1172
1173         * po/fi.po: Updated Finnish translation.
1174
1175 2009-08-11  Bernd Schmidt  <bernd.schmidt@analog.com>
1176
1177         Merge some FRV FDPIC changes into the Blackfin code.
1178         * elf32-bfin.c (struct bfinfdpic_elf_link_hash_table): Add pointer to
1179         summary reloc information.
1180         (bfinfdpic_dynamic_got_plt_info): New.
1181         (_bfin_create_got_section): Create the PLT section here.
1182         (elf32_bfinfdpic_create_dynamic_sections): Not here.
1183         (_bfinfdpic_count_nontls_entries): Move out of...
1184         (_bfinfdpic_count_got_plt_entries): ... here.
1185         (_bfinfdpic_count_relocs_fixups): Likewise.
1186         (_bfinfdpic_reset_got_plt_entries): New.
1187         (_bfinfdpic_size_got_plt): Move out of...
1188         (elf32_bfinfdpic_size_dynamic_sections): ... here.
1189         (bfinfdpic_relocate_section): Be careful not to call
1190         _bfinfdpic_add_rofixup or _bfinfdpic_add_dyn_reloc for deleted relocs.
1191         (bfinfdpic_check_discarded_relocs, bfinfdpic_elf_discard_info):
1192         New functions.
1193         (elf_backend_discard_info): Define for FD-PIC.
1194
1195 2009-08-11  Alan Modra  <amodra@bigpond.net.au>
1196
1197         * elflink.c: Add FIXMEs for some places that require octets_per_byte
1198         adjustments.
1199         * elf-eh-frame.c: Likewise.
1200         * merge.c: Likewise.
1201
1202 2009-08-11  Alan Modra  <amodra@bigpond.net.au>
1203
1204         * configure.in:  Remove elf-ifunc.lo from common ELF files.  Add
1205         to x86 and x86_64 configurations.
1206         * configure: Regenerate.
1207
1208 2009-08-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1209
1210         Stop using bfd_usrdata in libbfd.
1211         * coff-stgo32.c (bfd_coff_go32stub): Remove.
1212         (stub_bytes, comment): Replace STUBSIZE by GO32_STUBSIZE.
1213         (adjust_filehdr_in_post): Declare the abfd parameter as unused.
1214         Replace STUBSIZE by GO32_STUBSIZE.  Save now the stub in
1215         filehdr_dst->u.go32.stub.  New comment with the reason.
1216         (adjust_filehdr_out_pre): Replace STUBSIZE by GO32_STUBSIZE.
1217         Substitute the removed macro bfd_coff_go32stub.
1218         (adjust_filehdr_out_post, adjust_scnhdr_in_post, adjust_scnhdr_out_pre)
1219         (adjust_scnhdr_out_post, adjust_aux_in_post, adjust_aux_out_pre)
1220         (adjust_aux_out_post): Replace STUBSIZE by GO32_STUBSIZE.
1221         (create_go32_stub, go32_stubbed_coff_bfd_copy_private_bfd_data):
1222         Replace STUBSIZE by GO32_STUBSIZE.  Substitute the removed macro
1223         bfd_coff_go32stub.
1224         * coffcode.h (coff_mkobject_hook): Initialize coff->go32stub.
1225         * libcoff-in.h (coff_data_type): New field go32stub.
1226         * libcoff.h: Regenerated.
1227
1228 2009-08-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1229
1230         Fix go32 stub preservation by objcopy.
1231         * coff-stgo32.c (adjust_filehdr_in_post): Use bfd_malloc.
1232         (go32_stubbed_coff_bfd_copy_private_bfd_data): Optionally allocate OBFD
1233         go32stub.
1234
1235 2009-08-10  Nathan Sidwell  <nathan@codesourcery.com>
1236
1237         * elf32-arm.c (elf32_arm_size_stubs): Don't die on undefined local
1238         symbols.
1239         (elf32_arm_final_link_relocate): Treat local undefined symbols the
1240         same as global undefined symbols.
1241         (elf32_arm_relocate_section): Give an error for local undefined
1242         non-weak symbols, unless the reloc will not use the symbol.
1243
1244 2009-08-10  Nathan Sidwell  <nathan@codesourcery.com>
1245
1246         * elf32-ppc.c (shared_stub_entry, stub_entry): Use r12, not r11.
1247         (ppc_elf_relax_section): Use symbol index to distinguish
1248         relocatable stubs.
1249
1250 2009-08-10  Alan Modra  <amodra@bigpond.net.au>
1251
1252         * elf32-ppc.c (ppc_elf_relax_section): Ignore non-code sections.
1253
1254 2009-08-10  Alan Modra  <amodra@bigpond.net.au>
1255
1256         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Don't clear plt
1257         info for STT_GNU_IFUNC.
1258         * elf32-ppc.c (ppc_elf_check_relocs): Count a needed plt entry
1259         on got refs in case the symbol turns out to be ifunc.
1260         (ppc_elf_gc_sweep_hook): Similarly.
1261         (ppc_elf_adjust_dynamic_symbol): Adjust assertion.
1262         (allocate_dynrelocs): Don't specially allocate got relocs for ifunc.
1263         (ppc_elf_size_dynamic_sections): Likewise.
1264         (ppc_elf_relocate_section): Likewise.
1265
1266 2009-08-09  Bernd Schmidt  <bernd.schmidt@analog.com>
1267
1268         From Mike Frysinger <michael.frysinger@analog.com>
1269         * elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs,
1270         bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook,
1271         _bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section,
1272         bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs,
1273         bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs):
1274         Adjust to match the renamed reloc definitions.
1275
1276 2009-08-08  Alan Modra  <amodra@bigpond.net.au>
1277
1278         PR 10494
1279         * elf.c (_bfd_elf_make_section_from_shdr): When setting up section
1280         LMAs, use ELF_IS_SECTION_IN_SEGMENT to match sections with headers.
1281
1282 2009-08-07  Tom Tromey  <tromey@redhat.com>
1283
1284         * elf32-microblaze.c (microblaze_elf_check_relocs): Avoid strict
1285         aliasing error.
1286
1287 2009-08-06  Michael Eager <eager@eagercon.com>
1288
1289         * Makefile.am: Add cpu-microblaze.{lo,c}, elf32-microblaze.{lo,c}.
1290         * Makefile.in: Regenerate.
1291         * archures.c: Add bfd_arch_microblaze.
1292         * bfd-in2.h: Regenerate.
1293         * config.bfd: Add microblaze target.
1294         * configure.in: Add bfd_elf32_microblaze_vec target.
1295         * configure: Regenerate.
1296         * cpu-microblaze.c: New.
1297         * elf32-microblaze.c: New.
1298         * libbfd-in.h: Add prototype _bfd_dwarf2_fixup_section_debug_loc().
1299         * libbfd.h: Regenerate.
1300         * reloc.c: Add MICROBLAZE relocations.
1301         * section.c: Add struct relax_table and relax_count to section.
1302         * targets.c: Add bfd_elf32_microblaze_vec.
1303
1304 2009-08-06  Jakub Jelinek  <jakub@redhat.com>
1305             Alan Modra  <amodra@bigpond.net.au>
1306
1307         PR binutils/10492
1308         * elf.c (sym_is_global): Return true even for BSF_GNU_UNIQUE
1309         symbols.
1310         * elf32-mips.c (mips_elf_sym_is_global): Likewise.
1311         * elfn32-mips.c (mips_elf_sym_is_global): Likewise.
1312
1313 2009-08-06  Nathan Sidwell  <nathan@codesourcery.com>
1314
1315         * elf32-arm.c (elf32_arm_size_stubs): Call layout_sections_again
1316         at least once when fixing cortex-a8.
1317
1318 2009-08-05  Chao-ying Fu  <fu@mips.com>
1319
1320         * elf32-mips.c (mips_reloc_map): Add BFD_RELOC_MIPS_JALR.
1321         * elfxx-mips.c (JAL_TO_BAL_P): New define to transform JAL to BAL
1322         for CPUs.  It is true for RM9000.
1323         (JALR_TO_BAL_P): New define to transform JALR to BAL.  It is true
1324         for all CPUs.
1325         (mips_elf_perform_relocation): Use JAL_TO_BAL_P and JALR_TO_BAL_P
1326         to guard the transformation.
1327
1328 2009-08-05  Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
1329
1330         * elf32-spu.h (spu_elf_params): Add member emit_fixups.
1331         (spu_elf_size_sections): Declare prototype.
1332         * elf32-spu.c (spu_link_hash_table): Add member sfixup.
1333         (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros.
1334         (spu_elf_emit_fixup): New function.
1335         (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32.
1336         (spu_elf_size_sections): New function.
1337
1338 2009-08-05  Nathan Sidwell  <nathan@codesourcery.com>
1339
1340         * elf32-arm.c (elf32_arm_stub_type): Add arm_stub_a8_veneer_lwm.
1341         (arm_build_one_stub): Build a8 veneers as a separate pass.
1342         (cortex_a8_erratum_scan): Add prev_num_a8_fixes and stub_changed_p
1343         parameters.  Use them to check if we create a different a8 fixup
1344         than the previous pass.
1345         (elf32_arm_size_stubs): Move scope of stub_changed and
1346         prev_num_a8_fixes into main loop.
1347         (elf32_arm_build_stubs): Build a8 veneers in a second pass.
1348
1349 2009-08-04  Alan Modra  <amodra@bigpond.net.au>
1350
1351         * elf32-ppc.c (ppc_elf_relax_section): Correct conditions under
1352         which find_plt_ent is called.  Delete redundant code.
1353
1354 2009-08-03  H.J. Lu  <hongjiu.lu@intel.com>
1355
1356         PR binutils/10363
1357         * elf.c (bfd_elf_string_from_elf_section): Return NULL on
1358         invalid string offset.
1359
1360 2009-08-03  H.J. Lu  <hongjiu.lu@intel.com>
1361
1362         PR ld/10433
1363         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Set got
1364         to htab->init_got_offset and plt to htab->init_plt_offset
1365         when discarding space for dynamic relocations.
1366
1367 2009-08-03  Alan Modra  <amodra@bigpond.net.au>
1368
1369         * elf32-ppc.c (struct plt_entry): Revise comments.
1370         (ppc_elf_check_relocs): Don't create needless plt_entry info
1371         for non-pie executables.  Don't test info->pie when info->shared
1372         already covers that case.
1373         (ppc_elf_gc_sweep_hook): Adjust for above change.
1374         (add_stub_sym): Don't test info->pie when info->shared tested.
1375         (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Likewise.
1376         (write_glink_stub, ppc_elf_finish_dynamic_symbol): Likewise.
1377         (ppc_elf_relax_section): Adjust find_plt_ent arguments.
1378         (ppc_elf_relocate_section): Likewise.
1379
1380 2009-08-03  Alan Modra  <amodra@bigpond.net.au>
1381
1382         * elf32-ppc.c (ppc_elf_check_relocs): Always add a plt ref count
1383         for local ifunc symbols in non-pie executables, regardless of
1384         reloc type.  Don't specially create ifunc dyn relocs.  Tidy ifunc
1385         code so that it's obvious that we only do anything special for
1386         local ifunc syms.
1387         (ppc_elf_gc_sweep_hook): Adjust to suit check_relocs changes.
1388         (allocate_dynrelocs): Correct comment for syms defined in plt.
1389         Don't specially allocate ifunc dyn relocs.
1390         (ppc_elf_relax_section): Relax branches to ifunc plt entries too.
1391         (ppc_elf_relocate_section): Set "relocation" value for ifunc
1392         syms in non-pie executables.  No specially allocated dyn relocs
1393         for ifunc to write.  Allow for local sym on R_PPC_RELAX32_PLT.
1394         (ppc_elf_finish_dynamic_symbol): Set value of ifunc symbols in
1395         a non-pie executable.
1396
1397 2009-08-02  H.J. Lu  <hongjiu.lu@intel.com>
1398             Jakub Jelinek  <jakub@redhat.com>
1399
1400         PR ld/6443
1401         * elf32-i386.c (elf_i386_tls_transition): Check executable
1402         instead of shared for TLS when building PIE.
1403         (elf_i386_check_relocs): Likewise.
1404         (elf_i386_allocate_dynrelocs): Likewise.
1405         (elf_i386_relocate_section): Likewise.
1406
1407         * elf64-x86-64.c (elf64_x86_64_tls_transition): Check executable
1408         instead of shared for TLS when building PIE.
1409         (elf64_x86_64_check_relocs): Likewise.
1410         (elf64_x86_64_allocate_dynrelocs): Likewise.
1411         (elf64_x86_64_relocate_section): Likewise.
1412
1413 2009-07-31  Anthony Green  <green@moxielogic.com>
1414
1415         * config.bfd (targ_cpu): Add moxie-uclinux support.
1416
1417 2009-07-31  Hans-Peter Nilsson  <hp@bitrange.com>
1418
1419         * linker.c (fix_syms): Consider SEC_LOAD when choosing section.
1420
1421 2009-07-30  Alan Modra  <amodra@bigpond.net.au>
1422
1423         * elf32-ppc.c (ppc_elf_check_relocs): Always set up sections
1424         used by indirect function support.  Count dynamic relocs for
1425         ifunc syms.
1426         (ppc_elf_adjust_dynamic_symbol): Tweak for ifunc.
1427         (allocate_dynrelocs): Allocate all non-dynamic ifunc plt entries
1428         in iplt and their relocs in reliplt.  Don't make ifunc syms
1429         dynamic.  Allocate got entry relocs for non-dynamic ifunc in
1430         reliplt.  Handle other dynamic relocs for ifunc.
1431         (ppc_elf_size_dynamic_sections): Alloc dyn relocs for static
1432         ifunc in reliplt, likewise relocs for got against local ifunc.
1433         Typo fix on reliplt size adjust.
1434         (ppc_elf_relocate_section): Don't use plt scheme of allocating
1435         relocs 1-1 with entries for iplt, instead just add using
1436         reloc_count.  Write got relocs and dyn relocs for ifunc to reliplt.
1437         Error on invalid ifunc dyn relocs.
1438         (ppc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc plt
1439         in iplt/reliplt.
1440         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_JMP_IREL,
1441         R_PPC64_REL16, R_PPC64_REL16_LO, R_PPC64_REL16_HI, R_PPC64_REL16_HA.
1442         (ppc64_elf_reloc_type_lookup): Handle new relocs.
1443         (ppc64_elf_check_relocs): Likewise.  Count dyn relocs for ifunc.
1444         (allocate_dynrelocs): As for elf32-ppc.c above.
1445         (ppc64_elf_size_dynamic_sections): Likewise.
1446         (ppc_build_one_stub): Put non-dynamic ifunc plt call stubs in iplt,
1447         and their relocs in reliplt.  Use R_PPC64_JMP_IREL.
1448         (ppc_size_one_stub): Similarly.
1449         (ppc64_elf_relocate_section): As for elf32-ppc.c above.  Handle new
1450         relocs too.
1451         (ppc64_elf_finish_dynamic_symbol): As for elf32-ppc.c above.
1452
1453 2009-07-29  Hans-Peter Nilsson  <hp@bitrange.com>
1454
1455         * elf64-mmix.c (mmix_elf_relax_section): Revert 2009-05-27
1456         change.  Add note to head comment.
1457
1458 2009-07-28  Jan Beulich  <jbeulich@novell.com>
1459
1460         * archive.c (get_extended_arelt_filename): Remove redundant
1461         range check on index.
1462
1463 2009-07-27  Doug Kwan  <dougkwan@google.com>
1464
1465         * elf32-arm.c (stub_hash_newfunc): Initialize field output_name.
1466
1467 2009-07-27  H.J. Lu  <hongjiu.lu@intel.com>
1468
1469         * archures.c bfd_*_arch): Sorted.
1470         (bfd_archures_list): Likewise.
1471
1472 2009-07-27  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
1473
1474         * elf32-cr16.c (elf_cr16_final_link_relocate): Add code to handle
1475         to R_cr16_NUM32 relocation.
1476
1477 2009-07-26  Michael Eager  <eager@eagercon.com>
1478
1479         * archures.c: Add bfd_mach_ppc_405
1480         * bfd-in2.h: Same.
1481
1482 2009-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1483
1484         * cpu-i386.c (bfd_x86_64_arch): Fix comment typos.
1485         * cpu-l1om.c (bfd_l1om_arch): Likewise.
1486
1487 2009-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1488
1489         * archures.c (bfd_architecture): Add bfd_arch_l1om.
1490         (bfd_l1om_arch): New.
1491         (bfd_archures_list): Add &bfd_l1om_arch.
1492         * bfd-in2.h: Regenerated.
1493
1494         * config.bfd (targ64_selvecs): Add bfd_elf64_l1om_vec if
1495         bfd_elf64_x86_64_vec is supported.  Add bfd_elf64_l1om_freebsd_vec
1496         if bfd_elf64_x86_64_freebsd_vec is supported.
1497         (targ_selvecs): Likewise.
1498
1499         * configure.in: Support bfd_elf64_l1om_vec and
1500         bfd_elf64_l1om_freebsd_vec.
1501         * configure: Regenerated.
1502
1503         * cpu-l1om.c: New.
1504
1505         * elf64-x86-64.c (elf64_l1om_elf_object_p): New.
1506         (bfd_elf64_l1om_vec): Likewise.
1507         (bfd_elf64_l1om_freebsd_vec): Likewise.
1508
1509         * Makefile.am (ALL_MACHINES): Add cpu-l1om.lo.
1510         (ALL_MACHINES_CFILES): Add cpu-l1om.c.
1511         * Makefile.in: Regenerated.
1512
1513         * targets.c (bfd_elf64_l1om_vec): New.
1514         (bfd_elf64_l1om_freebsd_vec): Likewise.
1515         (_bfd_target_vector): Add bfd_elf64_l1om_vec and
1516         bfd_elf64_l1om_freebsd_vec.
1517
1518 2009-07-24  Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
1519             Alan Modra  <amodra@bigpond.net.au>
1520
1521         * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define.
1522         * bfd-in2.h: Regenerate.
1523         * libbfd.h: Regenerate.
1524         * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC.
1525         (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC.
1526         (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC.
1527
1528 2009-07-23  H.J. Lu  <hongjiu.lu@intel.com>
1529
1530         PR ld/10434
1531         * elf64-x86-64.c (elf64_x86_64_check_relocs): Check executable
1532         instead of shared for R_X86_64_TPOFF32.
1533         (elf64_x86_64_relocate_section): Likewise.
1534
1535 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
1536
1537         * elf-bfd.h (struct elf_link_hash_entry): Add unique_global field.
1538         * elf.c (swap_out_syms): Set binding to STB_GNU_UNIQUE for symbols
1539         with the BSF_GNU_UNIQUE flag bit set.
1540         * elfcode.h (elf_slurp_symbol_table): Set the BSF_GNU_UNIQUE flag
1541         for symbols with STB_GNU_UNIQUE binding.
1542         * elflink.c (_bfd_elf_merge_symbol): Set unique_global for symbols
1543         with the STB_GNU_UNIQUE binding.
1544         (elf_link_add_object_symbols): Set the BSF_GNU_UNIQUE flag for
1545         symbols with STB_GNU_UNIQUE binding.  Set STB_GNU_UNIQUE for
1546         symbols with the unique_global field set.
1547         (elf_link_output_extsym): Set unique_global field for symbols with
1548         the STB_GNU_UNIQUE binding.
1549         * syms.c (struct bfd_symbol): Define BSF_GNU_UNIQUE flag bit.
1550         (bfd_print_symbol_vandf): Print a 'u' character for BSF_GNU_UNIQUE
1551         symbols.
1552         (bfd_decode_symclass): Return a 'u' character for BSF_GNU_UNIQUE
1553         symbols.
1554         * bfd-in2.h: Regenerate.
1555
1556 2009-07-22  H.J. Lu  <hongjiu.lu@intel.com>
1557
1558         * elflink.c (elf_link_output_extsym): Revert the last change.
1559
1560 2009-07-22  H.J. Lu  <hongjiu.lu@intel.com>
1561
1562         PR ld/10433
1563         * elflink.c (elf_link_output_extsym): Special case ifunc syms
1564         when ref_regular, not def_regular.
1565
1566 2009-07-21  H.J. Lu  <hongjiu.lu@intel.com>
1567
1568         PR ld/10426
1569         * elflink.c (elf_link_add_object_symbols): Turn an IFUNC symbol
1570         from a DSO into a normal FUNC symbol.
1571         (elf_link_output_extsym): Turn an undefined IFUNC symbol into
1572         a normal FUNC symbol.
1573
1574 2009-07-17  Chao-ying Fu  <fu@mips.com>
1575
1576         * elfxx-mips.c (LOAD_INTERLOCKS_P): New define.
1577         (_bfd_mips_elf_size_dynamic_sections): For CPUs without load
1578         interlocking, the last PLT entry needs a nop in the branch delay slot.
1579         (_bfd_mips_elf_finish_dynamic_symbol): For CPUs with load itnerlocking,
1580         output the last two PLT entries in reverse order.
1581
1582 2009-07-16  H.J. Lu  <hongjiu.lu@intel.com>
1583
1584         * elf32-i386.c (elf_i386_relocate_section): Don't get local
1585         STT_GNU_IFUNC symbol for relocatable link.
1586         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1587
1588 2009-07-10  H.J. Lu  <hongjiu.lu@intel.com>
1589
1590         * bfdio.c (bfd_iovec): Add comments for bmmap.
1591         * bfd-in2.h: Regenerated.
1592
1593 2009-07-10  H.J. Lu  <hongjiu.lu@intel.com>
1594
1595         * Makefile.am: Run "make dep-am".
1596         * Makefile.in: Regenerated.
1597
1598 2009-07-10  Doug Kwan  <dougkwan@google.com>
1599
1600         * elf32-arm.c (stub_hash_newfunc): Initialize fields
1601         target_addend and orig_insn.
1602
1603 2009-07-10  Tom Tromey  <tromey@redhat.com>
1604
1605         * Makefile.am (dwarf2.lo): Use dwarf2.h, not elf/dwarf2.h.
1606         (elf-eh-frame.lo): Likewise.
1607         (elf32-bfin.lo): Likewise.
1608         (elf32-frv.lo): Likewise.
1609         (elf32-xc16x.lo): Likewise.
1610         * Makefile.in: Rebuild.
1611         * dwarf2.c: Included dwarf.h, not elf/dwarf2.h.
1612         * elf-eh-frame.c: Likewise.
1613         * elf32-bfin.c: Likewise.
1614         * elf32-frv.c: Likewise.
1615         * elf32-xc16x.c: Likewise.
1616
1617 2009-07-10  Julian Brown  <julian@codesourcery.com>
1618
1619         * elf32-arm.c (arm_build_one_stub): Use the hash entry of the
1620         symbol a stub entry is derived from, not the entry for the stub
1621         itself, in call to elf32_arm_final_link_relocate.
1622
1623 2009-07-10  H.J. Lu  <hongjiu.lu@intel.com>
1624
1625         * elf.c (_bfd_elf_get_synthetic_symtab): Remove leading zeros
1626         when reporting  addends.
1627
1628 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
1629
1630         * elf32-spu.c (spu_elf_size_stubs): Do set up soft-icache manager
1631         data even when no stubs.
1632         (spu_elf_place_overlay_data, spu_elf_build_stubs): Adjust.
1633
1634 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
1635
1636         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_IRELATIVE.
1637         (ppc_elf_get_synthetic_symtab): Report addend.
1638         (PLT_IFUNC): Define.
1639         (struct ppc_elf_link_hash_table): Add iplt and reliplt.
1640         (ppc_elf_create_glink): New function.
1641         (ppc_elf_create_dynamic_sections): Use it.
1642         (ppc_elf_add_symbol_hook): Set has_ifunc_symbols.
1643         (update_local_sym_info): Allocate space for local_plt array.
1644         Don't bump local_got_refcounts for PLT_IFUNC.  Return local_plt
1645         entry pointer.
1646         (is_branch_reloc): New function.
1647         (ppc_elf_check_relocs): Handle STT_GNU_IFUNC symbols.
1648         (ppc_elf_gc_sweep_hook): Likewise.
1649         (ppc_elf_adjust_dynamic_symbol): Likewise.
1650         (allocate_dynrelocs): Likewise.
1651         (ppc_elf_size_dynamic_sections): Likewise.
1652         (ppc_elf_relocate_section): Likewise.
1653         (branch_reloc_hash_match): Use is_branch_reloc.
1654         (ppc_elf_tls_optimize): Adjust for local_plt.
1655         (write_glink_stub): New function, extracted from..
1656         (ppc_elf_finish_dynamic_symbol): ..here.  Handle STT_GNU_IFUNC.
1657         (ppc_elf_finish_dynamic_sections): Only write plt resolver and
1658         branch table when dynamic.
1659         (elf_backend_post_process_headers): Define.
1660         * elf64-ppc.c (elf_backend_post_process_headers): Define.
1661         (ppc64_elf_howto_raw): Add R_PPC64_IRELATIVE.
1662         (ppc64_elf_get_synthetic_symtab): Report addend.
1663         (struct ppc_stub_hash_entry): Add plt_ent.
1664         (PLT_IFUNC): Define.
1665         (struct ppc_link_hash_table): Add iplt and reliplt.
1666         (create_linkage_sections): Make .iplt and .rela.iplt sections.
1667         (ppc64_elf_add_symbol_hook): Set has_ifunc_symbols.
1668         (update_local_sym_info): Allocate space for local_plt array.
1669         Don't bump local_got_ents for PLT_IFUNC.  Return local_plt
1670         entry pointer.
1671         (update_plt_info): Pass pointer to plt_entry rather than sym hash,
1672         and don't change hash flags here.
1673         (is_branch_reloc): New function.
1674         (ppc64_elf_check_relocs): Handle STT_GNU_IFUNC.
1675         (ppc64_elf_gc_sweep_hook): Likewise.
1676         (ppc64_elf_adjust_dynamic_symbol): Likewise.
1677         (allocate_dynrelocs): Likewise.
1678         (ppc64_elf_size_dynamic_sections): Likewise.
1679         (ppc_build_one_stub, ppc_size_one_stub): Likewise.
1680         (ppc64_elf_size_stubs): Likewise.
1681         (ppc64_elf_relocate_section): Likewise.
1682         (get_sym_h): Adjust for local_plt.
1683         (branch_reloc_hash_match): Use is_branch_reloc.
1684         (ppc_type_of_stub): Pass plt_entry pointer and handle ifunc.
1685         (ppc64_elf_toc): Ignore SEC_EXCLUDE sections.
1686
1687 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
1688
1689         * elf.c (_bfd_elf_get_synthetic_symtab): Report addends.
1690
1691 2009-07-10  Alan Modra  <amodra@bigpond.net.au>
1692
1693         * elf-bfd.h (struct elf_link_hash_entry): Clarify ref_regular
1694         and ref_regular_nonweak comment.
1695         * elflink.c (elf_link_output_extsym): Special case ifunc syms
1696         when def_regular, not ref_regular.
1697         (elf_link_add_object_symbols): Don't set needs_plt on ifunc syms,..
1698         * elf32-i386.c (elf_i386_check_relocs): ..set it here instead..
1699         * elf64-x86-64.c (elf64_x86_64_check_relocs): ..and here.
1700
1701 2009-07-09  Alan Modra  <amodra@bigpond.net.au>
1702
1703         * elf32-spu.c (mark_functions_via_relocs): Init broken_cycle field
1704         of malloc'd struct call_info.
1705         (pasted_function): Likewise, priority too.
1706
1707 2009-07-07  Alan Modra  <amodra@bigpond.net.au>
1708
1709         * elf32-spu.c (spu_elf_auto_overlay): Take into account section
1710         alignment when packing sections into overlays.
1711
1712 2009-07-03  Cary Coutant  <ccoutant@google.com>
1713
1714         * dwarf2.c (decode_line_info): Ignore DW_LNE_set_discriminator.
1715
1716 2009-07-03  Dave Korn  <dave.korn.cygwin@gmail.com>
1717
1718         * coffcode.h (sec_to_styp_flags):  Partially revert (functional
1719         changes only) earlier patch:-
1720
1721 2009-06-25  Kai Tietz  <kai.tietz@onevision.com>
1722
1723         * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
1724         give .debug and .reloc data characteristics.
1725         (DOT_RELOC): New define for .reloc section string.
1726         (coff_write_object_contents): Use DOT_RELOC instead of string.
1727
1728 2009-07-02  Tom Tromey  <tromey@redhat.com>
1729
1730         * aoutx.h (aout_get_external_symbols): Declare 'amt' locally.
1731         * bfdwin.c (bfd_free_window): Cast to unsigned long.
1732
1733 2009-07-01  Nick Clifton  <nickc@redhat.com>
1734
1735         * elf-m10300.c: Remove trailing white space.
1736         * reloc.c: Likewise.
1737
1738 2009-07-01  Douglas B Rupp  <rupp@gnat.com>
1739
1740         * bfd.m4 (BFD_HAVE_TIME_TYPE_MEMBER,
1741         BFD_HAVE_SYS_STAT_TYPE_MEMBER): New config functions.
1742         * configure.in: Use them.
1743         * configure: Regenerate.
1744         * config.in: Regenerate.
1745         * vmsutil.c: Include sysdep.h, remove ansidecl.h.
1746         #define _BSD_SOURCE. Add comments.
1747         (vms_file_stats_name): Calculate creation date based on available
1748         runtime data. Return 1 for version instead of 0.
1749
1750 2009-07-01  Nick Clifton  <nickc@redhat.com>
1751
1752         PR 10072
1753         * elf32-arm.c (elf32_arm_final_link_relocate): Add code to handle
1754         to R_ARM_THM_PC8 relocation.
1755
1756 2009-06-29  Nick Clifton  <nickc@redhat.com>
1757
1758         * elf-m10300.c (mn10300_elf_relax_section): Allow for the
1759         different uses of the relocations addend when a symbol is in a
1760         merged section.
1761
1762 2009-06-27  H.J. Lu  <hongjiu.lu@intel.com>
1763
1764         PR ld/10337
1765         * elf.c (bfd_section_from_shdr): Don't change sh_link for
1766         SHT_REL/SHT_RELA sections on executable nor shared library.
1767         Treat SHT_REL/SHT_RELA sections with sh_link set to SHN_UNDEF
1768         as a normal section.
1769
1770 2009-06-25  Nick Clifton  <nickc@redhat.com>
1771
1772         * elf-m10300.c (mn10300_elf_relax_section): Handle non-section
1773         symbols with SEC_MERGE flag.
1774
1775 2009-06-25  Kai Tietz  <kai.tietz@onevision.com>
1776
1777         * coffcode.h (sec_to_styp_flags): Set discardable for .reloc and
1778         give .debug and .reloc data characteristics.
1779         (DOT_RELOC): New define for .reloc section string.
1780         (coff_write_object_contents): Use DOT_RELOC instead of string.
1781
1782 2009-06-25  Tristan Gingold  <gingold@adacore.com>
1783
1784         * mach-o-target.c (bfd_mach_o_get_dynamic_symtab_upper_bound)
1785         (bfd_mach_o_canonicalize_dynamic_symtab)
1786         (bfd_mach_o_get_synthetic_symtab): Defines.
1787         (TARGET_NAME_BACKEND): Add bfd_mach_o_print_thread entry.
1788         (TARGET_NAME): Use Mach-O specific functions for dynamic.
1789
1790         * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_in): Fix howto indexes
1791         for scattered relocations.
1792         (bfd_mach_o_i386_print_thread): New function.
1793         (bfd_mach_o_print_thread): Define.
1794
1795         * mach-o.c (text_section_names_xlat): Add an entry for __const.
1796         (bfd_mach_o_canonicalize_one_reloc, bfd_mach_o_canonicalize_relocs):
1797         New functions extracted from ...
1798         (bfd_mach_o_canonicalize_reloc): ... This.  Simplified.
1799         (bfd_mach_o_get_dynamic_reloc_upper_bound): New function.
1800         (bfd_mach_o_canonicalize_dynamic_reloc): New function.
1801         (bfd_mach_o_i386_flavour_string): Adjusted after enum renaming.
1802         (bfd_mach_o_ppc_flavour_string): Reindentation.  Add 64 bits cases.
1803         (bfd_mach_o_scan_read_dylinker): Do not create a section anymore.
1804         Set name_str field.
1805         (bfd_mach_o_scan_read_dylib): Ditto.
1806         (bfd_mach_o_scan_read_thread): Set mdata at declaration.  Add comments,
1807         reindent.
1808         (bfd_mach_o_scan_read_dysymtab): Set mdata at declaration.  Correctly
1809         decode isym and flags on little endian targets.  Set dysymtab field.
1810         (bfd_mach_o_scan_start_address): Adjust for enum names.
1811         (bfd_mach_o_lookup_section): Do not look for segments anymore.
1812         (bfd_mach_o_print_section): Display bfd section name.
1813         (bfd_mach_o_print_segment): Display none if no name.
1814         (bfd_mach_o_print_dysymtab): Display next index for local, external
1815         and undefined symbols.
1816         (bfd_mach_o_bfd_print_private_bfd_data): Adjust code by using name_str.
1817         Display dylinker name. Display thread and unixthread commands content.
1818         (bfd_mach_o_print_thread): New macro.
1819
1820         * mach-o.h (bfd_mach_o_mach_header_magic): Align numbers.
1821         (bfd_mach_o_ppc_thread_flavour): Ditto.
1822         (bfd_mach_o_i386_thread_flavour): Ditto.
1823         (BFD_MACH_O_PPC_THREAD_STATE_NONE): New enum.
1824         (BFD_MACH_O_x86_THREAD_STATE_NONE): Replaces
1825         BFD_MACH_O_THREAD_STATE_NONE.
1826         (bfd_mach_o_segment_command): Remove segment field.
1827         (bfd_mach_o_thread_flavour): Field offset is now unsigned long.
1828         (bfd_mach_o_dylinker_command): Remove section field, add name_str.
1829         (bfd_mach_o_prebound_dylib_command): Ditto.
1830         (bfd_mach_o_dylib_command): Ditto.
1831         (bfd_mach_o_prebound_dylib_command): Remove section field.
1832         (mach_o_data_struct): Add dysymtab field.
1833         (bfd_mach_o_backend_data): Add _bfd_mach_o_print_thread field.
1834         (bfd_mach_o_get_reloc_upper_bound, bfd_mach_o_canonicalize_reloc)
1835         (bfd_mach_o_build_commands): Remove parameter names and attributes.
1836         (bfd_mach_o_get_dynamic_reloc_upper_bound)
1837         (bfd_mach_o_canonicalize_dynamic_reloc): New prototypes.
1838
1839 2009-06-25  Rafael Avila de Espindola  <espindola@google.com>
1840
1841         * plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type
1842         field of struct dirent.
1843
1844 2009-06-23  Tristan Gingold  <gingold@adacore.com>
1845
1846         * vms.c (vms_get_synthetic_symtab): Remove duplicate definition
1847         of this macro.  Fix indentation.
1848
1849 2009-06-22  Christophe Lyon  <christophe.lyon@st.com>
1850
1851         * elf32-arm.c (elf32_arm_size_stubs): Use PLT address as
1852         destination for defined dynamic symbols when deciding whether to
1853         insert a stub or not.
1854         (allocate_dynrelocs): Make sure functions are not marked as Thumb
1855         when actually accessed through a PLT, even when generating a
1856         shared lib.
1857
1858 2009-06-22  Tristan Gingold  <gingold@adacore.com>
1859
1860         * mach-o.c (bfd_mach_o_canonicalize_reloc): Append a sentinel to
1861         the relocs array.
1862
1863 2009-06-22  Alan Modra  <amodra@bigpond.net.au>
1864
1865         * elf32-ppc.c (ppc_elf_check_relocs): Handle R_PPC_RELAX* in switch.
1866         * elf32-v850.c (v850_elf_relocate_section): Warning fix.
1867
1868 2009-06-22  Alan Modra  <amodra@bigpond.net.au>
1869
1870         * elf64-ppc.c (ppc64_elf_edit_opd): Avoid gcc warning.
1871
1872 2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>
1873
1874         * elflink.c (elf_link_add_object_symbols): Avoid warning
1875         from -Wjump-misses-init in gcc 4.5.0.
1876
1877 2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>
1878
1879         * elf32-i386.c (elf_i386_check_relocs): Properly check local
1880         symbol on error.
1881         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
1882
1883 2009-06-19  H.J. Lu  <hongjiu.lu@intel.com>
1884
1885         * elf32-i386.c (elf_i386_tls_transition): Add a parameter,
1886         r_symndx.  Report local symbol name on error.
1887         (elf_i386_check_relocs): Updated.  Report local symbol name on
1888         error.
1889         (elf_i386_gc_sweep_hook): Updated.
1890         (elf_i386_relocate_section): Likewise.
1891
1892         * elf64-x86-64.c (elf64_x86_64_tls_transition): Add a parameter,
1893         r_symndx.  Report local symbol name on error.
1894         (elf64_x86_64_check_relocs): Updated.  Report local symbol name
1895         on error.
1896         (elf64_x86_64_gc_sweep_hook): Updated.
1897         (elf64_x86_64_relocate_section): Likewise.
1898
1899 2009-06-19  Tristan Gingold  <gingold@adacore.com>
1900
1901         * mach-o.c (bfd_mach_o_print_private_header): Fix format character.
1902
1903 2009-06-19  Tristan Gingold  <gingold@adacore.com>
1904
1905         * mach-o.c (bfd_mach_o_scan_read_symtab_symbols): Add prototype.
1906         (bfd_mach_o_version): Use bfd_mach_o_get_data instead of direct access.
1907         (bfd_mach_o_valid): Ditto.
1908         (bfd_mach_o_wide_p): Ditto.
1909         (bfd_mach_o_canonicalize_reloc): Ditto.
1910         (bfd_mach_o_build_commands): Ditto.
1911         (bfd_mach_o_scan_read_thread): Ditto.
1912         (bfd_mach_o_flatten_sections): Ditto.
1913         (bfd_mach_o_scan_start_address): Ditto.
1914         (bfd_mach_o_lookup_section): Ditto.
1915         (bfd_mach_o_core_fetch_environment): Ditto.
1916         (bfd_mach_o_write_contents): Ditto.  Handle reexport_dylib.
1917         (bfd_mach_o_scan_write_relocs): Adjust for bfd_mach_o_get_data.
1918         (bfd_mach_o_scan_write_symtab): Ditto.
1919         Use macros instead of hard-coded values.
1920         (bfd_mach_o_scan_read_symtab_symbol): Make the function static.
1921         Use bfd_mach_o_get_data instead of direct access.  Use macros
1922         instead of hard-coded values.
1923         (bfd_mach_o_scan_read_symtab_strtab): Make the function static.
1924         Remove sym argument and get section from mdata.
1925         Move code into the else branch.
1926         (bfd_mach_o_scan_read_symtab_symbols): Make the function static.
1927         Remove sym argument and get section from mdata.  Adjust code.
1928         (bfd_mach_o_scan_read_dylib): Move assertion into the created
1929         switch (which replaces consecutive if statements).
1930         (bfd_mach_o_scan_read_dysymtab): Rename seg to cmd.  Load
1931         module table, table of content, indirect symbols and external
1932         referenced symbols.
1933         (bfd_mach_o_scan_read_symtab): Renames seg to symtab.  Set symtab
1934         field.
1935         (bfd_mach_o_scan_read_linkedit): New function.
1936         (bfd_mach_o_scan_read_str): Ditto.
1937         (bfd_mach_o_count_symbols): Simplify the code by using the symtab
1938         field of mdata.
1939         (bfd_mach_o_get_symtab_upper_bound): Remove check as
1940         bfd_mach_o_count_symbols never returns an error.
1941         (bfd_mach_o_canonicalize_symtab): Simplify the code by using the
1942         symtab field (there might be only one symtab).
1943         (bfd_mach_o_scan_read_command): Handle reexported dylib.
1944         Handle sub frameworks, sub umbrella, sub library and sub client.
1945         Read code signature and segment split info commands.
1946         (bfd_mach_o_scan): Reindent.
1947         (bfd_mach_o_xlat_name): New type.
1948         (bfd_mach_o_print_flags): New function.
1949         (bfd_mach_o_get_name): Ditto.
1950         (bfd_mach_o_cpu_name): New variable.
1951         (bfd_mach_o_filetype_name, bfd_mach_o_header_flags_name)
1952         (bfd_mach_o_section_type_name)
1953         (bfd_mach_o_section_attribute_name)
1954         (bfd_mach_o_load_command_name): New variables.
1955         (bfd_mach_o_print_private_header): New function.
1956         (bfd_mach_o_print_section_map): New function extracted from
1957         bfd_mach_o_print_private_bfd_data.
1958         (bfd_mach_o_print_section): Ditto.  Print more infos.
1959         (bfd_mach_o_print_segment): Ditto.
1960         (bfd_mach_o_print_dysymtab): Ditto.
1961         (bfd_mach_o_bfd_print_private_bfd_data): Reworked.  Handle
1962         load weak dylib, reexport dylib and id dylib.
1963         Handle code signature and segment_split info.
1964         Handle sub frameworks, sub umbrella, sub library and sub client.
1965         (bfd_mach_o_section_get_nbr_indirect): New function.
1966
1967         * mach-o.h (BFD_MACH_O_REFERENCE_MASK): New macro.  Add comment.
1968         (bfd_mach_o_header_flags): New enum to define header flags.
1969         (bfd_mach_o_section_attribute): New enum to replace ...
1970         (BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC,
1971         BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG,
1972         BFD_MACH_O_S_SELF_MODIFYING_CODE, BFD_MACH_O_S_ATTR_LIVE_SUPPORT,
1973         BFD_MACH_O_S_ATTR_NO_DEAD_STRIP, BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS,
1974         BFD_MACH_O_S_ATTR_NO_TOC, BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): ...
1975         these removed macros.
1976         (BFD_MACH_O_NLIST_SIZE, BFD_MACH_O_NLIST_64_SIZE): New macros.
1977         (bfd_mach_o_dylib_module): New type.
1978         (BFD_MACH_O_DYLIB_MODULE_SIZE, BFD_MACH_O_DYLIB_MODULE_64_SIZE): New
1979         macros.
1980         (bfd_mach_o_dylib_table_of_content): New type.
1981         (BFD_MACH_O_TABLE_OF_CONTENT_SIZE): New macro.
1982         (bfd_mach_o_dylib_reference): New type.
1983         (BFD_MACH_O_REFERENCE_SIZE): New macro.
1984         (bfd_mach_o_dysymtab_command): Add fields for loaded and decoded
1985         modules, toc, references and indirect syms.
1986         (BFD_MACH_O_INDIRECT_SYMBOL_SIZE): New macro.
1987         (bfd_mach_o_dylinker_command): Remove cmd and cmdsize fields (were
1988         unused).  Add comment.
1989         (bfd_mach_o_dylib_command): Ditto.
1990         (bfd_mach_o_prebound_dylib_command): Ditto.
1991         (bfd_mach_o_linkedit_command): New type.
1992         (bfd_mach_o_str_command): New type.
1993         (bfd_mach_o_load_command): Add linkedit and str fields.
1994         (mach_o_data_struct): Add symtab field.
1995         (bfd_get_mach_o_data): Renamed to ...
1996         (bfd_mach_o_get_data): ... this new macro.
1997         (bfd_mach_o_scan_read_symtab_symbol,
1998         bfd_mach_o_scan_read_symtab_strtab,
1999         bfd_mach_o_scan_read_symtab_symbols): Prototypes removed.
2000
2001         * mach-o-i386.c (bfd_mach_o_i386_mkobject): Use bfd_mach_o_get_data
2002         instead of direct access.
2003
2004 2009-06-19  Alan Modra  <amodra@bigpond.net.au>
2005
2006         * elf32-ppc.c (ppc_elf_check_relocs): Allow local symbols for
2007         R_PPC_PLTREL24 relocs.
2008         (ppc_elf_relocate_section): Likewise.
2009
2010 2009-06-19  Alan Modra  <amodra@bigpond.net.au>
2011
2012         * elf32-ppc.c (find_plt_ent): Pass pointer to plist rather than
2013         pointer to sym hash.  Update all uses.
2014         (update_plt_info): Likewise.  Don't check addend here.
2015
2016 2009-06-18  H.J. Lu  <hongjiu.lu@intel.com>
2017
2018         * elf32-i386.c (elf_i386_check_relocs): Remove isymbuf and use
2019         bfd_sym_from_r_symndx.
2020         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
2021
2022 2009-06-18  Alan Modra  <amodra@bigpond.net.au>
2023
2024         * elf-bfd.h (struct sym_sec_cache): Delete.
2025         (struct sym_cache): New.
2026         (bfd_section_from_r_symndx): Delete prototype.
2027         (bfd_sym_from_r_symndx): Define prototype.
2028         * elf.c (bfd_section_from_r_symndx): Delete, replace with..
2029         (bfd_sym_from_r_symndx): ..new function.
2030         * elf32-arm.c: Update all uses of struct sym_sec_cache and
2031         bfd_section_from_r_symndx to new struct and function.
2032         * elf32-bfin.c: Likewise.
2033         * elf32-hppa.c: Likewise.
2034         * elf32-i386.c: Likewise.
2035         * elf32-m32r.c: Likewise.
2036         * elf32-m68hc1x.c: Likewise.
2037         * elf32-m68hc1x.h: Likewise.
2038         * elf32-m68k.c: Likewise.
2039         * elf32-ppc.c: Likewise.
2040         * elf32-s390.c: Likewise.
2041         * elf32-sh.c: Likewise.
2042         * elf64-ppc.c: Likewise.
2043         * elf64-s390.c: Likewise.
2044         * elf64-x86-64.c: Likewise.
2045         * elfxx-sparc.c: Likewise.
2046         * elfxx-sparc.h: Likewise.
2047
2048 2009-06-18  H.J. Lu  <hongjiu.lu@intel.com>
2049
2050         * elf32-i386.c (elf_i386_check_relocs): Cache or free isymbuf.
2051         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
2052
2053 2009-06-18  Nick Clifton  <nickc@redhat.com>
2054
2055         * elflink.c (elf_link_sort_relocs): Return early if there are no
2056         relocs to sort.
2057
2058 2009-06-18  Dave Korn  <dave.korn.cygwin@gmail.com>
2059
2060         Merge cegcc and mingw32ce target name changes from
2061         CeGCC project:
2062
2063         2007-12-25  Pedro Alves  <pedro_alves@portugalmail.pt>
2064
2065         * config.bfd: Add arm*-*-cegcc* target.
2066
2067         2007-12-17  Pedro Alves  <pedro_alves@portugalmail.pt>
2068
2069         * config.bfd: Add arm-*-mingw32ce* target.
2070
2071 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
2072
2073         * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): New.
2074         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Likewise.
2075         * elf32-i386.c (elf_i386_allocate_dynrelocs): Use it.
2076         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
2077
2078 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
2079
2080         * elf-bfd.h (_bfd_elf_create_ifunc_dyn_reloc): New.
2081         * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Likewise.
2082         * elf32-i386.c (elf_i386_check_relocs): Use it.
2083         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
2084
2085 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
2086
2087         * elf-bfd.h (elf_dyn_relocs): New.
2088
2089         * elf32-i386.c (elf_i386_dyn_relocs): Removed.
2090         (elf_i386_link_hash_entry): Replace elf_i386_dyn_relocs with
2091         elf_dyn_relocs.
2092         (elf_i386_copy_indirect_symbol): Likewise.
2093         (elf_i386_check_relocs): Likewise.
2094         (elf_i386_gc_sweep_hook): Likewise.
2095         (elf_i386_allocate_dynrelocs): Likewise.
2096         (elf_i386_readonly_dynrelocs): Likewise.
2097         (elf_i386_size_dynamic_sections): Likewise.
2098
2099         * elf64-x86-64.c (elf64_x86_64_dyn_relocs): Removed.
2100         (elf64_x86_64_link_hash_entry): Replace elf64_x86_64_dyn_relocs
2101         with elf_dyn_relocs.
2102         (elf64_x86_64_copy_indirect_symbol): Updated.
2103         (elf64_x86_64_check_relocs): Likewise.
2104         (elf64_x86_64_gc_sweep_hook): Likewise.
2105         (elf64_x86_64_adjust_dynamic_symbol): Likewise.
2106         (elf64_x86_64_allocate_dynrelocs): Likewise.
2107         (elf64_x86_64_readonly_dynrelocs): Likewise.
2108         (elf64_x86_64_size_dynamic_sections): Likewise.
2109
2110 2009-06-17  H.J. Lu  <hongjiu.lu@intel.com>
2111
2112         * elf32-arm.c (create_got_section): Get existing .rela.got
2113         section.
2114         * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise.
2115         * elf32-lm32.c (create_got_section): Likewise.
2116         * elf32-m32r.c (create_got_section): Likewise.
2117         * elf32-ppc.c (ppc_elf_create_got): Likewise.
2118         * elf32-s390.c (create_got_section): Likewise.
2119         * elf32-sh.c (create_got_section): Likewise.
2120         * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise.
2121         * elf64-s390.c (create_got_section): Likewise.
2122         * elfxx-sparc.c (create_got_section): Likewise.
2123
2124         * elflink.c (_bfd_elf_create_got_section): Properly initialize
2125         the GOT size.
2126
2127 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
2128
2129         * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): New.
2130
2131         * elf32-i386.c (elf_i386_local_hash): Removed.
2132         (elf_i386_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
2133         (elf_i386_get_local_sym_hash): Likewise.
2134
2135         * elf64-x86-64.c (elf64_x86_64_local_hash): Removed.
2136         (elf64_x86_64_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
2137         (elf64_x86_64_get_local_sym_hash): Likewise.
2138         * elfxx-ia64.c (elfNN_ia64_local_htab_hash): Likewise.
2139         (get_local_sym_hash): Likewise.
2140
2141 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
2142
2143         * elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
2144         rel_got_sec and plt_sec.
2145         (elfNN_ia64_relax_section): Updated.
2146         (elfNN_ia64_create_dynamic_sections): Likewise.
2147         (get_got): Likewise.
2148         (allocate_dynrel_entries): Likewise.
2149         (elfNN_ia64_size_dynamic_sections): Likewise.
2150         (set_got_entry): Likewise.
2151         (elfNN_ia64_choose_gp): Likewise.
2152         (elfNN_ia64_relocate_section): Likewise.
2153         (elfNN_ia64_finish_dynamic_symbol): Likewise.
2154         (elfNN_ia64_finish_dynamic_sections): Likewise.
2155
2156 2009-06-16  Ulrich Weigand  <uweigand@de.ibm.com>
2157
2158         * elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits
2159         also for calls.
2160
2161 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
2162
2163         * configure.in (elf): Add elf-ifunc.lo.
2164
2165         * configure: Regenerated.
2166         * Makefile.in: Likewise.
2167
2168         * elf-bfd.h (elf_link_hash_table): Add sgot, sgotplt,
2169         srelgot, splt, srelplt, igotplt, iplt, irelplt and irelifunc.
2170
2171         * elf32-i386.c (elf_i386_link_hash_table): Remove sgot,
2172         sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
2173         irelifunc.
2174         (elf_i386_link_hash_table_create): Likewise.
2175         (elf_i386_create_dynamic_sections): Likewise.
2176         (elf_i386_check_relocs): Likewise.
2177         (elf_i386_allocate_dynrelocs): Likewise.
2178         (elf_i386_size_dynamic_sections): Likewise.
2179         (elf_i386_relocate_section): Likewise.
2180         (elf_i386_finish_dynamic_symbol): Likewise.
2181         (elf_i386_finish_dynamic_sections): Likewise.
2182         (elf_i386_create_got_section): Removed.
2183
2184         * elf64-x86-64.c (elf64_x86_64_link_hash_table): Remove sgot,
2185         sgotplt, srelgot, splt, srelplt, igotplt, iplt, irelplt and
2186         irelifunc.
2187         (elf64_x86_64_compute_jump_table_size): Updated.
2188         (elf64_x86_64_link_hash_table_create): Likewise.
2189         (elf64_x86_64_create_dynamic_sections): Likewise.
2190         (elf64_x86_64_check_relocs): Likewise.
2191         (elf64_x86_64_allocate_dynrelocs): Likewise.
2192         (elf64_x86_64_size_dynamic_sections): Likewise.
2193         (elf64_x86_64_relocate_section): Likewise.
2194         (elf64_x86_64_finish_dynamic_symbol): Likewise.
2195         (elf64_x86_64_finish_dynamic_sections): Likewise.
2196         (elf64_x86_64_create_got_section): Removed.
2197
2198         * elflink.c (_bfd_elf_create_got_section): Use log_file_align
2199         for pointer alignment.  Set up section pointers.
2200         (_bfd_elf_create_dynamic_sections): Likewise.
2201         (_bfd_elf_create_ifunc_sections): Moved to ...
2202         * elf-ifunc.c: Here.  New.
2203
2204         * Makefile.am (BFD32_BACKENDS): Add elf-ifunc.lo.
2205         (BFD32_BACKENDS_CFILES): Add elf-ifunc.c.
2206         Run "make dep-am".
2207
2208 2009-06-16  Doug Kwan  <dougkwan@google.com>
2209
2210         * elf32-arm.c (cortex_a8_erratum_scan): Change type of offset
2211         to bfd_signed_vma.  Cast constant operands which are used in
2212         offset related expressions to bfd_signed_vma type as appropriate.
2213
2214 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
2215
2216         * elf32-vax.c (elf_vax_plt_sym_val): New function.
2217         (elf_backend_plt_sym_val): Define.
2218
2219 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
2220
2221         * elf32-vax.c (elf_vax_reloc_type_class): New function.
2222         (elf_backend_reloc_type_class): Define.
2223
2224 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
2225
2226         * elf32-vax.c (elf_vax_relocate_section): For symbol references
2227         from an executable to a shared library treat R_VAX_PC32
2228         relocations as R_VAX_PLT32 ones.
2229
2230 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
2231
2232         * elf32-vax.c (elf_vax_instantiate_got_entries): Skip local
2233         symbols in GOT space calculation.
2234         (elf_vax_relocate_section): Adjust accordingly.
2235
2236 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
2237
2238         * elf32-vax.c (elf_vax_plt_entry): Set the entry mask to
2239         include <R11:R2>.
2240
2241 2009-06-16  Maciej W. Rozycki  <macro@linux-mips.org>
2242
2243         * elf32-vax.c (elf_vax_check_relocs): Handle the visibility
2244         attribute.
2245         (elf_vax_relocate_section): Likewise.
2246
2247 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
2248
2249         * elf32-i386.c (elf_i386_allocate_dynrelocs): Update comments.
2250         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
2251
2252 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
2253
2254         * elf32-i386.c (elf_i386_check_relocs): Reformat.
2255         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
2256
2257 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
2258
2259         * Makefile.am: Run "make dep-am".
2260         * Makefile.in: Regenerated.
2261
2262 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
2263
2264         * elf32-i386.c (elf_i386_allocate_dynrelocs): Fix a typo.
2265         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
2266
2267 2009-06-15  Nick Clifton  <nickc@redhat.com>
2268
2269         * po/ru.po: New Russian translation.
2270         * configure.in (ALL_LINGUAS): Add ru.
2271         * configure: Regenerate.
2272
2273 2009-06-14  H.J. Lu  <hongjiu.lu@intel.com>
2274
2275         * elf32-i386.c: Remove duplicated comments.
2276
2277 2009-06-14  H.J. Lu  <hongjiu.lu@intel.com>
2278
2279         PR ld/10270
2280         * elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow
2281         dynamic IFUNC pointer in non-shared object.  Use .got.plt
2282         for IFUNC definition in PIE.
2283         (elf_i386_allocate_dynrelocs): Resolve IFUNC definition in
2284         PIE locally.
2285
2286         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow
2287         dynamic IFUNC pointer in non-shared object.  Use .got.plt
2288         for IFUNC definition in PIE.
2289         (elf64_x86_64_relocate_section): Resolve IFUNC definition in
2290         PIE locally.
2291
2292 2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>
2293
2294         * elf32-i386.c (elf_i386_check_relocs): Properly report
2295         local symbol for unhandled relocation against STT_GNU_IFUNC
2296         symbol.
2297         (elf_i386_relocate_section): Likewise.
2298         * elf64-x86-64.c (elf64_x86_64_check_relocs):  Likewise.
2299         (elf64_x86_64_relocate_section): Likewise.
2300
2301 2009-06-13  H.J. Lu  <hongjiu.lu@intel.com>
2302
2303         PR ld/10269
2304         * elf32-i386.c: Include "objalloc.h" and "hashtab.h".
2305         (elf_i386_link_hash_table): Add loc_hash_table and
2306         loc_hash_memory.
2307         (elf_i386_local_hash): New.
2308         (elf_i386_local_htab_hash): Likewise.
2309         (elf_i386_local_htab_eq): Likewise.
2310         (elf_i386_get_local_sym_hash): Likewise.
2311         (elf_i386_link_hash_table_free): Likewise.
2312         (elf_i386_allocate_local_dynrelocs): Likewise.
2313         (elf_i386_finish_local_dynamic_symbol): Likewise.
2314         (bfd_elf64_bfd_link_hash_table_free): Likewise.
2315         (elf_i386_link_hash_table_create): Create loc_hash_table and
2316         loc_hash_memory.
2317         (elf_i386_check_relocs): Handle local STT_GNU_IFUNC symbols.
2318         (elf_i386_size_dynamic_sections): Likewise.
2319         (elf_i386_relocate_section): Likewise.
2320         (elf_i386_finish_dynamic_sections): Likewise.
2321         (elf_i386_finish_dynamic_symbol): Check _DYNAMIC only if sym
2322         isn't NULL.
2323
2324         * elf64-x86-64.c: Include "objalloc.h" and "hashtab.h".
2325         (elf64_x86_64_link_hash_table): Add loc_hash_table and
2326         loc_hash_memory.
2327         (elf64_x86_64_local_hash): New.
2328         (elf64_x86_64_local_htab_hash): Likewise.
2329         (elf64_x86_64_local_htab_eq): Likewise.
2330         (elf64_x86_64_get_local_sym_hash): Likewise.
2331         (elf64_x86_64_link_hash_table_free): Likewise.
2332         (elf64_x86_64_allocate_local_dynrelocs): Likewise.
2333         (elf64_x86_64_finish_local_dynamic_symbol): Likewise.
2334         (bfd_elf64_bfd_link_hash_table_free): Likewise.
2335         (elf64_x86_64_link_hash_table_create): Create loc_hash_table
2336         and loc_hash_memory.
2337         (elf64_x86_64_check_relocs): Handle local STT_GNU_IFUNC
2338         symbols.
2339         (elf64_x86_64_size_dynamic_sections): Likewise.
2340         (elf64_x86_64_relocate_section): Likewise.
2341         (elf64_x86_64_finish_dynamic_sections): Likewise.
2342         (elf64_x86_64_finish_dynamic_symbol): Check _DYNAMIC only if
2343         sym isn't NULL.
2344
2345 2009-06-10  Philip Blundell  <philb@gnu.org>
2346
2347         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Avoid crash if
2348         elf_sec->this_hdr == NULL.
2349
2350 2009-06-12  Tristan Gingold  <gingold@adacore.com>
2351
2352         * reloc.c: Add BFD_RELOC_MACH_O_SECTDIFF and BFD_RELOC_MACH_O_PAIR.
2353         * bfd-in2.h: Regenerated.
2354         * libbfd.h: Regenerated.
2355
2356         * mach-o.c (FILE_ALIGN): New macro.
2357         (bfd_mach_o_canonicalize_symtab): Adjust for bfd_mach_o_asymbol.
2358         (bfd_mach_o_print_symbol): Ditto.
2359         (bfd_mach_o_scan_write_thread): Adjust type of variable offset.
2360         (bfd_mach_o_get_reloc_upper_bound): New function.
2361         (bfd_mach_o_canonicalize_reloc): Ditto.
2362         (bfd_mach_o_scan_write_relocs): Ditto.
2363         (bfd_mach_o_scan_write_section_32): Remove offset argument.
2364         (bfd_mach_o_scan_write_section_64): Ditto.
2365         (bfd_mach_o_scan_write_segment_32): Write relocs.  Fix size of data
2366         written for load command.  Do not compute section file offset.
2367         (bfd_mach_o_scan_write_segment_64): Ditto.
2368         (bfd_mach_o_scan_write_symtab): Compute file offset first.
2369         Adjust for bfd_mach_o_asymbol.  Move code to convert from BFD to
2370         Mach-O to ...
2371         (bfd_mach_o_mangle_symbols): ... this new function.
2372         (bfd_mach_o_write_contents): Be sure to have load commands built.
2373         Call bfd_mach_o_mangle_symbols.
2374         (bfd_mach_o_build_commands): Adjust for filelen field.
2375         Use FILE_ALIGN macro.  Clear section file offset if section is empty.
2376         Do not set symtab file offset anymore here.
2377         (bfd_mach_o_make_empty_symbol): Allocate a bfd_mach_o_asymbol.
2378         (bfd_mach_o_make_bfd_section): Set SEC_RELOC if has reloc.
2379         Set reloc_count and rel_filepos section fields.
2380         (bfd_mach_o_scan_read_section_32): Type of argument offset is now
2381         unsigned int.
2382         (bfd_mach_o_scan_read_section_64): Ditto.
2383         (bfd_mach_o_scan_read_section): Ditto.
2384         (bfd_mach_o_scan_read_symtab_symbol): Typr of argument s is now
2385         bfd_mach_o_asymbol.  Use unsigned int for file offset type.
2386         (bfd_mach_o_scan_read_symtab_symbol): Adjust for bfd_mach_o_asymbol.
2387         Handle weak-ref symbols.
2388         (bfd_mach_o_scan_read_symtab_symbols): Adjust for bfd_mach_o_asymbol.
2389         (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
2390         (bfd_mach_o_scan): Remove assignment to removed field.
2391         (bfd_mach_o_mkobject_init): Ditto.
2392         (bfd_mach_o_bfd_print_private_bfd_data): Adjust printf formatter.
2393         (bfd_mach_o_bfd_reloc_type_lookup): New macro.
2394         (bfd_mach_o_bfd_reloc_name_lookup): Ditto.
2395         (bfd_mach_o_swap_reloc_in): Ditto.
2396         (bfd_mach_o_swap_reloc_out): Ditto.
2397
2398         * mach-o.h (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY)
2399         (BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY)
2400         (BFD_MACH_O_REFERENCE_FLAG_DEFINED)
2401         (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_DEFINED)
2402         (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY)
2403         (BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY)
2404         (BFD_MACH_O_REFERENCED_DYNAMICALLY, BFD_MACH_O_N_DESC_DISCARDED)
2405         (BFD_MACH_O_N_NO_DEAD_STRIP, BFD_MACH_O_N_WEAK_REF)
2406         (BFD_MACH_O_N_WEAK_DEF): New macros.
2407         Add comments.
2408         (bfd_mach_o_section_type): Add new enumeration values.
2409         (BFD_MACH_O_S_SELF_MODIFYING_CODE)
2410         (BFD_MACH_O_S_ATTR_LIVE_SUPPORT)
2411         (BFD_MACH_O_S_ATTR_NO_DEAD_STRIP)
2412         (BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS, BFD_MACH_O_S_ATTR_NO_TOC): New
2413         macros.
2414         (BFD_MACH_O_GENERIC_RELOC_VANILLA)
2415         (BFD_MACH_O_GENERIC_RELOC_PAIR)
2416         (BFD_MACH_O_GENERIC_RELOC_SECTDIFF)
2417         (BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR)
2418         (BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF): Ditto.
2419         (BFD_MACH_O_RELENT_SIZE): Ditto.
2420         (BFD_MACH_O_R_PCREL, BFD_MACH_O_GET_R_LENGTH)
2421         (BFD_MACH_O_R_EXTERN, BFD_MACH_O_GET_R_TYPE)
2422         (BFD_MACH_O_GET_R_SYMBOLNUM, BFD_MACH_O_SET_R_LENGTH)
2423         (BFD_MACH_O_SET_R_TYPE, BFD_MACH_O_SET_R_SYMBOLNUM): Ditto.
2424         (BFD_MACH_O_SR_SCATTERED, BFD_MACH_O_SR_PCREL)
2425         (BFD_MACH_O_GET_SR_LENGTH, BFD_MACH_O_GET_SR_TYPE)
2426         (BFD_MACH_O_GET_SR_ADDRESS, BFD_MACH_O_SET_SR_LENGTH)
2427         (BFD_MACH_O_SET_SR_TYPE, BFD_MACH_O_SET_SR_ADDRESS): Ditto.
2428         (bfd_mach_o_reloc_info): New struct.
2429         (bfd_mach_o_asymbol): New struct.
2430         (bfd_mach_o_symtab_command): The symbols field is now of type
2431         bfd_mach_o_asymbol.
2432         (bfd_mach_o_load_command): The offset and len fields are now of type
2433         unsigned int.
2434         (mach_o_data_struct): Remove symbols, nsymbols and ibfd fields.
2435         Add a filelen field.  Add comments.
2436         (bfd_mach_o_backend_data): New struct.
2437         (bfd_mach_o_get_backend_data): New macro.
2438         (bfd_mach_o_scan_read_symtab_symbol): Parameter symbol now of type
2439         bfd_mach_o_asymbol.
2440         (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
2441         (bfd_mach_o_get_reloc_upper_bound): New prototype.
2442         (bfd_mach_o_canonicalize_reloc): Ditto.
2443
2444         * mach-o-target.c (bfd_mach_o_bfd_is_local_label_name): Remove
2445         duplicated macro.  Now defined to _bfd_generic_is_local_label.
2446         (TARGET_NAME_BACKEND): New macro...
2447         (TARGET_NAME_BACKEND): ... used to name a new variable.
2448         (TARGET_NAME): Define relocs table using bfd_mach_o, reference
2449         Mach-O backend data.
2450
2451         * mach-o-i386.c (i386_howto_table): New variable.
2452         (bfd_mach_o_i386_swap_reloc_in): New function.
2453         (bfd_mach_o_i386_swap_reloc_out): Ditto.
2454         (bfd_mach_o_i386_bfd_reloc_type_lookup): Ditto.
2455         (bfd_mach_o_i386_bfd_reloc_name_lookup): Ditto.
2456         (bfd_mach_o_swap_reloc_in, bfd_mach_o_swap_reloc_out): New macros.
2457         (bfd_mach_o_bfd_reloc_type_lookup)
2458         (bfd_mach_o_bfd_reloc_name_lookup): Ditto.
2459
2460 2009-06-11  Eric Paris  <eparis@redhat.com>
2461             Nick Clifton  <nickc@redhat.com>
2462
2463         * opncls.c (_maybe_make_executable): New function.  Gives execute
2464         permission to an executable bfd that was opened for writing
2465         provided that it is a regular file.  Replaces common code found in...
2466         (bfd_close): here and ...
2467         (bfd_close_all_done): here.
2468
2469 2009-06-11  Anthony Green  <green@moxielogic.com>
2470
2471         * reloc.c: Add BFD_RELOC_MOXIE_10_PCREL.
2472         * bfd-in2.h: Rebuilt.
2473         * libbfd.h: Rebuilt.
2474         * elf32-moxie.c (moxie_elf_howto_table): Add R_MOXIE_PCREL10
2475         relocation support.
2476         (moxie_reloc_map): Ditto.
2477         Clean up copyright notice.
2478
2479 2009-06-10  Paul Pluzhnikov  <ppluzhnikov@google.com>
2480
2481         * bfd-in2.h: bfd_mmap prototype.
2482         * bfdio.c (bfd_mmap): New function.
2483         * libbfd.h (bfd_iovec): Add bmmap.
2484         * cache.c (cache_bmmap): New function.
2485         (cache_iovec): Initialize bmmap member.
2486         * opencls.c (opncls_bmmap): New function.
2487         (opncls_iovec): Initialize bmmap member.
2488
2489 2009-06-09  Tristan Gingold  <gingold@adacore.com>
2490
2491         * mach-o.h (bfd_mach_o_symtab_command): Remove stabs_segment
2492         and stabstr_segment fields.
2493         (mach_o_be_vec, mach_o_le_vec): Removed
2494         (bfd_mach_o_version): New prototype.
2495
2496         * mach-o.c (bfd_mach_o_version): Make this function public.
2497         (mach_o_wide_p): New function.
2498         (bfd_mach_o_wide_p): Ditto.
2499         (bfd_mach_o_convert_section_name_to_bfd): Add prefix only for
2500         weird names.
2501         (bfd_mach_o_convert_section_name_to_mach_o): Fix typo in comment.
2502         Search in the list only if the name starts with a dot.
2503         (bfd_mach_o_write_header): Use mach_o_wide_p instead of hard-coded
2504         test.  Check bfd_seek status.
2505         (bfd_mach_o_scan_write_thread): Check bfd_seek status.
2506         (bfd_mach_o_scan_write_section_32): Ditto.
2507         (bfd_mach_o_scan_write_section_64): Ditto.
2508         (bfd_mach_o_scan_write_section): Removed.
2509         (bfd_mach_o_scan_write_segment): Split into ...
2510         (bfd_mach_o_scan_write_segment_32): ... this and ...
2511         (bfd_mach_o_scan_write_segment_64): ... this.  Check bfd_seek status.
2512         (bfd_mach_o_scan_write_symtab_symbols): Moved into ...
2513         (bfd_mach_o_scan_write_symtab): ... this.  Write symtab from BFD
2514         symbol table.  Now returns a boolean.
2515         (bfd_mach_o_write_contents): Set filetype.  Check bfd_seek status.
2516         Adjust for status type.
2517         (bfd_mach_o_build_commands): Use mach_o_wide_p instead of hard-coded
2518         test.  Write symbol table.  Numbers the sections.
2519         (bfd_mach_o_read_header): Check bfd_seek status.
2520         Use mach_o_wide_p instead of hard-coded test.
2521         (bfd_mach_o_scan_read_section_32): Check bfd_seek status.
2522         (bfd_mach_o_scan_read_section_64): Ditto.
2523         (bfd_mach_o_scan_read_symtab_symbol): Ditto.  Check bfd_seek status.
2524         Use BFD_MACH_O_N_TYPE instead of hard-coded value.  Correctly
2525         handled common symbols.
2526         (bfd_mach_o_scan_read_symtab_strtab): Check bfd_seek status.
2527         (bfd_mach_o_scan_read_dysymtab_symbol): Ditto.
2528         (bfd_mach_o_scan_read_dylinker): Ditto.
2529         (bfd_mach_o_scan_read_dylib): Ditto.
2530         (bfd_mach_o_scan_read_thread): Ditto.
2531         (bfd_mach_o_scan_read_symtab): Ditto.
2532         Do not create a section for the stabs.
2533         (bfd_mach_o_scan_read_uuid): Check bfd_seek status.
2534         (bfd_mach_o_scan_read_segment): Ditto.
2535         (bfd_mach_o_scan_read_command): Ditto.
2536         (bfd_mach_o_scan_start_address): Ditto.
2537         (bfd_mach_o_scan): Use mach_o_wide_p instead of hard-coded test.
2538         (bfd_mach_o_archive_p): Check bfd_seek status.
2539         (bfd_mach_o_core_fetch_environment): Ditto.
2540
2541         * mach-o-i386.c (bfd_mach_o_i386_mkobject): Don't set filetype.
2542
2543 2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>
2544
2545         * elf32-i386.c (elf_i386_link_hash_table): Add irelifunc.
2546         (elf_i386_link_hash_table_create): Initialize irelifunc.
2547         (elf_i386_check_relocs): Updated.  Set up irelifunc for
2548         shared objects.
2549         (elf_i386_allocate_dynrelocs): Use irelifunc for dynamic
2550         relocation for non-GOT reference of STT_GNU_IFUNC symbol in
2551         shared objects.
2552         (elf_i386_relocate_section): Likewise.
2553
2554         * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add irelifunc.
2555         (elf64_x86_64_link_hash_table_create): Initialize irelifunc.
2556         (elf64_x86_64_check_relocs): Updated.  Set up irelifunc for
2557         shared objects.
2558         (elf64_x86_64_allocate_dynrelocs): Use irelifunc for dynamic
2559         relocation for non-GOT reference of STT_GNU_IFUNC symbol in
2560         shared objects.
2561         (elf64_x86_64_relocate_section): Likewise.
2562
2563         * elf-bfd.h (_bfd_elf_create_static_ifunc_sections): Renamed to
2564         ...
2565         (_bfd_elf_create_ifunc_sections): This.
2566
2567         * elflink.c (_bfd_elf_create_static_ifunc_sections): Renamed to
2568         ...
2569         (_bfd_elf_create_ifunc_sections): This.  Create .rel[a].ifunc
2570         for shared objects.
2571
2572 2009-06-06  H.J. Lu  <hongjiu.lu@intel.com>
2573
2574         * elf32-i386.c (elf_i386_check_relocs): Make room for dynamic
2575         relocation for R_386_32 against STT_GNU_IFUNC symbol when
2576         building shared object.  Check info->executable instead of
2577         !info->shared when setting non_got_ref.
2578         (elf_i386_allocate_dynrelocs): Allocate dynamic relocation
2579         for non-GOT reference of STT_GNU_IFUNC symbol in shared
2580         object. Allocate GOT relocation agsinst STT_GNU_IFUNC
2581         symbol if needed.
2582         (elf_i386_relocate_section): Output dynamic relocation for
2583         R_386_32 against STT_GNU_IFUNC symbol to get the real
2584         function address when building shared object.
2585         (elf_i386_finish_dynamic_symbol): Output R_386_GLOB_DAT
2586         relocation for STT_GNU_IFUNC symbol in shared object.
2587
2588         * elf64-x86-64.c (elf64_x86_64_check_relocs): Make room for
2589         dynamic relocation for R_X86_64_64 against STT_GNU_IFUNC
2590         symbol when building shared object.  Check info->executable
2591         instead of !info->shared when setting non_got_ref.
2592         (elf64_x86_64_allocate_dynrelocs): Allocate dynamic relocation
2593         for non-GOT reference of STT_GNU_IFUNC symbol in shared
2594         library. Allocate GOT relocation agsinst STT_GNU_IFUNC symbol
2595         if needed.
2596         (elf64_x86_64_relocate_section): Output dynamic relocation
2597         for R_X86_64_64 against STT_GNU_IFUNC symbol to get the real
2598         function address when building shared object.
2599         (elf64_x86_64_finish_dynamic_symbol): Output R_X86_64_GLOB_DAT
2600         relocation for STT_GNU_IFUNC symbol in shared object.
2601
2602 2009-06-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
2603
2604         * Makefile.am: Run "make dep-am".
2605         (BFD32_BACKENDS): Add mach-o-i386.lo.
2606         (BFD32_BACKENDS_CFILES): Add mach-o-i386.c.
2607         * Makefile.in: Regenerate.
2608
2609 2009-06-06  Alan Modra  <amodra@bigpond.net.au>
2610
2611         * elf32-spu.c (spu_elf_relocate_section): Match overlay number
2612         when looking for soft-icache stubs.
2613
2614 2009-06-05  Tristan Gingold  <gingold@adacore.com>
2615
2616         * mach-o.h: Update copyright year.
2617         (bfd_mach_o_mach_header_magic): New enum.
2618         (bfd_mach_o_cpu_subtype): Now an enum.
2619         (BFD_MACH_O_HEADER_SIZE, BFD_MACH_O_HEADER_64_SIZE): New macros.
2620         (BFD_MACH_O_SECTION_SIZE, BFD_MACH_O_SECTION_64_SIZE): Ditto.
2621         (BFD_MACH_O_LC_SEGMENT_SIZE, BFD_MACH_O_LC_SEGMENT_64_SIZE): Ditto.
2622         (bfd_mach_o_load_command): Field type_required is now a boolean.
2623         Reindent prototypes.
2624         (bfd_mach_o_object_p, bfd_mach_o_core_p): Remove.
2625         (bfd_mach_o_bfd_copy_private_symbol_data): Add a prototype.
2626         (bfd_mach_o_bfd_copy_private_section_data): Ditto.
2627         (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
2628         (bfd_mach_o_get_symtab_upper_bound): Ditto.
2629         (bfd_mach_o_canonicalize_symtab): Ditto.
2630         (bfd_mach_o_get_symbol_info): Ditto.
2631         (bfd_mach_o_print_symbol): Ditto.
2632         (bfd_mach_o_bfd_print_private_bfd_data): Ditto.
2633         (bfd_mach_o_make_empty_symbol): Ditto.
2634         (bfd_mach_o_write_contents): Ditto.
2635
2636         * mach-o.c (bfd_mach_o_object_p, bfd_mach_o_core_p,
2637         bfd_mach_o_mkobject): Defines.
2638         (bfd_mach_o_valid): Returns FALSE/TRUE instead of 0/1.
2639         Do not check with target vector but with flavour.
2640         (struct mach_o_section_name_xlat): New declaration.
2641         (dwarf_section_names_xlat): Ditto.
2642         (text_section_names_xlat): Ditto.
2643         (data_section_names_xlat): Ditto.
2644         (struct mach_o_segment_name_xlat): Ditto.
2645         (segsec_names_xlat): Ditto.
2646         (bfd_mach_o_convert_section_name_to_bfd): New function.
2647         (bfd_mach_o_convert_section_name_to_mach_o): Ditto.
2648         (bfd_mach_o_bfd_copy_private_symbol_data): Make it public.
2649         (bfd_mach_o_bfd_copy_private_section_data): Ditto.
2650         (bfd_mach_o_bfd_copy_private_bfd_data): Ditto.
2651         Accept any input and output flavour.  Do not share private data
2652         anymore.
2653         (bfd_mach_o_count_symbols): Add a comment.
2654         (bfd_mach_o_get_symtab_upper_bound): Make it public.
2655         (bfd_mach_o_canonicalize_symtab): Ditto.
2656         (bfd_mach_o_get_symbol_info): Ditto.
2657         (bfd_mach_o_print_symbol): Ditto.
2658         (bfd_mach_o_write_header): Now returns a boolean instead of an int.
2659         Use constants instead of hard-coded values.
2660         (bfd_mach_o_scan_write_section_32): Use constants instead of hard-coded
2661         values.
2662         (bfd_mach_o_scan_write_section_64): Ditto.
2663         (bfd_mach_o_scan_write_segment): Ditto.
2664         Do not copy sections anymore.
2665         (bfd_mach_o_write_contents): Make it public.
2666         Remove dead code.  Rewrite typeflag assignment.
2667         (bfd_mach_o_build_commands): New function.
2668         (bfd_mach_o_set_section_contents): Ditto.
2669         (bfd_mach_o_make_empty_symbol): Make it public.
2670         (bfd_mach_o_read_header): Make it static.
2671         Convert to bfd_boolean.
2672         Use constants instead of hard-coded values.
2673         (bfd_mach_o_make_bfd_section): Call
2674         bfd_mach_o_convert_section_name_to_bfd to create name.
2675         (bfd_mach_o_scan_read_section_32): Use constants instead of hard-coded
2676         values.
2677         (bfd_mach_o_scan_read_section_64): Ditto.
2678         (bfd_mach_o_scan_read_segment): Do not create a bfd section for
2679         a segment anymore.  Use constants instead of hard-coded values.
2680         (bfd_mach_o_scan_read_command): Fix style.
2681         (bfd_mach_o_scan): Use constants instead of hard-coded values.
2682         Get rid of BFD_IO_FUNCS.
2683         (bfd_mach_o_mkobject_init): Renamed from bfd_mach_o_mkobject.
2684         (bfd_mach_o_header_p): Created from bfd_mach_o_object_p.
2685         (bfd_mach_o_gen_object_p): New function, replaces bfd_mach_o_object_p.
2686         (bfd_mach_o_object_p): Removed.
2687         (bfd_mach_o_gen_core_p): New function, replaces ...
2688         (bfd_mach_o_core_p): ... deleted.
2689         (bfd_mach_o_bfd_print_private_bfd_data): Make it public.
2690
2691         * mach-o-i386.c: New file.
2692         * config.bfd: Use mach_o_i386_vec as targ_defvec for ix86-darwin.
2693         * configure.in (TDEFINES): Add mach_o_i386_vec.
2694         * configure: Regenerated.
2695         * targets.c: Add mach_o_i386_vec.
2696
2697         * mach-o.c: Update copyright years.
2698         (BFD_IO_FUNCS): Remove (was not used).
2699         (bfd_mach_o_mkarchive, bfd_mach_o_read_ar_hdr, bfd_mach_o_slurp_armap
2700         bfd_mach_o_slurp_extended_name_table,
2701         bfd_mach_o_construct_extended_name_table,
2702         bfd_mach_o_truncate_arname, bfd_mach_o_write_armap,
2703         bfd_mach_o_get_elt_at_index, bfd_mach_o_generic_stat_arch_elt,
2704         bfd_mach_o_update_armap_timestamp, bfd_mach_o_close_and_cleanup,
2705         bfd_mach_o_bfd_free_cached_info, bfd_mach_o_new_section_hook,
2706         bfd_mach_o_get_section_contents_in_window,
2707         bfd_mach_o_bfd_is_local_label_name,
2708         bfd_mach_o_bfd_is_target_special_symbol,
2709         bfd_mach_o_bfd_is_local_label_name, bfd_mach_o_get_lineno,
2710         bfd_mach_o_find_nearest_line, bfd_mach_o_find_inliner_info,
2711         bfd_mach_o_bfd_make_debug_symbol, bfd_mach_o_read_minisymbols,
2712         bfd_mach_o_minisymbol_to_symbol,
2713         bfd_mach_o_bfd_get_relocated_section_contents,
2714         bfd_mach_o_bfd_relax_section, bfd_mach_o_bfd_link_hash_table_create,
2715         bfd_mach_o_bfd_link_hash_table_free, bfd_mach_o_bfd_link_add_symbols,
2716         bfd_mach_o_bfd_link_just_syms, bfd_mach_o_bfd_final_link,
2717         bfd_mach_o_bfd_link_split_section, bfd_mach_o_set_arch_mach,
2718         bfd_mach_o_bfd_merge_private_bfd_data,
2719         bfd_mach_o_bfd_set_private_flags, bfd_mach_o_get_section_contents,
2720         bfd_mach_o_bfd_gc_sections, bfd_mach_o_bfd_merge_sections,
2721         bfd_mach_o_bfd_is_group_section, bfd_mach_o_bfd_discard_group,
2722         bfd_mach_o_section_already_linked, bfd_mach_o_bfd_define_common_symbol,
2723         bfd_mach_o_bfd_copy_private_header_data,
2724         bfd_mach_o_core_file_matches_executable_p): Move these defines ...
2725         * mach-o-target.c: ... here.
2726         Update copyright years.
2727
2728 2009-06-04  Alan Modra  <amodra@bigpond.net.au>
2729
2730         * dep-in.sed: Don't use \n in replacement part of s command.
2731         * Makefile.am (DEP1): LC_ALL for uniq.
2732         Run "make dep-am".
2733         * Makefile.in: Regenerate.
2734
2735 2009-06-03  H.J. Lu  <hongjiu.lu@intel.com>
2736
2737         * elf32-i386.c (elf_i386_allocate_dynrelocs): Remove check of
2738         h->plt.refcount > 0 on STT_GNU_IFUNC symbol.
2739         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
2740
2741 2009-06-03  H.J. Lu  <hongjiu.lu@intel.com>
2742
2743         * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate
2744         GOT entry for STT_GNU_IFUNC symbol with pointer equality.
2745         (elf_i386_relocate_section): Adjust R_386_GOT32 relocation
2746         against STT_GNU_IFUNC symbols for static executables.
2747         (elf_i386_finish_dynamic_symbol): Load GOT entry with
2748         PLT entry for STT_GNU_IFUNC symbol with pointer equality.
2749
2750         * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Allocate
2751         GOT entry for STT_GNU_IFUNC symbol with pointer equality.
2752         (elf64_x86_64_finish_dynamic_symbol): Load GOT entry with
2753         PLT entry for STT_GNU_IFUNC symbol with pointer equality.
2754
2755 2009-06-02  Richard Sandiford  <r.sandiford@uk.ibm.com>
2756
2757         * coff-rs6000.c (xcoff_ppc_relocate_section): Allow undefined
2758         symbols to be left unimported when linking statically.
2759         * xcofflink.c (xcoff_link_add_symbols): Ignore global linkage
2760         code when linking statically.
2761
2762 2009-06-02  H.J. Lu  <hongjiu.lu@intel.com>
2763
2764         * elf32-i386.c (elf_i386_check_relocs): Increment
2765         got.refcount for R_386_GOT32/R_386_GOTOFF relocations
2766         against STT_GNU_IFUNC symbol.
2767         (elf_i386_allocate_dynrelocs): Set got.refcount to 0 if
2768         local STT_GNU_IFUNC definition is used.
2769         (elf_i386_relocate_section): Handle got.offset != -1 for
2770         R_386_GOT32/R_386_GOTOFF relocations against STT_GNU_IFUNC
2771         symbol.
2772
2773         * elf64-x86-64.c (elf64_x86_64_check_relocs): Increment
2774         got.refcount for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64
2775         relocations against STT_GNU_IFUNC symbol.
2776         (elf64_x86_64_allocate_dynrelocs): Set got.refcount to 0 if
2777         local STT_GNU_IFUNC definition is used.
2778         (elf64_x86_64_relocate_section): Handle got.offset != -1
2779         for R_X86_64_GOTPCREL/R_X86_64_GOTPCREL64 relocations against
2780         STT_GNU_IFUNC symbol.
2781
2782 2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>
2783
2784         PR ld/10205
2785         * elf32-i386.c (elf_howto_table): Add R_386_IRELATIVE.
2786         (elf_i386_reloc_type_lookup): Likewise.
2787         (R_386_tls): Removed.
2788         (R_386_irelative): New.
2789         (R_386_vt_offset): Updated.
2790         (elf_i386_rtype_to_howto): Likewise.
2791         (elf_i386_link_hash_table): Add igotplt, iplt and irelplt.
2792         (elf_i386_link_hash_table_create): Initialize igotplt,
2793         iplt and irelplt.
2794         (elf_i386_check_relocs): Handle STT_GNU_IFUNC symbol first.
2795         (elf_i386_adjust_dynamic_symbol): Likewise.
2796         (elf_i386_allocate_dynrelocs): Likewise.
2797         (elf_i386_relocate_section): Likewise.
2798         (elf_i386_size_dynamic_sections): Set up .iplt and .igot.plt
2799         sections.
2800         (elf_i386_finish_dynamic_symbol): When building a static
2801         executable, use .iplt, .igot.plt and .rel.iplt sections for
2802         STT_GNU_IFUNC symbols.  Generate R_386_IRELATIVE relocation for
2803         locally defined STT_GNU_IFUNC symbol.
2804
2805         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_IRELATIVE.
2806         (x86_64_reloc_map): Likewise.
2807         (R_X86_64_standard): Updated.
2808         (elf64_x86_64_link_hash_table): Add igotplt, iplt and irelplt.
2809         (elf64_x86_64_link_hash_table_create): Initialize igotplt,
2810         iplt and irelplt.
2811         (elf64_x86_64_check_relocs): Handle STT_GNU_IFUNC symbol first.
2812         (elf64_x86_64_adjust_dynamic_symbol): Likewise.
2813         (elf64_x86_64_allocate_dynrelocs): Likewise.
2814         (elf64_x86_64_relocate_section): Likewise.
2815         (elf64_x86_64_size_dynamic_sections): Set up .iplt and .igot.plt
2816         sections.
2817         (elf64_x86_64_finish_dynamic_symbol): When building a static
2818         executable, use .iplt, .igot.plt and .rela.iplt sections for
2819         STT_GNU_IFUNC symbols.  Generate R_X86_64_IRELATIVE relocation
2820         for locally defined STT_GNU_IFUNC symbol.
2821
2822         * reloc.c (BFD_RELOC_386_IRELATIVE): New.
2823         (BFD_RELOC_X86_64_IRELATIVE): Likewise.
2824
2825         * bfd-in2.h: Regenerated.
2826         * libbfd.h: Likewise.
2827
2828 2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>
2829
2830         * elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs.
2831         (_bfd_elf_make_ifunc_reloc_section): Removed.
2832         (_bfd_elf_is_ifunc_symbol): Likewise.
2833         (_bfd_elf_create_static_ifunc_sections): New.
2834
2835         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC
2836         symbol check to ...
2837         (elf_link_add_object_symbols): Here.
2838         (_bfd_elf_link_hash_hide_symbol): Don't clean plt on
2839         STT_GNU_IFUNC symbol.
2840         (elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol
2841         if a STT_GNU_IFUNC symbol is referenced in a non-shared object.
2842         (IFUNC_INFIX): Removed.
2843         (get_ifunc_reloc_section_name): Likewise.
2844         (_bfd_elf_make_ifunc_reloc_section): Likewise.
2845         (_bfd_elf_is_ifunc_symbol): Likewise.
2846         (_bfd_elf_create_static_ifunc_sections): New.
2847
2848 2009-05-29  H.J. Lu  <hongjiu.lu@intel.com>
2849
2850         * elf32-i386.c (link_hash_newfunc): Add elf_i386_ prefix.
2851         (create_got_section): Likewise.
2852         (allocate_dynrelocs): Likewise.
2853         (readonly_dynrelocs): Likewise.
2854         (set_tls_module_base): Likewise.
2855         (dtpoff_base): Likewise.
2856         (tpoff): Likewise.
2857         (elf_i386_link_hash_table_create): Updated.
2858         (elf_i386_create_dynamic_sections): Likewise.
2859         (elf_i386_check_relocs): Likewise.
2860         (elf_i386_size_dynamic_sections): Likewise.
2861         (elf_i386_relocate_section): Likewise.
2862
2863         * elf64-x86-64.c (link_hash_newfunc): Add elf64_x86_64_ prefix.
2864         (create_got_section): Likewise.
2865         (allocate_dynrelocs): Likewise.
2866         (readonly_dynrelocs): Likewise.
2867         (set_tls_module_base): Likewise.
2868         (dtpoff_base): Likewise.
2869         (tpoff): Likewise.
2870         (elf64_x86_64_link_hash_table_create): Updated.
2871         (elf64_x86_64_create_dynamic_sections): Likewise.
2872         (elf64_x86_64_check_relocs): Likewise.
2873         (elf64_x86_64_size_dynamic_sections): Likewise.
2874         (elf64_x86_64_relocate_section): Likewise.
2875
2876 2009-05-28  Nick Clifton  <nickc@redhat.com>
2877
2878         * targets.c (_bfd_target_vector): Only include plugin target in
2879         all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.
2880
2881 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
2882
2883         * elf32-spu.c (struct call_info): New member broken_cycle.
2884         (remove_cycle): Instead of physically removing call_info structures
2885         to break call graph cycles, mark them using the broken_cycle flag.
2886         (mark_overlay_section): Respect broken_cycle flag.
2887         (unmark_overlay_section): Likewise.
2888         (collect_lib_sections): Likewise.
2889         (collect_overlays): Likewise.
2890         (sum_stack): Likewise.
2891
2892 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
2893
2894         * elf32-spu.c (insert_callee): Accumulate incoming callee->count.
2895         (mark_functions_via_relocs): Initialize callee->count to 1.
2896         (pasted_function): Likewise.
2897         (spu_elf_auto_overlay): Honor call counts when determining number
2898         of stubs required in software i-cache mode.
2899
2900 2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
2901
2902         * plugin.c (program_name): Remove.
2903         (plugin_program_name): New.
2904         (bfd_plugin_set_program_name): New.
2905         (try_load_plugin): Use plugin_program_name.
2906         * plugin.h (bfd_plugin_set_program_name): New.
2907
2908 2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
2909
2910         * aclocal.m4: Include ../config/plugins.m4.
2911         * configure.in: Use AC_PLUGINS.
2912         * configure: Regenerate.
2913         * Makefile.in: Regenerate.
2914         * doc/Makefile.in: Regenerate.
2915
2916 2009-05-27  Nathan Sidwell  <nathan@codesourcery.com>
2917
2918         * elf32-ppc.c (ppc_elf_relax_section): Work with a partial
2919         link.
2920         * bout.c (b_out_bfd_relax_section): Reject relocatable links.
2921         * elf32-m10300.c (mn10300_elf_relax_section): Likewise.
2922         * elf32-avr.c (elf32_avr_relax_section): Likewise.
2923         * elf32-frv.c (elf32_avr_relax_section): Likewise.
2924         * elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
2925         * elf64-mmix.c (mmix_elf_relax_section): Likewise.
2926         * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
2927         * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
2928         * reloc.c (bfd_generic_relax_section): Likewise.
2929         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
2930         * vms.c (vms_bfd_relax_section): Likewise.
2931
2932 2009-05-26  H.J. Lu  <hongjiu.lu@intel.com>
2933
2934         * elf-bfd.h (_bfd_elf_is_ifunc_symbol): New.
2935
2936         * elf32-i386.c (is_indirect_symbol): Renamed to ...
2937         * elflink.c (_bfd_elf_is_ifunc_symbol): This.
2938
2939         * elf32-i386.c (allocate_dynrelocs): Updated.
2940         (elf_i386_relocate_section): Likewise.
2941         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
2942         (elf64_x86_64_relocate_section): Likewise.
2943
2944         * elf64-x86-64.c (is_indirect_symbol): Removed.
2945
2946 2009-05-26  Nick Clifton  <nickc@redhat.com>
2947
2948         * po/id.po: Updated Indonesian translation.
2949
2950 2009-05-26  Rafael Avila de Espindola  <espindola@google.com>
2951
2952         * Makefile.am: Run "make dep-am".
2953         (AM_CPPFLAGS): New.
2954         (LIBDL): New.
2955         (ALL_MACHINES): Add cpu-plugin.lo.
2956         (ALL_MACHINES_CFILES): Add cpu-plugin.c.
2957         (BFD32_BACKENDS): Add plugin.lo.
2958         (BFD32_BACKENDS_CFILES): Add plugin.c.
2959         (libbfd_la_LIBADD): Add LIBDL
2960         * archures.c (bfd_architecture): Add bfd_arch_plugin.
2961         (bfd_plugin_arch): Declare.
2962         * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
2963         * bfd.c (bfd): Add plugin_data.
2964         * config.bfd: Handle the plugin target.
2965         * configure.in: Check for --enable-plugins.
2966         (LT_INIT): Use the dlopen option.
2967         * cpu-plugin.c: New.
2968         * plugin.c: New.
2969         * plugin.h: New.
2970         * targets.c (plugin_vec): Declare.
2971         (_bfd_target_vector): Add plugin_vec.
2972         * Makefile.in: Regenerate.
2973         * bfd-in2.h: Regenerate.
2974         * configure: Regenerate.
2975
2976 2009-05-26  Alan Modra  <amodra@bigpond.net.au>
2977
2978         * dep-in.sed: Don't modify .o to .lo here.  Output one filename
2979         per line with all lines having continuation backslash.  Prefix
2980         first line with "A", following lines with "B".
2981         * Makefile.am (DEP): Don't use dep.sed here.
2982         (DEP1): Run $MKDEP on single files, modify .o to .lo here.  Use
2983         dep.sed here on dependencies, sort and uniq.
2984         * Makefile.in: Regenerate.
2985
2986 2009-05-25  Tristan Gingold  <gingold@adacore.com>
2987
2988         * makefile.vms: Add verilog.obj to object list OBJS.
2989
2990 2009-05-24  Alan Modra  <amodra@bigpond.net.au>
2991
2992         * bfdio.c (bfd_seek): Formatting.  Ensure newly allocated memory
2993         for BFD_IN_MEMORY is cleared.
2994         (bfd_bwrite): Zero excess memory allocated.
2995
2996 2009-05-22  Julian Brown  <julian@codesourcery.com>
2997
2998         * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New
2999         macros.
3000         (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
3001         (elf32_arm_stub_a8_veneer_blx): New stub sequences.
3002         (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
3003         arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx.
3004         (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields.
3005         (a8_erratum_fix, a8_erratum_reloc): New structs.
3006         (elf32_arm_link_hash_table): Add a8_erratum_fixes,
3007         num_a8_erratum_fixes, fix_cortex_a8 fields.
3008         (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
3009         (elf32_arm_add_stub): Split into two parts, creating...
3010         (elf32_arm_create_or_find_stub_sec): New function.
3011         (elf32_arm_final_link_relocate): Add forward declaration.
3012         (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
3013         relocations, multiple relocations per stub.
3014         (find_stub_size_and_template): New (using parts of arm_size_one_stub).
3015         (arm_size_one_stub): Use find_stub_size_and_template.
3016         (a8_reloc_compare): New.
3017         (find_thumb_glue): Add forward declaration.
3018         (cortex_a8_erratum_scan): New.
3019         (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
3020         (bfd_elf32_arm_set_cortex_a8_fix): New.
3021         (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
3022         (arm_map_one_stub): Add THUMB32_TYPE support.
3023         (a8_branch_to_stub_data): New.
3024         (make_branch_to_a8_stub): New.
3025         (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
3026         * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
3027         (bfd_elf32_arm_set_target_relocs): Add argument for controlling
3028         Cortex-A8 erratum workaround.
3029         * bfd-in2.h: Regenerate.
3030
3031 2009-05-22  Alan Modra  <amodra@bigpond.net.au>
3032
3033         * Makefile.am: Run "make dep-am".
3034         * Makefile.in: Regenerate.
3035         * po/SRC-POTFILES.in: Regenerate.
3036
3037 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
3038
3039         * elflink.c (elf_link_input_bfd): Correct *pindex change in last
3040         commit.
3041
3042 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
3043
3044         * elf-bfd.h (struct elf_backend_data
3045         <elf_backend_link_output_symbol_hook>): Return an int.
3046         * elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
3047         symbols on deleted .opd entries.
3048         * elflink.c (elf_link_output_sym): Return without outputting sym
3049         if output_symbol_hook returns 2.
3050         (elf_link_output_extsym): Don't assign h->indx when symbol discarded.
3051         Abort if we must not discard sym.
3052         (elf_link_input_bfd): Similarly, don't set finfo->indices for
3053         local syms.
3054         (bfd_elf_final_link): Adjust elf_link_output_sym calls.
3055         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
3056         elf_backend_link_output_symbol_hook return type change.
3057         * elf32-arm.c (output_arch_syminfo): Likewise.
3058         (elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
3059         (elf32_arm_output_arch_local_syms): Likewise.
3060         * elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
3061         * elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
3062         (bfd_score_elf_link_output_symbol_hook): Likewise.
3063         * elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
3064         * elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
3065         * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
3066         * elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
3067         * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
3068         * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
3069         * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
3070         * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
3071         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
3072         * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
3073         * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
3074
3075 2009-05-21  Alan Modra  <amodra@bigpond.net.au>
3076
3077         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
3078         out of range .opd symbols.
3079
3080 2009-05-21  Dave Korn  <dave.korn.cygwin@gmail.com>
3081
3082         * coffgen.c (coff_print_symbol):  Use bfd_fprintf_vma, not
3083         fprintf_vma directly.
3084         * peXXigen.c (pe_print_edata):  Likewise.
3085         (pe_print_pdata):  Likewise.
3086         (_bfd_XX_print_ce_compressed_pdata):  Likewise.
3087         (_bfd_XX_print_private_bfd_data_common):  Likewise.
3088
3089 2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>
3090
3091         * cofflink.c (process_embedded_commands):  Ignore "-aligncomm".
3092
3093 2009-05-15  Andrew Stubbs  <ams@codesourcery.com>
3094             Paul Brook  <paul@codesourcery.com>
3095
3096         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
3097         fix discarded sections.
3098
3099 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3100
3101         * elf32-spu.c (mark_overlay_section): Move .init and .fini
3102         sections into the software icache.
3103
3104 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3105
3106         * elf32-spu.c (build_stub): Always build "compact" sofware
3107         i-cache stubs.
3108
3109 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3110
3111         * elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
3112         (spu_elf_setup): Initialize it.
3113         (spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
3114         Update to new-sytle cache manager data structures.
3115         (spu_elf_build_stubs): Generate new-style cache manager data
3116         structures and symbols.
3117         (spu_elf_auto_overlay): Update size computation.
3118
3119 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3120
3121         * elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
3122         segments first amongst the program headers.
3123
3124 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3125
3126         * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index
3127         into addresses for relocation types that look at high bits.  Remove
3128         special handling of relocation overflow warnings.
3129
3130 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3131
3132         * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the
3133         control flow graph between fragments of a function.
3134
3135 2009-05-14  Ulrich Weigand  <uweigand@de.ibm.com>
3136
3137         * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,
3138         generate only a 16-byte .toe section.
3139         (spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
3140
3141 2009-05-14  Alan Modra  <amodra@bigpond.net.au>
3142
3143         * elf32-spu.c (spu_elf_size_stubs): Split out section placement to..
3144         (spu_elf_place_overlay_data): ..here.  New function.
3145         * elf32-spu.h (spu_elf_place_overlay_data): Declare.
3146
3147 2009-05-13  Andrew Jenner  <andrew@codesourcery.com>
3148
3149         * elf32-arm.c: Move sysdep.h to start of file.
3150
3151 2009-05-11  Ulrich Weigand  <uweigand@de.ibm.com>
3152
3153         * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
3154         start of overlays.
3155         (spu_elf_build_stubs): Don't define __icache_tagbase.  Define
3156         __icache_tag_array and __icache_tag_array_size.
3157
3158 2009-05-11  Masaki Muranaka  <monaka@monami-software.com>
3159
3160         * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Remove unnecessary
3161         ATTRIBUTE_UNUSED.
3162         (bfinfdpic_link_omit_section_dynsym): Likewise.
3163         (elf32_bfinfdpic_finish_dynamic_sections): Likewise.
3164
3165 2009-05-05  Paul Brook  <paul@codesourcery.com>
3166
3167         * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
3168         * bfd-in2.h: Regenerate.
3169         * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
3170         (_arm_elf_section_data): Add text and exidx fields.
3171         (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
3172         insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
3173         copy_exidx_entry): New functions.
3174         (elf32_arm_write_section): Fixup .ARM.exidx contents.
3175
3176 2009-05-05  Christophe lyon  <christophe.lyon@st.com>
3177
3178         * elf32-arm.c (DEF_STUBS): New helper define.
3179         (DEF_STUB): Likewise.
3180         (stub_def): New type.
3181         (stub_definitions): New array, containing stub template pointers
3182         and sizes.
3183         (arm_size_one_stub): Make use of stub_definitions.
3184
3185 2009-05-04  Dave Korn  <dave.korn.cygwin@gmail.com>
3186
3187         * elflink.c (find_version_for_sym):  Remove from here, ...
3188         * linker.c (bfd_find_version_for_sym):  ... rename, replace
3189         here, make public and update all callers.
3190         * bfd-in2.h:  Regenerate.
3191
3192 2009-04-30  Nick Clifton  <nickc@redhat.com>
3193
3194         * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
3195         section pointer.
3196         (struct elf_obj_data): Add has_ifunc_symbols boolean.
3197         * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
3198         into a STT_GNU_IFUNC symbol type.
3199         (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
3200         type.
3201         (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
3202         the binary contains ifunc symbols.
3203         * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
3204         symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
3205         * elf32-i386.c (is_indirect_function): New function.
3206         (elf_i386_check_relocs): Create an ifunc output section.
3207         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
3208         section if necessary.
3209         (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
3210         if necessary.
3211         (elf_i386_add_symbol_hook): New function. Set the
3212         has_ifunc_symbols field of the elf_obj_data structure if an ifunc
3213         symbol is encountered.
3214         (elf_backend_post_process_headers): Define.
3215         (elf_backend_add_symbol_hook): Define.
3216         (elf_i386_post_process_headers): Rename to
3217         elf_i388_fbsd_post_process_headers.
3218         * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
3219         (is_indirect_function): New function.
3220         (elf64_x86_64_check_relocs): Create an ifunc output section.
3221         (allocate_dynrelocs): Create dynamic relocs in the ifunc output
3222         section if necessary.
3223         (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
3224         symbol if necessary.
3225         (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
3226         elf_obj_data structure if an ifunc symbol is encountered.
3227         (elf_backend_post_process_headers): Define.
3228         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
3229         if we have ifunc symbols to handle.
3230         (get_ifunc_reloc_section_name): New function.  Computes the name
3231         for an ifunc section.
3232         (_bfd_elf_make_ifunc_reloc_section): New function.  Creates a
3233         section to hold ifunc relocs.
3234         * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
3235         (bfd_print_symbol_vandf): Handle ifunc symbols.
3236         (bfd_decode_symclass): Likewise.
3237         * bfd-in2.h: Regenerate.
3238
3239 2009-04-30  Joseph Myers  <joseph@codesourcery.com>
3240
3241         * elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
3242         MOVW and MOVT relocations in a shared library link.
3243
3244 2009-04-27  Anthony Green  <green@moxielogic.com>
3245
3246         * verilog.c: New file.
3247         * Makefile.am (BFD32_LIBS): Add verilog.c.
3248         (BFD32_LIBS_CFILES): Add verilog.c.
3249         (verilog.lo): New build rule.
3250         * Makefile.in: Rebuilt.
3251         * targets.c: Add verilog support.
3252         * bfd.c (tdata union): Add Verilog private data field.
3253         * bfd-in2.h: Regenerate.
3254
3255 2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>
3256
3257         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
3258         copy pe_opthdr.
3259
3260 2009-04-23  Matthias Klose  <doko@ubuntu.com>
3261
3262         * peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
3263
3264 2009-04-22  Christophe Lyon  <christophe.lyon@st.com>
3265
3266         PR9743
3267         * elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24,
3268         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
3269         (elf32_arm_size_stubs): Likewise.
3270         (record_thumb_to_arm_glue): Deleted unused function.
3271         (bfd_elf32_arm_process_before_allocation): No longer handle
3272         R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here.
3273         (elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24,
3274         R_ARM_JUMP24 and R_ARM_PLT32 relocations.
3275
3276 2009-04-21  Daniel Jacobowitz  <dan@codesourcery.com>
3277
3278         * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED.
3279         (elf32_arm_write_section): Declare early.
3280         (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD.
3281         (arm_allocate_glue_section_space): Exclude empty sections.
3282         (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED.
3283         (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub
3284         BFD.
3285         (elf32_arm_output_glue_section, elf32_arm_final_link): New.
3286         (elf32_arm_merge_eabi_attributes): Skip the stub BFD.
3287         (elf32_arm_size_dynamic_sections): Allocate interworking
3288         sections here.
3289         (bfd_elf32_bfd_final_link): Define.
3290
3291 2009-04-21  H.J. Lu  <hongjiu.lu@intel.com>
3292
3293         * coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K.
3294
3295         * coffcode.h (coff_compute_section_file_positions): Clear
3296         D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE.
3297
3298         * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and
3299         force_minimum_alignment.
3300
3301         * libcoff.h: Regenerated.
3302
3303         * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed.
3304         (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise.
3305
3306         * peicode.h (pe_mkobject): Don't set force_minimum_alignment
3307         nor target_subsystem.
3308
3309         * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check
3310         force_minimum_alignment nor target_subsystem.
3311
3312 2009-04-21  Kai Tietz  <kai.tietz@onevision.com>
3313
3314         * coff-x86_64.c (PEI_HEADERS): Protect includes.
3315         (bfd_pe_print_pdata): Remove #ifdef PE variation.
3316         * pei-x86_64.c (PEI_HEADERS): Define to prevent double
3317         include in coff-x86_64.c of headers.
3318         (PDATA_ROW_SIZE): New define.
3319         (pex_regs[]): New static array.
3320         (pex64_get_runtime_function): New static function.
3321         (pex64_get_unwind_info): Likewise.
3322         (pex64_get_scope_entry): Likewise.
3323         (pex64_xdata_print_uwd_codes): Likewise.
3324         (pex64_get_section_by_rva): Likewise.
3325         (pex64_dump_xdata): Likewise.
3326         (pex64_bfd_print_pdata): Likewise.
3327         (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata.
3328         * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation.
3329         * libpei.h (_bfd_pex64_print_pdata): Removed declaration.
3330
3331 2009-04-19  Peter O'Gorman  <binutils@mlists.thewrittenword.com>
3332             Alan Modra  <amodra@bigpond.net.au>
3333             Dave Korn  <dave.korn.cygwin@gmail.com>
3334
3335         * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t
3336         long names and non-NUL-terminated strings.
3337
3338 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
3339
3340         * bfd-in2.h: Regenerated.
3341
3342 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
3343
3344         * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace
3345         IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER.
3346
3347 2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>
3348
3349         PR binutils/10074
3350         * coffcode.h (bfd_pei_p): New.
3351
3352         * config.bfd: Remove bfd_efi_bsdrv_ia32_vec,
3353         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
3354         bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and
3355         bfd_efi_rtdrv_ia64_vec.  Replace bfd_efi_app_ia32_vec,
3356         bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with
3357         i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively.
3358
3359         * configure.in: Remove bfd_efi_bsdrv_ia32_vec,
3360         bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
3361         bfd_efi_rtdrv_x86_64_vec,
3362         bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec.  Replace
3363         bfd_efi_ia64_vec with bfd_pei_ia64_vec.
3364         * targets.c: Likewise.
3365
3366         * configure: Regenerated.
3367         * libcoff.h: Likewise.
3368         * Makefile.in: Likewise.
3369
3370         * efi-app-ia32.c: Removed.
3371         * efi-app-x86_64.c: Likewise.
3372         * efi-bsdrv-ia32.c: Likewise.
3373         * efi-bsdrv-ia64.c: Likewise.
3374         * efi-bsdrv-x86_64.c: Likewise.
3375         * efi-rtdrv-ia32.c: Likewise.
3376         * efi-rtdrv-ia64.c: Likewise.
3377         * efi-rtdrv-x86_64.c: Likewise.
3378         * efi-rtdrv-ia32.c: Likewise.
3379
3380         * efi-app-ia64.c: Moved to ...
3381         * pei-ia64.c: This.
3382         (TARGET_SYM): Set to bfd_pei_ia64_vec.
3383         (TARGET_NAME): Set to pei-ia64.
3384
3385         * libpei.h (bfd_target_pei_p): Removed.
3386         (bfd_target_pei_arch): Likewise.
3387         (bfd_target_efi_app_p): Likewise.
3388         (bfd_target_efi_app_arch): Likewise.
3389         (bfd_target_efi_bsdrv_p): Likewise.
3390         (bfd_target_efi_bsdrv_arch): Likewise.
3391         (bfd_target_efi_rtdrv_p): Likewise.
3392         (bfd_target_efi_rtdrv_arch): Likewise.
3393         (bfd_pe_executable_p): Likewise.
3394
3395         * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo,
3396         efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo.
3397         (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c
3398         and efi-rtdrv-ia32.c.
3399         (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo,
3400         efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and
3401         efi-rtdrv-x86_64.lo. Add pei-ia64.lo.
3402         (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c,
3403         efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and
3404         efi-rtdrv-x86_64.c. Add pei-ia64.c.
3405         (efi-app-ia64.lo): Removed.
3406         (efi-bsdrv-ia32.lo): Likewise.
3407         (efi-rtdrv-ia32.lo): Likewise.
3408         (efi-app-ia64.lo): Likewise.
3409         (efi-bsdrv-ia64.lo): Likewise.
3410         (efi-rtdrv-ia64.lo): Likewise.
3411         (efi-app-x86_64.lo): Likewise.
3412         (efi-bsdrv-x86_64.lo): Likewise.
3413         (efi-rtdrv-x86_64.lo): Likewise.
3414         (pei-ia64.lo): New.
3415
3416         * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p
3417         with bfd_pei_p.
3418         (arch_type): Removed.
3419         (pe_arch): Likewise.
3420         (pe_bfd_object_p): Just return coff_object_p.
3421
3422         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace
3423         bfd_pe_executable_p with bfd_pei_p.
3424
3425 2009-04-17  Christophe Lyon  <christophe.lyon@st.com>
3426
3427         * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through
3428         PLT entries to an undefined symbol when generating a shared
3429         library.
3430
3431 2009-04-17  Nick Clifton  <nickc@redhat.com>
3432
3433         PR 9909
3434         * coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.
3435
3436 2009-04-16  Richard Sandiford  <r.sandiford@uk.ibm.com>
3437
3438         * aout-adobe.c (aout_32_bfd_define_common_symbol): Define.
3439         * aout-target.h (MY_bfd_define_common_symbol): Likewise.
3440         * aout-tic30.c (MY_bfd_define_common_symbol): Likewise.
3441         * binary.c (binary_bfd_define_common_symbol): Likewise.
3442         * bout.c (b_out_bfd_define_common_symbol): Likewise.
3443         * coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
3444         * coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
3445         * coffcode.h (coff_bfd_define_common_symbol): Likewise.
3446         * elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise.
3447         * i386msdos.c (msdos_bfd_define_common_symbol): Likewise.
3448         * i386os9k.c (os9k_bfd_define_common_symbol): Likewise.
3449         * ieee.c (ieee_bfd_define_common_symbol): Likewise.
3450         * ihex.c (ihex_bfd_define_common_symbol): Likewise.
3451         * libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise.
3452         * mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise.
3453         * mmo.c (mmo_bfd_define_common_symbol): Likewise.
3454         * nlm-target.h (nlm_bfd_define_common_symbol): Likewise.
3455         * oasys.c (oasys_bfd_define_common_symbol): Likewise.
3456         * pef.c (bfd_pef_bfd_define_common_symbol): Likewise.
3457         * ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise.
3458         * som.c (som_bfd_define_common_symbol): Likewise.
3459         * srec.c (srec_bfd_define_common_symbol): Likewise.
3460         * tekhex.c (tekhex_bfd_define_common_symbol): Likewise.
3461         * versados.c (versados_bfd_define_common_symbol): Likewise.
3462         * vms.c (vms_bfd_define_common_symbol): Likewise.
3463         * xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise.
3464         * xsym.c (bfd_sym_bfd_define_common_symbol): Likewise.
3465         * coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol.
3466         (pmac_xcoff_vec): Likewise.
3467         * coff64-rs6000.c (rs6000coff64_vec): Likewise.
3468         (aix5coff64_vec): Likewise.
3469         * linker.c (bfd_generic_define_common_symbol): New function.
3470         * targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol.
3471         (_bfd_define_common_symbol): New field.
3472         * libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare.
3473         * xcofflink.c (_bfd_xcoff_define_common_symbol): New function.
3474         (xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common
3475         symbols here.
3476         * bfd-in2.h: Regenerate.
3477         * libbfd.h: Likewise.
3478         * libcoff.h: Likewise.
3479
3480 2009-04-15  Anthony Green  <green@moxielogic.com>
3481
3482         * targets.c: Add moxie support.
3483         * Makefile.am: Ditto.
3484         * Makefile.in: Rebuilt.
3485         * cpu-moxie.c, elf32-moxie.c: New files.
3486         * archures.c: Add moxie support.
3487         * configure.in: Add moxie support.
3488         * configure: Rebuilt.
3489         * config.bfd, archures.c: Add moxie support.
3490         * bfd-in2.h: Rebuilt.
3491
3492 2009-04-15  Christophe Lyon  <christophe.lyon@st.com>
3493
3494         * elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM
3495         branch to an undef weak symbol into a jump to next instruction if
3496         a PLT entry will be created.
3497
3498 2009-04-14  Dave Korn  <dave.korn.cygwin@gmail.com>
3499
3500         * coffgen.c (make_a_section_from_file):  Set the backend long
3501         section names enable if long section names found on input.
3502         * coffcode.h:  Extend long section names documentation to match.
3503
3504 2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>
3505
3506         * elflink.c (elf_link_add_object_symbols): Warn alternate ELF
3507         machine code.
3508
3509 2009-04-07  DJ Delorie  <dj@redhat.com>
3510
3511         * archures.c: Add bfd_mach_mep_c5.
3512         * bfd-in2.h: Likewise.
3513         * cpu-mep.c: Add bfd_c5_arch.
3514         * elf32-mep.c: Support it.
3515
3516 2009-04-07  H.J. Lu  <hongjiu.lu@intel.com>
3517
3518         * elflink.c (_bfd_elf_section_already_linked): Add `\n' for
3519         info->callbacks->einfo.
3520         * linker.c (_bfd_generic_section_already_linked): Likewise.
3521
3522 2009-04-06  DJ Delorie  <dj@redhat.com>
3523
3524         * elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes.
3525
3526 2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>
3527
3528         * coff-x86_64.c (bfd_pe_print_pdata): Defined to
3529         _bfd_pex64_print_pdata only if PE is defined.
3530
3531         * libpei.h (_bfd_pep_print_x64_pdata): Renamed to ...
3532         (_bfd_pex64_print_pdata): This.
3533
3534         * peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ...
3535         (_bfd_pex64_print_pdata): This.  Defined only if COFF_WITH_pex64
3536         is defined.
3537
3538 2009-04-05  Kai Tietz  <kai.tietz@onevision.com>
3539
3540         * coff-x86_64.c (bfd_pe_print_pdata): Define as
3541         _bfd_pep_print_x64_pdata.
3542         * libpei.h (_bfd_pep_print_x64_pdata): Add prototype.
3543         * peXXigen.c (_bfd_pep_print_x64_pdata): New.
3544
3545 2009-04-02  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
3546
3547         * elf32-xtensa.c (relax_property_section): Always set r_offset
3548         to zero.
3549
3550 2009-04-02  Christophe Lyon  <christophe.lyon@st.com>
3551
3552         * elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb,
3553         elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long
3554         branch stubs.
3555         (elf32_arm_stub_type): New enum values for the two new stubs.
3556         (arm_type_of_stub): Make use of the two new stubs.
3557         (arm_size_one_stub): Handle the two new stubs.
3558
3559 2009-04-01  Matt Thomas  <matt@netbsd.org>
3560
3561         * elf32-vax.c (elf_vax_check_relocs): Do not put relocations against
3562         hidden symbols into the GOT or PLT.GOT.
3563         (elf_vax_relocate_section): Do not emit a PCREL reloc
3564         into a shared object if it is against a hidden symbol.
3565
3566 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
3567
3568         * xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
3569         and know_contains_shared_object_p.
3570         (xcoff_archive_contains_shared_object_p): Add an "info" parameter.
3571         Cache the result in the archive_info table.
3572         (xcoff_auto_export_p): Add an "info" parameter and update the
3573         call to xcoff_archive_contains_shared_object_p.
3574         (xcoff_mark_auto_exports): Update accordingly.
3575         (xcoff_post_gc_symbol): Likewise.
3576
3577 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
3578
3579         * xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
3580         rather than C_EXT.
3581
3582 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
3583
3584         * coff-rs6000.c (member_layout): New structure.
3585         (archive_iterator): Likewise.
3586         (member_layout_init): New function.
3587         (archive_iterator_begin): Likewise.
3588         (archive_iterator_next): Likewise.
3589         (xcoff_write_armap_old): Use the new iterator functions.
3590         (do_shared_object_padding): Delete.
3591         (xcoff_write_armap_big): Use the new iterator functions.  Simplify
3592         handling of arch_info.
3593         (xcoff_write_archive_contents_old): Allocate arelt_data in the
3594         first loop rather than the second.  Allocate a member header if
3595         there isn't one, then work out the stat information and length
3596         in the first loop too.  Use the new iterators for the second loop.
3597         (xcoff_write_archive_contents_big): Likewise.
3598
3599 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
3600
3601         * bfd-in.h (bfd_xcoff_split_import_path): Declare.
3602         (bfd_xcoff_set_archive_import_path): Likewise.
3603         * bfd-in2.h: Regenerate.
3604         * xcofflink.c: Include libiberty.h.
3605         (xcoff_archive_info): New structure.
3606         (xcoff_archive_info_hash): New function.
3607         (xcoff_archive_info_eq): Likewise.
3608         (xcoff_get_archive_info): Likewise.
3609         (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info.
3610         (bfd_xcoff_split_import_path): New function.
3611         (bfd_xcoff_set_archive_import_path): Likewise.
3612         (xcoff_set_import_path): Move earlier in file.
3613         (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive
3614         object to the the directory part of the bfd's filename.  Get the
3615         import path and filename of an archive object from the archive's
3616         xcoff_tdata, initializing it if necessary.  Update use of
3617         import_file_id.
3618         (bfd_link_input_bfd): Update use of import_file_id.
3619         (xcoff_write_global_symbol): Likewise.
3620
3621 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
3622
3623         * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
3624
3625 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
3626
3627         * xcofflink.c (xcoff_link_create_extra_sections): Don't create
3628         a .loader section for relocatable links.
3629         (xcoff_need_ldrel_p): New function.
3630         (xcoff_mark): Use it.
3631         (bfd_xcoff_link_count_reloc): Only count loader relocs if there's
3632         a loader section.
3633         (xcoff_build_ldsym): New function, split out from...
3634         (xcoff_build_ldsyms): ...here.  Rename to...
3635         (xcoff_post_gc_symbol): ...this.  Only export symbols, and only
3636         call xcoff_build_ldsym, if there's a loader section.
3637         (xcoff_build_loader_section): New function, extracted verbatim from...
3638         (bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
3639         there's a loader section.  Only add an __rtinit loader symbol
3640         if there's a loader section.  Update after above name change.
3641         (xcoff_symbol_section, xcoff_create_ldrel): New functions.
3642         (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
3643         and xcoff_create_ldrel.
3644         (xcoff_write_global_symbol): Use xcoff_create_ldrel.
3645         (xcoff_reloc_link_order): Likewise, but only call it if there's
3646         a loader section.  Use xcoff_symbol_section.
3647         (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
3648         if there's a loader section.
3649
3650 2009-04-01  Richard Sandiford  <rdsandiford@googlemail.com>
3651
3652         * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
3653
3654 2009-04-01  Christophe Lyon  <christophe.lyon@st.com>
3655
3656         * elf32-arm.c (group_sections): Rewrite loops for better
3657         readability.
3658
3659 2009-03-30  DJ Delorie  <dj@redhat.com>
3660
3661         * elflink.c (elf_link_input_bfd): Don't try to resolve complex
3662         relocs when doing a relocatable link.
3663
3664 2009-03-28  Mark Mitchell  <mark@codesourcery.com>
3665
3666         * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
3667         "ERROR:", in error messages.
3668         * cpu-arm.c (bfd_arm_merge_machines): Likewise.
3669         * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
3670         * elf32-arm.c (tag_cpu_arch_combine): Likewise.
3671         (elf32_arm_merge_eabi_attributes): Likewise.
3672         (elf32_arm_merge_private_bfd_data): Likewise.
3673
3674 2009-03-27  Nick Clifton  <nickc@redhat.com>
3675
3676         * section.c (bfd_get_section_contents): Detect and handle the case
3677         where a section has the SEC_IN_MEMORY flag set but no actual
3678         contents allocated.
3679
3680 2009-03-26  Alan Modra  <amodra@bigpond.net.au>
3681
3682         PR 6494
3683         * elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO
3684         p_filesz and p_memsz are equal.  Use p_memsz as the segment size.
3685         (assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO
3686         if we don't find matching PT_LOAD when copying.
3687
3688 2009-03-25  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
3689
3690         * elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
3691         the reloc descriptions.
3692
3693 2009-03-25  Hans-Peter Nilsson  <hp@axis.com>
3694
3695         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
3696         <R_CRIS_16_GOT_GD, case R_CRIS_32_GOT_GD>: Handle COMMON symbols.
3697         <case R_CRIS_16_TPREL, R_CRIS_32_TPREL>: Ditto.
3698
3699 2009-03-24  H.J. Lu  <hongjiu.lu@intel.com>
3700
3701         * cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static.
3702         (bfd_i386_arch_intel_syntax): Likewise.
3703         (i8086_arch): Likewise.
3704         (bfd_x86_64_arch): Likewise.
3705
3706 2009-03-24  Hans-Peter Nilsson  <hp@axis.com>
3707
3708         * elf32-cris.c (cris_elf_relocate_section): <case
3709         R_CRIS_16_DTPREL, R_CRIS_32_DTPREL>: Allow use of non-local
3710         symbols for non-allocated sections.  Don't check whether to
3711         generate R_CRIS_DTPMOD for non-allocated sections.
3712         (cris_elf_gc_sweep_hook) <case R_CRIS_32_DTPREL>: Don't
3713         handle relocation GC:ing if applied to non-allocated section.
3714         (cris_elf_check_relocs): Similar.
3715
3716         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
3717         <R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: Don't include the TLS size
3718         when emitting a known TP offset in the GOT.
3719
3720 2009-03-23  Alan Modra  <amodra@bigpond.net.au>
3721
3722         * elf64-ppc.c (synthetic_opd): Delete.
3723         (compare_symbols): Look for .opd name rather than section match.
3724         (ppc64_elf_get_synthetic_symtab): Likewise.
3725
3726 2009-03-21  Alan Modra  <amodra@bigpond.net.au>
3727
3728         * elf32-ppc.c (is_pic_glink_stub): Delete.
3729         (is_nonpic_glink_stub): New function.
3730         (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather
3731         than first pic one.
3732         (struct ppc_elf_link_hash_table <glink_pltresolve>): Comment fix.
3733
3734 2009-03-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
3735             Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
3736
3737         * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_*
3738         macros for visibilty and locality checks.
3739         (elf_s390_adjust_dynamic_symbol): Likewise.
3740         (allocate_dynrelocs): Likewise.
3741         (elf_s390_relocate_section): Likewise.
3742         (elf_s390_finish_dynamic_symbol): Likewise.
3743         * elf64-s390.c (elf_s390_check_relocs): Likewise.
3744         (elf_s390_adjust_dynamic_symbol): Likewise.
3745         (allocate_dynrelocs): Likewise.
3746         (elf_s390_relocate_section): Likewise.
3747         (elf_s390_finish_dynamic_symbol): Likewise.
3748
3749 2009-03-19  Kai Tietz  <kai.tietz@onevision.com>
3750
3751         * bfd-in2.h: Regenerated.
3752         * coffcode.h (sec_to_styp_flags): For pe-coff add SEC_READONLY
3753         for debugging sections and map memory read/write dependent on
3754         SEC_COFF_NOREAD.
3755         (styp_to_sec_flags): Set SEC_COFF_NOREAD for sections
3756         without memory read flags set.
3757         * section.c: Add SEC_COFF_NOREAD to section flags.
3758
3759 2009-03-19  Andreas Schwab  <schwab@linux-m68k.org>
3760
3761         * elf32-hppa.c (final_link_relocate): Cast bfd_vma values to long
3762         for format string.
3763
3764 2009-03-19  Alan Modra  <amodra@bigpond.net.au>
3765
3766         * elf32-spu.c (spu_elf_find_overlays): Separate error return from
3767         "no overlays" return.  If there are overlays, create overlay
3768         manager entry symbols here, so that..
3769         (spu_elf_build_stubs): ..we don't need to set them up here.
3770         Simplify entry symbol tests.
3771         * elf32-spu.h (spu_elf_find_overlays): Update prototype.
3772
3773 2009-03-18  Mark Kettenis  <kettenis@gnu.org>
3774
3775         * elf.c (elfcore_grok_openbsd_procinfo)
3776         (elfcore_grok_openbsd_note): New functions.
3777         (elf_parse_notes): Handle notes from OpenBSD ELF core files.
3778
3779 2009-03-18  Alan Modra  <amodra@bigpond.net.au>
3780
3781         * vms-hdr.c: Don't include alloca.h.
3782         * elf32-m68hc1x.c: Include alloca-conf.h.
3783         * xsym.c: Likewise.
3784         * elf64-hppa.c: Likewise.  Remove existing #if's handling alloca.
3785         * som.c: Likewise.
3786         * Makefile.am: Run "make dep-am".
3787         * Makefile.in: Regenerate.
3788
3789 2009-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
3790
3791         * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test.
3792
3793 2009-03-17  Alan Modra  <amodra@bigpond.net.au>
3794
3795         * elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit.
3796         Add compact_stub.
3797         (emum _ovly_flavour): Delete ovly_compact, ovly_none.
3798         * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and
3799         ovly_return fields with ovly_entry[2].  Adjust all users.
3800         (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler
3801         when soft-icache.
3802         (spu_elf_build_stubs): Likewise.
3803         (ovl_stub_size): Change arg to spu_elf_params pointer.  Adjust for
3804         ovly_flavour changes.  Update all callers.
3805         (ovl_stub_size_log2): New function.
3806         (build_stub): Handle compact icache stubs.  Use different manager
3807         entry point for stubs in non-icache area.
3808         (spu_elf_size_stubs): Don't allocate space for indirect branch
3809         descriptors.
3810         (spu_elf_build_stubs): And don't built them.
3811
3812 2009-03-16  Andrew Stubbs  <ams@codesourcery.com>
3813
3814         * dwarf2.c (read_section): Always use rawsize, if available.
3815
3816 2009-03-16  Alan Modra  <amodra@bigpond.net.au>
3817
3818         * simple.c (bfd_simple_get_relocated_section_contents): Use larger
3819         of rawsize and size for buffer.
3820
3821 2009-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
3822
3823         * elf32-spu.c (spu_elf_check_vma): Do not reset auto_overlay
3824         parameter just because fixed sections fit into local store.
3825         (spu_elf_auto_overlay): Do not declare as "noreturn".  Skip
3826         generating overlays if fixed sections plus reserved stack
3827         and heap space fit into local store.
3828
3829 2009-03-15  Alan Modra  <amodra@bigpond.net.au>
3830
3831         * elf32-spu.c (build_stub): Correct icache set_id.
3832         (spu_elf_relocate_section): Likewise.
3833
3834 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3835
3836         * xcofflink.c (xcoff_link_check_archive_element): Only free the
3837         symbol table if it was created by the current call.
3838
3839 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3840
3841         * xcofflink.c (xcoff_build_ldsyms): Give imported descriptors
3842         class XMC_DS rather than XMC_UA.
3843
3844 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3845
3846         * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the
3847         bfd_boolean export_defineds parameter with an unsigned int
3848         auto_export_flags parameter.
3849         * bfd-in2.h: Regenerate.
3850         * xcofflink.c (xcoff_archive_contains_shared_object_p): New function,
3851         split out from xcoff_build_ldsyms.
3852         (xcoff_covered_by_expall_p): New function.
3853         (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms
3854         but with extra code to handle -bexpfull and -bexpall.
3855         (xcoff_mark_auto_exports): New function.
3856         (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether
3857         a function should be automatically exported.
3858         (bfd_xcoff_size_dynamic_sections): Replace the export_defineds
3859         parameter with an auto_export_flags parameter.  Update ldinfo
3860         accordingly.  Use xcoff_mark_auto_exports to mark all automatically-
3861         exported symbols.
3862
3863 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3864
3865         * xcofflink.c (xcoff_mark_symbol_by_name): New function.
3866         (bfd_xcoff_size_dynamic_sections): Use it to mark the entry,
3867         init and fini functions.  Do garbage collection for objects
3868         without an entry point too.
3869
3870 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3871
3872         * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to
3873         check whether a symbol has csect information.
3874         (coff_print_aux): Likewise.
3875         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect
3876         information for C_AIX_WEAKEXT too.
3877         (_bfd_xcoff_swap_aux_out): Likewise.
3878         (xcoff_reloc_type_br): Handle defweak symbols too.
3879         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect
3880         information for C_AIX_WEAKEXT too.
3881         (_bfd_xcoff64_swap_aux_out): Likewise.
3882         (xcoff64_reloc_type_br): Handle defweak symbols too.
3883         * coffgen.c (coff_print_symbol): Handle auxillary function
3884         information for C_AIX_WEAKEXT too.
3885         * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK
3886         instead of BSF_GLOBAL if the L_WEAK flag is set.
3887         (xcoff_dynamic_definition_p): New function.
3888         (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym
3889         defines h.  Don't change h if ldsym isn't the definition.  Otherwise,
3890         always take the symbol class from the ldsym.  Use weak bfd symbol
3891         types for weak ldsyms.
3892         (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P.
3893         Fix the check for whether a definition is from a shared object.
3894         Allow redefinitions of weak symbols.
3895         (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P.
3896         (xcoff_keep_symbol_p): Likewise.
3897         (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P.
3898         (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P.
3899         Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols,
3900         but mark them as L_WEAK.
3901         (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT
3902         instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT.
3903
3904 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3905
3906         * xcofflink.c (xcoff_mark): When walking the relocations,
3907         only mark the target symbol or the target section, not both.
3908         (xcoff_final_definition_p): New function.
3909         (xcoff_keep_symbol_p): Use it to check whether an external XCOFF
3910         symbol is a valid definition of the associated output symbol.
3911         Use XCOFF_ALLOCATED to stop the same hash table entry having
3912         two output symbols.
3913         (bfd_xcoff_size_dynamic_sections): Set XCOFF_ALLOCATED when
3914         keeping a symbol.
3915         (xcoff_link_input_bfd): Use xcoff_final_definition_p.
3916
3917 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3918
3919         * xcofflink.c (bfd_xcoff_import_symbol): Treat imported absolute
3920         symbols as XMC_XO.
3921
3922 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3923
3924         * libcoff-in.h (xcoff_tdata): Add a lineno_counts field.
3925         * libcoff.h: Regenerate.
3926         * xcofflink.c (xcoff_link_add_symbols): Record per-symbol
3927         line-number counts in the bfd's lineno_counts field.
3928         Don't keep per-csect line-number counts.
3929         (xcoff_sweep): Don't update per-csect line-number counts.
3930         (bfd_xcoff_size_dynamic_sections): Count the number of line-number
3931         entries in each output section.
3932         (xcoff_link_input_bfd): Get the number of line numbers from
3933         the bfd's lineno_counts field, rather than recalculating it
3934         from scratch.  Fix the range check when updating C_BINCL and
3935         C_EINCL symbols.
3936         (_bfd_xcoff_bfd_final_link): Don't count the output line numbers
3937         here.  Don't expect csects to have line-number counts.
3938
3939 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3940
3941         * libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
3942         * libcoff.h: Regenerate.
3943         * xcofflink.c (xcoff_keep_symbol_p): New function, using the
3944         "skip" logic from xcoff_link_input_bfd.
3945         (bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
3946         objects in a dynamic link, rather than checking whether csectpp
3947         is null.  Always allocate debug_index for other objects,
3948         and always go through the loop.  Update the type of debug_index
3949         after the change above.  Read the auxillary csect information
3950         and use xcoff_keep_symbol_p to decide whether a symbol should
3951         be kept.  Set its debug_index to -2 if not.
3952         (xcoff_link_input_bfd): Update the type of debug_index after
3953         the change above and always expect it to be nonnull.  Use it to
3954         test whether a symbol should be stripped, rather than making the
3955         decision here.  Postpone all symbol creation to the second pass.
3956
3957 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3958
3959         * xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
3960         creating a descriptor.
3961         (xcoff_sweep): Don't mark toc_section unless it's needed.
3962         (bfd_xcoff_size_dynamic_sections): Skip the toc_section
3963         when marking every bfd.
3964         (xcoff_link_input_bfd): Skip all TOC anchors.
3965         (xcoff_toc_section_p, xcoff_find_tc0): New functions.
3966         (_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
3967         to -1; call xcoff_find_tc0 instead.
3968
3969 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3970
3971         * libcoff-in.h (xcoff_section_tdata): Update commentary.
3972         * libcoff.h: Regenerate.
3973         * xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
3974         symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
3975         the previous symbol's csect.  Treat last_symndx as an inclusive value
3976         and simplify its handling.
3977         (xcoff_mark): Treat last_symndx as an inclusive value.  Only mark
3978         symbols with the right csect.  Don't mark rsec when processing
3979         relocations against undefined or absolute sections.
3980         (bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
3981         of bfd_und_section_ptr.
3982         (xcoff_link_input_bfd): Likewise.
3983
3984 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
3985
3986         * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
3987         against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
3988         flag is set.  Assert that all undefined symbols are either
3989         imported or defined by a dynamic object.
3990         * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
3991         * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
3992         handling to all relocations.  Only set XCOFF_CALLED for function
3993         symbols.
3994         (xcoff_find_function): New function, split out from...
3995         (bfd_xcoff_export_symbol) ...here.
3996         (xcoff_set_import_path): New function, split out from...
3997         (bfd_xcoff_import_symbol): ...here.  Remove assertion for old
3998         meaning of XCOFF_CALLED.
3999         (xcoff_mark_symbol): If we mark an undefined and unimported
4000         symbol, find some way of defining it.  If the symbol is a function
4001         descriptor, fill in its definition automatically.  If the symbol
4002         is a function, mark its descriptor and allocate room for global
4003         linkage code.  Otherwise mark the symbol as implicitly imported.
4004         Move the code for creating function descriptors from...
4005         (xcoff_build_ldsyms): ...here.  Use XCOFF_WAS_UNDEFINED to
4006         check for symbols that were implicitly defined.
4007         (xcoff_mark): Don't count any dynamic relocations against
4008         function symbols.
4009         (bfd_xcoff_size_dynamic_sections): Save the rtld parameter
4010         in the xcoff link info.
4011         (xcoff_link_input_bfd): Remove handling of undefined and
4012         unexported symbols.
4013
4014 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
4015
4016         * coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
4017         if the target is absolute.  Fix comment typo.
4018         (xcoff_ppc_relocate_section): Remove FIXME.
4019         * coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
4020         if the target is absolute.
4021
4022 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
4023
4024         * xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
4025         R_POS and R_NEG relocations against absolute symbols to the
4026         .loader section.
4027
4028 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
4029
4030         * coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
4031         to 2 for bfd_mach_ppc_620.
4032
4033 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
4034
4035         * config.bfd: Treat AIX 6+ in the same way as AIX 5.
4036         * configure.in: Likewise.
4037         * configure: Regenerate.
4038
4039 2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>
4040
4041         PR binutils/9945
4042         * elf.c (assign_section_numbers): Generate symbol table if there
4043         is any relocation in output.
4044         (_bfd_elf_compute_section_file_positions): Likewise.
4045
4046 2009-03-13  Nick Clifton  <nickc@redhat.com>
4047
4048         PR 9934
4049         * elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
4050         * elflink.c (elf_link_read_relocs_from_section): Use
4051         NUM_SHDR_ENTRIES.  Gracefully handle the case where there are
4052         relocs but no symbol table.
4053         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
4054
4055 2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>
4056
4057         PR ld/9938
4058         * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
4059         to check ___tls_get_addr.
4060
4061         * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
4062         strncmp to check __tls_get_addr.
4063
4064 2009-03-12  Andrew Stubbs  <ams@codesourcery.com>
4065
4066         * dwarf2.c (read_section): Always check the offset, even when the
4067         section has been read before.
4068
4069 2009-03-11  H.J. Lu  <hongjiu.lu@intel.com>
4070
4071         * elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
4072         comments.
4073
4074 2009-03-11  Chris Demetriou  <cgd@google.com>
4075
4076         * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
4077         * bfd-in2.h: Regenerate.
4078         * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
4079         flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
4080         mode.
4081         (bsd_write_armap): Likewise.
4082         (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
4083         flag is set, do nothing.
4084         (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
4085         for timestamp.
4086
4087 2009-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
4088
4089         * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
4090         used to update stack pointer.
4091
4092 2009-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4093
4094         PR binutils/9921
4095         * som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
4096         for unknown symbols in absolute section.
4097
4098 2009-03-06  Nick Clifton  <nickc@redhat.com>
4099
4100         * po/es.po: Updated Spanish translation.
4101
4102 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
4103
4104         * elf32-arm.c (group_sections): Take next section size into
4105         account before accepting to group it.
4106
4107 2009-03-05  Christophe Lyon  <christophe.lyon@st.com>
4108
4109         * elf32-arm.c (arm_type_of_stub): Handle long branches targetting
4110         PLT entries.
4111         (elf32_arm_final_link_relocate): Likewise.
4112
4113 2009-03-05  Moritz Kroll  <Moritz.Kroll@gmx.de>
4114
4115         PR 9923
4116         * peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
4117
4118 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
4119
4120         * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
4121         * section.c (struct bfd_section): Add has_tls_get_addr_call.
4122         (BFD_FAKE_SECTION): Init new flag.
4123         * ecoff.c (bfd_debug_section): Likewise.
4124         * bfd-in2.h: Regenerate.
4125         * libbfd.h: Regenerate.
4126         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
4127         (ppc_elf_reloc_type_lookup): Handle new relocs.
4128         (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
4129         without marker relocs.
4130         (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
4131         if section has no old-style calls.
4132         (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
4133         Don't try to optimize new-style __tls_get_addr call when handling
4134         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
4135         relocs.
4136         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
4137         (ppc64_elf_reloc_type_lookup): Handle new relocs.
4138         (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
4139         without marker relocs.
4140         (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
4141         if section has no old-style calls.  Set toc_ref for new relocs as
4142         appropriate.
4143         (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
4144         Don't try to optimize new-style __tls_get_addr call when handling
4145         arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
4146         relocs.
4147
4148 2009-03-04  Alan Modra  <amodra@bigpond.net.au>
4149
4150         PR 6768
4151         * configure.in: Test for ld --as-needed support.  Link shared
4152         libbfd against libm.
4153         * configure: Regenerate.
4154
4155 2009-03-03  Alan Modra  <amodra@bigpond.net.au>
4156
4157         * Makefile.am: Run "make dep-am".
4158         * Makefile.in: Regenerate.
4159
4160 2009-03-02  Qinwei  <qinwei@sunnorth.com.cn>
4161
4162         * elf32-score7.c: New file.
4163         * elf32-score.h: New file.
4164         * elf32-score.c: Add code to support score 7.  Set score7 as the
4165         default.
4166         * cpu-score.c: Add score7 architecure.
4167         (compatibile): New function.
4168         * Makefile.am: Add rules for building elf32-score7 object.
4169         * Makefile.in: Regenerate.
4170         * configure.in: Add elf32-score7 object to score vectors.
4171         * configure: Regenerate.
4172         * reloc.c: Add score7 relocs.
4173         * archures.c: Add score3 and score7 machine numbers.
4174         * bfd-in2.h: Regenerate.
4175         * libbfd.h: Regenerate.
4176
4177 2009-03-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4178
4179         * configure: Regenerate.
4180
4181 2009-03-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4182
4183         * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
4184         (elf32_hppa_check_relocs): Use it.
4185
4186         * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
4187         elf64-hppa.c.
4188         (elf_hppa_unmark_useless_dynamic_symbols): Likewise.
4189         (elf_hppa_remark_useless_dynamic_symbols): Likewise.
4190         (elf_hppa_is_dynamic_loader_symbol): Likewise.
4191         (elf_hppa_record_segment_addrs): Likewise.
4192         (elf_hppa_final_link): Likewise.
4193         (elf_hppa_relocate_insn): Likewise.
4194         (elf_hppa_final_link_relocate): Likewise.
4195         (elf64_hppa_relocate_section): Likewise.
4196         * elf64-hppa.c: Insert above.
4197
4198 2009-02-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4199
4200         * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
4201         (elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
4202         (elf_hppa_relocate_section): Likewise.
4203         * elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
4204         from struct elf_link_hash_entry.  Add count field.
4205         (struct elf64_hppa_dyn_hash_table): Delete.
4206         (struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
4207         (elf64_hppa_hash_table): Rename to hppa_link_hash_table.
4208         (hppa_elf_hash_entry, eh_name): Define.
4209         (elf64_hppa_new_dyn_hash_entry): Delete.
4210         (elf64_hppa_dyn_hash_lookup): Delete.
4211         (elf64_hppa_dyn_hash_traverse): Delete.
4212         (get_dyn_name): Delete.
4213         (elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
4214         of struct elf64_hppa_dyn_hash_entry *.
4215         (elf64_hppa_finalize_dlt, llocate_global_data_dlt,
4216         allocate_global_data_plt, allocate_global_data_stub,
4217         allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
4218         Likewise.
4219         (hppa64_link_hash_newfunc): New.
4220         (elf64_hppa_hash_table_create): Rework.
4221         (count_dyn_reloc): Likewise.
4222         (hppa64_elf_local_refcounts): New.
4223         (elf64_hppa_check_relocs): Rework using standard technique for recording
4224         local DLT, PLT and OPD reference counts.
4225         (elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
4226         elf_link_hash_entry *.
4227         (elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
4228         allocate_global_data_plt, allocate_global_data_stub,
4229         allocate_global_data_opd, allocate_dynrel_entries,
4230         elf64_hppa_adjust_dynamic_symbol,
4231         elf64_hppa_mark_milli_and_exported_functions): Likewise.
4232         (elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
4233         Use hppa_link_hash_table.  Rework.
4234         (elf64_hppa_link_output_symbol_hook): Rework.
4235         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
4236         elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
4237         elf64_hppa_finish_dynamic_sections): Likewise.
4238
4239 2009-02-26  Christophe Lyon  <christophe.lyon@st.com>
4240
4241         * elf32-arm.c (stub_reloc_type): Removed.
4242         (insn_sequence): Renamed reloc_type field to r_type.
4243         (elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
4244         (elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
4245         (elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
4246         (elf32_arm_stub_type): Add new enum entries for the new stubs.
4247         (arm_stub_is_thumb): Catch new stubs.
4248         (arm_type_of_stub): Handle new stubs.
4249         (arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
4250         (bfd_elf32_arm_process_before_allocation): Remove useless
4251         condition.
4252
4253 2009-02-25  H.J. Lu  <hongjiu.lu@intel.com>
4254
4255         * elf.c (elf_find_function): Use is_function_type to check
4256         function symbol.
4257
4258 2009-02-24  Sterling Augustine  <sterling@jaw.hq.tensilica.com>
4259
4260         * xtensa-modules.c: Revert to previous version 1.11 due
4261         to inadvertant commit.
4262
4263 2009-02-24  Sterling Augustine  <sterling@tensilica.com>
4264
4265         * elf32-xtensa.c (text_action_add): Separate test for action
4266         type.  Break if saved action is ta_widen_insn at same offset.
4267
4268 2009-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
4269
4270         * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
4271         to elf32_arm_stub_long_branch_any_arm_pic.
4272         (elf32_arm_stub_long_branch_any_thumb_pic): New.
4273         (enum elf32_arm_stub_type, arm_type_of_stub)
4274         (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
4275         separately.
4276
4277 2009-02-24  Joseph Myers  <joseph@codesourcery.com>
4278
4279         * elf32-arm.c (PREV_SEC): Update comment.
4280         (group_sections): Rename argument to stubs_always_after_branch.
4281         Reverse the list and place stubs at the end of input sections.
4282         Undefine NEXT_SEC.
4283         (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
4284
4285 2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
4286
4287         * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
4288         Fix formatting.
4289         (arm_size_one_stub): Remove unnecessary break.
4290         (arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.
4291
4292 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
4293
4294         * elf32-arm.c (stub_insn_type): New type.
4295         (stub_reloc_type): Likewise.
4296         (insn_sequence): Likewise.
4297         (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
4298         (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
4299         (elf32_arm_stub_long_branch_thumb_only): Likewise.
4300         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
4301         (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
4302         (elf32_arm_stub_long_branch_any_any_pic): Likewise.
4303         (elf32_arm_stub_hash_entry): Add new helper fields.
4304         (stub_hash_newfunc): Initialize these new fields.
4305         (arm_build_one_stub): Encode Arm and Thumb instructions separately
4306         to take endianness into account.
4307         (arm_size_one_stub): Compute size of stubs using insn_sequence.
4308         (arm_map_one_stub): Code is now more generic, thanks to
4309         insn_sequence.
4310
4311 2009-02-23  Christophe Lyon  <christophe.lyon@st.com>
4312
4313         * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
4314         code.
4315         (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
4316         (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
4317         BLX is not available. Fix typo in warning message. Add comments
4318         and improve formatting.
4319         (arm_build_one_stub): Adjust to new
4320         elf32_arm_stub_long_branch_v4t_thumb_arm stub.
4321         (arm_map_one_stub): Likewise.
4322
4323 2009-02-23  Tristan Gingold  <gingold@adacore.com>
4324             Eric Botcazou  <ebotcazou@adacore.com>
4325             Douglas B Rupp  <rupp@gnat.com>
4326
4327         * vms.h: Update copyright year, fix comments, reorder declarations.
4328         (_bfd_save_vms_section): Remove the prototype.
4329         (EGPS_S_V_NO_SHIFT): New constant.
4330         (bfd_vms_set_section_flags): New prototype.
4331         (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New
4332         constants.
4333         (EGSY_S_W_FLAGS): Ditto.
4334         (EGSY_S_V_QUAD_VAL): Ditto.
4335         (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto.
4336         (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX,
4337         EGST_S_B_NAMLNG): Ditto.
4338         (ESRF_S_B_NAMLNG): Ditto.
4339         (ETIR_S_C_HEADER_SIZE): Ditto.
4340         (EGPS_S_V_ALLOC_64BIT): Ditto.
4341         (DST_S_C_EPILOG): Ditto.
4342         (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto.
4343         (DST_S_C_SRC_INCRLNUM_B): Ditto.
4344         (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto.
4345         (DST_S_L_PCLINE_UNSLONG): Ditto.
4346         (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto
4347         (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto
4348         (DST_S_C_SOURCE_HEADER_SIZE): Ditto.
4349         (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto.
4350         (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto.
4351         (DST_S_B_SRC_UNSBYTE): Ditto.
4352         (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto.
4353         Add prototypes.
4354         (vms_section, vms_reloc): Remove types.
4355         (hdr_struc): Replaced by ...
4356         (hdr_struct): ... new type.
4357         (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants.
4358         (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto.
4359         (EMH_DATE_LENGTH): Ditto.
4360         (eom_struc): Replaced by ...
4361         (eom_struct): ... new type.
4362         (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants.
4363         (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto.
4364         (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto.
4365         (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto.
4366         (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto.
4367         (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto.
4368         (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto.
4369         (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto.
4370         (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto.
4371         (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto.
4372         (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto.
4373         (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto.
4374         (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto.
4375         (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto.
4376         (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto.
4377         (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto.
4378         (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto.
4379         (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH)
4380         (DBG_S_C_DMT_PSECT_SIZE): Ditto.
4381         (enum file_type_enum): New type.
4382         (struct location_struct): Removed.
4383         (struct fileinfo, struct srecinfo, struct lineinfo): New types.
4384         (struct funcinfo, struct module): Ditto.
4385         (struct vms_private_data_struct): Update fields.
4386         (struct vms_section_data_struct): New type.
4387
4388         * vms.c: Update copyright year, fix comments,
4389         Fix includes for DECC, add prototypes.
4390         (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove
4391         some initializers.
4392         Use flavour to set is_vax, location_stack is removed.
4393         (struct pair): Declare.
4394         (fill_section_ptr): Initialize variables at declaration.
4395         Add guard to set SECTION_SYM flag, handlde und section.
4396         (vms_fixup_sections): Use struct pair for fill_section_ptr argument.
4397         (_bfd_vms_slurp_object_records): New function, replaces previous
4398         vms_object_p.
4399         (vms_slurp_module): New function.
4400         (vms_slurp_image): Ditto.
4401         (vms_object_p): Complete rewrite.
4402         (vms_mkobject): Use is_vax field to slect architecture.
4403         (free_reloc_stream): New function.
4404         (vms_convert_to_var): Ditto.
4405         (vms_convert_to_var_1): Ditto.
4406         (vms_convert_to_var_unix_filename): Ditto.
4407         (vms_close_and_cleanup): Call free_reloc_stream, convert file to
4408         VAR format on VMS.
4409         (vms_new_section_hook): Set alignment to 0, allocate private data.
4410         (vms_get_section_contents): Load content.
4411         (vms_get_symbol_info): Handle undefined section.
4412         (vms_find_nearest_line): Handle.
4413         (alloc_reloc_stream): New function.
4414         (vms_slurp_reloc_table): Ditto.
4415         (vms_get_reloc_upper_bound): Make it real.
4416         (vms_canonicalize_reloc): Do the real work.
4417         (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA,
4418         ALPHA_R_BOH.
4419         (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH.
4420         (vms_set_arch_mach): Check arch.
4421         (vms_set_section_contents): Copy the content after allocation.
4422         (vms_alpha_vec): Update object flags.
4423
4424         * vms-tir.c: Update copyright year, fix comments,
4425         add prototypes for new functions.
4426         (dst_define_location): New function.
4427         (dst_restore_location): New function.
4428         (dst_retrieve_location): New function.
4429         (dst_check_allocation): New function.
4430         (image_dump): Call dst_check_allocation.
4431         (image_write_b): Ditto.
4432         (image_write_w): Ditto.
4433         (image_write_l): Ditto.
4434         (image_write_q): Ditto.
4435         (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW,
4436         STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC,
4437         CTL_STKDL.
4438         Call error handler instead of abort if name is not known.
4439         (etir_sta): Add quarter_relocs argument and set it.
4440         Fix cast.
4441         (etir_sto): Ditto.
4442         (etir_opr): Ditto, return FALSE in case of error.
4443         (etir_ctl): Add quarter_relocs argument and set it, fix cast.
4444         Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL.
4445         (etir_stc): Add quarter_relocs argument and set it, fix cast.
4446         Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA.
4447         Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL.
4448         Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS.
4449         Return FALSE in case of error.
4450         (tir_sta): Change sign of psect.
4451         (tir_ctl): Ditto.
4452         (tir_cmd): Fix cast. Makes tir_table static const.
4453         (etir_cmd): Add quarter_relocs argument, makes etir_table const,
4454         add argument to explain.
4455         (analyze_etir): Initialize maxptr, add quarter_relocs
4456         declaration, move some declarations into inner scopes.
4457         Handle quarter_relocs and STO_IMM.
4458         (_bfd_vms_slurp_tir): Use constant instead of hard-coded values.
4459         (_bfd_vms_slurp_relocs): New function.
4460         (_bfd_vms_decode_relocs): New function.
4461         (sto_imm): Rewritten.
4462         (start_first_etbt_record): New function.
4463         (start_another_etbt_record): Ditto.
4464         (etir_output_check): Ditto.
4465         (defer_reloc_p): Ditto.
4466         (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to
4467         a for-loop.  Correctly deals with contents, deals with .vmsdebug,
4468         rewritte relocations handling.
4469         (_bfd_vms_write_tbt): Removed.
4470         (_bfd_vms_write_dbg): Ditto.
4471
4472         * vms-misc.c: Update copyright year, Fix comments.
4473         (_bfd_vms_get_header_values): Use 'size' instead of 'length'.
4474         (maybe_adjust_record_pointer_for_object): New function.
4475         (_bfd_vms_get_first_record): New function, replaces ...
4476         (_bfd_vms_get_record): ..  removed.
4477         (_bfd_vms_get_object_record): New function.
4478         (_bfd_vms_get_object_record): New function.
4479         (vms_get_remaining_object_record): New function, replaces ...
4480         (_bfd_vms_get_next_record): ... removed.
4481         (add_new_contents): Removed.
4482         (_bfd_save_vms_section): Removed.
4483         (_bfd_get_vms_section): Removed.
4484         (_bfd_vms_output_flush): Write in VAR format.
4485         (new_symbol): Don't make UND section.
4486
4487         * vms-hdr.c: Update copyright year, update list of record handled.
4488         (_bfd_vms_slurp_hdr): rec_length renamed to rec_size.
4489         (_bfd_vms_write_hdr): Strip vms and unix patches,
4490         add comments, truncate module name at 31 characters,
4491         use constants instead of hard-coded value,
4492         write BFD version instead of a fixed string.
4493         (_bfd_vms_slurp_ihd): New function.
4494         (_bfd_vms_slurp_isd): Ditto.
4495         (_bfd_vms_slurp_ihs): Ditto.
4496         (new_module): Ditto.
4497         (parse_module): Ditto
4498         (build_module_list): Ditto.
4499         (module_find_nearest_line): Ditto.
4500         (_bfd_vms_find_nearest_dst_line): Ditto.
4501         (vms_slurp_debug): Ditto.
4502         (_bfd_vms_slurp_dbg): Ditto.
4503         (_bfd_vms_slurp_tbt): Ditto.
4504         (_bfd_vms_write_dbg): Ditto.
4505         (_bfd_vms_write_tbt): Ditto.
4506
4507         * vms-gsd.c: Update copyright year, update list of records handled.
4508         (EVAX_LITERALS_NAME): New macro.
4509         (evax_section_flags): Add an entry for EVAX_LITERALS_NAME.
4510         (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd.
4511         (register_universal_symbol): New function and prototype.
4512         (_bfd_vms_slurp_gsd): Fix indentations and casts,
4513         improve debug messages,
4514         use constants instead of hard-coded value,
4515         fix missing endianness conversion,
4516         handle global symbol (SYMG).
4517         (bfd_vms_set_section_flags): New function.
4518         (_bfd_vms_write_gsd): Don't write .vmsdebug section,
4519         handle section literals,
4520         fix indentation,
4521         handle section bfd and vms flags,
4522         don't output LIB$INITIALIZE symbol,
4523         fix handling of weak symbols,
4524         fix evax vs vax procedure descriptor,
4525         handle absolute symbols.
4526
4527         * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR,
4528         BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations.
4529
4530         * makefile.vms (DEFS): Fix flags for VMS.
4531
4532         * bfdio.c (real_fopen): Handle multiple VMS fopen attributes.
4533
4534         * bfd-in2.h: Regenerated.
4535         * libbfd.h: Regenerated.
4536
4537 2009-02-20  Cary Coutant  <ccoutant@google.com>
4538
4539         * vmsutil.c (vms_file_stats_name): Fix incorrect use of st_mtime
4540         in struct stat.
4541
4542 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
4543
4544         PR gas/7059
4545         * coffcode.h (coff_write_object_contents):  Don't let the string
4546         table offset overflow the s_name field when using long section names.
4547
4548 2009-18-02  Dave Korn  <dave.korn.cygwin@gmail.com>
4549
4550         * coff-alpha.c (alpha_ecoff_backend_data):  Initialise fields which
4551         control long section name handling with ECOFF_NO_LONG_SECTION_NAMES.
4552         * coff-mips.c (mips_ecoff_backend_data):  Likewise.
4553         * coff-rs6000.c (bfd_xcoff_backend_data):  Initialise fields which
4554         control long section name handling with XCOFF_NO_LONG_SECTION_NAMES.
4555         (bfd_pmac_xcoff_backend_data):  Likewise.
4556         * coff64-rs6000.c (bfd_xcoff_backend_data):  Likewise.
4557         (bfd_xcoff_aix5_backend_data):  Likewise.
4558         (xcoff64_write_object_contents):  Delete unused long_section_names
4559         local variable.
4560         * coff-sh.c (bfd_coff_small_swap_table):  Initialise long section
4561         name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire
4562         struct non-const.
4563         * coffcode.h (documentation):  Update to describe long section names.
4564         (COFFLONGSECTIONCATHELPER):  New helper macro.
4565         (BLANKOR1TOODD):  Likewise.
4566         (COFF_ENABLE_LONG_SECTION_NAMES):  Likewise.
4567         (COFF_LONG_SECTION_NAMES_SETTER):  Likewise.
4568         (COFF_DEFAULT_LONG_SECTION_NAMES):  Likewise.
4569         (bfd_coff_set_long_section_names_allowed):  New function.
4570         (bfd_coff_set_long_section_names_disallowed):  Likewise.
4571         (struct bfd_coff_backend_data):  Add new backend hook function
4572         pointer _bfd_coff_set_long_section_names.
4573         (bfd_coff_set_long_section_names):  New backend hook.
4574         (coff_write_object_contents):  Only generate long section names if
4575         bfd_coff_long_section_names() indicates they are currently enabled.
4576         (bfd_coff_std_swap_table):  Make non-const, and initialise long
4577         section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
4578         (ticoff0_swap_table):  Likewise to both.
4579         (ticoff1_swap_table):  Again, likewise to both.
4580         * coffgen.c (make_a_section_from_file):  Allow long section names
4581         as inputs even if not currently allowed for outputs.
4582         * ecoff.c (_bfd_ecoff_no_long_sections):  New function.
4583         * efi-app-ia32.c (COFF_LONG_SECTION_NAMES):  Define to 0, not blank.
4584         * efi-app-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4585         * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4586         * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
4587         * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4588         * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4589         * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES):  Likewise.
4590         * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4591         * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4592         * pei-arm.c (COFF_LONG_SECTION_NAMES):  Likewise.
4593         * pei-i386.c (COFF_LONG_SECTION_NAMES):  Likewise.
4594         * pei-mcore.c (COFF_LONG_SECTION_NAMES):  Likewise.
4595         * pei-mips.c (COFF_LONG_SECTION_NAMES):  Likewise.
4596         * pei-ppc.c (COFF_LONG_SECTION_NAMES):  Likewise.
4597         * pei-sh.c (COFF_LONG_SECTION_NAMES):  Likewise.
4598         * pei-x86_64.c (COFF_LONG_SECTION_NAMES):  Likewise.
4599         * libcoff-in.h:  Update copyright year to cause updated copyright
4600         year in generated libcoff.h, and fix typo.
4601         * libcoff.h:  Regenerated.
4602         * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES):  New macro.
4603         (_bfd_ecoff_no_long_sections):  Add prototype.
4604         * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES):  New macro.
4605         * pe-mips.c (COFF_LONG_SECTION_NAMES):  Define empty if not already
4606         defined by an including .c file.
4607         * ticoff.h (ticoff0_swap_table):  Make non-const, and initialise
4608         long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES.
4609         (ticoff1_swap_table):  Likewise to both.
4610
4611 2009-02-18  Christophe Lyon  <christophe.lyon@st.com>
4612
4613         * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
4614         stub. Catch default case error.
4615         (arm_map_one_stub): Add missing Thumb mapping symbol.
4616
4617 2009-02-18  Bjoern Haase  <bjoern.m.haase@web.de>
4618
4619         PR 9841
4620         * elf32-avr.c: Handle case where no local symbos exist correctly.
4621
4622 2009-02-16  Christophe Lyon  <christophe.lyon@st.com>
4623
4624         bfd/
4625         * elf32-arm.c (arm_long_branch_stub,
4626         arm_thumb_v4t_long_branch_stub,
4627         arm_thumb_thumb_long_branch_stub,
4628         arm_thumb_arm_v4t_long_branch_stub,
4629         arm_thumb_arm_v4t_short_branch_stub,
4630         arm_pic_long_branch_stub):
4631         Renamed to elf32_arm_stub_long_branch_any_any,
4632         elf32_arm_stub_long_branch_v4t_arm_thumb,
4633         elf32_arm_stub_long_branch_thumb_only,
4634         elf32_arm_stub_long_branch_v4t_thumb_arm,
4635         elf32_arm_stub_short_branch_v4t_thumb_arm,
4636         elf32_arm_stub_long_branch_any_any_pic.
4637         (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
4638         arm_thumb_thumb_stub_long_branch,
4639         arm_thumb_arm_v4t_stub_long_branch,
4640         arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
4641         Renamed to arm_stub_long_branch_any_any,
4642         arm_stub_long_branch_v4t_arm_thumb,
4643         arm_stub_long_branch_thumb_only,
4644         arm_stub_long_branch_v4t_thumb_arm,
4645         arm_stub_short_branch_v4t_thumb_arm,
4646         arm_stub_long_branch_any_any_pic.
4647
4648 2009-02-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4649
4650         * elf-hppa.h (elf_hppa_final_link_relocate): Correct addend value used
4651         in branch offset check.
4652
4653 2009-02-15  Alan Modra  <amodra@bigpond.net.au>
4654
4655         * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,
4656         add toc.symndx and toc.add.
4657         (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here.
4658         Set up toc.add.
4659         (get_tls_mask): Add toc_addend param, set from toc.add.  Adjust all
4660         callers.
4661         (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd.
4662         (branch_reloc_hash_match): New function, extracted from..
4663         (ppc64_elf_tls_optimize): ..here.
4664         (ppc64_elf_relocate_section): Properly set addends when optimizing
4665         tls sequences.  Avoid unnecessary reading and writing of insns.
4666         Only redo reloc when symbol changed.  Bypass symbol checks when
4667         using tlsld_got.
4668         * elf32-ppc.c (ppc_elf_tls_setup): Correct comment.
4669         (branch_reloc_hash_match): New function, extracted from..
4670         (ppc_elf_tls_optimize): ..here.
4671         (ppc_elf_relocate_section): Avoid unnecessary reading of insns.
4672         Don't clear addend on zapped __tls_get_addr reloc.
4673
4674 2009-02-12  Nick Clifton  <nickc@redhat.com>
4675
4676         PR 9827
4677         * elflink.c (bfd_elf_final_link): When counting the relocations,
4678         if the header size has not been set yet then assume that it will
4679         match the output section's reloc type.
4680
4681 2009-02-12  Nathan Sidwell  <nathan@codesourcery.com>
4682
4683         * elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
4684         relocatable link.
4685
4686 2009-02-09  Alan Modra  <amodra@bigpond.net.au>
4687
4688         * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
4689         (find_function): Likewise.
4690         (pasted_function): Don't error if no prior function found.
4691         (discover_functions): Revert 2008-12-10 change.  Extend first
4692         function range to start of section.
4693
4694 2009-02-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4695
4696         * elf64-hppa.c: Remove PARAMS macro.  Replace PTR with void *.  Convert
4697         functions to C90.
4698         * elf64-hppa.h: Likewise.
4699
4700 2009-02-06  Joseph Myers  <joseph@codesourcery.com>
4701
4702         * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
4703         .sbss handling.
4704
4705 2009-02-04  Alan Modra  <amodra@bigpond.net.au>
4706
4707         * elf32-spu.c (spu_elf_build_stubs): Define __icache_neg_log2_linesize.
4708         Define __icache_ptr_handler*, not __icache_ptr___icache_bi_handler*.
4709
4710 2009-02-03  Sandip Matte  <sandip@rmicorp.com>
4711
4712         * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
4713         * archures.c (bfd_mach_mips_xlr): Define.
4714         * bfd-in2.h: Regenerate.
4715         * cpu-mips.c (I_xlr): Define.
4716         (arch_info_struct): Add XLR entry.
4717         * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
4718         (mips_set_isa_flags): Handle bfd_mach_mips_xlr
4719         (mips_mach_extensions): Add XLR entry.
4720
4721 2009-02-03  Eric B. Weddington  <eric.weddington@atmel.com>
4722
4723         * elf32-avr.c (avr_final_link_relocate): Allow avr25 to wraparound.
4724
4725 2009-02-03  Carlos O'Donell  <carlos@codesourcery.com>
4726
4727         * configure.in: AC_SUBST pdfdir.
4728         * Makefile.am: Add install-pdf, install-pdf-am
4729         and install-pdf-recursive targets. Define pdfdir.
4730         * doc/Makefile.am: Define pdf__strip_dir. Add
4731         install-pdf and install-pdf-am targets.
4732         * po/Make-in: Add install-pdf target.
4733         * configure: Regenerate.
4734         * Makefile.in: Regenerate
4735         * doc/Makefile.in: Regenerate.
4736
4737 2009-02-03  Maxim Kuvyrkov  <maxim@codesourcery.com>
4738
4739         * bfd-in2.h: Regenerate.
4740         * elf32-m68k.c: Handle 2-slot GOT entries.  Rename variables and
4741         fields from n_entries to n_slots where appropriate, update comments.
4742         (HOWTO): Add TLS relocations.
4743         (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
4744         (enum elf_m68k_got_offset_size): New enum.
4745         (struct elf_m68k_got_entry.type): Move field to ...
4746         (struct elf_m68k_got_entry_key): ... here.  Update all uses.
4747         (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static
4748         functions.
4749         (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static
4750         functions.
4751         (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
4752         fields into n_entries array.  Update comments.
4753         (elf_m68k_init_got): Simplify, update all uses.
4754         (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update.
4755         (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
4756         GOT entries; update name, update all uses.
4757         (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto.
4758         (elf_m68k_get_got_entry): Update.
4759         (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
4760         simplify.
4761         (elf_m68k_remove_got_entry_type): Simplify.
4762         (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update.
4763         (elf_m68k_can_merge_gots): Update.
4764         (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
4765         (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot
4766         GOT entries, simplify.
4767         (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same.
4768         (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
4769         field, remove obsoleted local_n_entries field.
4770         (elf_m68k_partition_multi_got_2): New static function.
4771         (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it;
4772         update.
4773         (elf_m68k_remove_got_entry_type): Update.
4774         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
4775         (elf_m68k_check_relocs): Handle TLS relocations.  Remove unnecessary
4776         update of sgot->size and srelgot->size.
4777         (elf_m68k_gc_sweep_hook): Update.
4778         (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
4779         (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle
4780         TLS relocations.
4781         * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
4782         * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
4783
4784 2009-02-02  DJ Delorie  <dj@redhat.com>
4785
4786         * elf32-mep.c (config_names): Regenerate configuration.
4787
4788 2009-02-02  Alan Modra  <amodra@bigpond.net.au>
4789
4790         * elf-bfd.h (bfd_elf_get_str_section): Don't declare.
4791         (bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
4792         * elf.c (bfd_elf_get_str_section): Make static.
4793         (bfd_elf_find_section): Delete.
4794         * libbfd.h: Regenerate.
4795
4796 2009-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
4797
4798         * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
4799         (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.
4800
4801 2009-01-31  Alan Modra  <amodra@bigpond.net.au>
4802
4803         * elflink.c (on_needed_list): New function.
4804         (elf_link_add_object_symbols): Link in --as-needed libs if they
4805         satisfy undefined symbols in other libs.
4806
4807 2009-01-30  Julian Brown  <julian@codesourcery.com>
4808
4809         * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
4810         EXEC_P or DYNAMIC flags, and skip sections which are being linked
4811         with --just-symbols (-R).
4812
4813 2009-01-29  Adam Nemet  <anemet@caviumnetworks.com>
4814
4815         * dwarf2.c (read_rangelist): Use read_address to read low_pc and
4816         high_pc in order to properly sign-extend VMAs.
4817
4818 2009-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
4819             Mark Shinwell  <shinwell@codesourcery.com>
4820             Catherine Moore  <clm@codesourcery.com>
4821
4822         * elf-attrs.c, elflink.c, elfxx-mips.c: Correct typos in comments.
4823
4824 2009-01-28  Catherine Moore <clm@codesourcery.com>
4825
4826         * elf32-arm.c (elf32_arm_check_relocs): Set SEC_ALLOC and
4827         SEC_LOAD for dynamic relocation sections.
4828
4829 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
4830
4831         * elf32-cris.c (cris_elf_relocate_section): Use elf_hash_table
4832         (info)->tls_size, not elf_hash_table (info)->tls_sec->size for
4833         the size of local TLS data.
4834
4835 2009-01-27  Andreas Schwab  <schwab@suse.de>
4836
4837         * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
4838         architectures in the archive.
4839
4840 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
4841
4842         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
4843         <R_CRIS_32_DTPREL>: Correct relocation value.
4844
4845         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
4846         <R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
4847         symbols with non-default visibility.
4848
4849 2009-01-26  Nathan Sidwell  <nathan@codesourcery.com>
4850
4851         * elf32-ppc.c (ppc_elf_relax_section): Add space for relocs
4852         describing the trampolines.
4853         (ppc_elf_relocate_section): Update relocs to describe the
4854         trampolines.
4855
4856 2009-01-25  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4857
4858         * elf-hppa.h (elf_hppa_final_link_relocate): Add check to ensure that
4859         branch targets can be reached for R_PARISC_PCREL22F, R_PARISC_PCREL17F
4860         and R_PARISC_PCREL12F relocations.
4861
4862 2009-01-24  Alan Modra  <amodra@bigpond.net.au>
4863
4864         PR 6022
4865         * elflink.c (find_version_for_sym): New function split out from,
4866         but without export_dynamic test, ..
4867         (_bfd_elf_link_assign_sym_version): ..here.
4868         (_bfd_elf_export_symbol): Use it.
4869
4870 2009-01-23  Alan Modra  <amodra@bigpond.net.au>
4871
4872         * elf-bfd.h (struct elf_assign_sym_version_info): Delete.
4873         (struct elf_info_failed, struct elf_find_verdep_info): Move to..
4874         * elflink.c: ..here, somewhat modified.
4875         * elf-bfd.h (_bfd_elf_add_default_symbol, _bfd_elf_export_symbol,
4876         _bfd_elf_link_find_version_dependencies,
4877         _bfd_elf_link_assign_sym_version, _bfd_elf_link_size_reloc_section,
4878         _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol,
4879         _bfd_elf_link_sec_merge_syms, bfd_elf_link_mark_dynamic_symbol): Don't
4880         declare..
4881         * elflink.c: ..and make static here.
4882         (_bfd_elf_link_find_version_dependencies): Adjust for removal
4883         of output_bfd from struct elf_find_verdep_info.
4884         (_bfd_elf_link_assign_sym_version): Similarly adjust to use
4885         struct elf_info_failed.
4886         (bfd_elf_size_dynamic_sections): Adjust.
4887
4888 2009-01-22  Alan Modra  <amodra@bigpond.net.au>
4889
4890         PR 6832
4891         * dwarf2.c (find_line): Don't update stash->sec_info_ptr until
4892         after comp_unit_find_line call.
4893
4894 2009-01-21  Nick Clifton  <nickc@redhat.com>
4895
4896         PR 9769
4897         * vmsutil.c (vms_file_stats_name): Remove use of unsupported
4898         tm_gmtoff field in struct tm.
4899
4900 2009-01-21  Alan Modra  <amodra@bigpond.net.au>
4901
4902         * elf32-spu.h (struct spu_elf_params): Add non_ia_text.
4903         * elf32-spu.c (mark_overlay_section): Only include .text.ia.*
4904         sections in soft-icache lines unless non_ia_text.  Don't add
4905         rodata if doing so would exceed line size.
4906
4907 2009-01-19  Hans-Peter Nilsson  <hp@axis.com>
4908
4909         * elf32-cris.c (elf_cris_copy_indirect_symbol): For other symbol
4910         types than bfd_link_hash_indirect, before early return, call
4911         _bfd_elf_link_hash_copy_indirect.
4912
4913 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
4914
4915         * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
4916         * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
4917         * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
4918         (elf_backend_obj_attrs_order): New define.
4919         * elfxx-target.h (elf_backend_obj_attrs_order): New define.
4920         (elfNN_bed): Add elf_backend_obj_attrs_order.
4921
4922 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
4923
4924         * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
4925         (obj_attr_size): Likewise.
4926         (write_obj_attribute): Likewise.
4927         (_bfd_elf_copy_obj_attributes): Likewise.
4928         (_bfd_elf_parse_attributes): Likewise.
4929         * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
4930         (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
4931         (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
4932         (ATTR_TYPE_HAS_NO_DEFAULT): New define.
4933         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
4934         with macros.
4935
4936 2009-01-19  Andrew Stubbs  <ams@codesourcery.com>
4937
4938         * elf-attrs.c (is_default_attr): Support defaultless attributes.
4939         (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
4940         (bfd_elf_add_obj_attr_string): Likewise.
4941         (bfd_elf_add_obj_attr_int_string): Likewise.
4942         (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
4943         * elf-bfd.h (struct obj_attribute): Document new flag bit.
4944         * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
4945         Tag_nodefaults has no default value.
4946         (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
4947         comment to reflect the new state.
4948
4949 2009-01-19  Alan Modra  <amodra@bigpond.net.au>
4950
4951         PR 9695
4952         * pdp11.c (N_BADMAG): True for anything but OMAGIC, NMAGIC, ZMAGIC.
4953         (some_aout_object_p): Delete dead code handling QMAGIC and BMAGIC.
4954         (adjust_z_magix): Delete dead code handling QMAGIC.
4955
4956 2009-01-16  Kai Tietz  <kai.tietz@onevision.com>
4957
4958         * coffcode.h (styp_to_sec_flags): Correct interpretation of
4959         IMAGE_SCN_MEM_DISCARDABLE.
4960
4961 2009-01-16  Alan Modra  <amodra@bigpond.net.au>
4962
4963         * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute
4964         SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS.
4965         * configure.in (commonbfdlib): Delete.
4966         (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/
4967         (SHARED_LIBADD): Rename from WIN32LIBADD.  Add pic libiberty if such
4968         is available, not just for linux.
4969         * po/SRC-POTFILES.in: Regenerate.
4970         * Makefile.in: Regenerate.
4971         * configure: Regenerate.
4972
4973 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
4974             Julian Brown   <julian@codesourcery.com>
4975
4976         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
4977         ARM attributes in ABI 2.07.
4978         * elf32-arm.c (get_secondary_compatible_arch): New function.
4979         (set_secondary_compatible_arch): New function.
4980         (tag_cpu_arch_combine): New function.
4981         (elf32_arm_copy_one_eabi_other_attribute): Delete function.
4982         (elf32_arm_copy_eabi_other_attribute_list): Delete function.
4983         (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
4984         make it fit with order_01243.
4985         Add support for Tag_also_compatible_with,
4986         Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
4987         Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
4988         Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
4989         Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
4990         Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
4991         Tag_VFP_arch and Tag_ABI_FP_16bit_format.
4992         Rework the way unknown attributes are handled.
4993         Defer errors until all attributes have been processed.
4994
4995 2009-01-15  Andrew Stubbs  <ams@codesourcery.com>
4996
4997         * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
4998         bfd_elf_add_obj_attr_int_string.
4999         Read Tag_compatibility from its new location in the attribute array,
5000         rather than the attribute list.
5001         (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
5002         bfd_elf_add_obj_attr_int_string.
5003         (_bfd_elf_parse_attributes): Likewise.
5004         (_bfd_elf_merge_object_attributes): There's now only one
5005         Tag_compatibility, and it's in the array, not the list.
5006         * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
5007         Tag_compatibility.
5008         (bfd_elf_add_obj_attr_compat): Rename to
5009         bfd_elf_add_obj_attr_int_string.
5010         (bfd_elf_add_proc_attr_compat): Rename to
5011         bfd_elf_add_proc_attr_int_string.
5012         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
5013         Tag_compatibility.
5014
5015 2009-01-15  Douglas B Rupp  <rupp@gnat.com>
5016
5017         * Makefile.am (BFD32_BACKENDS): Add new object vmsutil.lo
5018         (BFD32_BACKENDS_CFILES): Add new file vmsutil.c
5019         (vmsutil.lo): Add dependency rule.
5020         * Makefile.in: Regenerate.
5021         * config.bfd (ia64*-*-*vms*): Add case.
5022         * configure.in (bfd_elf64_ia64_vms_vec): Add case.
5023         * configure: Regenerate.
5024         * vmsutil.c: New file.
5025         * vmsutil.h: New file.
5026         * elf-bfd.h (struct bfd_elf_special_section): Change type of
5027         attr to bfd_vma.
5028         * elfxx-ia64.c (elfNN_vms_post_process_headers,
5029         elfNN_vms_section_processing, elfNN_vms_final_write_processing,
5030         elfNN_vms_close_and_cleanup, elfNN_vms_section_from_shdr,
5031         elfNN_vms_object_p): New functions
5032         * targets.c (bfd_elf64_ia64_vms_vec): New target.
5033
5034 2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>
5035
5036         PR ld/9727
5037         * elflink.c (elf_gc_sweep): Exclude the group section if the
5038         first member of the section group is excluded.
5039
5040 2009-01-14  Alan Modra  <amodra@bigpond.net.au>
5041
5042         PR 9735
5043         * syms.c (_bfd_stab_section_find_nearest_line): Don't free
5044         saved filename, use bfd_alloc rather than bfd_malloc for it.
5045
5046 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
5047
5048         * elf32-spu.c (spu_elf_build_stubs): Make __icache_base absolute.
5049
5050 2009-01-13  Alan Modra  <amodra@bigpond.net.au>
5051
5052         * elf32-spu.c (remove_cycles): Always set call->max_depth.
5053
5054 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
5055
5056         * elf32-spu.c (spu_elf_auto_overlay): Correct vma mask.
5057
5058 2009-01-12  Alan Modra  <amodra@bigpond.net.au>
5059
5060         * elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2,
5061         num_lines_log2.
5062         (struct got_entry): Add br_addr.
5063         (struct call_info): Add priority.
5064         (struct function_info): Add lr_store and sp_adjust.
5065         (spu_elf_setup): Init line_size_log2 and num_lines_log2.
5066         (spu_elf_find_overlays): For soft-icache, mark any section within cache
5067         area as an overlay, and check that no other overlays exist.  Look up
5068         icache overlay manager entry sym.
5069         (BRA_STUBS, BRA, BRASL): Define.
5070         (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub.
5071         (needs_ovl_stub): Adjust for soft-icache.  Return priority encoded
5072         in branch insn.
5073         (count_stub, build_stub): Support soft-icache.
5074         (build_spuear_stubs, process_stubs): Adjust build_stub call.
5075         (spu_elf_size_stubs): Size soft-icache stubs.
5076         (overlay_index): New function.
5077         (spu_elf_build_stubs): Make static.  Support soft-icache.
5078         (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache.
5079         (find_function_stack_adjust): Save lr store and stack adjust insn
5080         offsets.
5081         (maybe_insert_function): Adjust find_function_stack_adjust call.
5082         (mark_functions_via_relocs): Retrieve priority.
5083         (remove_cycles): Only warn about pruned arcs when stack_analysis.
5084         (sort_calls): Sort by priority first.
5085         (mark_overlay_section): Ignore .ovl.init.
5086         (sum_stack): Only print when stack_analysis.
5087         (print_one_overlay_section): New function, extracted from..
5088         (spu_elf_auto_overlay): ..here.  Support soft-icache overlays.
5089         (spu_elf_stack_analysis): Only print when htab->stack_analysis.
5090         (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive
5091         analysis.  Call spu_elf_build_stubs.
5092         (spu_elf_relocate_section): For soft-icache encode overlay index
5093         into addresses.
5094         (spu_elf_output_symbol_hook): Support soft-icache.
5095         (spu_elf_modify_program_headers: Likewise.
5096
5097         * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis.  Rename
5098         num_regions to num_lines.  Add line_size and max_branch.
5099         (enum _ovly_flavour): Add ovly_soft_icache.
5100         (spu_elf_build_stubs): Delete.
5101
5102 2009-01-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
5103
5104         * elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
5105         relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.
5106
5107 2009-01-07  Hans-Peter Nilsson  <hp@axis.com>
5108
5109         * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
5110         <case R_CRIS_16_GOT_GD, R_CRIS_32_GOT_GD>: For a symbol defined in
5111         the program, the known offset starts at the negative size of the
5112         TLS section.
5113         <case R_CRIS_32_IE, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>:
5114         Similar.
5115
5116 2009-01-05  Joel Sherrill <joel.sherrill@oarcorp.com>
5117
5118         * config.bfd: Add lm32-*-rtems*.
5119
5120 2009-01-03  H.J. Lu  <hongjiu.lu@intel.com>
5121
5122         * coff-ppc.c: Add 2009 to Copyright.
5123         * elf32-cris.c: Likewise.
5124         * elflink.c: Likewise.
5125
5126 2009-01-03  Hans-Peter Nilsson  <hp@axis.com>
5127
5128         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Rename
5129         gotplt_index to rela_plt_index.  Adjust for R_CRIS_DTPMOD entry.
5130
5131 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
5132
5133         PR ld/9679
5134         * elflink.c (elf_merge_st_other): New.
5135         (_bfd_elf_merge_symbol): Use it on skipped weak definitions and
5136         hide them if needed.
5137         (elf_link_add_object_symbols): Updated.
5138
5139 2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>
5140
5141         PR ld/9676
5142         * elflink.c (elf_link_add_object_symbols): Update def_dynamic,
5143         ref_dynamic and dynamic_def fields when setting def_regular
5144         to 1.
5145
5146 2009-01-02  Curtis Mackie  <curtmackevo@gmail.com>
5147
5148         PR 9682
5149         * coff-ppc.c (dump_toc): Fix up calls to fprintf without a string
5150         literal.
5151
5152 For older changes see ChangeLog-2008
5153 \f
5154 Local Variables:
5155 mode: change-log
5156 left-margin: 8
5157 fill-column: 74
5158 version-control: never
5159 End: