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