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