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