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