1 2020-12-15 Cary Coutant <ccoutant@gmail.com>
3 * dwp.cc (class Dwo_file): Use new Ehdr::get_ei_osabi and
4 get_ei_abiversion methods.
5 * incremental.cc (make_sized_incremental_binary): Likewise.
6 * object.cc (Sized_relobj_file::Sized_relobj_file): Likewise.
7 (make_elf_sized_object): Likewise.
8 * object.h (class Osabi): Make the class untemplated.
10 2020-12-15 Vivek Das Mohapatra <vivek@collabora.com>
12 Implement -z unique / -z nounique options.
13 * layout.cc (Layout::finish_dynamic_section): Set DF_GNU_1_UNIQUE.
14 * options.h (class General_options): Handle -z unique, -z nounique.
16 2020-12-14 H.J. Lu <hjl.tools@gmail.com>
17 Cary Coutant <ccoutant@gmail.com>
20 * layout.cc (Layout::layout): Strip SHF_GNU_RETAIN.
21 * object.cc (Sized_relobj_file::Sized_relobj_file): Initialize osabi_.
22 (Sized_relobj_file::do_layout): Keep SHF_GNU_RETAIN sections for
24 * object.h (Osabi) New class.
25 (Sized_relobj_file): Add osabi() and osabi_.
26 * testsuite/Makefile.am (check_SCRIPTS): Add retain.sh.
27 (check_DATA): Add retain_1.out retain_2.out.
28 (MOSTLYCLEANFILES): Add retain_1 retain_2.
29 (retain_1.out): New target.
31 (retain_1.o): Likewise.
32 (retain_2.out): Likewise.
34 (retain_2.o): Likewise.
35 * testsuite/Makefile.in: Regenerate.
36 * testsuite/retain.sh: New file.
37 * testsuite/retain_1.s: Likewise.
38 * testsuite/retain_2.s: Likewise.
40 2020-12-13 Cary Coutant <ccoutant@gmail.com>
44 * testsuite/Makefile.am (incremental_copy_test): Re-enable for GCC 9+.
45 (incremental_comdat_test_1): Likewise.
46 * testsuite/Makefile.in: Regenerate.
48 2020-12-13 Cary Coutant <ccoutant@gmail.com>
51 * object.cc (Sized_relobj_file::layout_gnu_property_section): Ignore
52 Gnu properties during incremental links.
54 2020-12-13 Cary Coutant <ccoutant@gmail.com>
57 * layout.cc (Layout::init_fixed_output_section): Mask out flags that
58 should be ignored when matching sections.
60 2020-12-07 Alan Modra <amodra@gmail.com>
62 * plugin.cc (Plugin_recorder::init): Replace strncpy with memcpy.
64 2020-12-03 Alan Modra <amodra@gmail.com>
66 * testsuite/Makefile.am (pr26936a.o): Pass -mx86-used-note=yes.
67 (pr26936b.o, pr26936c.o, pr26936d.o): Likewise.
68 * testsuite/Makefile.in: Regenerate.
70 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
73 * x86_64.cc (Output_data_plt_x86_64_ibt::tlsdesc_plt_entry): Add
75 (Output_data_plt_x86_64_ibt::do_fill_tlsdesc_entry): Adjusted.
77 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
80 * x86_64.cc (Target_x86_64<size>::Scan::local): Check
81 get_r_addend() == -4 for GOTPCRELX conversion.
82 (Target_x86_64<size>::Scan::global): Likewise.
83 (Target_x86_64<size>::Relocate::relocate): Likewise.
84 * testsuite/Makefile.am (check_DATA): Add
85 x86_64_mov_to_lea15.stdout and x86_64_mov_to_lea16.stdout.
86 (MOSTLYCLEANFILES): Add x86_64_mov_to_lea15 and
88 (x86_64_mov_to_lea9.o): New target.
89 (x86_64_mov_to_lea10.o): Likewise.
90 (x86_64_mov_to_lea15): Likewise.
91 (x86_64_mov_to_lea16): Likewise.
92 (x86_64_mov_to_lea15.stdout): Likewise.
93 (x86_64_mov_to_lea16.stdout): Likewise.
94 * testsuite/Makefile.in: Regenerated.
95 * testsuite/x86_64_mov_to_lea.sh: Updated.
96 * testsuite/x86_64_mov_to_lea5.s: New file.
98 2020-11-29 H.J. Lu <hongjiu.lu@intel.com>
101 * object.cc (Sized_relobj_file::map_to_kept_section): Get the
102 section index for linkonce section. Also check the single
104 * testsuite/Makefile.am (check_SCRIPTS): Add pr26936.sh.
105 (check_DATA): Add pr26936a.stdout and pr26936b.stdout.
106 (MOSTLYCLEANFILES): Add pr26936a and pr26936b.
107 (pr26936a.stdout): New target.
108 (pr26936a): Likewise.
109 (pr26936b.stdout): Likewise.
110 (pr26936b): Likewise.
111 (pr26936a.o): Likewise.
112 (pr26936b.o): Likewise.
113 (pr26936c.o): Likewise.
114 (pr26936d.o): Likewise.
115 * testsuite/Makefile.in: Regenerated.
116 * testsuite/pr26936.sh: New file.
117 * testsuite/pr26936a.s: Likewise.
118 * testsuite/pr26936b.s: Likewise.
119 * testsuite/pr26936c.s: Likewise.
120 * testsuite/pr26936d.s: Likewise.
122 2020-11-17 Alan Modra <amodra@gmail.com>
124 * powerpc.cc (Target_powerpc::no_tprel_opt_): Rename from tprel_opt_.
126 (Target_powerpc::tprel_opt): Test parameters->options().tls_optimize().
127 (Target_powerpc::set_tprel_opt): Delete.
128 (Target_powerpc::set_no_tprel_opt): New function. Update all uses
131 2020-11-16 Michael Hudson-Doyle <michael.hudson@canonical.com>
134 * powerpc.cc (Relocate::relocate): Do not include local entry
135 offset of target function when computing the address of a stub.
137 2020-11-08 H.J. Lu <hongjiu.lu@intel.com>
140 * plugin.cc (Plugin_manager::claim_file): Don't share Plugin_list
142 (Plugin_manager::all_symbols_read): Likewise.
143 (Plugin_manager::cleanup): Likewise.
145 2020-11-03 Alan Modra <amodra@gmail.com>
147 * powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer.
148 (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error.
150 2020-11-03 Nick Gasson <nick.gasson@arm.com>
153 * fileread.cc (File_read::open): Ensure file_counts_lock is
155 * testsuite/Makefile.am (check_PROGRAMS): Add a test that passes
157 * testsuite/Makefile.in: Regenerate.
159 2020-10-30 H.J. Lu <hongjiu.lu@intel.com>
161 * testsuite/gnu_property_test.sh: Updated.
163 2020-10-22 H.J. Lu <hongjiu.lu@intel.com>
165 * Makefile.am (bootstrap-test): Skip for LTO build.
166 (bootstrap-test-r): Likewise.
168 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
171 * configure.ac: Check for GCC 9 or later and for -fcf-protection.
172 * configure: Regenerated.
173 * testsuite/Makefile.am (check_PROGRAMS): Skip incremental_test_2,
174 incremental_test_3, incremental_test_4, incremental_test_5,
175 incremental_copy_test, incremental_common_test_1 and
176 incremental_comdat_test_1 for -fcf-protection. Also Skip
177 incremental_copy_test and incremental_comdat_test_1 for GCC 9 or
179 * testsuite/Makefile.in: Regenerated.
181 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
184 * testsuite/Makefile.am (justsyms_lib): Pass
185 -T $(srcdir)/justsyms_lib.t to gold.
186 * testsuite/Makefile.in: Regenerated.
187 * testsuite/justsyms_lib.t: New file.
188 * testsuite/script_test_10.t: Discard .note.gnu.property section.
190 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
192 * x86_64.cc (Target_x86_64::Target_x86_64): Initialize
193 feature_2_used_, feature_2_needed_ and object_feature_2_used_.
194 (Target_x86_64::feature_2_used_): New data member.
195 (Target_x86_64::feature_2_needed_): Likewise.
196 (Target_x86_64::object_isa_1_used_): Likewise.
197 (Target_x86_64::record_gnu_property): Support
198 GNU_PROPERTY_X86_COMPAT_ISA_1_USED,
199 GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED,
200 GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED,
201 GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED,
202 GNU_PROPERTY_X86_FEATURE_2_USED and
203 GNU_PROPERTY_X86_FEATURE_2_NEEDED.
204 (Target_x86_64::merge_gnu_properties): Merge FEATURE_2_USED bits.
205 Initialize object_feature_2_used_.
206 (Target_x86_64::do_finalize_gnu_properties): Support
207 GNU_PROPERTY_X86_FEATURE_2_USED and
208 GNU_PROPERTY_X86_FEATURE_2_NEEDED.
209 * testsuite/gnu_property_a.S (GNU_PROPERTY_X86_ISA_1_USED): Set
211 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
212 * testsuite/gnu_property_b.S (GNU_PROPERTY_X86_ISA_1_USED): Set
214 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
215 * testsuite/gnu_property_c.S (GNU_PROPERTY_X86_ISA_1_USED): Set
217 (GNU_PROPERTY_X86_ISA_1_NEEDED): Set to 0xc0008002.
218 * testsuite/gnu_property_test.sh: Updated.
220 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
224 * layout.cc (Layout::attach_allocated_section_to_segment): Place
225 a note section in a PT_NOTE segment with the same alignment. Set
226 the alignment of the PT_NOTE segment from the alignment of the
228 (Layout::create_note): Align the NT_GNU_PROPERTY_TYPE_0 note to 8
229 bytes for 64-bit ELF.
230 (Layout::segment_precedes): Place segments with larger alignments
232 * output.cc (Output_segment::Output_segment): Initialize align_.
233 * output.h (Output_segment): Add align, set_align and align_.
234 * testsuite/Makefile.am (gnu_property_test.stdout): Pass -lhSWn
236 (gnu_property_test): Pass --build-id to ld.
237 * testsuite/Makefile.in: Regenerated.
238 * testsuite/gnu_property_test.sh (check_alignment): New.
239 Use check_alignment to check the NT_GNU_PROPERTY_TYPE_0 note
240 alignment. Verify that there are 2 PT_NOTE segments.
242 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
245 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): Remove
246 check for shared library.
247 (Scan::global_reloc_may_be_function_pointer): Remove check for
248 shared library and symbol visibility.
249 * testsuite/icf_safe_so_test.cc (bar_static): New function.
250 (main): Take function address of bar_static and use it.
251 * testsuite/icf_safe_so_test.sh (arch_specific_safe_fold): Also
252 check fold on x86-64. Check bar_static isn't folded.
254 2020-10-13 H.J. Lu <hongjiu.lu@intel.com>
256 * icf.cc (Icf::find_identical_sections): Skip zero-sized sections.
258 2020-10-09 Alan Modra <amodra@gmail.com>
260 * powerpc.cc (Powerpc_relobj::do_relocate_sections): Don't do
261 local entry offset optimisation for lplt_section.
262 (Target_powerpc::Branch_info::make_stub): Don't add local
263 entry offset to long branch dest passed to
264 add_long_branch_entry. Do pass st_other bits.
265 (Stub_table::Branch_stub_ent): Add "other_" field.
266 (Stub_table::add_long_branch_entry): Add "other" param, and
268 (Stub_table::branch_stub_size): Adjust long branch offset.
269 (Stub_table::do_write): Likewise.
270 (Target_powerpc::Relocate::relocate): Likewise.
272 2020-10-09 Alan Modra <amodra@gmail.com>
274 * powerpc.cc (is_got_reloc): New function.
275 (Target_powerpc::Relocate::relocate): Use it here, exclude GOT
276 relocs when looking for stubs.
278 2020-10-08 H.J. Lu <hongjiu.lu@intel.com>
280 * testsuite/split_i386.sh: Updated for --split-stack-adjust-size
282 * testsuite/split_x86_64.sh: Likewise.
284 2020-10-08 Alan Modra <amodra@gmail.com>
286 * options.h (split_stack_adjust_size): Default to 0x100000.
288 2020-09-26 Alan Modra <amodra@gmail.com>
290 * powerpc.cc (Target_powerpc): Rename power10_stubs_ to
292 (Target_powerpc::set_power10_relocs): New accessor.
293 (Target_powerpc::set_power10_stubs): Delete.
294 (Target_powerpc::power10_stubs): Adjust.
295 (Target_powerpc::has_localentry0): New accessor.
296 (ld_0_11): New constant.
297 (glink_eh_frame_fde_64v1, glink_eh_frame_fde_64v2): Adjust.
298 (glink_eh_frame_fde_64v2_localentry0): New.
299 (Output_data_glink::pltresolve_size): Update.
300 (Output_data_glink::add_eh_frame): Use localentry0 version eh_frame.
301 (Output_data_glink::do_write): Move r2 save to start of ELFv2 stub
302 and only emit for has_localentry0. Don't use r2 in the stub.
303 (Target_powerpc::Scan::local, global): Adjust for
304 set_power10_relocs renaming.
305 (Target_powerpc::scan_relocs): Warn and reset plt_localentry0_.
307 2020-09-24 Alan Modra <amodra@gmail.com>
309 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't skip
310 first insn of __tls_get_addr_opt stub.
312 2020-08-24 Alan Modra <amodra@gmail.com>
314 * powerpc.cc (Target_powerpc): Add tprel_opt_ and accessors.
315 (Target_powerpc::Scan::local): Sanity check tprel high relocs.
316 (Target_powerpc::Scan::global): Likewise.
317 (Target_powerpc::Relocate::relocate): Control tprel optimisation
318 with tprel_opt_ and enable for 32-bit.
320 2020-08-12 Nick Clifton <nickc@redhat.com>
322 * po/sr.po: Updated Serbian translation.
324 2020-07-27 Alan Modra <amodra@gmail.com>
326 * options.h (DEFINE_enum): Add optional_arg__ param, adjust
328 (General_options): Add --power10-stubs and --no-power10-stubs.
329 * options.cc (General_options::parse_no_power10_stubs): New.
330 (General_options::finalize): Handle --power10-stubs.
331 * powerpc.cc (set_power10_stubs): Don't set when --power10-stubs=no.
332 (power10_stubs_auto): New.
333 (struct Plt_stub_ent): Add toc_ and tocoff_. Don't use a bitfield
335 (struct Branch_stub_ent): Add toc_and tocoff_. Use bitfields for
336 iter_, notoc_ and save_res_.
337 (add_plt_call_entry): Set toc_. Adjust resizing conditions for
338 --power10-stubs=auto.
339 (add_long_branch_entry): Set toc_.
340 (add_eh_frame, define_stub_syms): No longer use const_iterators
341 for plt and long branch stub iteration.
342 (build_tls_opt_head, build_tls_opt_tail): Change parameters and
343 return value. Move tests for __tls_get_addr to callers.
344 (plt_call_size): Handle --power10-stubs=auto.
345 (branch_stub_size): Likewise.
346 (Stub_table::do_write): Likewise.
347 (relocate): Likewise.
349 2020-07-19 H.J. Lu <hongjiu.lu@intel.com>
351 * testsuite/bnd_ifunc_1.sh: Updated.
352 * testsuite/bnd_plt_1.sh: Likewise.
353 * testsuite/split_x32.sh: Likewise.
354 * testsuite/split_x86_64.sh: Likewise.
355 * testsuite/x86_64_indirect_call_to_direct.sh: Likewise.
357 2020-07-08 Nick Clifton <nickc@redhat.com>
359 * testsuite/script_test_7.sh: Adjust expected address of the .bss
361 * testsuite/script_test_9.sh: Do not expect the .init section to
362 immediately follow the .text section in the mapping of sections to
365 2020-07-07 Nick Clifton <nickc@redhat.com>
367 * target-reloc.h: (Default_comdat_behaviour:get): Ignore discarded
368 relocs that refer to the .gnu.build.attributes section.
370 2020-07-06 Nick Clifton <nickc@redhat.com>
372 * po/fr.po: Updated French translation.
373 * po/uk.po: Updated Ukranian translation.
375 2020-07-04 Nick Clifton <nickc@redhat.com>
377 Binutils 2.35 branch created.
379 2020-07-03 Alan Modra <amodra@gmail.com>
382 * testsuite/Makefile.am (file_in_many_sections.stdout): Add -W
384 * testsuite/Makefile.in: Regenerate.
386 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
388 * configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
389 * configure: Regenerated.
390 * config.h.in: Likewise.
392 2020-06-24 Nick Clifton <nickc@redhat.com>
394 * target-reloc.h (issue_discarded_error): Initialise the
397 2020-06-23 Roland McGrath <mcgrathr@google.com>
400 * options.h (class General_options): Add --dependency-file option.
401 * fileread.cc (File_read::files_read): New static variable.
402 (File_read::open): Add the file to the files_read list.
403 (File_read::record_file_read): New static member function.
404 (File_read::write_dependency_file): New static member function.
405 * fileread.h (class File_read): Declare them.
406 * layout.cc (Layout::read_layout_from_file): Call record_file_read.
407 (Close_task_runner::run): Call write_dependency_file if
408 --dependency-file was passed.
410 2020-06-18 Fangrui Song <i@maskray.me>
413 * layout.cc (Layout::finish_dynamic_section): Set DF_1_PIE.
415 2020-06-16 Alan Modra <amodra@gmail.com>
417 * testsuite/discard_locals_test.c: Replace uses of asm with __asm__.
418 * testsuite/discard_locals_relocatable_test.c: Likewise.
420 2020-06-16 Alan Modra <amodra@gmail.com>
422 * testsuite/Makefile.am (export_dynamic_plugin.o): Use CXXCOMPILE.
423 (plugin_test_wrap_symbols_1.o): Likewise.
424 (plugin_test_wrap_symbols_2.o): Likewise.
425 * testsuite/Makefile.in: Regenerate.
427 2020-06-15 Roland McGrath <mcgrathr@google.com>
429 Implement -z start-stop-visibility=... option.
430 * options.h (class General_options): Handle -z start-stop-visibility=.
431 (General_options::start_stop_visibility_enum): New public method.
432 (General_options::set_start_stop_visibility_enum): New private method.
433 (General_options::start_stop_visibility_enum_): New private member.
434 * options.cc (General_options::General_options): Add initializer.
435 (General_options::finalize): Set this->start_stop_visibility_enum_
437 * layout.cc (Layout::define_section_symbols): Use option setting.
439 2020-06-06 Alan Modra <amodra@gmail.com>
441 * powerpc.cc: Update throughout for reloc renaming.
443 2020-05-22 Alan Modra <amodra@gmail.com>
446 * powerpc.cc (merge_object_attributes): Replace name param with
447 obj param. Update callers. Don't init FP attributes from shared
448 libraries, and do not emit an error if they don't match.
450 2020-05-15 Nikita Ermakov <coffe92@gmail.com>
452 * powerpc.cc (do_gc_mark_symbol): Don't segfault on plugin symbols.
454 2020-05-14 Nick Clifton <nickc@redhat.com>
456 * po/sr.po: New Serbian translation.
458 2020-05-11 Alan Modra <amodra@gmail.com>
460 * powerpc.cc: Rename powerxx to power10 throughout.
462 2020-05-02 H.J. Lu <hongjiu.lu@intel.com>
465 * testsuite/Makefile.am (COMMON_TEST_C_CFLAGS): New.
466 (common_test_1.o): New rule.
467 (common_test_2.o): Likewise.
468 (common_test_3.o): Likewise.
469 (plugin_common_test_1.o): Likewise.
470 (plugin_common_test_2.o): Likewise.
471 (common_test_1_v1.o): Likewise.
472 (common_test_1_v2.o): Likewise.
473 (common_test_2_pic.o): Compile with $(COMMON_TEST_C_CFLAGS).
474 (common_test_3_pic.o): Likewise.
475 * testsuite/Makefile.in: Regenerated.
477 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
480 * x86_64.cc (Target_x86_64<size>::Relocate::tls_desc_gd_to_ie):
481 For x32, relax "rex leal foo@tlsdesc(%rip), %reg" to
482 "rex movl foo@gottpoff(%rip), %eax" and relax ""call *(%eax)"
484 (Target_x86_64<size>::Relocate::tls_desc_gd_to_le): For x32,
485 relax "rex leal foo@tlsdesc(%rip), %reg" to
486 "rex movl foo@tpoff, %eax" and relax "call *foo@tlscall(%eax)"
488 * testsuite/Makefile.am (tls_test_gnu2.o): Depend on
490 (tls_test_file2_gnu2.o): Likewise.
491 (tls_test_c_gnu2.o): Likewise.
492 * testsuite/Makefile.in: Regenerated.
494 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
497 * x86_64.cc (Target_x86_64<size>::Relocate::tls_desc_gd_to_ie):
498 Properly check r8 - r15 in "lea foo@TLSDESC(%rip), %reg".
499 (Target_x86_64<size>::Relocate::tls_desc_gd_to_le): Properly
500 relax r8 - r15 in "lea foo@TLSDESC(%rip), %reg".
501 * testsuite/Makefile.am (check_SCRIPTS): Add x86_64_gd_to_le.sh.
502 (check_DATA): Add x86_64_gd_to_le.stdout.
503 (MOSTLYCLEANFILES): Add x86_64_gd_to_le.
504 (x86_64_gd_to_le.o): New target.
505 (x86_64_gd_to_le): Likewise.
506 (x86_64_gd_to_le.stdout): Likewise.
507 * testsuite/Makefile.in: Regenerated.
508 * testsuite/x86_64_gd_to_le.s: New file.
509 * testsuite/x86_64_gd_to_le.sh: Likewise.
511 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
513 * testsuite/odr_violation2.cc (Ordering::operator()): Make
514 expression even more complex.
516 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
518 * testsuite/ver_test_pr16504.sh: Updated.
520 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
523 * x86_64.cc (Output_data_plt_x86_64_bnd::do_write): Increment
524 plt_offset after setting the reserved TLSDESC PLT entry.
525 (Output_data_plt_x86_64_ibt<size>::do_write): Likewise.
527 2020-05-01 H.J. Lu <hongjiu.lu@intel.com>
530 * x86_64.cc (Output_data_plt_x86_64_bnd::do_address_for_local):
531 Handle local IFUNC symbol.
532 (Output_data_plt_x86_64_ibt::do_address_for_local): Likewise.
534 2020-03-19 Fangrui Song <maskray@google.com>
536 * options.h (General_options): Add --no-rosegment option.
538 2020-02-24 Nick Clifton <nickc@redhat.com>
540 * po/fr.po: Update French translation.
542 2020-01-20 Nick Clifton <nickc@redhat.com>
544 * po/uk.po: Updated Ukranian translation.
546 2020-01-18 Nick Clifton <nickc@redhat.com>
548 * configure: Regenerate.
549 * po/gold.pot: Regenerate.
551 2020-01-18 Nick Clifton <nickc@redhat.com>
553 Binutils 2.34 branch created.
555 2020-01-01 Alan Modra <amodra@gmail.com>
557 Update year range in copyright notice of all files.
559 For older changes see ChangeLog-2019
561 Copyright (C) 2020 Free Software Foundation, Inc.
563 Copying and distribution of this file, with or without modification,
564 are permitted in any medium without royalty provided the copyright
565 notice and this notice are preserved.
571 version-control: never