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