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