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