1 2020-12-15 Vivek Das Mohapatra <vivek@collabora.com>
3 Implement -z unique / -z nounique options.
4 * layout.cc (Layout::finish_dynamic_section): Set DF_GNU_1_UNIQUE.
5 * options.h (class General_options): Handle -z unique, -z nounique.
7 2020-12-14 H.J. Lu <hjl.tools@gmail.com>
8 Cary Coutant <ccoutant@gmail.com>
11 * layout.cc (Layout::layout): Strip SHF_GNU_RETAIN.
12 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize osabi_.
13 (Sized_relobj_file::do_layout): Keep SHF_GNU_RETAIN sections for
15 * object.h (Osabi) New class.
16 (Sized_relobj_file): Add osabi() and osabi_.
17 * testsuite/Makefile.am (check_SCRIPTS): Add retain.sh.
18 (check_DATA): Add retain_1.out retain_2.out.
19 (MOSTLYCLEANFILES): Add retain_1 retain_2.
20 (retain_1.out): New target.
22 (retain_1.o): Likewise.
23 (retain_2.out): Likewise.
25 (retain_2.o): Likewise.
26 * testsuite/Makefile.in: Regenerate.
27 * testsuite/retain.sh: New file.
28 * testsuite/retain_1.s: Likewise.
29 * testsuite/retain_2.s: Likewise.
31 2020-12-13 Cary Coutant <ccoutant@gmail.com>
35 * testsuite/Makefile.am (incremental_copy_test): Re-enable for GCC 9+.
36 (incremental_comdat_test_1): Likewise.
37 * testsuite/Makefile.in: Regenerate.
39 2020-12-13 Cary Coutant <ccoutant@gmail.com>
42 * object.cc (Sized_relobj_file::layout_gnu_property_section): Ignore
43 Gnu properties during incremental links.
45 2020-12-13 Cary Coutant <ccoutant@gmail.com>
48 * layout.cc (Layout::init_fixed_output_section): Mask out flags that
49 should be ignored when matching sections.
51 2020-12-07 Alan Modra <amodra@gmail.com>
53 * plugin.cc (Plugin_recorder::init): Replace strncpy with memcpy.
55 2020-12-03 Alan Modra <amodra@gmail.com>
57 * testsuite/Makefile.am (pr26936a.o): Pass -mx86-used-note=yes.
58 (pr26936b.o, pr26936c.o, pr26936d.o): Likewise.
59 * testsuite/Makefile.in: Regenerate.
61 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
64 * x86_64.cc (Output_data_plt_x86_64_ibt::tlsdesc_plt_entry): Add
66 (Output_data_plt_x86_64_ibt::do_fill_tlsdesc_entry): Adjusted.
68 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
71 * x86_64.cc (Target_x86_64<size>::Scan::local): Check
72 get_r_addend() == -4 for GOTPCRELX conversion.
73 (Target_x86_64<size>::Scan::global): Likewise.
74 (Target_x86_64<size>::Relocate::relocate): Likewise.
75 * testsuite/Makefile.am (check_DATA): Add
76 x86_64_mov_to_lea15.stdout and x86_64_mov_to_lea16.stdout.
77 (MOSTLYCLEANFILES): Add x86_64_mov_to_lea15 and
79 (x86_64_mov_to_lea9.o): New target.
80 (x86_64_mov_to_lea10.o): Likewise.
81 (x86_64_mov_to_lea15): Likewise.
82 (x86_64_mov_to_lea16): Likewise.
83 (x86_64_mov_to_lea15.stdout): Likewise.
84 (x86_64_mov_to_lea16.stdout): Likewise.
85 * testsuite/Makefile.in: Regenerated.
86 * testsuite/x86_64_mov_to_lea.sh: Updated.
87 * testsuite/x86_64_mov_to_lea5.s: New file.
89 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
92 * object.cc (Sized_relobj_file::map_to_kept_section): Get the
93 section index for linkonce section. Also check the single
95 * testsuite/Makefile.am (check_SCRIPTS): Add pr26936.sh.
96 (check_DATA): Add pr26936a.stdout and pr26936b.stdout.
97 (MOSTLYCLEANFILES): Add pr26936a and pr26936b.
98 (pr26936a.stdout): New target.
100 (pr26936b.stdout): Likewise.
101 (pr26936b): Likewise.
102 (pr26936a.o): Likewise.
103 (pr26936b.o): Likewise.
104 (pr26936c.o): Likewise.
105 (pr26936d.o): Likewise.
106 * testsuite/Makefile.in: Regenerated.
107 * testsuite/pr26936.sh: New file.
108 * testsuite/pr26936a.s: Likewise.
109 * testsuite/pr26936b.s: Likewise.
110 * testsuite/pr26936c.s: Likewise.
111 * testsuite/pr26936d.s: Likewise.
113 2020-11-17 Alan Modra <amodra@gmail.com>
115 * powerpc.cc (Target_powerpc::no_tprel_opt_): Rename from tprel_opt_.
117 (Target_powerpc::tprel_opt): Test parameters->options().tls_optimize().
118 (Target_powerpc::set_tprel_opt): Delete.
119 (Target_powerpc::set_no_tprel_opt): New function. Update all uses
122 2020-11-16 Michael Hudson-Doyle <michael.hudson@canonical.com>
125 * powerpc.cc (Relocate::relocate): Do not include local entry
126 offset of target function when computing the address of a stub.
128 2020-11-08 H.J. Lu <hongjiu.lu@intel.com>
131 * plugin.cc (Plugin_manager::claim_file): Don't share Plugin_list
133 (Plugin_manager::all_symbols_read): Likewise.
134 (Plugin_manager::cleanup): Likewise.
136 2020-11-03 Alan Modra <amodra@gmail.com>
138 * powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer.
139 (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error.
141 2020-11-03 Nick Gasson <nick.gasson@arm.com>
144 * fileread.cc (File_read::open): Ensure file_counts_lock is
146 * testsuite/Makefile.am (check_PROGRAMS): Add a test that passes
148 * testsuite/Makefile.in: Regenerate.
150 2020-10-30 H.J. Lu <hongjiu.lu@intel.com>
152 * testsuite/gnu_property_test.sh: Updated.
154 2020-10-22 H.J. Lu <hongjiu.lu@intel.com>
156 * Makefile.am (bootstrap-test): Skip for LTO build.
157 (bootstrap-test-r): Likewise.
159 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
162 * configure.ac: Check for GCC 9 or later and for -fcf-protection.
163 * configure: Regenerated.
164 * testsuite/Makefile.am (check_PROGRAMS): Skip incremental_test_2,
165 incremental_test_3, incremental_test_4, incremental_test_5,
166 incremental_copy_test, incremental_common_test_1 and
167 incremental_comdat_test_1 for -fcf-protection. Also Skip
168 incremental_copy_test and incremental_comdat_test_1 for GCC 9 or
170 * testsuite/Makefile.in: Regenerated.
172 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
175 * testsuite/Makefile.am (justsyms_lib): Pass
176 -T $(srcdir)/justsyms_lib.t to gold.
177 * testsuite/Makefile.in: Regenerated.
178 * testsuite/justsyms_lib.t: New file.
179 * testsuite/script_test_10.t: Discard .note.gnu.property section.
181 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
183 * x86_64.cc (Target_x86_64::Target_x86_64): Initialize
184 feature_2_used_, feature_2_needed_ and object_feature_2_used_.
185 (Target_x86_64::feature_2_used_): New data member.
186 (Target_x86_64::feature_2_needed_): Likewise.
187 (Target_x86_64::object_isa_1_used_): Likewise.
188 (Target_x86_64::record_gnu_property): Support
189 GNU_PROPERTY_X86_COMPAT_ISA_1_USED,
190 GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED,
191 GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED,
192 GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED,
193 GNU_PROPERTY_X86_FEATURE_2_USED and
194 GNU_PROPERTY_X86_FEATURE_2_NEEDED.
195 (Target_x86_64::merge_gnu_properties): Merge FEATURE_2_USED bits.
196 Initialize object_feature_2_used_.
197 (Target_x86_64::do_finalize_gnu_properties): Support
198 GNU_PROPERTY_X86_FEATURE_2_USED and
199 GNU_PROPERTY_X86_FEATURE_2_NEEDED.
200 * testsuite/gnu_property_a.S (GNU_PROPERTY_X86_ISA_1_USED): Set
202 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
203 * testsuite/gnu_property_b.S (GNU_PROPERTY_X86_ISA_1_USED): Set
205 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
206 * testsuite/gnu_property_c.S (GNU_PROPERTY_X86_ISA_1_USED): Set
208 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
209 * testsuite/gnu_property_test.sh: Updated.
211 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
215 * layout.cc (Layout::attach_allocated_section_to_segment): Place
216 a note section in a PT_NOTE segment with the same alignment. Set
217 the alignment of the PT_NOTE segment from the alignment of the
219 (Layout::create_note): Align the NT_GNU_PROPERTY_TYPE_0 note to 8
220 bytes for 64-bit ELF.
221 (Layout::segment_precedes): Place segments with larger alignments
223 * output.cc (Output_segment::Output_segment): Initialize align_.
224 * output.h (Output_segment): Add align, set_align and align_.
225 * testsuite/Makefile.am (gnu_property_test.stdout): Pass -lhSWn
227 (gnu_property_test): Pass --build-id to ld.
228 * testsuite/Makefile.in: Regenerated.
229 * testsuite/gnu_property_test.sh (check_alignment): New.
230 Use check_alignment to check the NT_GNU_PROPERTY_TYPE_0 note
231 alignment. Verify that there are 2 PT_NOTE segments.
233 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
236 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): Remove
237 check for shared library.
238 (Scan::global_reloc_may_be_function_pointer): Remove check for
239 shared library and symbol visibility.
240 * testsuite/icf_safe_so_test.cc (bar_static): New function.
241 (main): Take function address of bar_static and use it.
242 * testsuite/icf_safe_so_test.sh (arch_specific_safe_fold): Also
243 check fold on x86-64. Check bar_static isn't folded.
245 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
247 * icf.cc (Icf::find_identical_sections): Skip zero-sized sections.
249 2020-10-09 Alan Modra <amodra@gmail.com>
251 * powerpc.cc (Powerpc_relobj::do_relocate_sections): Don't do
252 local entry offset optimisation for lplt_section.
253 (Target_powerpc::Branch_info::make_stub): Don't add local
254 entry offset to long branch dest passed to
255 add_long_branch_entry. Do pass st_other bits.
256 (Stub_table::Branch_stub_ent): Add "other_" field.
257 (Stub_table::add_long_branch_entry): Add "other" param, and
259 (Stub_table::branch_stub_size): Adjust long branch offset.
260 (Stub_table::do_write): Likewise.
261 (Target_powerpc::Relocate::relocate): Likewise.
263 2020-10-09 Alan Modra <amodra@gmail.com>
265 * powerpc.cc (is_got_reloc): New function.
266 (Target_powerpc::Relocate::relocate): Use it here, exclude GOT
267 relocs when looking for stubs.
269 2020-10-08 H.J. Lu <hongjiu.lu@intel.com>
271 * testsuite/split_i386.sh: Updated for --split-stack-adjust-size
273 * testsuite/split_x86_64.sh: Likewise.
275 2020-10-08 Alan Modra <amodra@gmail.com>
277 * options.h (split_stack_adjust_size): Default to 0x100000.
279 2020-09-26 Alan Modra <amodra@gmail.com>
281 * powerpc.cc (Target_powerpc): Rename power10_stubs_ to
283 (Target_powerpc::set_power10_relocs): New accessor.
284 (Target_powerpc::set_power10_stubs): Delete.
285 (Target_powerpc::power10_stubs): Adjust.
286 (Target_powerpc::has_localentry0): New accessor.
287 (ld_0_11): New constant.
288 (glink_eh_frame_fde_64v1, glink_eh_frame_fde_64v2): Adjust.
289 (glink_eh_frame_fde_64v2_localentry0): New.
290 (Output_data_glink::pltresolve_size): Update.
291 (Output_data_glink::add_eh_frame): Use localentry0 version eh_frame.
292 (Output_data_glink::do_write): Move r2 save to start of ELFv2 stub
293 and only emit for has_localentry0. Don't use r2 in the stub.
294 (Target_powerpc::Scan::local, global): Adjust for
295 set_power10_relocs renaming.
296 (Target_powerpc::scan_relocs): Warn and reset plt_localentry0_.
298 2020-09-24 Alan Modra <amodra@gmail.com>
300 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't skip
301 first insn of __tls_get_addr_opt stub.
303 2020-08-24 Alan Modra <amodra@gmail.com>
305 * powerpc.cc (Target_powerpc): Add tprel_opt_ and accessors.
306 (Target_powerpc::Scan::local): Sanity check tprel high relocs.
307 (Target_powerpc::Scan::global): Likewise.
308 (Target_powerpc::Relocate::relocate): Control tprel optimisation
309 with tprel_opt_ and enable for 32-bit.
311 2020-08-12 Nick Clifton <nickc@redhat.com>
313 * po/sr.po: Updated Serbian translation.
315 2020-07-27 Alan Modra <amodra@gmail.com>
317 * options.h (DEFINE_enum): Add optional_arg__ param, adjust
319 (General_options): Add --power10-stubs and --no-power10-stubs.
320 * options.cc (General_options::parse_no_power10_stubs): New.
321 (General_options::finalize): Handle --power10-stubs.
322 * powerpc.cc (set_power10_stubs): Don't set when --power10-stubs=no.
323 (power10_stubs_auto): New.
324 (struct Plt_stub_ent): Add toc_ and tocoff_. Don't use a bitfield
326 (struct Branch_stub_ent): Add toc_and tocoff_. Use bitfields for
327 iter_, notoc_ and save_res_.
328 (add_plt_call_entry): Set toc_. Adjust resizing conditions for
329 --power10-stubs=auto.
330 (add_long_branch_entry): Set toc_.
331 (add_eh_frame, define_stub_syms): No longer use const_iterators
332 for plt and long branch stub iteration.
333 (build_tls_opt_head, build_tls_opt_tail): Change parameters and
334 return value. Move tests for __tls_get_addr to callers.
335 (plt_call_size): Handle --power10-stubs=auto.
336 (branch_stub_size): Likewise.
337 (Stub_table::do_write): Likewise.
338 (relocate): Likewise.
340 2020-07-19 H.J. Lu <hongjiu.lu@intel.com>
342 * testsuite/bnd_ifunc_1.sh: Updated.
343 * testsuite/bnd_plt_1.sh: Likewise.
344 * testsuite/split_x32.sh: Likewise.
345 * testsuite/split_x86_64.sh: Likewise.
346 * testsuite/x86_64_indirect_call_to_direct.sh: Likewise.
348 2020-07-08 Nick Clifton <nickc@redhat.com>
350 * testsuite/script_test_7.sh: Adjust expected address of the .bss
352 * testsuite/script_test_9.sh: Do not expect the .init section to
353 immediately follow the .text section in the mapping of sections to
356 2020-07-07 Nick Clifton <nickc@redhat.com>
358 * target-reloc.h: (Default_comdat_behaviour:get): Ignore discarded
359 relocs that refer to the .gnu.build.attributes section.
361 2020-07-06 Nick Clifton <nickc@redhat.com>
363 * po/fr.po: Updated French translation.
364 * po/uk.po: Updated Ukranian translation.
366 2020-07-04 Nick Clifton <nickc@redhat.com>
368 Binutils 2.35 branch created.
370 2020-07-03 Alan Modra <amodra@gmail.com>
373 * testsuite/Makefile.am (file_in_many_sections.stdout): Add -W
375 * testsuite/Makefile.in: Regenerate.
377 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
379 * configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
380 * configure: Regenerated.
381 * config.h.in: Likewise.
383 2020-06-24 Nick Clifton <nickc@redhat.com>
385 * target-reloc.h (issue_discarded_error): Initialise the
388 2020-06-23 Roland McGrath <mcgrathr@google.com>
391 * options.h (class General_options): Add --dependency-file option.
392 * fileread.cc (File_read::files_read): New static variable.
393 (File_read::open): Add the file to the files_read list.
394 (File_read::record_file_read): New static member function.
395 (File_read::write_dependency_file): New static member function.
396 * fileread.h (class File_read): Declare them.
397 * layout.cc (Layout::read_layout_from_file): Call record_file_read.
398 (Close_task_runner::run): Call write_dependency_file if
399 --dependency-file was passed.
401 2020-06-18 Fangrui Song <i@maskray.me>
404 * layout.cc (Layout::finish_dynamic_section): Set DF_1_PIE.
406 2020-06-16 Alan Modra <amodra@gmail.com>
408 * testsuite/discard_locals_test.c: Replace uses of asm with __asm__.
409 * testsuite/discard_locals_relocatable_test.c: Likewise.
411 2020-06-16 Alan Modra <amodra@gmail.com>
413 * testsuite/Makefile.am (export_dynamic_plugin.o): Use CXXCOMPILE.
414 (plugin_test_wrap_symbols_1.o): Likewise.
415 (plugin_test_wrap_symbols_2.o): Likewise.
416 * testsuite/Makefile.in: Regenerate.
418 2020-06-15 Roland McGrath <mcgrathr@google.com>
420 Implement -z start-stop-visibility=... option.
421 * options.h (class General_options): Handle -z start-stop-visibility=.
422 (General_options::start_stop_visibility_enum): New public method.
423 (General_options::set_start_stop_visibility_enum): New private method.
424 (General_options::start_stop_visibility_enum_): New private member.
425 * options.cc (General_options::General_options): Add initializer.
426 (General_options::finalize): Set this->start_stop_visibility_enum_
428 * layout.cc (Layout::define_section_symbols): Use option setting.
430 2020-06-06 Alan Modra <amodra@gmail.com>
432 * powerpc.cc: Update throughout for reloc renaming.
434 2020-05-22 Alan Modra <amodra@gmail.com>
437 * powerpc.cc (merge_object_attributes): Replace name param with
438 obj param. Update callers. Don't init FP attributes from shared
439 libraries, and do not emit an error if they don't match.
441 2020-05-15 Nikita Ermakov <coffe92@gmail.com>
443 * powerpc.cc (do_gc_mark_symbol): Don't segfault on plugin symbols.
445 2020-05-14 Nick Clifton <nickc@redhat.com>
447 * po/sr.po: New Serbian translation.
449 2020-05-11 Alan Modra <amodra@gmail.com>
451 * powerpc.cc: Rename powerxx to power10 throughout.
453 2020-05-02 H.J. Lu <hongjiu.lu@intel.com>
456 * testsuite/Makefile.am (COMMON_TEST_C_CFLAGS): New.
457 (common_test_1.o): New rule.
458 (common_test_2.o): Likewise.
459 (common_test_3.o): Likewise.
460 (plugin_common_test_1.o): Likewise.
461 (plugin_common_test_2.o): Likewise.
462 (common_test_1_v1.o): Likewise.
463 (common_test_1_v2.o): Likewise.
464 (common_test_2_pic.o): Compile with $(COMMON_TEST_C_CFLAGS).
465 (common_test_3_pic.o): Likewise.
466 * testsuite/Makefile.in: Regenerated.
468 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
471 * x86_64.cc (Target_x86_64<size>::Relocate::tls_desc_gd_to_ie):
472 For x32, relax "rex leal foo@tlsdesc(%rip), %reg" to
473 "rex movl foo@gottpoff(%rip), %eax" and relax ""call *(%eax)"
475 (Target_x86_64<size>::Relocate::tls_desc_gd_to_le): For x32,
476 relax "rex leal foo@tlsdesc(%rip), %reg" to
477 "rex movl foo@tpoff, %eax" and relax "call *foo@tlscall(%eax)"
479 * testsuite/Makefile.am (tls_test_gnu2.o): Depend on
481 (tls_test_file2_gnu2.o): Likewise.
482 (tls_test_c_gnu2.o): Likewise.
483 * testsuite/Makefile.in: Regenerated.
485 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
488 * x86_64.cc (Target_x86_64<size>::Relocate::tls_desc_gd_to_ie):
489 Properly check r8 - r15 in "lea foo@TLSDESC(%rip), %reg".
490 (Target_x86_64<size>::Relocate::tls_desc_gd_to_le): Properly
491 relax r8 - r15 in "lea foo@TLSDESC(%rip), %reg".
492 * testsuite/Makefile.am (check_SCRIPTS): Add x86_64_gd_to_le.sh.
493 (check_DATA): Add x86_64_gd_to_le.stdout.
494 (MOSTLYCLEANFILES): Add x86_64_gd_to_le.
495 (x86_64_gd_to_le.o): New target.
496 (x86_64_gd_to_le): Likewise.
497 (x86_64_gd_to_le.stdout): Likewise.
498 * testsuite/Makefile.in: Regenerated.
499 * testsuite/x86_64_gd_to_le.s: New file.
500 * testsuite/x86_64_gd_to_le.sh: Likewise.
502 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
504 * testsuite/odr_violation2.cc (Ordering::operator()): Make
505 expression even more complex.
507 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
509 * testsuite/ver_test_pr16504.sh: Updated.
511 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
514 * x86_64.cc (Output_data_plt_x86_64_bnd::do_write): Increment
515 plt_offset after setting the reserved TLSDESC PLT entry.
516 (Output_data_plt_x86_64_ibt<size>::do_write): Likewise.
518 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
521 * x86_64.cc (Output_data_plt_x86_64_bnd::do_address_for_local):
522 Handle local IFUNC symbol.
523 (Output_data_plt_x86_64_ibt::do_address_for_local): Likewise.
525 2020-03-19 Fangrui Song <maskray@google.com>
527 * options.h (General_options): Add --no-rosegment option.
529 2020-02-24 Nick Clifton <nickc@redhat.com>
531 * po/fr.po: Update French translation.
533 2020-01-20 Nick Clifton <nickc@redhat.com>
535 * po/uk.po: Updated Ukranian translation.
537 2020-01-18 Nick Clifton <nickc@redhat.com>
539 * configure: Regenerate.
540 * po/gold.pot: Regenerate.
542 2020-01-18 Nick Clifton <nickc@redhat.com>
544 Binutils 2.34 branch created.
546 2020-01-01 Alan Modra <amodra@gmail.com>
548 Update year range in copyright notice of all files.
550 For older changes see ChangeLog-2019
552 Copyright (C) 2020 Free Software Foundation, Inc.
554 Copying and distribution of this file, with or without modification,
555 are permitted in any medium without royalty provided the copyright
556 notice and this notice are preserved.
562 version-control: never