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