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