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