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