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