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