1 2020-12-13 Cary Coutant <ccoutant@gmail.com>
5 * testsuite/Makefile.am (incremental_copy_test): Re-enable for GCC 9+.
6 (incremental_comdat_test_1): Likewise.
7 * testsuite/Makefile.in: Regenerate.
9 2020-12-13 Cary Coutant <ccoutant@gmail.com>
12 * object.cc (Sized_relobj_file::layout_gnu_property_section): Ignore
13 Gnu properties during incremental links.
15 2020-12-13 Cary Coutant <ccoutant@gmail.com>
18 * layout.cc (Layout::init_fixed_output_section): Mask out flags that
19 should be ignored when matching sections.
21 2020-12-07 Alan Modra <amodra@gmail.com>
23 * plugin.cc (Plugin_recorder::init): Replace strncpy with memcpy.
25 2020-12-03 Alan Modra <amodra@gmail.com>
27 * testsuite/Makefile.am (pr26936a.o): Pass -mx86-used-note=yes.
28 (pr26936b.o, pr26936c.o, pr26936d.o): Likewise.
29 * testsuite/Makefile.in: Regenerate.
31 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
34 * x86_64.cc (Output_data_plt_x86_64_ibt::tlsdesc_plt_entry): Add
36 (Output_data_plt_x86_64_ibt::do_fill_tlsdesc_entry): Adjusted.
38 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
41 * x86_64.cc (Target_x86_64<size>::Scan::local): Check
42 get_r_addend() == -4 for GOTPCRELX conversion.
43 (Target_x86_64<size>::Scan::global): Likewise.
44 (Target_x86_64<size>::Relocate::relocate): Likewise.
45 * testsuite/Makefile.am (check_DATA): Add
46 x86_64_mov_to_lea15.stdout and x86_64_mov_to_lea16.stdout.
47 (MOSTLYCLEANFILES): Add x86_64_mov_to_lea15 and
49 (x86_64_mov_to_lea9.o): New target.
50 (x86_64_mov_to_lea10.o): Likewise.
51 (x86_64_mov_to_lea15): Likewise.
52 (x86_64_mov_to_lea16): Likewise.
53 (x86_64_mov_to_lea15.stdout): Likewise.
54 (x86_64_mov_to_lea16.stdout): Likewise.
55 * testsuite/Makefile.in: Regenerated.
56 * testsuite/x86_64_mov_to_lea.sh: Updated.
57 * testsuite/x86_64_mov_to_lea5.s: New file.
59 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
62 * object.cc (Sized_relobj_file::map_to_kept_section): Get the
63 section index for linkonce section. Also check the single
65 * testsuite/Makefile.am (check_SCRIPTS): Add pr26936.sh.
66 (check_DATA): Add pr26936a.stdout and pr26936b.stdout.
67 (MOSTLYCLEANFILES): Add pr26936a and pr26936b.
68 (pr26936a.stdout): New target.
70 (pr26936b.stdout): Likewise.
72 (pr26936a.o): Likewise.
73 (pr26936b.o): Likewise.
74 (pr26936c.o): Likewise.
75 (pr26936d.o): Likewise.
76 * testsuite/Makefile.in: Regenerated.
77 * testsuite/pr26936.sh: New file.
78 * testsuite/pr26936a.s: Likewise.
79 * testsuite/pr26936b.s: Likewise.
80 * testsuite/pr26936c.s: Likewise.
81 * testsuite/pr26936d.s: Likewise.
83 2020-11-17 Alan Modra <amodra@gmail.com>
85 * powerpc.cc (Target_powerpc::no_tprel_opt_): Rename from tprel_opt_.
87 (Target_powerpc::tprel_opt): Test parameters->options().tls_optimize().
88 (Target_powerpc::set_tprel_opt): Delete.
89 (Target_powerpc::set_no_tprel_opt): New function. Update all uses
92 2020-11-16 Michael Hudson-Doyle <michael.hudson@canonical.com>
95 * powerpc.cc (Relocate::relocate): Do not include local entry
96 offset of target function when computing the address of a stub.
98 2020-11-08 H.J. Lu <hongjiu.lu@intel.com>
101 * plugin.cc (Plugin_manager::claim_file): Don't share Plugin_list
103 (Plugin_manager::all_symbols_read): Likewise.
104 (Plugin_manager::cleanup): Likewise.
106 2020-11-03 Alan Modra <amodra@gmail.com>
108 * powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer.
109 (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error.
111 2020-11-03 Nick Gasson <nick.gasson@arm.com>
114 * fileread.cc (File_read::open): Ensure file_counts_lock is
116 * testsuite/Makefile.am (check_PROGRAMS): Add a test that passes
118 * testsuite/Makefile.in: Regenerate.
120 2020-10-30 H.J. Lu <hongjiu.lu@intel.com>
122 * testsuite/gnu_property_test.sh: Updated.
124 2020-10-22 H.J. Lu <hongjiu.lu@intel.com>
126 * Makefile.am (bootstrap-test): Skip for LTO build.
127 (bootstrap-test-r): Likewise.
129 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
132 * configure.ac: Check for GCC 9 or later and for -fcf-protection.
133 * configure: Regenerated.
134 * testsuite/Makefile.am (check_PROGRAMS): Skip incremental_test_2,
135 incremental_test_3, incremental_test_4, incremental_test_5,
136 incremental_copy_test, incremental_common_test_1 and
137 incremental_comdat_test_1 for -fcf-protection. Also Skip
138 incremental_copy_test and incremental_comdat_test_1 for GCC 9 or
140 * testsuite/Makefile.in: Regenerated.
142 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
145 * testsuite/Makefile.am (justsyms_lib): Pass
146 -T $(srcdir)/justsyms_lib.t to gold.
147 * testsuite/Makefile.in: Regenerated.
148 * testsuite/justsyms_lib.t: New file.
149 * testsuite/script_test_10.t: Discard .note.gnu.property section.
151 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
153 * x86_64.cc (Target_x86_64::Target_x86_64): Initialize
154 feature_2_used_, feature_2_needed_ and object_feature_2_used_.
155 (Target_x86_64::feature_2_used_): New data member.
156 (Target_x86_64::feature_2_needed_): Likewise.
157 (Target_x86_64::object_isa_1_used_): Likewise.
158 (Target_x86_64::record_gnu_property): Support
159 GNU_PROPERTY_X86_COMPAT_ISA_1_USED,
160 GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED,
161 GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED,
162 GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED,
163 GNU_PROPERTY_X86_FEATURE_2_USED and
164 GNU_PROPERTY_X86_FEATURE_2_NEEDED.
165 (Target_x86_64::merge_gnu_properties): Merge FEATURE_2_USED bits.
166 Initialize object_feature_2_used_.
167 (Target_x86_64::do_finalize_gnu_properties): Support
168 GNU_PROPERTY_X86_FEATURE_2_USED and
169 GNU_PROPERTY_X86_FEATURE_2_NEEDED.
170 * testsuite/gnu_property_a.S (GNU_PROPERTY_X86_ISA_1_USED): Set
172 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
173 * testsuite/gnu_property_b.S (GNU_PROPERTY_X86_ISA_1_USED): Set
175 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
176 * testsuite/gnu_property_c.S (GNU_PROPERTY_X86_ISA_1_USED): Set
178 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
179 * testsuite/gnu_property_test.sh: Updated.
181 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
185 * layout.cc (Layout::attach_allocated_section_to_segment): Place
186 a note section in a PT_NOTE segment with the same alignment. Set
187 the alignment of the PT_NOTE segment from the alignment of the
189 (Layout::create_note): Align the NT_GNU_PROPERTY_TYPE_0 note to 8
190 bytes for 64-bit ELF.
191 (Layout::segment_precedes): Place segments with larger alignments
193 * output.cc (Output_segment::Output_segment): Initialize align_.
194 * output.h (Output_segment): Add align, set_align and align_.
195 * testsuite/Makefile.am (gnu_property_test.stdout): Pass -lhSWn
197 (gnu_property_test): Pass --build-id to ld.
198 * testsuite/Makefile.in: Regenerated.
199 * testsuite/gnu_property_test.sh (check_alignment): New.
200 Use check_alignment to check the NT_GNU_PROPERTY_TYPE_0 note
201 alignment. Verify that there are 2 PT_NOTE segments.
203 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
206 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): Remove
207 check for shared library.
208 (Scan::global_reloc_may_be_function_pointer): Remove check for
209 shared library and symbol visibility.
210 * testsuite/icf_safe_so_test.cc (bar_static): New function.
211 (main): Take function address of bar_static and use it.
212 * testsuite/icf_safe_so_test.sh (arch_specific_safe_fold): Also
213 check fold on x86-64. Check bar_static isn't folded.
215 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
217 * icf.cc (Icf::find_identical_sections): Skip zero-sized sections.
219 2020-10-09 Alan Modra <amodra@gmail.com>
221 * powerpc.cc (Powerpc_relobj::do_relocate_sections): Don't do
222 local entry offset optimisation for lplt_section.
223 (Target_powerpc::Branch_info::make_stub): Don't add local
224 entry offset to long branch dest passed to
225 add_long_branch_entry. Do pass st_other bits.
226 (Stub_table::Branch_stub_ent): Add "other_" field.
227 (Stub_table::add_long_branch_entry): Add "other" param, and
229 (Stub_table::branch_stub_size): Adjust long branch offset.
230 (Stub_table::do_write): Likewise.
231 (Target_powerpc::Relocate::relocate): Likewise.
233 2020-10-09 Alan Modra <amodra@gmail.com>
235 * powerpc.cc (is_got_reloc): New function.
236 (Target_powerpc::Relocate::relocate): Use it here, exclude GOT
237 relocs when looking for stubs.
239 2020-10-08 H.J. Lu <hongjiu.lu@intel.com>
241 * testsuite/split_i386.sh: Updated for --split-stack-adjust-size
243 * testsuite/split_x86_64.sh: Likewise.
245 2020-10-08 Alan Modra <amodra@gmail.com>
247 * options.h (split_stack_adjust_size): Default to 0x100000.
249 2020-09-26 Alan Modra <amodra@gmail.com>
251 * powerpc.cc (Target_powerpc): Rename power10_stubs_ to
253 (Target_powerpc::set_power10_relocs): New accessor.
254 (Target_powerpc::set_power10_stubs): Delete.
255 (Target_powerpc::power10_stubs): Adjust.
256 (Target_powerpc::has_localentry0): New accessor.
257 (ld_0_11): New constant.
258 (glink_eh_frame_fde_64v1, glink_eh_frame_fde_64v2): Adjust.
259 (glink_eh_frame_fde_64v2_localentry0): New.
260 (Output_data_glink::pltresolve_size): Update.
261 (Output_data_glink::add_eh_frame): Use localentry0 version eh_frame.
262 (Output_data_glink::do_write): Move r2 save to start of ELFv2 stub
263 and only emit for has_localentry0. Don't use r2 in the stub.
264 (Target_powerpc::Scan::local, global): Adjust for
265 set_power10_relocs renaming.
266 (Target_powerpc::scan_relocs): Warn and reset plt_localentry0_.
268 2020-09-24 Alan Modra <amodra@gmail.com>
270 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't skip
271 first insn of __tls_get_addr_opt stub.
273 2020-08-24 Alan Modra <amodra@gmail.com>
275 * powerpc.cc (Target_powerpc): Add tprel_opt_ and accessors.
276 (Target_powerpc::Scan::local): Sanity check tprel high relocs.
277 (Target_powerpc::Scan::global): Likewise.
278 (Target_powerpc::Relocate::relocate): Control tprel optimisation
279 with tprel_opt_ and enable for 32-bit.
281 2020-08-12 Nick Clifton <nickc@redhat.com>
283 * po/sr.po: Updated Serbian translation.
285 2020-07-27 Alan Modra <amodra@gmail.com>
287 * options.h (DEFINE_enum): Add optional_arg__ param, adjust
289 (General_options): Add --power10-stubs and --no-power10-stubs.
290 * options.cc (General_options::parse_no_power10_stubs): New.
291 (General_options::finalize): Handle --power10-stubs.
292 * powerpc.cc (set_power10_stubs): Don't set when --power10-stubs=no.
293 (power10_stubs_auto): New.
294 (struct Plt_stub_ent): Add toc_ and tocoff_. Don't use a bitfield
296 (struct Branch_stub_ent): Add toc_and tocoff_. Use bitfields for
297 iter_, notoc_ and save_res_.
298 (add_plt_call_entry): Set toc_. Adjust resizing conditions for
299 --power10-stubs=auto.
300 (add_long_branch_entry): Set toc_.
301 (add_eh_frame, define_stub_syms): No longer use const_iterators
302 for plt and long branch stub iteration.
303 (build_tls_opt_head, build_tls_opt_tail): Change parameters and
304 return value. Move tests for __tls_get_addr to callers.
305 (plt_call_size): Handle --power10-stubs=auto.
306 (branch_stub_size): Likewise.
307 (Stub_table::do_write): Likewise.
308 (relocate): Likewise.
310 2020-07-19 H.J. Lu <hongjiu.lu@intel.com>
312 * testsuite/bnd_ifunc_1.sh: Updated.
313 * testsuite/bnd_plt_1.sh: Likewise.
314 * testsuite/split_x32.sh: Likewise.
315 * testsuite/split_x86_64.sh: Likewise.
316 * testsuite/x86_64_indirect_call_to_direct.sh: Likewise.
318 2020-07-08 Nick Clifton <nickc@redhat.com>
320 * testsuite/script_test_7.sh: Adjust expected address of the .bss
322 * testsuite/script_test_9.sh: Do not expect the .init section to
323 immediately follow the .text section in the mapping of sections to
326 2020-07-07 Nick Clifton <nickc@redhat.com>
328 * target-reloc.h: (Default_comdat_behaviour:get): Ignore discarded
329 relocs that refer to the .gnu.build.attributes section.
331 2020-07-06 Nick Clifton <nickc@redhat.com>
333 * po/fr.po: Updated French translation.
334 * po/uk.po: Updated Ukranian translation.
336 2020-07-04 Nick Clifton <nickc@redhat.com>
338 Binutils 2.35 branch created.
340 2020-07-03 Alan Modra <amodra@gmail.com>
343 * testsuite/Makefile.am (file_in_many_sections.stdout): Add -W
345 * testsuite/Makefile.in: Regenerate.
347 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
349 * configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
350 * configure: Regenerated.
351 * config.h.in: Likewise.
353 2020-06-24 Nick Clifton <nickc@redhat.com>
355 * target-reloc.h (issue_discarded_error): Initialise the
358 2020-06-23 Roland McGrath <mcgrathr@google.com>
361 * options.h (class General_options): Add --dependency-file option.
362 * fileread.cc (File_read::files_read): New static variable.
363 (File_read::open): Add the file to the files_read list.
364 (File_read::record_file_read): New static member function.
365 (File_read::write_dependency_file): New static member function.
366 * fileread.h (class File_read): Declare them.
367 * layout.cc (Layout::read_layout_from_file): Call record_file_read.
368 (Close_task_runner::run): Call write_dependency_file if
369 --dependency-file was passed.
371 2020-06-18 Fangrui Song <i@maskray.me>
374 * layout.cc (Layout::finish_dynamic_section): Set DF_1_PIE.
376 2020-06-16 Alan Modra <amodra@gmail.com>
378 * testsuite/discard_locals_test.c: Replace uses of asm with __asm__.
379 * testsuite/discard_locals_relocatable_test.c: Likewise.
381 2020-06-16 Alan Modra <amodra@gmail.com>
383 * testsuite/Makefile.am (export_dynamic_plugin.o): Use CXXCOMPILE.
384 (plugin_test_wrap_symbols_1.o): Likewise.
385 (plugin_test_wrap_symbols_2.o): Likewise.
386 * testsuite/Makefile.in: Regenerate.
388 2020-06-15 Roland McGrath <mcgrathr@google.com>
390 Implement -z start-stop-visibility=... option.
391 * options.h (class General_options): Handle -z start-stop-visibility=.
392 (General_options::start_stop_visibility_enum): New public method.
393 (General_options::set_start_stop_visibility_enum): New private method.
394 (General_options::start_stop_visibility_enum_): New private member.
395 * options.cc (General_options::General_options): Add initializer.
396 (General_options::finalize): Set this->start_stop_visibility_enum_
398 * layout.cc (Layout::define_section_symbols): Use option setting.
400 2020-06-06 Alan Modra <amodra@gmail.com>
402 * powerpc.cc: Update throughout for reloc renaming.
404 2020-05-22 Alan Modra <amodra@gmail.com>
407 * powerpc.cc (merge_object_attributes): Replace name param with
408 obj param. Update callers. Don't init FP attributes from shared
409 libraries, and do not emit an error if they don't match.
411 2020-05-15 Nikita Ermakov <coffe92@gmail.com>
413 * powerpc.cc (do_gc_mark_symbol): Don't segfault on plugin symbols.
415 2020-05-14 Nick Clifton <nickc@redhat.com>
417 * po/sr.po: New Serbian translation.
419 2020-05-11 Alan Modra <amodra@gmail.com>
421 * powerpc.cc: Rename powerxx to power10 throughout.
423 2020-05-02 H.J. Lu <hongjiu.lu@intel.com>
426 * testsuite/Makefile.am (COMMON_TEST_C_CFLAGS): New.
427 (common_test_1.o): New rule.
428 (common_test_2.o): Likewise.
429 (common_test_3.o): Likewise.
430 (plugin_common_test_1.o): Likewise.
431 (plugin_common_test_2.o): Likewise.
432 (common_test_1_v1.o): Likewise.
433 (common_test_1_v2.o): Likewise.
434 (common_test_2_pic.o): Compile with $(COMMON_TEST_C_CFLAGS).
435 (common_test_3_pic.o): Likewise.
436 * testsuite/Makefile.in: Regenerated.
438 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
441 * x86_64.cc (Target_x86_64<size>::Relocate::tls_desc_gd_to_ie):
442 For x32, relax "rex leal foo@tlsdesc(%rip), %reg" to
443 "rex movl foo@gottpoff(%rip), %eax" and relax ""call *(%eax)"
445 (Target_x86_64<size>::Relocate::tls_desc_gd_to_le): For x32,
446 relax "rex leal foo@tlsdesc(%rip), %reg" to
447 "rex movl foo@tpoff, %eax" and relax "call *foo@tlscall(%eax)"
449 * testsuite/Makefile.am (tls_test_gnu2.o): Depend on
451 (tls_test_file2_gnu2.o): Likewise.
452 (tls_test_c_gnu2.o): Likewise.
453 * testsuite/Makefile.in: Regenerated.
455 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
458 * x86_64.cc (Target_x86_64<size>::Relocate::tls_desc_gd_to_ie):
459 Properly check r8 - r15 in "lea foo@TLSDESC(%rip), %reg".
460 (Target_x86_64<size>::Relocate::tls_desc_gd_to_le): Properly
461 relax r8 - r15 in "lea foo@TLSDESC(%rip), %reg".
462 * testsuite/Makefile.am (check_SCRIPTS): Add x86_64_gd_to_le.sh.
463 (check_DATA): Add x86_64_gd_to_le.stdout.
464 (MOSTLYCLEANFILES): Add x86_64_gd_to_le.
465 (x86_64_gd_to_le.o): New target.
466 (x86_64_gd_to_le): Likewise.
467 (x86_64_gd_to_le.stdout): Likewise.
468 * testsuite/Makefile.in: Regenerated.
469 * testsuite/x86_64_gd_to_le.s: New file.
470 * testsuite/x86_64_gd_to_le.sh: Likewise.
472 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
474 * testsuite/odr_violation2.cc (Ordering::operator()): Make
475 expression even more complex.
477 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
479 * testsuite/ver_test_pr16504.sh: Updated.
481 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
484 * x86_64.cc (Output_data_plt_x86_64_bnd::do_write): Increment
485 plt_offset after setting the reserved TLSDESC PLT entry.
486 (Output_data_plt_x86_64_ibt<size>::do_write): Likewise.
488 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
491 * x86_64.cc (Output_data_plt_x86_64_bnd::do_address_for_local):
492 Handle local IFUNC symbol.
493 (Output_data_plt_x86_64_ibt::do_address_for_local): Likewise.
495 2020-03-19 Fangrui Song <maskray@google.com>
497 * options.h (General_options): Add --no-rosegment option.
499 2020-02-24 Nick Clifton <nickc@redhat.com>
501 * po/fr.po: Update French translation.
503 2020-01-20 Nick Clifton <nickc@redhat.com>
505 * po/uk.po: Updated Ukranian translation.
507 2020-01-18 Nick Clifton <nickc@redhat.com>
509 * configure: Regenerate.
510 * po/gold.pot: Regenerate.
512 2020-01-18 Nick Clifton <nickc@redhat.com>
514 Binutils 2.34 branch created.
516 2020-01-01 Alan Modra <amodra@gmail.com>
518 Update year range in copyright notice of all files.
520 For older changes see ChangeLog-2019
522 Copyright (C) 2020 Free Software Foundation, Inc.
524 Copying and distribution of this file, with or without modification,
525 are permitted in any medium without royalty provided the copyright
526 notice and this notice are preserved.
532 version-control: never