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