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