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