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