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