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