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