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