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