Remove elf_x86_64_next_tls_desc_index/elf_x86_64_srelplt2
[binutils-gdb.git] / bfd / ChangeLog
1 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
4 (elf_x86_64_srelplt2): Likewise.
5
6 2017-08-30 Alan Modra <amodra@gmail.com>
7
8 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
9 (ppc64_elf_tls_optimize): Set it.
10 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
11 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
12 addis would add zero.
13 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
14 (ppc_elf_tls_optimize): Set it.
15 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
16 insn on TPREL16_LO relocs to use r2 when addis would add zero.
17
18 2017-08-30 Alan Modra <amodra@gmail.com>
19
20 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
21 __tls_get_addr call sequences to LE, don't move the addi down
22 to the nop. Replace the bl with addi and leave the nop alone.
23
24 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
25
26 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
27 Re-indent.
28 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
29 Likewise.
30 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
31
32 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
33
34 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
35 (BFD64_BACKENDS): Likewise.
36 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
37 (BFD64_BACKENDS_CFILES): Likewise.
38 * Makefile.in: Regenerated.
39 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
40 elf32-i386.lo and elf64-x86-64.lo.
41 * configure: Regenerated.
42 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
43 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
44 "objalloc.h" and "hashtab.h".
45 (ELIMINATE_COPY_RELOCS): Removed.
46 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
47 (SYMBOL_NO_COPYRELOC): Likewise.
48 (elf_i386_link_hash_entry): Likewise.
49 (GOT_UNKNOWN): Likewise.
50 (GOT_NORMAL): Likewise.
51 (GOT_TLS_GD): Likewise.
52 (elf_i386_hash_entry): Likewise.
53 (elf_i386_obj_tdata): Likewise.
54 (elf_i386_tdata): Likewise.
55 (elf_i386_local_got_tls_type): Likewise.
56 (elf_i386_local_tlsdesc_gotent): Likewise.
57 (elf_i386_hash_table): Likewise.
58 (elf_i386_link_hash_newfunc): Likewise.
59 (elf_i386_local_htab_hash): Likewise.
60 (elf_i386_local_htab_eq): Likewise.
61 (elf_i386_get_local_sym_hash): Likewise.
62 (elf_i386_link_hash_table_free): Likewise.
63 (elf_i386_copy_indirect_symbol): Likewise.
64 (elf_i386_fixup_symbol): Likewise.
65 (elf_i386_readonly_dynrelocs): Likewise.
66 (elf_i386_always_size_sections): Likewise.
67 (elf_i386_set_tls_module_base): Likewise.
68 (elf_i386_dtpoff_base): Likewise.
69 (compare_relocs): Likewise.
70 (elf_i386_hash_symbol): Likewise.
71 (elf_i386_parse_gnu_properties): Likewise.
72 (elf_i386_merge_gnu_properties): Likewise.
73 (elf_i386_link_check_relocs): Likewise.
74 (elf_i386_merge_symbol_attribute): Likewise.
75 (bfd_elf32_bfd_link_check_relocs): Likewise.
76 (elf_backend_copy_indirect_symbol): Likewise.
77 (elf_backend_always_size_sections): Likewise.
78 (elf_backend_omit_section_dynsym): Likewise.
79 (elf_backend_hash_symbol): Likewise.
80 (elf_backend_fixup_symbol): Likewise.
81 (elf_backend_parse_gnu_properties): Likewise.
82 (elf_backend_merge_gnu_properties): Likewise.
83 (elf_backend_merge_symbol_attribute): Likewise.
84 (elf_i386_mkobject): Updated.
85 (elf_i386_link_hash_table_create): Likewise.
86 (elf_i386_check_tls_transition): Likewise.
87 (elf_i386_tls_transition): Likewise.
88 (elf_i386_convert_load_reloc): Likewise.
89 (elf_i386_check_relocs): Likewise.
90 (elf_i386_adjust_dynamic_symbol): Likewise.
91 (elf_i386_allocate_dynrelocs): Likewise.
92 (elf_i386_convert_load): Likewise.
93 (elf_i386_size_dynamic_sections): Likewise.
94 (elf_i386_relocate_section): Likewise.
95 (elf_i386_finish_dynamic_symbol ): Likewise.
96 (elf_i386_finish_dynamic_sections): Likewise.
97 (elf_i386_output_arch_local_syms): Likewise.
98 (elf_i386_get_synthetic_symtab): Likewise.
99 (elf_i386_link_setup_gnu_properties): Likewise.
100 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
101 of elf_link_hash_table, as base.
102 (elf_i386_next_tls_desc_index): New.
103 (elf_i386_srelplt2): Likewise.
104 (elf_i386_plt): Likewise.
105 (elf_i386_lazy_plt): Likewise.
106 (elf_i386_non_lazy_plt): Likewise.
107 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
108 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
109 "objalloc.h" and "hashtab.h".
110 (ELIMINATE_COPY_RELOCS): Removed.
111 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
112 (SYMBOL_NO_COPYRELOC): Likewise.
113 (elf_x86_64_link_hash_entry): Likewise.
114 (GOT_UNKNOWN): Likewise.
115 (GOT_NORMAL): Likewise.
116 (GOT_TLS_GD): Likewise.
117 (elf_x86_64_hash_entry): Likewise.
118 (elf_x86_64_obj_tdata): Likewise.
119 (elf_x86_64_tdata): Likewise.
120 (elf_x86_64_local_got_tls_type): Likewise.
121 (elf_x86_64_local_tlsdesc_gotent): Likewise.
122 (elf_x86_64_hash_table): Likewise.
123 (elf_x86_64_link_hash_newfunc): Likewise.
124 (elf_x86_64_local_htab_hash): Likewise.
125 (elf_x86_64_local_htab_eq): Likewise.
126 (elf_x86_64_get_local_sym_hash): Likewise.
127 (elf_x86_64_link_hash_table_free): Likewise.
128 (elf_x86_64_copy_indirect_symbol): Likewise.
129 (elf_x86_64_fixup_symbol): Likewise.
130 (elf_x86_64_readonly_dynrelocs): Likewise.
131 (elf_x86_64_always_size_sections): Likewise.
132 (elf_x86_64_set_tls_module_base): Likewise.
133 (elf_x86_64_dtpoff_base): Likewise.
134 (compare_relocs): Likewise.
135 (elf_x86_64_merge_symbol_attribute): Likewise.
136 (elf_x86_64_hash_symbol): Likewise.
137 (elf_x86_64_parse_gnu_properties): Likewise.
138 (elf_x86_64_merge_gnu_properties): Likewise.
139 (elf_x86_64_link_check_relocs): Likewise.
140 (elf_backend_copy_indirect_symbol): Likewise.
141 (elf_backend_always_size_sections): Likewise.
142 (bfd_elf64_bfd_link_check_relocs): Likewise.
143 (elf_backend_merge_symbol_attribute): Likewise.
144 (elf_backend_hash_symbol): Likewise.
145 (elf_backend_omit_section_dynsym): Likewise.
146 (elf_backend_fixup_symbol): Likewise.
147 (elf_backend_parse_gnu_properties): Likewise.
148 (elf_backend_merge_gnu_properties): Likewise.
149 (bfd_elf32_bfd_link_check_relocs): Likewise.
150 (elf_x86_64_mkobject): Updated.
151 (elf_x86_64_link_hash_table_create): Likewise.
152 (elf_x86_64_check_tls_transition): Likewise.
153 (elf_x86_64_tls_transition): Likewise.
154 (elf_x86_64_convert_load_reloc): Likewise.
155 (elf_x86_64_check_relocs): Likewise.
156 (elf_x86_64_adjust_dynamic_symbol): Likewise.
157 (elf_x86_64_allocate_dynrelocs): Likewise.
158 (elf_x86_64_convert_load): Likewise.
159 (elf_x86_64_size_dynamic_sections): Likewise.
160 (elf_x86_64_relocate_section): Likewise.
161 (elf_x86_64_finish_dynamic_symbol ): Likewise.
162 (elf_x86_64_finish_dynamic_sections): Likewise.
163 (elf_x86_64_output_arch_local_syms): Likewise.
164 (elf_x86_64_get_synthetic_symtab): Likewise.
165 (elf_x86_64_link_setup_gnu_properties): Likewise.
166 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
167 instead of elf_link_hash_table, as base.
168 (elf_x86_64_next_tls_desc_index): New.
169 (elf_x86_64_srelplt2): Likewise.
170 (elf_x86_64_plt): Likewise.
171 (elf_x86_64_lazy_plt): Likewise.
172 (elf_x86_64_non_lazy_plt): Likewise.
173 * elfxx-x86.c: New file.
174 * elfxx-x86.h: Likewise.
175
176 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
177
178 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
179 return.
180 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
181
182 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
183
184 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
185 sections before checking dynamic relocations and free invalid
186 PLT section contents.
187 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
188
189 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
190
191 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
192 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
193
194 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
195
196 PR binutils/22018
197 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
198 PLT section size.
199 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
200
201 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
202
203 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
204 def_protected.
205 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
206
207 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
208
209 PR ld/21997
210 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
211 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
212 Add a has_no_copy_on_protected bitfield.
213 (elf_has_no_copy_on_protected): New.
214 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
215 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
216 (elf_merge_gnu_property_list): Likewise.
217 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
218 to FALSE for elf_has_no_copy_on_protected.
219 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
220 (elf_i386_link_hash_entry): Add def_protected.
221 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
222 when checking info->nocopyreloc.
223 (elf_i386_link_setup_gnu_properties): Don't set
224 extern_protected_data here.
225 (elf_i386_merge_symbol_attribute): New function.
226 (elf_backend_merge_symbol_attribute): New.
227 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
228 (elf_x86_64_link_hash_entry): Add def_protected.
229 (elf_x86_64_need_pic): Report protected symbol for def_protected.
230 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
231 when checking info->nocopyreloc.
232 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
233 relocation run-time overflow and unresolvable R_X86_64_32S
234 relocation against protected data symbol defined in shared object
235 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
236 (elf_x86_64_link_setup_gnu_properties): Don't set
237 extern_protected_data here.
238 (elf_x86_64_merge_symbol_attribute): New function.
239 (elf_backend_merge_symbol_attribute): New.
240
241 2017-08-26 Alan Modra <amodra@gmail.com>
242
243 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
244 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
245 (ppc_elf_relocate_section): Comment fix.
246 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
247 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
248 Support dynamic relocs for TPREL16 when non-pic too.
249 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
250 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
251 when non-pic too.
252
253 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
254
255 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
256 "symbol" in comments.
257 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
258
259 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
260
261 PR ld/22001
262 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
263 R_X86_64_PC32 relocation run-time overflow and unresolvable
264 R_X86_64_32S relocation with -z nocopyreloc.
265
266 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
267
268 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
269 Undefined symbols may not have a type.
270 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
271
272 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
273
274 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
275 bfd_link_info. Report shared, PIE or PDE object based on
276 bfd_link_info.
277 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
278 (elf_x86_64_relocate_section): Likewise.
279
280 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
281
282 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
283 for function symbols.
284 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
285
286 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
287
288 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
289 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
290 is set on any input relocatable file.
291 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
292
293 2017-08-23 Alan Modra <amodra@gmail.com>
294
295 PR 21988
296 * elf64-ppc.c (ensure_undef_dynamic): Rename from
297 ensure_undefweak_dynamic. Handle undefined too.
298 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
299 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
300 (allocate_dynrelocs): Discard undefined non-default visibility
301 relocs first. Make undefined syms dynamic. Tidy goto.
302
303 2017-08-21 Alan Modra <amodra@gmail.com>
304 H.J. Lu <hongjiu.lu@intel.com>
305
306 PR ld/21964
307 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
308 * elflink.c (bfd_elf_define_start_stop): Rewrite.
309
310 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
311
312 PR ld/20125
313 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
314 undefined weak symbols.
315
316 2017-08-18 Nick Clifton <nickc@redhat.com>
317
318 PR binutils/21962
319 * tekhex.c (getsym): Fix check for source pointer walking off the
320 end of the input buffer.
321
322 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
323
324 PR ld/18808
325 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
326 relocations in debug sections, change abort to _bfd_error_handler.
327
328 2017-08-14 Nick Clifton <nickc@redhat.com>
329
330 PR 21957
331 * elf.c (setup_group): Check for an empty or very small group
332 section.
333 * po/bfd.pot: Regenerate.
334
335 2017-08-14 Alan Modra <amodra@gmail.com>
336
337 PR 21441
338 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
339 alignment padding here.
340 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
341 in a reverse pass over sections.
342
343 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
344
345 PR binutils/21943
346 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
347 for @plt suffixes first.
348 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
349
350 2017-08-08 Nick Clifton <nickc@redhat.com>
351
352 PR 21916
353 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
354 small section lengths.
355 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
356 table.
357 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
358 there is enough data present in the note.
359
360 2017-08-08 Alan Modra <amodra@gmail.com>
361
362 PR 21017
363 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
364 got.refcount for GOTOFF relocs, just create .got section.
365
366 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
367
368 * elflink.c (elf_link_add_object_symbols): Move common symbol
369 check after bed->common_definition.
370
371 2017-08-07 Alan Modra <amodra@gmail.com>
372
373 PR 21910
374 * elflink.c (bfd_elf_final_link): Don't segfault when sections
375 needed to define various dynamic tags have been discarded.
376
377 2017-08-07 Nick Clifton <nickc@redhat.com>
378
379 PR 21884
380 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
381 has not been set then use the bfd returned by
382 _bfd_elf_link_setup_gnu_properties. If that is null then search
383 through all the input bfds selecting the first normal, ELF format
384 one.
385 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
386
387 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
388
389 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
390 to 1 bit.
391 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
392 (elf_i386_check_tls_transition): Check tls_get_addr directly.
393 (elf_i386_convert_load_reloc): Update tls_get_addr check.
394 (elf_i386_link_check_relocs): New function.
395 (bfd_elf32_bfd_link_check_relocs): New.
396 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
397 to 1 bit.
398 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
399 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
400 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
401 (elf_x86_64_link_check_relocs): New function.
402 (bfd_elf64_bfd_link_check_relocs): New.
403 (bfd_elf32_bfd_link_check_relocs): Likewise.
404
405 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
406
407 PR ld/21903:
408 * elflink.c (elf_link_add_object_symbols): Treat common symbol
409 as undefined for --no-define-common.
410
411 2017-08-05 Alan Modra <amodra@gmail.com>
412
413 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
414 hppa_link_hash_table.
415
416 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
417
418 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
419 entries for sysregs with negative indices.
420
421 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
422
423 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
424 isn't the S/390 specific elf data.
425 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
426
427 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
428
429 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
430 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
431 [R_RISCV_ADD16]: Likewise.
432 [R_RISCV_ADD32]: Likewise.
433 [R_RISCV_ADD64]: Likewise.
434 [R_RISCV_SUB6]: Likewise.
435 [R_RISCV_SUB8]: Likewise.
436 [R_RISCV_SUB16]: Likewise.
437 [R_RISCV_SUB32]: Likewise.
438 [R_RISCV_SUB64]: Likewise.
439
440 2017-07-31 Alan Modra <amodra@gmail.com>
441
442 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
443 without ld.so checks.
444
445 2017-07-29 Alan Modra <amodra@gmail.com>
446
447 PR 21847
448 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
449 (ppc64_elf_merge_symbol): Set non_zero_localentry.
450 (is_elfv2_localentry0): Test non_zero_localentry.
451 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
452
453 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
454
455 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
456 pointer check for htab->elf.irelplt.
457 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
458
459 2017-07-27 Nick Clifton <nickc@redhat.com>
460
461 PR 21840
462 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
463 size is -1.
464 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
465 with error return.
466 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
467 are NULL.
468 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
469 of end pointer.
470 (evax_bfd_print_emh): Check for invalid string lengths.
471
472 2017-07-25 Nick Clifton <nickc@redhat.com>
473
474 * po/fr.po: Updated French translation.
475
476 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
477
478 PR 21824
479 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
480 16-bit absolute branches into 10-bit pc-relative branches on the
481 MSP430 as well as the MSP430X.
482
483 2017-07-25 Alan Modra <amodra@gmail.com>
484
485 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
486 (stub_eh_frame_size): New function.
487 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
488 (group_sections): Init group tls_get_addr_opt_bctrl.
489 (ppc64_elf_size_stubs): Update sizing and initialization of
490 .eh_frame. Iteration over stubs via group list.
491 (ppc64_elf_build_stubs): Iterate over stubs via group list.
492 (ppc64_elf_finish_dynamic_sections): Update finalization of
493 .eh_frame.
494
495 2017-07-24 Nick Clifton <nickc@redhat.com>
496
497 PR 21813
498 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
499 of the relocs to the canonicalize_one_reloc routine.
500 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
501 for the _bfd_mach_o_canonicalize_one_reloc field.
502 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
503 res_base parameter. Use to check for corrupt pair relocs.
504 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
505 Likewise.
506 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
507 Likewise.
508 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
509 Likewise.
510
511 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
512 enough data in the record before attempting to parse it.
513 (_bfd_vms_slurp_eeom): Likewise.
514
515 (_bfd_vms_slurp_egsd): Check for an invalid section index.
516 (image_set_ptr): Likewise.
517 (alpha_vms_slurp_relocs): Likewise.
518
519 (alpha_vms_object_p): Check for a truncated record.
520
521 2017-07-24 Nick Clifton <nickc@redhat.com>
522
523 PR 21803
524 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
525 an unrecognized reloc and sets the bfd_error value.
526 * libbfd.h: Regenerate.
527 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
528 function.
529 * elf32-i386.c (elf_i386_relocate_section): Likewise.
530 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
531 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
532 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
533 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
534
535 2017-07-23 Alan Modra <amodra@gmail.com>
536
537 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
538 restore of LR.
539
540 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
541
542 PR ld/18841
543 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
544 reloc_class_ifunc for ifunc symbols.
545
546 2017-07-19 Nick Clifton <nickc@redhat.com>
547
548 PR 21787
549 * archive.c (bfd_generic_archive_p): If the bfd does not have the
550 correct magic bytes at the start, set the error to wrong format
551 and clear the format selector before returning NULL.
552
553 2017-07-19 Nick Clifton <nickc@redhat.com>
554
555 PR 21786
556 * coff-rs6000.c (_bfd_strntol): New function.
557 (_bfd_strntoll): New function.
558 (GET_VALUE_IN_FIELD): New macro.
559 (EQ_VALUE_IN_FIELD): new macro.
560 (_bfd_xcoff_slurp_armap): Use new macros.
561 (_bfd_xcoff_archive_p): Likewise.
562 (_bfd_xcoff_read_ar_hdr): Likewise.
563 (_bfd_xcoff_openr_next_archived_file): Likewise.
564 (_bfd_xcoff_stat_arch_elt): Likewise.
565 * coff64-rs6000.c (_bfd_strntol): New function.
566 (_bfd_strntoll): New function.
567 (GET_VALUE_IN_FIELD): New macro.
568 (xcoff64_slurp_armap): Use new macros.
569
570 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
571 John Eric Martin <John.Martin@emmicro-us.com>
572
573 * bfd-in2.h: Regenerate.
574 * libbfd.h: Regenerate.
575 * elf32-arc.c (JLI): Define.
576 * reloc.c: Add JLI relocations.
577
578 2017-07-18 Nick Clifton <nickc@redhat.com>
579
580 PR 21775
581 * coff-sh.c: Fix spelling typos.
582 * compress.c: Likewise.
583 * cpu-pdp11.c: Likewise.
584 * ecofflink.c: Likewise.
585 * elf-m10300.c: Likewise.
586 * elf.c: Likewise.
587 * elf32-arm.c: Likewise.
588 * elf32-m68k.c: Likewise.
589 * elf32-nds32.c: Likewise.
590 * elf32-ppc.c: Likewise.
591 * elf32-sh.c: Likewise.
592 * elf32-v850.c: Likewise.
593 * elf64-ppc.c: Likewise.
594 * elf64-x86-64.c: Likewise.
595 * elflink.c: Likewise.
596 * elfnn-aarch64.c: Likewise.
597 * elfxx-mips.c: Likewise.
598 * som.c: Likewise.
599 * sunos.c: Likewise.
600 * vms-alpha.c: Likewise.
601 * xcofflink.c: Likewise.
602
603 2017-07-18 Nick Clifton <nickc@redhat.com>
604
605 PR binutils/21781
606 * coffcode.h (handle_COMDAT): Replace abort with an error message
607 and return.
608
609 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
610
611 PR ld/21782
612 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
613 to shared library.
614
615 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
616
617 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
618
619 2017-07-16 Alan Modra <amodra@gmail.com>
620
621 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
622 __tls_index GOT entries when using __tls_get_addr_opt stub.
623 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
624
625 2017-07-12 Alan Modra <amodra@gmail.com>
626
627 * po/es.po: Update from translationproject.org/latest/bfd/.
628 * po/fi.po: Likewise.
629 * po/fr.po: Likewise.
630 * po/id.po: Likewise.
631 * po/ja.po: Likewise.
632 * po/ro.po: Likewise.
633 * po/ru.po: Likewise.
634 * po/sr.po: Likewise.
635 * po/sv.po: Likewise.
636 * po/tr.po: Likewise.
637 * po/uk.po: Likewise.
638 * po/vi.po: Likewise.
639 * po/zh_CN.po: Likewise.
640 * po/hr.po: New file from translationproject.org.
641 * configure.ac (ALL_LINGUAS): Add hr. Sort.
642 * configure: Regenerate.
643
644 2017-07-12 Nick Clifton <nickc@redhat.com>
645
646 Fix compile time warnings using gcc 7.1.1.
647 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
648 plt_name buffer.
649 (elf_xtensa_get_gotplt_section): Increase length of got_name
650 buffer.
651 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
652 default return of FALSE.
653 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
654 default return of FALSE.
655
656 2017-07-12 Alan Modra <amodra@gmail.com>
657
658 * binary.c (binary_set_section_contents): Don't print filepos in
659 error message.
660 (coff_write_object_contents): Cast size_t for error message.
661 (coff_slurp_line_table): Don't use bfd_vma symndx.
662 (coff_slurp_reloc_table): Remove unneeded cast.
663 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
664 error message.
665 (find_abstract_instance_name): Likewise.
666 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
667 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
668 (elf32_arm_check_relocs): Make r_symndx an int.
669 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
670 format string.
671 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
672 message arg.
673 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
674 error message.
675 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
676 * elf32-s390.c (elf_s390_check_relocs): Likewise.
677 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
678 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
679 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
680 * elf64-s390.c (elf_s390_check_relocs): Likewise.
681 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
682 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
683 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
684 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
685 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
686 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
687 and use %lu for error message.
688 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
689 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
690 error message.
691
692 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
693 in error message.
694 (elf32_arm_final_link_relocate): Likewise.
695 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
696 * coffcode.h (styp_to_sec_flags): Likewise.
697 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
698 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
699 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
700 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
701 (elf32_bfin_merge_private_bfd_data): Likewise.
702 * elf32-cris.c (cris_elf_relocate_section): Likewise.
703 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
704 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
705 (i370_elf_relocate_section): Likewise.
706 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
707 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
708 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
709 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
710 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
711 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
712 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
713 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
714 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
715 * ieee.c (ieee_write_id, read_id): Likewise.
716 * mach-o.c (bfd_mach_o_write_contents): Likewise.
717 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
718 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
719 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
720 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
721 * stabs.c (_bfd_link_section_stabs): Likewise.
722
723 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
724 format.
725 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
726 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
727 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
728 * coff-sh.c (sh_relax_section): Likewise.
729 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
730 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
731 * coffcode.h (coff_slurp_reloc_table): Likewise.
732 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
733 (_bfd_coff_read_string_table): Likewise.
734 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
735 * compress.c (bfd_get_full_section_contents): Likewise.
736 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
737 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
738 * elf.c (bfd_elf_string_from_elf_section): Likewise.
739 * elf32-arc.c (arc_special_overflow_checks): Likewise.
740 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
741 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
742 (elf32_arm_write_section): Likewise.
743 * elf32-bfin.c (bfin_relocate_section): Likewise.
744 (bfinfdpic_relocate_section): Likewise.
745 * elf32-hppa.c (hppa_build_one_stub): Likewise.
746 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
747 * elf32-i386.c (elf_i386_tls_transition): Likewise.
748 (elf_i386_relocate_section): Likewise.
749 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
750 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
751 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
752 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
753 * elf32-metag.c (elf_metag_relocate_section): Likewise.
754 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
755 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
756 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
757 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
758 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
759 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
760 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
761 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
762 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
763 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
764 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
765 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
766 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
767 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
768 * elf32-sh.c (sh_elf_relax_section): Likewise.
769 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
770 (sh_elf_relocate_section): Likewise.
771 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
772 * elf32-spu.c (spu_elf_relocate_section): Likewise.
773 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
774 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
775 * elf32-v850.c (v850_elf_relax_section): Likewise.
776 * elf32-vax.c (elf_vax_check_relocs): Likewise.
777 (elf_vax_relocate_section): Likewise.
778 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
779 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
780 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
781 (do_fix_for_relocatable_link): Likewise.
782 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
783 (elf64_alpha_relax_with_lituse): Likewise.
784 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
785 (elf_hppa_final_link_relocate): Likewise.
786 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
787 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
788 (elf64_vms_link_add_object_symbols): Likewise.
789 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
790 (mmix_final_link_relocate): Likewise.
791 * elf64-s390.c (invalid_tls_insn): Likewise.
792 (elf_s390_relocate_section): Likewise.
793 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
794 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
795 (elf_x86_64_relocate_section): Likewise.
796 * elfcode.h (elf_slurp_symbol_table): Likewise.
797 * elfcore.h (elf_core_file_p): Likewise.
798 * elflink.c (elf_link_read_relocs_from_section): Likewise.
799 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
800 (elfNN_aarch64_relocate_section): Likewise.
801 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
802 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
803 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
804 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
805 (_bfd_mips_elf_relocate_section): Likewise.
806 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
807 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
808 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
809 * ieee.c (ieee_slurp_external_symbols): Likewise.
810 * ihex.c (ihex_write_object_content): Likewise.
811 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
812 * merge.c (_bfd_merged_section_offset): Likewise.
813 * mmo.c (mmo_write_loc_chunk): Likewise.
814 (mmo_write_object_contents): Likewise.
815 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
816 * stabs.c (_bfd_link_section_stabs): Likewise.
817 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
818
819 2017-07-11 Alan Modra <amodra@gmail.com>
820
821 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
822
823 2017-07-11 Alan Modra <amodra@gmail.com>
824
825 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
826 instruction" error using _bfd_error_handler, not einfo.
827
828 2017-07-10 Nick Clifton <nickc@redhat.com>
829
830 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
831 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
832
833 2017-07-07 John Baldwin <jhb@FreeBSD.org>
834
835 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
836
837 2017-07-07 Alan Modra <amodra@gmail.com>
838
839 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
840
841 2017-07-07 Alan Modra <amodra@gmail.com>
842
843 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
844 as long long. Move code replacing "ll" with "I64", and simplify.
845
846 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
847
848 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
849 to 1.
850
851 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
852
853 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
854 xtime.
855 (line_info_add_file_name): Likewise.
856 (decode_line_info): Likewise.
857
858 2017-07-04 Tristan Gingold <gingold@adacore.com>
859
860 * version.m4: Bump version to 2.29.51
861 * configure: Regenerate.
862
863 2017-07-04 Jiong Wang <jiong.wang@arm.com>
864
865 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
866 sanity check at the head of this function.
867
868 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
869
870 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
871 dwarf_line_str_size.
872 (struct attr_abbrev): Add field implicit_const.
873 (dwarf_debug_sections): Add .debug_line_str.
874 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
875 (dwarf_debug_section_assert): Add static assertion.
876 (read_indirect_line_string): New.
877 (read_abbrevs): Support DW_FORM_implicit_const.
878 (is_str_attr): Support DW_FORM_line_strp.
879 (read_attribute_value): Support DW_FORM_line_strp and
880 DW_FORM_implicit_const.
881 (read_attribute): Support DW_FORM_implicit_const.
882 (line_info_add_include_dir, line_info_add_include_dir_stub):
883 (line_info_add_file_name, read_formatted_entries): New.
884 (decode_line_info, parse_comp_unit): Support DWARF 5.
885 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
886
887 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
888
889 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
890 abort statement that was put for symbols that are not dynamic.
891
892 2017-07-03 Tristan Gingold <gingold@adacore.com>
893
894 * po/bfd.pot: Regenerate
895
896 2017-07-03 Alan Modra <amodra@gmail.com>
897
898 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
899 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
900 * elf.c (setup_group): Use "Lx" to print sh_size.
901 (_bfd_elf_setup_sections): Remove unnecessary cast and print
902 unknown section type in hex.
903 (copy_special_section_fields): Style fix.
904 (bfd_section_from_shdr): Correct format for sh_link. Use a
905 common error message for all the variants of unrecognized
906 section types.
907 (assign_file_positions_for_load_sections): Use "Lx" for lma
908 adjust error message.
909 (assign_file_positions_for_non_load_sections): Formatting.
910 (rewrite_elf_program_header): Formatting. Use "Lx" for
911 bfd_vma values in error messages.
912 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
913 ELF_R_SYM value to type expected by format.
914 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
915 in error messages.
916 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
917 (elf_link_input_bfd): Use "Lx" for r_info.
918 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
919
920 2017-07-03 Alan Modra <amodra@gmail.com>
921
922 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
923 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
924 Microsoft C library variant of long long format specifier.
925 (PRINT20): Cast value to bfd_uint64_t not long long.
926 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
927 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
928 long long. Don't cast to bfd_vma.
929 * elf32-score.c (score3_bfd_getl48): Likewise.
930 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
931
932 2017-07-03 Alan Modra <amodra@gmail.com>
933
934 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
935 print d_tag.
936 (bfd_elf_print_symbol): Don't cast symbol->flags.
937 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
938 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
939 _bfd_error_handler argument order.
940 (ppc_elf_merge_private_bfd_data): Don't cast flags.
941
942 2017-07-03 Alan Modra <amodra@gmail.com>
943
944 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
945 AC_TYPE_LONG_DOUBLE.
946 * configure: Regenerate.
947 * config.in: Regenerate.
948
949 2017-06-29 Andrew Waterman <andrew@sifive.com>
950
951 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
952 relocs.
953
954 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
955
956 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
957 unless it is undefined weak.
958 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
959 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
960 relocation.
961 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
962 is not dynamic in PIC, abort.
963
964 2017-06-29 Jiong Wang <jiong.wang@arm.com>
965
966 PR ld/21402
967 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
968 undefined weak symbols into dynamic.
969 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
970 relocation for non-dynamic symbols.
971 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
972
973 2017-06-29 Jiong Wang <jiong.wang@arm.com>
974
975 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
976 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
977 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
978 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
979 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
980 support for them.
981
982 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
983
984 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
985 (elfcore_write_s390_gs_bc): Likewise.
986 * elf.c (elfcore_grok_s390_gs_cb): New function.
987 (elfcore_grok_s390_gs_bc): New function.
988 (elfcore_grok_note): Call them.
989 (elfcore_write_s390_gs_cb): New function.
990 (elfcore_write_s390_gs_bc): New function.
991 (elfcore_write_register_note): Call them.
992
993 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
994
995 * libbfd.c (_bfd_generic_get_section_contents): Don't call
996 bfd_get_file_size. Check archive element size.
997 (_bfd_generic_get_section_contents_in_window): Likewise.
998
999 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1000
1001 * bfd-in2.h: Regenerated.
1002 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1003 (bfd_get_file_size): Likewise.
1004
1005 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1006 Matthew Fortune <matthew.fortune@imgtec.com>
1007
1008 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1009 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1010 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1011 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1012 case.
1013 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1014 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1015 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1016 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1017 `bfd_mach_mips_interaptiv_mr2' entries.
1018 * bfd-in2.h: Regenerate.
1019
1020 2017-06-27 Nick Clifton <nickc@redhat.com>
1021
1022 * tekhex.c (pass_over): Revert accidental conversion of a local
1023 array to a static array.
1024
1025 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1026
1027 PR ld/13402
1028 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1029 reloc addend if necessary. Adjust diff only if
1030 shrinked_insn_address < end_address.
1031
1032 2017-06-27 Alan Modra <amodra@gmail.com>
1033
1034 PR binutils/21665
1035 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1036 (_bfd_generic_get_section_contents_in_window): Likewise.
1037
1038 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1039
1040 * elfnn-riscv.c (perform_relocation): Support the new
1041 R_RISCV_32_PCREL relocation.
1042 (riscv_elf_relocate_section): Likewise.
1043 * elfxx-riscv.c (howto_table): Likewise.
1044 (riscv_reloc_map): Likewise.
1045 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1046 * libbfd.h: Regenerate.
1047
1048 2017-06-27 Alan Modra <amodra@gmail.com>
1049
1050 PR binutils/21665
1051 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1052 Use unsigned file pointer type, and remove cast.
1053 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1054 Add "count", not "sz".
1055
1056 2017-06-26 Pedro Alves <palves@redhat.com>
1057
1058 PR binutils/21665
1059 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
1060 "sz".
1061
1062 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1063
1064 PR binutils/21665
1065 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
1066 a missing line.
1067
1068 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
1069
1070 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
1071 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
1072 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
1073 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
1074 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
1075
1076 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1077
1078 PR binutils/21665
1079 * compress.c (bfd_get_full_section_contents): Don't check the
1080 file size here.
1081 * libbfd.c (_bfd_generic_get_section_contents): Check for and
1082 reject a section whose size + offset is greater than the size
1083 of the entire file.
1084 (_bfd_generic_get_section_contents_in_window): Likewise.
1085
1086 2017-06-26 Nick Clifton <nickc@redhat.com>
1087
1088 PR binutils/21670
1089 * tekhex.c (getvalue): Check for the source pointer exceeding the
1090 end pointer before the first byte is read.
1091
1092 2017-06-26 Nick Clifton <nickc@redhat.com>
1093
1094 PR binutils/21665
1095 * opncls.c (get_build_id): Check that the section is big enough
1096 to contain the whole note.
1097 * compress.c (bfd_get_full_section_contents): Check for and reject
1098 a section whose size is greater than the size of the entire file.
1099 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
1100 contain a notes section.
1101
1102 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1103
1104 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
1105 pointer checks.
1106 (elf_s390_modify_segment_map): Likewise.
1107 (bfd_elf_s390_set_options): Lisewise.
1108
1109 2017-06-26 Alan Modra <amodra@gmail.com>
1110
1111 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
1112 a --just-syms bfd.
1113 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
1114 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
1115 .preinit_array on --just-syms bfds.
1116 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
1117 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
1118 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
1119
1120 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
1121
1122 * elf.c (find_link): Bounds check "hint".
1123
1124 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
1125
1126 * elf32-arm.c (using_thumb_only): Update list of architectures in
1127 BFD_ASSERT for which the logic is valid.
1128 (using_thumb2_bl): Likewise.
1129 (using_thumb2): Likewise and return true for ARMv8-R.
1130 (arch_has_arm_nop): Likewise.
1131 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
1132 merging logic. Update commentis for value 15 of v8m_baseline,
1133 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
1134 merging of value 15 of Tag_CPU_arch.
1135
1136 2017-06-23 Jiong Wang <jiong.wang@arm.com>
1137
1138 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
1139 BFD_RELOC_AARCH64_ADR_GOT_PAGE
1140 * bfd-in2.h: Regenerate.
1141
1142 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1143
1144 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
1145 the error_alignment label forward. Properly align program
1146 property note section.
1147
1148 2017-06-22 Eric Christopher <echristo@gmail.com>
1149
1150 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
1151 abs to fix a truncation warning.
1152
1153 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1154
1155 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
1156 local undefined weak symbol to 0.
1157 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
1158
1159 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1160
1161 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
1162 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1163 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
1164 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1165 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
1166 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1167 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
1168 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1169
1170 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
1171
1172 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
1173 (elf_i386_lazy_ibt_plt_entry): Likewise.
1174 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
1175 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
1176 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
1177 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
1178 (elf_i386_lazy_plt_layout): Likewise.
1179 (elf_i386_non_lazy_plt_layout): Likewise.
1180 (elf_i386_link_hash_entry): Add plt_second.
1181 (elf_i386_link_hash_table): Add plt_second and
1182 plt_second_eh_frame.
1183 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
1184 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
1185 the second PLT. Check the second PLT.
1186 (elf_i386_relocate_section): Use the second PLT to resolve
1187 PLT reference if needed.
1188 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
1189 needed.
1190 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
1191 second PLT. Generate unwind info for the second PLT.
1192 (elf_i386_plt_type): Add plt_second.
1193 (elf_i386_get_synthetic_symtab): Support the second PLT.
1194 (elf_i386_parse_gnu_properties): Support
1195 GNU_PROPERTY_X86_FEATURE_1_AND.
1196 (elf_i386_merge_gnu_properties): Support
1197 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1198 on GNU_PROPERTY_X86_FEATURE_1_IBT
1199 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
1200 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1201 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1202 is set on all relocatable inputs.
1203 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
1204 (elf_x32_lazy_ibt_plt_entry): Likewise.
1205 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
1206 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
1207 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
1208 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
1209 (elf_x86_64_lazy_ibt_plt): Likewise.
1210 (elf_x32_lazy_ibt_plt): Likewise.
1211 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1212 (elf_x32_non_lazy_ibt_plt): Likewise.
1213 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
1214 (elf_x86_64_parse_gnu_properties): Support
1215 GNU_PROPERTY_X86_FEATURE_1_AND.
1216 (elf_x86_64_merge_gnu_properties): Support
1217 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
1218 on GNU_PROPERTY_X86_FEATURE_1_IBT
1219 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
1220 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
1221 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1222 is set on all relocatable inputs.
1223
1224 2017-06-22 Nick Clifton <nickc@redhat.com>
1225
1226 PR binutils/21649
1227 * som.c (setup_sections): NUL terminate the space_strings buffer.
1228 Check that the space.name field does not index beyond the end of
1229 the space_strings buffer.
1230
1231 2017-06-21 Nick Clifton <nickc@redhat.com>
1232
1233 PR binutils/21646
1234 * coff-sh.c (sh_reloc): Check for an out of range reloc.
1235
1236 2017-06-21 Nick Clifton <nickc@redhat.com>
1237
1238 PR binutils/21639
1239 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
1240 type of the size parameter.
1241 (_bfd_vms_save_counted_string): Add second parameter - the maximum
1242 length of the counted string.
1243 * vms.h (_bfd_vms_save_sized_string): Update prototype.
1244 (_bfd_vms_save_counted_string): Likewise.
1245 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
1246 _bfd_vms_save_counted_string.
1247 (_bfd_vms_slurp_ehdr): Likewise.
1248 (_bfd_vms_slurp_egsd): Likewise.
1249 (Parse_module): Likewise.
1250
1251 2017-06-21 Alan Modra <amodra@gmail.com>
1252
1253 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
1254 calls before tocsave calls.
1255 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
1256 following nop.
1257
1258 2017-06-21 Nick Clifton <nickc@redhat.com>
1259
1260 PR binutils/21645
1261 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
1262 bfd_get_full_section_contents returns no contents.
1263
1264 2017-06-21 Nick Clifton <nickc@redhat.com>
1265
1266 PR binutils/21638
1267 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
1268 record.
1269
1270 2017-06-21 Nick Clifton <nickc@redhat.com>
1271
1272 PR binutils/21637
1273 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
1274 list.
1275 (image_set_ptr): Likewise.
1276 (alpha_vms_fix_sec_rel): Likewise.
1277 (alpha_vms_slurp_relocs): Likewise.
1278
1279 2017-06-21 Nick Clifton <nickc@redhat.com>
1280
1281 PR binutils/21633
1282 * ieee.c (ieee_slurp_sections): Check for a NULL return from
1283 read_id.
1284 (ieee_archive_p): Likewise.
1285 (ieee_object_p): Likewise.
1286
1287 2017-06-21 Nick Clifton <nickc@redhat.com>
1288
1289 PR binutils/21640
1290 * elf.c (setup_group): Zero the group section pointer list after
1291 allocation so that loops can be caught. Check for NULL pointers
1292 when processing a group list.
1293
1294 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1295
1296 * elf-s390.h: New file.
1297 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
1298 field.
1299 (elf_s390_additional_program_headers): New function.
1300 (elf_s390_modify_segment_map): New function.
1301 (bfd_elf_s390_set_options): New function.
1302 (elf_backend_additional_program_headers)
1303 (elf_backend_modify_segment_map): Add macro definitions.
1304
1305 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
1306
1307 PR ld/21626
1308 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
1309 the DYNAMIC bit instead of bfd_count_sections.
1310
1311 2017-06-19 Nick Clifton <nickc@redhat.com>
1312
1313 PR binutils/21618
1314 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
1315 length.
1316 (evax_bfd_print_eeom): Likewise.
1317 (evax_bfd_print_egsd): Check for an overlarge record length.
1318 (evax_bfd_print_etir): Likewise.
1319
1320 2017-06-19 Nick Clifton <nickc@redhat.com>
1321
1322 PR binutils/21612
1323 * libieee.h (struct common_header_type): Add end_p field.
1324 * ieee.c (this_byte_and_next): Do not advance input_p beyond
1325 end_p.
1326 (read_id): Check for a length that exceeds the remaining bytes in
1327 the input buffer.
1328 (ieee_seek): Initialise end_p.
1329 (ieee_archive_p): Likewise.
1330 (ieee_object_p): Likewise.
1331
1332 2017-06-19 Nick Clifton <nickc@redhat.com>
1333
1334 PR binutils/21611
1335 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
1336 before reading the EIHS structure entries.
1337
1338 2017-06-19 Nick Clifton <nickc@redhat.com>
1339
1340 PR binutils/21615
1341 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
1342 gsd_size. Check that there are enough bytes remaining to read the
1343 type and size of the next egsd. Check that the size of the egsd
1344 does not exceed the size of the record.
1345
1346 2017-06-19 Alan Modra <amodra@gmail.com>
1347
1348 * config.bfd: Correct targ_underscore for cris.
1349
1350 2017-06-18 Alan Modra <amodra@gmail.com>
1351
1352 * config.bfd: Correct targ_underscore for epiphany, ip2k,
1353 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
1354
1355 2017-06-16 Nick Clifton <nickc@redhat.com>
1356
1357 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
1358 bucketlist is empty because there are no symbols to add to the
1359 list.
1360
1361 2017-06-16 Alan Modra <amodra@gmail.com>
1362
1363 PR ld/20022
1364 PR ld/21557
1365 PR ld/21562
1366 PR ld/21571
1367 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
1368 (BFD_JUMP_TABLE_LINK): Likewise.
1369 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
1370 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
1371 (bfd_elf_define_start_stop): New function.
1372 * linker.c (bfd_generic_define_start_stop): New function.
1373 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
1374 new field.
1375 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
1376 * aout-target.h (MY_bfd_define_start_stop): Define.
1377 * aout-tic30.c (MY_bfd_define_start_stop): Define.
1378 * binary.c (binary_bfd_define_start_stop): Define.
1379 * bout.c (b_out_bfd_define_start_stop): Define.
1380 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
1381 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
1382 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
1383 * coffcode.h (coff_bfd_define_start_stop): Define.
1384 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
1385 * i386msdos.c (msdos_bfd_define_start_stop): Define.
1386 * i386os9k.c (os9k_bfd_define_start_stop): Define.
1387 * ieee.c (ieee_bfd_define_start_stop): Define.
1388 * ihex.c (ihex_bfd_define_start_stop): Define.
1389 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
1390 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
1391 * mmo.c (mmo_bfd_define_start_stop): Define.
1392 * nlm-target.h (nlm_bfd_define_start_stop): Define.
1393 * oasys.c (oasys_bfd_define_start_stop): Define.
1394 * pef.c (bfd_pef_bfd_define_start_stop): Define.
1395 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
1396 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
1397 * som.c (som_bfd_define_start_stop): Define.
1398 * srec.c (srec_bfd_define_start_stop): Define.
1399 * tekhex.c (tekhex_bfd_define_start_stop): Define.
1400 * versados.c (versados_bfd_define_start_stop): Define.
1401 * vms-alpha.c (vms_bfd_define_start_stop): Define.
1402 (alpha_vms_bfd_define_start_stop): Define.
1403 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
1404 * bfd-in2.h: Regenerate.
1405 * libbfd.h: Regenerate.
1406
1407 2017-06-16 Jiong Wang <jiong.wang@arm.com>
1408
1409 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
1410 SYMBOL_REFERENCES_LOCAL.
1411
1412 2017-06-15 Jiong Wang <jiong.wang@arm.com>
1413
1414 PR ld/21532
1415 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
1416 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
1417 runtime for if there needs copy relocation elimination.
1418 (need_copy_relocation_p): New function. Return true for symbol with
1419 pc-relative references and if it's against read-only sections.
1420 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
1421 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
1422 that are related with accessing external objects.
1423 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
1424 in elfNN_aarch64_check_relocs.
1425
1426 2017-06-15 Nick Clifton <nickc@redhat.com>
1427
1428 PR binutils/21582
1429 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
1430 bugs.
1431 PR binutils/21581
1432 (ieee_archive_p): Likewise.
1433
1434 2017-06-15 Nick Clifton <nickc@redhat.com>
1435
1436 PR binutils/21579
1437 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
1438
1439 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
1440
1441 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
1442 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
1443 keep both windowed and call0 ABI PLT definitions.
1444 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
1445 elf_xtensa_*_plt_entry endex.
1446 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
1447
1448 2017-06-14 Nick Clifton <nickc@redhat.com>
1449
1450 PR binutils/21578
1451 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
1452 flag value.
1453
1454 2017-06-14 Nick Clifton <nickc@redhat.com>
1455
1456 PR binutils/21589
1457 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
1458 maximum value for the ascic pointer. Check that name processing
1459 does not read beyond this value.
1460 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
1461 end of etir record.
1462
1463 2017-06-14 Nick Clifton <nickc@redhat.com>
1464
1465 PR binutils/21591
1466 * versados.c (versados_mkobject): Zero the allocated tdata structure.
1467 (process_otr): Check for an invalid offset in the otr structure.
1468
1469 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
1470
1471 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
1472
1473 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
1474
1475 PR ld/20022
1476 PR ld/21557
1477 PR ld/21562
1478 PR ld/21571
1479 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
1480 vtable field to a union.
1481 (_bfd_elf_is_start_stop): Removed.
1482 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
1483 __start_SECNAME and __stop_SECNAME symbols.
1484 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1485 * elflink.c (_bfd_elf_is_start_stop): Removed.
1486 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
1487 _bfd_elf_is_start_stop.
1488 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
1489 __stop_SECNAME symbols. Updated.
1490 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1491 (bfd_elf_gc_record_vtinherit): Likewise.
1492 (bfd_elf_gc_record_vtentry): Likewise.
1493
1494 2017-06-13 Nick Clifton <nickc@redhat.com>
1495
1496 PR ld/21524
1497 * elflink.c (elf_link_adjust_relocs): Generate an error when
1498 encountering a reloc against a symbol removed by garbage
1499 collection.
1500
1501 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
1502
1503 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1504 to merge_gnu_properties.
1505 * elf-properties.c (elf_merge_gnu_properties): Add struct
1506 bfd_link_info * and pass it to merge_gnu_properties.
1507 (elf_merge_gnu_property_list): Add struct bfd_link_info *
1508 and pass it to elf_merge_gnu_properties.
1509 (_bfd_elf_link_setup_gnu_properties): Pass info to
1510 elf_merge_gnu_property_list.
1511 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1512 bfd_link_info *.
1513 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1514
1515 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
1516
1517 PR 21564
1518 * binary.c (binary_set_section_contents): Scale lma by octets
1519 per byte to set filepos.
1520
1521 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1522
1523 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1524 dynamic sections.
1525
1526 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1527
1528 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1529 require TEXTREL.
1530
1531 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1532
1533 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1534 patched section contents for TLS IE reloc.
1535 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1536
1537 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1538
1539 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1540 RELOC_FOR_GLOBAL_SYMBOL macro.
1541
1542 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1543
1544 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1545 changes.
1546
1547 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1548
1549 * config/tc-arc.c (md_undefined_symbol): Changed.
1550 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1551
1552 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1553
1554 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1555 symbols.
1556
1557 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1558
1559 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1560 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1561
1562 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
1563
1564 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1565 object is created.
1566
1567 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
1568
1569 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1570 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1571 is non-zero. Add clarifying comments.
1572
1573 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
1574
1575 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1576 name. Use local IFUNC symbol name string to report unsupported
1577 non-PIC call to IFUNC function.
1578 (elf_i386_relocate_section): Dump local IFUNC name with minfo
1579 when generating R_386_IRELATIVE relocation.
1580 (elf_i386_finish_dynamic_symbol): Likewise.
1581 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1582 IFUNC symbol name.
1583 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1584 when generating R_X86_64_IRELATIVE relocation.
1585 (elf_x86_64_finish_dynamic_symbol): Likewise.
1586
1587 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1588
1589 * elf.c (setup_group): Make sure BFD sections are created for all
1590 group sections in the input file when processing SHF_GROUP
1591 sections.
1592 (bfd_section_from_shdr): Avoid duplicating logic already
1593 implemented in `setup_group'.
1594
1595 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
1596
1597 PR binutils/21546
1598 * peXXigen.c (pe_print_idata): Use the address of the first thunk
1599 if the hint address is zero.
1600
1601 2017-06-06 James Clarke <jrtc27@jrtc27.com>
1602
1603 PR ld/19579
1604 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1605 ELF_COMMON_DEF_P for common symbols.
1606
1607 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
1608
1609 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1610 SEC_GROUP sections as SEC_EXCLUDE.
1611 (bfd_elf_set_group_contents): Replace use of abort with an assert.
1612 (assign_section_numbers): Use resolve_section_groups flag instead
1613 of relocatable link type.
1614 (_bfd_elf_init_private_section_data): Use resolve_section_groups
1615 flag instead of checking the final_link flag for part of the
1616 checks in here. Fix white space as a result.
1617 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1618 instead of relocatable link type.
1619 (bfd_elf_final_link): Likewise.
1620
1621 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1622
1623 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1624 variable `bed'.
1625 * elf32-score.c (score_elf_final_link_relocate): Likewise.
1626 (s3_bfd_score_elf_check_relocs): Likewise.
1627 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1628 (score_elf_final_link_relocate): Likewise.
1629 (s7_bfd_score_elf_check_relocs): Likewise.
1630
1631 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
1632
1633 * elflink.c (init_reloc_cookie_rels): Remove unused variable
1634 `bed'.
1635
1636 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
1637
1638 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1639 from `reloc_count' rather than decrementing it.
1640 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1641 `reloc_count' by `int_rels_per_ext_rel'.
1642 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1643 `reloc_count' by `int_rels_per_ext_rel' for last relocation
1644 entry determination.
1645 (s3_bfd_score_elf_check_relocs): Likewise.
1646 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1647 (s7_bfd_score_elf_relocate_section): Likewise.
1648 (s7_bfd_score_elf_check_relocs): Likewise.
1649 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1650 prototype and function.
1651 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1652 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1653 triple rather than once the sum of REL and RELA relocation entry
1654 counts.
1655 (bfd_elf64_get_reloc_upper_bound): Remove macro.
1656 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1657 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1658 storage allocation size determination.
1659 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1660 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
1661 by `int_rels_per_ext_rel' for last relocation entry
1662 determination.
1663 (bfd_elf_final_link): Do not multiply `reloc_count' by
1664 `int_rels_per_ext_rel' for internal relocation storage
1665 allocation size determination.
1666 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1667 `int_rels_per_ext_rel' for last relocation entry determination.
1668 (elf_gc_smash_unused_vtentry_relocs): Likewise.
1669 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1670 (_bfd_mips_elf_relocate_section): Likewise.
1671
1672 2017-06-05 Alan Modra <amodra@gmail.com>
1673
1674 PR 21529
1675 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1676
1677 2017-06-01 John Baldwin <jhb@FreeBSD.org>
1678
1679 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1680 determine structure sizes.
1681 (elfcore_grok_freebsd_prstatus): Likewise.
1682
1683 2017-06-01 Alan Modra <amodra@gmail.com>
1684
1685 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1686 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1687 dynamic objects.
1688 (is_elfv2_localentry0): New function.
1689 (ppc64_elf_tls_setup): Default params->plt_localentry0.
1690 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1691 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1692 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1693 optimized localentry:0 stubs.
1694 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1695 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1696 localentry:0 stubs.
1697 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1698 DT_PPC64_OPT.
1699 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1700
1701 2017-05-30 Casey Smith <clegg89@gmail.com>
1702
1703 PR ld/21523
1704 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1705 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1706
1707 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
1708
1709 * cpu-arc.c (arc_compatible): New function.
1710
1711 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
1712
1713 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1714
1715 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
1716
1717 PR binutils/21519
1718 * bfdio.c (bfd_get_file_size): New function.
1719 * bfd-in2.h: Regenerated.
1720
1721 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
1722
1723 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1724 comments.
1725
1726 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
1727
1728 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1729 dynobj instead of htab->elf.dynobj.
1730
1731 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
1732
1733 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1734 and function.
1735 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1736 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1737 actual number of internal relocations retrieved. Adjust
1738 function description.
1739 (bfd_elf64_canonicalize_reloc): Remove macro.
1740 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1741
1742 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
1743
1744 * archures.c (bfd_mach_sparc_v9m8): Define.
1745 (bfd_mach_sparc_v8plusm8): Likewise.
1746 (bfd_mach_sparc_v9_p): Adjust to M8.
1747 (bfd_mach_sparc_64bit_p): Likewise.
1748 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1749 bfd_mach_sparc_v8plusm8.
1750 * bfd-in2.h: Regenerated.
1751 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1752 sparc:v8plusm8.
1753 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1754 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1755 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1756 SHA3.
1757 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1758 bfd_mach_sparc_v8plusm8.
1759
1760 2017-05-19 Alan Modra <amodra@gmail.com>
1761
1762 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1763 debug and special sections when no non-note alloc sections in an
1764 object are kept.
1765
1766 2017-05-18 Alan Modra <amodra@gmail.com>
1767
1768 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1769 * elf-m10300.c: Likewise.
1770 * elf.c: Likewise.
1771 * elf32-arc.c: Likewise.
1772 * elf32-bfin.c: Likewise.
1773 * elf32-m68k.c: Likewise.
1774 * elf32-nds32.c: Likewise.
1775 * elf32-tilepro.c: Likewise.
1776 * elflink.c: Likewise.
1777 * elfnn-aarch64.c: Likewise.
1778 * elfnn-riscv.c: Likewise.
1779 * elfxx-tilegx.c: Likewise.
1780 * mach-o.c: Likewise.
1781 * peXXigen.c: Likewise.
1782 * vms-alpha.c: Likewise.
1783 * vms-lib.c: Likewise.
1784
1785 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
1786
1787 PR ld/20882
1788 * elflink.c (elf_gc_mark_debug_section): New function.
1789 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1790 referenced by kept debug sections.
1791
1792 2017-05-16 Alan Modra <amodra@gmail.com>
1793
1794 * elf-m10300.c: Rename occurrences of non_ir_ref.
1795 * elf32-arm.c: Likewise.
1796 * elf32-bfin.c: Likewise.
1797 * elf32-cr16.c: Likewise.
1798 * elf32-cris.c: Likewise.
1799 * elf32-d10v.c: Likewise.
1800 * elf32-dlx.c: Likewise.
1801 * elf32-fr30.c: Likewise.
1802 * elf32-frv.c: Likewise.
1803 * elf32-hppa.c: Likewise.
1804 * elf32-i370.c: Likewise.
1805 * elf32-i386.c: Likewise.
1806 * elf32-iq2000.c: Likewise.
1807 * elf32-lm32.c: Likewise.
1808 * elf32-m32c.c: Likewise.
1809 * elf32-m32r.c: Likewise.
1810 * elf32-m68hc1x.c: Likewise.
1811 * elf32-m68k.c: Likewise.
1812 * elf32-mcore.c: Likewise.
1813 * elf32-metag.c: Likewise.
1814 * elf32-microblaze.c: Likewise.
1815 * elf32-moxie.c: Likewise.
1816 * elf32-msp430.c: Likewise.
1817 * elf32-mt.c: Likewise.
1818 * elf32-nios2.c: Likewise.
1819 * elf32-or1k.c: Likewise.
1820 * elf32-ppc.c: Likewise.
1821 * elf32-rl78.c: Likewise.
1822 * elf32-s390.c: Likewise.
1823 * elf32-score.c: Likewise.
1824 * elf32-score7.c: Likewise.
1825 * elf32-sh.c: Likewise.
1826 * elf32-tic6x.c: Likewise.
1827 * elf32-tilepro.c: Likewise.
1828 * elf32-v850.c: Likewise.
1829 * elf32-vax.c: Likewise.
1830 * elf32-xstormy16.c: Likewise.
1831 * elf32-xtensa.c: Likewise.
1832 * elf64-alpha.c: Likewise.
1833 * elf64-hppa.c: Likewise.
1834 * elf64-ia64-vms.c: Likewise.
1835 * elf64-mmix.c: Likewise.
1836 * elf64-ppc.c: Likewise.
1837 * elf64-s390.c: Likewise.
1838 * elf64-sh64.c: Likewise.
1839 * elf64-x86-64.c: Likewise.
1840 * elflink.c: Likewise.
1841 * elfnn-aarch64.c: Likewise.
1842 * elfnn-ia64.c: Likewise.
1843 * elfnn-riscv.c: Likewise.
1844 * elfxx-mips.c: Likewise.
1845 * elfxx-sparc.c: Likewise.
1846 * elfxx-tilegx.c: Likewise.
1847 * linker.c: Likewise.
1848
1849 2017-05-16 Alan Modra <amodra@gmail.com>
1850
1851 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
1852 * elflink.c (elf_link_add_object_symbols): Update to use
1853 non_ir_ref_dynamic.
1854 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
1855 non_ir_ref.
1856 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1857
1858 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
1859
1860 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
1861
1862 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
1863
1864 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
1865 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
1866 properties.
1867 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1868
1869 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1870
1871 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
1872 to plt_second.
1873 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
1874 to plt_second/plt_second_eh_frame.
1875 (elf_x86_64_link_hash_newfunc): Updated.
1876 (elf_x86_64_allocate_dynrelocs): Likewise.
1877 (elf_x86_64_size_dynamic_sections): Likewise.
1878 (elf_x86_64_relocate_section): Likewise.
1879 (elf_x86_64_finish_dynamic_symbol): Likewise.
1880 (elf_x86_64_finish_dynamic_sections): Likewise.
1881 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
1882 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
1883 .plt.sec section.
1884 (elf_backend_setup_gnu_properties): Updated. Create the
1885 .plt.sec section instead of the .plt.sec section.
1886
1887 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1888
1889 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
1890 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
1891 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
1892
1893 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1894
1895 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
1896 (bfd_elf64_set_reloc): Define.
1897 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
1898
1899 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1900
1901 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
1902 (struct bfd_target): New field _bfd_set_reloc.
1903 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
1904 * reloc.c (_bfd_generic_set_reloc): New function.
1905 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
1906 * nlm-target.h (nlm_set_reloc): Likewise.
1907 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
1908 * aout-tic30.c (MY_set_reloc): Likewise.
1909 * aout-target.h (MY_set_reloc): Likewise.
1910 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
1911 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
1912 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
1913 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
1914 * aout-adobe.c (aout_32_set_reloc): Likewise.
1915 * bout.c (b_out_set_reloc): Likewise.
1916 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
1917 * i386os9k.c (aout_32_set_reloc): Likewise.
1918 * ieee.c (ieee_set_reloc): Likewise.
1919 * oasys.c (oasys_set_reloc): Likewise.
1920 * som.c (som_set_reloc): Likewise.
1921 * versados.c (versados_set_reloc): Likewise.
1922 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
1923 _bfd_generic_set_reloc.
1924 (rs6000_xcoff64_aix_vec): LIkewise.
1925 * libbfd.c (_bfd_norelocs_set_reloc): New function.
1926 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
1927 * i386msdos.c (msdos_set_reloc): Define to
1928 _bfd_norelocs_set_reloc.
1929 * elfcode.h (elf_set_reloc): Define.
1930 * bfd-in2.h: Regenerated.
1931
1932 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
1933
1934 PR ld/21481
1935 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
1936 for IFUNC function address.
1937
1938 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
1939
1940 * elf32-arc.c (FEATURE_LIST_NAME): Define.
1941 (CONFLICT_LIST): Likewise.
1942 (opcode/arc-attrs.h): Include.
1943 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
1944 (arc_extract_features): New file.
1945 (arc_stralloc): Likewise.
1946 (arc_elf_merge_attributes): Likewise.
1947 (arc_elf_merge_private_bfd_data): Use object attributes.
1948 (bfd_arc_get_mach_from_attributes): New function.
1949 (arc_elf_object_p): Use object attributes.
1950 (arc_elf_final_write_processing): Likewise.
1951 (elf32_arc_obj_attrs_arg_type): New function.
1952 (elf32_arc_obj_attrs_handle_unknown): Likewise.
1953 (elf32_arc_section_from_shdr): Likewise.
1954 (elf_backend_obj_attrs_vendor): Define.
1955 (elf_backend_obj_attrs_section): Likewise.
1956 (elf_backend_obj_attrs_arg_type): Likewise.
1957 (elf_backend_obj_attrs_section_type): Likewise.
1958 (elf_backend_obj_attrs_handle_unknown): Likewise.
1959 (elf_backend_section_from_shdr): Likewise.
1960
1961 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
1962
1963 PR ld/21458
1964 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
1965 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
1966 and the destination is a Thumb symbol.
1967
1968 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1969
1970 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
1971 initializer to silence GCC 4.2.
1972 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1973
1974 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1975
1976 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
1977 (LAZY_PLT_ENTRY_SIZE): This.
1978 (NON_LAZY_PLT_ENTRY_SIZE): New.
1979 (elf_x86_64_plt0_entry): Renamed to ...
1980 (elf_x86_64_lazy_plt0_entry): This.
1981 (elf_x86_64_plt_entry): Renamed to ...
1982 (elf_x86_64_lazy_plt_entry): This.
1983 (elf_x86_64_bnd_plt0_entry): Renamed to ...
1984 (elf_x86_64_lazy_bnd_plt0_entry): This.
1985 (elf_x86_64_legacy_plt_entry): Removed.
1986 (elf_x86_64_bnd_plt_entry): Renamed to ...
1987 (elf_x86_64_lazy_bnd_plt_entry): This.
1988 (elf_x86_64_legacy_plt2_entry): Renamed to ...
1989 (elf_x86_64_non_lazy_plt_entry): This.
1990 (elf_x86_64_bnd_plt2_entry): Renamed to ...
1991 (elf_x86_64_non_lazy_bnd_plt_entry): This.
1992 (elf_x86_64_eh_frame_plt): Renamed to ...
1993 (elf_x86_64_eh_frame_lazy_plt): This.
1994 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
1995 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
1996 (elf_x86_64_eh_frame_plt_got): Renamed to ...
1997 (elf_x86_64_eh_frame_non_lazy_plt): This.
1998 (elf_x86_64_lazy_plt_layout): New.
1999 (elf_x86_64_non_lazy_plt_layout): Likewise.
2000 (elf_x86_64_plt_layout): Likewise.
2001 (elf_x86_64_backend_data): Remove PLT layout information. Add
2002 os for target system.
2003 (GET_PLT_ENTRY_SIZE): Removed.
2004 (elf_x86_64_lazy_plt): New.
2005 (elf_x86_64_non_lazy_plt): Likewise.
2006 (elf_x86_64_lazy_bnd_plt): Likewise.
2007 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2008 (elf_x86-64_arch_bed): Updated.
2009 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2010 (elf_x86_64_create_dynamic_sections): Removed.
2011 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2012 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2013 (elf_x86-64_adjust_dynamic_symbol): Updated.
2014 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2015 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2016 size for PLT0 if there is no PLT0. Get plt_entry_size from
2017 non_lazy_plt for non-lazy PLT entries.
2018 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2019 from non_lazy_plt for non-lazy PLT entries.
2020 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2021 if there is no PLT0.
2022 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2023 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2024 entries with non-lazy PLT layout. Don't fill the second and third
2025 slots in the PLT entry if there is no PLT0.
2026 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2027 if there is no PLT0. Set sh_entsize on the .plt.got section.
2028 (compare_relocs): New.
2029 (elf_x86_64_plt_type): Likewise.
2030 (elf_x86_64_plt): Likewise.
2031 (elf_x86_64_nacl_plt): New. Forward declaration.
2032 (elf_x86_64_get_plt_sym_val): Removed.
2033 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2034 against all dynamic relocations.
2035 (elf_x86_64_link_setup_gnu_properties): New function.
2036 (elf_backend_create_dynamic_sections): Updated.
2037 (elf_backend_setup_gnu_properties): New.
2038 (elf_x86_64_nacl_plt): New.
2039 (elf_x86_64_nacl_arch_bed): Updated.
2040
2041 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2042
2043 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2044 (LAZY_PLT_ENTRY_SIZE): This.
2045 (NON_LAZY_PLT_ENTRY_SIZE): New.
2046 (elf_i386_plt0_entry): Renamed to ...
2047 (elf_i386_lazy_plt0_entry): This.
2048 (elf_i386_plt_entry): Renamed to ...
2049 (elf_i386_lazy_plt_entry): This.
2050 (elf_i386_pic_plt0_entry): Renamed to ...
2051 (elf_i386_pic_lazy_plt0_entry): This.
2052 (elf_i386_pic_plt_entry): Renamed to ...
2053 (elf_i386_pic_lazy_plt_entry): This.
2054 (elf_i386_got_plt_entry): Renamed to ...
2055 (elf_i386_non_lazy_plt_entry): This.
2056 (elf_i386_pic_got_plt_entry): Renamed to ...
2057 (elf_i386_pic_non_lazy_plt_entry): This.
2058 (elf_i386_eh_frame_plt): Renamed to ...
2059 (elf_i386_eh_frame_lazy_plt): This.
2060 (elf_i386_eh_frame_plt_got): Renamed to ...
2061 (elf_i386_eh_frame_non_lazy_plt): This.
2062 (elf_i386_plt_layout): Renamed to ...
2063 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
2064 eh_frame_plt_got_size.
2065 (elf_i386_non_lazy_plt_layout): New.
2066 (elf_i386_plt_layout): Likewise.
2067 (elf_i386_non_lazy_plt): Likewise.
2068 (GET_PLT_ENTRY_SIZE): Removed.
2069 (elf_i386_plt): Renamed to ...
2070 (elf_i386_lazy_plt): This.
2071 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
2072 (elf_i386_arch_bed): Updated.
2073 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2074 (elf_i386_create_dynamic_sections): Removed.
2075 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
2076 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2077 (elf_i386_adjust_dynamic_symbol): Updated.
2078 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
2079 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2080 size for PLT0 if there is no PLT0.
2081 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
2082 output section is discarded only if GOT isn't empty.
2083 (elf_i386_relocate_section): Updated. Properly get PLT index
2084 if there is no PLT0.
2085 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
2086 second and third slots in the PLT entry if there is no PLT0.
2087 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
2088 if there is no PLT0. Set sh_entsize on the .plt.got section.
2089 (elf_i386_nacl_plt): Forward declaration.
2090 (elf_i386_get_plt_sym_val): Removed.
2091 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
2092 against all dynamic relocations.
2093 (elf_i386_link_setup_gnu_properties): New function.
2094 (elf_backend_create_dynamic_sections): Updated.
2095 (elf_backend_setup_gnu_properties): New.
2096 (elf_i386_nacl_plt): Updated.
2097 (elf_i386_nacl_arch_bed): Likewise.
2098 (elf_i386_vxworks_arch_bed): Likewise.
2099
2100 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
2101
2102 * elflink.c (elf_output_implib): Remove executable flag from import
2103 library bfd.
2104 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
2105 library is a relocatable object file.
2106
2107 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2108
2109 PR ld/21404
2110 * elf32-avr.c (avr_should_move_sym): New function.
2111 (avr_should_reduce_sym_size): Likewise.
2112 (avr_should_increase_sym_size): Likewise.
2113 (elf32_avr_relax_delete_bytes): Adjust symbol values
2114 and sizes by calling new functions.
2115
2116 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
2117
2118 * config.bfd (riscv32-*): Enable rv64.
2119
2120 2017-05-02 Alan Modra <amodra@gmail.com>
2121
2122 PR 21384
2123 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
2124 rather than h->root.type == bfd_link_hash_new.
2125 (bfd_elf_record_link_assignment): Similarly, call
2126 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
2127
2128 2017-04-29 Alan Modra <amodra@gmail.com>
2129
2130 PR 21432
2131 * reloc.c (reloc_offset_in_range): New function.
2132 (bfd_perform_relocation, bfd_install_relocation): Use it.
2133 (_bfd_final_link_relocate): Likewise.
2134
2135 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
2136
2137 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
2138 before using .plt.got.
2139 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2140
2141 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2142
2143 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
2144 instead of "+=" to update 0.
2145
2146 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2147
2148 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
2149 .plt.got section here.
2150 (elf_i386_check_relocs): Don't create the .plt.got section.
2151 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
2152 the .plt.got and .plt.bnd sections here.
2153 (elf_x86_64_check_relocs): Don't create the .plt.got nor
2154 .plt.bnd sections.
2155
2156 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2157
2158 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
2159 has_bnd_reloc.
2160 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
2161 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
2162 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
2163 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
2164 has_bnd_reloc.
2165
2166 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2167
2168 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
2169 to return bfd *.
2170 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
2171 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
2172 the first relocatable ELF input with GNU properties.
2173
2174 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
2175
2176 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
2177 VxWorks for non-PIC.
2178
2179 2017-04-27 Alan Modra <amodra@gmail.com>
2180
2181 * elf-bfd.h (struct elf_backend_data): Make asection param of
2182 elf_backend_eh_frame_address_size const.
2183 (_bfd_elf_eh_frame_address_size): Likewise.
2184 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
2185 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
2186 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
2187 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
2188 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
2189 (next_cie_fde_offset): Constify params.
2190 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2191
2192 2017-04-27 Alan Modra <amodra@gmail.com>
2193
2194 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
2195 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
2196 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
2197 aug_data_len.
2198 (offset_adjust): New function.
2199 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
2200 (adjust_eh_frame_local_symbols): Likewise.
2201 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
2202 after changing anything. Return true if anything changed.
2203 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
2204 _bfd_elf_adjust_eh_frame_global_symbol for globals.
2205
2206 2017-04-27 Alan Modra <amodra@gmail.com>
2207
2208 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
2209 when force_local.
2210
2211 2017-04-27 Alan Modra <amodra@gmail.com>
2212
2213 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2214 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
2215 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
2216 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
2217 for undef and undefweak dyn_relocs.
2218 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2219 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
2220 (allocate_got, allocate_dynrelocs): Likewise.
2221 (ppc64_elf_relocate_section): Likewise.
2222
2223 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
2224
2225 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
2226 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
2227 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
2228 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
2229
2230 2017-04-26 Nick Clifton <nickc@redhat.com>
2231
2232 PR binutils/21434
2233 * reloc.c (bfd_perform_relocation): Check for a negative address
2234 in the reloc.
2235
2236 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2237
2238 PR ld/21334
2239 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
2240 member.
2241 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
2242 (elf_backend_always_renumber_dynsyms): Define.
2243 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
2244 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
2245 * elflink.c (bfd_elf_size_dynamic_sections): Also call
2246 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
2247 it.
2248 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2249
2250 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
2251
2252 * elflink.c (bfd_elf_size_dynamic_sections): Only call
2253 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
2254 sections have been created.
2255
2256 2017-04-26 Nick Clifton <nickc@redhat.com>
2257
2258 PR binutils/21431
2259 * compress.c (bfd_init_section_compress_status): Check the return
2260 value from bfd_malloc.
2261
2262 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2263
2264 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
2265 no_finish_dynamic_symbol.
2266 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
2267 0.
2268 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
2269 weak symbol, don't make it dynamic.
2270 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
2271 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
2272 relocation for GOT reference.
2273 (elf_x86_64_finish_dynamic_symbol): Abort if
2274 no_finish_dynamic_symbol isn't 0.
2275
2276 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2277
2278 PR ld/21402
2279 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
2280 undefined weak symbol, don't make it dynamic.
2281 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
2282 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2283 relocation for R_386_GOT32.
2284
2285 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
2286
2287 PR ld/21425
2288 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
2289
2290 2017-04-23 Alan Modra <amodra@gmail.com>
2291
2292 PR 21414
2293 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
2294 * elf.c (lcomm_sym): New.
2295 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
2296 * bfd-in2.h: Regenerate.
2297
2298 2017-04-23 Alan Modra <amodra@gmail.com>
2299
2300 PR 21412
2301 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
2302 parameters and comment.
2303 (_bfd_elf_get_reloc_section): Delete.
2304 (_bfd_elf_plt_get_reloc_section): Declare.
2305 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
2306 New functions. Don't blindly skip over assumed .rel/.rela prefix.
2307 Extracted from..
2308 (_bfd_elf_get_reloc_section): ..here. Delete.
2309 (assign_section_numbers): Call elf_get_reloc_section.
2310 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
2311 * elfxx-target.h (elf_backend_get_reloc_section): Update.
2312
2313 2017-04-23 Alan Modra <amodra@gmail.com>
2314
2315 PR 21409
2316 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
2317 no symbols.
2318
2319 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2320
2321 PR ld/21402
2322 * elf32-i386.c (elf_i386_link_hash_entry): Add
2323 no_finish_dynamic_symbol.
2324 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
2325 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
2326 symbol, don't make it dynamic in PIE.
2327 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
2328 set no_finish_dynamic_symbol and generate R_386_RELATIVE
2329 relocation for R_386_GOT32
2330 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
2331 isn't 0.
2332
2333 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
2334
2335 PR ld/19617
2336 PR ld/21086
2337 * elflink.c (elf_link_add_object_symbols): Require
2338 --no-dynamic-linker with -E/--dynamic-list when creating
2339 dynamic sections.
2340
2341 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2342
2343 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
2344 if forced local.
2345
2346 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
2347
2348 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
2349 dynamic symbol sorting.
2350
2351 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
2352
2353 PR ld/21382
2354 * elflink.c (elf_link_add_object_symbols): Preserve
2355 dynamic_ref_after_ir_def when restoring the symbol table for
2356 unneeded dynamic object.
2357
2358 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
2359
2360 PR ld/21401
2361 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
2362 on on undefined IFUNC symbol in the second PLT.
2363
2364 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
2365
2366 * peXXigen.c (pe_print_reloc): Correct chunk_end.
2367
2368 2017-04-19 Alan Modra <amodra@gmail.com>
2369
2370 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
2371 or make dynamic for info->dynamic_undefined_weak 0 and 1.
2372 * elf32-ppc.c:Formatting.
2373 (ensure_undefweak_dynamic): Don't make dynamic when
2374 info->dynamic_undefined_weak is zero.
2375 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2376 info->dynamic_undefined_weak. Discard undef dyn_relocs when
2377 not default visibility. Discard undef and undefweak
2378 dyn_relocs earlier.
2379 (ppc_elf_relocate_section): Adjust to suit.
2380 * elf64-ppc.c: Formatting.
2381 (ensure_undefweak_dynamic): Don't make dynamic when
2382 info->dynamic_undefined_weak is zero.
2383 (allocate_dynrelocs): Discard undefweak dyn_relocs for
2384 info->dynamic_undefined_weak. Discard them earlier.
2385
2386 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
2387
2388 PR ld/21389
2389 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
2390 before generating the version definition section.
2391
2392 2017-04-17 Alan Modra <amodra@gmail.com>
2393
2394 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
2395 state when a regular object file defines a symbol with
2396 incompatible type to that defined by an earlier shared lib.
2397
2398 2017-04-13 Alan Modra <amodra@gmail.com>
2399
2400 * coffcode.h: Wrap some overly long _bfd_error_handler args.
2401 * elf.c: Likewise.
2402 * elf32-arm.c: Likewise.
2403 * elf32-i386.c: Likewise.
2404 * elf32-mep.c: Likewise.
2405 * elf64-ia64-vms.c: Likewise.
2406 * elf64-x86-64.c: Likewise.
2407 * elflink.c: Likewise.
2408 * elfnn-ia64.c: Likewise.
2409 * elfxx-mips.c: Likewise.
2410
2411 2017-04-13 Alan Modra <amodra@gmail.com>
2412
2413 * aoutx.h: Use %B and %A in error messages throughout file.
2414 * aout-cris.c: Likewise.
2415 * archive.c: Likewise.
2416 * binary.c: Likewise.
2417 * coff-rs6000.c: Likewise.
2418 * coff-tic4x.c: Likewise.
2419 * coffcode.h: Likewise.
2420 * coffgen.c: Likewise.
2421 * cofflink.c: Likewise.
2422 * coffswap.h: Likewise.
2423 * cpu-arm.c: Likewise.
2424 * elf-eh-frame.c: Likewise.
2425 * elf-m10300.c: Likewise.
2426 * elf.c: Likewise.
2427 * elf32-arc.c: Likewise.
2428 * elf32-arm.c: Likewise.
2429 * elf32-bfin.c: Likewise.
2430 * elf32-frv.c: Likewise.
2431 * elf32-iq2000.c: Likewise.
2432 * elf32-m32c.c: Likewise.
2433 * elf32-microblaze.c: Likewise.
2434 * elf32-nds32.c: Likewise.
2435 * elf32-rl78.c: Likewise.
2436 * elf32-rx.c: Likewise.
2437 * elf32-score.c: Likewise.
2438 * elf32-score7.c: Likewise.
2439 * elf32-sh64.c: Likewise.
2440 * elf32-v850.c: Likewise.
2441 * elf32-vax.c: Likewise.
2442 * elf32-visium.c: Likewise.
2443 * elf64-ia64-vms.c: Likewise.
2444 * elf64-mmix.c: Likewise.
2445 * elf64-sh64.c: Likewise.
2446 * elfcode.h: Likewise.
2447 * elfnn-aarch64.c: Likewise.
2448 * elfnn-ia64.c: Likewise.
2449 * elfxx-mips.c: Likewise.
2450 * hpux-core.c: Likewise.
2451 * ieee.c: Likewise.
2452 * ihex.c: Likewise.
2453 * linker.c: Likewise.
2454 * merge.c: Likewise.
2455 * mmo.c: Likewise.
2456 * oasys.c: Likewise.
2457 * pdp11.c: Likewise.
2458 * peXXigen.c: Likewise.
2459 * rs6000-core.c: Likewise.
2460 * vms-alpha.c: Likewise.
2461 * xcofflink.c: Likewise.
2462
2463 2017-04-13 Alan Modra <amodra@gmail.com>
2464
2465 * bfd.c (PRINT_TYPE): Define.
2466 (_doprnt): New function.
2467 (error_handler_internal): Use _doprnt.
2468 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
2469 calls in their natural order, throughout file.
2470 * coff-mcore.c: Likewise.
2471 * coff-ppc.c: Likewise.
2472 * coff-tic80.c: Likewise.
2473 * cofflink.c: Likewise.
2474 * elf-s390-common.c: Likewise.
2475 * elf.c: Likewise.
2476 * elf32-arm.c: Likewise.
2477 * elf32-i386.c: Likewise.
2478 * elf32-m32r.c: Likewise.
2479 * elf32-msp430.c: Likewise.
2480 * elf32-spu.c: Likewise.
2481 * elf64-ia64-vms.c: Likewise.
2482 * elf64-sparc.c: Likewise.
2483 * elf64-x86-64.c: Likewise.
2484 * elflink.c: Likewise.
2485 * elfnn-aarch64.c: Likewise.
2486 * elfnn-ia64.c: Likewise.
2487 * elfxx-mips.c: Likewise.
2488
2489 2017-04-13 Alan Modra <amodra@gmail.com>
2490
2491 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
2492 branch veneers" error. Fix double space and format message.
2493 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
2494 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2495
2496 2017-04-13 Alan Modra <amodra@gmail.com>
2497
2498 * bfd-in2.h: Regenerate.
2499
2500 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2501
2502 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2503 extra `\n' in warning/error messages.
2504 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2505 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2506
2507 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
2508
2509 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2510 processor-specific properties with generic ELF target vector.
2511
2512 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
2513
2514 * elf32-sparc.c (elf_backend_fixup_symbol): New.
2515 * elf64-sparc.c (elf_backend_fixup_symbol): New.
2516 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2517 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2518 has_non_got_reloc.
2519 (link_hash_newfunc): Initialize has_got_reloc and
2520 has_non_got_reloc.
2521 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2522 section.
2523 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2524 has_non_got_reloc.
2525 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2526 has_non_got_reloc.
2527 (_bfd_sparc_elf_fixup_symbol): New function.
2528 (allocate_dynrelocs): Don't allocate space for dynamic
2529 relocations and discard relocations against resolved undefined
2530 weak symbols in executable. Don't make resolved undefined weak
2531 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
2532 relocation against undefined weak symbols in PIE.
2533 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2534 relocations against resolved undefined weak symbols in PIE
2535 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2536 without ynamic PLT/GOT relocations for resolved undefined weak
2537 symbols.
2538 Don't generate dynamic relocation against resolved undefined
2539 weak symbol in executable.
2540 (pie_finish_undefweak_symbol): New function.
2541 (_bfd_sparc_elf_finish_dynamic_sections): Call
2542 pie_finish_undefweak_symbol on all symbols in PIE.
2543 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2544 (_bfd_sparc_elf_fixup_symbol): New function.
2545
2546 2017-04-10 Nick Clifton <nickc@redhat.com>
2547
2548 * config.bfd: Remove ns32k from obsolete list.
2549
2550 2017-04-10 Alan Modra <amodra@gmail.com>
2551
2552 PR 21287
2553 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2554 (special_sections_i): Likewise for .init_array.
2555 (special_sections_p): Likewise for .preinit_array.
2556
2557 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
2558
2559 PR ld/19579
2560 PR ld/21306
2561 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2562 ELF_COMMON_DEF_P for common symbols.
2563 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2564 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2565 * elflink.c (_bfd_elf_merge_symbol): Revert commits
2566 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2567 07492f668d2173da7a2bda3707ff0985e0f460b6.
2568
2569 2017-04-07 Pedro Alves <palves@redhat.com>
2570
2571 * opncls.c (bfd_get_debug_link_info): Rename to...
2572 (bfd_get_debug_link_info_1): ... this. Change type of second
2573 parameter to void pointer. Adjust.
2574 (bfd_get_debug_link_info): Reimplement on top of
2575 bfd_get_debug_link_info_1.
2576 (separate_debug_file_exists, separate_alt_debug_file_exists):
2577 Change type of second parameter to void pointer. Adjust.
2578 (get_func_type, check_func_type): Change type of second parameter
2579 to void pointer.
2580 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
2581 the callback functions instead of passing the address of a local.
2582 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2583 find_separate_debug_file.
2584 (get_alt_debug_link_info_shim): Change type of second parameter to
2585 void pointer. Adjust.
2586 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2587 find_separate_debug_file.
2588 (get_build_id_name, bfd_boolean check_build_id_file): Change type
2589 of second parameter to void pointer. Adjust.
2590 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2591 pointer local to find_separate_debug_file.
2592
2593 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
2594
2595 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2596 external symbols with a definition.
2597 (_bfd_coff_gc_mark_extra_sections): Fix typo.
2598
2599 2017-04-07 Alan Modra <amodra@gmail.com>
2600
2601 * po/SRC-POTFILES.in: Regenerate.
2602
2603 2017-04-05 Alan Modra <amodra@gmail.com>
2604
2605 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2606 reference counting.
2607
2608 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
2609
2610 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2611 numbers for DataDirectory entry indicies passed to
2612 add_data_entry().
2613
2614 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
2615
2616 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2617 each GNU_MBIND section and align GNU_MBIND section to page size.
2618 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2619 segment for each GNU_MBIND section.
2620 (_bfd_elf_init_private_section_data): Copy sh_info from input
2621 for GNU_MBIND section.
2622
2623 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
2624
2625 * elfnn-riscv.c (GP_NAME): Delete.
2626 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2627 (_bfd_riscv_relax_lui): Likewise.
2628
2629 2017-04-04 Nick Clifton <nickc@redhat.com>
2630
2631 PR binutils/21342
2632 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2633 dereference.
2634 (bfd_elf_final_link): Only initialize the extended symbol index
2635 section if there are extended symbol tables to list.
2636
2637 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
2638
2639 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2640 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2641 * configure.ac (elf): Add elf-properties.lo.
2642 * Makefile.in: Regenerated.
2643 * configure: Likewise.
2644 * elf-bfd.h (elf_property_kind): New.
2645 (elf_property): Likewise.
2646 (elf_property_list): Likewise.
2647 (elf_properties): Likewise.
2648 (_bfd_elf_parse_gnu_properties): Likewise.
2649 (_bfd_elf_get_property): Likewise.
2650 (_bfd_elf_link_setup_gnu_properties): Likewise.
2651 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2652 and setup_gnu_properties.
2653 (elf_obj_tdata): Add properties.
2654 * elf-properties.c: New file.
2655 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2656 (elf_i386_merge_gnu_properties): Likewise.
2657 (elf_backend_parse_gnu_properties): Likewise.
2658 (elf_backend_merge_gnu_properties): Likewise.
2659 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2660 (elf_x86_64_merge_gnu_properties): Likewise.
2661 (elf_backend_parse_gnu_properties): Likewise.
2662 (elf_backend_merge_gnu_properties): Likewise.
2663 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2664 (elf_backend_parse_gnu_properties): Likewise.
2665 (elf_backend_setup_gnu_properties): Likewise.
2666 (elfNN_bed): Add elf_backend_parse_gnu_properties,
2667 elf_backend_merge_gnu_properties and
2668 elf_backend_setup_gnu_properties.
2669
2670 2017-03-30 Pip Cet <pipcet@gmail.com>
2671
2672 * elf32-wasm32.c: Add relocation code, two relocs.
2673 * reloc.c: Add wasm32 relocations.
2674 * libbfd.h: Regenerate.
2675 * bfd-in2.h: Regenerate.
2676 * bfd/po/bfd.pot: Regenerate.
2677
2678 2017-03-29 Nick Clifton <nickc@redhat.com>
2679
2680 PR binutils/18025
2681 * coff-bfd.h (struct coff_section_data): Add new fields:
2682 saved_bias and bias.
2683 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2684 computed for PE binaries.
2685 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2686 missing abbrev.
2687
2688 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
2689
2690 PR ld/16044
2691 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2692 to handle a local symbol with a hash-symbol-entry; without PLT.
2693 Add BFD_ASSERT for an incidental case with GOT entry present.
2694 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2695 isn't forced-or-set local.
2696
2697 2017-03-27 Pip Cet <pipcet@gmail.com>
2698
2699 * wasm-module.c: New file to support WebAssembly modules.
2700 * wasm-module.h: New file to support WebAssembly modules.
2701 * doc/webassembly.texi: Start documenting wasm-module.c.
2702 * config.bfd: Add wasm_vec.
2703 * targets.c: Likewise.
2704 * configure.ac: Likewise.
2705 * Makefile.am: Add entries for wasm-module.c.
2706 * Makefile.in: Regenerate.
2707 * configure: Regenerate.
2708 * po/SRC-POTFILES.in: Regenerate.
2709
2710 2017-03-27 Pip Cet <pipcet@gmail.com>
2711
2712 * cpu-wasm32.c: New file to support wasm32 architecture.
2713 * elf32-wasm32.c: New file to support wasm32 architecture.
2714 * Makefile.am: Add wasm32 architecture.
2715 * archures.c: Likewise.
2716 * config.bfd: Likewise.
2717 * configure.ac: Likewise.
2718 * targets.c: Likewise.
2719 * Makefile.in: Regenerate.
2720 * bfd-in2.h: Regenerate.
2721 * configure: Regenerate.
2722 * po/SRC-POTFILES.in: Regenerate.
2723
2724 2017-03-20 Alan Modra <amodra@gmail.com>
2725
2726 PR 21266
2727 * elf64-ppc.c (compare_symbols): Stabilize sort.
2728
2729 2017-03-18 Alan Modra <amodra@gmail.com>
2730
2731 * elf64-ppc.c (struct ppc_link_hash_table): Add
2732 local_ifunc_resolver and maybe_local_ifunc_resolver.
2733 (ppc_build_one_stub): Set flags on emitting dynamic
2734 relocation to ifunc.
2735 (ppc64_elf_relocate_section): Likewise.
2736 (ppc64_elf_finish_dynamic_symbol): Likewise.
2737 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2738 local dynamic relocs to ifuncs.
2739 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2740 local_ifunc_resolver and maybe_local_ifunc_resolver.
2741 (ppc_elf_relocate_section): Set flag on emitting dynamic
2742 relocation to ifuncs.
2743 (ppc_elf_finish_dynamic_symbol): Likewise.
2744 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2745 dynamic relocs to ifuncs.
2746
2747 2017-03-13 Nick Clifton <nickc@redhat.com>
2748
2749 PR binutils/21202
2750 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2751 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2752 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2753 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2754 * bfd-in2.h: Regenerate.
2755 * libbfd.h: Regenerate.
2756 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2757 names.
2758 (IS_AARCH64_TLSDESC_RELOC): Likewise.
2759 (elfNN_aarch64_howto_table): Likewise.
2760 (aarch64_tls_transition_without_check): Likewise.
2761 (aarch64_reloc_got_type): Likewise.
2762 (elfNN_aarch64_final_link_relocate): Likewise.
2763 (elfNN_aarch64_tls_relax): Likewise.
2764 (elfNN_aarch64_relocate_section): Likewise.
2765 (elfNN_aarch64_gc_sweep_hook): Likewise.
2766 (elfNN_aarch64_check_relocs): Likewise.
2767 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2768 (_bfd_aarch64_elf_resolve_relocation): Likewise.
2769
2770 2017-03-11 Alan Modra <amodra@gmail.com>
2771
2772 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2773 parameter is in fact used. Whitespace fixes.
2774 * elf64-ppc.c: Likewise.
2775
2776 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
2777
2778 * rs6000-core.c (CORE_NEW): Simplify macro when
2779 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2780
2781 2017-03-07 Alan Modra <amodra@gmail.com>
2782
2783 PR 21224
2784 PR 20519
2785 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2786 dyn_relocs check.
2787
2788 2017-03-05 Alan Modra <amodra@gmail.com>
2789
2790 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2791 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2792 (next_cie_fde_offset): New function.
2793 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2794 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2795 four bytes. Align CIEs to four or eight bytes depending on
2796 per_encoding_aligned8. Align FDEs according to their encoding.
2797 Pad last FDE to output section alignment.
2798 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
2799 assertion.
2800 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2801 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2802 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2803
2804 2017-03-02 Martin Bickel <binutils@ineranves.de>
2805
2806 PR ld/21212
2807 * elf.c (rewrite_elf_program_header): Do not issue a warning for
2808 empty segments which have a zero filesz, but a non-zero memsz.
2809
2810 2017-03-02 Alan Modra <amodra@gmail.com>
2811
2812 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2813
2814 2017-02-28 Alan Modra <amodra@gmail.com>
2815
2816 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2817 (ppc64_elf_relocate_section): Likewise.
2818
2819 2017-02-28 Alan Modra <amodra@gmail.com>
2820
2821 PR 20995
2822 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2823 rather than elf32_nios2_hash_table or elf_hash_table.
2824 (create_got_section): Likewise.
2825 (nios2_elf32_finish_dynamic_symbol): Likewise.
2826 (nios2_elf32_adjust_dynamic_symbol): Likewise.
2827 (nios2_elf32_size_dynamic_sections): Likewise.
2828 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
2829 vars. Use htab equivalents directly instead. Don't create
2830 all dynamic sections on needing just the GOT. Use a goto
2831 rather than a fall-through with reloc test. Ensure
2832 htab->dynobj is set when making dynamic sreloc section.
2833 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
2834 equivalent directly instead. Don't segfault on looking for
2835 .dynamic when dynamic sections have not been created. Don't
2836 segfault on .got.plt being discarded.
2837 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
2838 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
2839 fixme and another not so relevant comment.
2840 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
2841 already set, set hash table dynobj on creating .sbss.
2842
2843 2017-02-28 Alan Modra <amodra@gmail.com>
2844
2845 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
2846 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
2847 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
2848 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
2849 (ppc64_elf_relocate_section): Likewise.
2850 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
2851 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
2852 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
2853 * libbfd.h: Regenerate.
2854 * bfd-in2.h: Regenerate.
2855
2856 2017-02-28 Alan Modra <amodra@gmail.com>
2857
2858 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
2859 dynamic .data.rel.ro read-only.
2860 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
2861 rather than section flags when deciding where copy reloc goes.
2862 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2863 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2864 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2865 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
2866 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
2867 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
2868 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
2869 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
2870 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2871 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
2872 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
2873 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
2874 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2875 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2876 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
2877 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
2878 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2879 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2880 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
2881
2882 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
2883
2884 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
2885 `jalr $0, $25' instruction encoding.
2886
2887 2017-02-27 Nick Clifton <nickc@redhat.com>
2888
2889 PR ld/21180
2890 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
2891 generating a seg-fault when encountering a symbol that has been
2892 deleted by garbage collection.
2893
2894 2017-02-25 Alan Modra <amodra@gmail.com>
2895
2896 * elf32-arc.c (struct dynamic_sections): Delete.
2897 (enum dyn_section_types): Delete.
2898 (dyn_section_names): Delete.
2899 (arc_create_dynamic_sections): Delete.
2900 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
2901 segfault on discarded .rela.plt section.
2902 (elf_arc_size_dynamic_sections): Formatting. Don't call
2903 arc_create_dynamic_sections. Don't allocate memory for sections
2904 handled by the generic linker. Correct code finding relocs in
2905 read-only sections. Set SEC_EXCLUDE on zero size .got,
2906 .got.plt, and .dynbss sections. Do set .interp for pies.
2907
2908 2017-02-24 Andrew Waterman <andrew@sifive.com>
2909
2910 * elfnn-riscv.c (GP_NAME): New macro.
2911 (riscv_global_pointer_value): Use it.
2912 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
2913 output section, consider only that section's alignment.
2914
2915 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2916
2917 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
2918 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
2919 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
2920 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
2921
2922 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2923
2924 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
2925 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
2926 or misaligned.
2927
2928 2017-02-23 Alan Modra <amodra@gmail.com>
2929
2930 PR 20744
2931 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
2932 16D relocations.
2933 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
2934 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
2935 relocs.
2936
2937 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
2938
2939 PR ld/20828
2940 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
2941 processing ahead of the call to `elf_gc_sweep_symbol'.
2942
2943 2017-02-22 Nick Clifton <nickc@redhat.com>
2944
2945 PR binutils/21193
2946 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
2947 created section 4-byte alignment.
2948
2949 2017-02-22 Alan Modra <amodra@gmail.com>
2950
2951 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
2952 on .got or .plt output section being discarded by script.
2953 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
2954 vxworks splt temp.
2955
2956 2017-02-21 Alan Modra <amodra@gmail.com>
2957
2958 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
2959 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
2960
2961 2017-02-20 Alan Modra <amodra@gmail.com>
2962
2963 PR 21181
2964 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
2965 if DT_RELSZ/DT_RELASZ is zero.
2966
2967 2017-02-17 Nick Clifton <nickc@redhat.com>
2968
2969 * compress.c (bfd_get_full_section_contents): Remember to reduce
2970 compressed size by the sizeof the compression header when
2971 decompressing the contents.
2972
2973 2017-02-17 Pedro Alves <palves@redhat.com>
2974
2975 * srec.c (Chunk): Rename to ...
2976 (_bfd_srec_len): ... this.
2977 (S3Forced): Rename to ...
2978 (_bfd_srec_forceS3): ... this.
2979 * objcopy.c: Adjust all references.
2980
2981 2017-02-17 Pedro Alves <palves@redhat.com>
2982
2983 * archive.c (bsd_write_armap): Rename to ...
2984 (_bfd_bsd_write_armap): ... this.
2985 (coff_write_armap): Rename to ...
2986 (_bfd_coff_write_armap): ... this.
2987 * libbfd-in.h (bsd_write_armap): Rename to ...
2988 (_bfd_bsd_write_armap): ... this.
2989 (coff_write_armap): Rename to ...
2990 (_bfd_coff_write_armap): ... this.
2991 * aout-target.h, aout-tic30.c: Adjust all users.
2992 * libbfd.h: Regenerate.
2993
2994 2017-02-17 Pedro Alves <palves@redhat.com>
2995
2996 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
2997 (warn_deprecated): Rename to ...
2998 (_bfd_warn_deprecated): ... this.
2999 * libbfd.c (warn_deprecated): Rename to ...
3000 (_bfd_warn_deprecated): ... this.
3001 * bfd-in2.h: Regenerate.
3002
3003 2017-02-17 Pedro Alves <palves@redhat.com>
3004
3005 * bfdio.c (real_ftell): Rename to ...
3006 (_bfd_real_ftell): ... this.
3007 (real_fseek): Rename to ...
3008 (_bfd_real_fseek): ... this.
3009 (real_fopen): Rename to ...
3010 (_bfd_real_fopen): ... this.
3011 * libbfd-in.h (real_ftell): Rename to ...
3012 (_bfd_real_ftell): ... this.
3013 (real_fseek): Rename to ...
3014 (_bfd_real_fseek): ... this.
3015 (real_fopen): Rename to ...
3016 (_bfd_real_fopen): ... this.
3017 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3018 * libbfd.h: Regenerate.
3019
3020 2017-02-17 Pedro Alves <palves@redhat.com>
3021
3022 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3023 * libbfd.c (read_unsigned_leb128): Rename to ...
3024 (_bfd_read_unsigned_leb128): ... this.
3025 (read_signed_leb128): Rename to ...
3026 (_bfd_read_signed_leb128): ... this.
3027 (safe_read_leb128): Rename to ...
3028 (_bfd_safe_read_leb128): ... this.
3029 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3030 (_bfd_read_unsigned_leb128): ... this.
3031 (read_signed_leb128): Rename to ...
3032 (_bfd_read_signed_leb128): ... this.
3033 (safe_read_leb128): Rename to ...
3034 (_bfd_safe_read_leb128): ... this.
3035 * libbfd.h: Renegerate.
3036
3037 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3038
3039 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3040 before trying to fine matching file and line information.
3041
3042 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3043
3044 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3045 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3046 not match current bfd, then reload debug information. Record bfd
3047 we're loading debug info for in the stash. If we have debug
3048 informatin in the cache then perform section placement before
3049 returning.
3050
3051 2017-02-16 Alan Modra <amodra@gmail.com>
3052
3053 PR 21000
3054 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3055 * elfxx-target.h (elf_backend_no_page_alias): Define.
3056 (elfNN_bed): Init new field.
3057 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3058 ensure PT_LOAD segment starts on a new page.
3059 * elf32-hppa.c (elf_backend_no_page_alias): Define.
3060
3061 2017-02-16 Alan Modra <amodra@gmail.com>
3062
3063 PR 21132
3064 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
3065 if pic.
3066
3067 2017-02-16 Jiong Wang <jiong.wang@arm.com>
3068
3069 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
3070 * bfd-in2.h: Regenerated.
3071
3072 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3073
3074 PR ld/21168
3075 * elf32-i386.c (elf_i386_relocate_section): Allow
3076 "lea foo@GOT, %reg" in PIC.
3077
3078 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3079
3080 PR ld/20244
3081 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
3082 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
3083 error against local IFUNC symbol without a base register for
3084 PIC.
3085
3086 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
3087
3088 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
3089 `%P: %H:' with `info->callbacks->einfo'.
3090 (ppc_elf_relocate_section): Likewise.
3091 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
3092 (ppc64_elf_edit_toc): Likewise.
3093 (ppc64_elf_relocate_section): Likewise.
3094
3095 2017-02-14 Alan Modra <amodra@gmail.com>
3096
3097 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
3098 --gc-keep-exported, and test versioned field of sym rather than
3099 looking for @ in name.
3100
3101 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
3102
3103 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
3104 __global_pointer$.
3105
3106 2017-02-13 Nick Clifton <nickc@redhat.com>
3107
3108 PR binutils/21151
3109 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
3110 unit length field.
3111
3112 2017-02-07 Andrew Waterman <andrew@sifive.com>
3113
3114 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
3115 entry size if PLT header is written.
3116
3117 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
3118
3119 Fix sparc64 dynamic relocation processing to use the dynamic
3120 symbol count.
3121 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
3122 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
3123 should be used.
3124
3125 2017-02-03 Nick Clifton <nickc@redhat.com>
3126
3127 PR 21096
3128 * coffcode.h (coff_write_object_contents): Enlarge size of
3129 s_name_buf in order to avoid compile time warning about possible
3130 integer truncation.
3131 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
3132 32-bits of insn value before printing into buffer.
3133
3134 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3135
3136 * elfxx-mips.c (mips_elf_hash_sort_data): Add
3137 `max_local_dynindx'.
3138 (mips_elf_sort_hash_table): Handle it.
3139 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
3140 symbols bump up `max_local_dynindx' rather than
3141 `max_non_got_dynindx'.
3142
3143 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3144
3145 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
3146 `min_got_dynindx', `max_unref_got_dynindx' and
3147 `max_non_got_dynindx' members to the `bfd_size_type' data type.
3148 (mips_elf_sort_hash_table): Adjust accordingly.
3149
3150 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3151
3152 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
3153 to access the hash table.
3154
3155 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3156
3157 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
3158 non-NULL `htab' to the beginning.
3159
3160 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
3161
3162 * elflink.c (elf_gc_sweep): Wrap overlong line.
3163
3164 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
3165
3166 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
3167 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
3168 * elfxx-mips.c (mips_elf_link_hash_table): Add
3169 `ignore_branch_isa' member.
3170 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
3171 in branch relocation calculation as an error if
3172 `ignore_branch_isa' has been set.
3173 (_bfd_mips_elf_insn32): Rename to...
3174 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
3175 parameter to `insn32' and add an `ignore_branch_isa' parameter.
3176 Handle the new parameter.
3177
3178 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
3179
3180 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
3181 local variable dynobj.
3182
3183 PR ld/20995
3184 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
3185 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
3186 executable from read-only sections into sdynrelro.
3187 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
3188 dynamic relocs in sdynrelro.
3189 (elf_backend_want_dynrelro): Define.
3190
3191 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3192
3193 * config.bfd (*-*-rtemsaout*): Mark as removed.
3194
3195 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3196
3197 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
3198 (arm-*-rtems*): Move to (arm*-*-eabi*).
3199 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
3200 (m68-*-rtems*): Move to (m68*-*-elf*).
3201
3202 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
3203
3204 * config.bfd (*-*-rtemscoff*): Mark as removed.
3205
3206 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
3207
3208 PR ld/20828
3209 * elflink.c (bfd_elf_record_link_assignment): Revert last
3210 change and don't ever clear `forced_local'. Set `mark'
3211 unconditionally.
3212 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
3213 file.
3214 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
3215 (bfd_elf_size_dynamic_sections): ... here.
3216 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
3217 and set `mark' instead in `__tls_get_addr_opt' processing.
3218 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
3219
3220 2017-01-24 Alan Modra <amodra@gmail.com>
3221
3222 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
3223 where dynamic relocs are preferable. Allow ifunc too.
3224 (ensure_undefweak_dynamic): New function.
3225 (allocate_dynrelocs): Use it here. Move plt handling last and
3226 don't make symbols dynamic, simplifying loop. Only make undef
3227 weak symbols with GOT entries dynamic. Correct condition
3228 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
3229 comments. Remove goto.
3230 (ppc_elf_relocate_section): Correct test for using dynamic
3231 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3232 to suit. Set up explicit tls_index entries and implicit GOT
3233 tls_index entries resolvable at link time for
3234 __tls_get_addr_opt. Simplify test to clear mem for prelink.
3235 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
3236 (ensure_undefweak_dynamic): New function.
3237 (allocate_dynrelocs): Use it here. Only make undef weak symbols
3238 with GOT entries dynamic. Remove unnecessary test of
3239 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
3240 (ppc64_elf_relocate_section): Correct test for using dynamic
3241 symbol on GOT relocs. Rearrange test for emitting GOT relocs
3242 to suit. Set up explicit tls_index entries and implicit GOT
3243 tls_index entries resolvable at link time for __tls_get_addr_opt.
3244 Simplify expression to clear mem for prelink.
3245
3246 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
3247
3248 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
3249
3250 2017-01-20 Jiong Wang <jiong.wang@arm.com>
3251
3252 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
3253 (elf_backend_hash_symbol): Define.
3254
3255 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
3256
3257 PR ld/20828
3258 * elflink.c (bfd_elf_record_link_assignment): Clear any
3259 `forced_local' marking for DSO symbols that are not being
3260 provided.
3261
3262 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
3263
3264 * elfnn-riscv.c (riscv_elf_object_p): New function.
3265
3266 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
3267
3268 PR ld/21038
3269 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
3270 plt_bnd_eh_frame.
3271 (elf_x86_64_check_relocs): Create .eh_frame section for the
3272 .plt.bnd section.
3273 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3274 .eh_frame section for the .plt.bnd section.
3275 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3276 for the .plt.bnd section.
3277
3278 2017-01-12 Nick Clifton <nickc@redhat.com>
3279
3280 PR binutils/20876
3281 * opncls.c (find_separate_debug_file): Add include_dirs
3282 parameter. Only include the directory part of the bfd's filename
3283 in search paths if include_dirs is true. Add a couple of extra
3284 locations for looking for debug files.
3285 ( bfd_follow_gnu_debuglink): Update invocation of
3286 find_separate_debug_file.
3287 (bfd_follow_gnu_debugaltlink): Likewise.
3288 (get_build_id): New function: Finds the build-id of the given bfd.
3289 (get_build_id_name): New function: Computes the name of the
3290 separate debug info file for a bfd, based upon its build-id.
3291 (check_build_id_file): New function: Checks to see if a separate
3292 debug info file exists at the given location, and that its
3293 build-id matches that of the original bfd.
3294 (bfd_follow_build_id_debuglink): New function: Finds a separate
3295 debug info file for a given bfd by using the build-id method.
3296 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
3297 method of locating a separate debug info file before using the
3298 debuglink method.
3299 * bfd-in2.h: Regenerate.
3300
3301 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
3302
3303 PR ld/21038
3304 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
3305 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
3306 elf_x86_64_eh_frame_plt_got.
3307 (elf_x86_64_size_dynamic_sections): Get unwind info from
3308 elf_x86_64_bnd_arch_bed for the BND PLT.
3309
3310 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
3311
3312 * config.bfd: Add entries for i686-redox and x86_64-redox.
3313
3314 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3315
3316 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
3317 to 4 bytes.
3318 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
3319 .eh_frame section to 4 bytes for x32.
3320 (elf_x86_64_check_relocs): Likewise.
3321
3322 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3323
3324 PR ld/20830
3325 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
3326 (PLT_GOT_FDE_LENGTH): Likewise.
3327 (elf_i386_plt_layout): Add eh_frame_plt_got and
3328 eh_frame_plt_got_size.
3329 (elf_i386_plt): Updated.
3330 (elf_i386_link_hash_table): Add plt_got_eh_frame.
3331 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
3332 (elf_i386_size_dynamic_sections): Allocate and initialize
3333 .eh_frame section for .plt.got.
3334 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
3335 .plt.got.
3336 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
3337 eh_frame_plt_got_size.
3338 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
3339 (PLT_GOT_FDE_LENGTH): Likewise.
3340 (elf_x86_64_backend_data): Add eh_frame_plt_got and
3341 eh_frame_plt_got_size.
3342 (elf_x86_64_arch_bed): Updated.
3343 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
3344 eh_frame_plt_got_size.
3345 (elf_x86_64_nacl_arch_bed): Likewise.
3346 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
3347 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
3348 (elf_x86_64_size_dynamic_sections): Allocate and initialize
3349 .eh_frame section for .plt.got.
3350 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3351 for .plt.got.
3352
3353 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
3354
3355 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
3356 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
3357
3358 2017-01-09 Nick Clifton <nickc@redhat.com>
3359
3360 * dwarf2.c (lookup_address_in_function_table): Return early if
3361 there are no functions in the given comp unit, or if the high
3362 address of the last function in the comp unit is less than the
3363 desired address.
3364
3365 2017-01-09 Nick Clifton <nickc@redhat.com>
3366
3367 PR binutils/21013
3368 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
3369 message if there are too many symbols to load.
3370
3371 2017-01-04 James Clarke <jrtc27@jrtc27.com>
3372
3373 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
3374 if relocs are cached.
3375
3376 2017-01-03 Rich Felker <bugdal@aerifal.cx>
3377
3378 PR ld/21017
3379 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
3380 for R_MICROBLAZE_GOTOFF_64.
3381
3382 2017-01-03 Nick Clifton <nickc@redhat.com>
3383
3384 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
3385 warning about using a possibly uninitialised variable.
3386
3387 2017-01-02 Alan Modra <amodra@gmail.com>
3388
3389 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
3390 (allocate_plt_static, allocate_dynrelocs): Use it.
3391
3392 2017-01-02 Alan Modra <amodra@gmail.com>
3393
3394 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
3395 .PARISC.unwind section.
3396
3397 2017-01-02 Alan Modra <amodra@gmail.com>
3398
3399 PR ld/20989
3400 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
3401 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
3402 indirect to GOT pointer relative code edit.
3403
3404 2017-01-02 Alan Modra <amodra@gmail.com>
3405
3406 Update year range in copyright notice of all files.
3407
3408 For older changes see ChangeLog-2016
3409 \f
3410 Copyright (C) 2017 Free Software Foundation, Inc.
3411
3412 Copying and distribution of this file, with or without modification,
3413 are permitted in any medium without royalty provided the copyright
3414 notice and this notice are preserved.
3415
3416 Local Variables:
3417 mode: change-log
3418 left-margin: 8
3419 fill-column: 74
3420 version-control: never
3421 End: