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