x86: Support Intel Shadow Stack with SHSTK property
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
48580982
L
12017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2
3 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
4 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
5 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
6 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
7 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
8 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
9 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
10 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
11
ee2fdd6f
L
122017-06-22 H.J. Lu <hongjiu.lu@intel.com>
13
14 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
15 (elf_i386_lazy_ibt_plt_entry): Likewise.
16 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
17 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
18 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
19 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
20 (elf_i386_lazy_plt_layout): Likewise.
21 (elf_i386_non_lazy_plt_layout): Likewise.
22 (elf_i386_link_hash_entry): Add plt_second.
23 (elf_i386_link_hash_table): Add plt_second and
24 plt_second_eh_frame.
25 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
26 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
27 the second PLT. Check the second PLT.
28 (elf_i386_relocate_section): Use the second PLT to resolve
29 PLT reference if needed.
30 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
31 needed.
32 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
33 second PLT. Generate unwind info for the second PLT.
34 (elf_i386_plt_type): Add plt_second.
35 (elf_i386_get_synthetic_symtab): Support the second PLT.
36 (elf_i386_parse_gnu_properties): Support
37 GNU_PROPERTY_X86_FEATURE_1_AND.
38 (elf_i386_merge_gnu_properties): Support
39 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
40 on GNU_PROPERTY_X86_FEATURE_1_IBT
41 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
42 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
43 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
44 is set on all relocatable inputs.
45 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
46 (elf_x32_lazy_ibt_plt_entry): Likewise.
47 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
48 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
49 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
50 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
51 (elf_x86_64_lazy_ibt_plt): Likewise.
52 (elf_x32_lazy_ibt_plt): Likewise.
53 (elf_x86_64_non_lazy_ibt_plt): Likewise.
54 (elf_x32_non_lazy_ibt_plt): Likewise.
55 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
56 (elf_x86_64_parse_gnu_properties): Support
57 GNU_PROPERTY_X86_FEATURE_1_AND.
58 (elf_x86_64_merge_gnu_properties): Support
59 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
60 on GNU_PROPERTY_X86_FEATURE_1_IBT
61 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
62 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
63 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
64 is set on all relocatable inputs.
65
d19237d9
NC
662017-06-22 Nick Clifton <nickc@redhat.com>
67
68 PR binutils/21649
69 * som.c (setup_sections): NUL terminate the space_strings buffer.
70 Check that the space.name field does not index beyond the end of
71 the space_strings buffer.
72
6879f5a9
NC
732017-06-21 Nick Clifton <nickc@redhat.com>
74
75 PR binutils/21646
76 * coff-sh.c (sh_reloc): Check for an out of range reloc.
77
7adc0a81
NC
782017-06-21 Nick Clifton <nickc@redhat.com>
79
80 PR binutils/21639
81 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
82 type of the size parameter.
83 (_bfd_vms_save_counted_string): Add second parameter - the maximum
84 length of the counted string.
85 * vms.h (_bfd_vms_save_sized_string): Update prototype.
86 (_bfd_vms_save_counted_string): Likewise.
87 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
88 _bfd_vms_save_counted_string.
89 (_bfd_vms_slurp_ehdr): Likewise.
90 (_bfd_vms_slurp_egsd): Likewise.
91 (Parse_module): Likewise.
92
6e1816be
AM
932017-06-21 Alan Modra <amodra@gmail.com>
94
95 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
96 calls before tocsave calls.
97 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
98 following nop.
99
20bd1b6b
NC
1002017-06-21 Nick Clifton <nickc@redhat.com>
101
102 PR binutils/21645
103 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
104 bfd_get_full_section_contents returns no contents.
105
3de58d95
NC
1062017-06-21 Nick Clifton <nickc@redhat.com>
107
108 PR binutils/21638
109 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
110 record.
111
cb06d03a
NC
1122017-06-21 Nick Clifton <nickc@redhat.com>
113
114 PR binutils/21637
115 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
116 list.
117 (image_set_ptr): Likewise.
118 (alpha_vms_fix_sec_rel): Likewise.
119 (alpha_vms_slurp_relocs): Likewise.
120
c458d007
NC
1212017-06-21 Nick Clifton <nickc@redhat.com>
122
123 PR binutils/21633
124 * ieee.c (ieee_slurp_sections): Check for a NULL return from
125 read_id.
126 (ieee_archive_p): Likewise.
127 (ieee_object_p): Likewise.
128
ce497010
NC
1292017-06-21 Nick Clifton <nickc@redhat.com>
130
131 PR binutils/21640
132 * elf.c (setup_group): Zero the group section pointer list after
133 allocation so that loops can be caught. Check for NULL pointers
134 when processing a group list.
135
abfa390d
L
1362017-06-19 H.J. Lu <hongjiu.lu@intel.com>
137
138 PR ld/21626
139 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
140 the DYNAMIC bit instead of bfd_count_sections.
141
bc21b167
NC
1422017-06-19 Nick Clifton <nickc@redhat.com>
143
144 PR binutils/21618
145 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
146 length.
147 (evax_bfd_print_eeom): Likewise.
148 (evax_bfd_print_egsd): Check for an overlarge record length.
149 (evax_bfd_print_etir): Likewise.
150
acb56a83
NC
1512017-06-19 Nick Clifton <nickc@redhat.com>
152
153 PR binutils/21612
154 * libieee.h (struct common_header_type): Add end_p field.
155 * ieee.c (this_byte_and_next): Do not advance input_p beyond
156 end_p.
157 (read_id): Check for a length that exceeds the remaining bytes in
158 the input buffer.
159 (ieee_seek): Initialise end_p.
160 (ieee_archive_p): Likewise.
161 (ieee_object_p): Likewise.
162
72e84f96
NC
1632017-06-19 Nick Clifton <nickc@redhat.com>
164
80053e46
NC
165 PR binutils/21611
166 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
167 before reading the EIHS structure entries.
168
1692017-06-19 Nick Clifton <nickc@redhat.com>
170
171 PR binutils/21615
72e84f96
NC
172 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
173 gsd_size. Check that there are enough bytes remaining to read the
174 type and size of the next egsd. Check that the size of the egsd
175 does not exceed the size of the record.
176
875ffa3e
AM
1772017-06-19 Alan Modra <amodra@gmail.com>
178
179 * config.bfd: Correct targ_underscore for cris.
180
bdd32e03
AM
1812017-06-18 Alan Modra <amodra@gmail.com>
182
183 * config.bfd: Correct targ_underscore for epiphany, ip2k,
184 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
185
4b48e2f6
NC
1862017-06-16 Nick Clifton <nickc@redhat.com>
187
188 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
189 bucketlist is empty because there are no symbols to add to the
190 list.
191
7dba9362
AM
1922017-06-16 Alan Modra <amodra@gmail.com>
193
194 PR ld/20022
195 PR ld/21557
196 PR ld/21562
197 PR ld/21571
198 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
199 (BFD_JUMP_TABLE_LINK): Likewise.
200 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
201 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
202 (bfd_elf_define_start_stop): New function.
203 * linker.c (bfd_generic_define_start_stop): New function.
204 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
205 new field.
206 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
207 * aout-target.h (MY_bfd_define_start_stop): Define.
208 * aout-tic30.c (MY_bfd_define_start_stop): Define.
209 * binary.c (binary_bfd_define_start_stop): Define.
210 * bout.c (b_out_bfd_define_start_stop): Define.
211 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
212 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
213 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
214 * coffcode.h (coff_bfd_define_start_stop): Define.
215 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
216 * i386msdos.c (msdos_bfd_define_start_stop): Define.
217 * i386os9k.c (os9k_bfd_define_start_stop): Define.
218 * ieee.c (ieee_bfd_define_start_stop): Define.
219 * ihex.c (ihex_bfd_define_start_stop): Define.
220 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
221 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
222 * mmo.c (mmo_bfd_define_start_stop): Define.
223 * nlm-target.h (nlm_bfd_define_start_stop): Define.
224 * oasys.c (oasys_bfd_define_start_stop): Define.
225 * pef.c (bfd_pef_bfd_define_start_stop): Define.
226 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
227 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
228 * som.c (som_bfd_define_start_stop): Define.
229 * srec.c (srec_bfd_define_start_stop): Define.
230 * tekhex.c (tekhex_bfd_define_start_stop): Define.
231 * versados.c (versados_bfd_define_start_stop): Define.
232 * vms-alpha.c (vms_bfd_define_start_stop): Define.
233 (alpha_vms_bfd_define_start_stop): Define.
234 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
235 * bfd-in2.h: Regenerate.
236 * libbfd.h: Regenerate.
237
d68f1976
JW
2382017-06-16 Jiong Wang <jiong.wang@arm.com>
239
240 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
241 SYMBOL_REFERENCES_LOCAL.
242
6353d82b
JW
2432017-06-15 Jiong Wang <jiong.wang@arm.com>
244
245 PR ld/21532
246 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
247 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
248 runtime for if there needs copy relocation elimination.
249 (need_copy_relocation_p): New function. Return true for symbol with
250 pc-relative references and if it's against read-only sections.
251 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
252 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
253 that are related with accessing external objects.
254 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
255 in elfNN_aarch64_check_relocs.
256
63634bb4
NC
2572017-06-15 Nick Clifton <nickc@redhat.com>
258
259 PR binutils/21582
260 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
261 bugs.
62b76e4b
NC
262 PR binutils/21581
263 (ieee_archive_p): Likewise.
63634bb4 264
76800cba
NC
2652017-06-15 Nick Clifton <nickc@redhat.com>
266
267 PR binutils/21579
268 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
269
f7e16c2a
MF
2702017-06-14 Max Filippov <jcmvbkbc@gmail.com>
271
272 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
273 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
274 keep both windowed and call0 ABI PLT definitions.
275 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
276 elf_xtensa_*_plt_entry endex.
277 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
278
f461bbd8
NC
2792017-06-14 Nick Clifton <nickc@redhat.com>
280
281 PR binutils/21578
282 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
283 flag value.
284
c53d2e6d
NC
2852017-06-14 Nick Clifton <nickc@redhat.com>
286
287 PR binutils/21589
288 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
289 maximum value for the ascic pointer. Check that name processing
290 does not read beyond this value.
291 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
292 end of etir record.
293
04f963fd
NC
2942017-06-14 Nick Clifton <nickc@redhat.com>
295
296 PR binutils/21591
297 * versados.c (versados_mkobject): Zero the allocated tdata structure.
298 (process_otr): Check for an invalid offset in the otr structure.
299
319c2dbe
SH
3002017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
301
302 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
303
cbd0eecf
L
3042017-06-13 H.J. Lu <hongjiu.lu@intel.com>
305
306 PR ld/20022
307 PR ld/21557
308 PR ld/21562
309 PR ld/21571
310 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
311 vtable field to a union.
312 (_bfd_elf_is_start_stop): Removed.
313 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
314 __start_SECNAME and __stop_SECNAME symbols.
315 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
316 * elflink.c (_bfd_elf_is_start_stop): Removed.
317 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
318 _bfd_elf_is_start_stop.
319 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
320 __stop_SECNAME symbols. Updated.
321 (elf_gc_smash_unused_vtentry_relocs): Likewise.
322 (bfd_elf_gc_record_vtinherit): Likewise.
323 (bfd_elf_gc_record_vtentry): Likewise.
324
10bbbc1d
NC
3252017-06-13 Nick Clifton <nickc@redhat.com>
326
327 PR ld/21524
328 * elflink.c (elf_link_adjust_relocs): Generate an error when
329 encountering a reloc against a symbol removed by garbage
330 collection.
331
5c3ce2bc
L
3322017-06-12 H.J. Lu <hongjiu.lu@intel.com>
333
334 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
335 to merge_gnu_properties.
336 * elf-properties.c (elf_merge_gnu_properties): Add struct
337 bfd_link_info * and pass it to merge_gnu_properties.
338 (elf_merge_gnu_property_list): Add struct bfd_link_info *
339 and pass it to elf_merge_gnu_properties.
340 (_bfd_elf_link_setup_gnu_properties): Pass info to
341 elf_merge_gnu_property_list.
342 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
343 bfd_link_info *.
344 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
345
9b97dfbf
AM
3462017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
347
348 PR 21564
349 * binary.c (binary_set_section_contents): Scale lma by octets
350 per byte to set filepos.
351
e3d1d408
CM
3522017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
353
354 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
355 dynamic sections.
356
64aa8e03
CM
3572017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
358
359 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
360 require TEXTREL.
361
a0abe743
CM
3622017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
363
364 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
365 patched section contents for TLS IE reloc.
366 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
367
f4e6805f
CM
3682017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
369
370 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
371 RELOC_FOR_GLOBAL_SYMBOL macro.
372
cd640291
CM
3732018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
374
375 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
376 changes.
377
7ef0acc1
VG
3782017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
379
380 * config/tc-arc.c (md_undefined_symbol): Changed.
381 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
382
cc89d0b3
CM
3832017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
384
385 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
386 symbols.
387
9d5c718b
CM
3882017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
389
390 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
391 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
392
be9e3704
CM
3932017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
394
395 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
396 object is created.
397
4ec192e6
RE
3982017-06-08 Richard Earnshaw <rearnsha@arm.com>
399
400 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
401 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
402 is non-zero. Add clarifying comments.
403
51fa2693
L
4042017-06-08 H.J. Lu <hongjiu.lu@intel.com>
405
406 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
407 name. Use local IFUNC symbol name string to report unsupported
408 non-PIC call to IFUNC function.
409 (elf_i386_relocate_section): Dump local IFUNC name with minfo
410 when generating R_386_IRELATIVE relocation.
411 (elf_i386_finish_dynamic_symbol): Likewise.
412 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
413 IFUNC symbol name.
414 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
415 when generating R_X86_64_IRELATIVE relocation.
416 (elf_x86_64_finish_dynamic_symbol): Likewise.
417
78e8a2ff
JM
4182017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
419
420 * elf.c (setup_group): Make sure BFD sections are created for all
421 group sections in the input file when processing SHF_GROUP
422 sections.
423 (bfd_section_from_shdr): Avoid duplicating logic already
424 implemented in `setup_group'.
425
9949827b
DBR
4262017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
427
428 PR binutils/21546
429 * peXXigen.c (pe_print_idata): Use the address of the first thunk
430 if the hint address is zero.
431
0ee3a6db
JC
4322017-06-06 James Clarke <jrtc27@jrtc27.com>
433
434 PR ld/19579
435 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
436 ELF_COMMON_DEF_P for common symbols.
437
7bdf4127
AB
4382017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
439
440 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
441 SEC_GROUP sections as SEC_EXCLUDE.
442 (bfd_elf_set_group_contents): Replace use of abort with an assert.
443 (assign_section_numbers): Use resolve_section_groups flag instead
444 of relocatable link type.
445 (_bfd_elf_init_private_section_data): Use resolve_section_groups
446 flag instead of checking the final_link flag for part of the
447 checks in here. Fix white space as a result.
448 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
449 instead of relocatable link type.
450 (bfd_elf_final_link): Likewise.
451
458ad2b8
JM
4522017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
453
454 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
455 variable `bed'.
456 * elf32-score.c (score_elf_final_link_relocate): Likewise.
457 (s3_bfd_score_elf_check_relocs): Likewise.
458 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
459 (score_elf_final_link_relocate): Likewise.
460 (s7_bfd_score_elf_check_relocs): Likewise.
461
fbebaf4a
JM
4622017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
463
464 * elflink.c (init_reloc_cookie_rels): Remove unused variable
465 `bed'.
466
056bafd4
MR
4672017-06-06 Maciej W. Rozycki <macro@imgtec.com>
468
469 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
470 from `reloc_count' rather than decrementing it.
471 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
472 `reloc_count' by `int_rels_per_ext_rel'.
473 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
474 `reloc_count' by `int_rels_per_ext_rel' for last relocation
475 entry determination.
476 (s3_bfd_score_elf_check_relocs): Likewise.
477 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
478 (s7_bfd_score_elf_relocate_section): Likewise.
479 (s7_bfd_score_elf_check_relocs): Likewise.
480 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
481 prototype and function.
482 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
483 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
484 triple rather than once the sum of REL and RELA relocation entry
485 counts.
486 (bfd_elf64_get_reloc_upper_bound): Remove macro.
487 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
488 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
489 storage allocation size determination.
490 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
491 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
492 by `int_rels_per_ext_rel' for last relocation entry
493 determination.
494 (bfd_elf_final_link): Do not multiply `reloc_count' by
495 `int_rels_per_ext_rel' for internal relocation storage
496 allocation size determination.
497 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
498 `int_rels_per_ext_rel' for last relocation entry determination.
499 (elf_gc_smash_unused_vtentry_relocs): Likewise.
500 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
501 (_bfd_mips_elf_relocate_section): Likewise.
502
af54f0eb
AM
5032017-06-05 Alan Modra <amodra@gmail.com>
504
505 PR 21529
506 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
507
6cf3bf88 5082017-06-01 John Baldwin <jhb@FreeBSD.org>
b5430a3c
JB
509
510 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
511 determine structure sizes.
512 (elfcore_grok_freebsd_prstatus): Likewise.
513
f378ab09
AM
5142017-06-01 Alan Modra <amodra@gmail.com>
515
516 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
517 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
518 dynamic objects.
519 (is_elfv2_localentry0): New function.
520 (ppc64_elf_tls_setup): Default params->plt_localentry0.
521 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
522 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
523 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
524 optimized localentry:0 stubs.
525 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
526 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
527 localentry:0 stubs.
528 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
529 DT_PPC64_OPT.
530 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
531
8c65b54f
CS
5322017-05-30 Casey Smith <clegg89@gmail.com>
533
534 PR ld/21523
535 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
536 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
537
64984c22
AK
5382017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
539
540 * cpu-arc.c (arc_compatible): New function.
541
37cd3877
AK
5422017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
543
544 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
545
8e2f54bc
L
5462017-05-30 H.J. Lu <hongjiu.lu@intel.com>
547
548 PR binutils/21519
549 * bfdio.c (bfd_get_file_size): New function.
550 * bfd-in2.h: Regenerated.
551
8e7f04f1 5522017-05-23 Dilian Palauzov <git-dpa@aegee.org>
553
554 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
555 comments.
556
25f94347
L
5572017-05-22 H.J. Lu <hongjiu.lu@intel.com>
558
559 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
560 dynobj instead of htab->elf.dynobj.
561
e5713223
MR
5622017-05-19 Maciej W. Rozycki <macro@imgtec.com>
563
564 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
565 and function.
566 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
567 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
568 actual number of internal relocations retrieved. Adjust
569 function description.
570 (bfd_elf64_canonicalize_reloc): Remove macro.
571 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
572
64517994
JM
5732017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
574
575 * archures.c (bfd_mach_sparc_v9m8): Define.
576 (bfd_mach_sparc_v8plusm8): Likewise.
577 (bfd_mach_sparc_v9_p): Adjust to M8.
578 (bfd_mach_sparc_64bit_p): Likewise.
579 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
580 bfd_mach_sparc_v8plusm8.
581 * bfd-in2.h: Regenerated.
582 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
583 sparc:v8plusm8.
584 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
585 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
586 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
587 SHA3.
588 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
589 bfd_mach_sparc_v8plusm8.
590
eb026f09
AM
5912017-05-19 Alan Modra <amodra@gmail.com>
592
593 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
594 debug and special sections when no non-note alloc sections in an
595 object are kept.
596
535b785f
AM
5972017-05-18 Alan Modra <amodra@gmail.com>
598
599 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
600 * elf-m10300.c: Likewise.
601 * elf.c: Likewise.
602 * elf32-arc.c: Likewise.
603 * elf32-bfin.c: Likewise.
604 * elf32-m68k.c: Likewise.
605 * elf32-nds32.c: Likewise.
606 * elf32-tilepro.c: Likewise.
607 * elflink.c: Likewise.
608 * elfnn-aarch64.c: Likewise.
609 * elfnn-riscv.c: Likewise.
610 * elfxx-tilegx.c: Likewise.
611 * mach-o.c: Likewise.
612 * peXXigen.c: Likewise.
613 * vms-alpha.c: Likewise.
614 * vms-lib.c: Likewise.
615
b7c871ed
L
6162017-05-17 H.J. Lu <hongjiu.lu@intel.com>
617
618 PR ld/20882
619 * elflink.c (elf_gc_mark_debug_section): New function.
620 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
621 referenced by kept debug sections.
622
bc4e12de
AM
6232017-05-16 Alan Modra <amodra@gmail.com>
624
625 * elf-m10300.c: Rename occurrences of non_ir_ref.
626 * elf32-arm.c: Likewise.
627 * elf32-bfin.c: Likewise.
628 * elf32-cr16.c: Likewise.
629 * elf32-cris.c: Likewise.
630 * elf32-d10v.c: Likewise.
631 * elf32-dlx.c: Likewise.
632 * elf32-fr30.c: Likewise.
633 * elf32-frv.c: Likewise.
634 * elf32-hppa.c: Likewise.
635 * elf32-i370.c: Likewise.
636 * elf32-i386.c: Likewise.
637 * elf32-iq2000.c: Likewise.
638 * elf32-lm32.c: Likewise.
639 * elf32-m32c.c: Likewise.
640 * elf32-m32r.c: Likewise.
641 * elf32-m68hc1x.c: Likewise.
642 * elf32-m68k.c: Likewise.
643 * elf32-mcore.c: Likewise.
644 * elf32-metag.c: Likewise.
645 * elf32-microblaze.c: Likewise.
646 * elf32-moxie.c: Likewise.
647 * elf32-msp430.c: Likewise.
648 * elf32-mt.c: Likewise.
649 * elf32-nios2.c: Likewise.
650 * elf32-or1k.c: Likewise.
651 * elf32-ppc.c: Likewise.
652 * elf32-rl78.c: Likewise.
653 * elf32-s390.c: Likewise.
654 * elf32-score.c: Likewise.
655 * elf32-score7.c: Likewise.
656 * elf32-sh.c: Likewise.
657 * elf32-tic6x.c: Likewise.
658 * elf32-tilepro.c: Likewise.
659 * elf32-v850.c: Likewise.
660 * elf32-vax.c: Likewise.
661 * elf32-xstormy16.c: Likewise.
662 * elf32-xtensa.c: Likewise.
663 * elf64-alpha.c: Likewise.
664 * elf64-hppa.c: Likewise.
665 * elf64-ia64-vms.c: Likewise.
666 * elf64-mmix.c: Likewise.
667 * elf64-ppc.c: Likewise.
668 * elf64-s390.c: Likewise.
669 * elf64-sh64.c: Likewise.
670 * elf64-x86-64.c: Likewise.
671 * elflink.c: Likewise.
672 * elfnn-aarch64.c: Likewise.
673 * elfnn-ia64.c: Likewise.
674 * elfnn-riscv.c: Likewise.
675 * elfxx-mips.c: Likewise.
676 * elfxx-sparc.c: Likewise.
677 * elfxx-tilegx.c: Likewise.
678 * linker.c: Likewise.
679
4070765b
AM
6802017-05-16 Alan Modra <amodra@gmail.com>
681
682 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
683 * elflink.c (elf_link_add_object_symbols): Update to use
684 non_ir_ref_dynamic.
685 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
686 non_ir_ref.
687 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
688
25499ac7
MR
6892017-05-15 Maciej W. Rozycki <macro@imgtec.com>
690
691 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
692
73caa85d
L
6932017-05-12 H.J. Lu <hongjiu.lu@intel.com>
694
695 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
696 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
697 properties.
698 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
699
f2c29a16
L
7002017-05-11 H.J. Lu <hongjiu.lu@intel.com>
701
702 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
703 to plt_second.
704 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
705 to plt_second/plt_second_eh_frame.
706 (elf_x86_64_link_hash_newfunc): Updated.
707 (elf_x86_64_allocate_dynrelocs): Likewise.
708 (elf_x86_64_size_dynamic_sections): Likewise.
709 (elf_x86_64_relocate_section): Likewise.
710 (elf_x86_64_finish_dynamic_symbol): Likewise.
711 (elf_x86_64_finish_dynamic_sections): Likewise.
712 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
713 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
714 .plt.sec section.
715 (elf_backend_setup_gnu_properties): Updated. Create the
716 .plt.sec section instead of the .plt.sec section.
717
dc2be3d2
L
7182017-05-11 H.J. Lu <hongjiu.lu@intel.com>
719
720 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
721 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
722 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
723
db84b98a
JM
7242017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
725
726 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
727 (bfd_elf64_set_reloc): Define.
728 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
729
23186865
JM
7302017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
731
732 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
733 (struct bfd_target): New field _bfd_set_reloc.
734 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
735 * reloc.c (_bfd_generic_set_reloc): New function.
736 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
737 * nlm-target.h (nlm_set_reloc): Likewise.
738 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
739 * aout-tic30.c (MY_set_reloc): Likewise.
740 * aout-target.h (MY_set_reloc): Likewise.
741 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
742 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
743 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
744 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
745 * aout-adobe.c (aout_32_set_reloc): Likewise.
746 * bout.c (b_out_set_reloc): Likewise.
747 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
748 * i386os9k.c (aout_32_set_reloc): Likewise.
749 * ieee.c (ieee_set_reloc): Likewise.
750 * oasys.c (oasys_set_reloc): Likewise.
751 * som.c (som_set_reloc): Likewise.
752 * versados.c (versados_set_reloc): Likewise.
753 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
754 _bfd_generic_set_reloc.
755 (rs6000_xcoff64_aix_vec): LIkewise.
756 * libbfd.c (_bfd_norelocs_set_reloc): New function.
757 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
758 * i386msdos.c (msdos_set_reloc): Define to
759 _bfd_norelocs_set_reloc.
760 * elfcode.h (elf_set_reloc): Define.
761 * bfd-in2.h: Regenerated.
762
aab82f4c
L
7632017-05-10 H.J. Lu <hongjiu.lu@intel.com>
764
765 PR ld/21481
766 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
767 for IFUNC function address.
768
53a346d8
CZ
7692017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
770
771 * elf32-arc.c (FEATURE_LIST_NAME): Define.
772 (CONFLICT_LIST): Likewise.
773 (opcode/arc-attrs.h): Include.
774 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
775 (arc_extract_features): New file.
776 (arc_stralloc): Likewise.
777 (arc_elf_merge_attributes): Likewise.
778 (arc_elf_merge_private_bfd_data): Use object attributes.
779 (bfd_arc_get_mach_from_attributes): New function.
780 (arc_elf_object_p): Use object attributes.
781 (arc_elf_final_write_processing): Likewise.
782 (elf32_arc_obj_attrs_arg_type): New function.
783 (elf32_arc_obj_attrs_handle_unknown): Likewise.
784 (elf32_arc_section_from_shdr): Likewise.
785 (elf_backend_obj_attrs_vendor): Define.
786 (elf_backend_obj_attrs_section): Likewise.
787 (elf_backend_obj_attrs_arg_type): Likewise.
788 (elf_backend_obj_attrs_section_type): Likewise.
789 (elf_backend_obj_attrs_handle_unknown): Likewise.
790 (elf_backend_section_from_shdr): Likewise.
791
e645cf40
AG
7922017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
793
794 PR ld/21458
795 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
796 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
797 and the destination is a Thumb symbol.
798
dd9e66ee
L
7992017-05-08 H.J. Lu <hongjiu.lu@intel.com>
800
801 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
802 initializer to silence GCC 4.2.
803 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
804
38b12349
L
8052017-05-08 H.J. Lu <hongjiu.lu@intel.com>
806
807 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
808 (LAZY_PLT_ENTRY_SIZE): This.
809 (NON_LAZY_PLT_ENTRY_SIZE): New.
810 (elf_x86_64_plt0_entry): Renamed to ...
811 (elf_x86_64_lazy_plt0_entry): This.
812 (elf_x86_64_plt_entry): Renamed to ...
813 (elf_x86_64_lazy_plt_entry): This.
814 (elf_x86_64_bnd_plt0_entry): Renamed to ...
815 (elf_x86_64_lazy_bnd_plt0_entry): This.
816 (elf_x86_64_legacy_plt_entry): Removed.
817 (elf_x86_64_bnd_plt_entry): Renamed to ...
818 (elf_x86_64_lazy_bnd_plt_entry): This.
819 (elf_x86_64_legacy_plt2_entry): Renamed to ...
820 (elf_x86_64_non_lazy_plt_entry): This.
821 (elf_x86_64_bnd_plt2_entry): Renamed to ...
822 (elf_x86_64_non_lazy_bnd_plt_entry): This.
823 (elf_x86_64_eh_frame_plt): Renamed to ...
824 (elf_x86_64_eh_frame_lazy_plt): This.
825 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
826 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
827 (elf_x86_64_eh_frame_plt_got): Renamed to ...
828 (elf_x86_64_eh_frame_non_lazy_plt): This.
829 (elf_x86_64_lazy_plt_layout): New.
830 (elf_x86_64_non_lazy_plt_layout): Likewise.
831 (elf_x86_64_plt_layout): Likewise.
832 (elf_x86_64_backend_data): Remove PLT layout information. Add
833 os for target system.
834 (GET_PLT_ENTRY_SIZE): Removed.
835 (elf_x86_64_lazy_plt): New.
836 (elf_x86_64_non_lazy_plt): Likewise.
837 (elf_x86_64_lazy_bnd_plt): Likewise.
838 (elf_x86_64_non_lazy_bnd_plt): Likewise.
839 (elf_x86-64_arch_bed): Updated.
840 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
841 (elf_x86_64_create_dynamic_sections): Removed.
842 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
843 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
844 (elf_x86-64_adjust_dynamic_symbol): Updated.
845 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
846 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
847 size for PLT0 if there is no PLT0. Get plt_entry_size from
848 non_lazy_plt for non-lazy PLT entries.
849 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
850 from non_lazy_plt for non-lazy PLT entries.
851 (elf_x86-64_relocate_section): Updated. Properly get PLT index
852 if there is no PLT0.
853 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
854 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
855 entries with non-lazy PLT layout. Don't fill the second and third
856 slots in the PLT entry if there is no PLT0.
857 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
858 if there is no PLT0. Set sh_entsize on the .plt.got section.
859 (compare_relocs): New.
860 (elf_x86_64_plt_type): Likewise.
861 (elf_x86_64_plt): Likewise.
862 (elf_x86_64_nacl_plt): New. Forward declaration.
863 (elf_x86_64_get_plt_sym_val): Removed.
864 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
865 against all dynamic relocations.
866 (elf_x86_64_link_setup_gnu_properties): New function.
867 (elf_backend_create_dynamic_sections): Updated.
868 (elf_backend_setup_gnu_properties): New.
869 (elf_x86_64_nacl_plt): New.
870 (elf_x86_64_nacl_arch_bed): Updated.
871
f604c2a2
L
8722017-05-08 H.J. Lu <hongjiu.lu@intel.com>
873
874 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
875 (LAZY_PLT_ENTRY_SIZE): This.
876 (NON_LAZY_PLT_ENTRY_SIZE): New.
877 (elf_i386_plt0_entry): Renamed to ...
878 (elf_i386_lazy_plt0_entry): This.
879 (elf_i386_plt_entry): Renamed to ...
880 (elf_i386_lazy_plt_entry): This.
881 (elf_i386_pic_plt0_entry): Renamed to ...
882 (elf_i386_pic_lazy_plt0_entry): This.
883 (elf_i386_pic_plt_entry): Renamed to ...
884 (elf_i386_pic_lazy_plt_entry): This.
885 (elf_i386_got_plt_entry): Renamed to ...
886 (elf_i386_non_lazy_plt_entry): This.
887 (elf_i386_pic_got_plt_entry): Renamed to ...
888 (elf_i386_pic_non_lazy_plt_entry): This.
889 (elf_i386_eh_frame_plt): Renamed to ...
890 (elf_i386_eh_frame_lazy_plt): This.
891 (elf_i386_eh_frame_plt_got): Renamed to ...
892 (elf_i386_eh_frame_non_lazy_plt): This.
893 (elf_i386_plt_layout): Renamed to ...
894 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
895 eh_frame_plt_got_size.
896 (elf_i386_non_lazy_plt_layout): New.
897 (elf_i386_plt_layout): Likewise.
898 (elf_i386_non_lazy_plt): Likewise.
899 (GET_PLT_ENTRY_SIZE): Removed.
900 (elf_i386_plt): Renamed to ...
901 (elf_i386_lazy_plt): This.
902 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
903 (elf_i386_arch_bed): Updated.
904 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
905 (elf_i386_create_dynamic_sections): Removed.
906 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
907 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
908 (elf_i386_adjust_dynamic_symbol): Updated.
909 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
910 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
911 size for PLT0 if there is no PLT0.
912 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
913 output section is discarded only if GOT isn't empty.
914 (elf_i386_relocate_section): Updated. Properly get PLT index
915 if there is no PLT0.
916 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
917 second and third slots in the PLT entry if there is no PLT0.
918 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
919 if there is no PLT0. Set sh_entsize on the .plt.got section.
920 (elf_i386_nacl_plt): Forward declaration.
921 (elf_i386_get_plt_sym_val): Removed.
922 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
923 against all dynamic relocations.
924 (elf_i386_link_setup_gnu_properties): New function.
925 (elf_backend_create_dynamic_sections): Updated.
926 (elf_backend_setup_gnu_properties): New.
927 (elf_i386_nacl_plt): Updated.
928 (elf_i386_nacl_arch_bed): Likewise.
929 (elf_i386_vxworks_arch_bed): Likewise.
930
046734ff
TP
9312017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
932
933 * elflink.c (elf_output_implib): Remove executable flag from import
934 library bfd.
935 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
936 library is a relocatable object file.
937
b660e9eb
SKS
9382017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
939
940 PR ld/21404
941 * elf32-avr.c (avr_should_move_sym): New function.
942 (avr_should_reduce_sym_size): Likewise.
943 (avr_should_increase_sym_size): Likewise.
944 (elf32_avr_relax_delete_bytes): Adjust symbol values
945 and sizes by calling new functions.
946
763a5fa4
PD
9472017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
948
949 * config.bfd (riscv32-*): Enable rv64.
950
73ec947d
AM
9512017-05-02 Alan Modra <amodra@gmail.com>
952
953 PR 21384
954 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
955 rather than h->root.type == bfd_link_hash_new.
956 (bfd_elf_record_link_assignment): Similarly, call
957 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
958
a941291c
AM
9592017-04-29 Alan Modra <amodra@gmail.com>
960
961 PR 21432
962 * reloc.c (reloc_offset_in_range): New function.
963 (bfd_perform_relocation, bfd_install_relocation): Use it.
964 (_bfd_final_link_relocate): Likewise.
965
750eaa47
L
9662017-04-28 H.J. Lu <hongjiu.lu@intel.com>
967
968 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
969 before using .plt.got.
970 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
971
5b66fac4
L
9722017-04-27 H.J. Lu <hongjiu.lu@intel.com>
973
974 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
975 instead of "+=" to update 0.
976
de9a3c42
L
9772017-04-27 H.J. Lu <hongjiu.lu@intel.com>
978
979 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
980 .plt.got section here.
981 (elf_i386_check_relocs): Don't create the .plt.got section.
982 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
983 the .plt.got and .plt.bnd sections here.
984 (elf_x86_64_check_relocs): Don't create the .plt.got nor
985 .plt.bnd sections.
986
da3d25af
L
9872017-04-27 H.J. Lu <hongjiu.lu@intel.com>
988
989 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
990 has_bnd_reloc.
991 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
992 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
993 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
994 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
995 has_bnd_reloc.
996
fba37edd
L
9972017-04-27 H.J. Lu <hongjiu.lu@intel.com>
998
999 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
1000 to return bfd *.
1001 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
1002 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
1003 the first relocatable ELF input with GNU properties.
1004
1f78f649
L
10052017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1006
1007 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
1008 VxWorks for non-PIC.
1009
76c20d54
AM
10102017-04-27 Alan Modra <amodra@gmail.com>
1011
1012 * elf-bfd.h (struct elf_backend_data): Make asection param of
1013 elf_backend_eh_frame_address_size const.
1014 (_bfd_elf_eh_frame_address_size): Likewise.
1015 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
1016 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
1017 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
1018 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
1019 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
1020 (next_cie_fde_offset): Constify params.
1021 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
1022
d7153c4a
AM
10232017-04-27 Alan Modra <amodra@gmail.com>
1024
1025 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
1026 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
1027 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
1028 aug_data_len.
1029 (offset_adjust): New function.
1030 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
1031 (adjust_eh_frame_local_symbols): Likewise.
1032 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
1033 after changing anything. Return true if anything changed.
1034 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
1035 _bfd_elf_adjust_eh_frame_global_symbol for globals.
1036
641338d8
AM
10372017-04-27 Alan Modra <amodra@gmail.com>
1038
1039 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
1040 when force_local.
1041
21d68fcd
AM
10422017-04-27 Alan Modra <amodra@gmail.com>
1043
1044 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1045 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
1046 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
1047 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
1048 for undef and undefweak dyn_relocs.
1049 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1050 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
1051 (allocate_got, allocate_dynrelocs): Likewise.
1052 (ppc64_elf_relocate_section): Likewise.
1053
97d343d4
L
10542017-04-26 H.J. Lu <hongjiu.lu@intel.com>
1055
1056 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
1057 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
1058 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
1059 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
1060
04b31182
NC
10612017-04-26 Nick Clifton <nickc@redhat.com>
1062
1063 PR binutils/21434
1064 * reloc.c (bfd_perform_relocation): Check for a negative address
1065 in the reloc.
1066
23ec1e32
MR
10672017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1068
1069 PR ld/21334
1070 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
1071 member.
1072 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
1073 (elf_backend_always_renumber_dynsyms): Define.
1074 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
1075 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
1076 * elflink.c (bfd_elf_size_dynamic_sections): Also call
1077 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
1078 it.
1079 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1080
c46cec3a
MR
10812017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1082
1083 * elflink.c (bfd_elf_size_dynamic_sections): Only call
1084 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
1085 sections have been created.
1086
e63d1232
NC
10872017-04-26 Nick Clifton <nickc@redhat.com>
1088
1089 PR binutils/21431
1090 * compress.c (bfd_init_section_compress_status): Check the return
1091 value from bfd_malloc.
1092
9e9821dd
L
10932017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1094
1095 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
1096 no_finish_dynamic_symbol.
1097 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
1098 0.
1099 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
1100 weak symbol, don't make it dynamic.
1101 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
1102 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
1103 relocation for GOT reference.
1104 (elf_x86_64_finish_dynamic_symbol): Abort if
1105 no_finish_dynamic_symbol isn't 0.
1106
0dc9a308
L
11072017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1108
1109 PR ld/21402
1110 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
1111 undefined weak symbol, don't make it dynamic.
1112 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
1113 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1114 relocation for R_386_GOT32.
1115
1587442d
L
11162017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1117
1118 PR ld/21425
1119 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1120
7eacd66b
AM
11212017-04-23 Alan Modra <amodra@gmail.com>
1122
1123 PR 21414
1124 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1125 * elf.c (lcomm_sym): New.
1126 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1127 * bfd-in2.h: Regenerate.
1128
bce964aa
AM
11292017-04-23 Alan Modra <amodra@gmail.com>
1130
1131 PR 21412
1132 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1133 parameters and comment.
1134 (_bfd_elf_get_reloc_section): Delete.
1135 (_bfd_elf_plt_get_reloc_section): Declare.
1136 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1137 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1138 Extracted from..
1139 (_bfd_elf_get_reloc_section): ..here. Delete.
1140 (assign_section_numbers): Call elf_get_reloc_section.
1141 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1142 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1143
97e83a10
AM
11442017-04-23 Alan Modra <amodra@gmail.com>
1145
1146 PR 21409
1147 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1148 no symbols.
1149
e133d005
L
11502017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1151
1152 PR ld/21402
1153 * elf32-i386.c (elf_i386_link_hash_entry): Add
1154 no_finish_dynamic_symbol.
1155 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1156 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1157 symbol, don't make it dynamic in PIE.
1158 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1159 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1160 relocation for R_386_GOT32
1161 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1162 isn't 0.
1163
3c5fce9b
L
11642017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1165
1166 PR ld/19617
1167 PR ld/21086
1168 * elflink.c (elf_link_add_object_symbols): Require
1169 --no-dynamic-linker with -E/--dynamic-list when creating
1170 dynamic sections.
1171
0fad2956
MR
11722017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1173
1174 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1175 if forced local.
1176
64575f78
MR
11772017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1178
1179 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1180 dynamic symbol sorting.
1181
59fa66c5
L
11822017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1183
1184 PR ld/21382
1185 * elflink.c (elf_link_add_object_symbols): Preserve
1186 dynamic_ref_after_ir_def when restoring the symbol table for
1187 unneeded dynamic object.
1188
e492d2f8
L
11892017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1190
1191 PR ld/21401
1192 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1193 on on undefined IFUNC symbol in the second PLT.
1194
10169134
WAF
11952017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1196
1197 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1198
954b63d4
AM
11992017-04-19 Alan Modra <amodra@gmail.com>
1200
1201 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1202 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1203 * elf32-ppc.c:Formatting.
1204 (ensure_undefweak_dynamic): Don't make dynamic when
1205 info->dynamic_undefined_weak is zero.
1206 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1207 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1208 not default visibility. Discard undef and undefweak
1209 dyn_relocs earlier.
1210 (ppc_elf_relocate_section): Adjust to suit.
1211 * elf64-ppc.c: Formatting.
1212 (ensure_undefweak_dynamic): Don't make dynamic when
1213 info->dynamic_undefined_weak is zero.
1214 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1215 info->dynamic_undefined_weak. Discard them earlier.
1216
e6699019
L
12172017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1218
1219 PR ld/21389
1220 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1221 before generating the version definition section.
1222
c5d37467
AM
12232017-04-17 Alan Modra <amodra@gmail.com>
1224
1225 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1226 state when a regular object file defines a symbol with
1227 incompatible type to that defined by an earlier shared lib.
1228
63a5468a
AM
12292017-04-13 Alan Modra <amodra@gmail.com>
1230
1231 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1232 * elf.c: Likewise.
1233 * elf32-arm.c: Likewise.
1234 * elf32-i386.c: Likewise.
1235 * elf32-mep.c: Likewise.
1236 * elf64-ia64-vms.c: Likewise.
1237 * elf64-x86-64.c: Likewise.
1238 * elflink.c: Likewise.
1239 * elfnn-ia64.c: Likewise.
1240 * elfxx-mips.c: Likewise.
1241
dae82561
AM
12422017-04-13 Alan Modra <amodra@gmail.com>
1243
1244 * aoutx.h: Use %B and %A in error messages throughout file.
1245 * aout-cris.c: Likewise.
1246 * archive.c: Likewise.
1247 * binary.c: Likewise.
1248 * coff-rs6000.c: Likewise.
1249 * coff-tic4x.c: Likewise.
1250 * coffcode.h: Likewise.
1251 * coffgen.c: Likewise.
1252 * cofflink.c: Likewise.
1253 * coffswap.h: Likewise.
1254 * cpu-arm.c: Likewise.
1255 * elf-eh-frame.c: Likewise.
1256 * elf-m10300.c: Likewise.
1257 * elf.c: Likewise.
1258 * elf32-arc.c: Likewise.
1259 * elf32-arm.c: Likewise.
1260 * elf32-bfin.c: Likewise.
1261 * elf32-frv.c: Likewise.
1262 * elf32-iq2000.c: Likewise.
1263 * elf32-m32c.c: Likewise.
1264 * elf32-microblaze.c: Likewise.
1265 * elf32-nds32.c: Likewise.
1266 * elf32-rl78.c: Likewise.
1267 * elf32-rx.c: Likewise.
1268 * elf32-score.c: Likewise.
1269 * elf32-score7.c: Likewise.
1270 * elf32-sh64.c: Likewise.
1271 * elf32-v850.c: Likewise.
1272 * elf32-vax.c: Likewise.
1273 * elf32-visium.c: Likewise.
1274 * elf64-ia64-vms.c: Likewise.
1275 * elf64-mmix.c: Likewise.
1276 * elf64-sh64.c: Likewise.
1277 * elfcode.h: Likewise.
1278 * elfnn-aarch64.c: Likewise.
1279 * elfnn-ia64.c: Likewise.
1280 * elfxx-mips.c: Likewise.
1281 * hpux-core.c: Likewise.
1282 * ieee.c: Likewise.
1283 * ihex.c: Likewise.
1284 * linker.c: Likewise.
1285 * merge.c: Likewise.
1286 * mmo.c: Likewise.
1287 * oasys.c: Likewise.
1288 * pdp11.c: Likewise.
1289 * peXXigen.c: Likewise.
1290 * rs6000-core.c: Likewise.
1291 * vms-alpha.c: Likewise.
1292 * xcofflink.c: Likewise.
1293
c08bb8dd
AM
12942017-04-13 Alan Modra <amodra@gmail.com>
1295
1296 * bfd.c (PRINT_TYPE): Define.
1297 (_doprnt): New function.
1298 (error_handler_internal): Use _doprnt.
1299 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1300 calls in their natural order, throughout file.
1301 * coff-mcore.c: Likewise.
1302 * coff-ppc.c: Likewise.
1303 * coff-tic80.c: Likewise.
1304 * cofflink.c: Likewise.
1305 * elf-s390-common.c: Likewise.
1306 * elf.c: Likewise.
1307 * elf32-arm.c: Likewise.
1308 * elf32-i386.c: Likewise.
1309 * elf32-m32r.c: Likewise.
1310 * elf32-msp430.c: Likewise.
1311 * elf32-spu.c: Likewise.
1312 * elf64-ia64-vms.c: Likewise.
1313 * elf64-sparc.c: Likewise.
1314 * elf64-x86-64.c: Likewise.
1315 * elflink.c: Likewise.
1316 * elfnn-aarch64.c: Likewise.
1317 * elfnn-ia64.c: Likewise.
1318 * elfxx-mips.c: Likewise.
1319
10463f39
AM
13202017-04-13 Alan Modra <amodra@gmail.com>
1321
1322 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1323 branch veneers" error. Fix double space and format message.
1324 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1325 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1326
4af8774e
AM
13272017-04-13 Alan Modra <amodra@gmail.com>
1328
1329 * bfd-in2.h: Regenerate.
1330
e4097f5e
L
13312017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1332
1333 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1334 extra `\n' in warning/error messages.
1335 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1336 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1337
537616aa
L
13382017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1339
1340 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1341 processor-specific properties with generic ELF target vector.
1342
bb1dd176
QZ
13432017-04-10 Qing Zhao <qing.zhao@oracle.com>
1344
1345 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1346 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1347 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1348 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1349 has_non_got_reloc.
1350 (link_hash_newfunc): Initialize has_got_reloc and
1351 has_non_got_reloc.
1352 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1353 section.
1354 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1355 has_non_got_reloc.
1356 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1357 has_non_got_reloc.
1358 (_bfd_sparc_elf_fixup_symbol): New function.
1359 (allocate_dynrelocs): Don't allocate space for dynamic
1360 relocations and discard relocations against resolved undefined
1361 weak symbols in executable. Don't make resolved undefined weak
1362 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1363 relocation against undefined weak symbols in PIE.
1364 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1365 relocations against resolved undefined weak symbols in PIE
1366 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1367 without ynamic PLT/GOT relocations for resolved undefined weak
1368 symbols.
1369 Don't generate dynamic relocation against resolved undefined
1370 weak symbol in executable.
1371 (pie_finish_undefweak_symbol): New function.
1372 (_bfd_sparc_elf_finish_dynamic_sections): Call
1373 pie_finish_undefweak_symbol on all symbols in PIE.
1374 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1375 (_bfd_sparc_elf_fixup_symbol): New function.
1376
d236cfd4
NC
13772017-04-10 Nick Clifton <nickc@redhat.com>
1378
1379 * config.bfd: Remove ns32k from obsolete list.
1380
6f9dbcd4
AM
13812017-04-10 Alan Modra <amodra@gmail.com>
1382
1383 PR 21287
1384 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1385 (special_sections_i): Likewise for .init_array.
1386 (special_sections_p): Likewise for .preinit_array.
1387
8170f769
L
13882017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1389
1390 PR ld/19579
1391 PR ld/21306
1392 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1393 ELF_COMMON_DEF_P for common symbols.
1394 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1395 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1396 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1397 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1398 07492f668d2173da7a2bda3707ff0985e0f460b6.
1399
49f4617b
PA
14002017-04-07 Pedro Alves <palves@redhat.com>
1401
1402 * opncls.c (bfd_get_debug_link_info): Rename to...
1403 (bfd_get_debug_link_info_1): ... this. Change type of second
1404 parameter to void pointer. Adjust.
1405 (bfd_get_debug_link_info): Reimplement on top of
1406 bfd_get_debug_link_info_1.
1407 (separate_debug_file_exists, separate_alt_debug_file_exists):
1408 Change type of second parameter to void pointer. Adjust.
1409 (get_func_type, check_func_type): Change type of second parameter
1410 to void pointer.
1411 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1412 the callback functions instead of passing the address of a local.
1413 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1414 find_separate_debug_file.
1415 (get_alt_debug_link_info_shim): Change type of second parameter to
1416 void pointer. Adjust.
1417 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1418 find_separate_debug_file.
1419 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1420 of second parameter to void pointer. Adjust.
1421 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1422 pointer local to find_separate_debug_file.
1423
14242017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1fd6d111
TG
1425
1426 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1427 external symbols with a definition.
1428 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1429
86abf93a
AM
14302017-04-07 Alan Modra <amodra@gmail.com>
1431
1432 * po/SRC-POTFILES.in: Regenerate.
1433
8dea77f0
AM
14342017-04-05 Alan Modra <amodra@gmail.com>
1435
1436 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1437 reference counting.
1438
477bdd39
JT
14392017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1440
1441 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1442 numbers for DataDirectory entry indicies passed to
1443 add_data_entry().
1444
a91e1603
L
14452017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1446
1447 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1448 each GNU_MBIND section and align GNU_MBIND section to page size.
1449 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1450 segment for each GNU_MBIND section.
1451 (_bfd_elf_init_private_section_data): Copy sh_info from input
1452 for GNU_MBIND section.
1453
b5292032
PD
14542017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
1455
1456 * elfnn-riscv.c (GP_NAME): Delete.
1457 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
1458 (_bfd_riscv_relax_lui): Likewise.
1459
ad32986f
NC
14602017-04-04 Nick Clifton <nickc@redhat.com>
1461
1462 PR binutils/21342
1463 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
1464 dereference.
1465 (bfd_elf_final_link): Only initialize the extended symbol index
1466 section if there are extended symbol tables to list.
1467
46bed679
L
14682017-04-03 H.J. Lu <hongjiu.lu@intel.com>
1469
1470 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
1471 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
1472 * configure.ac (elf): Add elf-properties.lo.
1473 * Makefile.in: Regenerated.
1474 * configure: Likewise.
1475 * elf-bfd.h (elf_property_kind): New.
1476 (elf_property): Likewise.
1477 (elf_property_list): Likewise.
1478 (elf_properties): Likewise.
1479 (_bfd_elf_parse_gnu_properties): Likewise.
1480 (_bfd_elf_get_property): Likewise.
1481 (_bfd_elf_link_setup_gnu_properties): Likewise.
1482 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
1483 and setup_gnu_properties.
1484 (elf_obj_tdata): Add properties.
1485 * elf-properties.c: New file.
1486 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
1487 (elf_i386_merge_gnu_properties): Likewise.
1488 (elf_backend_parse_gnu_properties): Likewise.
1489 (elf_backend_merge_gnu_properties): Likewise.
1490 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1491 (elf_x86_64_merge_gnu_properties): Likewise.
1492 (elf_backend_parse_gnu_properties): Likewise.
1493 (elf_backend_merge_gnu_properties): Likewise.
1494 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
1495 (elf_backend_parse_gnu_properties): Likewise.
1496 (elf_backend_setup_gnu_properties): Likewise.
1497 (elfNN_bed): Add elf_backend_parse_gnu_properties,
1498 elf_backend_merge_gnu_properties and
1499 elf_backend_setup_gnu_properties.
1500
f96bd6c2
PC
15012017-03-30 Pip Cet <pipcet@gmail.com>
1502
1503 * elf32-wasm32.c: Add relocation code, two relocs.
1504 * reloc.c: Add wasm32 relocations.
1505 * libbfd.h: Regenerate.
1506 * bfd-in2.h: Regenerate.
1507 * bfd/po/bfd.pot: Regenerate.
1508
e643cb45
NC
15092017-03-29 Nick Clifton <nickc@redhat.com>
1510
1511 PR binutils/18025
1512 * coff-bfd.h (struct coff_section_data): Add new fields:
1513 saved_bias and bias.
1514 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
1515 computed for PE binaries.
1516 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
1517 missing abbrev.
1518
086554e8
HPN
15192017-03-28 Hans-Peter Nilsson <hp@axis.com>
1520
1521 PR ld/16044
1522 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
1523 to handle a local symbol with a hash-symbol-entry; without PLT.
1524 Add BFD_ASSERT for an incidental case with GOT entry present.
1525 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
1526 isn't forced-or-set local.
1527
a6be0538
PC
15282017-03-27 Pip Cet <pipcet@gmail.com>
1529
1530 * wasm-module.c: New file to support WebAssembly modules.
1531 * wasm-module.h: New file to support WebAssembly modules.
1532 * doc/webassembly.texi: Start documenting wasm-module.c.
1533 * config.bfd: Add wasm_vec.
1534 * targets.c: Likewise.
1535 * configure.ac: Likewise.
1536 * Makefile.am: Add entries for wasm-module.c.
1537 * Makefile.in: Regenerate.
1538 * configure: Regenerate.
1539 * po/SRC-POTFILES.in: Regenerate.
1540
79b1d3cb
PC
15412017-03-27 Pip Cet <pipcet@gmail.com>
1542
1543 * cpu-wasm32.c: New file to support wasm32 architecture.
1544 * elf32-wasm32.c: New file to support wasm32 architecture.
1545 * Makefile.am: Add wasm32 architecture.
1546 * archures.c: Likewise.
1547 * config.bfd: Likewise.
1548 * configure.ac: Likewise.
1549 * targets.c: Likewise.
1550 * Makefile.in: Regenerate.
1551 * bfd-in2.h: Regenerate.
1552 * configure: Regenerate.
1553 * po/SRC-POTFILES.in: Regenerate.
1554
aaed6f5b
AM
15552017-03-20 Alan Modra <amodra@gmail.com>
1556
1557 PR 21266
1558 * elf64-ppc.c (compare_symbols): Stabilize sort.
1559
82e66161
AM
15602017-03-18 Alan Modra <amodra@gmail.com>
1561
1562 * elf64-ppc.c (struct ppc_link_hash_table): Add
1563 local_ifunc_resolver and maybe_local_ifunc_resolver.
1564 (ppc_build_one_stub): Set flags on emitting dynamic
1565 relocation to ifunc.
1566 (ppc64_elf_relocate_section): Likewise.
1567 (ppc64_elf_finish_dynamic_symbol): Likewise.
1568 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
1569 local dynamic relocs to ifuncs.
1570 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
1571 local_ifunc_resolver and maybe_local_ifunc_resolver.
1572 (ppc_elf_relocate_section): Set flag on emitting dynamic
1573 relocation to ifuncs.
1574 (ppc_elf_finish_dynamic_symbol): Likewise.
1575 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
1576 dynamic relocs to ifuncs.
1577
f955cccf
NC
15782017-03-13 Nick Clifton <nickc@redhat.com>
1579
1580 PR binutils/21202
1581 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
1582 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
1583 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
1584 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
1585 * bfd-in2.h: Regenerate.
1586 * libbfd.h: Regenerate.
1587 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
1588 names.
1589 (IS_AARCH64_TLSDESC_RELOC): Likewise.
1590 (elfNN_aarch64_howto_table): Likewise.
1591 (aarch64_tls_transition_without_check): Likewise.
1592 (aarch64_reloc_got_type): Likewise.
1593 (elfNN_aarch64_final_link_relocate): Likewise.
1594 (elfNN_aarch64_tls_relax): Likewise.
1595 (elfNN_aarch64_relocate_section): Likewise.
1596 (elfNN_aarch64_gc_sweep_hook): Likewise.
1597 (elfNN_aarch64_check_relocs): Likewise.
1598 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1599 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1600
4aef7643
AM
16012017-03-11 Alan Modra <amodra@gmail.com>
1602
1603 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
1604 parameter is in fact used. Whitespace fixes.
1605 * elf64-ppc.c: Likewise.
1606
f03265d9
ST
16072017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
1608
1609 * rs6000-core.c (CORE_NEW): Simplify macro when
1610 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
1611
b1b07054
AM
16122017-03-07 Alan Modra <amodra@gmail.com>
1613
1614 PR 21224
1615 PR 20519
1616 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
1617 dyn_relocs check.
1618
2e0ce1c8
AM
16192017-03-05 Alan Modra <amodra@gmail.com>
1620
1621 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
1622 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
1623 (next_cie_fde_offset): New function.
1624 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
1625 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
1626 four bytes. Align CIEs to four or eight bytes depending on
1627 per_encoding_aligned8. Align FDEs according to their encoding.
1628 Pad last FDE to output section alignment.
1629 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
1630 assertion.
1631 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
1632 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
1633 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
1634
f98450c6
NC
16352017-03-02 Martin Bickel <binutils@ineranves.de>
1636
1637 PR ld/21212
1638 * elf.c (rewrite_elf_program_header): Do not issue a warning for
d20928fa 1639 empty segments which have a zero filesz, but a non-zero memsz.
f98450c6 1640
673cff9b
AM
16412017-03-02 Alan Modra <amodra@gmail.com>
1642
1643 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
1644
3de43e7b
AM
16452017-02-28 Alan Modra <amodra@gmail.com>
1646
1647 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
1648 (ppc64_elf_relocate_section): Likewise.
1649
4ef97a1b
AM
16502017-02-28 Alan Modra <amodra@gmail.com>
1651
1652 PR 20995
1653 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
1654 rather than elf32_nios2_hash_table or elf_hash_table.
1655 (create_got_section): Likewise.
1656 (nios2_elf32_finish_dynamic_symbol): Likewise.
1657 (nios2_elf32_adjust_dynamic_symbol): Likewise.
1658 (nios2_elf32_size_dynamic_sections): Likewise.
1659 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
1660 vars. Use htab equivalents directly instead. Don't create
1661 all dynamic sections on needing just the GOT. Use a goto
1662 rather than a fall-through with reloc test. Ensure
1663 htab->dynobj is set when making dynamic sreloc section.
1664 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
1665 equivalent directly instead. Don't segfault on looking for
1666 .dynamic when dynamic sections have not been created. Don't
1667 segfault on .got.plt being discarded.
1668 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
1669 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
1670 fixme and another not so relevant comment.
1671 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
1672 already set, set hash table dynobj on creating .sbss.
1673
7ba71655
AM
16742017-02-28 Alan Modra <amodra@gmail.com>
1675
1676 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
1677 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
1678 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
1679 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
1680 (ppc64_elf_relocate_section): Likewise.
1681 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
1682 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
1683 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
1684 * libbfd.h: Regenerate.
1685 * bfd-in2.h: Regenerate.
1686
afbf7e8e
AM
16872017-02-28 Alan Modra <amodra@gmail.com>
1688
1689 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
1690 dynamic .data.rel.ro read-only.
1691 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
1692 rather than section flags when deciding where copy reloc goes.
1693 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
1694 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
1695 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
1696 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
1697 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
1698 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
1699 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
1700 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
1701 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1702 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
1703 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
1704 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
1705 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1706 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1707 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
1708 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
1709 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
1710 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
1711 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
1712
0e392101
MR
17132017-02-28 Maciej W. Rozycki <macro@imgtec.com>
1714
1715 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
1716 `jalr $0, $25' instruction encoding.
1717
bd757ca7
NC
17182017-02-27 Nick Clifton <nickc@redhat.com>
1719
1720 PR ld/21180
1721 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
1722 generating a seg-fault when encountering a symbol that has been
1723 deleted by garbage collection.
1724
034fed0b
AM
17252017-02-25 Alan Modra <amodra@gmail.com>
1726
1727 * elf32-arc.c (struct dynamic_sections): Delete.
1728 (enum dyn_section_types): Delete.
1729 (dyn_section_names): Delete.
1730 (arc_create_dynamic_sections): Delete.
1731 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
1732 segfault on discarded .rela.plt section.
1733 (elf_arc_size_dynamic_sections): Formatting. Don't call
1734 arc_create_dynamic_sections. Don't allocate memory for sections
1735 handled by the generic linker. Correct code finding relocs in
1736 read-only sections. Set SEC_EXCLUDE on zero size .got,
1737 .got.plt, and .dynbss sections. Do set .interp for pies.
1738
d0f744f9
AW
17392017-02-24 Andrew Waterman <andrew@sifive.com>
1740
1741 * elfnn-riscv.c (GP_NAME): New macro.
1742 (riscv_global_pointer_value): Use it.
1743 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
1744 output section, consider only that section's alignment.
1745
5d58c733
MR
17462017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1747
1748 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
1749 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
1750 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
1751 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
1752
c1556ecd
MR
17532017-02-23 Maciej W. Rozycki <macro@imgtec.com>
1754
1755 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
1756 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
1757 or misaligned.
1758
5499c7c7
AM
17592017-02-23 Alan Modra <amodra@gmail.com>
1760
1761 PR 20744
1762 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
1763 16D relocations.
1764 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
1765 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
1766 relocs.
1767
902e9fc7
MR
17682017-02-22 Maciej W. Rozycki <macro@imgtec.com>
1769
1770 PR ld/20828
1771 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
1772 processing ahead of the call to `elf_gc_sweep_symbol'.
1773
758d96d8
NC
17742017-02-22 Nick Clifton <nickc@redhat.com>
1775
1776 PR binutils/21193
1777 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
1778 created section 4-byte alignment.
1779
6528b6eb
AM
17802017-02-22 Alan Modra <amodra@gmail.com>
1781
1782 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
1783 on .got or .plt output section being discarded by script.
1784 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
1785 vxworks splt temp.
1786
24f1a751
AM
17872017-02-21 Alan Modra <amodra@gmail.com>
1788
1789 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
1790 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
1791
64487780
AM
17922017-02-20 Alan Modra <amodra@gmail.com>
1793
1794 PR 21181
1795 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
1796 if DT_RELSZ/DT_RELASZ is zero.
1797
6438d1be
NC
17982017-02-17 Nick Clifton <nickc@redhat.com>
1799
1800 * compress.c (bfd_get_full_section_contents): Remember to reduce
1801 compressed size by the sizeof the compression header when
1802 decompressing the contents.
1803
4bc26c69
PA
18042017-02-17 Pedro Alves <palves@redhat.com>
1805
1806 * srec.c (Chunk): Rename to ...
1807 (_bfd_srec_len): ... this.
1808 (S3Forced): Rename to ...
1809 (_bfd_srec_forceS3): ... this.
1810 * objcopy.c: Adjust all references.
1811
7ec22e0f
PA
18122017-02-17 Pedro Alves <palves@redhat.com>
1813
1814 * archive.c (bsd_write_armap): Rename to ...
1815 (_bfd_bsd_write_armap): ... this.
1816 (coff_write_armap): Rename to ...
1817 (_bfd_coff_write_armap): ... this.
1818 * libbfd-in.h (bsd_write_armap): Rename to ...
1819 (_bfd_bsd_write_armap): ... this.
1820 (coff_write_armap): Rename to ...
1821 (_bfd_coff_write_armap): ... this.
1822 * aout-target.h, aout-tic30.c: Adjust all users.
1823 * libbfd.h: Regenerate.
1824
8c8402cc
PA
18252017-02-17 Pedro Alves <palves@redhat.com>
1826
1827 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
1828 (warn_deprecated): Rename to ...
1829 (_bfd_warn_deprecated): ... this.
1830 * libbfd.c (warn_deprecated): Rename to ...
1831 (_bfd_warn_deprecated): ... this.
1832 * bfd-in2.h: Regenerate.
1833
c7c3d11b
PA
18342017-02-17 Pedro Alves <palves@redhat.com>
1835
1836 * bfdio.c (real_ftell): Rename to ...
1837 (_bfd_real_ftell): ... this.
1838 (real_fseek): Rename to ...
1839 (_bfd_real_fseek): ... this.
1840 (real_fopen): Rename to ...
1841 (_bfd_real_fopen): ... this.
1842 * libbfd-in.h (real_ftell): Rename to ...
1843 (_bfd_real_ftell): ... this.
1844 (real_fseek): Rename to ...
1845 (_bfd_real_fseek): ... this.
1846 (real_fopen): Rename to ...
1847 (_bfd_real_fopen): ... this.
1848 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
1849 * libbfd.h: Regenerate.
1850
4265548c
PA
18512017-02-17 Pedro Alves <palves@redhat.com>
1852
1853 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
1854 * libbfd.c (read_unsigned_leb128): Rename to ...
1855 (_bfd_read_unsigned_leb128): ... this.
1856 (read_signed_leb128): Rename to ...
1857 (_bfd_read_signed_leb128): ... this.
1858 (safe_read_leb128): Rename to ...
1859 (_bfd_safe_read_leb128): ... this.
1860 * libbfd-in.h (read_unsigned_leb128): Rename to ...
1861 (_bfd_read_unsigned_leb128): ... this.
1862 (read_signed_leb128): Rename to ...
1863 (_bfd_read_signed_leb128): ... this.
1864 (safe_read_leb128): Rename to ...
1865 (_bfd_safe_read_leb128): ... this.
1866 * libbfd.h: Renegerate.
1867
3239a423
AB
18682017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1869
1870 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
1871 before trying to fine matching file and line information.
1872
90ed9b8b
AB
18732017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
1874
1875 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
1876 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
1877 not match current bfd, then reload debug information. Record bfd
1878 we're loading debug info for in the stash. If we have debug
1879 informatin in the cache then perform section placement before
1880 returning.
1881
a8c75b76
AM
18822017-02-16 Alan Modra <amodra@gmail.com>
1883
1884 PR 21000
1885 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
1886 * elfxx-target.h (elf_backend_no_page_alias): Define.
1887 (elfNN_bed): Init new field.
1888 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
1889 ensure PT_LOAD segment starts on a new page.
1890 * elf32-hppa.c (elf_backend_no_page_alias): Define.
1891
247d6c4c
AM
18922017-02-16 Alan Modra <amodra@gmail.com>
1893
1894 PR 21132
1895 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
1896 if pic.
1897
90571206
JW
18982017-02-16 Jiong Wang <jiong.wang@arm.com>
1899
1900 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
1901 * bfd-in2.h: Regenerated.
1902
2a568401
L
19032017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1904
1905 PR ld/21168
1906 * elf32-i386.c (elf_i386_relocate_section): Allow
1907 "lea foo@GOT, %reg" in PIC.
1908
a5def14f
L
19092017-02-15 H.J. Lu <hongjiu.lu@intel.com>
1910
1911 PR ld/20244
1912 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
1913 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
1914 error against local IFUNC symbol without a base register for
1915 PIC.
1916
174d0a74
MR
19172017-02-15 Maciej W. Rozycki <macro@imgtec.com>
1918
1919 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
1920 `%P: %H:' with `info->callbacks->einfo'.
1921 (ppc_elf_relocate_section): Likewise.
1922 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1923 (ppc64_elf_edit_toc): Likewise.
1924 (ppc64_elf_relocate_section): Likewise.
1925
e278ae05
AM
19262017-02-14 Alan Modra <amodra@gmail.com>
1927
1928 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
1929 --gc-keep-exported, and test versioned field of sym rather than
1930 looking for @ in name.
1931
10ddfe62
PD
19322017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
1933
1934 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
1935 __global_pointer$.
1936
d11135f5
NC
19372017-02-13 Nick Clifton <nickc@redhat.com>
1938
1939 PR binutils/21151
1940 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
1941 unit length field.
1942
cc162427
AW
19432017-02-07 Andrew Waterman <andrew@sifive.com>
1944
1945 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
1946 entry size if PLT header is written.
1947
3d044c0c
SL
19482017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
1949
1950 Fix sparc64 dynamic relocation processing to use the dynamic
1951 symbol count.
1952 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
1953 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
1954 should be used.
1955
1b7e3d2f
NC
19562017-02-03 Nick Clifton <nickc@redhat.com>
1957
1958 PR 21096
1959 * coffcode.h (coff_write_object_contents): Enlarge size of
1960 s_name_buf in order to avoid compile time warning about possible
1961 integer truncation.
1962 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
1963 32-bits of insn value before printing into buffer.
1964
e17b0c35
MR
19652017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1966
1967 * elfxx-mips.c (mips_elf_hash_sort_data): Add
1968 `max_local_dynindx'.
1969 (mips_elf_sort_hash_table): Handle it.
1970 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
1971 symbols bump up `max_local_dynindx' rather than
1972 `max_non_got_dynindx'.
1973
55f8b9d2
MR
19742017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1975
1976 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
1977 `min_got_dynindx', `max_unref_got_dynindx' and
1978 `max_non_got_dynindx' members to the `bfd_size_type' data type.
1979 (mips_elf_sort_hash_table): Adjust accordingly.
1980
0f8c4b60
MR
19812017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1982
1983 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
1984 to access the hash table.
1985
17a80fa8
MR
19862017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1987
1988 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
1989 non-NULL `htab' to the beginning.
1990
8f56d4fd
MR
19912017-02-02 Maciej W. Rozycki <macro@imgtec.com>
1992
1993 * elflink.c (elf_gc_sweep): Wrap overlong line.
1994
8b10b0b3
MR
19952017-01-30 Maciej W. Rozycki <macro@imgtec.com>
1996
1997 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
1998 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
1999 * elfxx-mips.c (mips_elf_link_hash_table): Add
2000 `ignore_branch_isa' member.
2001 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
2002 in branch relocation calculation as an error if
2003 `ignore_branch_isa' has been set.
2004 (_bfd_mips_elf_insn32): Rename to...
2005 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
2006 parameter to `insn32' and add an `ignore_branch_isa' parameter.
2007 Handle the new parameter.
2008
1fbd05e1
HPN
20092017-01-27 Hans-Peter Nilsson <hp@axis.com>
2010
22d9a0de
HPN
2011 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
2012 local variable dynobj.
2013
1fbd05e1
HPN
2014 PR ld/20995
2015 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
2016 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
2017 executable from read-only sections into sdynrelro.
2018 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
2019 dynamic relocs in sdynrelro.
2020 (elf_backend_want_dynrelro): Define.
2021
4a7324e1
SH
20222017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2023
2024 * config.bfd (*-*-rtemsaout*): Mark as removed.
2025
c75b4ebd
SH
20262017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2027
2028 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
2029 (arm-*-rtems*): Move to (arm*-*-eabi*).
2030 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
2031 (m68-*-rtems*): Move to (m68*-*-elf*).
2032
850d84f6
SH
20332017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2034
2035 * config.bfd (*-*-rtemscoff*): Mark as removed.
2036
b531344c
MR
20372017-01-24 Maciej W. Rozycki <macro@imgtec.com>
2038
2039 PR ld/20828
2040 * elflink.c (bfd_elf_record_link_assignment): Revert last
2041 change and don't ever clear `forced_local'. Set `mark'
2042 unconditionally.
2043 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
2044 file.
2045 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
2046 (bfd_elf_size_dynamic_sections): ... here.
2047 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
2048 and set `mark' instead in `__tls_get_addr_opt' processing.
2049 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
2050
f0158f44
AM
20512017-01-24 Alan Modra <amodra@gmail.com>
2052
2053 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
2054 where dynamic relocs are preferable. Allow ifunc too.
2055 (ensure_undefweak_dynamic): New function.
2056 (allocate_dynrelocs): Use it here. Move plt handling last and
2057 don't make symbols dynamic, simplifying loop. Only make undef
2058 weak symbols with GOT entries dynamic. Correct condition
2059 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
2060 comments. Remove goto.
2061 (ppc_elf_relocate_section): Correct test for using dynamic
2062 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2063 to suit. Set up explicit tls_index entries and implicit GOT
2064 tls_index entries resolvable at link time for
2065 __tls_get_addr_opt. Simplify test to clear mem for prelink.
2066 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
2067 (ensure_undefweak_dynamic): New function.
2068 (allocate_dynrelocs): Use it here. Only make undef weak symbols
2069 with GOT entries dynamic. Remove unnecessary test of
2070 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
2071 (ppc64_elf_relocate_section): Correct test for using dynamic
2072 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2073 to suit. Set up explicit tls_index entries and implicit GOT
2074 tls_index entries resolvable at link time for __tls_get_addr_opt.
2075 Simplify expression to clear mem for prelink.
2076
2d0ca824
YN
20772017-01-23 Yury Norov <ynorov@caviumnetworks.com>
2078
2079 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
2080
7f784814
JW
20812017-01-20 Jiong Wang <jiong.wang@arm.com>
2082
2083 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
2084 (elf_backend_hash_symbol): Define.
2085
81ff47b3
MR
20862017-01-18 Maciej W. Rozycki <macro@imgtec.com>
2087
2088 PR ld/20828
2089 * elflink.c (bfd_elf_record_link_assignment): Clear any
2090 `forced_local' marking for DSO symbols that are not being
2091 provided.
2092
640d6bfd
KLC
20932017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2094
2095 * elfnn-riscv.c (riscv_elf_object_p): New function.
2096
8361ed4d
L
20972017-01-12 H.J. Lu <hongjiu.lu@intel.com>
2098
2099 PR ld/21038
2100 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
2101 plt_bnd_eh_frame.
2102 (elf_x86_64_check_relocs): Create .eh_frame section for the
2103 .plt.bnd section.
2104 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2105 .eh_frame section for the .plt.bnd section.
2106 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2107 for the .plt.bnd section.
2108
2425a30e
NC
21092017-01-12 Nick Clifton <nickc@redhat.com>
2110
2111 PR binutils/20876
2112 * opncls.c (find_separate_debug_file): Add include_dirs
2113 parameter. Only include the directory part of the bfd's filename
2114 in search paths if include_dirs is true. Add a couple of extra
2115 locations for looking for debug files.
2116 ( bfd_follow_gnu_debuglink): Update invocation of
2117 find_separate_debug_file.
2118 (bfd_follow_gnu_debugaltlink): Likewise.
2119 (get_build_id): New function: Finds the build-id of the given bfd.
2120 (get_build_id_name): New function: Computes the name of the
2121 separate debug info file for a bfd, based upon its build-id.
2122 (check_build_id_file): New function: Checks to see if a separate
2123 debug info file exists at the given location, and that its
2124 build-id matches that of the original bfd.
2125 (bfd_follow_build_id_debuglink): New function: Finds a separate
2126 debug info file for a given bfd by using the build-id method.
2127 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2128 method of locating a separate debug info file before using the
2129 debuglink method.
2130 * bfd-in2.h: Regenerate.
2131
9e659176
L
21322017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2133
2134 PR ld/21038
2135 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2136 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2137 elf_x86_64_eh_frame_plt_got.
2138 (elf_x86_64_size_dynamic_sections): Get unwind info from
2139 elf_x86_64_bnd_arch_bed for the BND PLT.
2140
f2e2d2f5
JS
21412017-01-11 Jeremy Soller <jackpot51@gmail.com>
2142
2143 * config.bfd: Add entries for i686-redox and x86_64-redox.
2144
52b232b3
L
21452017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2146
2147 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2148 to 4 bytes.
2149 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2150 .eh_frame section to 4 bytes for x32.
2151 (elf_x86_64_check_relocs): Likewise.
2152
fff53dae
L
21532017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2154
2155 PR ld/20830
2156 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2157 (PLT_GOT_FDE_LENGTH): Likewise.
2158 (elf_i386_plt_layout): Add eh_frame_plt_got and
2159 eh_frame_plt_got_size.
2160 (elf_i386_plt): Updated.
2161 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2162 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2163 (elf_i386_size_dynamic_sections): Allocate and initialize
2164 .eh_frame section for .plt.got.
2165 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2166 .plt.got.
2167 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2168 eh_frame_plt_got_size.
2169 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2170 (PLT_GOT_FDE_LENGTH): Likewise.
2171 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2172 eh_frame_plt_got_size.
2173 (elf_x86_64_arch_bed): Updated.
2174 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2175 eh_frame_plt_got_size.
2176 (elf_x86_64_nacl_arch_bed): Likewise.
2177 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2178 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2179 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2180 .eh_frame section for .plt.got.
2181 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2182 for .plt.got.
2183
f129e49f
L
21842017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2185
2186 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2187 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2188
cd6581da
NC
21892017-01-09 Nick Clifton <nickc@redhat.com>
2190
2191 * dwarf2.c (lookup_address_in_function_table): Return early if
2192 there are no functions in the given comp unit, or if the high
2193 address of the last function in the comp unit is less than the
2194 desired address.
2195
98f02962
NC
21962017-01-09 Nick Clifton <nickc@redhat.com>
2197
2198 PR binutils/21013
2199 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2200 message if there are too many symbols to load.
2201
ae4fda66
JC
22022017-01-04 James Clarke <jrtc27@jrtc27.com>
2203
2204 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2205 if relocs are cached.
2206
de1010f4
RF
22072017-01-03 Rich Felker <bugdal@aerifal.cx>
2208
2209 PR ld/21017
2210 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2211 for R_MICROBLAZE_GOTOFF_64.
2212
09fe2662
NC
22132017-01-03 Nick Clifton <nickc@redhat.com>
2214
2215 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2216 warning about using a possibly uninitialised variable.
2217
595e0a47
AM
22182017-01-02 Alan Modra <amodra@gmail.com>
2219
2220 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2221 (allocate_plt_static, allocate_dynrelocs): Use it.
2222
7bd9df3b
AM
22232017-01-02 Alan Modra <amodra@gmail.com>
2224
2225 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2226 .PARISC.unwind section.
2227
5b86074c
AM
22282017-01-02 Alan Modra <amodra@gmail.com>
2229
2230 PR ld/20989
2231 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2232 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2233 indirect to GOT pointer relative code edit.
2234
2571583a
AM
22352017-01-02 Alan Modra <amodra@gmail.com>
2236
2237 Update year range in copyright notice of all files.
2238
5c1ad6b5 2239For older changes see ChangeLog-2016
3499769a 2240\f
5c1ad6b5 2241Copyright (C) 2017 Free Software Foundation, Inc.
3499769a
AM
2242
2243Copying and distribution of this file, with or without modification,
2244are permitted in any medium without royalty provided the copyright
2245notice and this notice are preserved.
2246
2247Local Variables:
2248mode: change-log
2249left-margin: 8
2250fill-column: 74
2251version-control: never
2252End:
This page took 0.18993 seconds and 4 git commands to generate.