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