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