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