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