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