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