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