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