* dwarf2.c (struct dwarf2_debug): Add close_on_cleanup.
[platform/upstream/binutils.git] / bfd / ChangeLog
1 2012-08-01  Alan Modra  <amodra@gmail.com>
2
3         * dwarf2.c (struct dwarf2_debug): Add close_on_cleanup.
4         (_bfd_dwarf2_slurp_debug_info): Set close_on_cleanup if we open
5         gnu_debuglink bfd.
6         (_bfd_dwarf2_cleanup_debug_info): Act on close_on_cleanup.
7
8 2012-07-30  Nick Clifton  <nickc@redhat.com>
9
10         * po/bfd.pot: Updated template.
11         * po/es.po: Updated Spanish translation.
12         * po/fi.po: Updated Finnish translation.
13         * po/fr.po: Updated French translation.
14         * po/ru.po: Updated Russian translation.
15         * po/uk.po: Updated Ukranian translation.
16
17 2012-07-27  Mike Frysinger  <vapier@gentoo.org>
18
19         * configure.in (AC_INIT): Call with the args bfd and 2.22.52.
20         (AM_INIT_AUTOMAKE): Remove args.
21         * configure: Regenerate.
22
23 2012-07-27  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
24
25         * cpu-s390.c (bfd_s390_64_arch, bfd_s390_arch): Pick the default
26         arch depending on the target size.
27
28 2012-07-27  Tristan Gingold  <gingold@adacore.com>
29
30         * configure.in: Bump version to 2.23.51
31         * configure: Regenerate.
32
33 2012-07-26  Teresa Johnson  <tejohnson@google.com>
34
35         * bfd/dwarf2.c (find_line): Initialize discriminator_ptr
36         if it is non-NULL.
37
38 2012-07-26  Meador Inge  <meadori@codesourcery.com>
39             Nick Clifton  <nickc@redhat.com>
40
41         PR ld/14397
42         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Report an error
43         if a required section is missing from the linker script.
44
45 2012-07-24  Jan Waclawek <konfera@efton.sk>
46         PR 13899
47         * elf32-avr.c (elf32_avr_relax_delete_bytes): Call
48         _bfd_elf_link_read_relocs with keep_memory as TRUE.
49
50 2012-07-24  Teresa Johnson  <tejohnson@google.com>
51
52         * bfd.c (bfd_find_nearest_line_discriminator): New macro.
53         * coff-rs6000.c: Init _bfd_find_nearest_line_discriminator.
54         * coff64-rs6000.c: Likewise.
55         * dwarf2.c (struct line_info): Add discriminator field.
56         (add_line_info): Fill in new discriminator field.
57         (decode_line_info): Record discriminator information instead
58         of ignoring it.
59         (lookup_address_in_line_info_table): Return discriminator field if
60         requested.
61         (comp_unit_find_nearest_line): Add discriminator argument.
62         (find_line): Likewise.
63         (_bfd_dwarf2_find_nearest_line): Likewise.
64         (_bfd_dwarf2_find_line): Likewise.
65         * elf-bfd.h (_bfd_elf_find_nearest_line_discriminator): New.
66         (_bfd_elf_find_line_discriminator): Likewise.
67         (_bfd_generic_find_nearest_line_discriminator): Likewise. Defined.
68         * elf.c (_bfd_elf_find_nearest_line): Change to a wrapper
69         that invokes _bfd_elf_find_nearest_line_discriminator with correct
70         arguments.
71         (_bfd_elf_find_nearest_line_discriminator): New.
72         (_bfd_elf_find_line): Change to a wrapper
73         that invokes _bfd_elf_find_line_discriminator with correct
74         arguments.
75         (_bfd_elf_find_line_discriminator): New.
76         * coffgen.c (coff_find_nearest_line_with_names): Handle
77         new discriminator argument.
78         * elf32-arm.c (elf32_arm_find_nearest_line): Likewise.
79         * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise.
80         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise.
81         * mach-o.c (bfd_mach_o_find_nearest_line): Likewise.
82         * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Add discriminator
83         argument.
84         (_bfd_dwarf2_find_line): Likewise.
85         (_bfd_generic_find_nearest_line_discriminator): New.
86         * libbfd.c (_bfd_generic_find_nearest_line_discriminator): New.
87         * bfd-in2.h: Regenerated.
88         * libbfd.h: Likewise.
89         * targets.c (BFD_JUMP_TABLE_SYMBOLS): Initialize
90         _bfd_find_nearest_line_discriminator with
91         _bfd_generic_find_nearest_line_discriminator.
92         (bfd_target): Add _bfd_find_nearest_line_discriminator.
93
94 2012-07-24  Sean Keys  <skeys@ipdatasys.com>
95
96         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Added code
97         that enables the linker to offset addresses, when linking against
98         symbols from the XGATE processor and vice versa.
99
100 2012-07-23  Nick Clifton  <nickc@redhat.com>
101
102         * cisco-core.c (cisco_core_file_failing_command): Make static.
103         (cisco_core_file_failing_signal): Make static.
104
105 2012-07-18  H.J. Lu  <hongjiu.lu@intel.com>
106
107         * bfd-in2.h: Regenerated.
108
109 2012-07-18  Nicolàs Alejandro Di Risio <sheeva@tiscali.it>
110
111         PR binutils/14335
112         * section.c: Fix a typo in comments.
113
114 2012-07-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
115
116         * elf64-s390.c: Include elf-s390-common.c.
117         (R_390_IRELATIVE): New reloc.
118         (elf_s390_reloc_type_lookup): Support R_390_IRELATIVE.
119         (RELA_ENTRY_SIZE): New macro.
120         (elf_s390_link_hash_entry): New fields ifunc_resolver_address and
121         *ifunc_resolver_section.
122         (struct plt_entry): New struct.
123         (struct elf_s390_obj_tdata): New field local_plt.
124         (elf_s390_local_plt): New macro.
125         (struct elf_s390_link_hash_table): New field irelifunc.
126         (ELF64): New macro.
127         (link_hash_newfunc): Initialize new fields.
128         (elf_s390_check_relocs): Handle IFUNC symbols.
129         (elf_s390_adjust_dynamic_symbol): Don't do anything for IFUNC
130         symbols.
131         (allocate_dynrelocs): Call s390_elf_allocate_ifunc_dyn_relocs for
132         IFUNC symbols.
133         (elf_s390_size_dynamic_sections): Handle IFUNC symbols.
134         (elf_s390_relocate_section): Likewise.
135         (elf_s390_finish_dynamic_symbol): Likewise.
136         (elf_s390_finish_dynamic_sections): Handle local IFUNC symbols.
137         (elf_s390_finish_ifunc_symbol): New function.
138         (elf_s390_gc_sweep_hook): Handle local plt entries.
139         (elf_backend_add_symbol_hook): Define.
140         * elf32-s390.c: See elf64-s390.c changes.
141         * elf-s390-common.c: New file.
142         * bfd-in2.h (BFD_RELOC_390_IRELATIVE): New enum field.
143         * libbfd.h (BFD_RELOC_390_IRELATIVE): New entry for
144         BFD_RELOC_390_IRELATIVE.
145         * reloc.c (BFD_RELOC_390_IRELATIVE): Document new relocation.
146
147 2012-07-13  Nick Clifton  <nickc@redhat.com>
148
149         * aix386-core.c: Remove use of PTR and PARAMS macros.
150         * archive.c: Likewise.
151         * cache.c: Likewise.
152         * cisco-core.c: Likewise.
153         * coff-alpha.c: Likewise.
154         * coff-apollo.c: Likewise.
155         * coff-aux.c: Likewise.
156         * coff-h8300.c: Likewise.
157         * coff-h8500.c: Likewise.
158         * coff-i386.c: Likewise.
159         * coff-i960.c: Likewise.
160         * coff-ia64.c: Likewise.
161         * coff-m68k.c: Likewise.
162         * coff-m88k.c: Likewise.
163         * coff-mcore.c: Likewise.
164         * coff-mips.c: Likewise.
165         * coff-or32.c: Likewise.
166         * coff-ppc.c: Likewise.
167         * coff-rs6000.c: Likewise.
168         * coff-sh.c: Likewise.
169         * coff-sparc.c: Likewise.
170         * coff-stgo32.c: Likewise.
171         * coff-tic30.c: Likewise.
172         * coff-tic4x.c: Likewise.
173         * coff-tic54x.c: Likewise.
174         * coff-tic80.c: Likewise.
175         * coff-w65.c: Likewise.
176         * cofflink.c: Likewise.
177         * cpu-arc.c: Likewise.
178         * cpu-cris.c: Likewise.
179         * cpu-h8500.c: Likewise.
180         * cpu-i960.c: Likewise.
181         * cpu-msp430.c: Likewise.
182         * cpu-ns32k.c: Likewise.
183         * cpu-powerpc.c: Likewise.
184         * cpu-rs6000.c: Likewise.
185         * cpu-tic4x.c: Likewise.
186         * cpu-w65.c: Likewise.
187         * ecoff.c: Likewise.
188         * ecofflink.c: Likewise.
189         * elf-m10200.c: Likewise.
190         * elf32-bfin.c: Likewise.
191         * elf32-cris.c: Likewise.
192         * elf32-crx.c: Likewise.
193         * elf32-fr30.c: Likewise.
194         * elf32-frv.c: Likewise.
195         * elf32-h8300.c: Likewise.
196         * elf32-i960.c: Likewise.
197         * elf32-m32c.c: Likewise.
198         * elf32-m68hc11.c: Likewise.
199         * elf32-m68hc12.c: Likewise.
200         * elf32-m68hc1x.c: Likewise.
201         * elf32-m68k.c: Likewise.
202         * elf32-mcore.c: Likewise.
203         * elf32-rl78.c: Likewise.
204         * elf32-rx.c: Likewise.
205         * elf32-s390.c: Likewise.
206         * elf32-vax.c: Likewise.
207         * elf64-alpha.c: Likewise.
208         * elf64-mmix.c: Likewise.
209         * elf64-s390.c: Likewise.
210         * elf64-sparc.c: Likewise.
211         * elfnn-ia64.c: Likewise.
212         * elfxx-mips.c: Likewise.
213         * elfxx-sparc.c: Likewise.
214         * hash.c: Likewise.
215         * hp300hpux.c: Likewise.
216         * hppabsd-core.c: Likewise.
217         * hpux-core.c: Likewise.
218         * i386dynix.c: Likewise.
219         * i386linux.c: Likewise.
220         * i386lynx.c: Likewise.
221         * i386mach3.c: Likewise.
222         * i386msdos.c: Likewise.
223         * i386os9k.c: Likewise.
224         * irix-core.c: Likewise.
225         * lynx-core.c: Likewise.
226         * m68klinux.c: Likewise.
227         * mach-o.h: Likewise.
228         * mipsbsd.c: Likewise.
229         * netbsd-core.c: Likewise.
230         * nlm32-i386.c: Likewise.
231         * osf-core.c: Likewise.
232         * pc532-mach.c: Likewise.
233         * pef.c: Likewise.
234         * ppcboot.c: Likewise.
235         * ptrace-core.c: Likewise.
236         * reloc16.c: Likewise.
237         * sco5-core.c: Likewise.
238         * som.h: Likewise.
239         * sparclinux.c: Likewise.
240         * sparclynx.c: Likewise.
241         * ticoff.h: Likewise.
242         * trad-core.c: Likewise.
243         * vms-lib.c: Likewise.
244         * xsym.h: Likewise.
245
246 2012-07-09  Alan Modra  <amodra@gmail.com>
247
248         PR ld/14323
249         * elflink.c (elf_sort_symbol): Sort by size too.
250         (elf_link_add_object_symbols <weakdefs>): Simplify binary search.
251         Do not depend on ordering of symbol aliases.  Match largest size.
252
253 2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>
254
255         * elf.c (assign_section_numbers): Check if number of sections
256         >= SHN_LORESERVE.
257         * elfcode.h (elf_object_p): Likewise.
258
259 2012-07-03  Nick Clifton  <nickc@redhat.com>
260
261         * archive.c (bsd_write_armap): Catch attempts to create an archive
262         with indicies bigger than 4Gb.
263         (coff_write_armap): Likewise.
264
265 2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>
266
267         PR binutils/14319
268         * elf.c (_bfd_elf_make_section_from_shdr): Don't compress empty
269         debug section.
270
271 2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>
272
273         PR ld/3351
274         * elflink.c (_bfd_elf_update_dynamic_flags): New.
275         (_bfd_elf_merge_symbol): Update both real and indirect symbol
276         dynamic flags.
277         (_bfd_elf_add_default_symbol): Make the real symbol dynamic if
278         the indirect symbol is defined in a shared library.
279         (elf_link_add_object_symbols): Likewise.  If the indirect
280         symbol has been forced local, don't make the real symbol
281         dynamic.
282         (elf_link_check_versioned_symbol): Check indirect symbol.
283         (elf_link_output_extsym): Use real symbol definition when
284         reporting indirect symbol error.  Check version info for
285         dynamic versioned symbol.
286
287 2012-07-03  Alan Modra  <amodra@gmail.com>
288
289         PR ld/14207
290         * elf.c (assign_file_positions_for_load_sections): Remove assertions
291         that only PT_LOAD headers include file header and section headers.
292         (assign_file_positions_for_non_load_sections): Similarly don't
293         assert PT_GNU_RELRO header does not include file and section headers.
294         Compare first section vma rather than PT_LOAD p_vaddr against
295         relro_start when looking for PT_LOAD covering PT_GNU_RELRO.  Replace
296         abort with assertion.
297
298 2012-07-02  Alan Modra  <amodra@gmail.com>
299
300         * elf32-m32c.c (m32c_elf_check_relocs): Use bfd_make_section
301         "anyway" variant when creating .plt.
302         (m32c_elf_relax_plt_section): Remove redundant test and unused param.
303         (m32c_elf_relax_section): Test SEC_LINKER_CREATED before calling
304         m32c_elf_relax_plt_section.
305         * elfxx-mips.c (mips_elf_create_got_section): Use make anyway variant
306         when creating .got and .got.plt.
307         (_bfd_mips_elf_final_link): Likewise for .rtproc, and use
308         bfd_get_linker_section.
309         * sunos.c: Similarly throughout.
310
311 2012-07-01  Andreas Schwab  <schwab@linux-m68k.org>
312
313         * elf.c (_bfd_elf_make_section_from_shdr): Fix typo in error
314         message.
315
316 2012-06-29  H.J. Lu  <hongjiu.lu@intel.com>
317
318         * elf64-x86-64.c (elf_x86_64_relocate_section): Return FALSE
319         on unresolvable relocation.
320
321 2012-06-29  H.J. Lu  <hongjiu.lu@intel.com>
322
323         * archive.c (_bfd_compute_and_write_armap): Simplify global
324         symbol handling.
325
326 2012-06-29  Nick Clifton  <nickc@redhat.com>
327
328         PR ld/14189
329         * elf32-arm.c (elf32_arm_check_relocs): Do not increment refcount
330         for locally bound symbols.
331
332 2012-06-29  Alan Modra  <amodra@gmail.com>
333
334         * section.c (bfd_get_linker_section): New function.
335         * elf32-arm.c: When retrieving SEC_LINKER_CREATED sections, use
336         the above throughout rather than bfd_get_section_by_name.  Use
337         bfd_make_section_anyway rather than bfd_make_section when creating
338         them.
339         * elf32-bfin.c: Likewise.
340         * elf32-cr16.c: Likewise.
341         * elf32-cris.c: Likewise.
342         * elf32-frv.c: Likewise.
343         * elf32-hppa.c: Likewise.
344         * elf32-i370.c: Likewise.
345         * elf32-i386.c: Likewise.
346         * elf32-lm32.c: Likewise.
347         * elf32-m32c.c: Likewise.
348         * elf32-m32r.c: Likewise.
349         * elf32-m68k.c: Likewise.
350         * elf32-microblaze.c: Likewise.
351         * elf32-ppc.c: Likewise.
352         * elf32-rl78.c: Likewise.
353         * elf32-s390.c: Likewise.
354         * elf32-score.c: Likewise.
355         * elf32-score7.c: Likewise.
356         * elf32-sh.c: Likewise.
357         * elf32-tic6x.c: Likewise.
358         * elf32-tilepro.c: Likewise.
359         * elf32-vax.c: Likewise.
360         * elf32-xstormy16.c: Likewise.
361         * elf32-xtensa.c: Likewise.
362         * elf64-alpha.c: Likewise.
363         * elf64-hppa.c: Likewise.
364         * elf64-ia64-vms.c: Likewise.
365         * elf64-ppc.c: Likewise.
366         * elf64-s390.c: Likewise.
367         * elf64-sh64.c: Likewise.
368         * elf64-sparc.c: Likewise.
369         * elf64-x86-64.c: Likewise.
370         * elfnn-ia64.c: Likewise.
371         * elfxx-mips.c: Likewise.
372         * elfxx-sparc.c: Likewise.
373         * elfxx-tilegx.c: Likewise.
374         * elflink.c: Likewise.
375         * elf-vxworks.c: Likewise.
376         * elf-m10300.c: Likewise.  Also make use of htab plt, got and
377         gotplt shortcuts.
378         * bfd-in2.h: Regenerate.
379         * elf32-lm32.c (lm32_elf_check_relocs): Use the correct bfd when
380         calling create_rofixup_section.
381         * elflink.c (bfd_elf_final_link): Simplify test for .dynstr.
382
383 2012-06-29  Alan Modra  <amodra@gmail.com>
384
385         * elf32-sh.c (sh_elf_create_dynamic_sections): Don't create .rela
386         section for bss type sections, except for .rela.bss.
387         * elf-m10300.c (_bfd_mn10300_elf_create_dynamic_sections): Likewise.
388         * elf32-cr16.c (_bfd_cr16_elf_create_dynamic_sections): Likewise.
389         * elf32-lm32.c (lm32_elf_create_dynamic_sections): Likewise.
390         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
391         * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
392
393 2012-06-28  Roland McGrath  <mcgrathr@google.com>
394
395         * elf32-arm.c (elf32_arm_populate_plt_entry): Use int32_t for
396         displacement calculation in nacl_p case.
397
398 2012-06-28  Nick Clifton  <nickc@redhat.com>
399
400         * po/uk.po: New Ukranian translation.
401         * configure.in (ALL_LINGUAS): Add uk.
402         * configure: Regenerate.
403
404 2012-06-26  Alan Modra  <amodra@gmail.com>
405
406         * elf64-ppc.c (ppc64_elf_next_toc_section): Don't error if input
407         file has multiple .got/.toc sections and all don't fit in
408         current toc group.
409
410 2012-06-22  Roland McGrath  <mcgrathr@google.com>
411
412         * elf.c (assign_file_positions_for_non_load_sections): Define
413         __ehdr_start symbol if it's referenced and there's a PT_LOAD
414         segment that covers both the file and program headers.
415
416 2012-06-22  Andreas Schwab  <schwab@linux-m68k.org>
417
418         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Don't make
419         _GLOBAL_OFFSET_TABLE_ and _DYNAMIC absolute.
420
421 2012-06-22  Alan Modra  <amodra@gmail.com>
422
423         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't emit out-of-line
424         save/restore functions when relocatable.  Make "funcs" static.
425
426 2012-06-18  Hans-Peter Nilsson  <hp@axis.com>
427
428         * elf32-cris.c (cris_elf_plt_sym_val): Rewrite to work in presence
429         of merged .got and .got.plt entries.
430
431 2012-06-18  John Szakmeister  <john@szakmeister.net>
432
433         * elf32-arm.c (elf32_arm_final_link_relocate): Correct return value.
434
435 2012-06-17  Hans-Peter Nilsson  <hp@axis.com>
436
437         * elf32-cris.c (cris_elf_relocate_section): <R_CRIS_32_IE>
438         <R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>: Handle references to
439         thread common symbols.
440
441 2012-06-13  Nick Clifton  <nickc@redhat.com>
442
443         * elf32-arm.c (bfd_arm_get_mach_from_attributes): New function.
444         (elf32_arm_object_p): If the machine number could not be deduced
445         from the notes, call bfd_arm_get_mach_from_attributes to get the
446         number from the attributes.
447
448 2012-06-12  H.J. Lu  <hongjiu.lu@intel.com>
449
450         PR bfd/14207
451         * elf.c (assign_file_positions_for_non_load_sections): Abort if
452         PT_GNU_RELRO segment doesn't fit in PT_LOAD segment.
453
454 2012-06-12  Alan Modra  <amodra@gmail.com>
455
456         PR ld/14207
457         * elf.c (_bfd_elf_map_sections_to_segments): Disregard bss type
458         sections at end of PT_LOAD segment when searching for segment
459         that contains end of relro extent.
460
461 2012-06-11  H.J. Lu  <hongjiu.lu@intel.com>
462
463         * elf.c (assign_file_positions_for_non_load_sections): Reindent.
464
465 2012-06-11  H.J. Lu  <hongjiu.lu@intel.com>
466
467         * elf.c (_bfd_elf_map_sections_to_segments): Reindent.
468
469 2012-06-06  Alan Modra  <amodra@gmail.com>
470
471         * elflink.c (elf_link_input_bfd): Provide a file symbol for
472         each input file with local syms, if the input lacks such.
473         (bfd_elf_final_link): Add a file symbol to mark end of locals
474         for which we can associate with input files.
475         (struct elf_final_link_info): Add filesym_count field.
476         (struct elf_outext_info): Add need_second_pass and second_pass.
477         (elf_link_output_extsym): Detect symbols defined in the output
478         file, emit them on second pass over locals.
479
480 2012-06-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
481
482         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument
483         of target_read_memory as bfd_size_type.
484         * bfd-in2.h: Regenerate.
485         * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN
486         argument of target_read_memory as bfd_size_type.
487         (_bfd_elf32_bfd_from_remote_memory): Likewise.
488         (_bfd_elf64_bfd_from_remote_memory): Likewise.
489         * elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
490         * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise.
491
492 2012-06-03  Alan Modra  <amodra@gmail.com>
493
494         PR binutils/13897
495         * elf.c (elf_find_function): Cache last function sym info.
496         (_bfd_elf_maybe_function_sym): Return function size, pass in
497         section of interest.
498         * elf-bfd.h (struct elf_backend_data <maybe_function_sym>): Likewise.
499         (_bfd_elf_maybe_function_sym): Likewise.
500         * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
501         (opd_entry_value): Add in_code_sec param.  Revert caching code.
502         Return -1 if in_code_sec and function found in wrong section.
503         Update all calls.
504
505 2012-06-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
506
507         * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument
508         of target_read_memory as size_t.
509         * bfd-in2.h: Regenerate.
510         * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN
511         argument of target_read_memory as size_t.
512         (_bfd_elf32_bfd_from_remote_memory): Likewise.
513         (_bfd_elf64_bfd_from_remote_memory): Likewise.
514         * elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
515         * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise.
516
517 2012-06-01  Alan Modra  <amodra@gmail.com>
518
519         PR binutils/13897
520         * elf64-ppc.c (opd_entry_value): Rewrite cache code.
521
522 2012-05-29  Tom Tromey  <tromey@redhat.com>
523
524         * opncls.c (bfd_fopen): Always close fd on failure.
525         (bfd_fdopenr): Likewise.
526
527 2012-05-27  Alan Modra  <amodra@gmail.com>
528
529         PR ld/14170
530         * elflink.c (_bfd_elf_merge_symbol): When a symbol defined in
531         a dynamic library finds a new instance with non-default
532         visibility in a regular object, correctly handle symbols
533         already on the undefs list and undo dynamic symbol state when
534         the new symbol is hidden or internal.
535
536 2012-05-25  H.J. Lu  <hongjiu.lu@intel.com>
537
538         * elf32-i386.c (elf_i386_create_dynamic_sections): Don't use
539         dynamic_sec_flags to create PLT .eh_frame section.
540         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
541
542 2012-05-25  Alan Modra  <amodra@gmail.com>
543
544         PR ld/13909
545         * elf-eh-frame.c (_bfd_elf_eh_frame_present): New function.
546         (_bfd_elf_maybe_strip_eh_frame_hdr): Use it here.
547         * elf-bfd.h (_bfd_elf_eh_frame_present): Declare.
548         * elflink.c (bfd_elf_size_dynamic_sections): Let the backend
549         size dynamic sections before stripping eh_frame_hdr.
550         (bfd_elf_gc_sections): Handle multiple .eh_frame sections.
551         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Drop glink_eh_frame
552         if no other .eh_frame sections exist.
553         * elf64-ppc.c (ppc64_elf_size_stubs): Likewise.
554         * elf32-i386.c (elf_i386_create_dynamic_sections): Don't size
555         or alloc plt_eh_frame here..
556         (elf_i386_size_dynamic_sections): ..do it here instead.  Don't
557         specially keep sgotplt, iplt, tgotplt, sdynbss for symbols.
558         (elf_i386_finish_dynamic_sections): Check plt_eh_frame->contents
559         before writing plt offset.
560         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Don't size
561         or alloc plt_eh_frame here..
562         (elf_x86_64_size_dynamic_sections): ..do it here instead.
563         (elf_x86_64_finish_dynamic_sections): Check plt_eh_frame->contents
564         before writing plt offset.
565
566 2012-05-24  Alan Modra  <amodra@gmail.com>
567
568         PR ld/14158
569         * elf64-ppc.c (ppc64_elf_size_stubs): Round up glink_eh_frame
570         size to output section alignment.
571         (ppc64_elf_build_stubs): Likewise, and extend last FDE to cover.
572
573 2012-05-23  Alan Modra  <amodra@gmail.com>
574
575         * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle
576         BFDs with multiple .eh_frame sections.
577
578 2012-05-23  Alan Modra  <amodra@gmail.com>
579
580         PR ld/13909
581         * elflink.c (bfd_elf_discard_info): Don't ignore dynamic BFDs.
582
583 2012-05-22  H.J. Lu  <hongjiu.lu@intel.com>
584
585         PR ld/13909
586         * elf32-i386.c (elf_i386_create_dynamic_sections): Revert the
587         last change.
588         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
589
590 2012-05-22  Alan Modra  <amodra@gmail.com>
591
592         * elflink.c (bfd_elf_discard_info): Look for next .eh_frame if
593         first one is zero size or discarded.
594         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set most of
595         glink_eh_frame contents here..
596         (ppc_elf_finish_dynamic_sections): ..rather than here.  Just set
597         offset to .glink.
598
599 2012-05-22  H.J. Lu  <hongjiu.lu@intel.com>
600
601         PR ld/13909
602         * elf32-i386.c (elf_i386_create_dynamic_sections): Create PLT
603         eh_frame section if there is an input .eh_frame section.
604         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
605
606 2012-05-22  H.J. Lu  <hongjiu.lu@intel.com>
607
608         PR ld/14105
609         * elf32-i386.c (elf_i386_create_dynamic_sections): Always
610         create PLT eh_frame section with SEC_LINKER_CREATED.
611         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
612
613 2012-05-22  Alan Modra  <amodra@gmail.com>
614
615         * elflink.c (bfd_elf_discard_info): Handle multiple .eh_frame
616         sections attached to a BFD.
617         * section.c (bfd_get_section_by_name): Rewrite description.
618         (bfd_get_next_section_by_name): New function.
619         * bfd-in2.h: Regenerate.
620
621 2012-05-21  Andreas Schwab  <schwab@linux-m68k.org>
622
623         * elf32-m68k.c (elf_m68k_grok_prstatus): New function.
624         (elf_m68k_grok_psinfo): New function.
625         (elf_backend_grok_prstatus): Define.
626         (elf_backend_grok_psinfo): Define.
627
628 2012-05-19  Maciej W. Rozycki  <macro@linux-mips.org>
629
630         * elf64-mips.c (elf_backend_got_header_size): Correct definition.
631         * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Use the ELF
632         backend's GOT header size instead of hardcoding it.
633
634 2012-05-19  Maciej W. Rozycki  <macro@linux-mips.org>
635
636         * elf32-vax.c (elf_vax_relocate_section)
637         <R_VAX_8, R_VAX_16, R_VAX_32>: Don't check if info->shared again.
638
639 2012-05-19  Maciej W. Rozycki  <macro@linux-mips.org>
640
641         * elf32-vax.c (elf_vax_relocate_section)
642         <R_VAX_8, R_VAX_16, R_VAX_32>: Use section flags rather than
643         its name as the check for text sections.
644
645 2012-05-19  Maciej W. Rozycki  <macro@linux-mips.org>
646
647         * elf64-mips.c (mips_elf64_be_swap_reloc_out): Also make sure
648         the third reloc offset is the same as the first.
649
650 2012-05-19  Alan Modra  <amodra@gmail.com>
651
652         * elf32-ppc.h (has_vle_insns, is_ppc_vle): Delete.
653         (has_tls_reloc, has_tls_get_addr_call): Move back to..
654         * elf32-ppc.c: ..here.
655         (ppc_elf_section_flags, elf_backend_section_flags): Delete.
656         (ppc_elf_modify_segment_map): Use ELF sh_flags to detect VLE sections.
657
658 2012-05-18  H.J. Lu  <hongjiu.lu@intel.com>
659
660         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Don't make
661         _DYNAMIC nor _GLOBAL_OFFSET_TABLE_ absolute.
662         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
663
664 2012-05-18  Roland McGrath  <mcgrathr@google.com>
665
666         * archive.c (_bfd_generic_read_ar_hdr_mag): Fix last change so as
667         not to clobber the ar_fmag field stored in ARED->arch_header.
668
669 2012-05-18  Pedro Alves  <palves@redhat.com>
670
671         * mach-o.h: Don't include sysdep.h.
672
673 2012-05-18  Nick Clifton  <nickc@redhat.com>
674
675         PR 14072
676         * bfd-in.h: Check for PACKAGE or PACKAGE_VERSION before
677         complaining about config.h not having been included.
678         * bfd-in2.h: Regenerate.
679
680 2012-05-18  Andreas Schwab  <schwab@linux-m68k.org>
681
682         * aclocal.m4: Regenerate.
683         * Makefile.in: Regenerate.
684
685 2012-05-17  Daniel Richard G.  <skunk@iskunk.org>
686             Nick Clifton  <nickc@redhat.com>
687
688         PR 14072
689         * configure.in: Add check that sysdep.h has been included before
690         any system header files.
691         * configure: Regenerate.
692         * config.in: Regenerate.
693         * aclocal.m4: Regenerate.
694         * bfd-in.h: Generate an error if included before config.h.
695         * sysdep.h: Likewise.
696         * bfd-in2.h: Regenerate.
697         * compress.c: Remove #include "config.h".
698         * plugin.c: Likewise.
699         * elf32-m68hc1x.c: Include sysdep.h before alloca-conf.h.
700         * elf64-hppa.c: Likewise.
701         * som.c: Likewise.
702         * xsymc.c: Likewise.
703
704 2012-05-17  Maciej W. Rozycki  <macro@linux-mips.org>
705             Alan Modra  <amodra@gmail.com>
706
707         * elf.c (ignore_section_sym): Correct comment.  Don't return
708         true for absolute section.
709         (elf_map_symbols): Move stray comment.  Adjust for above change.
710         Don't discard global section symbols.
711
712 2012-05-17  Alan Modra  <amodra@gmail.com>
713
714         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make _DYNAMIC,
715         _GLOBAL_OFFSET_TABLE_ or _PROCEDURE_LINKAGE_TABLE_ absolute.
716         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Don't make _DYNAMIC
717         absolute.
718
719 2012-05-17  Alan Modra  <amodra@gmail.com>
720
721         * elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call, has_vle_insns,
722         is_ppc_vle): Move to..
723         * elf32-ppc.h: ..here, making is_ppc_vle a macro.
724
725 2012-05-16  Sergio Durigan Junior  <sergiodj@redhat.com>
726
727         * bfd-in.h (bfd_get_section_name, bfd_get_section_vma,
728         bfd_get_section_lma, bfd_get_section_alignment,
729         bfd_get_section_flags, bfd_get_section_userdata): Rewrite macros
730         in order to use the `bfd' argument.
731         * bfd-in2.h: Regenerate.
732         * elf-vxworks.c (elf_vxworks_finish_dynamic_entry): Pass proper `bfd'
733         as the first argument for `bfd_get_section_alignment'.
734         * elf32-arm.c (create_ifunc_sections): Likewise, for
735         `bfd_set_section_alignment'.
736         * elf32-m32r.c (m32r_elf_relocate_section): Likewise, for
737         `bfd_get_section_name'.
738         * elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
739         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
740         (ppc_elf_relocate_section): Likewise.
741         * elf64-mmix.c (mmix_final_link_relocate): Likewise, for
742         `bfd_get_section_vma'.
743         * elf64-ppc.c (create_linkage_sections): Likewise, for
744         `bfd_set_section_alignment'.
745
746 2012-05-16  Georg-Johann Lay  <avr@gjlay.de>
747
748         PR target/13503
749         * reloc.c: Rename BFD_RELOC_AVR_8_HHI to BFD_RELOC_AVR_8_HLO.
750         * bfd-in2.h: Regenerate.
751         * libbfd.h: Regenrate.
752         * elf32-avr.c (elf_avr_howto_table): Rename R_AVR_8_HHI8 to
753         R_AVR_8_HLO8.
754         (avr_reloc_map): Likewise.
755
756 2012-05-16  Daniel Richard G.  <skunk@iskunk.org>
757
758         PR binutils/13558
759         * bfd/aout-cris.c: Include sysdep.h before bfd.h.
760         * bfd/aout-ns32k.c: Likewise.
761         * bfd/aout-sparcle.c: Likewise.
762         * bfd/aout0.c: Likewise.
763         * bfd/bfd-in2.h: Likewise.
764         * bfd/coff-stgo32.c: Likewise.
765         * bfd/cpu-lm32.c: Likewise.
766         * bfd/cpu-microblaze.c: Likewise.
767         * bfd/cpu-score.c: Likewise.
768         * bfd/cpu-tilegx.c: Likewise.
769         * bfd/cpu-tilepro.c: Likewise.
770         * bfd/elf32-lm32.c: Likewise.
771         * bfd/elf32-microblaze.c: Likewise.
772         * bfd/elf32-score7.c: Likewise.
773         * bfd/elf32-tilepro.c: Likewise.
774         * bfd/elfxx-tilegx.c: Likewise.
775         * bfd/mach-o.h: Likewise.
776         * bfd/nlm32-ppc.c: Likewise.
777         * bfd/ns32knetbsd.c: Likewise.
778         * bfd/pef.h: Likewise.
779         * bfd/plugin.c: Likewise.
780         * bfd/stab-syms.c: Likewise.
781         * bfd/sunos.c: Likewise.
782         * bfd/syms.c: Likewise.
783         * bfd/xsym.h: Likewise.
784
785 2012-05-16  Alan Modra  <amodra@gmail.com>
786
787         * elflink.c: Rename flaginfo to flinfo throughout, except..
788         (bfd_elf_lookup_section_flags): ..here, rename finfo to flaginfo.
789         Formatting, style.  Simplify flag match.
790
791 2012-05-16  Alan Modra  <amodra@gmail.com>
792
793         * dwarf2.c: Formatting.
794         (arange_add): Pass in unit rather than bfd.  Update callers.
795         Ignore empty ranges.  Don't ask for cleared memory.
796         (parse_comp_unit): Only set unit->base_address if processing
797         DW_TAG_compile_unit.
798         (find_debug_info): Optimise section lookup.
799         (place_sections): Use bfd_alloc for stash->adjusted_sections.
800         (find_line): Match previously parsed comp unit addresses as we
801         do for newly parsed comp units.
802
803 2012-05-16  Alan Modra  <amodra@gmail.com>
804
805         * archive.c (_bfd_generic_read_ar_hdr_mag):  Ensure sscanf
806         stops at end of ar_size field.
807
808 2012-05-16  Alan Modra  <amodra@gmail.com>
809
810         PR ld/13962
811         PR ld/7023
812         * elf.c (bfd_section_from_shdr): Fail when .dynsym sh_info is
813         out of range.  As a special case, fix sh_info for zero sh_size.
814         Do the same for .symtab.
815
816 2012-05-15  James Murray <jsm@jsm-net.demon.co.uk>
817             Stephane Carrez <stcarrez@nerim.fr>
818
819         * archures.c: Add bfd_arch_m9s12x and bfd_arch_m9s12xg.
820         * config.bfd: Likewise.
821         * cpu-m9s12x.c: New.
822         * cpu-m9s12xg.c: New.
823         * elf32-m68hc12.c: Add S12X and XGATE co-processor support.
824         Add option to offset S12 addresses into XGATE memory space.
825         Fix carry bug in IMM16 (IMM8 low/high) relocate.
826         * Makefile.am (ALL_MACHINES): Add cpu-m9s12x and cpu-m9s12xg.
827         (ALL_MACHINES_CFILES): Likewise.
828         * reloc.c: Add S12X relocs.
829         * Makefile.in: Regenerate.
830         * bfd-in2.h: Regenerate.
831         * libbfd.h: Regenerate.
832
833 2012-05-14  James Lemke  <jwlemke@codesourcery.com>
834             Catherine Moore  <clm@codesourcery.com>
835
836         * bfd.c (bfd_lookup_section_flags): Add section parm.
837         * ecoff.c (bfd_debug_section): Remove flag_info initializer.
838         * elf-bfd.h (bfd_elf_section_data): Move in section_flag_info.
839         (bfd_elf_lookup_section_flags): Add section parm.
840         * elf32-ppc.c (is_ppc_vle): New function.
841         (ppc_elf_modify_segment_map): New function.
842         (elf_backend_modify_segment_map): Define.
843         (has_vle_insns): New define.
844         * elf32-ppc.h (ppc_elf_modify_segment_map): Declare.
845         * elflink.c (bfd_elf_lookup_section_flags): Add return value & parm.
846         Move in logic to omit / include a section.
847         * libbfd-in.h (bfd_link_info): Add section parm.
848         (bfd_generic_lookup_section_flags): Likewise.
849         * reloc.c (bfd_generic_lookup_section_flags): Likewise.
850         * section.c (bfd_section): Move out section_flag_info.
851         (BFD_FAKE_SECTION): Remove flag_info initializer.
852         * targets.c (_bfd_lookup_section_flags): Add section parm.
853
854 2012-05-14  Catherine Moore  <clm@codesourcery.com>
855
856         * archures.c (bfd_mach_ppc_vle): New.
857         * bfd-in2.h: Regenerated.
858         * cpu-powerpc.c (bfd_powerpc_archs): New entry for vle.
859         * elf32-ppc.c (split16_format_type): New enumeration.
860         (ppc_elf_vle_split16): New function.
861         (HOWTO): Add entries for R_PPC_VLE relocations.
862         (ppc_elf_reloc_type_lookup): Handle PPC_VLE relocations.
863         (ppc_elf_section_flags): New function.
864         (ppc_elf_lookup_section_flags): New function.
865         (ppc_elf_section_processing): New function.
866         (ppc_elf_check_relocs): Handle PPC_VLE relocations.
867         (ppc_elf_relocation_section): Likewise.
868         (elf_backend_lookup_section_flags_hook): Define.
869         (elf_backend_section_flags): Define.
870         (elf_backend_section_processing): Define.
871         * elf32-ppc.h (ppc_elf_section_processing): Declare.
872         * libbfd.h: Regenerated.
873         * reloc.c (BFD_RELOC_PPC_VLE_REL8, BFD_RELOC_PPC_VLE_REL15,
874         BFD_RELOC_PPC_VLE_REL24, BFD_RELOC_PPC_VLE_LO16A,
875         BFD_RELOC_PPC_VLE_LO16D, BFD_RELOC_PPC_VLE_HI16A,
876         BFD_RELOC_PPC_VLE_HI16D, BFD_RELOC_PPC_VLE_HA16A,
877         BFD_RELOC_PPC_VLE_HA16D, BFD_RELOC_PPC_VLE_SDA21,
878         BFD_RELOC_PPC_VLE_SDA21_LO, BFD_RELOC_PPC_VLE_SDAREL_LO16A,
879         BFD_RELOC_PPC_VLE_SDAREL_LO16D, BFD_RELOC_PPC_VLE_SDAREL_HI16A,
880         BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A,
881         BFD_RELOC_PPC_VLE_SDAREL_HA16D): New bfd relocations.
882
883 2012-05-11  Georg-Johann Lay  <avr@gjlay.de>
884
885         PR target/13503
886         * reloc.c: Add new ENUM for BFD_RELOC_AVR_8_LO,
887         BFD_RELOC_AVR_8_HI, BFD_RELOC_AVR_8_HHI.
888         * bfd-in2.h: Regenerate.
889         * libbfd.h: Regenrate.
890         * elf32-avr.c (elf_avr_howto_table): Add entries for
891         R_AVR_8_LO8, R_AVR_8_HI8, R_AVR_8_HHI8.
892         (avr_reloc_map): Add RELOC mappings for R_AVR_8_LO8, R_AVR_8_HI8,
893         R_AVR_8_HHI8.
894
895 2012-05-10  H.J. Lu  <hongjiu.lu@intel.com>
896
897         * elf64-x86-64.c (elf_x86_64_relocate_section): Use int in x32
898         addend overflow check.
899
900 2012-05-10  DJ Delorie  <dj@redhat.com>
901
902         * elf32-rx.c (rx_elf_object_p): Ignore empty segments.
903
904 2012-05-10  H.J. Lu  <hongjiu.lu@intel.com>
905
906         * elf64-x86-64.c (elf_x86_64_relocate_section): Display signed
907         hex number in x32 addend overflow check.
908
909 2012-05-10  H.J. Lu  <hongjiu.lu@intel.com>
910
911         * elf64-x86-64.c (elf_x86_64_reloc_type_class): Handle
912         R_X86_64_RELATIVE64.
913
914 2012-05-09  H.J. Lu  <hongjiu.lu@intel.com>
915
916         * elf64-x86-64.c (elf_x86_64_relocate_section): Check addend
917         overflow for R_X86_64_RELATIVE64.
918
919 2012-05-08  Ben Cheng  <bccheng@google.com>
920
921         * elf.c: Preserve the original p_align and p_flags if they are
922         valid.
923
924 2012-05-07  Alan Modra  <amodra@gmail.com>
925
926         * elf64-ia64-vms.c (elf64_ia64_relocate_section): Update
927         RELOC_AGAINST_DISCARDED_SECTION invocation.
928
929 2012-05-07  Hans-Peter Nilsson  <hp@axis.com>
930
931         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Declare and use
932         local variable i_ instead of assuming and using a variable i.
933
934 2012-05-07  Maciej W. Rozycki  <macro@linux-mips.org>
935
936         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Handle compound
937         relocations.
938         * elfxx-mips.c (mips_reloc_against_discarded_section): New
939         function.
940         (_bfd_mips_elf_relocate_section): Call it, in place of
941         RELOC_AGAINST_DISCARDED_SECTION.
942         * elf-m10200.c (mn10200_elf_relocate_section): Update arguments
943         to RELOC_AGAINST_DISCARDED_SECTION.
944         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
945         * elf32-arm.c (elf32_arm_relocate_section): Likewise.
946         * elf32-avr.c (elf32_avr_relocate_section): Likewise.
947         * elf32-bfin.c (bfin_relocate_section): Likewise.
948         (bfinfdpic_relocate_section): Likewise.
949         * elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
950         * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
951         * elf32-cris.c (cris_elf_relocate_section): Likewise.
952         * elf32-crx.c (elf32_crx_relocate_section): Likewise.
953         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
954         * elf32-epiphany.c (epiphany_elf_relocate_section): Likewise.
955         * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
956         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
957         * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
958         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
959         * elf32-i370.c (i370_elf_relocate_section): Likewise.
960         * elf32-i386.c (elf_i386_relocate_section): Likewise.
961         * elf32-i860.c (elf32_i860_relocate_section): Likewise.
962         * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
963         * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
964         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
965         * elf32-m32c.c (m32c_elf_relocate_section): Likewise.
966         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
967         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
968         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
969         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
970         * elf32-mep.c (mep_elf_relocate_section): Likewise.
971         * elf32-moxie.c (moxie_elf_relocate_section): Likewise.
972         * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
973         * elf32-mt.c (mt_elf_relocate_section): Likewise.
974         * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
975         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
976         * elf32-rl78.c (rl78_elf_relocate_section): Likewise.
977         * elf32-rx.c (rx_elf_relocate_section): Likewise.
978         * elf32-s390.c (elf_s390_relocate_section): Likewise.
979         * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
980         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
981         * elf32-sh.c (sh_elf_relocate_section): Likewise.
982         * elf32-spu.c (spu_elf_relocate_section): Likewise.
983         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
984         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
985         * elf32-v850.c (v850_elf_relocate_section): Likewise.
986         * elf32-vax.c (elf_vax_relocate_section): Likewise.
987         * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
988         * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
989         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
990         * elf64-alpha.c (elf64_alpha_relocate_section_r): Likewise.
991         (elf64_alpha_relocate_section): Likewise.
992         * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
993         * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
994         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
995         * elf64-s390.c (elf_s390_relocate_section): Likewise.
996         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
997         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
998         * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
999         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1000         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1001
1002 2012-05-05  Alan Modra  <amodra@gmail.com>
1003
1004         PR ld/14052
1005         PR ld/13621
1006         * linker.c (_bfd_nearby_section): Revert 2012-02-13 change.
1007
1008 2012-05-05  Alan Modra  <amodra@gmail.com>
1009
1010         * aout-arm.c: Replace all uses of bfd_abs_section, bfd_com_section,
1011         bfd_und_section and bfd_ind_section with their _ptr variants, or
1012         use corresponding bfd_is_* macros.
1013         * aout-ns32k.c: Likewise.
1014         * aout-tic30.c: Likewise.
1015         * coff-arm.c: Likewise.
1016         * coff-tic54x.c: Likewise.
1017         * cpu-ns32k.c: Likewise.
1018         * elf-attrs.c: Likewise.
1019         * elfcode.h: Likewise.
1020         * peicode.h: Likewise.
1021         * reloc.c: Likewise.
1022         * riscix.c: Likewise.
1023         * versados.c: Likewise.
1024         * section.c: Likewise.
1025         (bfd_abs_section, bfd_ind_section, bfd_com_section,
1026         bfd_ind_section): Delete.
1027         (std_section): New array replacing above.
1028         (bfd_abs_section_ptr, bfd_ind_section_ptr, bfd_com_section_ptr,
1029         bfd_ind_section_ptr, STD_SECTION): Update.
1030         (BFD_FAKE_SECTION, GLOBAL_SYM_INIT): Remove unnecessary casts.
1031         * bfd-in2.h: Regenerate.
1032
1033 2012-05-03  Sean Keys  <skeys@ipdatasys.com>
1034
1035         * cpu-xgate.c: New file. Added XGATE support.
1036         * archures.c (bfd_architecture): Add XGATE architecture.
1037         (bfd_archures_list): Add reference to XGATE architecture info.
1038         * elf-bfd.h (prep_headers): Handle bfd_arch_xgate.
1039         * reloc.c: Add various XGATE relocation enums.
1040         * targets.c (bfd_elf32_xgate_vec): Declare and add to target vector
1041         list.
1042         * Makefile.am: Add support for XGATE elf.
1043         * configure.in: Ditto.
1044         * config.bfd: Ditto.
1045         * Makefile.in: Regenerate.
1046         * configure: Ditto.
1047         * bfd-in2.h: Ditto.
1048         * libbfd.h: Ditto.
1049         Added files for XGATE relocations.
1050         * elf32-xgate.c: Created minimal relocation file.
1051         * elf32-xgate.h: Created minimal header file for elf32-xgate.
1052
1053 2012-05-03  Tristan Gingold  <gingold@adacore.com>
1054
1055         * dwarf2.c (decode_line_info): Ignore
1056         DW_LNE_HP_source_file_correlation.
1057
1058 2012-05-01  Nick Clifton  <nickc@redhat.com>
1059
1060         PR binutils/13121
1061         * aoutx.h: Rename 'finfo' to 'flaginfo' to avoid conflicts with
1062         AIX system headers.
1063         * coff-ppc.c: Likewise.
1064         * cofflink.c: Likewise.
1065         * elf32-arm.c: Likewise.
1066         * elf64-sparc.c: Likewise.
1067         * elflink.c: Likewise.
1068         * pdp11.c: Likewise.
1069         * rescoff.c: Likewise.
1070
1071 2012-04-26  Mark Wielaard  <mjw@redhat.com>
1072
1073         * dwarf2.c (scan_unit_for_symbols): Account for DW_AT_high_pc
1074         possibly being relative to DW_AT_low_pc.
1075         (parse_comp_unit): Likewise.
1076
1077 2012-04-26  Andreas Schwab  <schwab@linux-m68k.org>
1078
1079         * elf32-m68k.c (elf_m68k_check_relocs): Mark non-GOT references
1080         also when generating PIE.
1081         (elf_m68k_discard_copies): Mark undefined weak symbols referenced
1082         by relocations as dynamic.
1083
1084 2012-04-26  Hans-Peter Nilsson  <hp@axis.com>
1085
1086         Provide a way for programs to recognize BFD_ASSERT calls.
1087         * bfd.c (bfd_assert_handler_type): New API type.
1088         (bfd_set_assert_handler, bfd_get_assert_handler): New API functions.
1089         (_bfd_assert_handler): New variable.
1090         (_bfd_default_assert_handler): New function.
1091         (bfd_assert): Call _bfd_assert_handler, not _bfd_error_handler.
1092         * libbfd-in.h (_bfd_assert_handler): Declare.
1093         * libbfd.h, bfd-in2.h: Regenerate.
1094
1095 2012-04-24  Hans-Peter Nilsson  <hp@axis.com>
1096
1097         PR ld/13990
1098         * elf32-arm.c (elf32_arm_gc_sweep_hook): Handle a forced-local
1099         symbol, where PLT refcount is set to -1.
1100
1101 2012-04-24  Alan Modra  <amodra@gmail.com>
1102
1103         PR ld/13991
1104         * elf-bfd.h (_bfd_elf_link_just_syms): Define as
1105         _bfd_generic_link_just_syms.
1106         * elflink.c (_bfd_elf_link_just_syms): Delete.
1107         * linker.c (_bfd_generic_link_just_syms): Set sec_info_type.
1108
1109         * bfd-in.h (discarded_section): Renamed from elf_discarded_section.
1110         * section.c (SEC_INFO_TYPE_NONE, SEC_INFO_TYPE_STABS,
1111         SEC_INFO_TYPE_MERGE, SEC_INFO_TYPE_EH_FRAME,
1112         SEC_INFO_TYPE_JUST_SYMS): Renamed from corresponding ELF_INFO_TYPE.
1113         * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
1114         * elf.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c,
1115         * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
1116         * elf32-crx.c, * elf32-d10v.c, * elf32-epiphany.c,
1117         * elf32-fr30.c, * elf32-frv.c, * elf32-h8300.c,
1118         * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c,
1119         * elf32-i860.c, * elf32-ip2k.c, * elf32-iq2000.c,
1120         * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c,
1121         * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
1122         * elf32-mep.c, * elf32-moxie.c, * elf32-msp430.c,
1123         * elf32-mt.c, * elf32-openrisc.c, * elf32-ppc.c,
1124         * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c,
1125         * elf32-score.c, * elf32-score7.c, * elf32-sh.c,
1126         * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c,
1127         * elf32-v850.c, * elf32-vax.c, * elf32-xc16x.c,
1128         * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
1129         * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
1130         * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c,
1131         * elf64-x86-64.c, * elflink.c, * elfnn-ia64.c,
1132         * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c,
1133         * reloc.c: Update all references.
1134         * bfd-in2.h: Regenerate.
1135
1136 2012-04-20  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1137
1138         * elf32-s390.c (ELF_DYNAMIC_INTERPRETER): Set to the GCC default.
1139         * elf64-s390.c (ELF_DYNAMIC_INTERPRETER): Set to the GCC default.
1140
1141 2012-04-19  Thomas Schwinge  <thomas@codesourcery.com>
1142
1143         * elf32-sh.c (elf_sh_link_hash_entry): Specify an enum identifier for
1144         got_type.
1145         (allocate_dynrelocs, sh_elf_relocate_section, sh_elf_check_relocs): Use
1146         it.
1147
1148 2012-04-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1149
1150         * elf32-sh.c (allocate_dynrelocs): Don't allocate dynamic
1151         relocations when LE conversion happens on the IE tls symbol.
1152
1153 2012-04-17  Roland McGrath  <mcgrathr@google.com>
1154
1155         * elf64-x86-64.c (elf_x86_64_nacl_plt0_entry): Fix nop padding
1156         so that 32-byte boundary is a proper instruction boundary.
1157
1158 2012-04-17  Tristan Gingold  <gingold@adacore.com>
1159
1160         * vms-lib.c (_bfd_vms_lib_get_module): Append .obj extension to
1161         member of an object archive.<
1162
1163 2012-04-17  Tristan Gingold  <gingold@adacore.com>
1164
1165         * vms-lib.c (MAX_EKEYLEN): Define.
1166         (MAX_KEYLEN): Fix value.
1167         (vms_write_index): Add comments and fix indentation.
1168         Adjust comparaison.  Add assertions.  Free kbn_blk.
1169         (_bfd_vms_lib_write_archive_contents): Use MAX_EKEYLEN.
1170         Compense MAX_KEYLEN adjustment.
1171
1172 2012-04-16  Maciej W. Rozycki  <macro@linux-mips.org>
1173
1174         * elfxx-mips.c (mips16_stub_symndx): Handle n64 compound relocs.
1175         (_bfd_mips_elf_check_relocs): Update accordingly.
1176
1177 2012-04-13  Alan Modra  <amodra@gmail.com>
1178
1179         PR ld/13947
1180         * elflink.c (bfd_elf_final_link): Set reloc_count to 0 for
1181         reloc sections.
1182
1183 2012-04-12  David S. Miller  <davem@davemloft.net>
1184
1185         * reloc.c (BFD_RELOC_SPARC_H34, BFD_RELOC_SPARC_SIZE32,
1186         BFD_RELOC_SPARC_SIZE64, BFD_RELOC_SPARC_WDISP10): New relocs.
1187         * libbfd.h: Regenerate.
1188         * bfd-in2.h: Likewise.
1189         * elfxx-sparc.c (sparc_elf_wdisp10_reloc): New function.
1190         (_bfd_sparc_elf_howto_table): Add entries for R_SPARC_H34,
1191         R_SPARC_SIZE32, R_SPARC_64, and R_SPARC_WDISP10.
1192         (_bfd_sparc_elf_reloc_type_lookup): Handle new relocs.
1193         (_bfd_sparc_elf_check_relocs): Likewise.
1194         (_bfd_sparc_elf_gc_sweep_hook): Likewise.
1195         (_bfd_sparc_elf_relocate_section): Likewise.
1196
1197 2012-04-12  Roland McGrath  <mcgrathr@google.com>
1198
1199         * elf32-arm.c (elf32_arm_nacl_plt0_entry, elf32_arm_nacl_plt_entry):
1200         New variables.
1201         (struct elf32_arm_link_hash_table): New member `nacl_p'.
1202         (elf32_arm_link_hash_table_create): Initialize it.
1203         (elf32_arm_nacl_link_hash_table_create): New function.
1204         (arm_movw_immediate, arm_movt_immediate): New functions.
1205         (elf32_arm_populate_plt_entry): Test HTAB->nacl_p.
1206         (elf32_arm_finish_dynamic_sections): Likewise.
1207         (elf32_arm_output_plt_map_1): Likewise.
1208         (bfd_elf32_littlearm_nacl_vec, bfd_elf32_bigarm_nacl_vec):
1209         New backend vector stanza.
1210         (elf32_arm_nacl_modify_segment_map): New function.
1211         * config.bfd: Handle arm-*-nacl*, armeb-*-nacl*.
1212         * targets.c: Support bfd_elf32_{big,little}_nacl_vec.
1213         * configure.in: Likewise.
1214         (bfd_elf32_bigarm_nacl_vec): Add elf-nacl.lo here.
1215         (bfd_elf32_littlearm_nacl_vec): Likewise.
1216         (bfd_elf32_bigarm_vec, bfd_elf32_littlearm_vec): Likewise.
1217         (bfd_elf32_bigarm_symbian_vec): Likewise.
1218         (bfd_elf32_littlearm_symbian_vec): Likewise.
1219         (bfd_elf32_bigarm_vxworks_vec): Likewise.
1220         (bfd_elf32_littlearm_vxworks_vec): Likewise.
1221         * configure: Regenerated.
1222
1223 2012-04-12  Tristan Gingold  <gingold@adacore.com>
1224
1225         * elflink.c (elf_link_output_extsym): Add a guard.
1226         (bfd_elf_final_link): Remove assertion.
1227         (bfd_elf_final_link): Add a guard.
1228         * elfnn-ia64.c (INCLUDE_IA64_VMS): Removed.
1229         (elfNN_vms_section_from_shdr, elfNN_vms_object_p)
1230         (elfNN_vms_post_process_headers, elfNN_vms_section_processing)
1231         (elfNN_vms_final_write_processing, elfNN_vms_close_and_cleanup):
1232         Remove.
1233         (elfNN-ia64-vms target): Move to ...
1234         * elf64-ia64-vms.c: New file.
1235         * configure.in (bfd_elf64_ia64_vms_vec): Add elf64-ia64-vms.lo
1236         * Makefile.am (BFD64_BACKENDS): Add elf64-ia64-vms.lo.
1237         (BFD64_BACKENDS_CFILES): Ad elf64-ia64-vms.c.
1238         * configure: Regenerate.
1239         * Makefile.in: Regenerate.
1240
1241 2012-04-11  Nick Clifton  <nickc@redhat.com>
1242
1243         PR binutils/13897
1244         * elf64-ppc.c (opd_entry_value): When dealing with sections
1245         without relocs, keep the last section loaded in order to avoid
1246         unnecessary reloads.
1247
1248 2012-04-09  Roland McGrath  <mcgrathr@google.com>
1249
1250         * elf.c (_bfd_elf_map_sections_to_segments): Set INFO->user_phdrs.
1251         * elf-nacl.c (nacl_modify_segment_map): Do nothing if INFO->user_phdrs.
1252         (nacl_modify_program_headers): Likewise.
1253
1254 2012-04-03  Roland McGrath  <mcgrathr@google.com>
1255
1256         * elf-nacl.c: New file.
1257         * elf-nacl.h: New file.
1258         * elf32-i386.c (elf_backend_modify_segment_map): Define for
1259         bfd_elf32_i386_nacl_vec.
1260         (elf_backend_modify_program_headers): Likewise.
1261         * elf64-x86-64.c (elf_backend_modify_segment_map): Define for
1262         bfd_elf64_x86_64_nacl_vec and bfd_elf32_x86_64_nacl_vec.
1263         (elf_backend_modify_program_headers): Likewise.
1264         * Makefile.am (BFD32_BACKENDS, BFD64_BACKENDS): Add elf-nacl.lo here.
1265         (BFD32_BACKENDS_CFILES, BFD64_BACKENDS_CFILES): Add elf-nacl.c here.
1266         * Makefile.in: Regenerated.
1267         * configure.in (bfd_elf64_x86_64_nacl_vec): Add elf-nacl.o to tb here.
1268         (bfd_elf32_x86_64_nacl_vec): Likewise.
1269         (bfd_elf64_x86_64_vec, bfd_elf32_x86_64_vec): Likewise.
1270         (bfd_elf64_x86_64_freebsd_vec, bfd_elf64_x86_64_sol2_vec): Likewise.
1271         (bfd_elf64_l1om_vec, bfd_elf64_l1om_freebsd_vec): Likewise.
1272         (bfd_elf64_k1om_vec, bfd_elf64_k1om_freebsd_vec): Likewise.
1273         (bfd_elf32_i386_nacl_vec): Likewise.
1274         (bfd_elf32_i386_sol2_vec, bfd_elf32_i386_freebsd_vec): Likewise.
1275         (bfd_elf32_i386_vxworks_vec, bfd_elf32_i386_vec): Likewise.
1276         * configure: Regenerated.
1277
1278 2012-03-31  Andreas Schwab  <schwab@linux-m68k.org>
1279
1280         * elf32-m68k.c (elf_m68k_relocate_section): Allow
1281         R_68K_TLS_LE{8,16,32} for PIE.
1282
1283 2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1284
1285         * elf64-s390.c: Fix several comments regarding PLT entry
1286         description.
1287         * elf32-s390.c: Likewise.
1288
1289 2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1290
1291         * elf64-s390.c: Use the section pointer shortcuts in
1292         elf_link_hash_table and remove them from the target specific
1293         variant.
1294         * elf32-s390.c: Likewise.
1295
1296 2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1297
1298         * elf64-s390.c (elf_s390x_plt_entry, elf_s390x_first_plt_entry):
1299         New definitions.
1300         (PLT_PIC_ENTRY_WORD*, PLT_PIC12_ENTRY_WORD*): Remove.
1301         (elf_s390_finish_dynamic_symbol): Use memcpy instead of bfd_put_32.
1302         (elf_s390_finish_dynamic_sections): Likewise.
1303         * elf32-s390.c (elf_s390_plt_entry, elf_s390_plt_pic_entry)
1304         (elf_s390_plt_pic12_entry, elf_s390_plt_pic16_entry)
1305         (elf_s390_plt_first_entry, elf_s390_plt_pic_first_entry): New definitions.
1306         (PLT_PIC16_ENTRY_WORD*, PLT_ENTRY_WORD*)
1307         (PLT_PIC_FIRST_ENTRY_WORD*, PLT_FIRST_ENTRY_WORD*): Remove.
1308
1309 2012-03-30  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1310
1311         * elf32-s390.c (struct elf_s390_dyn_relocs): Remove.
1312         Rename all occurrences in the file to elf_dyn_relocs.
1313         * elf64-s390.c: Likewise.
1314
1315 2012-03-30  Alan Modra  <amodra@gmail.com>
1316
1317         * elflink.c (_bfd_elf_gc_mark_reloc): Don't delve into dynamic
1318         libraries.
1319
1320 2012-03-29  Alan Modra  <amodra@gmail.com>
1321
1322         * bfd-in.h (bfd_get_arch_size, bfd_get_sign_extend_vma): Delete.
1323         * bfd-in2.h: Regenerate.
1324
1325 2012-03-23  Alan Modra  <amodra@gmail.com>
1326
1327         * elf.c (assign_file_positions_for_non_load_sections): Don't warn
1328         on empty alloc sections.
1329
1330 2012-03-23  Alan Modra  <amodra@gmail.com>
1331
1332         * linker.c (_bfd_nearby_section): New function, split out from..
1333         (fix_syms): ..here.
1334         * bfd-in.h (_bfd_nearby_section): Declare.
1335         * bfd-in2.h: Regenerate.
1336         * elflink.c (elf_link_input_bfd): Don't use text_index_section or
1337         data_index_section with ld -q or ld -r output relocs against
1338         stripped output sections.  Instead use _bfd_nearby_section.
1339
1340 2012-03-23  Alan Modra  <amodra@gmail.com>
1341
1342         PR binutils/13894
1343         * elf64-ppc.c (opd_entry_value): Read full symbol table when
1344         sym hashes unavailable.
1345
1346 2012-03-21  Eliot Dresselhaus  <eliot@sonic.net>
1347
1348         * elf32-tic6x.c (elf32_tic6x_merge_private_bfd_data): Return TRUE
1349         for non-C6X objects.
1350
1351 2012-03-20  Kai Tietz  <ktietz@redhat.com>
1352
1353         PR ld/12742
1354         * configure.in (AC_CHECK_HEADERS): Test for windows.h and dlfcn.h.
1355         * plugin.c: Guard include of dlfcn.h if HAVE_DLFCN_H is defined.
1356         Add windows.h header include if HAVE_WINDOWS_H is defined.
1357         (dlerror): New static function if windows variant is used instead
1358         of dlfcn.h.
1359         (dlclose): Likewise.
1360         (dlopen): Likewise.
1361         (dlsym): Likewise.
1362         * configure: Regenerated.
1363         * config.in: Regenerated.
1364
1365 2012-03-20  H.J. Lu  <hongjiu.lu@intel.com>
1366
1367         PR ld/13880
1368         * elf32-i386.c (elf_i386_relocate_section): Don't issue an error
1369         for R_386_GOTOFF relocation against protected function if
1370         SYMBOLIC_BIND is true.
1371
1372         * elf64-x86-64.c (elf_x86_64_relocate_section): Don't issue an
1373         error for R_X86_64_GOTOFF64 relocation against protected function
1374         when building executable or SYMBOLIC_BIND is true.
1375
1376 2012-03-16  Roland McGrath  <mcgrathr@google.com>
1377
1378         * config.bfd: Handle x86_64-*-nacl*.
1379         * elf64-x86-64.c (bfd_elf64_x86_64_nacl_vec): New backend vector stanza.
1380         (bfd_elf32_x86_64_nacl_vec): Likewise.
1381         * targets.c: Support them.
1382         * configure.in: Likewise.
1383         * configure: Regenerated.
1384
1385 2012-03-16  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1386
1387         * elf32-arm.c (elf32_arm_attributes_accept_div): New function.
1388         (elf32_arm_attributes_forbid_div): Likewise.
1389         (elf32_arm_merge_eabi_attributes): Correct handling of
1390         Tag_DIV_use.
1391
1392 2012-03-15  Roland McGrath  <mcgrathr@google.com>
1393
1394         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use
1395         elf_x86_64_backend_data parameters for plt_eh_frame.
1396
1397         * elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
1398         (get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
1399         (elf_x86_64_arch_bed): New variable.
1400         (elf_backend_arch_data): New macro.
1401         (elf_x86_64_adjust_dynamic_symbol): Use GET_PLT_ENTRY_SIZE.
1402         (elf_x86_64_allocate_dynrelocs): Likewise.
1403         (elf_x86_64_relocate_section): Likewise.
1404         (elf_x86_64_plt_sym_val): Likewise.
1405         (elf_x86_64_finish_dynamic_symbol): Use elf_x86_64_backend_data
1406         parameters for PLT details.
1407         (elf_x86_64_finish_dynamic_sections): Likewise.
1408
1409 2012-03-14  Roland McGrath  <mcgrathr@google.com>
1410
1411         * elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
1412         to the full size, padding out with nop instructions.
1413
1414 2012-03-12  Alan Modra  <amodra@gmail.com>
1415
1416         * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Don't warn
1417         on zero size dynbss symbol.
1418         * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
1419         * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
1420         * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
1421         * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
1422         * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
1423         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
1424         * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
1425         * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
1426         * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
1427         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
1428         * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
1429         * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
1430         * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
1431         * elf32-tilepro.c (tilepro_elf_adjust_dynamic_symbol): Likewise.
1432         * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
1433         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
1434         * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
1435         * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
1436         * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1437         * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
1438         * elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.
1439
1440 2012-03-10  Edmar Wienskoski  <edmar@freescale.com>
1441
1442         * archures.c: Add bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.
1443         * bfd-in2.h: Regenerate.
1444         * cpu-powerpc.c (bfd_powerpc_archs): Add entries for
1445         bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.
1446
1447 2012-03-09  H.J. Lu  <hongjiu.lu@intel.com>
1448
1449         PR ld/13817
1450         * elf32-i386.c (elf_i386_relocate_section): Restore
1451         R_386_IRELATIVE.
1452
1453         * elf64-x86-64.c (elf_x86_64_relocate_section): Restore
1454         R_X86_64_IRELATIVE.
1455
1456 2012-03-08  Tristan Gingold  <gingold@adacore.com>
1457
1458         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Set maximum
1459         keylen according to archive kind.  Set nextvbn and nextrfa lhd
1460         fields.  Add comments.
1461
1462 2012-03-07  Nick Clifton  <nickc@redhat.com>
1463
1464         * elf-m10300.c (elf32_mn10300_link_hash_entry): Add tls_type
1465         field.
1466         (elf32_mn10300_link_hash_table): Add tls_ldm_got entry;
1467         (elf_mn10300_tdata): Define.
1468         (elf_mn10300_local_got_tls_type): Define.
1469         (elf_mn10300_howto_table): Add entries for R_MN10300_TLS_GD,
1470         R_MN10300_TLS_LD, R_MN10300_TLS_LDO, R_MN10300_TLS_GOTIE,
1471         R_MN10300_TLS_IE, R_MN10300_TLS_LE, R_MN10300_TLS_DPTMOD,
1472         R_MN10300_TLS_DTPOFF, R_MN10300_TLS_TPOFF relocs.
1473         (mn10300_reloc_map): Likewise.
1474         (elf_mn10300_tls_transition): New function.
1475         (dtpoff, tpoff, mn10300_do_tls_transition): New functions.
1476         (mn10300_elf_check_relocs): Add TLS support.
1477         (mn10300_elf_final_link_relocate): Likewise.
1478         (mn10300_elf_relocate_section): Likewise.
1479         (mn10300_elf_relax_section): Likewise.
1480         (elf32_mn10300_link_hash_newfunc): Initialise new field.
1481         (_bfd_mn10300_copy_indirect_symbol): New function.
1482         (elf32_mn10300_link_hash_table_create): Initialise new fields.
1483         (_bfd_mn10300_elf_size_dynamic_sections): Add TLS support.
1484         (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
1485         (_bfd_mn10300_elf_reloc_type_class): Allocate an
1486         elf_mn10300_obj_tdata structure.
1487         (elf_backend_copy_indirect_symbol): Define.
1488         * reloc.c (BFD_MN10300_TLS_GD, BFD_MN10300_TLS_LD,
1489         BFD_MN10300_TLS_LDO, BFD_MN10300_TLS_GOTIE, BFD_MN10300_TLS_IE,
1490         BFD_MN10300_TLS_LE, BFD_MN10300_TLS_DPTMOD,
1491         BFD_MN10300_TLS_DTPOFF, BFD_MN10300_TLS_TPOFF): New relocations.
1492         (BFD_RELOC_MN10300_32_PCREL, BFD_RELOC_MN10300_16_PCREL): Move to
1493         alongside other MN10300 relocations.
1494         * bfd-in2.h: Regenerate.
1495         * libbfd.h: Regenerate.
1496
1497 2012-03-06  Jakub Jelinek  <jakub@redhat.com>
1498
1499         * elf64-x86-64.c (elf_x86_64_relocate_section): For R_X86_64_RELATIVE
1500         set relocate to TRUE.
1501
1502 2012-03-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1503
1504         PR ld/12152
1505         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Also ignore
1506         overflows for R_SPARC_UA32 in .stab sections.
1507
1508 2012-03-01  Alan Modra  <amodra@gmail.com>
1509
1510         * elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning.
1511
1512 2012-02-27  Alan Modra  <amodra@gmail.com>
1513
1514         * elf32-sh.c (sh_elf_osec_to_segment): Check for elf flavour bfd
1515         before calling elf specific function.
1516         (sh_elf_osec_readonly_p): Test for error return from above.
1517
1518 2012-02-27  Alan Modra  <amodra@gmail.com>
1519
1520         * elf32-spu.c (build_stub): Fix malloc under-allocation.
1521
1522 2012-02-25  Walter Lee  <walt@tilera.com>
1523         * reloc.c: Add BFD_RELOC_TILEPRO_TLS_GD_CALL,
1524         BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
1525         BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
1526         BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
1527         BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
1528         BFD_RELOC_TILEPRO_TLS_IE_LOAD, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
1529         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
1530         BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
1531         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
1532         BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
1533         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
1534         BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
1535         BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
1536         BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
1537         BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
1538         BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
1539         BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
1540         BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
1541         BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
1542         BFD_RELOC_TILEGX_TLS_GD_CALL, BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
1543         BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
1544         BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
1545         BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD, BFD_RELOC_TILEGX_TLS_IE_LOAD,
1546         BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
1547         BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
1548         BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD.
1549         Delete BFD_RELOC_TILEGX_IMM16_X0_HW1_GOT,
1550         BFD_RELOC_TILEGX_IMM16_X1_HW1_GOT,
1551         BFD_RELOC_TILEGX_IMM16_X0_HW2_GOT,
1552         BFD_RELOC_TILEGX_IMM16_X1_HW2_GOT,
1553         BFD_RELOC_TILEGX_IMM16_X0_HW3_GOT,
1554         BFD_RELOC_TILEGX_IMM16_X1_HW3_GOT,
1555         BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_GOT,
1556         BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_GOT,
1557         BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_GD,
1558         BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_GD,
1559         BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_GD,
1560         BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_GD,
1561         BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_GD,
1562         BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_GD,
1563         BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_GD,
1564         BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_GD,
1565         BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_IE,
1566         BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_IE,
1567         BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_IE,
1568         BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_IE,
1569         BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_IE,
1570         BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_IE,
1571         BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_IE,
1572         BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_IE.
1573         * elf32-tilepro.c (tilepro_elf_howto_table): Update tilepro
1574         relocations.
1575         (tilepro_reloc_map): Ditto.
1576         (tilepro_info_to_howto_rela): Ditto.
1577         (reloc_to_create_func): Ditto.
1578         (tilepro_tls_translate_to_le): New.
1579         (tilepro_tls_translate_to_ie): New.
1580         (tilepro_elf_tls_transition): New.
1581         (tilepro_elf_check_relocs): Handle new tls relocations.
1582         (tilepro_elf_gc_sweep_hook): Ditto.
1583         (allocate_dynrelocs): Ditto.
1584         (tilepro_elf_relocate_section): Ditto.
1585         (tilepro_replace_insn): New.
1586         (insn_mask_X1): New.
1587         (insn_mask_X0_no_dest_no_srca): New
1588         (insn_mask_X1_no_dest_no_srca): New
1589         (insn_mask_Y0_no_dest_no_srca): New
1590         (insn_mask_Y1_no_dest_no_srca): New
1591         (srca_mask_X0): New
1592         (srca_mask_X1): New
1593         (insn_tls_le_move_X1): New
1594         (insn_tls_le_move_zero_X0X1): New
1595         (insn_tls_ie_lw_X1): New
1596         (insn_tls_ie_add_X0X1): New
1597         (insn_tls_ie_add_Y0Y1): New
1598         (insn_tls_gd_add_X0X1): New
1599         (insn_tls_gd_add_Y0Y1): New
1600         * elfxx-tilegx.c (tilegx_elf_howto_table): Update tilegx
1601         relocations.
1602         (tilegx_reloc_map): Ditto.
1603         (tilegx_info_to_howto_rela): Ditto.
1604         (reloc_to_create_func): Ditto.
1605         (tilegx_elf_link_hash_table): New field disable_le_transition.
1606         (tilegx_tls_translate_to_le): New.
1607         (tilegx_tls_translate_to_ie): New.
1608         (tilegx_elf_tls_transition): New.
1609         (tilegx_elf_check_relocs): Handle new tls relocations.
1610         (tilegx_elf_gc_sweep_hook): Ditto.
1611         (allocate_dynrelocs): Ditto.
1612         (tilegx_elf_relocate_section): Ditto.
1613         (tilegx_copy_bits): New.
1614         (tilegx_replace_insn): New.
1615         (insn_mask_X1): New.
1616         (insn_mask_X0_no_dest_no_srca): New.
1617         (insn_mask_X1_no_dest_no_srca): New.
1618         (insn_mask_Y0_no_dest_no_srca): New.
1619         (insn_mask_Y1_no_dest_no_srca): New.
1620         (insn_mask_X0_no_operand): New.
1621         (insn_mask_X1_no_operand): New.
1622         (insn_mask_Y0_no_operand): New.
1623         (insn_mask_Y1_no_operand): New.
1624         (insn_tls_ie_ld_X1): New.
1625         (insn_tls_ie_ld4s_X1): New.
1626         (insn_tls_ie_add_X0X1): New.
1627         (insn_tls_ie_add_Y0Y1): New.
1628         (insn_tls_ie_addx_X0X1): New.
1629         (insn_tls_ie_addx_Y0Y1): New.
1630         (insn_tls_gd_add_X0X1): New.
1631         (insn_tls_gd_add_Y0Y1): New.
1632         (insn_move_X0X1): New.
1633         (insn_move_Y0Y1): New.
1634         (insn_add_X0X1): New.
1635         (insn_add_Y0Y1): New.
1636         (insn_addx_X0X1): New.
1637         (insn_addx_Y0Y1): New.
1638         * libbfd.h: Regenerate.
1639         * bfd-in2.h: Regenerate.
1640
1641 2012-02-25  Walter Lee  <walt@tilera.com>
1642
1643         * config.bfd (tilegx-*-*): rename little endian vector; add big
1644         endian vector.
1645         (tilegxbe-*-*): New case.
1646         * configure.in (bfd_elf32_tilegx_vec): Rename...
1647         (bfd_elf32_tilegx_le_vec): ... to this.
1648         (bfd_elf32_tilegx_be_vec): New vector.
1649         (bfd_elf64_tilegx_vec): Rename...
1650         (bfd_elf64_tilegx_le_vec): ... to this.
1651         (bfd_elf64_tilegx_be_vec): New vector.
1652         * configure: Regenerate.
1653         * elf32-tilegx.c (TARGET_LITTLE_SYM): Rename.
1654         (TARGET_LITTLE_NAME): Ditto.
1655         (TARGET_BIG_SYM): Define.
1656         (TARGET_BIG_NAME): Define.
1657         * elf64-tilegx.c (TARGET_LITTLE_SYM): Rename.
1658         (TARGET_LITTLE_NAME): Ditto.
1659         (TARGET_BIG_SYM): Define.
1660         (TARGET_BIG_NAME): Define.
1661         * targets.c (bfd_elf32_tilegx_vec): Rename...
1662         (bfd_elf32_tilegx_le_vec): ... to this.
1663         (bfd_elf32_tilegx_be_vec): Declare.
1664         (bfd_elf64_tilegx_vec): Rename...
1665         (bfd_elf64_tilegx_le_vec): ... to this.
1666         (bfd_elf64_tilegx_be_vec): Declare.
1667         (_bfd_target_vector): Add / rename above vectors.
1668         * arctures.c (bfd_architecture): Define bfd_mach_tilegx32.
1669         * bfd-in2.h: Regenerate.
1670         * cpu-tilegx.c (bfd_tilegx32_arch): define.
1671         (bfd_tilegx_arch): link to bfd_tilegx32_arch.
1672
1673 2012-02-24  Nick Clifton  <nickc@redhat.com>
1674
1675         PR ld/13730
1676         * reloc.c (bfd_generic_get_relocated_section_contents): Issue an
1677         error message instead of aborting, when an outofrange reloc is
1678         encountered.
1679
1680 2012-02-23  Iain Sandoe  <idsandoe@googlemail.com>
1681
1682         * mach-o.c (bfd_mach_o_swap_in_non_scattered_reloc): New.
1683         (bfd_mach_o_canonicalize_one_reloc):  Swap non-scattered reloc
1684         bit-fields when target and host differ in endian-ness.  When
1685         PAIRs are non-scattered find the 'symbol' from the preceding
1686         reloc.  Add FIXME re. reloc symbols on section boundaries.
1687         (bfd_mach_o_swap_out_non_scattered_reloc): New.
1688         (bfd_mach_o_write_relocs): Use bfd_mach_o_encode_non_scattered_reloc.
1689
1690 2012-02-17  Iain Sandoe  <idsandoe@googlemail.com>
1691
1692         * mach-o-i386.c (i386_howto_table): Add support for 16 bit
1693         sect-diffs.
1694         (bfd_mach_o_i386_swap_reloc_in): Handle 16bit sect-diffs.
1695         (bfd_mach_o_i386_swap_reloc_out): Likewise.
1696
1697 2012-02-17  Tristan Gingold  <gingold@adacore.com>
1698
1699         * reloc.c (BFD_RELOC_MACH_O_LOCAL_SECTDIFF):
1700         * libbfd.h: Regenerated.
1701         * bfd-in2.h: Likewise.
1702         * mach-o-i386.c (i386_howto_table): Include local sectdiff.
1703         (bfd_mach_o_i386_swap_reloc_in): Update for local sectdiff.
1704         (bfd_mach_o_i386_swap_reloc_out): Likewise.
1705
1706 2012-02-17  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1707
1708         * elf32-s390.c (elf_s390_relocate_section): Support basr in the
1709         GD->LE and LD->LE optimizations.
1710
1711 2012-02-16  Alan Modra  <amodra@gmail.com>
1712
1713         PR binutils/13355
1714         * elf32-rx.c (elf32_rx_relax_section): Correct width check.
1715
1716 2012-02-13  Richard Henderson  <rth@redhat.com>
1717
1718         PR ld/13621
1719         * linker.c (fix_syms): Force symbols outside any section into
1720         bfd_abs_section_ptr.
1721
1722 2012-02-13  Alan Modra  <amodra@gmail.com>
1723
1724         * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): New function.
1725         * elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Declare.
1726         * elf32-m68hc11.c (elf_backend_merge_symbol_attribute): Define.
1727         * elf32-m68hc12.c (elf_backend_merge_symbol_attribute): Define.
1728
1729 2012-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
1730             Nick Clifton  <nickc@redhat.com>
1731
1732         * oasys.c (oasys_write_header): Fix compilation warning on zero-sized
1733         memset.
1734
1735 2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
1736
1737         * mach-o.c (bfd_mach_o_build_seg_command): Count zerofill section
1738         vma additions in their logical, rather than physical order.
1739
1740 2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
1741
1742         * mach-o.c (mach_o_section_name_xlat): Correct eh-frame section
1743         parameters.
1744         * mach-o-x86-64.c (text_section_names_xlat): New.
1745         (mach_o_x86_64_segsec_names_xlat): New.
1746         (bfd_mach_o_tgt_seg_table): Define to mach_o_x86_64_segsec_names_xlat.
1747         * mach-o-i386.c (text_section_names_xlat): Correct section parameters.
1748
1749 2012-02-10  Tristan Gingold  <gingold@adacore.com>
1750
1751         * elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator
1752         to avoid infinite loop.  Add comments.
1753
1754 2012-02-09  H.J. Lu  <hongjiu.lu@intel.com>
1755
1756         PR ld/13675
1757         * cpu-i386.c (bfd_arch_i386_fill): Updated to support multi byte
1758         nop instructions.
1759         (bfd_arch_i386_short_nop_fill): New.
1760         (bfd_arch_i386_long_nop_fill): Likewise.
1761         Use bfd_arch_i386_short_nop_fill in 32bit bfd_arch_info
1762         initializers.  Use bfd_arch_i386_long_nop_fill on 64bit
1763         bfd_arch_info initializers.
1764
1765         * cpu-k1om.c (bfd_arch_i386_fill): Renamed to ...
1766         (bfd_arch_i386_short_nop_fill): This.
1767         Update bfd_arch_info initializers.
1768         * cpu-l1om.c: Likewise.
1769
1770 2012-02-08  Alan Modra  <amodra@gmail.com>
1771
1772         * elflink.c (_bfd_elf_gc_mark_rsec): Mark weakdef syms too.
1773         (_bfd_elf_fix_symbol_flags): When a weakdef is def_regular, clear
1774         the correct h->u.weakdef.
1775
1776 2012-02-07  Alan Modra  <amodra@gmail.com>
1777
1778         * elf.c (elf_find_function): Don't use internal_elf_sym.
1779         (_bfd_elf_maybe_function_sym): Likewise.  Replace elf_symbol_type
1780         parameter with asymbol.
1781         * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
1782         * elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype.
1783         (struct elf_backend_data <maybe_function_sym>): Likewise.
1784
1785 2012-02-02  Vidya Praveen (vidya.praveen@atmel.com)
1786
1787         PR bfd/13410
1788         * elf32-avr.c (elf32_avr_relax_section): Correct the
1789         condition that qualifies the candidates for relaxation.
1790
1791 2012-02-02  Tristan Gingold  <gingold@adacore.com>
1792
1793         * bfdio.c (real_fopen): Remove unused vms_modes variable.
1794
1795 2012-02-02  Tristan Gingold  <gingold@adacore.com>
1796
1797         * mach-o.c (bfd_mach_o_read_header): Silent uninitialized
1798         variable warning.
1799
1800 2012-02-02  Tristan Gingold  <gingold@adacore.com>
1801
1802         * archive.c (bfd_slurp_armap): Fix thinko in cast.
1803
1804 2012-01-31  H.J. Lu  <hongjiu.lu@intel.com>
1805
1806         PR ld/13616
1807         * archures.c (bfd_arch_info): Add fill.
1808         (bfd_default_arch_struct): Add bfd_arch_default_fill.
1809         (bfd_arch_default_fill): New.
1810
1811         * configure.in: Set bfd version to 2.22.52.
1812         * configure: Regenerated.
1813
1814         * cpu-alpha.c: Add bfd_arch_default_fill to bfd_arch_info
1815         initializer.
1816         * cpu-arc.c: Likewise.
1817         * cpu-arm.c: Likewise.
1818         * cpu-avr.c: Likewise.
1819         * cpu-bfin.c: Likewise.
1820         * cpu-cr16.c: Likewise.
1821         * cpu-cr16c.c: Likewise.
1822         * cpu-cris.c: Likewise.
1823         * cpu-crx.c: Likewise.
1824         * cpu-d10v.c: Likewise.
1825         * cpu-d30v.c: Likewise.
1826         * cpu-dlx.c: Likewise.
1827         * cpu-epiphany.c: Likewise.
1828         * cpu-fr30.c: Likewise.
1829         * cpu-frv.c: Likewise.
1830         * cpu-h8300.c: Likewise.
1831         * cpu-h8500.c: Likewise.
1832         * cpu-hppa.c: Likewise.
1833         * cpu-i370.c: Likewise.
1834         * cpu-i860.c: Likewise.
1835         * cpu-i960.c: Likewise.
1836         * cpu-ia64.c: Likewise.
1837         * cpu-ip2k.c: Likewise.
1838         * cpu-iq2000.c: Likewise.
1839         * cpu-lm32.c: Likewise.
1840         * cpu-m10200.c: Likewise.
1841         * cpu-m10300.c: Likewise.
1842         * cpu-m32c.c: Likewise.
1843         * cpu-m32r.c: Likewise.
1844         * cpu-m68hc11.c: Likewise.
1845         * cpu-m68hc12.c: Likewise.
1846         * cpu-m68k.c: Likewise.
1847         * cpu-m88k.c: Likewise.
1848         * cpu-mcore.c: Likewise.
1849         * cpu-mep.c: Likewise.
1850         * cpu-microblaze.c: Likewise.
1851         * cpu-mips.c: Likewise.
1852         * cpu-mmix.c: Likewise.
1853         * cpu-moxie.c: Likewise.
1854         * cpu-msp430.c: Likewise.
1855         * cpu-mt.c: Likewise.
1856         * cpu-ns32k.c: Likewise.
1857         * cpu-openrisc.c: Likewise.
1858         * cpu-or32.c: Likewise.
1859         * cpu-pdp11.c: Likewise.
1860         * cpu-pj.c: Likewise.
1861         * cpu-plugin.c: Likewise.
1862         * cpu-powerpc.c: Likewise.
1863         * cpu-rl78.c: Likewise.
1864         * cpu-rs6000.c: Likewise.
1865         * cpu-rx.c: Likewise.
1866         * cpu-s390.c: Likewise.
1867         * cpu-score.c: Likewise.
1868         * cpu-sh.c: Likewise.
1869         * cpu-sparc.c: Likewise.
1870         * cpu-spu.c: Likewise.
1871         * cpu-tic30.c: Likewise.
1872         * cpu-tic4x.c: Likewise.
1873         * cpu-tic54x.c: Likewise.
1874         * cpu-tic6x.c: Likewise.
1875         * cpu-tic80.c: Likewise.
1876         * cpu-tilegx.c: Likewise.
1877         * cpu-tilepro.c: Likewise.
1878         * cpu-v850.c: Likewise.
1879         * cpu-vax.c: Likewise.
1880         * cpu-w65.c: Likewise.
1881         * cpu-we32k.c: Likewise.
1882         * cpu-xc16x.c: Likewise.
1883         * cpu-xstormy16.c: Likewise.
1884         * cpu-xtensa.c: Likewise.
1885         * cpu-z80.c: Likewise.
1886         * cpu-z8k.c: Likewise.
1887
1888         * cpu-i386.c: Include "libiberty.h".
1889         (bfd_arch_i386_fill): New.
1890         Add bfd_arch_i386_fill to  bfd_arch_info initializer.
1891
1892         * cpu-k1om.c: Add bfd_arch_i386_fill to  bfd_arch_info initializer.
1893         * cpu-l1om.c: Likewise.
1894
1895         * linker.c (default_data_link_order): Call abfd->arch_info->fill
1896         if fill size is 0.
1897
1898         * bfd-in2.h: Regenerated.
1899
1900 2012-01-27  Michael Eager  <eager@eagercon.com>
1901
1902         * elf32-microblaze.c (create_got_section):
1903         Reuse existing .rela.got section.
1904
1905 2012-01-23  Alan Modra  <amodra@gmail.com>
1906
1907         * elf-bfd.h: Formatting.
1908         (struct elf_backend_data): Add "maybe_function_sym".
1909         (_bfd_elf_maybe_function_sym): Declare.
1910         * elfxx-target.h (elf_backend_maybe_function_sym): Define.
1911         (elfNN_bed): Init new field.
1912         * elf.c (elf_find_function): Use maybe_function_sym.
1913         (_bfd_elf_maybe_function_sym): New function.
1914         * elf64-ppc.c (elf_backend_maybe_function_sym): Define.
1915         (ppc64_elf_maybe_function_sym): New function.
1916
1917 2012-01-20  Francois Gouget  <fgouget@codeweavers.com>
1918
1919         PR binutils/13534
1920         * archive.c (_bfd_ar_sizepad): New function. Correctly install and
1921         pad the size field in an archive header.
1922         (_bfd_generic_read_ar_hdr_mag): Use the correct type and scan
1923         function for the archive size field.
1924         (bfd_generic_openr_next_archived_file): Likewise.
1925         (do_slurp_coff_armap): Likewise.
1926         (_bfd_write_archive_contents): Likewise.
1927         (_bfd_bsd44_write_ar_hdr): Use the new function.
1928         (bfd_ar_hdr_from_filesystem): Likewise.
1929         (_bfd_write_archive_contents): Likewise.
1930         (bsd_write_armap): Likewise.
1931         (coff_write_armap): Likewise.
1932         * archive64.c (bfd_elf64_archive_write_armap): Likewise.
1933         * bfdio.c (bfd_bread): Use correct type for archive element
1934         sizes.
1935         * ar.c (open_inarch): Likewise.
1936         (extract_file): Likewise.
1937         * libbfd-in.h (struct areltdata): Use correct types for
1938         parsed_size and extra_size fields.
1939         Prototype _bfd_ar_sizepad function.
1940         * libbfd.h: Regenerate.
1941
1942 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
1943
1944         * elf.c (elfcore_write_prpsinfo): Provide unconditionally.
1945         Return NULL if core file generation is unsupported.
1946         (elfcore_write_prstatus): Likewise.
1947         * elf32-arm.c (elf32_arm_nabi_write_core_note): New function.
1948         (elf_backend_write_core_note): Define.
1949
1950 2012-01-19  Tristan Gingold  <gingold@adacore.com>
1951
1952         * pef.c: Add a comment.
1953         * xsym.c: Likewise.
1954
1955 2012-01-17  Alan Modra  <amodra@gmail.com>
1956
1957         * elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave
1958         trailing garbage in the note.
1959         * elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise.
1960
1961 2012-01-16  Daniel Green  <venix1@gmail.com>
1962
1963         PR ld/13491
1964         * coff-i386.c (coff_i386_rtype_to_howto <R_SECREL32>): Test
1965         h->root.type not h->type.
1966         * coff-x86_64.c (coff_amd64_rtype_to_howto <R_AMD64_SECREL>): Likewise.
1967
1968 2012-01-13  Iain Sandoe  <idsandoe@googlemail.com>
1969
1970         * mach-o.c (bfd_mach_o_build_dysymtab_command): Handle absolute
1971         indirect symbols.
1972
1973 2012-01-13  Iain Sandoe  <idsandoe@googlemail.com>
1974
1975         * mach-o.c (bfd_mach_o_write_relocs): Move computation of relocs file
1976         position from here... to (bfd_mach_o_build_seg_command): Here.
1977
1978 2012-01-12  Iain Sandoe  <idsandoe@googlemail.com>
1979
1980         * mach-o.c (bfd_mach_o_count_indirect_symbols): New.
1981         (bfd_mach_o_build_dysymtab_command): Populate indirect symbol table.
1982         * mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the
1983         file. (bfd_mach_o_section): Add indirect_syms field.
1984
1985 2012-01-11  Iain Sandoe  <idsandoe@googlemail.com>
1986
1987         * mach-o.c (bfd_mach_o_build_seg_command): Separate computation of
1988         vmsize from filesize.  Don't compute offsets or file sizes for
1989         zerofill sections.
1990
1991 2012-01-11  Iain Sandoe  <idsandoe@googlemail.com>
1992
1993         * mach-o.c (bfd_mach_o_build_commands): Make the building of each
1994         command type independent.
1995
1996 2012-01-11  Alan Modra  <amodra@gmail.com>
1997
1998         * elf64-ppc.c: Define more insns used in plt call stubs.
1999         (ppc64_elf_brtaken_reloc): Assume isa version 2 or above.
2000         (ppc64_elf_relocate_section): Likewise.
2001         (enum ppc_stub_type): Add ppc_stub_plt_call_r2save.
2002         (struct ppc_link_hash_table): Increase size of stub_count array.
2003         Add plt_stub_align and plt_thread_safe.
2004         (ALWAYS_USE_FAKE_DEP, ALWAYS_EMIT_R2SAVE): Define.
2005         (plt_stub_size, plt_stub_pad): New functions.
2006         (build_plt_stub): Emit barriers for power7 thread safety.  Don't
2007         emit needless save of r2.
2008         (build_tls_get_addr_stub): Adjust params.
2009         (ppc_build_one_stub): Handle ppc_stub_plt_call_r2save and aligning
2010         plt stubs.  Adjust build_*plt_stub calls.
2011         (ppc_size_one_stub): Similarly.
2012         (ppc64_elf_size_stubs): Accept plt_thread_safe and plt_stub_align
2013         params.  Choose default for plt_thread_safe based on existence of
2014         calls to thread creation functions.  Modify plt_call to
2015         plt_call_r2save when no tocsave reloc found.  Align tail of stub
2016         sections.
2017         (ppc64_elf_build_stubs): Align tail of stub sections.  Adjust
2018         output of stub statistics.
2019         (ppc64_elf_relocate_section): Handle ppc_stub_plt_call_r2save.
2020         * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
2021
2022 2012-01-10  H.J. Lu  <hongjiu.lu@intel.com>
2023
2024         PR ld/13581
2025         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove ABI_64_P
2026         check on R_X86_64_PCXX.
2027
2028 2012-01-10  Tristan Gingold  <gingold@adacore.com>
2029
2030         * mach-o.c (bfd_mach_o_build_commands): Avoid uninitialized false
2031         warning.
2032
2033 2012-01-10  Tristan Gingold  <gingold@adacore.com>
2034
2035         * bfdio.c (bfd_tell): Handle nested archives.
2036         (bfd_seek): Ditto.
2037         * cache.c (bfd_cache_lookup_worker): Ditto.
2038         * archive.c (_bfd_get_elt_at_filepos): Remove code dealing with
2039         nested archives.
2040         (bfd_generic_openr_next_archived_file): Likewise.
2041
2042 2012-01-09  Iain Sandoe  <idsandoe@googlemail.com>
2043
2044         * mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement.
2045         (bfd_mach_o_write_symtab): Remove handling for indirect syms.
2046         (bfd_mach_o_primary_symbol_sort_key): Likewise.
2047         (bfd_mach_o_cf_symbols): Likewise.
2048         (bfd_mach_o_sort_symbol_table): Remove.
2049         (bfd_mach_o_mangle_symbols): Adjust arguments, remove handling
2050         for indirect and dysymtab counts.  Do the symbol sorting here.
2051         (bfd_mach_o_build_dysymtab_command): Count the symbol types here.
2052         Make the indirect symbols a TODO.
2053         (bfd_mach_o_build_commands): Adjust call to bfd_mach_o_mangle_symbols.
2054         (bfd_mach_o_make_empty_symbol): Specifically flag unset symbols with
2055         a non-zero value.
2056         (bfd_mach_o_read_symtab_symbol): Record the symbol index.
2057         (bfd_mach_o_read_symtab_symbol): Adjust recording of global status.
2058         * mach-o.h (mach_o_data_struct): Remove indirect and dysymtab entries.
2059         (IS_MACHO_INDIRECT): Remove.
2060         (SYM_MACHO_FIELDS_UNSET, SYM_MACHO_FIELDS_NOT_VALIDATED): New.
2061
2062 2012-01-06  Nick Clifton  <nickc@redhat.com>
2063
2064         PR binutils/13121
2065         * reloc.c (bfd_generic_lookup_section_flags): Rename 'finfo' to
2066         'flaginfo' to avoid conflicts with AIX system headers.
2067
2068 2012-01-06  Tristan Gingold  <gingold@adacore.com>
2069
2070         * bfdio.c (bfd_bread): Use arelt_size macro.
2071
2072 2012-01-06  Tristan Gingold  <gingold@adacore.com>
2073
2074         * config.bfd (i[3-7]86-*-darwin*): Define targ64_selvecs.
2075
2076 2012-01-05  Nick Clifton  <nickc@redhat.com>
2077
2078         PR ld/12161
2079         * elf32-avr.c (elf32_avr_relax_delete_bytes): Read in relocs if
2080         necessary.
2081
2082 2012-01-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
2083
2084         Fix zero registers core files when built by gcc-4.7.
2085         * elf64-x86-64.c (elf_x86_64_write_core_note): Remove variables p and
2086         size.  Call elfcore_write_note for the local variables.  Remove the
2087         final elfcore_write_note call.  Add NOTREACHED comments.
2088
2089 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2090
2091         * mach-o.c (bfd_mach_o_fat_stat_arch_elt): New function.
2092         (bfd_mach_o_generic_stat_arch_elt): Adjust.
2093
2094 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2095
2096         * mach-o.c (bfd_mach_o_fat_member_init): New function.
2097         (bfd_mach_o_openr_next_archived_file): Reindent.
2098         Adjust to call bfd_mach_o_fat_member_init.
2099         (bfd_mach_o_fat_extract): Adjust to call bfd_mach_o_fat_member_init.
2100
2101 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2102
2103         * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle
2104         BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1,
2105         BFD_RELOC_MACH_O_X86_64_PCREL32_2,
2106         BFD_RELOC_MACH_O_X86_64_PCREL32_4,
2107         BFD_RELOC_MACH_O_X86_64_BRANCH32,
2108         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
2109         BFD_RELOC_MACH_O_X86_64_GOT.
2110
2111 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2112
2113         * mach-o.h (bfd_mach_o_fvmlib_command): New structure.
2114         (bfd_mach_o_load_command): Add fvmlib field.
2115
2116         * mach-o.c (bfd_mach_o_read_fvmlib): New function.
2117         (bfd_mach_o_read_command): Handle fvmlib.
2118
2119 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2120
2121         * mach-o.c (bfd_mach_o_convert_architecture): Reindent.
2122         Decode msubtype for ARM.
2123
2124 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2125
2126         * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add comments.
2127
2128 2012-01-04  Tristan Gingold  <gingold@adacore.com>
2129
2130         * mach-o.h: Reindent header.
2131         (bfd_mach_o_encryption_info_command): New structure.
2132         (bfd_mach_o_load_command): Add encryption_info field.
2133
2134         * mach-o.c (bfd_mach_o_read_encryption_info): New function.
2135         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO.
2136         (bfd_mach_o_read_command): Adjust error message.
2137
2138 2012-01-04  Shinichiro Hamaji  <shinichiro.hamaji@gmail.com>
2139
2140         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Factor out the part
2141         which reads DWARF2 and stores in stash from find_line.
2142         (find_line) Call _bfd_dwarf2_slurp_debug_info.
2143         * libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Add declaration.
2144         * libbfd.h (_bfd_dwarf2_slurp_debug_info): Regenerate.
2145         * mach-o.c (dsym_subdir): The name of subdir where debug
2146         information may be stored.
2147         (bfd_mach_o_lookup_uuid_command): New. Lookup a load command whose
2148         type is UUID.
2149         (bfd_mach_o_dsym_for_uuid_p): New. Check if the specified BFD is
2150         corresponding to the executable.
2151         (bfd_mach_o_find_dsym): New. Find a debug information BFD in the
2152         specified binary file.
2153         (bfd_mach_o_follow_dsym): New. Find a debug information BFD for
2154         the original BFD.
2155         (bfd_mach_o_find_nearest_line): Check dSYM files for Mach-O
2156         executables, dylibs, and bundles.
2157         (bfd_mach_o_close_and_cleanup): Clean up BFDs for the dSYM file.
2158         * mach-o.h (dsym_bfd): The BFD of the dSYM file.
2159
2160 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
2161
2162         * mach-o.c (bfd_mach_o_mangle_symbols): Put in the section index
2163         for stabd symbols.
2164         (bfd_mach_o_primary_symbol_sort_key): Adjust for stabs.
2165         (bfd_mach_o_cf_symbols): Likewise.
2166
2167 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
2168
2169         * mach-o.c (bfd_mach_o_mangle_symbols): Correct typo.
2170
2171 2012-01-03  Iain Sandoe  <idsandoe@googlemail.com>
2172
2173         * mach-o.c (bfd_mach_o_write_symtab): Fill in the string table index
2174         as the value of an indirect symbol.  Keep the string table index in
2175         non-indirect syms for reference.
2176         (bfd_mach_o_write_dysymtab): New.
2177         (bfd_mach_o_primary_symbol_sort_key): New.
2178         (bfd_mach_o_cf_symbols): New.
2179         (bfd_mach_o_sort_symbol_table): New.
2180         (bfd_mach_o_mangle_symbols): Return early if no symbols.  Sort symbols.
2181         If we are emitting a dysymtab, process indirect symbols and count the
2182         number of each other kind.
2183         (bfd_mach_o_mangle_sections): New.
2184         (bfd_mach_o_write_contents): Split out some pre-requisite code into
2185         the command builder. Write dysymtab if the command is present.
2186         (bfd_mach_o_count_sections_for_seg): New.
2187         (bfd_mach_o_build_seg_command): New.
2188         (bfd_mach_o_build_dysymtab_command): New.
2189         (bfd_mach_o_build_commands): Reorganize to support the fact that some
2190         commands are optional and should not be emitted if there are no
2191         sections or symbols.
2192         (bfd_mach_o_set_section_contents): Amend comment.
2193         * mach-o.h: Amend and add to comments.
2194         (mach_o_data_struct): Add fields for dysymtab symbols counts and a
2195         pointer to the indirects, when present.
2196         (bfd_mach_o_should_emit_dysymtab): New macro.
2197         (IS_MACHO_INDIRECT): Likewise.
2198
2199 For older changes see ChangeLog-2011
2200 \f
2201 Local Variables:
2202 mode: change-log
2203 left-margin: 8
2204 fill-column: 74
2205 version-control: never
2206 End: