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