8c6e8b14f754a11283039d8f5b39945175ec5a03
[binutils-gdb.git] / bfd / ChangeLog
1 2017-09-01 Nick Clifton <nickc@redhat.com>
2
3 PR 22059
4 * dwarf2.c (decode_line_info): Fix test for an overlong line info
5 structure.
6
7 2017-09-01 Nick Clifton <nickc@redhat.com>
8
9 PR 22058
10 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
11 attribute buffer is NUL terminated.
12
13 2017-08-31 Nick Clifton <nickc@redhat.com>
14
15 PR 22047
16 * dwarf2.c (read_section): If necessary add a terminating NUL byte
17 to dwarf string sections.
18
19 2017-08-31 Alan Modra <amodra@gmail.com>
20
21 * po/SRC-POTFILES.in: Regenerate.
22
23 2017-08-31 Alan Modra <amodra@gmail.com>
24
25 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
26 for a section containing just a terminator. Allow multiple
27 terminators at end of section.
28 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
29 sections when not adding alignment. Assert on terminator in
30 the middle of FDEs.
31
32 2017-08-31 Alan Modra <amodra@gmail.com>
33
34 PR 21441
35 PR 22048
36 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
37 terminators.
38
39 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
40
41 * configure.ac (bfd_backends): Add elf64.lo together with
42 elfxx-x86.lo for 64-bit BFD.
43 * configure: Regenerated.
44
45 2017-08-31 James Bowman <james.bowman@ftdichip.com>
46
47 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
48 for R_FT32_18.
49
50 2017-08-31 Alan Modra <amodra@gmail.com>
51
52 PR binutils/22032
53 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
54 before _close_and_cleanup. Call iovec->bclose after.
55 (bfd_close): Remove code common to, and call, bfd_close_all_done.
56
57 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
58
59 * elf32-i386.c (elf_i386_plt_type): Removed.
60 (elf_i386_plt): Likewise.
61 (elf_i386_get_synthetic_symtab): Updated. Call
62 _bfd_x86_elf_get_synthetic_symtab.
63 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
64 (elf_x86_64_plt): Likewise.
65 (elf_x86_64_get_synthetic_symtab): Updated. Call
66 _bfd_x86_elf_get_synthetic_symtab.
67 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
68 (elf_x86_64_get_plt_got_vma): Likewise.
69 (elf_i386_valid_plt_reloc_p): Likewise.
70 (elf_x86_64_valid_plt_reloc_p): Likewise.
71 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
72 * elfxx-x86.h (elf_x86_plt_type): New.
73 (elf_x86_plt): Likewise.
74 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
75
76 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
77
78 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
79 target_id instead of elf_machine_code.
80
81 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
82
83 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
84 (elf_i386_lazy_plt_layout): Likewise.
85 (elf_i386_non_lazy_plt_layout): Likewise.
86 (elf_i386_plt_layout): Likewise.
87 (elf_i386_link_hash_table): Likewise.
88 (elf_i386_next_tls_desc_index): Likewise.
89 (elf_i386_srelplt2): Likewise.
90 (elf_i386_plt): Likewise.
91 (elf_i386_lazy_plt): Likewise.
92 (elf_i386_non_lazy_plt): Likewise.
93 (elf_i386_link_hash_table_create): Likewise.
94 (bfd_elf32_bfd_link_hash_table_create): Likewise.
95 (elf_i386_lazy_plt): Updated.
96 (elf_i386_non_lazy_plt): Likewise.
97 (elf_i386_lazy_ibt_plt): Likewise.
98 (elf_i386_non_lazy_ibt_plt): Likewise.
99 (elf_i386_allocate_dynrelocs): Likewise.
100 (elf_i386_size_dynamic_sections): Likewise.
101 (elf_i386_relocate_section): Likewise.
102 (elf_i386_finish_dynamic_symbol): Likewise.
103 (elf_i386_finish_dynamic_sections): Likewise.
104 (elf_i386_get_synthetic_symtab): Likewise.
105 (elf_i386_link_setup_gnu_properties): Likewise.
106 (elf_i386_nacl_plt): Likewise.
107 * elf64-x86-64.c (ABI_64_P): Removed.
108 (ELF64_DYNAMIC_INTERPRETER): Likewise.
109 (ELF32_DYNAMIC_INTERPRETER): Likewise.
110 (elf_x86_64_lazy_plt_layout): Likewise.
111 (elf_x86_64_non_lazy_plt_layout): Likewise.
112 (elf_x86_64_plt_layout): Likewise.
113 (elf_x86_64_link_hash_table): Likewise.
114 (elf_x86_64_plt): Likewise.
115 (elf_x86_64_lazy_plt): Likewise.
116 (elf_x86_64_non_lazy_plt): Likewise.
117 (elf_x86_64_link_hash_table_create): Likewise.
118 (bfd_elf64_bfd_link_hash_table_create): Likewise.
119 (bfd_elf32_bfd_link_hash_table_create): Likewise.
120 (elf_x86_64_lazy_plt): Updated.
121 (elf_x86_64_non_lazy_plt): Likewise.
122 (elf_x86_64_lazy_bnd_plt): Likewise.
123 (elf_x86_64_non_lazy_bnd_plt): Likewise.
124 (elf_x86_64_lazy_ibt_plt): Likewise.
125 (elf_x32_lazy_ibt_plt): Likewise.
126 (elf_x86_64_non_lazy_ibt_plt): Likewise.
127 (elf_x32_non_lazy_ibt_plt): Likewise.
128 (elf_x86_64_allocate_dynrelocs): Likewise.
129 (elf_x86_64_size_dynamic_sections): Likewise.
130 (elf_x86_64_relocate_section): Likewise.
131 (elf_x86_64_finish_dynamic_symbol): Likewise.
132 (elf_x86_64_finish_dynamic_sections): Likewise.
133 (elf_x86_64_get_synthetic_symtab): Likewise.
134 (elf_x86_64_link_setup_gnu_properties): Likewise.
135 (elf_x86_64_nacl_plt): Likewise.
136 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
137 "elf/x86-64.h".
138 (ELF32_DYNAMIC_INTERPRETER): New.
139 (ELF64_DYNAMIC_INTERPRETER): Likewise.
140 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
141 (_bfd_x86_elf_link_hash_table_create): Likewise.
142 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
143 (elf_x86_link_hash_table_free): This. Make it static.
144 * elfxx-x86.h: Don't include "objalloc.h".
145 (ABI_64_P): New.
146 (elf_x86_lazy_plt_layout): Likewise.
147 (elf_x86_non_lazy_plt_layout): Likewise.
148 (elf_x86_plt_layout): Likewise.
149 (_bfd_x86_elf_link_hash_table_create): Likewise.
150 (bfd_elf64_bfd_link_hash_table_create): Likewise.
151 (bfd_elf32_bfd_link_hash_table_create): Likewise.
152 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
153 srelplt2 and next_tls_desc_index.
154 (_bfd_x86_elf_link_hash_table_free): Removed.
155
156 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
157
158 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
159 branch offset interpretation.
160
161 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
162
163 PR binutils/22032
164 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
165
166 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
167
168 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
169 (elf_x86_64_srelplt2): Likewise.
170
171 2017-08-30 Alan Modra <amodra@gmail.com>
172
173 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
174 (ppc64_elf_tls_optimize): Set it.
175 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
176 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
177 addis would add zero.
178 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
179 (ppc_elf_tls_optimize): Set it.
180 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
181 insn on TPREL16_LO relocs to use r2 when addis would add zero.
182
183 2017-08-30 Alan Modra <amodra@gmail.com>
184
185 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
186 __tls_get_addr call sequences to LE, don't move the addi down
187 to the nop. Replace the bl with addi and leave the nop alone.
188
189 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
190
191 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
192 Re-indent.
193 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
194 Likewise.
195 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
196
197 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
198
199 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
200 (BFD64_BACKENDS): Likewise.
201 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
202 (BFD64_BACKENDS_CFILES): Likewise.
203 * Makefile.in: Regenerated.
204 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
205 elf32-i386.lo and elf64-x86-64.lo.
206 * configure: Regenerated.
207 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
208 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
209 "objalloc.h" and "hashtab.h".
210 (ELIMINATE_COPY_RELOCS): Removed.
211 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
212 (SYMBOL_NO_COPYRELOC): Likewise.
213 (elf_i386_link_hash_entry): Likewise.
214 (GOT_UNKNOWN): Likewise.
215 (GOT_NORMAL): Likewise.
216 (GOT_TLS_GD): Likewise.
217 (elf_i386_hash_entry): Likewise.
218 (elf_i386_obj_tdata): Likewise.
219 (elf_i386_tdata): Likewise.
220 (elf_i386_local_got_tls_type): Likewise.
221 (elf_i386_local_tlsdesc_gotent): Likewise.
222 (elf_i386_hash_table): Likewise.
223 (elf_i386_link_hash_newfunc): Likewise.
224 (elf_i386_local_htab_hash): Likewise.
225 (elf_i386_local_htab_eq): Likewise.
226 (elf_i386_get_local_sym_hash): Likewise.
227 (elf_i386_link_hash_table_free): Likewise.
228 (elf_i386_copy_indirect_symbol): Likewise.
229 (elf_i386_fixup_symbol): Likewise.
230 (elf_i386_readonly_dynrelocs): Likewise.
231 (elf_i386_always_size_sections): Likewise.
232 (elf_i386_set_tls_module_base): Likewise.
233 (elf_i386_dtpoff_base): Likewise.
234 (compare_relocs): Likewise.
235 (elf_i386_hash_symbol): Likewise.
236 (elf_i386_parse_gnu_properties): Likewise.
237 (elf_i386_merge_gnu_properties): Likewise.
238 (elf_i386_link_check_relocs): Likewise.
239 (elf_i386_merge_symbol_attribute): Likewise.
240 (bfd_elf32_bfd_link_check_relocs): Likewise.
241 (elf_backend_copy_indirect_symbol): Likewise.
242 (elf_backend_always_size_sections): Likewise.
243 (elf_backend_omit_section_dynsym): Likewise.
244 (elf_backend_hash_symbol): Likewise.
245 (elf_backend_fixup_symbol): Likewise.
246 (elf_backend_parse_gnu_properties): Likewise.
247 (elf_backend_merge_gnu_properties): Likewise.
248 (elf_backend_merge_symbol_attribute): Likewise.
249 (elf_i386_mkobject): Updated.
250 (elf_i386_link_hash_table_create): Likewise.
251 (elf_i386_check_tls_transition): Likewise.
252 (elf_i386_tls_transition): Likewise.
253 (elf_i386_convert_load_reloc): Likewise.
254 (elf_i386_check_relocs): Likewise.
255 (elf_i386_adjust_dynamic_symbol): Likewise.
256 (elf_i386_allocate_dynrelocs): Likewise.
257 (elf_i386_convert_load): Likewise.
258 (elf_i386_size_dynamic_sections): Likewise.
259 (elf_i386_relocate_section): Likewise.
260 (elf_i386_finish_dynamic_symbol ): Likewise.
261 (elf_i386_finish_dynamic_sections): Likewise.
262 (elf_i386_output_arch_local_syms): Likewise.
263 (elf_i386_get_synthetic_symtab): Likewise.
264 (elf_i386_link_setup_gnu_properties): Likewise.
265 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
266 of elf_link_hash_table, as base.
267 (elf_i386_next_tls_desc_index): New.
268 (elf_i386_srelplt2): Likewise.
269 (elf_i386_plt): Likewise.
270 (elf_i386_lazy_plt): Likewise.
271 (elf_i386_non_lazy_plt): Likewise.
272 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
273 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
274 "objalloc.h" and "hashtab.h".
275 (ELIMINATE_COPY_RELOCS): Removed.
276 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
277 (SYMBOL_NO_COPYRELOC): Likewise.
278 (elf_x86_64_link_hash_entry): Likewise.
279 (GOT_UNKNOWN): Likewise.
280 (GOT_NORMAL): Likewise.
281 (GOT_TLS_GD): Likewise.
282 (elf_x86_64_hash_entry): Likewise.
283 (elf_x86_64_obj_tdata): Likewise.
284 (elf_x86_64_tdata): Likewise.
285 (elf_x86_64_local_got_tls_type): Likewise.
286 (elf_x86_64_local_tlsdesc_gotent): Likewise.
287 (elf_x86_64_hash_table): Likewise.
288 (elf_x86_64_link_hash_newfunc): Likewise.
289 (elf_x86_64_local_htab_hash): Likewise.
290 (elf_x86_64_local_htab_eq): Likewise.
291 (elf_x86_64_get_local_sym_hash): Likewise.
292 (elf_x86_64_link_hash_table_free): Likewise.
293 (elf_x86_64_copy_indirect_symbol): Likewise.
294 (elf_x86_64_fixup_symbol): Likewise.
295 (elf_x86_64_readonly_dynrelocs): Likewise.
296 (elf_x86_64_always_size_sections): Likewise.
297 (elf_x86_64_set_tls_module_base): Likewise.
298 (elf_x86_64_dtpoff_base): Likewise.
299 (compare_relocs): Likewise.
300 (elf_x86_64_merge_symbol_attribute): Likewise.
301 (elf_x86_64_hash_symbol): Likewise.
302 (elf_x86_64_parse_gnu_properties): Likewise.
303 (elf_x86_64_merge_gnu_properties): Likewise.
304 (elf_x86_64_link_check_relocs): Likewise.
305 (elf_backend_copy_indirect_symbol): Likewise.
306 (elf_backend_always_size_sections): Likewise.
307 (bfd_elf64_bfd_link_check_relocs): Likewise.
308 (elf_backend_merge_symbol_attribute): Likewise.
309 (elf_backend_hash_symbol): Likewise.
310 (elf_backend_omit_section_dynsym): Likewise.
311 (elf_backend_fixup_symbol): Likewise.
312 (elf_backend_parse_gnu_properties): Likewise.
313 (elf_backend_merge_gnu_properties): Likewise.
314 (bfd_elf32_bfd_link_check_relocs): Likewise.
315 (elf_x86_64_mkobject): Updated.
316 (elf_x86_64_link_hash_table_create): Likewise.
317 (elf_x86_64_check_tls_transition): Likewise.
318 (elf_x86_64_tls_transition): Likewise.
319 (elf_x86_64_convert_load_reloc): Likewise.
320 (elf_x86_64_check_relocs): Likewise.
321 (elf_x86_64_adjust_dynamic_symbol): Likewise.
322 (elf_x86_64_allocate_dynrelocs): Likewise.
323 (elf_x86_64_convert_load): Likewise.
324 (elf_x86_64_size_dynamic_sections): Likewise.
325 (elf_x86_64_relocate_section): Likewise.
326 (elf_x86_64_finish_dynamic_symbol ): Likewise.
327 (elf_x86_64_finish_dynamic_sections): Likewise.
328 (elf_x86_64_output_arch_local_syms): Likewise.
329 (elf_x86_64_get_synthetic_symtab): Likewise.
330 (elf_x86_64_link_setup_gnu_properties): Likewise.
331 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
332 instead of elf_link_hash_table, as base.
333 (elf_x86_64_next_tls_desc_index): New.
334 (elf_x86_64_srelplt2): Likewise.
335 (elf_x86_64_plt): Likewise.
336 (elf_x86_64_lazy_plt): Likewise.
337 (elf_x86_64_non_lazy_plt): Likewise.
338 * elfxx-x86.c: New file.
339 * elfxx-x86.h: Likewise.
340
341 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
342
343 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
344 return.
345 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
346
347 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
348
349 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
350 sections before checking dynamic relocations and free invalid
351 PLT section contents.
352 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
353
354 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
355
356 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
357 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
358
359 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
360
361 PR binutils/22018
362 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
363 PLT section size.
364 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
365
366 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
367
368 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
369 def_protected.
370 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
371
372 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
373
374 PR ld/21997
375 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
376 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
377 Add a has_no_copy_on_protected bitfield.
378 (elf_has_no_copy_on_protected): New.
379 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
380 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
381 (elf_merge_gnu_property_list): Likewise.
382 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
383 to FALSE for elf_has_no_copy_on_protected.
384 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
385 (elf_i386_link_hash_entry): Add def_protected.
386 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
387 when checking info->nocopyreloc.
388 (elf_i386_link_setup_gnu_properties): Don't set
389 extern_protected_data here.
390 (elf_i386_merge_symbol_attribute): New function.
391 (elf_backend_merge_symbol_attribute): New.
392 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
393 (elf_x86_64_link_hash_entry): Add def_protected.
394 (elf_x86_64_need_pic): Report protected symbol for def_protected.
395 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
396 when checking info->nocopyreloc.
397 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
398 relocation run-time overflow and unresolvable R_X86_64_32S
399 relocation against protected data symbol defined in shared object
400 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
401 (elf_x86_64_link_setup_gnu_properties): Don't set
402 extern_protected_data here.
403 (elf_x86_64_merge_symbol_attribute): New function.
404 (elf_backend_merge_symbol_attribute): New.
405
406 2017-08-26 Alan Modra <amodra@gmail.com>
407
408 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
409 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
410 (ppc_elf_relocate_section): Comment fix.
411 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
412 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
413 Support dynamic relocs for TPREL16 when non-pic too.
414 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
415 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
416 when non-pic too.
417
418 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
419
420 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
421 "symbol" in comments.
422 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
423
424 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
425
426 PR ld/22001
427 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
428 R_X86_64_PC32 relocation run-time overflow and unresolvable
429 R_X86_64_32S relocation with -z nocopyreloc.
430
431 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
432
433 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
434 Undefined symbols may not have a type.
435 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
436
437 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
438
439 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
440 bfd_link_info. Report shared, PIE or PDE object based on
441 bfd_link_info.
442 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
443 (elf_x86_64_relocate_section): Likewise.
444
445 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
446
447 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
448 for function symbols.
449 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
450
451 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
452
453 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
454 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
455 is set on any input relocatable file.
456 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
457
458 2017-08-23 Alan Modra <amodra@gmail.com>
459
460 PR 21988
461 * elf64-ppc.c (ensure_undef_dynamic): Rename from
462 ensure_undefweak_dynamic. Handle undefined too.
463 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
464 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
465 (allocate_dynrelocs): Discard undefined non-default visibility
466 relocs first. Make undefined syms dynamic. Tidy goto.
467
468 2017-08-21 Alan Modra <amodra@gmail.com>
469 H.J. Lu <hongjiu.lu@intel.com>
470
471 PR ld/21964
472 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
473 * elflink.c (bfd_elf_define_start_stop): Rewrite.
474
475 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
476
477 PR ld/20125
478 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
479 undefined weak symbols.
480
481 2017-08-18 Nick Clifton <nickc@redhat.com>
482
483 PR binutils/21962
484 * tekhex.c (getsym): Fix check for source pointer walking off the
485 end of the input buffer.
486
487 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
488
489 PR ld/18808
490 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
491 relocations in debug sections, change abort to _bfd_error_handler.
492
493 2017-08-14 Nick Clifton <nickc@redhat.com>
494
495 PR 21957
496 * elf.c (setup_group): Check for an empty or very small group
497 section.
498 * po/bfd.pot: Regenerate.
499
500 2017-08-14 Alan Modra <amodra@gmail.com>
501
502 PR 21441
503 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
504 alignment padding here.
505 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
506 in a reverse pass over sections.
507
508 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
509
510 PR binutils/21943
511 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
512 for @plt suffixes first.
513 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
514
515 2017-08-08 Nick Clifton <nickc@redhat.com>
516
517 PR 21916
518 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
519 small section lengths.
520 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
521 table.
522 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
523 there is enough data present in the note.
524
525 2017-08-08 Alan Modra <amodra@gmail.com>
526
527 PR 21017
528 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
529 got.refcount for GOTOFF relocs, just create .got section.
530
531 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
532
533 * elflink.c (elf_link_add_object_symbols): Move common symbol
534 check after bed->common_definition.
535
536 2017-08-07 Alan Modra <amodra@gmail.com>
537
538 PR 21910
539 * elflink.c (bfd_elf_final_link): Don't segfault when sections
540 needed to define various dynamic tags have been discarded.
541
542 2017-08-07 Nick Clifton <nickc@redhat.com>
543
544 PR 21884
545 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
546 has not been set then use the bfd returned by
547 _bfd_elf_link_setup_gnu_properties. If that is null then search
548 through all the input bfds selecting the first normal, ELF format
549 one.
550 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
551
552 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
553
554 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
555 to 1 bit.
556 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
557 (elf_i386_check_tls_transition): Check tls_get_addr directly.
558 (elf_i386_convert_load_reloc): Update tls_get_addr check.
559 (elf_i386_link_check_relocs): New function.
560 (bfd_elf32_bfd_link_check_relocs): New.
561 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
562 to 1 bit.
563 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
564 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
565 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
566 (elf_x86_64_link_check_relocs): New function.
567 (bfd_elf64_bfd_link_check_relocs): New.
568 (bfd_elf32_bfd_link_check_relocs): Likewise.
569
570 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
571
572 PR ld/21903:
573 * elflink.c (elf_link_add_object_symbols): Treat common symbol
574 as undefined for --no-define-common.
575
576 2017-08-05 Alan Modra <amodra@gmail.com>
577
578 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
579 hppa_link_hash_table.
580
581 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
582
583 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
584 entries for sysregs with negative indices.
585
586 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
587
588 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
589 isn't the S/390 specific elf data.
590 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
591
592 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
593
594 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
595 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
596 [R_RISCV_ADD16]: Likewise.
597 [R_RISCV_ADD32]: Likewise.
598 [R_RISCV_ADD64]: Likewise.
599 [R_RISCV_SUB6]: Likewise.
600 [R_RISCV_SUB8]: Likewise.
601 [R_RISCV_SUB16]: Likewise.
602 [R_RISCV_SUB32]: Likewise.
603 [R_RISCV_SUB64]: Likewise.
604
605 2017-07-31 Alan Modra <amodra@gmail.com>
606
607 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
608 without ld.so checks.
609
610 2017-07-29 Alan Modra <amodra@gmail.com>
611
612 PR 21847
613 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
614 (ppc64_elf_merge_symbol): Set non_zero_localentry.
615 (is_elfv2_localentry0): Test non_zero_localentry.
616 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
617
618 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
619
620 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
621 pointer check for htab->elf.irelplt.
622 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
623
624 2017-07-27 Nick Clifton <nickc@redhat.com>
625
626 PR 21840
627 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
628 size is -1.
629 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
630 with error return.
631 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
632 are NULL.
633 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
634 of end pointer.
635 (evax_bfd_print_emh): Check for invalid string lengths.
636
637 2017-07-25 Nick Clifton <nickc@redhat.com>
638
639 * po/fr.po: Updated French translation.
640
641 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
642
643 PR 21824
644 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
645 16-bit absolute branches into 10-bit pc-relative branches on the
646 MSP430 as well as the MSP430X.
647
648 2017-07-25 Alan Modra <amodra@gmail.com>
649
650 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
651 (stub_eh_frame_size): New function.
652 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
653 (group_sections): Init group tls_get_addr_opt_bctrl.
654 (ppc64_elf_size_stubs): Update sizing and initialization of
655 .eh_frame. Iteration over stubs via group list.
656 (ppc64_elf_build_stubs): Iterate over stubs via group list.
657 (ppc64_elf_finish_dynamic_sections): Update finalization of
658 .eh_frame.
659
660 2017-07-24 Nick Clifton <nickc@redhat.com>
661
662 PR 21813
663 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
664 of the relocs to the canonicalize_one_reloc routine.
665 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
666 for the _bfd_mach_o_canonicalize_one_reloc field.
667 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
668 res_base parameter. Use to check for corrupt pair relocs.
669 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
670 Likewise.
671 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
672 Likewise.
673 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
674 Likewise.
675
676 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
677 enough data in the record before attempting to parse it.
678 (_bfd_vms_slurp_eeom): Likewise.
679
680 (_bfd_vms_slurp_egsd): Check for an invalid section index.
681 (image_set_ptr): Likewise.
682 (alpha_vms_slurp_relocs): Likewise.
683
684 (alpha_vms_object_p): Check for a truncated record.
685
686 2017-07-24 Nick Clifton <nickc@redhat.com>
687
688 PR 21803
689 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
690 an unrecognized reloc and sets the bfd_error value.
691 * libbfd.h: Regenerate.
692 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
693 function.
694 * elf32-i386.c (elf_i386_relocate_section): Likewise.
695 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
696 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
697 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
698 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
699
700 2017-07-23 Alan Modra <amodra@gmail.com>
701
702 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
703 restore of LR.
704
705 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
706
707 PR ld/18841
708 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
709 reloc_class_ifunc for ifunc symbols.
710
711 2017-07-19 Nick Clifton <nickc@redhat.com>
712
713 PR 21787
714 * archive.c (bfd_generic_archive_p): If the bfd does not have the
715 correct magic bytes at the start, set the error to wrong format
716 and clear the format selector before returning NULL.
717
718 2017-07-19 Nick Clifton <nickc@redhat.com>
719
720 PR 21786
721 * coff-rs6000.c (_bfd_strntol): New function.
722 (_bfd_strntoll): New function.
723 (GET_VALUE_IN_FIELD): New macro.
724 (EQ_VALUE_IN_FIELD): new macro.
725 (_bfd_xcoff_slurp_armap): Use new macros.
726 (_bfd_xcoff_archive_p): Likewise.
727 (_bfd_xcoff_read_ar_hdr): Likewise.
728 (_bfd_xcoff_openr_next_archived_file): Likewise.
729 (_bfd_xcoff_stat_arch_elt): Likewise.
730 * coff64-rs6000.c (_bfd_strntol): New function.
731 (_bfd_strntoll): New function.
732 (GET_VALUE_IN_FIELD): New macro.
733 (xcoff64_slurp_armap): Use new macros.
734
735 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
736 John Eric Martin <John.Martin@emmicro-us.com>
737
738 * bfd-in2.h: Regenerate.
739 * libbfd.h: Regenerate.
740 * elf32-arc.c (JLI): Define.
741 * reloc.c: Add JLI relocations.
742
743 2017-07-18 Nick Clifton <nickc@redhat.com>
744
745 PR 21775
746 * coff-sh.c: Fix spelling typos.
747 * compress.c: Likewise.
748 * cpu-pdp11.c: Likewise.
749 * ecofflink.c: Likewise.
750 * elf-m10300.c: Likewise.
751 * elf.c: Likewise.
752 * elf32-arm.c: Likewise.
753 * elf32-m68k.c: Likewise.
754 * elf32-nds32.c: Likewise.
755 * elf32-ppc.c: Likewise.
756 * elf32-sh.c: Likewise.
757 * elf32-v850.c: Likewise.
758 * elf64-ppc.c: Likewise.
759 * elf64-x86-64.c: Likewise.
760 * elflink.c: Likewise.
761 * elfnn-aarch64.c: Likewise.
762 * elfxx-mips.c: Likewise.
763 * som.c: Likewise.
764 * sunos.c: Likewise.
765 * vms-alpha.c: Likewise.
766 * xcofflink.c: Likewise.
767
768 2017-07-18 Nick Clifton <nickc@redhat.com>
769
770 PR binutils/21781
771 * coffcode.h (handle_COMDAT): Replace abort with an error message
772 and return.
773
774 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
775
776 PR ld/21782
777 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
778 to shared library.
779
780 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
781
782 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
783
784 2017-07-16 Alan Modra <amodra@gmail.com>
785
786 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
787 __tls_index GOT entries when using __tls_get_addr_opt stub.
788 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
789
790 2017-07-12 Alan Modra <amodra@gmail.com>
791
792 * po/es.po: Update from translationproject.org/latest/bfd/.
793 * po/fi.po: Likewise.
794 * po/fr.po: Likewise.
795 * po/id.po: Likewise.
796 * po/ja.po: Likewise.
797 * po/ro.po: Likewise.
798 * po/ru.po: Likewise.
799 * po/sr.po: Likewise.
800 * po/sv.po: Likewise.
801 * po/tr.po: Likewise.
802 * po/uk.po: Likewise.
803 * po/vi.po: Likewise.
804 * po/zh_CN.po: Likewise.
805 * po/hr.po: New file from translationproject.org.
806 * configure.ac (ALL_LINGUAS): Add hr. Sort.
807 * configure: Regenerate.
808
809 2017-07-12 Nick Clifton <nickc@redhat.com>
810
811 Fix compile time warnings using gcc 7.1.1.
812 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
813 plt_name buffer.
814 (elf_xtensa_get_gotplt_section): Increase length of got_name
815 buffer.
816 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
817 default return of FALSE.
818 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
819 default return of FALSE.
820
821 2017-07-12 Alan Modra <amodra@gmail.com>
822
823 * binary.c (binary_set_section_contents): Don't print filepos in
824 error message.
825 (coff_write_object_contents): Cast size_t for error message.
826 (coff_slurp_line_table): Don't use bfd_vma symndx.
827 (coff_slurp_reloc_table): Remove unneeded cast.
828 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
829 error message.
830 (find_abstract_instance_name): Likewise.
831 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
832 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
833 (elf32_arm_check_relocs): Make r_symndx an int.
834 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
835 format string.
836 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
837 message arg.
838 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
839 error message.
840 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
841 * elf32-s390.c (elf_s390_check_relocs): Likewise.
842 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
843 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
844 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
845 * elf64-s390.c (elf_s390_check_relocs): Likewise.
846 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
847 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
848 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
849 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
850 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
851 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
852 and use %lu for error message.
853 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
854 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
855 error message.
856
857 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
858 in error message.
859 (elf32_arm_final_link_relocate): Likewise.
860 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
861 * coffcode.h (styp_to_sec_flags): Likewise.
862 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
863 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
864 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
865 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
866 (elf32_bfin_merge_private_bfd_data): Likewise.
867 * elf32-cris.c (cris_elf_relocate_section): Likewise.
868 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
869 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
870 (i370_elf_relocate_section): Likewise.
871 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
872 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
873 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
874 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
875 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
876 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
877 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
878 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
879 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
880 * ieee.c (ieee_write_id, read_id): Likewise.
881 * mach-o.c (bfd_mach_o_write_contents): Likewise.
882 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
883 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
884 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
885 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
886 * stabs.c (_bfd_link_section_stabs): Likewise.
887
888 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
889 format.
890 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
891 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
892 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
893 * coff-sh.c (sh_relax_section): Likewise.
894 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
895 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
896 * coffcode.h (coff_slurp_reloc_table): Likewise.
897 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
898 (_bfd_coff_read_string_table): Likewise.
899 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
900 * compress.c (bfd_get_full_section_contents): Likewise.
901 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
902 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
903 * elf.c (bfd_elf_string_from_elf_section): Likewise.
904 * elf32-arc.c (arc_special_overflow_checks): Likewise.
905 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
906 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
907 (elf32_arm_write_section): Likewise.
908 * elf32-bfin.c (bfin_relocate_section): Likewise.
909 (bfinfdpic_relocate_section): Likewise.
910 * elf32-hppa.c (hppa_build_one_stub): Likewise.
911 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
912 * elf32-i386.c (elf_i386_tls_transition): Likewise.
913 (elf_i386_relocate_section): Likewise.
914 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
915 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
916 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
917 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
918 * elf32-metag.c (elf_metag_relocate_section): Likewise.
919 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
920 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
921 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
922 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
923 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
924 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
925 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
926 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
927 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
928 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
929 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
930 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
931 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
932 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
933 * elf32-sh.c (sh_elf_relax_section): Likewise.
934 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
935 (sh_elf_relocate_section): Likewise.
936 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
937 * elf32-spu.c (spu_elf_relocate_section): Likewise.
938 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
939 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
940 * elf32-v850.c (v850_elf_relax_section): Likewise.
941 * elf32-vax.c (elf_vax_check_relocs): Likewise.
942 (elf_vax_relocate_section): Likewise.
943 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
944 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
945 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
946 (do_fix_for_relocatable_link): Likewise.
947 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
948 (elf64_alpha_relax_with_lituse): Likewise.
949 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
950 (elf_hppa_final_link_relocate): Likewise.
951 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
952 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
953 (elf64_vms_link_add_object_symbols): Likewise.
954 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
955 (mmix_final_link_relocate): Likewise.
956 * elf64-s390.c (invalid_tls_insn): Likewise.
957 (elf_s390_relocate_section): Likewise.
958 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
959 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
960 (elf_x86_64_relocate_section): Likewise.
961 * elfcode.h (elf_slurp_symbol_table): Likewise.
962 * elfcore.h (elf_core_file_p): Likewise.
963 * elflink.c (elf_link_read_relocs_from_section): Likewise.
964 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
965 (elfNN_aarch64_relocate_section): Likewise.
966 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
967 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
968 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
969 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
970 (_bfd_mips_elf_relocate_section): Likewise.
971 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
972 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
973 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
974 * ieee.c (ieee_slurp_external_symbols): Likewise.
975 * ihex.c (ihex_write_object_content): Likewise.
976 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
977 * merge.c (_bfd_merged_section_offset): Likewise.
978 * mmo.c (mmo_write_loc_chunk): Likewise.
979 (mmo_write_object_contents): Likewise.
980 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
981 * stabs.c (_bfd_link_section_stabs): Likewise.
982 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
983
984 2017-07-11 Alan Modra <amodra@gmail.com>
985
986 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
987
988 2017-07-11 Alan Modra <amodra@gmail.com>
989
990 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
991 instruction" error using _bfd_error_handler, not einfo.
992
993 2017-07-10 Nick Clifton <nickc@redhat.com>
994
995 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
996 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
997
998 2017-07-07 John Baldwin <jhb@FreeBSD.org>
999
1000 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1001
1002 2017-07-07 Alan Modra <amodra@gmail.com>
1003
1004 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1005
1006 2017-07-07 Alan Modra <amodra@gmail.com>
1007
1008 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1009 as long long. Move code replacing "ll" with "I64", and simplify.
1010
1011 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1012
1013 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1014 to 1.
1015
1016 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1017
1018 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1019 xtime.
1020 (line_info_add_file_name): Likewise.
1021 (decode_line_info): Likewise.
1022
1023 2017-07-04 Tristan Gingold <gingold@adacore.com>
1024
1025 * version.m4: Bump version to 2.29.51
1026 * configure: Regenerate.
1027
1028 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1029
1030 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1031 sanity check at the head of this function.
1032
1033 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1034
1035 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1036 dwarf_line_str_size.
1037 (struct attr_abbrev): Add field implicit_const.
1038 (dwarf_debug_sections): Add .debug_line_str.
1039 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1040 (dwarf_debug_section_assert): Add static assertion.
1041 (read_indirect_line_string): New.
1042 (read_abbrevs): Support DW_FORM_implicit_const.
1043 (is_str_attr): Support DW_FORM_line_strp.
1044 (read_attribute_value): Support DW_FORM_line_strp and
1045 DW_FORM_implicit_const.
1046 (read_attribute): Support DW_FORM_implicit_const.
1047 (line_info_add_include_dir, line_info_add_include_dir_stub):
1048 (line_info_add_file_name, read_formatted_entries): New.
1049 (decode_line_info, parse_comp_unit): Support DWARF 5.
1050 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1051
1052 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1053
1054 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1055 abort statement that was put for symbols that are not dynamic.
1056
1057 2017-07-03 Tristan Gingold <gingold@adacore.com>
1058
1059 * po/bfd.pot: Regenerate
1060
1061 2017-07-03 Alan Modra <amodra@gmail.com>
1062
1063 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1064 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1065 * elf.c (setup_group): Use "Lx" to print sh_size.
1066 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1067 unknown section type in hex.
1068 (copy_special_section_fields): Style fix.
1069 (bfd_section_from_shdr): Correct format for sh_link. Use a
1070 common error message for all the variants of unrecognized
1071 section types.
1072 (assign_file_positions_for_load_sections): Use "Lx" for lma
1073 adjust error message.
1074 (assign_file_positions_for_non_load_sections): Formatting.
1075 (rewrite_elf_program_header): Formatting. Use "Lx" for
1076 bfd_vma values in error messages.
1077 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1078 ELF_R_SYM value to type expected by format.
1079 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1080 in error messages.
1081 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1082 (elf_link_input_bfd): Use "Lx" for r_info.
1083 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1084
1085 2017-07-03 Alan Modra <amodra@gmail.com>
1086
1087 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1088 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1089 Microsoft C library variant of long long format specifier.
1090 (PRINT20): Cast value to bfd_uint64_t not long long.
1091 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1092 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1093 long long. Don't cast to bfd_vma.
1094 * elf32-score.c (score3_bfd_getl48): Likewise.
1095 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1096
1097 2017-07-03 Alan Modra <amodra@gmail.com>
1098
1099 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1100 print d_tag.
1101 (bfd_elf_print_symbol): Don't cast symbol->flags.
1102 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1103 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1104 _bfd_error_handler argument order.
1105 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1106
1107 2017-07-03 Alan Modra <amodra@gmail.com>
1108
1109 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1110 AC_TYPE_LONG_DOUBLE.
1111 * configure: Regenerate.
1112 * config.in: Regenerate.
1113
1114 2017-06-29 Andrew Waterman <andrew@sifive.com>
1115
1116 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1117 relocs.
1118
1119 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1120
1121 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1122 unless it is undefined weak.
1123 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1124 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1125 relocation.
1126 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1127 is not dynamic in PIC, abort.
1128
1129 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1130
1131 PR ld/21402
1132 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1133 undefined weak symbols into dynamic.
1134 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1135 relocation for non-dynamic symbols.
1136 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1137
1138 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1139
1140 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1141 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1142 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1143 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1144 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1145 support for them.
1146
1147 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1148
1149 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1150 (elfcore_write_s390_gs_bc): Likewise.
1151 * elf.c (elfcore_grok_s390_gs_cb): New function.
1152 (elfcore_grok_s390_gs_bc): New function.
1153 (elfcore_grok_note): Call them.
1154 (elfcore_write_s390_gs_cb): New function.
1155 (elfcore_write_s390_gs_bc): New function.
1156 (elfcore_write_register_note): Call them.
1157
1158 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1159
1160 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1161 bfd_get_file_size. Check archive element size.
1162 (_bfd_generic_get_section_contents_in_window): Likewise.
1163
1164 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1165
1166 * bfd-in2.h: Regenerated.
1167 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1168 (bfd_get_file_size): Likewise.
1169
1170 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1171 Matthew Fortune <matthew.fortune@imgtec.com>
1172
1173 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1174 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1175 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1176 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1177 case.
1178 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1179 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1180 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1181 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1182 `bfd_mach_mips_interaptiv_mr2' entries.
1183 * bfd-in2.h: Regenerate.
1184
1185 2017-06-27 Nick Clifton <nickc@redhat.com>
1186
1187 * tekhex.c (pass_over): Revert accidental conversion of a local
1188 array to a static array.
1189
1190 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1191
1192 PR ld/13402
1193 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1194 reloc addend if necessary. Adjust diff only if
1195 shrinked_insn_address < end_address.
1196
1197 2017-06-27 Alan Modra <amodra@gmail.com>
1198
1199 PR binutils/21665
1200 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1201 (_bfd_generic_get_section_contents_in_window): Likewise.
1202
1203 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1204
1205 * elfnn-riscv.c (perform_relocation): Support the new
1206 R_RISCV_32_PCREL relocation.
1207 (riscv_elf_relocate_section): Likewise.
1208 * elfxx-riscv.c (howto_table): Likewise.
1209 (riscv_reloc_map): Likewise.
1210 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1211 * libbfd.h: Regenerate.
1212
1213 2017-06-27 Alan Modra <amodra@gmail.com>
1214
1215 PR binutils/21665
1216 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1217 Use unsigned file pointer type, and remove cast.
1218 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1219 Add "count", not "sz".
1220
1221 2017-06-26 Pedro Alves <palves@redhat.com>
1222
1223 PR binutils/21665
1224 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
1225 "sz".
1226
1227 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1228
1229 PR binutils/21665
1230 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
1231 a missing line.
1232
1233 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
1234
1235 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
1236 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
1237 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
1238 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
1239 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
1240
1241 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1242
1243 PR binutils/21665
1244 * compress.c (bfd_get_full_section_contents): Don't check the
1245 file size here.
1246 * libbfd.c (_bfd_generic_get_section_contents): Check for and
1247 reject a section whose size + offset is greater than the size
1248 of the entire file.
1249 (_bfd_generic_get_section_contents_in_window): Likewise.
1250
1251 2017-06-26 Nick Clifton <nickc@redhat.com>
1252
1253 PR binutils/21670
1254 * tekhex.c (getvalue): Check for the source pointer exceeding the
1255 end pointer before the first byte is read.
1256
1257 2017-06-26 Nick Clifton <nickc@redhat.com>
1258
1259 PR binutils/21665
1260 * opncls.c (get_build_id): Check that the section is big enough
1261 to contain the whole note.
1262 * compress.c (bfd_get_full_section_contents): Check for and reject
1263 a section whose size is greater than the size of the entire file.
1264 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
1265 contain a notes section.
1266
1267 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1268
1269 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
1270 pointer checks.
1271 (elf_s390_modify_segment_map): Likewise.
1272 (bfd_elf_s390_set_options): Lisewise.
1273
1274 2017-06-26 Alan Modra <amodra@gmail.com>
1275
1276 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
1277 a --just-syms bfd.
1278 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
1279 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
1280 .preinit_array on --just-syms bfds.
1281 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
1282 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
1283 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
1284
1285 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
1286
1287 * elf.c (find_link): Bounds check "hint".
1288
1289 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
1290
1291 * elf32-arm.c (using_thumb_only): Update list of architectures in
1292 BFD_ASSERT for which the logic is valid.
1293 (using_thumb2_bl): Likewise.
1294 (using_thumb2): Likewise and return true for ARMv8-R.
1295 (arch_has_arm_nop): Likewise.
1296 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
1297 merging logic. Update commentis for value 15 of v8m_baseline,
1298 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
1299 merging of value 15 of Tag_CPU_arch.
1300
1301 2017-06-23 Jiong Wang <jiong.wang@arm.com>
1302
1303 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
1304 BFD_RELOC_AARCH64_ADR_GOT_PAGE
1305 * bfd-in2.h: Regenerate.
1306
1307 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1308
1309 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
1310 the error_alignment label forward. Properly align program
1311 property note section.
1312
1313 2017-06-22 Eric Christopher <echristo@gmail.com>
1314
1315 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
1316 abs to fix a truncation warning.
1317
1318 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1319
1320 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
1321 local undefined weak symbol to 0.
1322 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
1323
1324 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1325
1326 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
1327 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1328 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
1329 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1330 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
1331 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1332 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
1333 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1334
1335 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1336
1337 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
1338 (elf_i386_lazy_ibt_plt_entry): Likewise.
1339 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
1340 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
1341 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
1342 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
1343 (elf_i386_lazy_plt_layout): Likewise.
1344 (elf_i386_non_lazy_plt_layout): Likewise.
1345 (elf_i386_link_hash_entry): Add plt_second.
1346 (elf_i386_link_hash_table): Add plt_second and
1347 plt_second_eh_frame.
1348 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
1349 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
1350 the second PLT. Check the second PLT.
1351 (elf_i386_relocate_section): Use the second PLT to resolve
1352 PLT reference if needed.
1353 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
1354 needed.
1355 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
1356 second PLT. Generate unwind info for the second PLT.
1357 (elf_i386_plt_type): Add plt_second.
1358 (elf_i386_get_synthetic_symtab): Support the second PLT.
1359 (elf_i386_parse_gnu_properties): Support
1360 GNU_PROPERTY_X86_FEATURE_1_AND.
1361 (elf_i386_merge_gnu_properties): Support
1362 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1363 on GNU_PROPERTY_X86_FEATURE_1_IBT
1364 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
1365 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1366 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1367 is set on all relocatable inputs.
1368 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
1369 (elf_x32_lazy_ibt_plt_entry): Likewise.
1370 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
1371 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
1372 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
1373 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
1374 (elf_x86_64_lazy_ibt_plt): Likewise.
1375 (elf_x32_lazy_ibt_plt): Likewise.
1376 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1377 (elf_x32_non_lazy_ibt_plt): Likewise.
1378 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
1379 (elf_x86_64_parse_gnu_properties): Support
1380 GNU_PROPERTY_X86_FEATURE_1_AND.
1381 (elf_x86_64_merge_gnu_properties): Support
1382 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1383 on GNU_PROPERTY_X86_FEATURE_1_IBT
1384 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
1385 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1386 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1387 is set on all relocatable inputs.
1388
1389 2017-06-22 Nick Clifton <nickc@redhat.com>
1390
1391 PR binutils/21649
1392 * som.c (setup_sections): NUL terminate the space_strings buffer.
1393 Check that the space.name field does not index beyond the end of
1394 the space_strings buffer.
1395
1396 2017-06-21 Nick Clifton <nickc@redhat.com>
1397
1398 PR binutils/21646
1399 * coff-sh.c (sh_reloc): Check for an out of range reloc.
1400
1401 2017-06-21 Nick Clifton <nickc@redhat.com>
1402
1403 PR binutils/21639
1404 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
1405 type of the size parameter.
1406 (_bfd_vms_save_counted_string): Add second parameter - the maximum
1407 length of the counted string.
1408 * vms.h (_bfd_vms_save_sized_string): Update prototype.
1409 (_bfd_vms_save_counted_string): Likewise.
1410 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
1411 _bfd_vms_save_counted_string.
1412 (_bfd_vms_slurp_ehdr): Likewise.
1413 (_bfd_vms_slurp_egsd): Likewise.
1414 (Parse_module): Likewise.
1415
1416 2017-06-21 Alan Modra <amodra@gmail.com>
1417
1418 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
1419 calls before tocsave calls.
1420 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
1421 following nop.
1422
1423 2017-06-21 Nick Clifton <nickc@redhat.com>
1424
1425 PR binutils/21645
1426 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
1427 bfd_get_full_section_contents returns no contents.
1428
1429 2017-06-21 Nick Clifton <nickc@redhat.com>
1430
1431 PR binutils/21638
1432 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
1433 record.
1434
1435 2017-06-21 Nick Clifton <nickc@redhat.com>
1436
1437 PR binutils/21637
1438 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
1439 list.
1440 (image_set_ptr): Likewise.
1441 (alpha_vms_fix_sec_rel): Likewise.
1442 (alpha_vms_slurp_relocs): Likewise.
1443
1444 2017-06-21 Nick Clifton <nickc@redhat.com>
1445
1446 PR binutils/21633
1447 * ieee.c (ieee_slurp_sections): Check for a NULL return from
1448 read_id.
1449 (ieee_archive_p): Likewise.
1450 (ieee_object_p): Likewise.
1451
1452 2017-06-21 Nick Clifton <nickc@redhat.com>
1453
1454 PR binutils/21640
1455 * elf.c (setup_group): Zero the group section pointer list after
1456 allocation so that loops can be caught. Check for NULL pointers
1457 when processing a group list.
1458
1459 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1460
1461 * elf-s390.h: New file.
1462 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
1463 field.
1464 (elf_s390_additional_program_headers): New function.
1465 (elf_s390_modify_segment_map): New function.
1466 (bfd_elf_s390_set_options): New function.
1467 (elf_backend_additional_program_headers)
1468 (elf_backend_modify_segment_map): Add macro definitions.
1469
1470 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
1471
1472 PR ld/21626
1473 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
1474 the DYNAMIC bit instead of bfd_count_sections.
1475
1476 2017-06-19 Nick Clifton <nickc@redhat.com>
1477
1478 PR binutils/21618
1479 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
1480 length.
1481 (evax_bfd_print_eeom): Likewise.
1482 (evax_bfd_print_egsd): Check for an overlarge record length.
1483 (evax_bfd_print_etir): Likewise.
1484
1485 2017-06-19 Nick Clifton <nickc@redhat.com>
1486
1487 PR binutils/21612
1488 * libieee.h (struct common_header_type): Add end_p field.
1489 * ieee.c (this_byte_and_next): Do not advance input_p beyond
1490 end_p.
1491 (read_id): Check for a length that exceeds the remaining bytes in
1492 the input buffer.
1493 (ieee_seek): Initialise end_p.
1494 (ieee_archive_p): Likewise.
1495 (ieee_object_p): Likewise.
1496
1497 2017-06-19 Nick Clifton <nickc@redhat.com>
1498
1499 PR binutils/21611
1500 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
1501 before reading the EIHS structure entries.
1502
1503 2017-06-19 Nick Clifton <nickc@redhat.com>
1504
1505 PR binutils/21615
1506 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
1507 gsd_size. Check that there are enough bytes remaining to read the
1508 type and size of the next egsd. Check that the size of the egsd
1509 does not exceed the size of the record.
1510
1511 2017-06-19 Alan Modra <amodra@gmail.com>
1512
1513 * config.bfd: Correct targ_underscore for cris.
1514
1515 2017-06-18 Alan Modra <amodra@gmail.com>
1516
1517 * config.bfd: Correct targ_underscore for epiphany, ip2k,
1518 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
1519
1520 2017-06-16 Nick Clifton <nickc@redhat.com>
1521
1522 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
1523 bucketlist is empty because there are no symbols to add to the
1524 list.
1525
1526 2017-06-16 Alan Modra <amodra@gmail.com>
1527
1528 PR ld/20022
1529 PR ld/21557
1530 PR ld/21562
1531 PR ld/21571
1532 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
1533 (BFD_JUMP_TABLE_LINK): Likewise.
1534 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
1535 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
1536 (bfd_elf_define_start_stop): New function.
1537 * linker.c (bfd_generic_define_start_stop): New function.
1538 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
1539 new field.
1540 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
1541 * aout-target.h (MY_bfd_define_start_stop): Define.
1542 * aout-tic30.c (MY_bfd_define_start_stop): Define.
1543 * binary.c (binary_bfd_define_start_stop): Define.
1544 * bout.c (b_out_bfd_define_start_stop): Define.
1545 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
1546 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
1547 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
1548 * coffcode.h (coff_bfd_define_start_stop): Define.
1549 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
1550 * i386msdos.c (msdos_bfd_define_start_stop): Define.
1551 * i386os9k.c (os9k_bfd_define_start_stop): Define.
1552 * ieee.c (ieee_bfd_define_start_stop): Define.
1553 * ihex.c (ihex_bfd_define_start_stop): Define.
1554 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
1555 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
1556 * mmo.c (mmo_bfd_define_start_stop): Define.
1557 * nlm-target.h (nlm_bfd_define_start_stop): Define.
1558 * oasys.c (oasys_bfd_define_start_stop): Define.
1559 * pef.c (bfd_pef_bfd_define_start_stop): Define.
1560 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
1561 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
1562 * som.c (som_bfd_define_start_stop): Define.
1563 * srec.c (srec_bfd_define_start_stop): Define.
1564 * tekhex.c (tekhex_bfd_define_start_stop): Define.
1565 * versados.c (versados_bfd_define_start_stop): Define.
1566 * vms-alpha.c (vms_bfd_define_start_stop): Define.
1567 (alpha_vms_bfd_define_start_stop): Define.
1568 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
1569 * bfd-in2.h: Regenerate.
1570 * libbfd.h: Regenerate.
1571
1572 2017-06-16 Jiong Wang <jiong.wang@arm.com>
1573
1574 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
1575 SYMBOL_REFERENCES_LOCAL.
1576
1577 2017-06-15 Jiong Wang <jiong.wang@arm.com>
1578
1579 PR ld/21532
1580 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
1581 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
1582 runtime for if there needs copy relocation elimination.
1583 (need_copy_relocation_p): New function. Return true for symbol with
1584 pc-relative references and if it's against read-only sections.
1585 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
1586 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
1587 that are related with accessing external objects.
1588 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
1589 in elfNN_aarch64_check_relocs.
1590
1591 2017-06-15 Nick Clifton <nickc@redhat.com>
1592
1593 PR binutils/21582
1594 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
1595 bugs.
1596 PR binutils/21581
1597 (ieee_archive_p): Likewise.
1598
1599 2017-06-15 Nick Clifton <nickc@redhat.com>
1600
1601 PR binutils/21579
1602 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
1603
1604 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
1605
1606 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
1607 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
1608 keep both windowed and call0 ABI PLT definitions.
1609 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
1610 elf_xtensa_*_plt_entry endex.
1611 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
1612
1613 2017-06-14 Nick Clifton <nickc@redhat.com>
1614
1615 PR binutils/21578
1616 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
1617 flag value.
1618
1619 2017-06-14 Nick Clifton <nickc@redhat.com>
1620
1621 PR binutils/21589
1622 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
1623 maximum value for the ascic pointer. Check that name processing
1624 does not read beyond this value.
1625 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
1626 end of etir record.
1627
1628 2017-06-14 Nick Clifton <nickc@redhat.com>
1629
1630 PR binutils/21591
1631 * versados.c (versados_mkobject): Zero the allocated tdata structure.
1632 (process_otr): Check for an invalid offset in the otr structure.
1633
1634 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
1635
1636 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
1637
1638 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
1639
1640 PR ld/20022
1641 PR ld/21557
1642 PR ld/21562
1643 PR ld/21571
1644 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
1645 vtable field to a union.
1646 (_bfd_elf_is_start_stop): Removed.
1647 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
1648 __start_SECNAME and __stop_SECNAME symbols.
1649 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1650 * elflink.c (_bfd_elf_is_start_stop): Removed.
1651 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
1652 _bfd_elf_is_start_stop.
1653 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
1654 __stop_SECNAME symbols. Updated.
1655 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1656 (bfd_elf_gc_record_vtinherit): Likewise.
1657 (bfd_elf_gc_record_vtentry): Likewise.
1658
1659 2017-06-13 Nick Clifton <nickc@redhat.com>
1660
1661 PR ld/21524
1662 * elflink.c (elf_link_adjust_relocs): Generate an error when
1663 encountering a reloc against a symbol removed by garbage
1664 collection.
1665
1666 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
1667
1668 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1669 to merge_gnu_properties.
1670 * elf-properties.c (elf_merge_gnu_properties): Add struct
1671 bfd_link_info * and pass it to merge_gnu_properties.
1672 (elf_merge_gnu_property_list): Add struct bfd_link_info *
1673 and pass it to elf_merge_gnu_properties.
1674 (_bfd_elf_link_setup_gnu_properties): Pass info to
1675 elf_merge_gnu_property_list.
1676 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1677 bfd_link_info *.
1678 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1679
1680 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
1681
1682 PR 21564
1683 * binary.c (binary_set_section_contents): Scale lma by octets
1684 per byte to set filepos.
1685
1686 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1687
1688 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1689 dynamic sections.
1690
1691 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1692
1693 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1694 require TEXTREL.
1695
1696 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1697
1698 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1699 patched section contents for TLS IE reloc.
1700 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1701
1702 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1703
1704 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1705 RELOC_FOR_GLOBAL_SYMBOL macro.
1706
1707 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1708
1709 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1710 changes.
1711
1712 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1713
1714 * config/tc-arc.c (md_undefined_symbol): Changed.
1715 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1716
1717 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1718
1719 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1720 symbols.
1721
1722 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1723
1724 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1725 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1726
1727 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1728
1729 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1730 object is created.
1731
1732 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
1733
1734 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1735 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1736 is non-zero. Add clarifying comments.
1737
1738 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
1739
1740 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1741 name. Use local IFUNC symbol name string to report unsupported
1742 non-PIC call to IFUNC function.
1743 (elf_i386_relocate_section): Dump local IFUNC name with minfo
1744 when generating R_386_IRELATIVE relocation.
1745 (elf_i386_finish_dynamic_symbol): Likewise.
1746 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1747 IFUNC symbol name.
1748 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1749 when generating R_X86_64_IRELATIVE relocation.
1750 (elf_x86_64_finish_dynamic_symbol): Likewise.
1751
1752 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1753
1754 * elf.c (setup_group): Make sure BFD sections are created for all
1755 group sections in the input file when processing SHF_GROUP
1756 sections.
1757 (bfd_section_from_shdr): Avoid duplicating logic already
1758 implemented in `setup_group'.
1759
1760 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
1761
1762 PR binutils/21546
1763 * peXXigen.c (pe_print_idata): Use the address of the first thunk
1764 if the hint address is zero.
1765
1766 2017-06-06 James Clarke <jrtc27@jrtc27.com>
1767
1768 PR ld/19579
1769 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1770 ELF_COMMON_DEF_P for common symbols.
1771
1772 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
1773
1774 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1775 SEC_GROUP sections as SEC_EXCLUDE.
1776 (bfd_elf_set_group_contents): Replace use of abort with an assert.
1777 (assign_section_numbers): Use resolve_section_groups flag instead
1778 of relocatable link type.
1779 (_bfd_elf_init_private_section_data): Use resolve_section_groups
1780 flag instead of checking the final_link flag for part of the
1781 checks in here. Fix white space as a result.
1782 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1783 instead of relocatable link type.
1784 (bfd_elf_final_link): Likewise.
1785
1786 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1787
1788 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1789 variable `bed'.
1790 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1791 (s3_bfd_score_elf_check_relocs): Likewise.
1792 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1793 (score_elf_final_link_relocate): Likewise.
1794 (s7_bfd_score_elf_check_relocs): Likewise.
1795
1796 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1797
1798 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1799 `bed'.
1800
1801 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1802
1803 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1804 from `reloc_count' rather than decrementing it.
1805 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1806 `reloc_count' by `int_rels_per_ext_rel'.
1807 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1808 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1809 entry determination.
1810 (s3_bfd_score_elf_check_relocs): Likewise.
1811 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1812 (s7_bfd_score_elf_relocate_section): Likewise.
1813 (s7_bfd_score_elf_check_relocs): Likewise.
1814 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1815 prototype and function.
1816 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1817 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1818 triple rather than once the sum of REL and RELA relocation entry
1819 counts.
1820 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1821 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1822 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1823 storage allocation size determination.
1824 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1825 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1826 by `int_rels_per_ext_rel' for last relocation entry
1827 determination.
1828 (bfd_elf_final_link): Do not multiply `reloc_count' by
1829 `int_rels_per_ext_rel' for internal relocation storage
1830 allocation size determination.
1831 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1832 `int_rels_per_ext_rel' for last relocation entry determination.
1833 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1834 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1835 (_bfd_mips_elf_relocate_section): Likewise.
1836
1837 2017-06-05 Alan Modra <amodra@gmail.com>
1838
1839 PR 21529
1840 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1841
1842 2017-06-01 John Baldwin <jhb@FreeBSD.org>
1843
1844 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1845 determine structure sizes.
1846 (elfcore_grok_freebsd_prstatus): Likewise.
1847
1848 2017-06-01 Alan Modra <amodra@gmail.com>
1849
1850 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1851 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1852 dynamic objects.
1853 (is_elfv2_localentry0): New function.
1854 (ppc64_elf_tls_setup): Default params->plt_localentry0.
1855 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1856 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1857 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1858 optimized localentry:0 stubs.
1859 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1860 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1861 localentry:0 stubs.
1862 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1863 DT_PPC64_OPT.
1864 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1865
1866 2017-05-30 Casey Smith <clegg89@gmail.com>
1867
1868 PR ld/21523
1869 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1870 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1871
1872 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
1873
1874 * cpu-arc.c (arc_compatible): New function.
1875
1876 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
1877
1878 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1879
1880 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
1881
1882 PR binutils/21519
1883 * bfdio.c (bfd_get_file_size): New function.
1884 * bfd-in2.h: Regenerated.
1885
1886 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
1887
1888 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1889 comments.
1890
1891 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
1892
1893 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1894 dynobj instead of htab->elf.dynobj.
1895
1896 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
1897
1898 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1899 and function.
1900 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1901 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1902 actual number of internal relocations retrieved. Adjust
1903 function description.
1904 (bfd_elf64_canonicalize_reloc): Remove macro.
1905 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1906
1907 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
1908
1909 * archures.c (bfd_mach_sparc_v9m8): Define.
1910 (bfd_mach_sparc_v8plusm8): Likewise.
1911 (bfd_mach_sparc_v9_p): Adjust to M8.
1912 (bfd_mach_sparc_64bit_p): Likewise.
1913 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1914 bfd_mach_sparc_v8plusm8.
1915 * bfd-in2.h: Regenerated.
1916 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1917 sparc:v8plusm8.
1918 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1919 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1920 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1921 SHA3.
1922 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1923 bfd_mach_sparc_v8plusm8.
1924
1925 2017-05-19 Alan Modra <amodra@gmail.com>
1926
1927 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1928 debug and special sections when no non-note alloc sections in an
1929 object are kept.
1930
1931 2017-05-18 Alan Modra <amodra@gmail.com>
1932
1933 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1934 * elf-m10300.c: Likewise.
1935 * elf.c: Likewise.
1936 * elf32-arc.c: Likewise.
1937 * elf32-bfin.c: Likewise.
1938 * elf32-m68k.c: Likewise.
1939 * elf32-nds32.c: Likewise.
1940 * elf32-tilepro.c: Likewise.
1941 * elflink.c: Likewise.
1942 * elfnn-aarch64.c: Likewise.
1943 * elfnn-riscv.c: Likewise.
1944 * elfxx-tilegx.c: Likewise.
1945 * mach-o.c: Likewise.
1946 * peXXigen.c: Likewise.
1947 * vms-alpha.c: Likewise.
1948 * vms-lib.c: Likewise.
1949
1950 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
1951
1952 PR ld/20882
1953 * elflink.c (elf_gc_mark_debug_section): New function.
1954 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1955 referenced by kept debug sections.
1956
1957 2017-05-16 Alan Modra <amodra@gmail.com>
1958
1959 * elf-m10300.c: Rename occurrences of non_ir_ref.
1960 * elf32-arm.c: Likewise.
1961 * elf32-bfin.c: Likewise.
1962 * elf32-cr16.c: Likewise.
1963 * elf32-cris.c: Likewise.
1964 * elf32-d10v.c: Likewise.
1965 * elf32-dlx.c: Likewise.
1966 * elf32-fr30.c: Likewise.
1967 * elf32-frv.c: Likewise.
1968 * elf32-hppa.c: Likewise.
1969 * elf32-i370.c: Likewise.
1970 * elf32-i386.c: Likewise.
1971 * elf32-iq2000.c: Likewise.
1972 * elf32-lm32.c: Likewise.
1973 * elf32-m32c.c: Likewise.
1974 * elf32-m32r.c: Likewise.
1975 * elf32-m68hc1x.c: Likewise.
1976 * elf32-m68k.c: Likewise.
1977 * elf32-mcore.c: Likewise.
1978 * elf32-metag.c: Likewise.
1979 * elf32-microblaze.c: Likewise.
1980 * elf32-moxie.c: Likewise.
1981 * elf32-msp430.c: Likewise.
1982 * elf32-mt.c: Likewise.
1983 * elf32-nios2.c: Likewise.
1984 * elf32-or1k.c: Likewise.
1985 * elf32-ppc.c: Likewise.
1986 * elf32-rl78.c: Likewise.
1987 * elf32-s390.c: Likewise.
1988 * elf32-score.c: Likewise.
1989 * elf32-score7.c: Likewise.
1990 * elf32-sh.c: Likewise.
1991 * elf32-tic6x.c: Likewise.
1992 * elf32-tilepro.c: Likewise.
1993 * elf32-v850.c: Likewise.
1994 * elf32-vax.c: Likewise.
1995 * elf32-xstormy16.c: Likewise.
1996 * elf32-xtensa.c: Likewise.
1997 * elf64-alpha.c: Likewise.
1998 * elf64-hppa.c: Likewise.
1999 * elf64-ia64-vms.c: Likewise.
2000 * elf64-mmix.c: Likewise.
2001 * elf64-ppc.c: Likewise.
2002 * elf64-s390.c: Likewise.
2003 * elf64-sh64.c: Likewise.
2004 * elf64-x86-64.c: Likewise.
2005 * elflink.c: Likewise.
2006 * elfnn-aarch64.c: Likewise.
2007 * elfnn-ia64.c: Likewise.
2008 * elfnn-riscv.c: Likewise.
2009 * elfxx-mips.c: Likewise.
2010 * elfxx-sparc.c: Likewise.
2011 * elfxx-tilegx.c: Likewise.
2012 * linker.c: Likewise.
2013
2014 2017-05-16 Alan Modra <amodra@gmail.com>
2015
2016 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2017 * elflink.c (elf_link_add_object_symbols): Update to use
2018 non_ir_ref_dynamic.
2019 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2020 non_ir_ref.
2021 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2022
2023 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2024
2025 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2026
2027 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2028
2029 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2030 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2031 properties.
2032 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2033
2034 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2035
2036 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2037 to plt_second.
2038 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2039 to plt_second/plt_second_eh_frame.
2040 (elf_x86_64_link_hash_newfunc): Updated.
2041 (elf_x86_64_allocate_dynrelocs): Likewise.
2042 (elf_x86_64_size_dynamic_sections): Likewise.
2043 (elf_x86_64_relocate_section): Likewise.
2044 (elf_x86_64_finish_dynamic_symbol): Likewise.
2045 (elf_x86_64_finish_dynamic_sections): Likewise.
2046 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2047 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2048 .plt.sec section.
2049 (elf_backend_setup_gnu_properties): Updated. Create the
2050 .plt.sec section instead of the .plt.sec section.
2051
2052 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2053
2054 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2055 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2056 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2057
2058 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2059
2060 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2061 (bfd_elf64_set_reloc): Define.
2062 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2063
2064 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2065
2066 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2067 (struct bfd_target): New field _bfd_set_reloc.
2068 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2069 * reloc.c (_bfd_generic_set_reloc): New function.
2070 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2071 * nlm-target.h (nlm_set_reloc): Likewise.
2072 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2073 * aout-tic30.c (MY_set_reloc): Likewise.
2074 * aout-target.h (MY_set_reloc): Likewise.
2075 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2076 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2077 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2078 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2079 * aout-adobe.c (aout_32_set_reloc): Likewise.
2080 * bout.c (b_out_set_reloc): Likewise.
2081 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2082 * i386os9k.c (aout_32_set_reloc): Likewise.
2083 * ieee.c (ieee_set_reloc): Likewise.
2084 * oasys.c (oasys_set_reloc): Likewise.
2085 * som.c (som_set_reloc): Likewise.
2086 * versados.c (versados_set_reloc): Likewise.
2087 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2088 _bfd_generic_set_reloc.
2089 (rs6000_xcoff64_aix_vec): LIkewise.
2090 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2091 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2092 * i386msdos.c (msdos_set_reloc): Define to
2093 _bfd_norelocs_set_reloc.
2094 * elfcode.h (elf_set_reloc): Define.
2095 * bfd-in2.h: Regenerated.
2096
2097 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2098
2099 PR ld/21481
2100 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2101 for IFUNC function address.
2102
2103 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2104
2105 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2106 (CONFLICT_LIST): Likewise.
2107 (opcode/arc-attrs.h): Include.
2108 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2109 (arc_extract_features): New file.
2110 (arc_stralloc): Likewise.
2111 (arc_elf_merge_attributes): Likewise.
2112 (arc_elf_merge_private_bfd_data): Use object attributes.
2113 (bfd_arc_get_mach_from_attributes): New function.
2114 (arc_elf_object_p): Use object attributes.
2115 (arc_elf_final_write_processing): Likewise.
2116 (elf32_arc_obj_attrs_arg_type): New function.
2117 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2118 (elf32_arc_section_from_shdr): Likewise.
2119 (elf_backend_obj_attrs_vendor): Define.
2120 (elf_backend_obj_attrs_section): Likewise.
2121 (elf_backend_obj_attrs_arg_type): Likewise.
2122 (elf_backend_obj_attrs_section_type): Likewise.
2123 (elf_backend_obj_attrs_handle_unknown): Likewise.
2124 (elf_backend_section_from_shdr): Likewise.
2125
2126 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2127
2128 PR ld/21458
2129 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2130 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2131 and the destination is a Thumb symbol.
2132
2133 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2134
2135 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2136 initializer to silence GCC 4.2.
2137 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2138
2139 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2140
2141 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2142 (LAZY_PLT_ENTRY_SIZE): This.
2143 (NON_LAZY_PLT_ENTRY_SIZE): New.
2144 (elf_x86_64_plt0_entry): Renamed to ...
2145 (elf_x86_64_lazy_plt0_entry): This.
2146 (elf_x86_64_plt_entry): Renamed to ...
2147 (elf_x86_64_lazy_plt_entry): This.
2148 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2149 (elf_x86_64_lazy_bnd_plt0_entry): This.
2150 (elf_x86_64_legacy_plt_entry): Removed.
2151 (elf_x86_64_bnd_plt_entry): Renamed to ...
2152 (elf_x86_64_lazy_bnd_plt_entry): This.
2153 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2154 (elf_x86_64_non_lazy_plt_entry): This.
2155 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2156 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2157 (elf_x86_64_eh_frame_plt): Renamed to ...
2158 (elf_x86_64_eh_frame_lazy_plt): This.
2159 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2160 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2161 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2162 (elf_x86_64_eh_frame_non_lazy_plt): This.
2163 (elf_x86_64_lazy_plt_layout): New.
2164 (elf_x86_64_non_lazy_plt_layout): Likewise.
2165 (elf_x86_64_plt_layout): Likewise.
2166 (elf_x86_64_backend_data): Remove PLT layout information. Add
2167 os for target system.
2168 (GET_PLT_ENTRY_SIZE): Removed.
2169 (elf_x86_64_lazy_plt): New.
2170 (elf_x86_64_non_lazy_plt): Likewise.
2171 (elf_x86_64_lazy_bnd_plt): Likewise.
2172 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2173 (elf_x86-64_arch_bed): Updated.
2174 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2175 (elf_x86_64_create_dynamic_sections): Removed.
2176 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2177 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2178 (elf_x86-64_adjust_dynamic_symbol): Updated.
2179 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2180 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2181 size for PLT0 if there is no PLT0. Get plt_entry_size from
2182 non_lazy_plt for non-lazy PLT entries.
2183 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2184 from non_lazy_plt for non-lazy PLT entries.
2185 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2186 if there is no PLT0.
2187 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2188 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2189 entries with non-lazy PLT layout. Don't fill the second and third
2190 slots in the PLT entry if there is no PLT0.
2191 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2192 if there is no PLT0. Set sh_entsize on the .plt.got section.
2193 (compare_relocs): New.
2194 (elf_x86_64_plt_type): Likewise.
2195 (elf_x86_64_plt): Likewise.
2196 (elf_x86_64_nacl_plt): New. Forward declaration.
2197 (elf_x86_64_get_plt_sym_val): Removed.
2198 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2199 against all dynamic relocations.
2200 (elf_x86_64_link_setup_gnu_properties): New function.
2201 (elf_backend_create_dynamic_sections): Updated.
2202 (elf_backend_setup_gnu_properties): New.
2203 (elf_x86_64_nacl_plt): New.
2204 (elf_x86_64_nacl_arch_bed): Updated.
2205
2206 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2207
2208 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2209 (LAZY_PLT_ENTRY_SIZE): This.
2210 (NON_LAZY_PLT_ENTRY_SIZE): New.
2211 (elf_i386_plt0_entry): Renamed to ...
2212 (elf_i386_lazy_plt0_entry): This.
2213 (elf_i386_plt_entry): Renamed to ...
2214 (elf_i386_lazy_plt_entry): This.
2215 (elf_i386_pic_plt0_entry): Renamed to ...
2216 (elf_i386_pic_lazy_plt0_entry): This.
2217 (elf_i386_pic_plt_entry): Renamed to ...
2218 (elf_i386_pic_lazy_plt_entry): This.
2219 (elf_i386_got_plt_entry): Renamed to ...
2220 (elf_i386_non_lazy_plt_entry): This.
2221 (elf_i386_pic_got_plt_entry): Renamed to ...
2222 (elf_i386_pic_non_lazy_plt_entry): This.
2223 (elf_i386_eh_frame_plt): Renamed to ...
2224 (elf_i386_eh_frame_lazy_plt): This.
2225 (elf_i386_eh_frame_plt_got): Renamed to ...
2226 (elf_i386_eh_frame_non_lazy_plt): This.
2227 (elf_i386_plt_layout): Renamed to ...
2228 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
2229 eh_frame_plt_got_size.
2230 (elf_i386_non_lazy_plt_layout): New.
2231 (elf_i386_plt_layout): Likewise.
2232 (elf_i386_non_lazy_plt): Likewise.
2233 (GET_PLT_ENTRY_SIZE): Removed.
2234 (elf_i386_plt): Renamed to ...
2235 (elf_i386_lazy_plt): This.
2236 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
2237 (elf_i386_arch_bed): Updated.
2238 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2239 (elf_i386_create_dynamic_sections): Removed.
2240 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
2241 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2242 (elf_i386_adjust_dynamic_symbol): Updated.
2243 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
2244 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2245 size for PLT0 if there is no PLT0.
2246 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
2247 output section is discarded only if GOT isn't empty.
2248 (elf_i386_relocate_section): Updated. Properly get PLT index
2249 if there is no PLT0.
2250 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
2251 second and third slots in the PLT entry if there is no PLT0.
2252 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
2253 if there is no PLT0. Set sh_entsize on the .plt.got section.
2254 (elf_i386_nacl_plt): Forward declaration.
2255 (elf_i386_get_plt_sym_val): Removed.
2256 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
2257 against all dynamic relocations.
2258 (elf_i386_link_setup_gnu_properties): New function.
2259 (elf_backend_create_dynamic_sections): Updated.
2260 (elf_backend_setup_gnu_properties): New.
2261 (elf_i386_nacl_plt): Updated.
2262 (elf_i386_nacl_arch_bed): Likewise.
2263 (elf_i386_vxworks_arch_bed): Likewise.
2264
2265 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
2266
2267 * elflink.c (elf_output_implib): Remove executable flag from import
2268 library bfd.
2269 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
2270 library is a relocatable object file.
2271
2272 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2273
2274 PR ld/21404
2275 * elf32-avr.c (avr_should_move_sym): New function.
2276 (avr_should_reduce_sym_size): Likewise.
2277 (avr_should_increase_sym_size): Likewise.
2278 (elf32_avr_relax_delete_bytes): Adjust symbol values
2279 and sizes by calling new functions.
2280
2281 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
2282
2283 * config.bfd (riscv32-*): Enable rv64.
2284
2285 2017-05-02 Alan Modra <amodra@gmail.com>
2286
2287 PR 21384
2288 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
2289 rather than h->root.type == bfd_link_hash_new.
2290 (bfd_elf_record_link_assignment): Similarly, call
2291 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
2292
2293 2017-04-29 Alan Modra <amodra@gmail.com>
2294
2295 PR 21432
2296 * reloc.c (reloc_offset_in_range): New function.
2297 (bfd_perform_relocation, bfd_install_relocation): Use it.
2298 (_bfd_final_link_relocate): Likewise.
2299
2300 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
2301
2302 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
2303 before using .plt.got.
2304 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2305
2306 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2307
2308 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
2309 instead of "+=" to update 0.
2310
2311 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2312
2313 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
2314 .plt.got section here.
2315 (elf_i386_check_relocs): Don't create the .plt.got section.
2316 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
2317 the .plt.got and .plt.bnd sections here.
2318 (elf_x86_64_check_relocs): Don't create the .plt.got nor
2319 .plt.bnd sections.
2320
2321 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2322
2323 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
2324 has_bnd_reloc.
2325 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
2326 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
2327 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
2328 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
2329 has_bnd_reloc.
2330
2331 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2332
2333 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
2334 to return bfd *.
2335 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
2336 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
2337 the first relocatable ELF input with GNU properties.
2338
2339 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2340
2341 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
2342 VxWorks for non-PIC.
2343
2344 2017-04-27 Alan Modra <amodra@gmail.com>
2345
2346 * elf-bfd.h (struct elf_backend_data): Make asection param of
2347 elf_backend_eh_frame_address_size const.
2348 (_bfd_elf_eh_frame_address_size): Likewise.
2349 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
2350 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
2351 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
2352 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
2353 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
2354 (next_cie_fde_offset): Constify params.
2355 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2356
2357 2017-04-27 Alan Modra <amodra@gmail.com>
2358
2359 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
2360 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
2361 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
2362 aug_data_len.
2363 (offset_adjust): New function.
2364 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
2365 (adjust_eh_frame_local_symbols): Likewise.
2366 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
2367 after changing anything. Return true if anything changed.
2368 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
2369 _bfd_elf_adjust_eh_frame_global_symbol for globals.
2370
2371 2017-04-27 Alan Modra <amodra@gmail.com>
2372
2373 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
2374 when force_local.
2375
2376 2017-04-27 Alan Modra <amodra@gmail.com>
2377
2378 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2379 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
2380 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
2381 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
2382 for undef and undefweak dyn_relocs.
2383 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2384 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
2385 (allocate_got, allocate_dynrelocs): Likewise.
2386 (ppc64_elf_relocate_section): Likewise.
2387
2388 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
2389
2390 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
2391 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
2392 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
2393 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
2394
2395 2017-04-26 Nick Clifton <nickc@redhat.com>
2396
2397 PR binutils/21434
2398 * reloc.c (bfd_perform_relocation): Check for a negative address
2399 in the reloc.
2400
2401 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2402
2403 PR ld/21334
2404 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
2405 member.
2406 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
2407 (elf_backend_always_renumber_dynsyms): Define.
2408 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
2409 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
2410 * elflink.c (bfd_elf_size_dynamic_sections): Also call
2411 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
2412 it.
2413 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2414
2415 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2416
2417 * elflink.c (bfd_elf_size_dynamic_sections): Only call
2418 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
2419 sections have been created.
2420
2421 2017-04-26 Nick Clifton <nickc@redhat.com>
2422
2423 PR binutils/21431
2424 * compress.c (bfd_init_section_compress_status): Check the return
2425 value from bfd_malloc.
2426
2427 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2428
2429 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
2430 no_finish_dynamic_symbol.
2431 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
2432 0.
2433 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
2434 weak symbol, don't make it dynamic.
2435 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
2436 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
2437 relocation for GOT reference.
2438 (elf_x86_64_finish_dynamic_symbol): Abort if
2439 no_finish_dynamic_symbol isn't 0.
2440
2441 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2442
2443 PR ld/21402
2444 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
2445 undefined weak symbol, don't make it dynamic.
2446 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
2447 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2448 relocation for R_386_GOT32.
2449
2450 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2451
2452 PR ld/21425
2453 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
2454
2455 2017-04-23 Alan Modra <amodra@gmail.com>
2456
2457 PR 21414
2458 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
2459 * elf.c (lcomm_sym): New.
2460 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
2461 * bfd-in2.h: Regenerate.
2462
2463 2017-04-23 Alan Modra <amodra@gmail.com>
2464
2465 PR 21412
2466 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
2467 parameters and comment.
2468 (_bfd_elf_get_reloc_section): Delete.
2469 (_bfd_elf_plt_get_reloc_section): Declare.
2470 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
2471 New functions. Don't blindly skip over assumed .rel/.rela prefix.
2472 Extracted from..
2473 (_bfd_elf_get_reloc_section): ..here. Delete.
2474 (assign_section_numbers): Call elf_get_reloc_section.
2475 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
2476 * elfxx-target.h (elf_backend_get_reloc_section): Update.
2477
2478 2017-04-23 Alan Modra <amodra@gmail.com>
2479
2480 PR 21409
2481 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
2482 no symbols.
2483
2484 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2485
2486 PR ld/21402
2487 * elf32-i386.c (elf_i386_link_hash_entry): Add
2488 no_finish_dynamic_symbol.
2489 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
2490 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
2491 symbol, don't make it dynamic in PIE.
2492 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
2493 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2494 relocation for R_386_GOT32
2495 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
2496 isn't 0.
2497
2498 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2499
2500 PR ld/19617
2501 PR ld/21086
2502 * elflink.c (elf_link_add_object_symbols): Require
2503 --no-dynamic-linker with -E/--dynamic-list when creating
2504 dynamic sections.
2505
2506 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2507
2508 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
2509 if forced local.
2510
2511 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2512
2513 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
2514 dynamic symbol sorting.
2515
2516 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
2517
2518 PR ld/21382
2519 * elflink.c (elf_link_add_object_symbols): Preserve
2520 dynamic_ref_after_ir_def when restoring the symbol table for
2521 unneeded dynamic object.
2522
2523 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
2524
2525 PR ld/21401
2526 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
2527 on on undefined IFUNC symbol in the second PLT.
2528
2529 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
2530
2531 * peXXigen.c (pe_print_reloc): Correct chunk_end.
2532
2533 2017-04-19 Alan Modra <amodra@gmail.com>
2534
2535 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
2536 or make dynamic for info->dynamic_undefined_weak 0 and 1.
2537 * elf32-ppc.c:Formatting.
2538 (ensure_undefweak_dynamic): Don't make dynamic when
2539 info->dynamic_undefined_weak is zero.
2540 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2541 info->dynamic_undefined_weak. Discard undef dyn_relocs when
2542 not default visibility. Discard undef and undefweak
2543 dyn_relocs earlier.
2544 (ppc_elf_relocate_section): Adjust to suit.
2545 * elf64-ppc.c: Formatting.
2546 (ensure_undefweak_dynamic): Don't make dynamic when
2547 info->dynamic_undefined_weak is zero.
2548 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2549 info->dynamic_undefined_weak. Discard them earlier.
2550
2551 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
2552
2553 PR ld/21389
2554 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
2555 before generating the version definition section.
2556
2557 2017-04-17 Alan Modra <amodra@gmail.com>
2558
2559 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
2560 state when a regular object file defines a symbol with
2561 incompatible type to that defined by an earlier shared lib.
2562
2563 2017-04-13 Alan Modra <amodra@gmail.com>
2564
2565 * coffcode.h: Wrap some overly long _bfd_error_handler args.
2566 * elf.c: Likewise.
2567 * elf32-arm.c: Likewise.
2568 * elf32-i386.c: Likewise.
2569 * elf32-mep.c: Likewise.
2570 * elf64-ia64-vms.c: Likewise.
2571 * elf64-x86-64.c: Likewise.
2572 * elflink.c: Likewise.
2573 * elfnn-ia64.c: Likewise.
2574 * elfxx-mips.c: Likewise.
2575
2576 2017-04-13 Alan Modra <amodra@gmail.com>
2577
2578 * aoutx.h: Use %B and %A in error messages throughout file.
2579 * aout-cris.c: Likewise.
2580 * archive.c: Likewise.
2581 * binary.c: Likewise.
2582 * coff-rs6000.c: Likewise.
2583 * coff-tic4x.c: Likewise.
2584 * coffcode.h: Likewise.
2585 * coffgen.c: Likewise.
2586 * cofflink.c: Likewise.
2587 * coffswap.h: Likewise.
2588 * cpu-arm.c: Likewise.
2589 * elf-eh-frame.c: Likewise.
2590 * elf-m10300.c: Likewise.
2591 * elf.c: Likewise.
2592 * elf32-arc.c: Likewise.
2593 * elf32-arm.c: Likewise.
2594 * elf32-bfin.c: Likewise.
2595 * elf32-frv.c: Likewise.
2596 * elf32-iq2000.c: Likewise.
2597 * elf32-m32c.c: Likewise.
2598 * elf32-microblaze.c: Likewise.
2599 * elf32-nds32.c: Likewise.
2600 * elf32-rl78.c: Likewise.
2601 * elf32-rx.c: Likewise.
2602 * elf32-score.c: Likewise.
2603 * elf32-score7.c: Likewise.
2604 * elf32-sh64.c: Likewise.
2605 * elf32-v850.c: Likewise.
2606 * elf32-vax.c: Likewise.
2607 * elf32-visium.c: Likewise.
2608 * elf64-ia64-vms.c: Likewise.
2609 * elf64-mmix.c: Likewise.
2610 * elf64-sh64.c: Likewise.
2611 * elfcode.h: Likewise.
2612 * elfnn-aarch64.c: Likewise.
2613 * elfnn-ia64.c: Likewise.
2614 * elfxx-mips.c: Likewise.
2615 * hpux-core.c: Likewise.
2616 * ieee.c: Likewise.
2617 * ihex.c: Likewise.
2618 * linker.c: Likewise.
2619 * merge.c: Likewise.
2620 * mmo.c: Likewise.
2621 * oasys.c: Likewise.
2622 * pdp11.c: Likewise.
2623 * peXXigen.c: Likewise.
2624 * rs6000-core.c: Likewise.
2625 * vms-alpha.c: Likewise.
2626 * xcofflink.c: Likewise.
2627
2628 2017-04-13 Alan Modra <amodra@gmail.com>
2629
2630 * bfd.c (PRINT_TYPE): Define.
2631 (_doprnt): New function.
2632 (error_handler_internal): Use _doprnt.
2633 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
2634 calls in their natural order, throughout file.
2635 * coff-mcore.c: Likewise.
2636 * coff-ppc.c: Likewise.
2637 * coff-tic80.c: Likewise.
2638 * cofflink.c: Likewise.
2639 * elf-s390-common.c: Likewise.
2640 * elf.c: Likewise.
2641 * elf32-arm.c: Likewise.
2642 * elf32-i386.c: Likewise.
2643 * elf32-m32r.c: Likewise.
2644 * elf32-msp430.c: Likewise.
2645 * elf32-spu.c: Likewise.
2646 * elf64-ia64-vms.c: Likewise.
2647 * elf64-sparc.c: Likewise.
2648 * elf64-x86-64.c: Likewise.
2649 * elflink.c: Likewise.
2650 * elfnn-aarch64.c: Likewise.
2651 * elfnn-ia64.c: Likewise.
2652 * elfxx-mips.c: Likewise.
2653
2654 2017-04-13 Alan Modra <amodra@gmail.com>
2655
2656 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
2657 branch veneers" error. Fix double space and format message.
2658 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
2659 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2660
2661 2017-04-13 Alan Modra <amodra@gmail.com>
2662
2663 * bfd-in2.h: Regenerate.
2664
2665 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2666
2667 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2668 extra `\n' in warning/error messages.
2669 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2670 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2671
2672 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2673
2674 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2675 processor-specific properties with generic ELF target vector.
2676
2677 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
2678
2679 * elf32-sparc.c (elf_backend_fixup_symbol): New.
2680 * elf64-sparc.c (elf_backend_fixup_symbol): New.
2681 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2682 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2683 has_non_got_reloc.
2684 (link_hash_newfunc): Initialize has_got_reloc and
2685 has_non_got_reloc.
2686 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2687 section.
2688 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2689 has_non_got_reloc.
2690 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2691 has_non_got_reloc.
2692 (_bfd_sparc_elf_fixup_symbol): New function.
2693 (allocate_dynrelocs): Don't allocate space for dynamic
2694 relocations and discard relocations against resolved undefined
2695 weak symbols in executable. Don't make resolved undefined weak
2696 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
2697 relocation against undefined weak symbols in PIE.
2698 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2699 relocations against resolved undefined weak symbols in PIE
2700 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2701 without ynamic PLT/GOT relocations for resolved undefined weak
2702 symbols.
2703 Don't generate dynamic relocation against resolved undefined
2704 weak symbol in executable.
2705 (pie_finish_undefweak_symbol): New function.
2706 (_bfd_sparc_elf_finish_dynamic_sections): Call
2707 pie_finish_undefweak_symbol on all symbols in PIE.
2708 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2709 (_bfd_sparc_elf_fixup_symbol): New function.
2710
2711 2017-04-10 Nick Clifton <nickc@redhat.com>
2712
2713 * config.bfd: Remove ns32k from obsolete list.
2714
2715 2017-04-10 Alan Modra <amodra@gmail.com>
2716
2717 PR 21287
2718 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2719 (special_sections_i): Likewise for .init_array.
2720 (special_sections_p): Likewise for .preinit_array.
2721
2722 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
2723
2724 PR ld/19579
2725 PR ld/21306
2726 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2727 ELF_COMMON_DEF_P for common symbols.
2728 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2729 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2730 * elflink.c (_bfd_elf_merge_symbol): Revert commits
2731 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2732 07492f668d2173da7a2bda3707ff0985e0f460b6.
2733
2734 2017-04-07 Pedro Alves <palves@redhat.com>
2735
2736 * opncls.c (bfd_get_debug_link_info): Rename to...
2737 (bfd_get_debug_link_info_1): ... this. Change type of second
2738 parameter to void pointer. Adjust.
2739 (bfd_get_debug_link_info): Reimplement on top of
2740 bfd_get_debug_link_info_1.
2741 (separate_debug_file_exists, separate_alt_debug_file_exists):
2742 Change type of second parameter to void pointer. Adjust.
2743 (get_func_type, check_func_type): Change type of second parameter
2744 to void pointer.
2745 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
2746 the callback functions instead of passing the address of a local.
2747 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2748 find_separate_debug_file.
2749 (get_alt_debug_link_info_shim): Change type of second parameter to
2750 void pointer. Adjust.
2751 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2752 find_separate_debug_file.
2753 (get_build_id_name, bfd_boolean check_build_id_file): Change type
2754 of second parameter to void pointer. Adjust.
2755 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2756 pointer local to find_separate_debug_file.
2757
2758 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
2759
2760 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2761 external symbols with a definition.
2762 (_bfd_coff_gc_mark_extra_sections): Fix typo.
2763
2764 2017-04-07 Alan Modra <amodra@gmail.com>
2765
2766 * po/SRC-POTFILES.in: Regenerate.
2767
2768 2017-04-05 Alan Modra <amodra@gmail.com>
2769
2770 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2771 reference counting.
2772
2773 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
2774
2775 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2776 numbers for DataDirectory entry indicies passed to
2777 add_data_entry().
2778
2779 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
2780
2781 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2782 each GNU_MBIND section and align GNU_MBIND section to page size.
2783 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2784 segment for each GNU_MBIND section.
2785 (_bfd_elf_init_private_section_data): Copy sh_info from input
2786 for GNU_MBIND section.
2787
2788 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2789
2790 * elfnn-riscv.c (GP_NAME): Delete.
2791 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2792 (_bfd_riscv_relax_lui): Likewise.
2793
2794 2017-04-04 Nick Clifton <nickc@redhat.com>
2795
2796 PR binutils/21342
2797 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2798 dereference.
2799 (bfd_elf_final_link): Only initialize the extended symbol index
2800 section if there are extended symbol tables to list.
2801
2802 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2803
2804 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2805 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2806 * configure.ac (elf): Add elf-properties.lo.
2807 * Makefile.in: Regenerated.
2808 * configure: Likewise.
2809 * elf-bfd.h (elf_property_kind): New.
2810 (elf_property): Likewise.
2811 (elf_property_list): Likewise.
2812 (elf_properties): Likewise.
2813 (_bfd_elf_parse_gnu_properties): Likewise.
2814 (_bfd_elf_get_property): Likewise.
2815 (_bfd_elf_link_setup_gnu_properties): Likewise.
2816 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2817 and setup_gnu_properties.
2818 (elf_obj_tdata): Add properties.
2819 * elf-properties.c: New file.
2820 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2821 (elf_i386_merge_gnu_properties): Likewise.
2822 (elf_backend_parse_gnu_properties): Likewise.
2823 (elf_backend_merge_gnu_properties): Likewise.
2824 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2825 (elf_x86_64_merge_gnu_properties): Likewise.
2826 (elf_backend_parse_gnu_properties): Likewise.
2827 (elf_backend_merge_gnu_properties): Likewise.
2828 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2829 (elf_backend_parse_gnu_properties): Likewise.
2830 (elf_backend_setup_gnu_properties): Likewise.
2831 (elfNN_bed): Add elf_backend_parse_gnu_properties,
2832 elf_backend_merge_gnu_properties and
2833 elf_backend_setup_gnu_properties.
2834
2835 2017-03-30 Pip Cet <pipcet@gmail.com>
2836
2837 * elf32-wasm32.c: Add relocation code, two relocs.
2838 * reloc.c: Add wasm32 relocations.
2839 * libbfd.h: Regenerate.
2840 * bfd-in2.h: Regenerate.
2841 * bfd/po/bfd.pot: Regenerate.
2842
2843 2017-03-29 Nick Clifton <nickc@redhat.com>
2844
2845 PR binutils/18025
2846 * coff-bfd.h (struct coff_section_data): Add new fields:
2847 saved_bias and bias.
2848 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2849 computed for PE binaries.
2850 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2851 missing abbrev.
2852
2853 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
2854
2855 PR ld/16044
2856 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2857 to handle a local symbol with a hash-symbol-entry; without PLT.
2858 Add BFD_ASSERT for an incidental case with GOT entry present.
2859 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2860 isn't forced-or-set local.
2861
2862 2017-03-27 Pip Cet <pipcet@gmail.com>
2863
2864 * wasm-module.c: New file to support WebAssembly modules.
2865 * wasm-module.h: New file to support WebAssembly modules.
2866 * doc/webassembly.texi: Start documenting wasm-module.c.
2867 * config.bfd: Add wasm_vec.
2868 * targets.c: Likewise.
2869 * configure.ac: Likewise.
2870 * Makefile.am: Add entries for wasm-module.c.
2871 * Makefile.in: Regenerate.
2872 * configure: Regenerate.
2873 * po/SRC-POTFILES.in: Regenerate.
2874
2875 2017-03-27 Pip Cet <pipcet@gmail.com>
2876
2877 * cpu-wasm32.c: New file to support wasm32 architecture.
2878 * elf32-wasm32.c: New file to support wasm32 architecture.
2879 * Makefile.am: Add wasm32 architecture.
2880 * archures.c: Likewise.
2881 * config.bfd: Likewise.
2882 * configure.ac: Likewise.
2883 * targets.c: Likewise.
2884 * Makefile.in: Regenerate.
2885 * bfd-in2.h: Regenerate.
2886 * configure: Regenerate.
2887 * po/SRC-POTFILES.in: Regenerate.
2888
2889 2017-03-20 Alan Modra <amodra@gmail.com>
2890
2891 PR 21266
2892 * elf64-ppc.c (compare_symbols): Stabilize sort.
2893
2894 2017-03-18 Alan Modra <amodra@gmail.com>
2895
2896 * elf64-ppc.c (struct ppc_link_hash_table): Add
2897 local_ifunc_resolver and maybe_local_ifunc_resolver.
2898 (ppc_build_one_stub): Set flags on emitting dynamic
2899 relocation to ifunc.
2900 (ppc64_elf_relocate_section): Likewise.
2901 (ppc64_elf_finish_dynamic_symbol): Likewise.
2902 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2903 local dynamic relocs to ifuncs.
2904 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2905 local_ifunc_resolver and maybe_local_ifunc_resolver.
2906 (ppc_elf_relocate_section): Set flag on emitting dynamic
2907 relocation to ifuncs.
2908 (ppc_elf_finish_dynamic_symbol): Likewise.
2909 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2910 dynamic relocs to ifuncs.
2911
2912 2017-03-13 Nick Clifton <nickc@redhat.com>
2913
2914 PR binutils/21202
2915 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2916 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2917 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2918 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2919 * bfd-in2.h: Regenerate.
2920 * libbfd.h: Regenerate.
2921 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2922 names.
2923 (IS_AARCH64_TLSDESC_RELOC): Likewise.
2924 (elfNN_aarch64_howto_table): Likewise.
2925 (aarch64_tls_transition_without_check): Likewise.
2926 (aarch64_reloc_got_type): Likewise.
2927 (elfNN_aarch64_final_link_relocate): Likewise.
2928 (elfNN_aarch64_tls_relax): Likewise.
2929 (elfNN_aarch64_relocate_section): Likewise.
2930 (elfNN_aarch64_gc_sweep_hook): Likewise.
2931 (elfNN_aarch64_check_relocs): Likewise.
2932 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2933 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2934
2935 2017-03-11 Alan Modra <amodra@gmail.com>
2936
2937 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2938 parameter is in fact used. Whitespace fixes.
2939 * elf64-ppc.c: Likewise.
2940
2941 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
2942
2943 * rs6000-core.c (CORE_NEW): Simplify macro when
2944 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2945
2946 2017-03-07 Alan Modra <amodra@gmail.com>
2947
2948 PR 21224
2949 PR 20519
2950 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2951 dyn_relocs check.
2952
2953 2017-03-05 Alan Modra <amodra@gmail.com>
2954
2955 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2956 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2957 (next_cie_fde_offset): New function.
2958 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2959 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2960 four bytes. Align CIEs to four or eight bytes depending on
2961 per_encoding_aligned8. Align FDEs according to their encoding.
2962 Pad last FDE to output section alignment.
2963 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
2964 assertion.
2965 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2966 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2967 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2968
2969 2017-03-02 Martin Bickel <binutils@ineranves.de>
2970
2971 PR ld/21212
2972 * elf.c (rewrite_elf_program_header): Do not issue a warning for
2973 empty segments which have a zero filesz, but a non-zero memsz.
2974
2975 2017-03-02 Alan Modra <amodra@gmail.com>
2976
2977 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2978
2979 2017-02-28 Alan Modra <amodra@gmail.com>
2980
2981 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2982 (ppc64_elf_relocate_section): Likewise.
2983
2984 2017-02-28 Alan Modra <amodra@gmail.com>
2985
2986 PR 20995
2987 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2988 rather than elf32_nios2_hash_table or elf_hash_table.
2989 (create_got_section): Likewise.
2990 (nios2_elf32_finish_dynamic_symbol): Likewise.
2991 (nios2_elf32_adjust_dynamic_symbol): Likewise.
2992 (nios2_elf32_size_dynamic_sections): Likewise.
2993 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
2994 vars. Use htab equivalents directly instead. Don't create
2995 all dynamic sections on needing just the GOT. Use a goto
2996 rather than a fall-through with reloc test. Ensure
2997 htab->dynobj is set when making dynamic sreloc section.
2998 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
2999 equivalent directly instead. Don't segfault on looking for
3000 .dynamic when dynamic sections have not been created. Don't
3001 segfault on .got.plt being discarded.
3002 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3003 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3004 fixme and another not so relevant comment.
3005 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3006 already set, set hash table dynobj on creating .sbss.
3007
3008 2017-02-28 Alan Modra <amodra@gmail.com>
3009
3010 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3011 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3012 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3013 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3014 (ppc64_elf_relocate_section): Likewise.
3015 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3016 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3017 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3018 * libbfd.h: Regenerate.
3019 * bfd-in2.h: Regenerate.
3020
3021 2017-02-28 Alan Modra <amodra@gmail.com>
3022
3023 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3024 dynamic .data.rel.ro read-only.
3025 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3026 rather than section flags when deciding where copy reloc goes.
3027 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3028 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3029 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3030 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3031 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3032 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3033 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3034 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3035 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3036 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3037 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3038 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3039 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3040 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3041 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3042 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3043 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3044 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3045 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3046
3047 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3048
3049 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3050 `jalr $0, $25' instruction encoding.
3051
3052 2017-02-27 Nick Clifton <nickc@redhat.com>
3053
3054 PR ld/21180
3055 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3056 generating a seg-fault when encountering a symbol that has been
3057 deleted by garbage collection.
3058
3059 2017-02-25 Alan Modra <amodra@gmail.com>
3060
3061 * elf32-arc.c (struct dynamic_sections): Delete.
3062 (enum dyn_section_types): Delete.
3063 (dyn_section_names): Delete.
3064 (arc_create_dynamic_sections): Delete.
3065 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3066 segfault on discarded .rela.plt section.
3067 (elf_arc_size_dynamic_sections): Formatting. Don't call
3068 arc_create_dynamic_sections. Don't allocate memory for sections
3069 handled by the generic linker. Correct code finding relocs in
3070 read-only sections. Set SEC_EXCLUDE on zero size .got,
3071 .got.plt, and .dynbss sections. Do set .interp for pies.
3072
3073 2017-02-24 Andrew Waterman <andrew@sifive.com>
3074
3075 * elfnn-riscv.c (GP_NAME): New macro.
3076 (riscv_global_pointer_value): Use it.
3077 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3078 output section, consider only that section's alignment.
3079
3080 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3081
3082 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3083 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3084 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3085 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3086
3087 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3088
3089 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3090 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3091 or misaligned.
3092
3093 2017-02-23 Alan Modra <amodra@gmail.com>
3094
3095 PR 20744
3096 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3097 16D relocations.
3098 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3099 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3100 relocs.
3101
3102 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3103
3104 PR ld/20828
3105 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3106 processing ahead of the call to `elf_gc_sweep_symbol'.
3107
3108 2017-02-22 Nick Clifton <nickc@redhat.com>
3109
3110 PR binutils/21193
3111 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3112 created section 4-byte alignment.
3113
3114 2017-02-22 Alan Modra <amodra@gmail.com>
3115
3116 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3117 on .got or .plt output section being discarded by script.
3118 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3119 vxworks splt temp.
3120
3121 2017-02-21 Alan Modra <amodra@gmail.com>
3122
3123 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3124 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3125
3126 2017-02-20 Alan Modra <amodra@gmail.com>
3127
3128 PR 21181
3129 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3130 if DT_RELSZ/DT_RELASZ is zero.
3131
3132 2017-02-17 Nick Clifton <nickc@redhat.com>
3133
3134 * compress.c (bfd_get_full_section_contents): Remember to reduce
3135 compressed size by the sizeof the compression header when
3136 decompressing the contents.
3137
3138 2017-02-17 Pedro Alves <palves@redhat.com>
3139
3140 * srec.c (Chunk): Rename to ...
3141 (_bfd_srec_len): ... this.
3142 (S3Forced): Rename to ...
3143 (_bfd_srec_forceS3): ... this.
3144 * objcopy.c: Adjust all references.
3145
3146 2017-02-17 Pedro Alves <palves@redhat.com>
3147
3148 * archive.c (bsd_write_armap): Rename to ...
3149 (_bfd_bsd_write_armap): ... this.
3150 (coff_write_armap): Rename to ...
3151 (_bfd_coff_write_armap): ... this.
3152 * libbfd-in.h (bsd_write_armap): Rename to ...
3153 (_bfd_bsd_write_armap): ... this.
3154 (coff_write_armap): Rename to ...
3155 (_bfd_coff_write_armap): ... this.
3156 * aout-target.h, aout-tic30.c: Adjust all users.
3157 * libbfd.h: Regenerate.
3158
3159 2017-02-17 Pedro Alves <palves@redhat.com>
3160
3161 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3162 (warn_deprecated): Rename to ...
3163 (_bfd_warn_deprecated): ... this.
3164 * libbfd.c (warn_deprecated): Rename to ...
3165 (_bfd_warn_deprecated): ... this.
3166 * bfd-in2.h: Regenerate.
3167
3168 2017-02-17 Pedro Alves <palves@redhat.com>
3169
3170 * bfdio.c (real_ftell): Rename to ...
3171 (_bfd_real_ftell): ... this.
3172 (real_fseek): Rename to ...
3173 (_bfd_real_fseek): ... this.
3174 (real_fopen): Rename to ...
3175 (_bfd_real_fopen): ... this.
3176 * libbfd-in.h (real_ftell): Rename to ...
3177 (_bfd_real_ftell): ... this.
3178 (real_fseek): Rename to ...
3179 (_bfd_real_fseek): ... this.
3180 (real_fopen): Rename to ...
3181 (_bfd_real_fopen): ... this.
3182 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3183 * libbfd.h: Regenerate.
3184
3185 2017-02-17 Pedro Alves <palves@redhat.com>
3186
3187 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3188 * libbfd.c (read_unsigned_leb128): Rename to ...
3189 (_bfd_read_unsigned_leb128): ... this.
3190 (read_signed_leb128): Rename to ...
3191 (_bfd_read_signed_leb128): ... this.
3192 (safe_read_leb128): Rename to ...
3193 (_bfd_safe_read_leb128): ... this.
3194 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3195 (_bfd_read_unsigned_leb128): ... this.
3196 (read_signed_leb128): Rename to ...
3197 (_bfd_read_signed_leb128): ... this.
3198 (safe_read_leb128): Rename to ...
3199 (_bfd_safe_read_leb128): ... this.
3200 * libbfd.h: Renegerate.
3201
3202 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3203
3204 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3205 before trying to fine matching file and line information.
3206
3207 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3208
3209 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3210 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3211 not match current bfd, then reload debug information. Record bfd
3212 we're loading debug info for in the stash. If we have debug
3213 informatin in the cache then perform section placement before
3214 returning.
3215
3216 2017-02-16 Alan Modra <amodra@gmail.com>
3217
3218 PR 21000
3219 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3220 * elfxx-target.h (elf_backend_no_page_alias): Define.
3221 (elfNN_bed): Init new field.
3222 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3223 ensure PT_LOAD segment starts on a new page.
3224 * elf32-hppa.c (elf_backend_no_page_alias): Define.
3225
3226 2017-02-16 Alan Modra <amodra@gmail.com>
3227
3228 PR 21132
3229 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
3230 if pic.
3231
3232 2017-02-16 Jiong Wang <jiong.wang@arm.com>
3233
3234 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
3235 * bfd-in2.h: Regenerated.
3236
3237 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3238
3239 PR ld/21168
3240 * elf32-i386.c (elf_i386_relocate_section): Allow
3241 "lea foo@GOT, %reg" in PIC.
3242
3243 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3244
3245 PR ld/20244
3246 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
3247 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
3248 error against local IFUNC symbol without a base register for
3249 PIC.
3250
3251 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
3252
3253 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
3254 `%P: %H:' with `info->callbacks->einfo'.
3255 (ppc_elf_relocate_section): Likewise.
3256 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
3257 (ppc64_elf_edit_toc): Likewise.
3258 (ppc64_elf_relocate_section): Likewise.
3259
3260 2017-02-14 Alan Modra <amodra@gmail.com>
3261
3262 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
3263 --gc-keep-exported, and test versioned field of sym rather than
3264 looking for @ in name.
3265
3266 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
3267
3268 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
3269 __global_pointer$.
3270
3271 2017-02-13 Nick Clifton <nickc@redhat.com>
3272
3273 PR binutils/21151
3274 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
3275 unit length field.
3276
3277 2017-02-07 Andrew Waterman <andrew@sifive.com>
3278
3279 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
3280 entry size if PLT header is written.
3281
3282 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
3283
3284 Fix sparc64 dynamic relocation processing to use the dynamic
3285 symbol count.
3286 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
3287 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
3288 should be used.
3289
3290 2017-02-03 Nick Clifton <nickc@redhat.com>
3291
3292 PR 21096
3293 * coffcode.h (coff_write_object_contents): Enlarge size of
3294 s_name_buf in order to avoid compile time warning about possible
3295 integer truncation.
3296 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
3297 32-bits of insn value before printing into buffer.
3298
3299 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3300
3301 * elfxx-mips.c (mips_elf_hash_sort_data): Add
3302 `max_local_dynindx'.
3303 (mips_elf_sort_hash_table): Handle it.
3304 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
3305 symbols bump up `max_local_dynindx' rather than
3306 `max_non_got_dynindx'.
3307
3308 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3309
3310 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
3311 `min_got_dynindx', `max_unref_got_dynindx' and
3312 `max_non_got_dynindx' members to the `bfd_size_type' data type.
3313 (mips_elf_sort_hash_table): Adjust accordingly.
3314
3315 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3316
3317 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
3318 to access the hash table.
3319
3320 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3321
3322 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
3323 non-NULL `htab' to the beginning.
3324
3325 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3326
3327 * elflink.c (elf_gc_sweep): Wrap overlong line.
3328
3329 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
3330
3331 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
3332 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
3333 * elfxx-mips.c (mips_elf_link_hash_table): Add
3334 `ignore_branch_isa' member.
3335 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
3336 in branch relocation calculation as an error if
3337 `ignore_branch_isa' has been set.
3338 (_bfd_mips_elf_insn32): Rename to...
3339 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
3340 parameter to `insn32' and add an `ignore_branch_isa' parameter.
3341 Handle the new parameter.
3342
3343 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
3344
3345 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
3346 local variable dynobj.
3347
3348 PR ld/20995
3349 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
3350 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
3351 executable from read-only sections into sdynrelro.
3352 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
3353 dynamic relocs in sdynrelro.
3354 (elf_backend_want_dynrelro): Define.
3355
3356 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3357
3358 * config.bfd (*-*-rtemsaout*): Mark as removed.
3359
3360 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3361
3362 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
3363 (arm-*-rtems*): Move to (arm*-*-eabi*).
3364 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
3365 (m68-*-rtems*): Move to (m68*-*-elf*).
3366
3367 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3368
3369 * config.bfd (*-*-rtemscoff*): Mark as removed.
3370
3371 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
3372
3373 PR ld/20828
3374 * elflink.c (bfd_elf_record_link_assignment): Revert last
3375 change and don't ever clear `forced_local'. Set `mark'
3376 unconditionally.
3377 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
3378 file.
3379 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
3380 (bfd_elf_size_dynamic_sections): ... here.
3381 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
3382 and set `mark' instead in `__tls_get_addr_opt' processing.
3383 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
3384
3385 2017-01-24 Alan Modra <amodra@gmail.com>
3386
3387 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
3388 where dynamic relocs are preferable. Allow ifunc too.
3389 (ensure_undefweak_dynamic): New function.
3390 (allocate_dynrelocs): Use it here. Move plt handling last and
3391 don't make symbols dynamic, simplifying loop. Only make undef
3392 weak symbols with GOT entries dynamic. Correct condition
3393 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
3394 comments. Remove goto.
3395 (ppc_elf_relocate_section): Correct test for using dynamic
3396 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3397 to suit. Set up explicit tls_index entries and implicit GOT
3398 tls_index entries resolvable at link time for
3399 __tls_get_addr_opt. Simplify test to clear mem for prelink.
3400 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
3401 (ensure_undefweak_dynamic): New function.
3402 (allocate_dynrelocs): Use it here. Only make undef weak symbols
3403 with GOT entries dynamic. Remove unnecessary test of
3404 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
3405 (ppc64_elf_relocate_section): Correct test for using dynamic
3406 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3407 to suit. Set up explicit tls_index entries and implicit GOT
3408 tls_index entries resolvable at link time for __tls_get_addr_opt.
3409 Simplify expression to clear mem for prelink.
3410
3411 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
3412
3413 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
3414
3415 2017-01-20 Jiong Wang <jiong.wang@arm.com>
3416
3417 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
3418 (elf_backend_hash_symbol): Define.
3419
3420 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
3421
3422 PR ld/20828
3423 * elflink.c (bfd_elf_record_link_assignment): Clear any
3424 `forced_local' marking for DSO symbols that are not being
3425 provided.
3426
3427 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3428
3429 * elfnn-riscv.c (riscv_elf_object_p): New function.
3430
3431 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
3432
3433 PR ld/21038
3434 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
3435 plt_bnd_eh_frame.
3436 (elf_x86_64_check_relocs): Create .eh_frame section for the
3437 .plt.bnd section.
3438 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3439 .eh_frame section for the .plt.bnd section.
3440 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3441 for the .plt.bnd section.
3442
3443 2017-01-12 Nick Clifton <nickc@redhat.com>
3444
3445 PR binutils/20876
3446 * opncls.c (find_separate_debug_file): Add include_dirs
3447 parameter. Only include the directory part of the bfd's filename
3448 in search paths if include_dirs is true. Add a couple of extra
3449 locations for looking for debug files.
3450 ( bfd_follow_gnu_debuglink): Update invocation of
3451 find_separate_debug_file.
3452 (bfd_follow_gnu_debugaltlink): Likewise.
3453 (get_build_id): New function: Finds the build-id of the given bfd.
3454 (get_build_id_name): New function: Computes the name of the
3455 separate debug info file for a bfd, based upon its build-id.
3456 (check_build_id_file): New function: Checks to see if a separate
3457 debug info file exists at the given location, and that its
3458 build-id matches that of the original bfd.
3459 (bfd_follow_build_id_debuglink): New function: Finds a separate
3460 debug info file for a given bfd by using the build-id method.
3461 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
3462 method of locating a separate debug info file before using the
3463 debuglink method.
3464 * bfd-in2.h: Regenerate.
3465
3466 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
3467
3468 PR ld/21038
3469 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
3470 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
3471 elf_x86_64_eh_frame_plt_got.
3472 (elf_x86_64_size_dynamic_sections): Get unwind info from
3473 elf_x86_64_bnd_arch_bed for the BND PLT.
3474
3475 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
3476
3477 * config.bfd: Add entries for i686-redox and x86_64-redox.
3478
3479 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3480
3481 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
3482 to 4 bytes.
3483 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
3484 .eh_frame section to 4 bytes for x32.
3485 (elf_x86_64_check_relocs): Likewise.
3486
3487 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3488
3489 PR ld/20830
3490 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
3491 (PLT_GOT_FDE_LENGTH): Likewise.
3492 (elf_i386_plt_layout): Add eh_frame_plt_got and
3493 eh_frame_plt_got_size.
3494 (elf_i386_plt): Updated.
3495 (elf_i386_link_hash_table): Add plt_got_eh_frame.
3496 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
3497 (elf_i386_size_dynamic_sections): Allocate and initialize
3498 .eh_frame section for .plt.got.
3499 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
3500 .plt.got.
3501 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
3502 eh_frame_plt_got_size.
3503 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
3504 (PLT_GOT_FDE_LENGTH): Likewise.
3505 (elf_x86_64_backend_data): Add eh_frame_plt_got and
3506 eh_frame_plt_got_size.
3507 (elf_x86_64_arch_bed): Updated.
3508 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
3509 eh_frame_plt_got_size.
3510 (elf_x86_64_nacl_arch_bed): Likewise.
3511 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
3512 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
3513 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3514 .eh_frame section for .plt.got.
3515 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3516 for .plt.got.
3517
3518 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3519
3520 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
3521 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
3522
3523 2017-01-09 Nick Clifton <nickc@redhat.com>
3524
3525 * dwarf2.c (lookup_address_in_function_table): Return early if
3526 there are no functions in the given comp unit, or if the high
3527 address of the last function in the comp unit is less than the
3528 desired address.
3529
3530 2017-01-09 Nick Clifton <nickc@redhat.com>
3531
3532 PR binutils/21013
3533 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
3534 message if there are too many symbols to load.
3535
3536 2017-01-04 James Clarke <jrtc27@jrtc27.com>
3537
3538 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
3539 if relocs are cached.
3540
3541 2017-01-03 Rich Felker <bugdal@aerifal.cx>
3542
3543 PR ld/21017
3544 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
3545 for R_MICROBLAZE_GOTOFF_64.
3546
3547 2017-01-03 Nick Clifton <nickc@redhat.com>
3548
3549 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
3550 warning about using a possibly uninitialised variable.
3551
3552 2017-01-02 Alan Modra <amodra@gmail.com>
3553
3554 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
3555 (allocate_plt_static, allocate_dynrelocs): Use it.
3556
3557 2017-01-02 Alan Modra <amodra@gmail.com>
3558
3559 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
3560 .PARISC.unwind section.
3561
3562 2017-01-02 Alan Modra <amodra@gmail.com>
3563
3564 PR ld/20989
3565 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
3566 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
3567 indirect to GOT pointer relative code edit.
3568
3569 2017-01-02 Alan Modra <amodra@gmail.com>
3570
3571 Update year range in copyright notice of all files.
3572
3573 For older changes see ChangeLog-2016
3574 \f
3575 Copyright (C) 2017 Free Software Foundation, Inc.
3576
3577 Copying and distribution of this file, with or without modification,
3578 are permitted in any medium without royalty provided the copyright
3579 notice and this notice are preserved.
3580
3581 Local Variables:
3582 mode: change-log
3583 left-margin: 8
3584 fill-column: 74
3585 version-control: never
3586 End: