Ignore references with relocs to discarded sections in .data.rel.ro.local on hppa...
[external/binutils.git] / bfd / ChangeLog
1 2015-10-11  John David Anglin  <danglin@gcc.gnu.org>
2
3         * elf-hppa.h (elf_hppa_action_discarded): Ignore relocations in
4         .data.rel.ro.local.
5
6 2015-10-07  Cupertino Miranda  <cmiranda@synopsys.com>
7
8         * archures.c: Remove support for older ARC. Added support for new
9         ARC cpus (ARC600, ARC601, ARC700, ARCV2).
10         * bfd-in2.h: Likewise.
11         * config.bfd: Likewise.
12         * cpu-arc.c: Likewise.
13         * elf32-arc.c: Totally changed file with a refactored
14         inplementation of the ARC port.
15         * libbfd.h: Added ARC specific relocation types.
16         * reloc.c: Likewise.
17
18 2015-10-06  H.J. Lu  <hongjiu.lu@intel.com>
19
20         * bfd.c (bfd_update_compression_header): Clear the ch_reserved
21         field in 64-bit output.
22         (bfd_convert_section_contents): Likewise.
23
24 2015-10-05  H.J. Lu  <hongjiu.lu@intel.com>
25
26         PR ld/18914
27         * elflink.c (elf_link_add_object_symbols): Don't re-export a
28         symbol if it isn't undefined.
29
30 2015-10-04  H.J. Lu  <hongjiu.lu@intel.com>
31
32         * config.bfd (targ_selvecs, targ64_selvecs): Add iamcu_elf32_vec,
33         i386_pei_vec and x86_64_pei_vec for Solaris2/x86.
34
35 2015-10-02  Renlin Li  <renlin.li@arm.com>
36
37         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Add
38         TLSIE_MOVW_GOTTPREL_G1.
39         (aarch64_tls_transition_without_check): Add
40         TLSIE_MOVW_GOTTPREL_G1 to TLSLE_MOVW_TPREL_G2
41         transition for local symbol.
42         (elfNN_aarch64_tls_relax): Add a argument to pass tp offset.
43         Add TLSIE_MOVW_GOTTPREL_G1 relaxation.
44         (elfNN_aarch64_relocate_section): Call elfNN_aarch64_tls_relax
45         with new argument.
46
47 2015-10-02  Renlin Li  <renlin.li@arm.com>
48
49         * elfnn-aarch64.c (aarch64_tls_transition_without_check):  Add
50         relax transitions for TLSDESC_ADD, TLSDESC_LDR, TLSDESC_OFF_G0_NC,
51         TLSDESC_OFF_G1.
52         (aarch64_tls_transition_without_check): Add relaxation support.
53         (aarch64_reloc_got_type): Add support.
54         (elfNN_aarch64_final_link_relocate): Likewise.
55         (elfNN_aarch64_tls_relax): Likewise.
56         (elfNN_aarch64_relocate_section): Likewise.
57         (elfNN_aarch64_gc_sweep_hook): Likewise.
58         (elfNN_aarch64_check_relocs): Likewise.
59         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
60         (_bfd_aarch64_elf_resolve_relocation): Likewise.
61
62 2015-10-02  Renlin Li  <renlin.li@arm.com>
63
64         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Check overflow for
65         BFD_RELOC_AARCH64_TLSDESC_OFF_G1.
66
67 2015-10-02  Renlin Li  <renlin.li@arm.com>
68
69         * elfnn-aarch64.c(IS_AARCH64_TLS_RELAX_RELOC):
70         Add relaxation support for TLSGD_MOVW_G0_NC and TLSGD_MOVW_G1.
71         (aarch64_tls_transition_without_check): Likewise
72         (elfNN_aarch64_tls_relax): Likwise.
73
74 2015-10-02  Renlin Li  <renlin.li@arm.com>
75
76         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Create GOT section
77         for TLSLE_MOVW_TPREL_G(1, 1_NC, 2) relocation.
78
79 2015-10-02  Renlin Li  <renlin.li@arm.com>
80
81         * reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
82         AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
83         * libbfd.h: Regenerate.
84         * bfd-in2.h: Likewise.
85         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
86         TLSIE_MOVW_GOTTPREL_G1 check overflow.
87         (aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
88         and TLSIE_MOVW_GOTTPREL_G0_NC.
89         (elfNN_aarch64_final_link_relocate): Likewise.
90         (elfNN_aarch64_relocate_section): Likewise.
91         (elfNN_aarch64_gc_sweep_hook): Likewise.
92         (elfNN_aarch64_check_relocs): Likewise.
93         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
94         (_bfd_aarch64_elf_resolve_relocation): Likewise.
95
96 2015-10-02  Renlin Li  <renlin.li@arm.com>
97
98         * elfnn-aarch64.c (aarch64_reloc_got_type): Add
99         BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support.
100         (elfNN_aarch64_final_link_relocate): Likewise.
101         (elfNN_aarch64_relocate_section): Likewise.
102         (elfNN_aarch64_gc_sweep_hook): Likewise.
103         (elfNN_aarch64_check_relocs): Likewise.
104         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
105         (_bfd_aarch64_elf_resolve_relocation): Likewise.
106
107 2015-10-02  Renlin Li  <renlin.li@arm.com>
108
109         * reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC): New entry.
110         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
111         BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC.
112         * libbfd.h: Regenerate.
113         * bfd-in2.h: Likewise
114
115 2015-10-02  Renlin Li  <renlin.li@arm.com>
116
117         * elfnn-aarch64.c (aarch64_reloc_got_type): Add
118         BFD_RELOC_AARCH64_TLSGD_MOVW_G1 support.
119         (elfNN_aarch64_final_link_relocate): Likewise.
120         (elfNN_aarch64_relocate_section): Likewise.
121         (elfNN_aarch64_gc_sweep_hook): Likewise.
122         (elfNN_aarch64_check_relocs): Likewise.
123         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
124         (_bfd_aarch64_elf_resolve_relocation): Likewise.
125
126 2015-10-02  Renlin Li  <renlin.li@arm.com>
127
128         * reloc.c (BFD_RELOC_AARCH64_TLSGD_MOVW_G1): New entry.
129         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
130         BFD_RELOC_AARCH64_TLSGD_MOVW_G1.
131         * bfd-in2.h: Regenerate.
132         * libbfd.h: Likewise.
133
134 2015-10-02  Renlin Li  <renlin.li@arm.com>
135
136         * elfnn-aarch64.c (aarch64_reloc_got_type): Add
137         BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC support.
138         (elfNN_aarch64_final_link_relocate): Likewise.
139         (elfNN_aarch64_gc_sweep_hook): Likewise.
140         (elfNN_aarch64_check_relocs): Likewise.
141         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
142         (_bfd_aarch64_elf_resolve_relocation): Likewise.
143
144 2015-10-02  Renlin Li  <renlin.li@arm.com>
145
146         * reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC): New.
147         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry
148         MOVW_GOTOFF_G0_NC.
149         * libbfd.h: Regnerate.
150         * bfd-in2.h: Regenerate.
151
152 2015-10-02  Renlin Li  <renlin.li@arm.com>
153
154         * elfnn-aarch64.c (aarch64_reloc_got_type): Add support
155         for BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
156         (elfNN_aarch64_gc_sweep_hook): Likewise.
157         (elfNN_aarch64_check_relocs): Likewise
158         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
159         (_bfd_aarch64_elf_resolve_relocation): Likewise
160         (elfNN_aarch64_final_link_relocate): Likewise
161
162 2015-010-02  Renlin Li  <renlin.li@arm.com>
163
164         * reloc.c (BFD_RELOC_AARCH64_MOVW_GOTOFF_G1): New.
165         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
166         MOVW_GOTOFF_G1.
167         * libbfd.h: Regenerate.
168         * bfd-in2.h: Regenerate.
169
170 2015-10-02  Renlin Li  <renlin.li@arm.com>
171
172         * elfnn-aarch64.c (aarch64_reloc_got_type): Add
173         BFD_RELOC_AARCH64_LD_64_GOTOFF_LO15 support.
174         (elfNN_aarch64_gc_sweep_hook): Likewise.
175         (elfNN_aarch64_check_relocs): Likewise
176         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
177         (_bfd_aarch64_elf_resolve_relocation): Likewise
178         (elfNN_aarch64_final_link_relocate): Calculate offset within GOT.
179
180 2015-10-02  Renlin Li  <renlin.li@arm.com>
181
182         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Change if to
183         switch statement.
184
185 2015-10-01  H.J. Lu  <hongjiu.lu@intel.com>
186
187         PR ld/19031
188         * elf64-x86-64.c (elf_x86_64_check_relocs): Set
189         pointer_equality_needed for R_X86_64_PC32 reloc in non-code
190         sections.
191
192 2015-10-01  Renlin Li  <renlin.li@arm.com>
193
194         * elfnn-aarch64.c (elfNN_aarch64_output_plt_map): Remove.
195         (elfNN_aarch64_output_arch_local_syms): Emit AARCH64_MAP_INSN once.
196
197 2015-10-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
198
199         * config.bfd (targ_selvecs): Remove sh_elf32_vec and
200         sh_elf32_le_vec from sh*-*-linux cases.
201
202 2015-10-01  Alan Modra  <amodra@gmail.com>
203
204         PR ld/19013
205         * elflink.c (_bfd_elf_merge_sections): Revert last change.
206
207 2015-09-30  H.J. Lu  <hongjiu.lu@intel.com>
208
209         PR ld/19031
210         * elf32-i386.c (elf_i386_check_relocs): Set
211         pointer_equality_needed for R_386_PC32 reloc in non-code
212         sections.
213
214 2015-09-30  H.J. Lu  <hongjiu.lu@intel.com>
215
216         PR ld/19013
217         * elflink.c (_bfd_elf_merge_sections): Only merge input bfds
218         that have the compatible ELF machine code with the output bfd.
219
220 2015-09-30  Alan Modra  <amodra@gmail.com>
221
222         PR ld/19013
223         * elflink.c (_bfd_elf_merge_sections): Only merge input bfds that
224         will be handled by elf_link_input_bfd.  Rename abfd param to obfd.
225
226 2015-09-30  Rich Felker  <dalias@libc.org>
227
228         * config.bfd (targ_selvecs): Add fdpic and misc targets
229         for sh*-*-linux*.
230
231 2015-09-29  Andrew Stubbs  <ams@codesourcery.com>
232             H.J. Lu  <hongjiu.lu@intel.com>
233
234         PR binutils/19020
235         * bfd.c (bfd_convert_section_contents): Add ptr_size parameter.
236         * bfd-in2.h: Regenerated.
237
238 2015-08-11  Peter Zotov  <whitequark@whitequark.org>
239
240         PR ld/18759
241         * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
242         (R_OR1K_16_PCREL): Likewise.
243         (R_OR1K_8_PCREL): Likewise.
244
245 2015-09-23  Nick Clifton  <nickc@redhat.com>
246
247         * bout.c (b_out_slurp_reloc_table): Cast constant to unsigned in
248         order to avoid problems with left shifting negative values.
249         (abs32code): Likewise.
250         * mach-o.c (FILE_ALIGN): Likewise.
251         * coff-rs6000.c (xcoff_debug_sections): Delete unused static
252         array.
253         * elf32-visium.c (visium_reloc_map): Likewise.
254         * elf32-arm.c (elf32_arm_final_link_relocate): Remove useless
255         calls to abs function.
256         * elf32-frv.c (_frvfdpic_relax_tls_entries): Likewise.
257         * elf32-score.c (score_elf_final_link_relocate): Likewise.
258         * elf32-score7.c (score_elf_final_link_relocate): Likewise.
259         * elf32-i860.c (i860_howto_pc26_reloc): Use multiplication instead
260         of shifting to create a negative mask.
261         * elf32-msp430.c (elf_backend_special_sections): Define.
262         * elfxx-mips.c (got_ofst_reloc_p): Delete unused function.
263         (got_hi16_reloc_p): Delete unused function.
264         * ppcboot.c (ppcboot_bfd_print_private_bfd_data): Fix test of
265         partition name.
266
267 2015-09-23  Nick Clifton  <nickc@redhat.com>
268
269         PR binutils/15835
270         * elf-bfd.h (struct elf_section_list): New structure.
271         (struct elf_obj_tdata): Replace symtab_shndx_hdr with
272         symtab_shndx_list.  Delete symtab_shndx_section.
273         (elf_symtab_shndx): Replace macro with elf_symtab_shndx_list.
274         * elf.c (bfd_elf_get_syms): If symtab index sections are present,
275         scan them for the section that matches the provided symbol table.
276         (bfd_section_from_shdr): Record all SHT_SYMTAB_SHNDX sections.
277         (assign_section_numbers): Use the first symtab index table in the
278         list.
279         (_bfd_elf_compute_section_file_positions): Replace use of
280         symtab_shndx_hdr with use of symtab_shndx_list.
281         (find_section_in_list): New function.
282         (assign_file_postions_except_relocs): Use new function.
283         (_bfd_elf_copy_private_symbol_data): Likewise.
284         (swap_out_syms): Handle multiple symbol table index sections.
285         * elf32-m32c.c (m32c_elf_relax_section): Replace use of
286         symtab_shndx_hdr with use of symtab_shndx_list.
287         * elf32-rl78.c (rl78_elf_relax_section): Likewise.
288         * elf32-rx.c (rx_relax_section): Likewise.
289         * elf32-v850.c (v850_elf_relax_delete_bytes): Likewise.
290         * elflink.c (bfd_elf_final_link): Likewise.
291
292 2015-09-21  H.J. Lu  <hongjiu.lu@intel.com>
293
294         * bfd.c (bfd_update_compression_header): Use bfd_put_32 on
295         ch_type.
296         (bfd_check_compression_header): Use bfd_get_32 on ch_type.
297         (bfd_convert_section_contents): Use bfd_get_32 and bfd_put_32
298         on ch_type.
299
300 2015-09-20  Rich Felker  <dalias@libc.org>
301
302         * elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create
303         .interp when info->nointerp.
304         (bfd_elf_size_dynamic_sections): Adjust assert.
305         * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't size .interp
306         when info->nointerp.
307         * elf32-bfin.c (elf32_bfinfdpic_size_dynamic_sections): Likewise.
308         * elf32-cr16.c (_bfd_cr16_elf_size_dynamic_sections): Likewise.
309         * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise.
310         * elf32-frv.c (elf32_frvfdpic_size_dynamic_sections): Likewise.
311         * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise.
312         * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
313         * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
314         * elf32-lm32.c (lm32_elf_size_dynamic_sections): Likewise.
315         * elf32-m32r.c (m32r_elf_size_dynamic_sections): Likewise.
316         * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
317         * elf32-metag.c (elf_metag_size_dynamic_sections): Likewise.
318         * elf32-nds32.c (nds32_elf_size_dynamic_sections): Likewise.
319         * elf32-nios2.c (nios2_elf32_size_dynamic_sections): Likewise.
320         * elf32-or1k.c (or1k_elf_size_dynamic_sections): Likewise.
321         * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
322         * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise.
323         * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
324         * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
325         * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise.
326         * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Likewise.
327         * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Likewise.
328         * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise.
329         * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise.
330         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
331         * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
332         * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Likewise.
333         * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise.
334         * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
335         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
336         * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Likewise.
337         * elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise.
338         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
339         * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
340         * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): Likewise.
341
342 2015-09-18  Doug Evans  <xdje42@gmail.com>
343
344         * targets.c (enum bfd_flavour): Add comment.
345         (bfd_flavour_name): New function.
346         * bfd-in2.h: Regenerate.
347
348 2015-09-18  Alan Modra  <amodra@gmail.com>
349
350         * elf64-ppc.h (struct ppc64_elf_params <tls_get_addr_opt>): Rename
351         from no_tls_get_addr_opt.
352         * elf64-ppc.c: Update for rename and inversion of tls_get_addr_opt.
353         (ppc64_elf_tls_setup): Set tls_get_addr_opt to 0 only when at
354         default of -1.
355
356 2015-09-17  Alan Modra  <amodra@gmail.com>
357
358         PR 18867
359         * elflink.c (elf_link_adjust_relocs): Correct start of insertion
360         sort main loop.
361
362 2015-09-16  Alan Modra  <amodra@gmail.com>
363
364         PR 18867
365         * elflink.c (elf_link_adjust_relocs): Modify insertion sort to
366         insert a run.  Return status in case of malloc failure.
367         Adjust callers.
368
369 2015-09-15  Max Filippov  <jcmvbkbc@gmail.com>
370
371         * elf32-xtensa.c (elf_xtensa_be_plt_entry)
372         (elf_xtensa_le_plt_entry): Emit 'entry' instruction only for
373         windowed ABI.
374         (elf_xtensa_create_plt_entry): Generate 'l32r' offsets and fix
375         up instructions according to ABI.
376
377 2015-09-14  Rich Felker  <dalias@libc.org>
378
379         * elf32-sh.c (sh_elf_relocate_section): Set EF_SH_PIC flag
380         instead of clearing it on cross-section relocations.
381         (sh_elf_merge_private_data): Clear EF_SH_PIC flag by default.
382
383 2015-09-12  Helge Deller  <deller@gmx.de>
384
385         PR ld/18514
386         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Set .plt entry
387         size to 0.
388
389 2015-09-09  Jiong Wang  <jiong.wang@arm.com>
390
391         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Sort alphabetically.
392
393 2015-09-09  Jiong Wang  <jiong.wang@arm.com>
394
395         * elfnn-aarch64.c (aarch64_tls_transition_without_check): Support three
396         TLS local dynamic traditional relocations types.
397         (elfNN_aarch64_tls_relax): Support TLS local dynamic traditional to
398         local executable relaxation.
399
400 2015-09-03  H.J. Lu  <hongjiu.lu@intel.com>
401
402         * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Remove
403         convert_mov_to_lea.
404
405 2015-09-02  H.J. Lu  <hongjiu.lu@intel.com>
406
407         * elf32-i386.c (R_386_irelative): Renamed to ...
408         (R_386_ext2): This.
409         (R_386_vt_offset): Updated.
410         (elf_i386_rtype_to_howto): Likewise.
411         (elf_i386_relocate_section): Likewise.
412
413 2015-09-01  H.J. Lu  <hongjiu.lu@intel.com>
414
415         PR ld/18900
416         * elf32-i386.c (elf_i386_link_hash_entry): Add
417         func_pointer_refcount.
418         (elf_i386_link_hash_newfunc): Clear func_pointer_refcount.
419         (elf_i386_get_local_sym_hash): Likewise.
420         (elf_i386_copy_indirect_symbol): Also copy
421         func_pointer_refcount.
422         (elf_i386_check_relocs): Increment func_pointer_refcount.
423         (elf_i386_gc_sweep_hook): Decrement func_pointer_refcount.
424         (elf_i386_allocate_dynrelocs): Don't create the PLT entry if
425         there are only function pointer relocations which can be
426         resolved at run-time.  Keep dynanamic relocations for run-time
427         function pointer initialization.
428         (elf_i386_relocate_section): Copy dynamic function pointer
429         relocations.
430         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
431         func_pointer_refcount.
432         (elf_x86_64_link_hash_newfunc): Clear func_pointer_refcount.
433         (elf_x86_64_get_local_sym_hash): Likewise.
434         (elf_x86_64_copy_indirect_symbol): Also copy
435         func_pointer_refcount.
436         (elf_x86_64_check_relocs): Increment func_pointer_refcount.
437         (elf_x86_64_gc_sweep_hook): Decrement func_pointer_refcount.
438         (elf_x86_64_allocate_dynrelocs): Don't create the PLT entry if
439         there are only function pointer relocations which can be
440         resolved at run-time.  Keep dynanamic relocations for run-time
441         function pointer initialization.
442         (elf_x86_64_relocate_section): Copy dynamic function pointer
443         relocations.
444
445 2015-09-01  Alan Modra  <amodra@gmail.com>
446
447         * elf64-ppc.c (ppc64_elf_maybe_function_sym): Adjust symbol value
448         if .opd section has been edited.
449
450 2015-09-01  Alan Modra  <amodra@gmail.com>
451
452         PR 18878
453         * elf64-ppc.c (ARRAY_SIZE): Define.  Use throughout.
454         (enum ppc_stub_type): Add ppc_stub_save_res.
455         (struct map_stub): Add "next" and "needs_save_res".
456         (struct ppc_link_hash_entry): Add "save_res" flag.
457         (struct ppc_link_hash_table): Add "group".
458         (sfpr_define): Add stub_sec param.  Define symbol in stub_sec if
459         stub_sec is non-null.  Set "save_res".
460         (save_res_funcs): Make file scope, rename from funcs.  Adjust uses.
461         (ppc64_elf_adjust_dynamic_symbol): Prohibit plt call to save_res syms.
462         (ppc_build_one_stub): Handle ppc_stub_save_res.
463         (ppc_size_one_stub): Set stub type to ppc_size_one_stub on finding
464         stub for linker defined save_res sym.
465         (group_sections): Init new fields of struct map_stub.
466         (ppc64_elf_size_stubs): Reserve space for save/restore func copy.
467         (ppc64_elf_build_stubs): Copy save/restore funcs to groups.  Emit
468         alias syms too.
469         (ppc64_elf_relocate_section): Set destination for ppc_stub_save_res.
470
471 2015-08-31  Alan Modra  <amodra@gmail.com>
472
473         * elf64-ppc.c (get_r2off): Return -1 on error.
474         (ppc_build_one_stub): Adjust for get_r2off change.  Don't emit
475         addi r2,r2,0 on r2off stubs when the low 16-bit delta is zero.
476         (ppc_size_one_stub): Corresponding size changes for r2off stubs.
477         Add condition in test for -R objects.
478
479 2015-08-31  Alan Modra  <amodra@gmail.com>
480
481         * section.c (section_id): Make file scope.
482         (bfd_get_next_section_id): New function.
483         * elf64-ppc.c (struct map_stub): Remove toc_off field.  Move decl.
484         (struct ppc_stub_hash_entry): Delete stub_sec and id_sec.  Add
485         group.  Update all uses.
486         (struct ppc_link_hash_table): Delete top_id, top_index, and
487         input_list.  Add sec_info_arr_size.  Rename stub_group to
488         sec_info, and make group info indirect.  Update stub_group refs
489         throughout file.
490         (ppc_add_stub): Don't look for stub_sec on link_sec stub_group
491         entry.
492         (ppc_build_one_stub): Delete FIXME.
493         (ppc64_elf_setup_section_lists): Size htab->sec_info for all
494         sections, not just input sections.  Don't create htab->input_list.
495         (ppc64_elf_next_input_section): Update to use sec_info union as
496         list pointer.
497         (PREV_SEC): Delete.
498         (group_sections): Pass "info" param rather than "htab".  Iterate
499         over output sections rather than input_list.  Use sec_info union
500         as list pointers.  Alloc atruct map_stub, and return fail status.
501         * bfd-in2.h: Regenerate.
502
503 2015-08-31  Alan Modra  <amodra@gmail.com>
504
505         * elflink.c (elf_sort_symbol): Use correctly sized type for
506         calculating signed section->id difference.
507         (elf_link_add_object_symbols): Likewise.
508         * pef.c (bfd_pef_scan_start_address): Warning fix.
509         * vms-alpha.c (vms_new_section_hook): Likewise.
510
511 2015-08-31  Alan Modra  <amodra@gmail.com>
512
513         * elf32-nds32.c (nds32_convert_32_to_16_alu1): Warning fix.
514         (find_relocs_at_address_addr): Make "reloc_type" an enum.
515         (nds32_elf_relax_delete_blanks): Warning fix.
516         (nds32_elf_relax_loadstore): Correct loop bound.
517
518 2015-08-31  Alan Modra  <amodra@gmail.com>
519
520         * section.c (struct bfd_section): Make "id" and "index" unsigned.
521         * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust local var to suit.
522         * elf.c (elf_map_symbols): Likewise.
523         * elf64-ppc.c (sym_exists_at): Make "id" param unsigned.
524         (struct ppc_link_hash_table): Make "top_id" and "top_index" unsigned.
525         (ppc64_elf_setup_section_lists): Ditto for local vars.
526         * elf32-arm.c: Similarly to elf64-ppc.c.
527         * elf32-avr.c: Likewise.
528         * elf32-hppa.c: Likewise.
529         * elf32-m68hc1x.c: Likewise.
530         * elf32-metag.c: Likewise.
531         * elf32-nios2.c: Likewise.
532         * elfnn-aarch64.c: Likewise.
533         * simple.c (struct saved_offsets): Make "section_count" unsigned.
534         * bfd-in2.h: Regenerate.
535
536 2015-08-27  Alan Modra  <amodra@gmail.com>
537
538         PR 18867
539         * elf64-alpha.c (elf64_alpha_sort_relocs_p): New function.
540         (elf_backend_sort_relocs_p): Define.
541
542 2015-08-26  Alan Modra  <amodra@gmail.com>
543
544         PR 18867
545         * elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete.
546         (cmp_ext64l_r_offset, cmp_ext64b_r_offset): Delete.
547         (ext32l_r_offset, ext32b_r_offset, ext64l_r_offset, ext64b_r_offset):
548         New functions.
549         (elf_link_adjust_relocs): Use an insertion sort to sort relocs.
550
551 2015-08-26  Matthew Fortune  <matthew.fortune@imgtec.com>
552
553         PR ld/18401
554         * elfxx-mips.c (bfd_mips_isa_ext_mach): New function: Converts an
555         ISA value to a bfd machine number.
556         (bfd_mips_isa_ext): Update the ISA level and revision if
557         necessary.  Use mips_mach_extends_p to decide if the ISA extension
558         needs to be set.
559         (_bfd_mips_elf_merge_private_bfd_data): Allow the ISA extension to
560         be inferred from the ABI setting.  Set the ISA level from the
561         maximum of the incoming and outgoing ISA levels.
562
563 2015-08-25  Nick Clifton  <nickc@redhat.com>
564
565         PR binutils/18854
566         * elf.c (bfd_section_from_shdr): Replace assertions with warnings
567         about multiple symbol tables.
568
569 2015-08-25  Renlin Li  <renlin.li@arm.com>
570
571         * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of
572         ILP64.
573         * bfd-in2.h: Regenerate.
574
575 2015-08-22  Alan Modra  <amodra@gmail.com>
576
577         * elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
578         Don't copy fields not set by _bfd_elf_swap_verdef_in.
579
580 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
581
582         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
583         types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
584         BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
585         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
586         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
587         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
588         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
589         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
590         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
591         (elfNN_aarch64_final_link_relocate): Likewise.
592         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
593         (_bfd_aarch64_elf_resolve_relocation): Likewise.
594
595 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
596
597         * reloc.c (BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
598         BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
599         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
600         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
601         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
602         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
603         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
604         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC): New entries.
605         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
606         * bfd-in2.h: Regenerate.
607         * libbfd.h: Regenerate.
608
609 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
610
611         PR ld/18276
612         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
613         types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
614         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
615         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
616         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
617         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
618         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
619         (elfNN_aarch64_final_link_relocate): Likewise.
620         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
621         (_bfd_aarch64_elf_resolve_relocation): Likewise.
622
623 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
624
625         * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
626         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
627         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
628         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
629         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
630         BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
631         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
632         * bfd-in2.h: Regenerate.
633         * libbfd.h: Regenerate.
634
635 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
636
637         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
638         BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
639         (aarch64_reloc_got_type): Likewise.
640         (elfNN_aarch64_final_link_relocate): Likewise.
641         (elfNN_aarch64_relocate_section): Likewise.
642         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
643         (_bfd_aarch64_elf_resolve_relocation): Likewise.
644
645 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
646
647         * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
648         * bfd-in2.h: Regenerate.
649         * libbfd.h: Regenerate.
650         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
651         BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
652
653 2015-08-19  Alan Modra  <amodra@gmail.com>
654
655         * elf-s390-common.c: Simplify expressions using
656         bfd_linke_executable, bfd_link_pie and bfd_link_pic.
657         * elf32-arm.c: Likewise.
658         * elf32-bfin.c: Likewise.
659         * elf32-frv.c: Likewise.
660         * elf32-m68k.c: Likewise.
661         * elf32-nios2.c: Likewise.
662         * elf32-ppc.c: Likewise.
663         * elf32-s390.c: Likewise.
664         * elf32-sh.c: Likewise.
665         * elf64-alpha.c: Likewise.
666         * elf64-ppc.c: Likewise.
667         * elf64-s390.c: Likewise.
668         * elflink.c: Likewise.
669
670 2015-08-18  Jiong Wang  <jiong.wang@arm.com>
671
672         * elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check.
673         (elfNN_aarch64_relocate_section): Likewise.
674         (elfNN_aarch64_gc_sweep_hook): Likewise.
675         (elfNN_aarch64_check_relocs): Likewise.
676
677 2015-08-18  H.J. Lu  <hongjiu.lu@intel.com>
678
679         PR ld/18841
680         * elf-bfd.h (elf_link_hash_table): Add dynsym.
681         * elf32-i386.c (elf_i386_reloc_type_class): Return
682         reloc_class_ifunc for relocation against STT_GNU_IFUNC symbol.
683         * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
684         * elflink.c (_bfd_elf_link_create_dynamic_sections): Set dynsym.
685         (bfd_elf_size_dynsym_hash_dynstr): Use dynsym.
686         (elf_final_link_info): Remove dynsym_sec.
687         (elf_link_output_extsym): Replace dynsym_sec with dynsym.
688         (bfd_elf_final_link): Remove reference to dynsym_sec.  Replace
689         dynsym_sec with dynsym.
690
691 2015-08-18  H.J. Lu  <hongjiu.lu@intel.com>
692
693         * bfd/aoutx.h: Replace shared, executable, relocatable and pie
694         fields with bfd_link_executable, bfd_link_dll,
695         bfd_link_relocatable, bfd_link_pic and bfd_link_pie.
696         * bfd/bout.c: Likewise.
697         * bfd/coff-alpha.c: Likewise.
698         * bfd/coff-arm.c: Likewise.
699         * bfd/coff-i386.c: Likewise.
700         * bfd/coff-i960.c: Likewise.
701         * bfd/coff-m68k.c: Likewise.
702         * bfd/coff-mcore.c: Likewise.
703         * bfd/coff-mips.c: Likewise.
704         * bfd/coff-ppc.c: Likewise.
705         * bfd/coff-rs6000.c: Likewise.
706         * bfd/coff-sh.c: Likewise.
707         * bfd/coff-tic80.c: Likewise.
708         * bfd/coff-x86_64.c: Likewise.
709         * bfd/coff64-rs6000.c: Likewise.
710         * bfd/coffgen.c: Likewise.
711         * bfd/cofflink.c: Likewise.
712         * bfd/ecoff.c: Likewise.
713         * bfd/ecofflink.c: Likewise.
714         * bfd/elf-bfd.h: Likewise.
715         * bfd/elf-eh-frame.c: Likewise.
716         * bfd/elf-ifunc.c: Likewise.
717         * bfd/elf-m10200.c: Likewise.
718         * bfd/elf-m10300.c: Likewise.
719         * bfd/elf-s390-common.c: Likewise.
720         * bfd/elf-vxworks.c: Likewise.
721         * bfd/elf.c: Likewise.
722         * bfd/elf32-arm.c: Likewise.
723         * bfd/elf32-avr.c: Likewise.
724         * bfd/elf32-bfin.c: Likewise.
725         * bfd/elf32-cr16.c: Likewise.
726         * bfd/elf32-cr16c.c: Likewise.
727         * bfd/elf32-cris.c: Likewise.
728         * bfd/elf32-crx.c: Likewise.
729         * bfd/elf32-d10v.c: Likewise.
730         * bfd/elf32-dlx.c: Likewise.
731         * bfd/elf32-epiphany.c: Likewise.
732         * bfd/elf32-fr30.c: Likewise.
733         * bfd/elf32-frv.c: Likewise.
734         * bfd/elf32-ft32.c: Likewise.
735         * bfd/elf32-h8300.c: Likewise.
736         * bfd/elf32-hppa.c: Likewise.
737         * bfd/elf32-i370.c: Likewise.
738         * bfd/elf32-i386.c: Likewise.
739         * bfd/elf32-i860.c: Likewise.
740         * bfd/elf32-ip2k.c: Likewise.
741         * bfd/elf32-iq2000.c: Likewise.
742         * bfd/elf32-lm32.c: Likewise.
743         * bfd/elf32-m32c.c: Likewise.
744         * bfd/elf32-m32r.c: Likewise.
745         * bfd/elf32-m68hc11.c: Likewise.
746         * bfd/elf32-m68hc1x.c: Likewise.
747         * bfd/elf32-m68k.c: Likewise.
748         * bfd/elf32-mcore.c: Likewise.
749         * bfd/elf32-mep.c: Likewise.
750         * bfd/elf32-metag.c: Likewise.
751         * bfd/elf32-microblaze.c: Likewise.
752         * bfd/elf32-moxie.c: Likewise.
753         * bfd/elf32-msp430.c: Likewise.
754         * bfd/elf32-mt.c: Likewise.
755         * bfd/elf32-nds32.c: Likewise.
756         * bfd/elf32-nios2.c: Likewise.
757         * bfd/elf32-or1k.c: Likewise.
758         * bfd/elf32-ppc.c: Likewise.
759         * bfd/elf32-rl78.c: Likewise.
760         * bfd/elf32-rx.c: Likewise.
761         * bfd/elf32-s390.c: Likewise.
762         * bfd/elf32-score.c: Likewise.
763         * bfd/elf32-score7.c: Likewise.
764         * bfd/elf32-sh-symbian.c: Likewise.
765         * bfd/elf32-sh.c: Likewise.
766         * bfd/elf32-sh64.c: Likewise.
767         * bfd/elf32-spu.c: Likewise.
768         * bfd/elf32-tic6x.c: Likewise.
769         * bfd/elf32-tilepro.c: Likewise.
770         * bfd/elf32-v850.c: Likewise.
771         * bfd/elf32-vax.c: Likewise.
772         * bfd/elf32-visium.c: Likewise.
773         * bfd/elf32-xc16x.c: Likewise.
774         * bfd/elf32-xstormy16.c: Likewise.
775         * bfd/elf32-xtensa.c: Likewise.
776         * bfd/elf64-alpha.c: Likewise.
777         * bfd/elf64-hppa.c: Likewise.
778         * bfd/elf64-ia64-vms.c: Likewise.
779         * bfd/elf64-mmix.c: Likewise.
780         * bfd/elf64-ppc.c: Likewise.
781         * bfd/elf64-s390.c: Likewise.
782         * bfd/elf64-sh64.c: Likewise.
783         * bfd/elf64-x86-64.c: Likewise.
784         * bfd/elflink.c: Likewise.
785         * bfd/elfnn-aarch64.c: Likewise.
786         * bfd/elfnn-ia64.c: Likewise.
787         * bfd/elfxx-mips.c: Likewise.
788         * bfd/elfxx-sparc.c: Likewise.
789         * bfd/elfxx-tilegx.c: Likewise.
790         * bfd/i386linux.c: Likewise.
791         * bfd/linker.c: Likewise.
792         * bfd/m68klinux.c: Likewise.
793         * bfd/pdp11.c: Likewise.
794         * bfd/pe-mips.c: Likewise.
795         * bfd/peXXigen.c: Likewise.
796         * bfd/reloc.c: Likewise.
797         * bfd/reloc16.c: Likewise.
798         * bfd/sparclinux.c: Likewise.
799         * bfd/sunos.c: Likewise.
800         * bfd/vms-alpha.c: Likewise.
801         * bfd/xcofflink.c: Likewise.
802
803 2015-08-18  Alan Modra  <amodra@gmail.com>
804
805         PR 18667
806         * Makefile.am: Use $(SED) in place of sed throughout.
807         * Makefile.in: Regenerate.
808
809 2015-08-18  Alan Modra  <amodra@gmail.com>
810
811         * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't redefine .TOC.
812         if already defined, and set linker_def.
813         (ppc64_elf_set_toc): Use .TOC. value if defined other than by
814         the backend.
815
816 2015-08-14  Alan Modra  <amodra@gmail.com>
817
818         PR ld/18759
819         * elf32-or1k.c: Revert 2015-08-11 change.
820
821 2015-08-13  H.J. Lu  <hongjiu.lu@intel.com>
822
823         PR ld/18801
824         * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error
825         for read-only segment with dynamic IFUNC relocations.
826         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
827
828 2015-08-12  Simon Dardis  <simon.dardis@imgtec.com>
829
830         * elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
831         (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry,
832         mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry):
833         Update to use 'or' instead of 'addu/daddu'.
834         (_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE.
835         (move_insns_32): Reorder table.
836
837 2015-08-11  H.J. Lu  <hongjiu.lu@intel.com>
838
839         * elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC
840         relocations in debug sections.
841         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
842
843 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
844
845         * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Improve warning
846         message for R_AARCH64_LD64_GOTPAGE_LO15/R_AARCH64_LD32_GOTPAGE_LO14.
847
848 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
849
850         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
851         (aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.
852
853 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
854
855         * bfd/elfnn-aarch64.c (aarch64_type_of_stub): New parameter "sym_sec".
856         Loose the check for symbol from ABS section.
857         (elfNN_aarch64_size_stubs): Pass sym_sec.
858
859 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
860
861         PR ld/18668
862         * elfnn-aarch64.c (aarch64_type_of_stub): Update destination for
863         calls go through plt stub.
864         (elfNN_aarch64_final_link_relocate): Adjust code logic for CALL26,
865         JUMP26 relocation to support inserting veneer for call to plt stub.
866
867 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
868
869         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
870         BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
871         (aarch64_reloc_got_type): Likewise.
872         (elfNN_aarch64_final_link_relocate): Likewise.
873         (elfNN_aarch64_relocate_section): Likewise.
874         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
875         (_bfd_aarch64_elf_resolve_relocation): Likewise.
876
877 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
878
879         * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
880         * bfd-in2.h: Regenerate.
881         * libbfd.h: Regenerate.
882         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
883         BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
884
885 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
886
887         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
888         BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
889         (aarch64_reloc_got_type): Likewise.
890         (elfNN_aarch64_final_link_relocate): Likewise.
891         (elfNN_aarch64_relocate_section): Likewise.
892         (elfNN_aarch64_gc_sweep_hook): Likewise.
893         (elfNN_aarch64_check_relocs): Likewise.
894         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
895         (_bfd_aarch64_elf_resolve_relocation): Likewise.
896
897 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
898
899         * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
900         * bfd-in2.h: Regenerate.
901         * libbfd.h: Regenerate.
902         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
903         BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
904
905 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
906
907         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
908         BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
909         (aarch64_reloc_got_type): Likewise.
910         (elfNN_aarch64_final_link_relocate): Likewise.
911         (elfNN_aarch64_relocate_section): Likewise.
912         (elfNN_aarch64_gc_sweep_hook): Likewise.
913         (elfNN_aarch64_check_relocs): Likewise.
914         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
915         (_bfd_aarch64_elf_resolve_relocation): Likewise.
916
917 2015-08-11  Jiong Wang  <jiong.wang@arm.com>
918
919         * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
920         * bfd-in2.h: Regenerate.
921         * libbfd.h: Regenerate.
922         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
923         BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
924
925 2015-08-11  H.J. Lu  <hongjiu.lu@intel.com>
926
927         PR ld/18808
928         * elf32-i386.c (elf_i386_relocate_section): Skip IFUNC
929         relocations in debug sections.
930         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
931
932 2015-08-11  Peter Zotov  <whitequark@whitequark.org>
933
934         PR ld/18759
935         * elf32-or1k.c (R_OR1K_32_PCREL): Set pcrel_offset to TRUE.
936         (R_OR1K_16_PCREL): Likewise.
937         (R_OR1K_8_PCREL): Likewise.
938
939 2015-08-11  Nick Clifton  <nickc@redhat.com>
940
941         PR binutils/18747
942         * coff-sh.c (_bfd_sh_align_load_span): Fix typo when setting
943         opcode count.
944
945         PR binutils/18758
946         * elf.c (_bfd_elf_setup_sections): Add checks for corrupt section
947         group information.
948         * peicode.h (pe_ILF_make_a_section): Ensure alignment of the
949         used_by_bfd pointer.
950         (pe_ILF_build_a_bfd): Ensure alignment of vars.data pointer.
951
952 2015-08-11  H.J. Lu  <hongjiu.lu@intel.com>
953
954         * elf.c (_bfd_elf_copy_private_bfd_data): Fix a typo.
955
956 2015-08-10  H.J. Lu  <hongjiu.lu@intel.com>
957
958         * elf-bfd.h (elf_symbol_version): New enum.
959         (elf_link_hash_entry): Replace hidden with versioned.
960         * elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
961         version if the symbol is unversioned.  Initialize versioned.
962         (_bfd_elf_add_default_symbol): Don't look for symbol version
963         if the symbol is unversioned or hidden.  Initialize versioned.
964         (elf_collect_hash_codes): Don't look for symbol version if the
965         symbol is unversioned.
966         (elf_collect_gnu_hash_codes): Likewise.
967         (bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
968         (_bfd_elf_link_hash_copy_indirect): Check versioned instead of
969         hidden.
970         (elf_link_output_extsym): Likewise.
971
972 2015-08-07  H.J. Lu  <hongjiu.lu@intel.com>
973
974         PR binutils/18785
975         * elf.c (_bfd_elf_copy_private_bfd_data): When copying the
976         sh_link and sh_info fields in stripped section headers, we also
977         check if the sh_type, sh_flags, sh_addralign and sh_entsize
978         fields of the output section match the output.  Since
979         --only-keep-debug turns all non-debug sections into SHT_NOBITS
980         sections, the output SHT_NOBITS type matches any input type.
981
982 2015-08-07  H.J. Lu  <hongjiu.lu@intel.com>
983
984         PR ld/18720
985         * elflink.c (_bfd_elf_merge_symbol): Add a parameter to indicate
986         if the new symbol matches the existing one.  The new hidden
987         versioned symbol matches the existing symbol if they have the
988         same symbol version. Update the existing symbol only if they
989         match.
990         (_bfd_elf_add_default_symbol): Update call to
991         _bfd_elf_merge_symbol.
992         (_bfd_elf_link_assign_sym_version): Don't set the hidden field
993         here.
994         (elf_link_add_object_symbols): Override a definition only if the
995         new symbol matches the existing one.
996         (_bfd_elf_link_hash_copy_indirect): Don't copy any references to
997         the hidden versioned symbol.
998         (elf_link_output_extsym): Bind a symbol locally when linking
999         executable if it is locally defined, hidden versioned, not
1000         referenced by shared library and not exported.  Turn on
1001         VERSYM_HIDDEN only if the hidden versioned symbol is defined
1002         locally.
1003
1004 2015-08-05  Nick Clifton  <nickc@redhat.com>
1005
1006         * elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
1007         sh_info fields of sections whose type has been changed to
1008         SHT_NOBITS.
1009
1010 2015-08-04  Yuriy M. Kaminskiy"  <yumkam@gmail.com>
1011             Tyler Hicks  <tyhicks@canonical.com>
1012
1013         PR binutils/18750
1014         * ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
1015         and stack overflow when char is signed and \200-\376 was in place of hex
1016         digit; also fixes \377 was handled as EOF instead of "incorrect character".
1017         (ihex_read_section): Changed for consistency.
1018         (ihex_bad_byte): Prevent (now impossible to trigger) stack
1019         overflow and incorrect escape sequence handling.
1020         * srec.c (srec_bad_byte): Likewise.
1021
1022 2015-08-03  Hans-Peter Nilsson  <hp@axis.com>
1023
1024         * elf32-cris.c (cris_elf_relocate_section)
1025         (elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
1026         (elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
1027         just link_info->symbolic, to check if a symbol should be bound
1028         symbolically.
1029
1030 2015-07-30  H.J. Lu  <hongjiu.lu@intel.com>
1031
1032         PR ld/18735
1033         * elflink.c (_bfd_elf_add_default_symbol): Add the default
1034         symbol if not performing a relocatable link.
1035         (elf_link_add_object_symbols): Adjust the default symbol if
1036         not performing a relocatable link.
1037
1038 2015-07-29  H.J. Lu  <hongjiu.lu@intel.com>
1039
1040         * elflink.c (elf_link_add_object_symbols): Remove
1041         !info->relocatable check for info->executable.  Add
1042         !info->relocatable check for !info->executable.
1043         (elf_link_output_extsym): Remove
1044         !info->relocatable check for info->executable.
1045
1046 2015-07-29  Hans-Peter Nilsson  <hp@bitrange.com>
1047
1048         * mmo.c (mmo_write_symbols_and_terminator): Skip symbol-type
1049         assignment loop for bfd plugin objects.
1050
1051 2015-07-28  Alan Modra  <amodra@gmail.com>
1052
1053         * elf.c (_bfd_elf_map_sections_to_segments): Do not make a new
1054         segment for loaded sections after nonloaded sections if the
1055         sections are on the same page.
1056
1057 2015-07-28  Iain Buclaw  <ibuclaw@gdcproject.org>
1058
1059         * configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
1060         * config.in, configure: Regenerate.
1061
1062 2015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
1063
1064         * configure: Regenerated.
1065
1066 2015-07-27  Nick Clifton  <nickc@redhat.com>
1067
1068         * elf32-msp430.c (uses_large_model): New function.
1069         (msp430_elf_eh_frame_address_size): New function.
1070         (elf_backend_eh_frame_address_size): Define.
1071
1072 2015-07-27  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1073
1074         PR ld/18705
1075         * elfnn-aarch64.c (elf_backend_extern_protected_data): Define.
1076
1077 2015-07-27  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1078
1079         PR ld/18705
1080         * elf32-arm.c (elf_backend_extern_protected_data): Define.
1081
1082 2015-07-25  H.J. Lu  <hongjiu.lu@intel.com>
1083
1084         PR ld/18718
1085         * elflink.c (elf_link_output_extsym): Check symbol version
1086         section check only if not linking executable, the symbol is
1087         referenced by shared library or not locally defined.
1088
1089 2015-07-25  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1090
1091         * elf32-arm.c (elf32_arm_final_link_relocate): Use SYMBOLIC_BIND to
1092         check if a symbol should be bound symbolically.
1093         * elf32-hppa.c (elf32_hppa_check_relocs,
1094         elf32_hppa_adjust_dynamic_symbol, elf32_hppa_relocate_section,
1095         elf32_hppa_finish_dynamic_symbol): Likewise.
1096         * elf32-m68k.c (elf_m68k_check_relocs,
1097         elf_m68k_relocate_section): Likewise.
1098         * elf32-nios2.c (nios2_elf32_relocate_section,
1099         nios2_elf32_check_relocs, allocate_dynrelocs): Likewise.
1100         * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol,
1101         elf32_tic6x_relocate_section): Likewise.
1102
1103 2015-07-24  Alan Modra  <amodra@gmail.com>
1104
1105         * elf.c (_bfd_elf_assign_file_positions_for_non_load): Use .rela
1106         prefix for reloc section corresponding to rela section associated
1107         with renamed debug section.
1108
1109 2015-07-24  Alan Modra  <amodra@gmail.com>
1110
1111         * section.c (bfd_get_section_by_name_if): Iterate over entire hash
1112         chain.
1113
1114 2015-07-23  Joseph Myers  <joseph@codesourcery.com>
1115
1116         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
1117         <DT_MIPS_RLD_MAP_REL>: Add target address to host address
1118         difference, not to host pointer.
1119
1120 2015-07-22  Alan Modra  <amodra@gmail.com>
1121
1122         * elf64-ppc.c (opd_entry_value): Remove assertion.  Instead,
1123         return -1 if symbol referenced is not defined.  Tidy.
1124
1125 2015-07-20  Alan Modra  <amodra@gmail.com>
1126
1127         * po/SRC-POTFILES.in: Regenerate.
1128
1129 2015-07-17  Jiong Wang  <jiong.wang@arm.com>
1130
1131         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Sort alphabetically.
1132         (IS_AARCH64_TLSDESC_RELOC): Sort alphabetically.
1133
1134 2015-07-16  Jiong Wang  <jiong.wang@arm.com>
1135
1136         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
1137         BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1138         (aarch64_reloc_got_type): Ditto.
1139         (elfNN_aarch64_final_link_relocate): Ditto.
1140         (elfNN_aarch64_relocate_section): Ditto.
1141         (elfNN_aarch64_gc_sweep_hook): Ditto.
1142         (elfNN_aarch64_check_relocs): Ditto.
1143         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1144         (_bfd_aarch64_elf_resolve_relocation): Ditto.
1145
1146 2015-07-16  Jiong Wang  <jiong.wang@arm.com>
1147
1148         * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PREL21): New entry.
1149         * bfd-in2.h: Regenerate.
1150         * libbfd.h: Regenerate.
1151         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1152         BFD_RELOC_AARCH64_TLSLD_ADR_PREL21.
1153
1154 2015-07-10  H.J. Lu  <hongjiu.lu@intel.com>
1155
1156          PR binutils/18656
1157          * bfd.c (bfd_convert_section_size): New function.
1158          (bfd_convert_section_contents): Likewise.
1159          * bfd-in2.h: Regenerated.
1160
1161 2015-07-09  Catherine Moore  <clm@codesourcery.com>
1162
1163         * elflink.c (bfd_elf_size_dynamic_sections): Call to
1164         _bfd_elf_maybe_strip_eh_frame_hdr should be before
1165         bed->elf_backend_size_dynamic_sections.
1166
1167 2015-07-08  Pitchumani Sivanupandi <pitchumani.s@atmel.com>
1168
1169         * elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
1170
1171 2015-07-05  Richard Sandiford  <richard.sandiford@arm.com>
1172
1173         * elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value
1174         plus addend rather than the original st_value when looking up
1175         entries in opd->adjust.
1176
1177 2015-07-03   Kai Tietz  <ktietz@redhat.com>
1178              Nick Clifton  <nickc@redhat.com>
1179
1180         PR ld/11539
1181         * coffcode.h (coff_bfd_gc_sections): Define default
1182         to bfd_coff_gc_sections function.
1183         (coff_gc_mark_hook_fn): New type.
1184         * coffgen.c (init_reloc_cookie): Copy and adjust coff
1185         related code about gc-sections from elflink.c to here.
1186         (fini_reloc_cookie): Likewise.
1187         (init_reloc_cookie_rels): Likewise.
1188         (fini_reloc_cookie_rels): Likewise.
1189         (init_reloc_cookie_for_section): Likewise.
1190         (fini_reloc_cookie_for_section): Likewise.
1191         (_bfd_coff_gc_mark_hook): Likewise.
1192         (_bfd_coff_gc_mark_rsec): Likewise.
1193         (_bfd_coff_gc_mark_reloc): Likewise.
1194         (_bfd_coff_gc_mark): Likewise.
1195         (_bfd_coff_gc_mark_extra_sections): Likewise.
1196         (coff_gc_sweep_symbol_info): Likewise.
1197         (coff_gc_sweep_symbol): Likewise.
1198         (gc_sweep_hook_fn): Likewise.
1199         (coff_gc_sweep): Likewise.
1200         (bfd_coff_gc_sections): Likewise.
1201         (_bfd_coff_gc_keep): Likewise.
1202         * libcoff-in.h (coff_reloc_cookie): New struct.
1203         (bfd_coff_gc_sections): New prototype.
1204         * libcoff.h: Regenerate.
1205
1206 2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
1207             Cesar Philippidis  <cesar@codesourcery.com>
1208
1209         * bfd-in2.h: Regenerated.
1210         * elf32-nios2.c (elf_nios2_howto_table_rel): Rename to...
1211         (elf_nios2_r1_howto_table_rel): This.
1212         (elf_nios2_r2_howto_table_rel): New.
1213         (BFD_IS_R2): New.
1214         (lookup_howto): Add ABFD parameter.  Adjust to look up in either
1215         the R1 or R2 relocation table, as determined by ABFD.
1216         (nios2_reloc_map): Add R2 relocations.
1217         (nios2_elf32_bfd_reloc_type_lookup): Do lookup using lookup_howto.
1218         Pass it the ABFD parameter.
1219         (nios2_elf32_bfd_reloc_name_lookup): Use ABFD to decide whether to
1220         return an R1 or R2 relocation.
1221         (nios2_elf32_info_to_howto): Do lookup using lookup_howto.
1222         Pass it the ABFD parameter.
1223         (nios2_elf32_do_call26_relocate): Check for alignment on a 4-byte
1224         boundary.
1225         (nios2_elf32_relocate_section): Adjust call to lookup_howto.
1226         * libbfd.h: Regenerated.
1227         * reloc.c (BFD_RELOC_NIOS2_R2_S12): New.
1228         (BFD_RELOC_NIOS2_R2_I10_1_PCREL): New.
1229         (BFD_RELOC_NIOS2_R2_T1I7_1_PCREL): New.
1230         (BFD_RELOC_NIOS2_R2_T1I7_2): New.
1231         (BFD_RELOC_NIOS2_R2_T2I4): New.
1232         (BFD_RELOC_NIOS2_R2_T2I4_1): New.
1233         (BFD_RELOC_NIOS2_R2_T2I4_2): New.
1234         (BFD_RELOC_NIOS2_R2_X1I7_2): New.
1235         (BFD_RELOC_NIOS2_R2_X2L5): New.
1236         (BFD_RELOC_NIOS2_R2_F1I5_2): New.
1237         (BFD_RELOC_NIOS2_R2_L5I4X1): New.
1238         (BFD_RELOC_NIOS2_R2_T1X1I6): New.
1239         (BFD_RELOC_NIOS2_R2_T1X1I6_2): New.
1240
1241 2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
1242             Cesar Philippidis  <cesar@codesourcery.com>
1243
1244         * archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New.
1245         * bfd-in2.h: Regenerated.
1246         * cpu-nios2.c (nios2_compatible): New.
1247         (N): Use nios2_compatible instead of bfd_default_compatible.
1248         (NIOS2R1_NEXT, NIOS2R2_NEXT): Define.
1249         (arch_info_struct): New.
1250         (bfd_nios2_arch): Chain to NIOS2R1_NEXT.
1251         * elf32-nios2.c (is_nios2_elf): New.
1252         (nios2_elf32_merge_private_bfd_data): New.
1253         (nios2_elf32_object_p): New.
1254         (bfd_elf32_bfd_merge_private_bfd_data): Define.
1255         (elf_backend_object_p): Define.
1256
1257 2015-07-01  H.J. Lu  <hongjiu.lu@intel.com>
1258
1259         * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Refactor.
1260
1261 2015-06-30  Nick Clifton  <nickc@redhat.com>
1262
1263         PR binutils/18570
1264         * elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag.
1265         (write_obj_attribute): Likewise.
1266         (elf_new_obj_attr): Likewise.
1267         (bfd_elf_get_obj_attr_int): Likewise.
1268         (bfd_elf_add_obj_attr_int): Likewise.
1269         (bfd_elf_add_obj_attr_string): Likewise.
1270         (bfd_elf_add_obj_attr_int_string): Likewise.
1271         (gnu_obj_attrs_arg_type): Likewise.
1272         (_bfd_elf_obj_attrs_arg_type): Likewise.
1273         (_bfd_elf_parse_attributes): Likewise.
1274         (_bfd_elf_merge_unknown_attribute_list): Likewise.
1275         * elf-bfd.h (struct obj_attribute_list): Likewise.
1276         Update prototypes.
1277
1278 2015-06-28  H.J. Lu  <hongjiu.lu@intel.com>
1279
1280         * bfd-in.h (compressed_debug_section_type): Remove
1281         COMPRESS_DEBUG_ZLIB.
1282         * bfd-in2.h : Regenerated.
1283
1284 2015-06-26  Matthew Fortune  <matthew.fortune@imgtec.com>
1285
1286         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
1287         instead of !shared to indicate an application vs shared library.
1288         (_bfd_mips_elf_size_dynamic_sections): Likewise.
1289         (_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
1290         (_bfd_mips_elf_get_target_dtag): Likewise.
1291
1292 2015-06-25  DJ Delorie  <dj@redhat.com>
1293
1294         * elf32-msp430.c (msp430_final_link_relocate): Fix comments.  Fix
1295         REL loads to match RELA stores.
1296
1297 2015-06-25  H.J. Lu  <hongjiu.lu@intel.com>
1298
1299         * elf.c (_bfd_elf_compute_section_file_positions): Don't
1300         initialize sh_size for .shstrtab here.
1301
1302 2015-06-25  H.J. Lu  <hongjiu.lu@intel.com>
1303
1304         PR gas/18451
1305         * elf-bfd.h (elf_sym_strtab): New.
1306         (elf_link_hash_table): Add strtabcount, strtabsize and
1307         strtab.
1308         (_bfd_elf_stringtab_init): Removed.
1309         * elf.c (_bfd_elf_stringtab_init): Removed.
1310         (_bfd_elf_compute_section_file_positions): Replace
1311         bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/
1312         _bfd_stringtab_size with
1313         elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/
1314         _bfd_elf_strtab_size.  Use _bfd_elf_strtab_add,
1315         _bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get
1316         st_name.
1317         (swap_out_syms): Likewise.
1318         * elflink.c (elf_final_link_info): Replace bfd_strtab_hash
1319         with elf_strtab_hash.  Remove symbuf, symbuf_count,
1320         symbuf_size and shndxbuf_size.
1321         (elf_link_flush_output_syms): Removed.
1322         (elf_link_output_sym): Renamed to ...
1323         (elf_link_output_symstrtab): This.  Replace _bfd_stringtab_add
1324         with _bfd_elf_strtab_add.  Don't flush symbols to the file nor
1325         swap out symbols.
1326         (elf_link_swap_symbols_out): New.
1327         (elf_link_output_extsym): Replace elf_link_output_sym with
1328         elf_link_output_symstrtab.
1329         (elf_link_input_bfd): Likewise.
1330         (elf_final_link_free): Replace _bfd_stringtab_free with
1331         _bfd_elf_strtab_free.  Remove symbuf.
1332         (bfd_elf_final_link): Replace _bfd_elf_stringtab_init with
1333         _bfd_elf_strtab_init.  Don't set symbuf, symbuf_count,
1334         symbuf_size nor shndxbuf_size.  Initialize strtabsize and
1335         strtab.  Initialize symshndxbuf to -1 when number of sections
1336         >= 64K.  Replace elf_link_output_sym/elf_link_output_sym with
1337         elf_link_output_symstrtab/elf_link_output_symstrtab. Don't
1338         call elf_link_flush_output_syms.  Call _bfd_elf_strtab_finalize
1339         and elf_link_swap_symbols_out.  Replace _bfd_stringtab_size
1340         and _bfd_stringtab_emit with _bfd_elf_strtab_size and
1341         _bfd_elf_strtab_emit.
1342
1343 2015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
1344
1345         * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Silence older
1346         GCC warning.
1347
1348 2015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
1349
1350         * elf32-i386.c (elf_i386_allocate_dynrelocs): Always allocate
1351         space for the first .plt entry.
1352         (elf_i386_size_dynamic_sections): Always add DT_PLTGOT for .plt
1353         section.  Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1354         there are PLT relocations.
1355         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Always
1356         allocate space for the first .plt entry.
1357         (elf_x86_64_size_dynamic_sections): Always add DT_PLTGOT for
1358         .plt section.  Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if
1359         there are PLT relocations.
1360
1361 2015-06-24  H.J. Lu  <hongjiu.lu@intel.com>
1362
1363         PR ld/18591
1364         * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert
1365         R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation
1366         overflow.
1367
1368 2015-06-23  Jiong Wang  <jiong.wang@arm.com>
1369
1370         * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
1371         (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
1372         relocations against read-only sections.
1373
1374 2015-06-18  Nick Clifton  <nickc@redhat.com>
1375
1376         PR 18481
1377         * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
1378
1379 2015-06-15  Jon Turney  <jon.turney@dronecode.org.uk>
1380
1381         * bfd.c: Change struct bfd_build_id to use bfd_size_type.
1382         * bfd-in2.h : Regenerate.
1383
1384 2015-06-16  Alan Modra  <amodra@gmail.com>
1385
1386         * elf32-ppc.c (ppc_elf_relocate_section): Correct binary search of
1387         dynamic relocs.
1388
1389 2015-06-10  Jon Turney  <jon.turney@dronecode.org.uk>
1390
1391         * elf-bfd.h : Remove struct elf_build_id.
1392         * bfd.c : Add struct bfd_build_id.
1393         * bfd-in2.h: Regenerate.
1394         * elf.c (elfobj_grok_gnu_build_id): Update to use bfd_build_id.
1395         * libpei.h: Add protoype and macros for
1396         bfd_XXi_slurp_codeview_record.
1397         * peXXigen.c (_bfd_XXi_slurp_codeview_record): Make public
1398         * peicode.h (pe_bfd_read_buildid): Add.
1399         (pe_bfd_object_p): Use pe_bfd_read_buildid().
1400
1401 2015-06-15  Renlin Li  <renlin.li@arm.com>
1402
1403         * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry.
1404         * bfd-in2.h: Regenerate.
1405         * libbfd.h: Regenerate.
1406         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1407         BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
1408
1409 2015-06-15  Alan Modra  <amodra@gmail.com>
1410
1411         * cofflink.c (_bfd_coff_generic_relocate_section): Revert
1412         2014-03-26 change.  Call _bfd_clear_contents for relocs against
1413         local and global symbols defined in discarded input sections.
1414
1415 2015-06-05  Nick Clifton  <nickc@redhat.com>
1416
1417         * elf32-msp430.c (rl78_sym_diff_handler): New function.
1418         (msp430_howto_table): Use the new function for the SYM_DIFF reloc.
1419         (msp430x_howto_table): Likewise.
1420
1421 2015-06-05  Alan Modra  <amodra@gmail.com>
1422
1423         * elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
1424         relocs with insns moved by --ppc476-workaround.  Correct
1425         output of REL16 relocs.
1426
1427 2015-06-01  Jiong Wang  <jiong.wang@arm.com>
1428
1429         * elfnn-aarch64.c (aarch64_reloc_got_type): Support
1430         BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1431         (elfNN_aarch64_final_link_relocate): Ditto.
1432         (elfNN_aarch64_gc_swap_hook): Ditto.
1433         (elfNN_aarch64_check_relocs): Ditto.
1434         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1435
1436 2015-06-01  Jiong Wang  <jiong.wang@arm.com>
1437
1438         * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
1439         * bfd-in2.h: Regenerate.
1440         * libbfd.h: Regenerate.
1441         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1442         BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
1443
1444 2015-06-01  Jiong Wang  <jiong.wang@arm.com>
1445
1446         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
1447         complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1448         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
1449         PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
1450
1451 2015-06-01  Jiong Wang  <jiong.wang@arm.com>
1452
1453         * elfnn-aarch64.c (aarch64_reloc_got_type): Support
1454         BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1455         (elfNN_aarch64_final_link_relocate): Ditto.
1456         (elfNN_aarch64_gc_swap_hook): Ditto.
1457         (elfNN_aarch64_check_relocs): Ditto.
1458         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1459
1460 2015-06-01  Jiong Wang  <jiong.wang@arm.com>
1461
1462         * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
1463         * bfd-in2.h: Regenerate.
1464         * libbfd.h: Regenerate.
1465         * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
1466         BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
1467
1468 2015-05-28  Catherine Moore  <clm@codesourcery.com>
1469             Bernd Schmidt <bernds@codesourcery.com>
1470             Paul Brook <paul@codesourcery.com>
1471
1472         bfd/
1473         * bfd-in2.h: Regenerated.
1474         * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
1475         (COMPACT_EH_CANT_UNWIND_OPCODE): Define.
1476         (dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
1477         eh_frame_hdr_info.
1478         (compact_eh_frame_hdr_info): Declare.
1479         (eh_frame_hdr_info):  Redeclare with union for dwarf-specific
1480         fields and compact-eh fields.
1481         (elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
1482         (bfd_elf_section_data): Add eh_frame_entry_field.
1483         (elf_section_eh_frame_entry): Define.
1484         (bfd_elf_parse_eh_frame_entries): Declare.
1485         (_bfd_elf_parse_eh_frame_entry): Declare.
1486         (_bfd_elf_end_eh_frame_parsing): Declare.
1487         (_bfd_elf_write_section_eh_frame_entry): Declare.
1488         (_bfd_elf_eh_frame_entry_present): Declare.
1489         (_bfd_elf_section_for_symbol): Declare.
1490         * elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
1491         (bfd_elf_record_eh_frame_entry): New function.
1492         (_bfd_elf_parse_eh_frame_entry): New function.
1493         (_bfd_elf_parse_eh_frame): Update hdr_info field references.
1494         (cmp_eh_frame_hdr): New function.
1495         (add_eh_frame_hdr_terminator): New function.
1496         (_bfd_elf_end_eh_frame_parsing): New function.
1497         (find_merged_cie): Update hdr_info field references.
1498         (_bfd_elf_discard_section_eh_frame): Likewise.
1499         (_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
1500         (_bfd_elf_eh_frame_entry_present): New function.
1501         (_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
1502         (_bfd_elf_write_section_eh_frame_entry): New function.
1503         (_bfd_elf_write_section_eh_frame): Update hdr_info field references.
1504         (_bfd_elf_fixup_eh_frame_hdr): New function.
1505         (write_compact_eh_frame_hdr): New function.
1506         (write_dwarf_eh_frame_hdr): New function.
1507         (_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
1508         * elflink.c (_bfd_elf_section_for_symbol): New function.
1509         (elf_section_ignore_discarded_relocs): Add Compact EH support.
1510         (elf_link_input_bfd): Likewise.
1511         (bfd_elf_final_link): Likewise.
1512         (_bfd_elf_gc_mark): Likewise.
1513         (bfd_elf_parse_eh_frame_entries): New function.
1514         (bfd_elf_gc_sections): Add Compact EH support.
1515         (bfd_elf_discard_info): Likewise.
1516         * elfxx-mips.c: Include dwarf2.h.
1517         (_bfd_mips_elf_compact_eh_encoding): New function.
1518         (_bfd_mips_elf_cant_unwind_opcode): New function.
1519         * elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
1520         (_bfd_mips_elf_cant_unwind_opcode): Declare.
1521         (elf_backend_compact_eh_encoding): Define.
1522         (elf_backend_cant_unwind_opcode): Define.
1523         * elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
1524         (elf_backend_cant_unwind_opcode): Provide default.
1525         (elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
1526         elf_backend_cant_unwind_opcode.
1527         * section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.
1528
1529 2015-05-27  H.J. Lu  <hongjiu.lu@intel.com>
1530
1531         PR binutils/18458
1532         * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
1533         for now binding only if pointer equality isn't needed.
1534         (elf_i386_allocate_dynrelocs): Use .plt.got section for now
1535         binding only if pointer equality isn't needed.
1536         * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
1537         section for now binding only if pointer equality isn't needed.
1538         (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
1539         binding only if pointer equality isn't needed.
1540
1541 2015-05-26  H.J. Lu  <hongjiu.lu@intel.com>
1542
1543         PR binutils/18437
1544         * elf32-i386.c (elf_i386_get_plt_sym_val): Skip extra relocations
1545         in .rel.plt/.rela.plt.
1546         * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
1547
1548 2015-05-19  Jiong Wang  <jiong.wang@arm.com>
1549
1550         * elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
1551         relocation case labels alphabetically.
1552         (elfNN_aarch64_final_link_relocate): Ditto.
1553         (elfNN_aarch64_tls_relax): Ditto.
1554         (elfNN_aarch64_relocate_section): Ditto.
1555         (elfNN_aarch64_gc_sweep_hook): Ditto.
1556         (elfNN_aarch64_check_relocs): Ditto.
1557         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
1558         (_bfd_aarch64_elf_resolve_relocation): Ditto.
1559
1560 2015-05-18  Jiong Wang  <jiong.wang@arm.com>
1561
1562         * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Rewrite
1563         comments.
1564
1565 2015-05-16  H.J. Lu  <hongjiu.lu@intel.com>
1566
1567         * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section
1568         for now binding.
1569         (elf_i386_allocate_dynrelocs): Use .plt.got section for now
1570         binding.
1571         * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got
1572         section for now binding.
1573         (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now
1574         binding.
1575
1576 2015-05-14  H.J. Lu  <hongjiu.lu@intel.com>
1577
1578         * bfd.c (bfd_update_compression_header): Also write the zlib
1579         header if the SHF_COMPRESSED bit cleared..
1580         (bfd_check_compression_header): Return the uncompressed size.
1581         * compress.c (decompress_contents): Don't skip the zlib header.
1582         (bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
1583         which doesn't have the zlib header.
1584         (bfd_init_section_decompress_status): Likewise.
1585         (bfd_get_full_section_contents): Updated.
1586         (bfd_is_section_compressed): Likewise.
1587         (bfd_is_section_compressed_with_header): Return the uncompressed
1588         size.
1589         * elf.c (_bfd_elf_make_section_from_shdr): Updated.
1590         * bfd-in2.h: Regenerated.
1591
1592 2015-05-14  Jiong Wang  <jiong.wang@arm.com>
1593
1594         * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Remove overflow
1595         check restrictions.
1596
1597 2015-05-14  Max Filippov  <jcmvbkbc@gmail.com>
1598
1599         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
1600         as GOT reference when plt.refcount is not positive.
1601
1602 2015-05-12  H.J. Lu  <hongjiu.lu@intel.com>
1603
1604         * elf32-i386.c (elf_i386_allocate_dynrelocs): Allocate space
1605         for the first .plt entry only if needed.
1606         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1607
1608 2015-05-11  H.J. Lu  <hongjiu.lu@intel.com>
1609
1610         * Makefile.am (ALL_MACHINES): Add cpu-iamcu.lo.
1611         (ALL_MACHINES_CFILES): Likewise.
1612         * archures.c (bfd_mach_iamcu): New.
1613         (bfd_mach_i386_iamcu): Likewise.
1614         (bfd_mach_i386_iamcu_intel_syntax): Likewise.
1615         (bfd_iamcu_arch): Likewise.
1616         (bfd_archures_list): Add &bfd_iamcu_arch.
1617         * config.bfd (targ_selvecs): Add iamcu_elf32_vec to
1618         i386_elf32_vec.
1619         (targ_archs): Add bfd_iamcu_arch if needed.
1620         * configure.ac: Support iamcu_elf32_vec.
1621         * cpu-iamcu.c: New file.
1622         * elf32-i386.c (elf32_iamcu_elf_object_p): New function.
1623         Add support for iamcu_elf32_vec and elf32_iamcu_bed.
1624         * targets.c (iamcu_elf32_vec): New.
1625         (_bfd_target_vector): Add iamcu_elf32_vec.
1626         * Makefile.in: Regenerated.
1627         * bfd-in2.h: Likewise.
1628         * configure: Likewise.
1629
1630 2015-05-11  H.J. Lu  <hongjiu.lu@intel.com>
1631
1632         * elfcode.h (elf_object_p): Replace EM_486 with EM_IAMCU.
1633
1634 2015-05-10  H.J. Lu  <hongjiu.lu@intel.com>
1635
1636         * elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
1637         and output_bfd with abfd.
1638         * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
1639
1640 2015-05-06  Toni Spets  <toni.spets@iki.fi>
1641
1642         PR ld/18372
1643         * peXXigen.c (rsrc_process_section): Skip discarded resource
1644         sections.
1645
1646 2015-05-01  H.J. Lu  <hongjiu.lu@intel.com>
1647
1648         * config.bfd: Support i[3-7]86-*-elf*.
1649
1650 2015-04-30  H.J. Lu  <hongjiu.lu@intel.com>
1651
1652         * elf32-i386.c (elf_backend_post_process_headers): Undef for
1653         Solaris 2.
1654
1655 2015-04-30  Nick Clifton  <nickc@redhat.com>
1656
1657         PR 18317
1658         * elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
1659         mep_reloc.
1660         (mep_reloc): Delete unused function.
1661
1662 2015-04-29  Nick Clifton  <nickc@redhat.com>
1663
1664         PR 17099
1665         * coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
1666         relocs.
1667
1668 2015-04-27  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
1669
1670         * elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
1671         * elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
1672         elf_s390_merge_obj_attributes.
1673         * elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
1674
1675 2015-04-24  Jiong Wang  <jiong.wang@arm.com>
1676
1677         PR ld/18270
1678         * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
1679         GOT_NORMAL for both sgot/srelgot section.
1680         (elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
1681         and generate necessary runtime relocation for GOT entry.
1682
1683 2015-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1684
1685         PR binutils/18209
1686         * archive.c (_bfd_get_elt_at_filepos): Copy is_linker_input.
1687
1688 2015-04-24  Jiong Wang  <jiong.wang@arm.com>
1689
1690         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
1691         PC-relative relocation for external symbol.
1692
1693 2015-04-24  Nick Clifton  <nickc@redhat.com>
1694
1695         PR 18313
1696         * compress.c (decompress_contents): Zero initialse the z_stream
1697         structure.
1698
1699 2015-04-24  Nick Clifton  <nickc@redhat.com>
1700
1701         * elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
1702         local labels to include local labels with a numeric suffix and
1703         fake symbols.
1704
1705 2015-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1706
1707         PR binutils/18316
1708         * section.c (SEC_MEP_VLIW): New.
1709         * bfd-in2.h: Regenerated.
1710
1711 2015-04-23  H.J. Lu  <hongjiu.lu@intel.com>
1712
1713         PR ld/18277
1714         * compress.c (bfd_compress_section_contents): Remove the
1715         write_compress argument.
1716         (bfd_init_section_compress_status): Updated.
1717         (bfd_compress_section): Likewise.
1718         * elf.c (_bfd_elf_set_reloc_sh_name): New.
1719         (_bfd_elf_init_reloc_shdr): Add delay_st_name_p.  Set sh_name
1720         to (unsigned int) -1 if delay_st_name_p is TRUE.  Use
1721         _bfd_elf_set_reloc_sh_name.
1722         (elf_fake_sections): Don't rename DWARF debug section for
1723         linker output if it will be compressed.  Instead, set
1724         delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
1725         (assign_section_numbers): Call _bfd_elf_strtab_addref only if
1726         sh_name != (unsigned int) -1.  Don't finalize nor assign
1727         shstrtab section here.  Delay setting output section names to
1728         _bfd_elf_write_object_contents.
1729         (_bfd_elf_compute_section_file_positions): Update comments on
1730         sh_offset for shstrtab section.
1731         (assign_file_positions_for_non_load_sections): Set sh_offset to
1732         -1 for shstrtab section.
1733         (assign_file_positions_except_relocs): Likewise.
1734         (_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
1735         when compressing DWARF debug sections.  Place shstrtab section
1736         after DWARF debug sections have been compressed.
1737         (_bfd_elf_write_object_contents): Setting sh_name for output
1738         sections.
1739
1740 2015-04-23  H.J. Lu  <hongjiu.lu@intel.com>
1741
1742         PR binutils/18209
1743         * bfd.c (bfd): Add is_linker_input.
1744         * elf.c (convert_debug_to_zdebug): New.
1745         (convert_zdebug_to_debug): Likewise.
1746         (_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
1747         .zdebug_* here.  Use convert_zdebug_to_debug.  Set SEC_ELF_RENAME.
1748         (_bfd_elf_init_reloc_shdr): Pass a pointer to section name
1749         instead of a pointer to section.
1750         (elf_fake_sections): Rename the section name if SEC_ELF_RENAME
1751         is set.
1752         * section.c (SEC_ELF_RENAME): New.
1753         * bfd-in2.h: Regenerated.
1754
1755 2015-04-23  Alan Modra  <amodra@gmail.com>
1756
1757         * elf64-ppc.c (TOC_BASE_ALIGN): Define.
1758         (ppc64_elf_next_toc_section): Align multi-got toc base.
1759         (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
1760
1761 2015-04-22  H.J. Lu  <hongjiu.lu@intel.com>
1762
1763         PR ld/18289
1764         * elf32-i386.c (elf_i386_link_hash_entry): Add gotoff_ref.
1765         (elf_i386_link_hash_newfunc): Initialize gotoff_ref to 0.
1766         (elf_i386_create_dynamic_sections): Always allow copy relocs for
1767         building executables.
1768         (elf_i386_copy_indirect_symbol): Also copy gotoff_ref.
1769         (elf_i386_check_relocs): Set gotoff_ref for R_386_GOTOFF.
1770         (elf_i386_adjust_dynamic_symbol): Also allocate copy relocs for
1771         PIE and R_386_GOTOFF.
1772         (elf_i386_relocate_section): Allow R_386_GOTOFF in executable.
1773
1774 2015-04-20  H.J. Lu  <hongjiu.lu@intel.com>
1775
1776         * elf.c (assign_section_numbers): Always set up sh_name.
1777
1778 2015-04-20  H.J. Lu  <hongjiu.lu@intel.com>
1779
1780         * elf.c (assign_file_positions_for_non_load_sections): Iterate
1781         sections by pointer.
1782         (_bfd_elf_assign_file_positions_for_non_load): Likewise.
1783
1784 2015-04-14  H.J. Lu  <hongjiu.lu@intel.com>
1785
1786         * bfd-in.h (compressed_debug_section_type): New.
1787         * compress.c (bfd_compress_section_contents): Add an argument
1788         for linker write compression and always generate .zdebug_*
1789         section when linking.
1790         (bfd_init_section_compress_status): Pass FALSE to
1791         bfd_compress_section_contents.
1792         (bfd_compress_section): New function.
1793         * elf.c (elf_fake_sections): For linking, set SEC_ELF_COMPRESS
1794         on DWARF debug sections if COMPRESS_DEBUG is set and rename
1795         section if COMPRESS_DEBUG_GABI_ZLIB isn't set.
1796         (assign_file_positions_for_non_load_sections): Set sh_offset
1797         to -1 if SEC_ELF_COMPRESS is set.
1798         (assign_file_positions_except_relocs): Likwise.
1799         (_bfd_elf_assign_file_positions_for_relocs): Renamed to ...
1800         (_bfd_elf_assign_file_positions_for_non_load): This.  Change
1801         return time to bfd_boolean.  Compress the section if
1802         SEC_ELF_COMPRESS is set.
1803         (_bfd_elf_write_object_contents): Updated.
1804         (_bfd_elf_set_section_contents): Write section contents to
1805         the buffer if SEC_ELF_COMPRESS is set.
1806         * merge.c: Include "elf-bfd.h".
1807         (sec_merge_emit): Add arguments for contents and offset.  Write
1808         to contents with offset if contents isn't NULL.
1809         (_bfd_write_merged_section): Write section contents to the
1810         buffer if SEC_ELF_COMPRESS is set.  Pass contents and
1811         output_offset to sec_merge_emit.
1812         * elflink.c (bfd_elf_final_link): Allocate the buffer for
1813         output section contents if SEC_ELF_COMPRESS is set.
1814         * section.c (SEC_ELF_COMPRESS): New.
1815         * bfd-in2.h: Regenerated.
1816
1817 2015-04-15  Alan Modra  <amodra@gmail.com>
1818
1819         * elf32-rl78.c (rl78_elf_relocate_section): Typo fix.
1820
1821 2015-04-14  Nick Clifton  <nickc@redhat.com>
1822
1823         * elf32-rl78.c (RL78_OP_REL): New macro.
1824         (rl78_elf_howto_table): Use it for complex relocs.
1825         (get_symbol_value): Handle the cases when the info or status
1826         arguments are NULL.
1827         (get_romstart): Cache the status returned by get_symbol_value.
1828         (get_ramstart): Likewise.
1829         (RL78_STACK_PUSH): Generate an error message if the stack
1830         overflows.
1831         (RL78_STACK_POP): Likewise for underflows.
1832         (rl78_compute_complex_reloc): New function.  Contains the basic
1833         processing code for all RL78 complex relocs.
1834         (rl78_special_reloc): New function.  Provides special reloc
1835         handling for complex relocs.
1836         (rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
1837         (rl78_offset_for_reloc): Likewise.
1838
1839 2015-04-14  H.J. Lu  <hongjiu.lu@intel.com>
1840
1841         PR ld/pr17709
1842         * elflink.c (_bfd_elf_adjust_dynamic_copy): Check
1843         info->extern_protected_data when warning copy relocs against
1844         protected symbols.
1845         (_bfd_elf_symbol_refs_local_p): Check info->extern_protected_data
1846         when checking protected non-function symbols.
1847
1848 2015-04-13  John Baldwin  <jhb@FreeBSD.org>
1849
1850         * elf.c (elfcore_grok_note): Recognize NT_X86_XSTATE on
1851         FreeBSD.
1852         (elfcore_write_xstatereg): Use correct note name on FreeBSD.
1853
1854 2015-04-13  H.J. Lu  <hongjiu.lu@intel.com>
1855
1856         PR ld/18250
1857         * elflink.c (elf_link_is_defined_archive_symbol): Return FALSE
1858         if the object has been claimed by plugin.
1859
1860 2015-04-11  H.J. Lu  <hongjiu.lu@intel.com>
1861
1862         * elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
1863         with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
1864         protected data symbol when building shared library.
1865         * elf64-x86-64.c (elf_x86_64_relocate_section): Check
1866         R_X86_64_GOTOFF64 against undefined symbol and replace
1867         SYMBOLIC_BIND with SYMBOL_REFERENCES_LOCAL when checking
1868         R_X86_64_GOTOFF64 against protected data symbol when building
1869         shared library.
1870
1871 2015-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1872
1873         PR ld/pr17709
1874         * elf32-i386.c (elf_i386_relocate_section): Also check R_386_GOTOFF
1875         against protected data symbol when building shared library.
1876         * elf64-x86-64.c (elf_x86_64_relocate_section): Also check
1877         R_X86_64_GOTOFF64 against protected data symbol when building
1878         shared library.
1879
1880 2015-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1881
1882         PR ld/pr15228
1883         PR ld/pr17709
1884         * elf-bfd.h (elf_backend_data): Add extern_protected_data.
1885         * elf32-i386.c (elf_backend_extern_protected_data): New.
1886         Defined to 1.
1887         * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
1888         * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
1889         copy relocs against protected symbols if extern_protected_data
1890         is true.
1891         (_bfd_elf_symbol_refs_local_p): Don't return true on protected
1892         non-function symbols if extern_protected_data is true.
1893         * elfxx-target.h (elf_backend_extern_protected_data): New.
1894         Default to 0.
1895         (elfNN_bed): Initialize extern_protected_data with
1896         elf_backend_extern_protected_data.
1897
1898 2015-04-10  H.J. Lu  <hongjiu.lu@intel.com>
1899
1900         * compress.c (bfd_compress_section_contents): Replace bfd_malloc
1901         and free with bfd_alloc and bfd_release on compressed buffer.
1902         Release buffer if compressed section isn't smaller.
1903
1904 2015-04-10  Alan Modra  <amodra@gmail.com>
1905
1906         PR ld/18222
1907         * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
1908         on adding a protected visibility variable to .dynbss.
1909
1910 2015-04-10  Alan Modra  <amodra@gmail.com>
1911
1912         Revert 2015-03-05  H.J. Lu  <hongjiu.lu@intel.com>
1913         PR ld/pr15228
1914         PR ld/pr17709
1915         * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
1916         * elf32-i386.c (elf_backend_extern_protected_data): Delete.
1917         * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
1918         * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
1919         extern_protected_data test.
1920         (_bfd_elf_symbol_refs_local_p): Likewise.
1921         * elfxx-target.h (elf_backend_extern_protected_data): Delete.
1922         (elfNN_bed): Delete elf_backend_extern_protected_data init.
1923
1924 2015-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1925
1926         * compress.c (bfd_compress_section_contents): Update comments.
1927         (bfd_init_section_decompress_status): Likewise.
1928         (bfd_init_section_compress_status): Likewise.
1929
1930 2015-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1931
1932         * elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to
1933         object_flags.
1934         (TARGET_LITTLE_SYM): Likewise.
1935
1936 2015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
1937
1938         * elf32-xtensa.c (splay-tree.h): include header.
1939         (text_action_struct): drop next pointer.
1940         (text_action_list_struct): drop head pointer, add count and
1941         tree fields.
1942         (find_fill_action): instead of linear search in text_action_list
1943         search in the tree.
1944         (text_action_compare, action_first, action_next): new functions.
1945         (text_action_add, text_action_add_literal): instead of linear
1946         search and insertion insert new node into the tree.
1947         (removed_by_actions): pass additional parameter: action_list,
1948         use it to traverse the tree.
1949         (offset_with_removed_text): pass additional action_list parameter
1950         to removed_by_actions.
1951         (map_action_fn_context): new typedef.
1952         (map_action_fn_context_struct): new structure.
1953         (map_action_fn): new function.
1954         (map_removal_by_action): use splay_tree_foreach to build map.
1955         (find_insn_action): replace linear search in text_action_list
1956         with series of splay_tree_lookups.
1957         (print_action, print_action_list_fn): new functions.
1958         (print_action_list): use splay_tree_foreach.
1959         (init_xtensa_relax_info): drop action_list.head initialization.
1960         Initialize the tree.
1961         (compute_text_actions): use non-zero action_list_count instead of
1962         non-NULL action list.
1963         (xlate_map_context): new typedef.
1964         (xlate_map_context_struct): new structure.
1965         (xlate_map_fn): new function.
1966         (build_xlate_map): use splay_tree_foreach to build map.
1967         (action_remove_bytes_fn): new function.
1968         (relax_section): use zero action_list_count instead of NULL
1969         action list. Use splay_tree_foreach to count final section size.
1970         Drop unused variable 'removed'.
1971
1972 2015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
1973
1974         * elf32-xtensa.c (removed_literal_map_entry): new typedef.
1975         (removed_literal_map_entry_struct): new structure.
1976         (removed_literal_list_struct): add new fields: n_map and map.
1977         (map_removed_literal, removed_literal_compare): new functions.
1978         (find_removed_literal): build index array for literals ordered
1979         by VMA, use binary search to find removed literal.
1980
1981 2015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
1982
1983         * elf32-xtensa.c (removal_by_action_entry_struct,
1984         removal_by_action_map_struct): new structures.
1985         (removal_by_action_entry, removal_by_action_map): new typedefs.
1986         (text_action_list_struct): add new field: map.
1987         (map_removal_by_action, removed_by_actions_map,
1988         offset_with_removed_text_map): new functions.
1989         (relax_section): replace offset_with_removed_text with
1990         offset_with_removed_text_map.
1991         (translate_reloc, relax_property_section, relax_section_symbols):
1992         replace removed_by_actions with removed_by_actions_map.
1993
1994 2015-04-09  Max Filippov  <jcmvbkbc@gmail.com>
1995
1996         * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
1997         reloc_range): new typedef.
1998         (reloc_range_list_struct, reloc_range_list_entry_struct,
1999         reloc_range_struct): new structures.
2000         (reloc_range_compare, build_reloc_ranges,
2001         reloc_range_list_append, reloc_range_list_remove,
2002         reloc_range_list_update_range, free_reloc_range_list): new
2003         functions.
2004         (compute_text_actions): precompute relocation opcodes before the
2005         loop. Add relevant_relocs variable, initialize it before the
2006         loop, pass it to the check_section_ebb_pcrels_fit.
2007         (check_section_ebb_pcrels_fit): add new parameter:
2008         relevant_relocs. Update address range in the relevant_relocs if
2009         it's non-NULL and iterate only over relevant relocations.
2010
2011 2015-04-09  Nick Clifton  <nickc@redhat.com>
2012
2013         * elf32-rx.c (describe_flags): Report the settings of the string
2014         insn using bits.
2015         (rx_elf_merge_private_bfd_data): Handle merging of the string insn
2016         using bits.
2017
2018 2015-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2019
2020         * compress.c (bfd_compress_section_contents): Work around a GCC
2021         uninitialized warning bug fixed in GCC 4.7.
2022
2023 2015-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2024
2025         * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
2026         bit.
2027         * bfd.c (bfd::flags): Increase size to 18 bits.
2028         (BFD_COMPRESS_GABI): New.
2029         (BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
2030         (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
2031         (bfd_update_compression_header): New fuction.
2032         (bfd_check_compression_header): Likewise.
2033         (bfd_get_compression_header_size): Likewise.
2034         (bfd_is_section_compressed_with_header): Likewise.
2035         * compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
2036         (bfd_compress_section_contents): Return the uncompressed size if
2037         the full section contents is compressed successfully.  Support
2038         converting from/to .zdebug* sections.
2039         (bfd_get_full_section_contents): Call
2040         bfd_get_compression_header_size to get compression header size.
2041         (bfd_is_section_compressed): Renamed to ...
2042         (bfd_is_section_compressed_with_header): This.  Add a pointer
2043         argument to return compression header size.
2044         (bfd_is_section_compressed): Use it.
2045         (bfd_init_section_decompress_status): Call
2046         bfd_get_compression_header_size to get compression header size.
2047         Return FALSE if uncompressed section size is 0.
2048         * elf.c (_bfd_elf_make_section_from_shdr): Support converting
2049         from/to .zdebug* sections.
2050         * bfd-in2.h: Regenerated.
2051
2052 2015-04-07  Alan Modra  <amodra@gmail.com>
2053
2054         * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
2055         mapped to output .got section.
2056
2057 2015-04-07  Alan Modra  <amodra@gmail.com>
2058
2059         * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
2060         and has_addr16_lo.  Make has_sda_refs a bitfield.
2061         (ppc_elf_check_relocs): Set new flags.
2062         (ppc_elf_link_hash_table_create): Update default_params.
2063         (ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
2064         where we won't be making .dynbss entries or editing code.  Set
2065         params->pic_fixup when we'll edit code for protected var access.
2066         (allocate_dynrelocs): Allocate got entry for edited code and
2067         discard dyn_relocs.
2068         (struct ppc_elf_relax_info): Add picfixup_size.
2069         (ppc_elf_relax_section): Rename struct one_fixup to struct
2070         one_branch_fixup.  Rename fixups to branch_fixups.  Size space for
2071         pic fixups.
2072         (ppc_elf_relocate_section): Edit non-PIC accessing protected
2073         visibility variables to PIC.  Don't emit dyn_relocs for code
2074         we've edited.
2075         * elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
2076
2077 2015-04-07  Nick Clifton  <nickc@redhat.com>
2078
2079         * elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
2080         local labels as local.
2081
2082 2015-04-06  H.J. Lu  <hongjiu.lu@intel.com>
2083
2084         * compress.c (get_uncompressed_size): Removed.
2085         (bfd_compress_section_contents): Use bfd_putb64 to write
2086         uncompressed section size.
2087         (bfd_init_section_decompress_status): Replace
2088         get_uncompressed_size with bfd_getb64.
2089
2090 2015-04-04  H.J. Lu  <hongjiu.lu@intel.com>
2091
2092         * elf.c (_bfd_elf_init_private_section_data): Also preserve the
2093         SHF_COMPRESSED bit if not decompress.
2094
2095 2015-04-04  H.J. Lu  <hongjiu.lu@intel.com>
2096
2097         * compress.c (get_uncompressed_size): New.  Extracted from ...
2098         (bfd_init_section_decompress_status): This.  Use it.
2099
2100 2015-04-02  Andrew Turner  <andrew@freebsd.org>
2101
2102         * config.bfd: Add aarch64-*-freebsd* target triple.
2103
2104 2015-04-02  H.J. Lu  <hongjiu.lu@intel.com>
2105
2106         * configure: Regenerated.
2107
2108 2015-04-01  Tejas Belagod  <tejas.belagod@arm.com>
2109             Marcus Shawcroft  <marcus.shawcroft@arm.com>
2110             Jiong Wang  <jiong.wang@arm.com>
2111
2112         * bfd-in.h (bfd_elf64_aarch64_set_options)
2113         (bfd_elf32_aarch64_set_options): Add parameter.
2114         * bfd-in2.h: Regenerated.
2115         * elfnn-aarch64.c (aarch64_erratum_843419_stub)
2116         (_bfd_aarch64_adrp_p, _bfd_aarch64_erratum_843419_sequence_p)
2117         (_bfd_aarch64_erratum_843419_stub_name)
2118         (_bfd_aarch64_erratum_843419_fixup)
2119         (_bfd_aarch64_erratum_843419_scan)
2120         (_bfd_aarch64_erratum_843419_branch_to_stub)
2121         (_bfd_aarch64_erratum_843419_p): Define.
2122         (enum elf_aarch64_stub_type): Define
2123         aarch64_stub_erratum_843419_veneer.
2124         (struct elf_aarch64_stub_hash_entry): Define adrp_offset.
2125         (struct elf_aarch64_link_hash_table): Define fix_erratum_843419
2126         and fix_erratum_843419_adr.
2127         (stub_hash_newfunc): Initialize adrp_offset;
2128         (_bfd_aarch64_add_stub_entry_after): Define.
2129         (aarch64_map_one_stub, aarch64_build_one_stub)
2130         (aarch64_size_one_stub): Handle
2131         aarch64_stub_erratum_843419_veneer.
2132         (_bfd_aarch64_resize_stubs): Round stub section size.
2133         (elfNN_aarch64_size_stubs): Add scan for 843419.
2134         (bfd_elfNN_aarch64_set_options): Add parameter. Initialize
2135         fix_erratum_843419 and fix_erratum_843419_adr.
2136         (struct erratum_835769_branch_to_stub_data): Add info.
2137         (elfNN_aarch64_write_section): Initialise info.  Handle 843419.
2138         (elfNN_aarch64_size_dynamic_sections): Handle 843419.
2139         * elfxx-aarch64.c (_bfd_aarch64_decode_adrp_imm)
2140         (_bfd_aarch64_sign_extend): Define.
2141         (reencode_adr_imm): Remove static. Rename to:
2142         (_bfd_aarch64_reencode_adr_imm): Define.
2143         (_bfd_aarch64_elf_put_addend): Call _bfd_aarch64_reencode_adr_imm.
2144         * elfxx-aarch64.h (AARCH64_ADR_OP, AARCH64_ADRP_OP)
2145         (AARCH64_ADRP_OP_MASK, _bfd_aarch64_sign_extend)
2146         (_bfd_aarch64_decode_adrp_imm, _bfd_aarch64_reencode_adr_imm):
2147         Define.
2148
2149 2015-04-01  H.J. Lu  <hongjiu.lu@intel.com>
2150
2151         * configure: Regenerated.
2152
2153 2015-03-31  Ed Schouten  <ed@nuxi.nl>
2154
2155         * config.bfd (targ_defvec): Set to x86_64_elf64_cloudabi_vec
2156         for x86_64-*-cloudabi*.
2157         * configure.ac: Handle x86_64_elf64_cloudabi_vec.
2158         * configure: Regenerated.
2159         * elf64-x86-64.c (TARGET_LITTLE_SYM): Support x86_64-*-cloudabi*.
2160         (TARGET_LITTLE_NAME): Likewise.
2161         (ELF_OSABI): Likewise.
2162         (elf64_bed): Likewise.
2163         * targets.c (x86_64_elf64_cloudabi_vec): New.
2164         (_bfd_target_vector): Add x86_64_elf64_cloudabi_vec.
2165
2166 2015-03-31  H.J. Lu  <hongjiu.lu@intel.com>
2167
2168         * configure.ac: Revert the AM_ZLIB change.
2169         * Makefile.in: Regenerated.
2170         * aclocal.m4: Likewise.
2171         * configure: Likewise.
2172         * doc/Makefile.in: Likewise.
2173
2174 2015-03-30  H.J. Lu  <hongjiu.lu@intel.com>
2175
2176         PR ld/18169
2177         * elf-bfd.h (elf_backend_data): Add get_reloc_section.
2178         (_bfd_elf_get_reloc_section): New.
2179         * elf.c (_bfd_elf_get_reloc_section): Likewise.
2180         (assign_section_numbers): Call get_reloc_section to look up the
2181         section the relocs apply.
2182         * elfxx-target.h (elf_backend_get_reloc_section): Likewise.
2183         (elfNN_bed): Initialize get_reloc_section with
2184         elf_backend_get_reloc_section.
2185
2186 2015-03-29  H.J. Lu  <hongjiu.lu@intel.com>
2187
2188         * Makefile.am (ZLIB): New.
2189         (ZLIBINC): Likewise.
2190         (AM_CFLAGS): Add $(ZLIBINC).
2191         (libbfd_la_LIBADD): Add $(ZLIB).
2192         * compress.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
2193         (decompress_contents): Don't check HAVE_ZLIB_H.
2194         (bfd_compress_section_contents): Likewise.
2195         (bfd_get_full_section_contents): Likewise.
2196         (bfd_init_section_decompress_status): Likewise.
2197         (bfd_init_section_compress_status): Likewise.
2198         * configure.ac (AM_ZLIB): Removed.
2199         (zlibdir): New.  AC_SUBST.
2200         (zlibinc): Likewise.
2201         Add --with-system-zlib.
2202         * Makefile.in: Regenerated.
2203         * acinclude.m4: Likewise.
2204         * config.in: Likewise.
2205         * configure: Likewise.
2206         * doc/Makefile.in: Likewise.
2207
2208 2015-03-27  Alan Modra  <amodra@gmail.com>
2209
2210         PR ld/15228
2211         PR ld/18167
2212         * elflink.c (elf_merge_st_other): Add "sec" parameter.  Don't set
2213         protected_def when symbol section is read-only.  Adjust all calls.
2214         * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
2215
2216 2015-03-26  Tejas Belagod  <tejas.belagod@arm.com>
2217
2218         * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
2219         _bfd_final_link_relocate with aarch64_relocate.
2220
2221 2015-03-26  H.J. Lu  <hongjiu.lu@intel.com>
2222
2223         PR ld/18160
2224         * elflink.c (elf_gc_sweep): Skip if relocation is incompatible.
2225         (bfd_elf_gc_sections): Likewise.
2226
2227 2015-03-25  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2228
2229         * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Adjust stub section
2230         size for initial branch.
2231         (elfNN_aarch64_build_stubs): Write initial branch.
2232         _bfd_aarch64_decode_(elfNN_aarch64_output_arch_local_syms): Write
2233         mapping symbol on initial branch.
2234
2235 2015-03-25  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2236
2237         * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan):
2238         Update erratum count.
2239
2240 2015-03-25  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
2241
2242         * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on
2243         first matching debug section.
2244
2245 2015-03-24  H.J. Lu  <hongjiu.lu@intel.com>
2246
2247         PR gas/18087
2248         * compress.c (bfd_compress_section_contents): Don't write the
2249         zlib header and set contents as well as compress_status if
2250         compression didn't make the section smaller.
2251         (bfd_init_section_compress_status): Don't check compression
2252         size here.
2253
2254 2015-03-24  Nick Clifton  <nickc@redhat.com>
2255
2256         PR binutils/17512
2257         * coffgen.c (coff_get_normalized_symtab): Fix test for out of
2258         range auxillary sections.
2259
2260 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2261
2262         * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor
2263         code into:
2264         (_bfd_aarch64_get_stub_for_link_section): Define.
2265
2266 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2267
2268         * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Adjust
2269         update of section_group[].stub_sec.
2270
2271 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2272
2273         * elfnn-aarch64.c (struct aarch64_erratum_835769_fix) Remove.
2274         (erratum_835769_scan) Drop fix_table_size_p and fixes_p arguments.
2275         Delete fixes, fix_table_size and associated code.  Call
2276         _bfd_aarch64_add_stub_entry_in_group. Rename to...
2277         (bfd_aarch64_erratum_835769_scan): Define.
2278         (elfNN_aarch64_size_stubs): Delete erratum_835769_fixes,
2279         erratum_835769_fix_table_size, i and associated code.  Relocate
2280         call to _bfd_aarch64_erratum_835769_scan.  Delete adhoc stub size
2281         correction.  Delete construction of stub entry from
2282         erratum_835769_fixes array.
2283
2284 2015-03-24  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2285
2286         * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Use
2287         _bfd_aarch64_add_stub_entry_in_group.
2288
2289 2015-03-24  Alan Modra  <amodra@gmail.com>
2290
2291         * elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
2292         stubs, even those for undefined weak symbols.  Otherwise, don't
2293         report relocation overflow on branches to undefined strong
2294         symbols.  Fix memory leak.
2295         * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
2296         overflow on branches to undefined strong symbols.
2297
2298 2015-03-23  Keith Seitz  <keiths@redhat.com>
2299
2300         * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Add
2301         missing ';'.
2302
2303 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2304
2305         * elfnn-aarch64.c (erratum_835769_scan): Factor stub name
2306         construction into...
2307         (_bfd_aarch64_erratum_835769_stub_name): Define.
2308
2309 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2310
2311         * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Factor out
2312         stub resize code into...
2313         (bfd_aarch64_resize_stubs): Define.
2314
2315 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2316
2317         * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Factor stub
2318         creation code into...
2319         (bfd_aarch64_create_stub_section): Define.
2320
2321 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2322
2323         * elfnn-aarch64.c (_bfd_aarch64_create_or_find_stub_sec): Rename
2324         from elf_aarch64_create_or_find_stub_sec.
2325         (_bfd_aarch64_add_stub_entry_in_group): Rename from
2326         elfNN_aarch64_add_stub.  Call
2327         _bfd_aarch64_create_or_find_stub_sec.
2328         (elfNN_aarch64_size_stubs, elfNN_aarch64_size_stubs): Call
2329         _bfd_aarch64_add_stub_entry_in_group.
2330
2331 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2332
2333         * elfnn-aarch64.c (erratum_835769_scan) Add comment.  Reverse
2334         sense of boolean return.
2335         (elfNN_aarch64_size_stubs): Adjust for above.
2336
2337 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2338
2339         * elfnn-aarch64.c (elf_aarch64_create_or_find_stub_sec):
2340         Remove unused parameter.
2341         (elfNN_aarch64_size_stubs): Adjust for above.
2342
2343 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2344
2345         * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Remove bfd_indx.
2346
2347 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2348
2349         * elfnn-aarch64.c (aarch64_erratum_835769_fixes)
2350         (num_aarch64_erratum_835769_fixes): Remove.
2351         (elfNN_aarch64_size_stubs): Remove assignments to above.
2352
2353 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2354
2355         * elfnn-aarch64.c (aarch64_mem_op_p): Update comment. Rename rtn
2356         to rt2.
2357         (aarch64_erratum_seqeunce): Rename rtn to rt2.
2358
2359 2015-03-23  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2360
2361         * elfnn-aarch64.c (elfNN_aarch64_write_section): Adjust layout.
2362
2363 2015-03-19  Nick Clifton  <nickc@redhat.com>
2364
2365         * elf32-rl78.c (rl78_cpu_name): New function.  Prints the name of
2366         the RL78 core based upon the flags.
2367         (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
2368         flags.
2369         (rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
2370         (elf32_rl78_machine): Always return bfd_mach_rl78.
2371
2372 2015-03-19  Nick Clifton  <nickc@redhat.com>
2373
2374         PR 18078
2375         * compress.c (bfd_compress_section_contents): Do not define this
2376         function if it is not used.
2377
2378 2015-03-18  H.J. Lu  <hongjiu.lu@intel.com>
2379
2380         * compress.c (bfd_compress_section_contents): Make it static.
2381         * bfd/bfd-in2.h: Regenerated.
2382
2383 2015-03-18  Eric Youngdale  <eyoungdale@ptc.com>
2384
2385         PR ld/16598
2386         * peicode.h (pe_ILF_build_a_bfd): Add support for creating relocs
2387         suitable for the AMD64.
2388
2389 2015-03-18  Jon Turney  <jon.turney@dronecode.org.uk>
2390             Nick Clifton  <nickc@redhat.com>
2391
2392         PR binutils/18087
2393         * coffgen.c (make_a_section_from_file): Only prepend a z to a
2394         debug section's name if the section was actually compressed.
2395         * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
2396         * compress.c (bfd_init_section_compress_status): Do not compress
2397         the section if doing so would make it bigger.  In such cases leave
2398         the section alone and return COMPRESS_SECTION_NONE.
2399
2400 2015-03-17  Alan Modra  <amodra@gmail.com>
2401
2402         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return count of 0
2403         on nothing to do, before malloc of returned symbol array.
2404
2405 2015-03-16  Nick Clifton  <nickc@redhat.com>
2406
2407         * elf32-rx.c (elf32_rx_relax_delete_bytes): If the relocs are not
2408         stored in the elf_section_data structure then load them as
2409         necessary.
2410
2411 2015-03-14  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2412
2413         * elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
2414         relocs against code sections.
2415         * elf32-s390.c: Define elf_backend_sort_relocs_p.
2416         * elf64-s390.c: Likewise.
2417
2418 2015-03-11  Alan Modra  <amodra@gmail.com>
2419
2420         * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
2421         reverse order.  Account for larger size of __tls_get_addr_opt stub.
2422
2423 2015-03-10  Yuri Gribov  <y.gribov@samsung.arm>
2424
2425         PR ld/16572
2426         * elf32-arm.c (elf32_arm_final_link_relocate): Remove support for
2427         ELF_ARM_HASENTRY.
2428         (elf32_arm_print_private_bfd_data): Likewise.
2429
2430 2015-03-06  Nick Clifton  <nickc@redhat.com>
2431
2432         PR binutils/17765
2433         * elflink.c (put_value): Like previous delta, but for the 32-bit
2434         case.
2435
2436 2015-03-05  Nick Clifton  <nickc@redhat.com>
2437
2438         PR binutils/17765
2439         * elflink.c (put_value): Avoid using an undefined shift
2440         operation.
2441
2442 2015-03-05  H.J. Lu  <hongjiu.lu@intel.com>
2443
2444         PR ld/pr15228
2445         PR ld/pr17709
2446         * elf-bfd.h (elf_backend_data): Add extern_protected_data.
2447         * elf32-i386.c (elf_backend_extern_protected_data): New.
2448         Defined to 1.
2449         * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
2450         * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
2451         copy relocs against protected symbols if extern_protected_data
2452         is true.
2453         (_bfd_elf_symbol_refs_local_p): Don't return true on protected
2454         non-function symbols if extern_protected_data is true.
2455         * elfxx-target.h (elf_backend_extern_protected_data): New.
2456         Default to 0.
2457         (elfNN_bed): Initialize extern_protected_data with
2458         elf_backend_extern_protected_data.
2459
2460 2015-03-05  Nick Clifton  <nickc@redhat.com>
2461
2462         PR binutils/18025
2463         * coffgen.c (coff_find_nearest_line_with_names): If the dwarf2
2464         lookup fails, check for an address bias in the dwarf info, and if
2465         one exists, retry the lookup with the biased value.
2466         * dwarf2.c (_bfd_dwarf2_find_symbol_bias): New function.
2467         Determines if a bias exists bewteen the addresses of functions
2468         based on DWARF information vs symbol table information.
2469         * libbfd-in.h (_bfd_dwarf2_find_symbol_bias): Prototype.
2470         * libbfd.h: Regenerate.
2471
2472 2015-03-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2473
2474         * elfxx-aarch64.c (decode_add_imm, decode_movw_imm)
2475         (decode_tst_branch_ofs_14, decode_ld_lit_ofs_19)
2476         (decode_cond_branch_ofs_19, decode_branch_ofs_26): Remove.
2477
2478 2015-03-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2479
2480         * elfnn-aarch64.c (aarch64_build_one_stub): Call abort.
2481         (aarch64_size_one_stub): Likewise.
2482         (aarch64_map_one_stub): Likewise.
2483
2484 2015-03-04  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2485
2486         * cpu-s390.c (N): New macro.
2487         (bfd_s390_31_arch): New.  Define only if default target word size
2488         is 64 bits.  Otherwise define...
2489         (bfd_390_64_arch): ...this.  Make static.
2490         (bfd_s390_arch): Define according to the default target word size.
2491         Let the 'next' field point to the alternate arch.
2492
2493 2015-03-04  Richard Sandiford  <richard.sandiford@arm.com>
2494
2495         PR gas/17843
2496         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
2497         R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
2498         to be used with MOVK rather than MOVZ.
2499
2500 2015-03-03  DJ Delorie  <dj@redhat.com>
2501
2502         * elf32-rl78.c (rl78_elf_relax_section): Only relax ADDR16's if
2503         there's a symbol.
2504
2505 2015-02-28  Alan Modra  <amodra@gmail.com>
2506
2507         * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
2508         not PLT_NEW.
2509
2510 2015-02-27  H.J. Lu  <hongjiu.lu@intel.com>
2511
2512         * elf32-i386.c (need_convert_mov_to_lea): New.
2513         (elf_i386_check_relocs): Set need_convert_mov_to_lea if needed.
2514         (elf_i386_convert_mov_to_lea): Return TRUE if
2515         need_convert_mov_to_lea is unset.
2516         * elf64-x86-64.c (need_convert_mov_to_lea): New.
2517         (elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed.
2518         (elf_x86_64_convert_mov_to_lea): Return TRUE if
2519         need_convert_mov_to_lea is unset.
2520
2521 2015-02-27  Nick Clifton  <nickc@redhat.com>
2522
2523         PR binutils/17910
2524         * coffgen.c (_bfd_coff_internal_syment_name): Only check for
2525         string length overflow when the string table length is actually
2526         set.
2527
2528 2015-02-27  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2529
2530         * bfd/bfd-in2.h: Regenerate.
2531         * bfd/libbfd.h: Regenerate.
2532
2533 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2534
2535         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix
2536         TLSDESC_LD_PREL19 field width and masks.
2537         (aarch64_tls_transition_without_check)
2538         (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
2539         (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
2540         (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
2541         BFD_RELOC_AARCH64_TLSDESC_LD_PREL19.
2542         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2543         (_bfd_aarch64_elf_resolve_relocation): Likewise.
2544
2545 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2546
2547         * elfnn-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Reorder R_TYPE
2548         tests.
2549         (aarch64_tls_transition_without_check)
2550         (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
2551         (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
2552         (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
2553         BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21.
2554         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2555         (_bfd_aarch64_elf_resolve_relocation): Likewise.
2556         * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
2557
2558 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2559
2560         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC)
2561         (elfNN_aarch64_howto_table, aarch64_tls_transition_without_check)
2562         (aarch64_reloc_got_type, elfNN_aarch64_final_link_relocate)
2563         (elfNN_aarch64_tls_relax, elfNN_aarch64_relocate_section)
2564         (elfNN_aarch64_gc_sweep_hook, elfNN_aarch64_check_relocs): Handle
2565         BFD_RELOC_AARCH64_TLSGD_ADR_PREL21.
2566         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2567         (_bfd_aarch64_elf_resolve_relocation): Likewise.
2568         * reloc.c (BFD_RELOC_AARCH64_TLSGD_ADR_PREL21): Define.
2569
2570 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2571
2572         * elfnn-aarch64.c: (TLSIE_LD_GOTTREL_PREL19): Fix HOWTO bit field width.
2573         (aarch64_tls_transition_without_check, aarch64_reloc_got_type)
2574         (elfNN_aarch64_final_link_relocate, elfNN_aarch64_tls_relax)
2575         (elfNN_aarch64_relocate_section, elfNN_aarch64_gc_sweep_hook)
2576         (elfNN_aarch64_check_relocs): Handle
2577         BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19.
2578
2579         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend)
2580         (_bfd_aarch64_elf_resolve_relocation): Likewise.
2581
2582 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2583
2584         * elfnn-aarch64.c: (TLSDESC_CALL): Fix HOWTO bit field width.
2585
2586 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2587
2588         * elfnn-aarch64.c (TLSLE_MOVW_TPREL_G2)
2589         (TLSLE_MOVW_TPREL_G1, TLSLE_MOVW_TPREL_G1_NC)
2590         (TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC): Fix bit field
2591         width.
2592
2593 2015-02-26  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2594
2595         * elfnn-aarch64.c: (TLSIE_MOVW_GOTTPREL_G0_NC): Fix HOWTO bit
2596         field width.
2597
2598 2015-02-26  Nick Clifton  <nickc@redhat.com>
2599
2600         PR binutils/17512
2601         * coffcode.h (coff_compute_section_file_positions): Report
2602         negative page sizes.
2603         * elf.c (elf_fake_sections): Handle excessive alignmment powers.
2604         (assign_file_positions_for_non_load_sections): Replace assertion
2605         with an error message.
2606         (rewrite_elf_program_header): Handle excessive segment
2607         alignments.
2608         * mach-o.c (bfd_mach_o_read_section_32): Likewise.
2609         (bfd_mach_o_read_section_64): Likewise.
2610         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Use %B to
2611         print a bfd name, not %A.
2612
2613 2015-02-26  Alan Modra  <amodra@gmail.com>
2614
2615         * elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
2616         thread-safe stubs for iplt.
2617         (build_tls_get_addr_stub): Restore r2 immediately after call.
2618
2619 2015-02-26  Terry Guo  <terry.guo@arm.com>
2620
2621         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we
2622         merge Tag_ABI_HardFP_use.
2623
2624 2015-02-26  Alan Modra  <amodra@gmail.com>
2625
2626         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
2627         Use text relocs rather than giving an error on trying to use
2628         .dynbss for protected shared lib vars.
2629         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
2630
2631 2015-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
2632
2633         * elf32-avr.c (struct elf_avr_section_data): New structure.
2634         (struct avr_relax_info): New structure.
2635         (elf_avr_new_section_hook): New function.
2636         (struct elf_avr_section_data): Add relax_info.
2637         (get_avr_relax_info): New function.
2638         (init_avr_relax_info): New function.
2639         (elf32_avr_relax_delete_bytes): Find next property record before
2640         deleting bytes.  When deleting don't move bytes beyond the next
2641         property record.
2642         (avr_elf32_assign_records_to_section): New function.
2643         (avr_property_record_compare): New function.
2644         (avr_load_all_property_sections): New function.
2645         (elf32_avr_relax_section): Load property data.  After relaxing the
2646         section, move any .align directives that have enough deleted bytes
2647         before them.
2648         (bfd_elf32_new_section_hook): Define.
2649
2650 2015-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
2651
2652         * elf32-avr.h (struct avr_property_header): New strucure.
2653         (avr_elf32_load_property_records): Declare.
2654         (avr_elf32_property_record_name): Declare.
2655         * elf32-avr.c: Add bfd_stdint.h include.
2656         (retrieve_local_syms): New function.
2657         (get_elf_r_symndx_section): New function.
2658         (get_elf_r_symndx_offset): New function.
2659         (internal_reloc_compare): New function.
2660         (struct avr_find_section_data): New structure.
2661         (avr_is_section_for_address): New function.
2662         (avr_find_section_for_address): New function.
2663         (avr_elf32_load_records_from_section): New function.
2664         (avr_elf32_load_property_records): New function.
2665         (avr_elf32_property_record_name): New function.
2666
2667 2015-02-25  Andrew Burgess  <andrew.burgess@embecosm.com>
2668
2669         * elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
2670         (AVR_PROPERTY_RECORDS_VERSION): Define.
2671         (AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
2672         (struct avr_property_record): New structure.
2673
2674 2015-02-24  Nick Clifton  <nickc@redhat.com>
2675
2676         * elf32-v850.c (v850_set_note): New function.  Creates a Renesas
2677         style note entry.
2678         (v850_elf_make_note_section): New function.  Creates a note
2679         section.
2680         (v850_elf_create_sections): New function.  Create a note section
2681         if one is not already present.
2682         (v850_elf_set_note): New function.  Adds a note to a bfd.
2683         (v850_elf_copy_private_bfd_data): New function.  Copies V850
2684         notes.
2685         (v850_elf_merge_notes): New function.  Merges V850 notes.
2686         (print_v850_note): New function.  Displays a V850 note.
2687         (v850_elf_print_notes): New function. Displays all notes attached
2688         to a bfd.
2689         (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
2690         (v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
2691         (v850_elf_fake_sections): Set the type of the V850 note section.
2692         * bfd-in.h (v850_elf_create_sections): Add prototype.
2693         (v850_elf_set_note): Add prototype.
2694         * bfd-in2.h: Regenerate.
2695
2696 2015-02-24  Nick Clifton  <nickc@redhat.com>
2697
2698         * configure.ac (AC_CHECK_HEADERS): Add wctype.h.
2699         * configure: Regenerate.
2700         * config.in: Regenerate.
2701         * peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined.
2702         (u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined.
2703         (rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H
2704         is defined.
2705
2706 2015-02-24  Nick Clifton  <nickc@redhat.com>
2707
2708         * pdp11.c (set_section_contents): Pad the .text and .data sections
2709         to their aligned sizes.
2710
2711 2015-02-23  Yoshinori Sato <ysato@users.sourceforge.jp>
2712
2713         * config.bfd: Add h8300-*-linux.
2714         * configure.ac: Add h8300_elf32_linux_vec.
2715         * configure: Regenerate.
2716         * elf32-h8300.c: Likewise.
2717         * targets.c(_bfd_target_vector): Likewise.
2718
2719 2015-02-23  Nick Clifton  <nickc@redhat.com>
2720
2721         PR 17914
2722         * cpu-w65.c: Correct typos in license notice.
2723
2724         PR 17940
2725         * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
2726         symbols at end of sections.  Adjust function sizes.
2727
2728 2015-02-20  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2729
2730         * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
2731         (elfcore_write_s390_vxrs_high): Likewise.
2732         * elf.c (elfcore_grok_s390_vxrs_low): New function.
2733         (elfcore_grok_s390_vxrs_high): New function.
2734         (elfcore_grok_note): Call them.
2735         (elfcore_write_s390_vxrs_low): New function.
2736         (elfcore_write_s390_vxrs_high): New function.
2737         (elfcore_write_register_note): Call them.
2738
2739 2015-02-19  Branko Drevensek  <branko.drevensek@gmail.com>
2740
2741         PR 17995
2742         * verilog.c (verilog_write_record): Correct buffer size.
2743
2744 2015-02-19  Alan Modra  <amodra@gmail.com>
2745
2746         * elflink.c (_bfd_elf_define_linkage_sym): Set 'bed' earlier.
2747
2748 2015-02-19  Alan Modra  <amodra@gmail.com>
2749
2750         PR ld/4317
2751         * elflink.c (elf_link_input_bfd): Drop undefined local syms.
2752         (elf_link_output_extsym): Drop local and global undefined syms.
2753         Tidy.  Expand comment.
2754
2755 2015-02-17  Alan Modra  <amodra@gmail.com>
2756
2757         PR ld/17975
2758         * elflink.c (struct elf_outext_info): Remove need_second_pass
2759         and second_pass.
2760         (elf_link_output_extsym): Delete code handling second forced
2761         local pass.  Move code emitting NULL STT_FILE symbol later, so
2762         that it can be omitted if forced local is stripped.  Don't
2763         emit the NULL STT_FILE if no file symbols have been output.
2764         (bfd_elf_final_link): Remove second forced local pass.
2765         * elf32-ppc.c (add_stub_sym): Set linker_def on linker syms.
2766         (ppc_elf_size_dynamic_sections): Likewise.
2767         * elf64-ppc.c (ppc_build_one_stub): Likewise.
2768         (build_global_entry_stubs): Likewise.
2769         (ppc64_elf_build_stubs): Likewise.
2770
2771 2015-02-16  H.J. Lu  <hongjiu.lu@intel.com>
2772
2773         PR ld/17975
2774         * elflink.c (elf_link_output_extsym): Only check filesym_count
2775         when outputting a NULL FILE symbol.  Set second_pass_sym to
2776         h->forced_local && !h->root.linker_def.
2777
2778 2015-02-15  H.J. Lu  <hongjiu.lu@intel.com>
2779
2780         * elf32-i386.c (elf_i386_always_size_sections): Set root.linker_def
2781         on _TLS_MODULE_BASE_.
2782         * elf64-x86-64.c (elf_x86_64_always_size_sections): Likewise.
2783
2784 2015-02-15  Alan Modra  <amodra@gmail.com>
2785
2786         * dwarf2.c (read_rangelist): Correct buffer overflow check
2787         Whitespace throughout file.
2788
2789 2015-02-14  Alan Modra  <amodra@gmail.com>
2790
2791         PR ld/17973
2792         * bfd.c (struct bfd): Add lto_output.
2793         * linker.c (_bfd_handle_already_linked): Explicitly test for
2794         objects added by the lto plugin.
2795         * opncls.c (_bfd_new_bfd_contained_in): Copy lto_output and
2796         no_export flags from archive.
2797         * archive.c (open_nested_file): New function, setting lto_output
2798         and no_export, extracted from..
2799         (find_nested_archive): ..here.  Flip params.  Rename from
2800         _bfd_find_nested_archive.
2801         (_bfd_get_elt_at_filepos): Correct var typo.  Use open_nested_file.
2802         (_bfd_look_for_bfd_in_cache): Copy no_export.
2803         * elflink.c (elf_link_add_object_symbols): Remove now unnecessary
2804         my_archive->no_export test.
2805         (elf_link_input_bfd): Drop existing lto_output STT_FILE syms.
2806         Don't use the file name when adding lto_output STT_FILE sym.
2807         * bfd-in2.h: Regenerate.
2808
2809 2015-02-13  Alan Modra  <amodra@gmail.com>
2810
2811         PR binutils/17512
2812         * elf64-ppc.c (opd_entry_value): Tighten offset check.  Remove
2813         now redundant assert.
2814
2815 2015-02-12  Nick Clifton  <nickc@redhat.com>
2816
2817         PR binutils/17512
2818         * dwarf.c (read_1_byte, read_1_signed_byte, read_2_bytes)
2819         (read_4_bytes, read_8_bytes, read_n_bytes, read_string)
2820         (read_indirect_string, read_alt_indirect_string)
2821         (read_alt_indirect_ref, read_address, read_abbrevs)
2822         (read_attribute_value, read_attribute, decode_line_info)
2823         (find_abstract_instance_name, read_rangelist)
2824         (scan_unit_for_symbols, parse_comp_unit)
2825         (_bfd_dwarf2_find_nearest_line): Harden DWARF reading code.  Pass
2826         end pointers to reading functions and check for offsets taking
2827         pointers out of range.  Replace calls to read_*_leb128 with calls
2828         to safe_read_leb128.
2829
2830         (* elf64-ppc.c (opd_entry_value): Add a check for an overlarge
2831         offset.
2832         * syms.c (_bfd_stab_section_find_nearest_line): Add checks for
2833         computed file_name address being before the start of the string
2834         table.
2835
2836 2015-02-11  H.J. Lu  <hongjiu.lu@intel.com>
2837
2838         PR ld/17878
2839         * bfd.c (bfd_plugin_format): New.
2840         (bfd): Add plugin_format and plugin_dummy_bfd.
2841         * plugin.c (try_load_plugin): Take a pointer to bfd_boolean
2842         argument to return TRUE if any plugin is found.  Set plugin_format.
2843         (has_plugin): New.
2844         (bfd_plugin_target_p): New.
2845         (bfd_plugin_specified_p): Likewise.
2846         (bfd_plugin_target_p): Likewise.
2847         (register_ld_plugin_object_p): Likewise.
2848         (bfd_plugin_set_plugin): Set has_plugin.
2849         (load_plugin): Cache try_load_plugin result.
2850         (bfd_plugin_object_p): Try ld_plugin_object_p first.  Check
2851         plugin_format.
2852         * plugin.h (bfd_plugin_target_p): New.
2853         (bfd_plugin_specified_p): Likewise.
2854         (register_ld_plugin_object_p): Likewise.
2855         * bfd-in2.h: Regenerated.
2856
2857 2015-02-11  Pedro Alves  <palves@redhat.com>
2858
2859         * libbfd-in.h [__cplusplus]: Open extern "C" scope.
2860         * libcoff-in.h [__cplusplus]: Open extern "C" scope.
2861         * libbfd.h: Regenerate.
2862         * libcoff.h: Regenerate.
2863
2864         * elf-bfd.h [__cplusplus]: Wrap in extern "C".
2865         * mach-o.h [__cplusplus]: Wrap in extern "C".
2866         * som.h [__cplusplus]: Wrap in extern "C".
2867
2868 2015-02-10  Nick Clifton  <nickc@redhat.com>
2869
2870         PR binutils/17512
2871         * coffcode.h (styp_to_sec_flags): Use an unsigned long type to
2872         hold the flag bits.
2873         * peXXigen.c (pe_print_reloc): Use unsigned types to hold the
2874         size and number of relocs.
2875         (pe_print_debugdata): Use a 32-bit aligned buffer to store the
2876         codeview record.
2877         * versados.c (process_otr): Check the esdid value before using it
2878         to access the EDATA.
2879
2880 2015-02-09  Ed Maste  <emaste@freebsd.org>
2881
2882         * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
2883         uninitialized and unused variable.
2884         * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
2885
2886 2015-02-09  Alan Modra  <amodra@gmail.com>
2887
2888         * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
2889         tls_sec.
2890         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2891         * elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
2892
2893 2015-02-09  Alan Modra  <amodra@gmail.com>
2894
2895         * elflink.c: Whitespace, formatting fixes.
2896         (elf_link_input_bfd): Clarify comment.
2897         (elf_link_output_extsym): Exclude symbols in linker created
2898         sections when testing for plugin symbols.
2899
2900 2015-02-07  H.J. Lu  <hongjiu.lu@intel.com>
2901
2902         PR ld/17935
2903         * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a
2904         warning for relocation in readonly section for -z text.
2905         (elf_i386_size_dynamic_sections): Likewise.
2906         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
2907         (elf_x86_64_size_dynamic_sections): Likewise.
2908
2909 2015-02-06  H.J. Lu  <hongjiu.lu@intel.com>
2910
2911         PR ld/12365
2912         PR ld/14272
2913         * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change.
2914         (elf_link_input_bfd): Mark the plugin symbol undefined if it is
2915         referenced from a non-IR file.
2916
2917 2015-02-06  Nick Clifton  <nickc@redhat.com>
2918
2919         PR binutils/17512
2920         * peXXigen.c (rsrc_print_resource_entries): Add range check for
2921         addresses that wrap around the address space.
2922         (rsrc_parse_entry): Likewise.
2923
2924 2015-02-03  H.J. Lu  <hongjiu.lu@intel.com>
2925
2926         PR ld/12365
2927         PR ld/14272
2928         * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol
2929         undefined if it is referenced from a non-IR file.
2930
2931 2015-02-03  Nick Clifton  <nickc@redhat.com>
2932
2933         PR binutils/17512
2934         * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
2935         (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
2936         index or an out of range fdr index.
2937         * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
2938         * elf32-arc.c (arc_info_to_howto_rel): Likewise.
2939         * elf32-avr.c (avr_info_to_howto_rela): Likewise.
2940         * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
2941         * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
2942         * elf32-cris.c (cris_info_to_howto_rela): Likewise.
2943         * elf32-crx.c (elf_crx_info_to_howto): Likewise.
2944         * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
2945         * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
2946         * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
2947         * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
2948         * elf32-frv.c (frv_info_to_howto_rela): Likewise.
2949         * elf32-i370.c (i370_elf_info_to_howto): Likewise.
2950         * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
2951         * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
2952         * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
2953         * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
2954         * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
2955         * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
2956         * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
2957         * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
2958         * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
2959         * elf32-mep.c (mep_info_to_howto_rela): Likewise.
2960         * elf32-metag.c (metag_info_to_howto_rela): Likewise.
2961         * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
2962         * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
2963         * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
2964         * elf32-mt.c (mt_info_to_howto_rela): Likewise.
2965         * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
2966         * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
2967         * elf32-pj.c (pj_elf_info_to_howto): Likewise.
2968         * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
2969         * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
2970         * elf32-rx.c (rx_info_to_howto_rela): Likewise.
2971         * elf32-sh.c (sh_elf_info_to_howto): Likewise.
2972         * elf32-spu.c (spu_elf_info_to_howto): Likewise.
2973         * elf32-v850.c (v850_elf_perform_relocation): Likewise.
2974         * elf32-vax.c (rtype_to_howto): Likewise.
2975         * elf32-visium.c (visium_info_to_howto_rela): Likewise.
2976         * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
2977         * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
2978         * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
2979         * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
2980         * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
2981         (bfd_mach_o_canonicalize_one_reloc): Fix check on out
2982         of range symbol indicies.
2983         (bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
2984         (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
2985         (bfd_mach_o_build_dysymtab): Likewise.
2986         (bfd_mach_o_write_symtab_content): Set the string table size to
2987         zero upon error.
2988         (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
2989         read fails.
2990         * peXXigen.c (pe_print_edata):  Check for numeric overflow in edt
2991         fields.
2992         * tekhex.c (first_phase): Check for src pointer reaching end of
2993         buffer.
2994
2995 2015-02-03  Will Newton  <will.newton@linaro.org>
2996
2997         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
2998         Set st_value to zero for undefined symbols if the reference
2999         is weak or pointer_equality_needed is FALSE.
3000
3001         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Improve
3002           comment discussing why we clear st_value for some symbols.
3003
3004 2015-02-02  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3005
3006         * elf32-nds32.c (nds32_get_section_contents): Add one more argument.
3007         (nds32_elf_relocate_section): Do not relocate R_NDS32_LONGJUMP7.
3008
3009 2015-01-29  Alan Modra  <amodra@gmail.com>
3010
3011         * elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
3012         optimization.  Tidy mask for GOT_TLSGD optimization.
3013         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.  Correct
3014         location of nop zapping high insn too.
3015
3016 2015-01-28  Alan Modra  <amodra@gmail.com>
3017
3018         * elf64-ppc.h (struct ppc64_elf_params): Add "object_in_toc".
3019         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Assume that global symbols
3020         in .toc indicate xlc compiled code that might require a rw .toc.
3021
3022 2015-01-28  James Bowman  <james.bowman@ftdichip.com>
3023
3024         * Makefile.am: Add FT32 files.
3025         * archures.c (enum bfd_architecture): Add bfd_arch_ft32.
3026         (bfd_mach_ft32): Define.
3027         (bfd_ft32_arch): Declare.
3028         (bfd_archures_list): Add bfd_ft32_arch.
3029         * config.bfd: Handle FT32.
3030         * configure.ac: Likewise.
3031         * cpu-ft32.c: New file.
3032         * elf32-ft32.c: New file.
3033         * reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
3034         BFD_RELOC_FT32_18): Define.
3035         * targets.c (_bfd_target_vector): Add ft32_elf32_vec.
3036         * bfd-in2.h: Regenerate.
3037         * libbfd.h: Regenerate.
3038         * Makefile.in: Regenerate.
3039         * configure: Regenerate.
3040         * po/SRC-POTFILES.in: Regenerate.
3041
3042 2015-01-27  Nick Clifton  <nickc@redhat.com>
3043
3044         PR binutils/17512
3045         * pdp11.c (aout_get_external_symbols): Return false if there are
3046         no symbols.
3047
3048         * dwarf2.c (concat_filename): Check for an empty directory table.
3049         (scan_unit_for_symbols): Check for reading off the end of the
3050         unit.
3051         (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
3052         non-string form.
3053         * elf64-ppc.c (opd_entry_value): Fail if there are no relocs
3054         available.
3055
3056 2015-01-26  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3057
3058         * elf32-nds32.c (nds32_elf_pick_relax): Fix again setting.
3059
3060 2015-01-22  DJ Delorie  <dj@redhat.com>
3061
3062         * elf32-m32c.c (m32c_apply_reloc_24): New.
3063         (m32c_elf_howto_table): Use it for R_M32C_24.
3064         (m32c_elf_relocate_section): Handle R_M32C_24 specially.
3065
3066 2015-01-22  Nick Clifton  <nickc@redhat.com>
3067
3068         PR binutils/17512
3069         * coffcode.h (handle_COMDAT): When searching for the section
3070         symbol, make sure that there is space left in the symbol table.
3071         * vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
3072
3073 2015-01-21  Nick Clifton  <nickc@redhat.com>
3074
3075         PR binutils/17512
3076         * coffcode.h (coff_set_arch_mach_hook): Check return value from
3077         bfd_malloc.
3078         (coff_slurp_line_table): Return FALSE if the line number
3079         information was corrupt.
3080         (coff_slurp_symbol_table): Return FALSE if the symbol information
3081         was corrupt.
3082         * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
3083         initialise the fields of the dyld_info structure.
3084         (bfd_mach_o_build_exec_seg_command): Replace assertion with an
3085         error message and a return value.
3086         (bfd_mach_o_layout_commands): Change the function to boolean.
3087         Return FALSE if the function fails.
3088         (bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
3089         fails.
3090         (bfd_mach_o_read_command): Fail if an unrecognised command is
3091         encountered.
3092         * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
3093         read fails.
3094         (slurp_symtab): Check the return from bfd_malloc.
3095         (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
3096         encountered an error.
3097         (_bfd_XXi_final_link_postscript): Fail if a section could not be
3098         copied.
3099         * peicode.h (pe_bfd_object_p): Fail if the header could not be
3100         swapped in.
3101         * tekhex.c (first_phase): Fail if the section is too big.
3102         * versados.c (struct esdid): Add content_size field.
3103         (process_otr): Use and check the new field.
3104         (versados_get_section_contents): Check that the section exists and
3105         that the requested data is available.
3106
3107 2015-01-20  Chung-Lin Tang  <cltang@codesourcery.com>
3108
3109         * elf32-nios2.c (elf_backend_default_execstack): Define as 0.
3110
3111 2015-01-20  Alan Modra  <amodra@gmail.com>
3112
3113         PR ld/17615
3114         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
3115         ELF_COMMON_DEF syms.
3116
3117 2015-01-19  Alan Modra  <amodra@gmail.com>
3118
3119         PR ld/17615
3120         * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
3121         linker script assignments too.
3122         * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
3123         (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
3124
3125 2015-01-19  Alan Modra  <amodra@gmail.com>
3126
3127         * elf32-bfin.c (bfin_bfd_reloc_type_lookup): Correct loop iteration
3128         to allow return of first howto.
3129         * elf32-fr30.c (fr30_reloc_type_lookup): Likewise.
3130         * elf32-m32c.c (m32c_reloc_type_lookup): Likewise.
3131         * elf32-moxie.c (moxie_reloc_type_lookup): Likewise.
3132         * elf32-or1k.c (or1k_reloc_type_lookup): Likewise.
3133         * elf32-rl78.c (rl78_reloc_type_lookup): Likewise.
3134         * elf32-rx.c (rx_reloc_type_lookup): Likewise.
3135         * elf32-tilepro.c (tilepro_reloc_type_lookup): Likewise.
3136         * elf32-xstormy16.c (xstormy16_reloc_type_lookup): Likewise.
3137         * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
3138         * elf32-nios2.c (nios2_reloc_map): Add mapping for R_NIOS2_NONE.
3139         * elf32-spu.c (spu_elf_bfd_to_reloc_type): Allow return of R_SPU_NONE.
3140         (spu_elf_reloc_type_lookup): Adjust to suit.
3141
3142 2015-01-19  Alan Modra  <amodra@gmail.com>
3143
3144         * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
3145         (bfd_get_section_limit): ..here.
3146         * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
3147         (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
3148         * elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
3149         * elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
3150         bfd_reloc_outofrange check.
3151         * bfd-in2.h: Regenerate.
3152
3153         * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
3154         on zero size relocs.
3155         * ecoff.c (ecoff_reloc_link_order): Likewise.
3156         * elf32-nds32.c (nds32_relocate_contents): Likewise.
3157         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3158
3159         * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
3160         (_bfd_clear_contents): Likewise.
3161         * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
3162         (mips_elf_perform_relocation): Likewise.
3163
3164         * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
3165         from malloc on zero size alloc.
3166         * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
3167         * elflink.c (elf_reloc_link_order): Likewise.
3168         * linker.c (_bfd_generic_reloc_link_order): Likewise.
3169         * pdp11.c (aout_link_reloc_link_order): Likewise.
3170         * xcofflink.c (xcoff_reloc_link_order): Likewise.
3171
3172         * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
3173         bitsize 0, and complain_overflow_dont.
3174         * coff-sparc.c (coff_sparc_howto_table): Likewise.
3175         * elf-hppa.h (elf_hppa_howto_table): Likewise.
3176         * elf-m10200.c (elf_mn10200_howto_table): Likewise.
3177         * elf-m10300.c (elf_mn10300_howto_table): Likewise.
3178         * elf32-arc.c (elf_arc_howto_table): Likewise.
3179         * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
3180         * elf32-avr.c (elf_avr_howto_table): Likewise.
3181         * elf32-bfin.c (bfin_howto_table): Likewise.
3182         * elf32-cr16.c (cr16_elf_howto_table): Likewise.
3183         * elf32-cris.c (cris_elf_howto_table): Likewise.
3184         * elf32-crx.c (crx_elf_howto_table): Likewise.
3185         * elf32-d10v.c (elf_d10v_howto_table): Likewise.
3186         * elf32-d30v.c (elf_d30v_howto_table): Likewise.
3187         * elf32-dlx.c (dlx_elf_howto_table): Likewise.
3188         * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
3189         * elf32-fr30.c (fr30_elf_howto_table): Likewise.
3190         * elf32-frv.c (elf32_frv_howto_table): Likewise.
3191         * elf32-h8300.c (h8_elf_howto_table): Likewise.
3192         * elf32-i370.c (i370_elf_howto_raw): Likewise.
3193         * elf32-i386.c (elf_howto_table): Likewise.
3194         * elf32-i860.c (elf32_i860_howto_table): Likewise.
3195         * elf32-i960.c (elf32_i960_relocate): Likewise.
3196         * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
3197         * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
3198         * elf32-lm32.c (lm32_elf_howto_table): Likewise.
3199         * elf32-m32c.c (m32c_elf_howto_table): Likewise.
3200         * elf32-m32r.c (m32r_elf_howto_table): Likewise.
3201         * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
3202         * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
3203         * elf32-m68k.c (howto_table): Likewise.
3204         * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
3205         * elf32-mep.c (mep_elf_howto_table): Likewise.
3206         * elf32-metag.c (elf_metag_howto_table): Likewise.
3207         * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
3208         * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
3209         * elf32-moxie.c (moxie_elf_howto_table): Likewise.
3210         * elf32-msp430.c (elf_msp430_howto_table): Likewise.
3211         * elf32-mt.c (mt_elf_howto_table): Likewise.
3212         * elf32-nds32.c (nds32_elf_howto_table): Likewise.
3213         * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
3214         * elf32-or1k.c (or1k_elf_howto_table): Likewise.
3215         * elf32-pj.c (pj_elf_howto_table): Likewise.
3216         * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
3217         * elf32-rl78.c (rl78_elf_howto_table): Likewise.
3218         * elf32-rx.c (rx_elf_howto_table): Likewise.
3219         * elf32-s390.c (elf_howto_table): Likewise.
3220         * elf32-score.c (elf32_score_howto_table): Likewise.
3221         * elf32-score7.c (elf32_score_howto_table): Likewise.
3222         * elf32-sh-relocs.h (R_SH_NONE): Likewise.
3223         * elf32-spu.c (elf_howto_table): Likewise.
3224         * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
3225         * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
3226         * elf32-v850.c (v850_elf_howto_table): Likewise.
3227         * elf32-vax.c (howto_table): Likewise.
3228         * elf32-visium.c (visium_elf_howto_table): Likewise.
3229         * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
3230         * elf32-xgate.c (elf_xgate_howto_table): Likewise.
3231         * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
3232         * elf32-xtensa.c (elf_howto_table): Likewise.
3233         * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
3234         * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
3235         * elf64-mmix.c (elf_mmix_howto_table): Likewise.
3236         * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
3237         * elf64-s390.c (elf_howto_table): Likewise.
3238         * elf64-sh64.c (sh_elf64_howto_table): Likewise.
3239         * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
3240         * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
3241         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
3242         (elfNN_aarch64_howto_none): Likewise.
3243         * elfxx-ia64.c (ia64_howto_table): Likewise.
3244         * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
3245         * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
3246         * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
3247
3248 2015-01-15  H.J. Lu  <hongjiu.lu@intel.com>
3249
3250         PR ld/17847
3251         * elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain
3252         about -fPIC if the symbol is undefined when building executable.
3253
3254 2015-01-15  Nick Clifton  <nickc@redhat.com>
3255
3256         PR binutils/17512
3257         * elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
3258         error message.  Never return an invalid howto pointer.
3259         * elf32-cr16.c (cr16_info_to_howto): Likewise.
3260         * elf32-crx.c (elf_crx_info_to_howto): Likewise.
3261         * elf32-i370.c (i370_elf_info_to_howto): Likewise.
3262         * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
3263         * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
3264         * elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
3265         * elf32-pj.c (pj_elf_info_to_howto): Likewise.
3266         * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
3267         * elf32-spu.c (spu_elf_info_to_howto): Likewise.
3268         * elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
3269         * elf32-vax.c (rtype_to_howto): Likewise.
3270         * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
3271         * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
3272         * elfn32-mips.c (sh_elf_info_to_howto): Likewise.
3273         * elf32-sh.c (sh_elf_info_to_howto): Likewise.
3274         (sh_elf_reloc): Check that the reloc is in range.
3275         * reloc.c (bfd_perform_relocation): Check that the section is big
3276         enough for the entire reloc.
3277         (bfd_generic_get_relocated_section_contents): Report unexpected
3278         return values from perform_reloc.
3279
3280 2015-01-15  Nick Clifton  <nickc@redhat.com>
3281
3282         * elf32-msp430.c (msp430_elf_relax_section): Skip unhandled
3283         relocs.  Include PC-relative adjustment for R_MSP430X_ABS16
3284         relaxation.
3285
3286 2015-01-15  Alan Modra  <amodra@gmail.com>
3287
3288         * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
3289         any output section matching a linker created dynobj section.
3290
3291 2015-01-15  Alan Modra  <amodra@gmail.com>
3292
3293         PR 17842
3294         * elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
3295         (bfd_elf_final_link): Always create a symbol table when emit_relocs.
3296         Don't assign symtab file position unless symbols will be output.
3297         Merge blocks with condition in common.  Don't call
3298         elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
3299         unless other symbols are output.  Move assignment of symtab_shndx
3300         file position.  Localize variable.
3301
3302 2015-01-14  Jiong Wang  <jiong.wang@arm.com>
3303
3304         * elf32-arm.c (elf32_arm_final_link_relocate): Reject R_ARM_32/_NOI when
3305         trying to defer them to runtime.
3306
3307 2015-01-13  Thomas Preud'homme <thomas.preudhomme@arm.com>
3308
3309         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
3310         to check if a symbol should be bound symbolically.
3311
3312 2015-01-13  Jiong Wang  <jiong.wang@arm.com>
3313
3314         * elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check
3315         for TLSLE_MOVW_TPREL_G2.
3316
3317 2015-01-13  Jiong Wang  <jiong.wang@arm.com>
3318
3319         PR ld/17415
3320         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
3321         R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
3322         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the
3323         bit mask.
3324
3325 2015-01-12  Terry Guo  <terry.guo@arm.com>
3326
3327         * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
3328         function.
3329         (_bfd_elf_gc_mark_extra_sections): Use it.
3330
3331 2015-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3332
3333         PR ld/17827
3334         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
3335         only discard space for pc-relative relocs symbols which turn
3336         out to need copy relocs.
3337
3338 2015-01-09  Nick Clifton  <nickc@redhat.com>
3339
3340         * tekhex.c (getvalue): Fix thinko in test for correct extraction
3341         of value.
3342         (getsym): Return false if there was not enough data to extract the
3343         symbol.
3344
3345 2015-01-09  Anthony Green  <green@moxielogic.com>
3346
3347         * elf32-moxie.c (ELF_MACHINE_ALT1): Define.
3348
3349 2015-01-08  Nick Clifton  <nickc@redhat.com>
3350
3351         * elf32-msp430.c (msp430_elf_relax_section): Add relaxation of
3352         16-bit absolute BR instructions to 10-bit pc-relative JMP
3353         instructions.
3354
3355 2015-01-08  Nick Clifton  <nickc@redhat.com>
3356
3357         PR binutils/17512
3358         * coffcode.h (coff_slurp_symbol_table): Return false if we failed
3359         to load the line table.
3360         * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
3361         maxpagesize of 1.
3362         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if
3363         the Data Directory Size is too large.
3364
3365 2015-01-06  H.J. Lu  <hongjiu.lu@intel.com>
3366
3367         PR binutils/17512
3368         * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
3369         * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3370
3371 2015-01-06  Nick Clifton  <nickc@redhat.com>
3372
3373         PR binutils/17512
3374         * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
3375         string table.
3376
3377         * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
3378         (bfd_perform_relocation): Include the size of the reloc in the
3379         test for an out of range relocation.
3380         (bfd_generic_get_relocated_section_contents): Remove reloc range
3381         test.
3382
3383         * coff-i860.c (CALC_ADDEND): Always set an addend value.
3384         * tekhex.c (getvalue): Add an end pointer parameter.  Use it to
3385         avoid reading off the end of the buffer.
3386         (getsym): Likewise.
3387         (first_phase): Likewise.
3388         (pass_over): Pass an end pointer to the invoked function.
3389
3390 2015-01-05  H.J. Lu  <hongjiu.lu@intel.com>
3391
3392         PR binutils/17512
3393         * elf32-i386.c (elf_i386_get_plt_sym_val): Return NULL on corrupt
3394         input.
3395         * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
3396
3397 2015-01-05  Nick Clifton  <nickc@redhat.com>
3398
3399         PR binutils/17512
3400         * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
3401         is at least big enough for the header to be read.
3402         * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocs.
3403         * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
3404         (bfd_mach_o_read_command): Prevetn duplicate error messages about
3405         unrecognized commands.
3406         * syms.c (_bfd_stab_section_find_nearest_line): Add range checks
3407         when indexing into the string table.
3408
3409 2015-01-01  Alan Modra  <amodra@gmail.com>
3410
3411         Update year range in copyright notice of all files.
3412
3413 For older changes see ChangeLog-2014
3414 \f
3415 Copyright (C) 2015 Free Software Foundation, Inc.
3416
3417 Copying and distribution of this file, with or without modification,
3418 are permitted in any medium without royalty provided the copyright
3419 notice and this notice are preserved.
3420
3421 Local Variables:
3422 mode: change-log
3423 left-margin: 8
3424 fill-column: 74
3425 version-control: never
3426 End: