Fix problem where gold does not create base version for executables.
[external/binutils.git] / gold / ChangeLog
1 2018-06-20  Cary Coutant  <ccoutant@gmail.com>
2
3         PR gold/23268
4         * dynobj.cc (Versions::Versions): Change init for needs_base_version_.
5         (Versions::record_version): Add verdefs for both shared objects and
6         executables.
7         (Versions::add_def): Likewise for base version.
8         (Versions::add_need): Don't add base version for executables.
9         (Versions::version_index): Look up version for both shared objects and
10         executables.
11         * testsuite/Makefile.am (ver_test_14): New test case.
12         * testsuite/Makefile.in: Regenerate.
13         * testsuite/ver_test_14.script: New version script.
14         * testsuite/ver_test_14.sh: New test script.
15
16 2018-06-19  Joshua Watt  <jpewhacker@gmail.com>
17             Cary Coutant  <ccoutant@gmail.com>
18
19         * configure.ac: Replace manual thread configuration with AX_PTHREAD.
20         Add --enable-threads=auto.
21         * Makefile.am (THREADFLAGS, THREADLIBS): New defines.
22         (AM_CFLAGS, AM_CXXFLAGS): Add $(THREADFLAGS).
23         (THREADSLIB): Remove; change all references to THREADLIBS.
24         * Makefile.in: Regenerate.
25         * aclocal.m4: Regenerate.
26         * config.in: Regenerate.
27         * configure: Regenerate.
28         * testsuite/Makefile.am (THREADSLIB): Replace with...
29         (THREADFLAGS, THREADLIBS): ... these.
30         (LDADD): Remove; add as individual defines for...
31         (object_unittest, binary_unittest, leb128_unittest)
32         (overflow_unittest): ... these tests.
33         (tls_test, tls_pic_test, tls_pie_test, tls_pie_pic_test)
34         (tls_shared_test, tls_shared_ie_test, tls_shared_gd_to_ie_test)
35         (tls_shared_gnu2_gd_to_ie_test, tls_shared_gnu2_test_LDFLAGS)
36         (tls_shared_nonpic_test_LDFLAGS): Add $(THREADFLAGS) and ($THREADLIBS).
37         * testsuite/Makefile.in: Regenerate.
38
39 2018-06-19  Cary Coutant  <ccoutant@gmail.com>
40
41         * testsuite/Makefile.am (MOSTLYCLEANFILES): Add *.stderr.
42         * testsuite/Makefile.in: Regenerate.
43
44 2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>
45
46         * configure.ac: Remove AC_PREREQ, add missing quoting and usage
47         of AC_LANG_SOURCE.
48         * Makefile.in: Re-generate.
49         * aclocal.m4: Re-generate.
50         * configure: Re-generate.
51         * testsuite/Makefile.in: Re-generate.
52
53 2018-05-10  Stephen Crane  <sjc@immunant.com>
54
55         * aarch64.cc (Target_aarch64::do_finalize_sections): Use size of
56         .got section for the _GLOBAL_OFFSET_TABLE_ symbol computation.
57
58 2018-04-24  Cary Coutant  <ccoutant@gmail.com>
59
60         PR gold/20642
61         PR gold/22820
62         * gc.h (gc_process_relocs): Flag STT_SECTION symbols in symvec.
63         * icf.cc (get_section_contents): For merge sections, ignore the
64         addend for relocations against non-section symbols.
65
66 2018-04-24  Cary Coutant  <ccoutant@gmail.com>
67
68         PR gold/16504
69         * dynobj.cc (Versions::symbol_section_contents): Don't set
70         VERSYM_HIDDEN flag for undefined symbols.
71         * symtab.cc (Symbol_table::add_from_object): Don't override default
72         version definition with a different default version.
73         * symtab.h (Symbol::from_dyn): New method.
74         * testsuite/plugin_test.c (struct sym_info): Add ver field.
75         (claim_file_hook): Pass symbol version to plugin API.
76         (parse_readelf_line): Parse symbol version.
77         * testsuite/Makefile.am (ver_test_pr16504): New test case.
78         * testsuite/Makefile.in: Regenerate.
79         * testsuite/ver_test_pr16504.sh: New test script.
80         * testsuite/ver_test_pr16504_a.c: New source file.
81         * testsuite/ver_test_pr16504_a.script: New version script.
82         * testsuite/ver_test_pr16504_b.c: New source file.
83         * testsuite/ver_test_pr16504_b.script: New version script.
84
85 2018-04-19  Cary Coutant  <ccoutant@gmail.com>
86
87         PR gold/23046
88         * gc.h (gc_process_relocs): Pass target to
89         scan.local_reloc_may_be_function_pointer.
90
91 2018-04-18  Nick Clifton  <nickc@redhat.com>
92
93         * po/es.po: Updated Spanish translation.
94
95 2018-04-14  Cary Coutant  <ccoutant@gmail.com>
96
97         PR gold/23046
98         * gc.h (gc_process_relocs): Pass target to
99         scan.global_reloc_may_be_function_pointer.
100
101 2018-04-09  Alan Modra  <amodra@gmail.com>
102
103         * configure: Regenerate.
104
105 2018-04-09  Alan Modra  <amodra@gmail.com>
106
107         * powerpc.cc (Target_powerpc::Track_tls::maybe_skip_tls_get_addr_call):
108         Handle inline plt sequence relocs.
109         (Stub_table::Plt_stub_key::Plt_stub_key): Likewise.
110         (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Likewise.
111         (Target_powerpc::Relocate::relocate): Likewise.
112
113 2018-04-09  Alan Modra  <amodra@gmail.com>
114
115         * powerpc.cc (Target_powerpc::lplt_): New variable.
116         (Target_powerpc::lplt_section): Associated accessor.
117         (Target_powerpc::plt_off): Handle local non-ifunc symbols.
118         (Target_powerpc::make_lplt_section): New function.
119         (Target_powerpc::make_local_plt_entry): New function.
120         (Powerpc_relobj::do_relocate_sections): Write out lplt.
121         (Output_data_plt_powerpc::first_plt_entry_offset): Zero for lplt.
122         (Output_data_plt_powerpc::add_local_entry): New function.
123         (Output_data_plt_powerpc::do_write): Ignore lplt.
124         (Target_powerpc::make_iplt_section): Make lplt first.
125         (Target_powerpc::make_brlt_section): Make .branch_lt relro.
126         (Target_powerpc::Scan::local): Handle PLT16 relocs.
127
128 2018-04-09  Alan Modra  <amodra@gmail.com>
129
130         * powerpc.cc (Target_powerpc::plt_off): New functions.
131         (is_plt16_reloc): New function.
132         (Stub_table::plt_off): Use Target_powerpc::plt_off.
133         (Stub_table::plt_call_size): Use plt_off.
134         (Stub_table::do_write): Likewise.
135         (Target_powerpc::Scan::get_reference_flags): Return RELATIVE_REF
136         for PLT16 relocations.
137         (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Return true
138         for PLT16 relocations.
139         (Target_powerpc::Scan::global): Make a PLT entry for PLT16 relocations.
140         (Target_powerpc::Relocate::relocate): Support PLT16 relocations.
141         (Powerpc_scan_relocatable_reloc::global_strategy): Return RELOC_SPECIAL
142         for ppc32 plt16 relocs.
143
144 2018-04-06  Cary Coutant  <ccoutant@gmail.com>
145
146         * object.cc (Sized_relobj_file::include_section_group): Store
147         reference to Kept_section info for discarded comdat sections
148         regardless of size.  Move size checking to map_to_kept_section.
149         (Sized_relobj_file::include_linkonce_section): Likewise.
150         (Sized_relobj_file::map_to_kept_section): Add section name parameter.
151         Insert size checking logic from above functions.
152         (Sized_relobj_file::find_kept_section_object): New method.
153         (Sized_relobj_file::get_symbol_name): New method.
154         * object.h (Sized_relobj_file::map_to_kept_section): Add section_name
155         parameter.  Adjust all callers.
156         (Sized_relobj_file::find_kept_section_object): New method.
157         (Sized_relobj_file::get_symbol_name): New method.
158         (Sized_relobj_file::Kept_comdat_section): Replace object and shndx
159         fields with sh_size, kept_section, symndx, and is_comdat fields.
160         (Sized_relobj_file::set_kept_comdat_section): Replace kept_object
161         and kept_shndx parameters with is_comdat, symndx, sh_size, and
162         kept_section.
163         (Sized_relobj_file::get_kept_comdat_section): Likewise.
164         * target-reloc.h (enum Comdat_behavior): Change CB_WARNING to CB_ERROR.
165         Adjust all references.
166         (issue_undefined_symbol_error): New function template.
167         (relocate_section): Pass section name to map_to_kept_section.
168         Move discarded section code to new function above.
169         * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Move
170         declaration for gsym out one level.  Call issue_discarded_error.
171         * arm.cc (Target_arm::scan_reloc_section_for_stubs): Likewise.
172         * powerpc.cc (Relocate_comdat_behavior): Change CB_WARNING to CB_ERROR.
173
174 2018-04-05  Cary Coutant  <ccoutant@gmail.com>
175
176         * target-reloc.h (relocate_section): Add local symbol index or global
177         symbol name to warning about relocation that refers to discarded
178         section.
179
180 2018-04-05  James Cowgill  <james.cowgill@mips.com>
181
182         Revert previous patch and apply revised patch.
183
184         PR gold/22770
185         * mips.cc (Mips_got_info::record_got_page_entry): Don't insert
186         Got_page_entry for object's GOT.
187         (Mips_got_info::add_got_page_entries): Add all pages from from's GOT.
188         Rename to add_got_page_count.
189         (Got_page_entry): Remove num_pages.
190
191 2018-04-05  James Cowgill  <james.cowgill@mips.com>
192
193         PR gold/22770
194         * mips.cc (Mips_got_info::record_got_page_entry): Fetch existing
195         page entries for the object's GOT.
196
197 2018-04-05  Alan Modra  <amodra@gmail.com>
198
199         * powerpc.cc (Target_powerpc::make_brlt_section): Make .branch_lt relro.
200
201 2018-04-04  Nick Clifton  <nickc@redhat.com>
202
203         * po/es.po: Updated Spanish translation.
204
205 2018-04-02  Cary Coutant  <ccoutant@gmail.com>
206
207         PR gold/23016
208         * incremental.cc (can_incremental_update): Check for unwind section
209         type.
210         * layout.h (Layout::layout): Add sh_type parameter.
211         * layout.cc (Layout::layout): Likewise.
212         (Layout::layout_reloc): Create new output reloc section if data
213         section does not already have one.
214         (Layout::layout_eh_frame): Check for unwind section type.
215         (Layout::make_eh_frame_section): Use unwind section type for .eh_frame
216         and .eh_frame_hdr.
217         * object.h (Sized_relobj_file::Shdr_write): New typedef.
218         (Sized_relobj_file::layout_section): Add sh_type parameter.
219         (Sized_relobj_file::Deferred_layout::Deferred_layout): Add sh_type
220         parameter.
221         * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
222         unwind section type.
223         (Sized_relobj_file::layout_section): Add sh_type parameter; pass it
224         to Layout::layout.
225         (Sized_relobj_file::do_layout): Make local copy of sh_type.
226         Force .eh_frame sections to unwind section type.
227         Pass sh_type to layout_section.
228         (Sized_relobj_file<size, big_endian>::do_layout_deferred_sections):
229         Pass sh_type to layout_section.
230         * output.cc (Output_section::Output_section): Initialize reloc_section_.
231         * output.h (Output_section::reloc_section): New method.
232         (Output_section::set_reloc_section): New method.
233         (Output_section::reloc_section_): New data member.
234         * target.h (Target::unwind_section_type): New method.
235         (Target::Target_info::unwind_section_type): New data member.
236
237         * aarch64.cc (aarch64_info): Add unwind_section_type.
238         * arm.cc (arm_info, arm_nacl_info): Likewise.
239         * i386.cc (i386_info, i386_nacl_info, iamcu_info): Likewise.
240         * mips.cc (mips_info, mips_nacl_info): Likewise.
241         * powerpc.cc (powerpc_info): Likewise.
242         * s390.cc (s390_info): Likewise.
243         * sparc.cc (sparc_info): Likewise.
244         * tilegx.cc (tilegx_info): Likewise.
245         * x86_64.cc (x86_64_info, x86_64_nacl_info): Likewise.
246
247         * testsuite/Makefile.am (pr23016_1, pr23016_2): New test cases.
248         * testsuite/Makefile.in: Regenerate.
249         * testsuite/testfile.cc: Add unwind_section_type.
250         * testsuite/pr23016_1.sh: New test script.
251         * testsuite/pr23016_1a.s: New source file.
252         * testsuite/pr23016_1b.s: New source file.
253         * testsuite/pr23016_2.sh: New test script.
254         * testsuite/pr23016_2a.s: New source file.
255         * testsuite/pr23016_2b.s: New source file.
256
257 2018-03-28  Cary Coutant  <ccoutant@gmail.com>
258
259         PR gold/21423
260         PR gold/22500
261         * configure.ac: Call AC_USE_SYSTEM_EXTENSIONS.
262         Replace check for --enable-plugins with AC_PLUGINS.
263         * options.cc (parse_plugin, parse_plugin_opt): Remove #ifdef.
264         (General_options::finalize): Check if plugins enabled.
265         * options.h (--plugin, --plugin-opt): Define even if plugins not
266         enabled.
267         * Makefile.in: Regenerate.
268         * aclocal.m4: Regenerate.
269         * configure: Regenerate.
270         * testsuite/Makefile.in: Regenerate.
271
272 2018-03-28  Cary Coutant  <ccoutant@gmail.com>
273
274         PR gold/22969
275         * aarch64-reloc.def: Add TLSLE_LDST* relocations.
276         * aarch64.cc (Target_aarch64::optimize_tls_reloc): Likewise.
277         (Target_aarch64::Scan::local): Likewise.
278         (Target_aarch64::Scan::global): Likewise.
279         (Target_aarch64::Relocate::relocate): Likewise.
280         (Target_aarch64::Relocate::relocate_tls): Likewise.
281
282 2018-03-27  Roland McGrath  <mcgrathr@google.com>
283
284         * testsuite/split_x86_64.sh: Fix bad regexp.
285
286 2018-03-26  Cary Coutant  <ccoutant@gmail.com>
287
288         PR gold/22868
289         * plugin.cc (Sized_pluginobj::do_add_symbols): Use a real section
290         index instead of SHN_ABS for defined symbols.
291         * testsuite/Makefile.am (plugin_pr22868): New test case.
292         * testsuite/Makefile.in: Regenerate
293         * testsuite/plugin_pr22868.sh: New test script.
294         * testsuite/plugin_pr22868_a.c: New source file.
295         * testsuite/plugin_pr22868_b.c: New source file.
296
297 2018-03-23  Cary Coutant  <ccoutant@gmail.com>
298
299         * plugin.cc (link_or_copy_file): Remove newlines from warning messages.
300         Add pedantic check for return value from ::write.
301
302 2018-03-23  Cary Coutant  <ccoutant@gmail.com>
303
304         * debug.h (DEBUG_PLUGIN): New constant.
305         (DEBUG_ALL): Add DEBUG_PLUGIN.
306         (debug_string_to_enum): Likewise.
307         * plugin.cc (make_sized_plugin_object): Add filename parameter.
308         (Plugin_recorder): New class.
309         (Plugin_manager::~Plugin_manager): Delete recorder_.
310         (Plugin_manager::load_plugins): Create and initialize recorder_.
311         (Plugin_manager::claim_file): Record claimed and unclaimed files.
312         (Plugin_manager::make_plugin_object): Use object name as name for
313         plugin object, if available.
314         (Plugin_manager::add_input_file): Record replacement files.
315         (Sized_pluginobj::do_add_symbols): Record plugin symbols.
316         (Plugin_finish::run): Call Plugin_recorder::finish().
317         (make_sized_plugin_object): Add filename parameter and pass to
318         Sized_pluginobj constructor.
319         * plugin.h (Plugin::filename): New method.
320         (Plugin::recorder): New method.
321         (Plugin::recorder_): New data member.
322
323 2018-03-07  Sriraman Tallam  <tmsriram@google.com>
324
325         * layout.cc (Layout::default_section_order): Check for text section
326         prefixes.
327         (Layout::text_section_name_mapping): New static member.
328         (Layout::text_section_name_mapping_count): New static member.
329         (Layout::match_section_name): New static function.
330         (Layout::output_section_name): Check for text section prefixes.
331         * layout.h (Output_section_order::ORDER_TEXT_HOT): New enum value.
332         (Output_section_order::ORDER_TEXT_STARTUP): New enum value.
333         (Output_section_order::ORDER_TEXT_EXIT): New enum value.
334         (Output_section_order::ORDER_TEXT_UNLIKELY): New enum value.
335         (Layout::text_section_name_mapping): New static member.
336         (Layout::text_section_name_mapping_count): New static member.
337         (Layout::match_section_name): New static function.
338         * options.h (keep_text_section_prefix): New -z option.
339         * testsuite/Makefile.am (keep_text_section_prefix): New test.
340         * testsuite/Makefile.in: Regenerate.
341         * testsuite/keep_text_section_prefix.cc: New test source.
342         * testsuite/keep_text_section_prefix.sh: New test script.
343
344 2018-02-22  Sriraman Tallam  <tmsriram@google.com>
345
346         * plugin.cc (get_wrap_symbols): New plugin interface.
347         (load): Add get_wrap_symbols to transfer vector.
348         * plugin-api.h (ld_plugin_get_wrap_symbols): New plugin interface.
349         * testsuite/plugin_test.c (onload): Call and check get_wrap_symbols
350         interface.
351         * testsuite/plugin_test_wrap_symbols.sh: New test script.
352         * testsuite/plugin_test_wrap_symbols_1.cc: New file.
353         * testsuite/plugin_test_wrap_symbols_2.cc: New file.
354         * testsuite/Makefile.am (plugin_test_wrap_symbols): New test.
355         * testsuite/Makefile.in: Regenerate.
356
357 2018-02-07  Sriraman Tallam  <tmsriram@google.com>
358
359         * expression.cc (Symbol_expression::set_expr_sym_in_real_elf):
360         New method.
361         (Unary_expression::set_expr_sym_in_real_elf): New method.
362         (Binary_expression::set_expr_sym_in_real_elf): New method.
363         (Trinary_expression::set_expr_sym_in_real_elf): New method.
364         * plugin.cc (get_symbol_resolution_info): Fix symbol resolution if
365         defined or used in defsyms.
366         * plugin.h (Plugin_manager::is_defsym_def): New method.
367         (Plugin_manager::Plugin_manager): Initialize defsym_defines_set_.
368         (Plugin_manager::defsym_defines_set_): New member.
369         (Plugin_manager::Defsym_defines_set): New typedef.
370         * script.cc (Script_options::set_defsym_uses_in_real_elf): New method.
371         (Script_options::find_defsym_defs): New method.
372         * script.h (Expression::set_expr_sym_in_real_elf): New method.
373         (Symbol_assignment::is_defsym): New method.
374         (Symbol_assignment::value): New method.
375         (Script_options::find_defsym_defs): New method.
376         (Script_options::set_defsym_uses_in_real_elf): New method.
377         * testsuite/Makefile.am (plugin_test_defsym): New test.
378         * testsuite/Makefile.in: Regenerate.
379         * testsuite/plugin_test.c: Check for new symbol resolution.
380         * testsuite/plugin_test_defsym.sh: New script.
381         * testsuite/plugin_test_defsym.c: New test source.
382
383 2018-02-07  Alan Modra  <amodra@gmail.com>
384
385         Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
386         * options.h: Remove --speculate-indirect-jumps support.
387         * powerpc.cc: Likewise.
388
389 2018-02-02  Cary Coutant  <ccoutant@gmail.com>
390
391         * PR gold/22776
392         * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog): Add
393         support for DWARF-4 line number tables.
394         * dwarf_reader.h (Sized_dwarf_line_info::max_ops_per_insn): New field.
395
396 2018-01-18  Alan Modra  <amodra@gmail.com>
397
398         * powerpc.cc (param_plt_align): New function supplying default
399         --plt-align values.  Use it..
400         (Stub_table::plt_call_align): ..here, and..
401         (Output_data_glink::global_entry_align): ..here.
402         (Stub_table::stub_align): Correct 32-bit minimum alignment.
403
404 2018-01-17  Alan Modra  <amodra@gmail.com>
405
406         * options.h (speculate_indirect_jumps): New option.
407         * powerpc.cc (beqctrm, beqctrlm, crseteq): New insn constants.
408         (output_bctr): New function.
409         (Stub_table::plt_call_size): Add space for speculation barrier.
410         (Stub_table::branch_stub_size): Likewise.
411         (Output_data_glink::pltresolve_size): Likewise.
412         (Stub_table::do_write): Output speculation barriers.
413
414 2018-01-17  Alan Modra  <amodra@gmail.com>
415
416         * options.h (plt_align): Support for PowerPC32 too.
417         * powerpc.cc (Stub_table::stub_align): Heed --plt-align for 32-bit.
418         (Stub_table::plt_call_size, branch_stub_size): Tidy.
419         (Stub_table::plt_call_align): Implement using stub_align.
420         (Output_data_glink::global_entry_align): New function.
421         (Output_data_glink::global_entry_off): New function.
422         (Output_data_glink::global_entry_address): Use global_entry_off.
423         (Output_data_glink::pltresolve_size): New function, replacing
424         pltresolve_size_ constant.  Update all uses.
425         (Output_data_glink::add_global_entry): Align offset.
426         (Output_data_glink::set_final_data_size): Use global_entry_align.
427         (Stub_table::do_write): Don't pad __glink_PLTrelsolve with nops.
428         Tidy stub output.  Use global_entry_off.
429
430 2018-01-15  Cary Coutant  <ccoutant@gmail.com>
431
432         PR gold/22694
433         * options.h (-fuse-ld): Add correct helparg.
434
435 2018-01-15  Nick Clifton  <nickc@redhat.com>
436
437         * po/uk.po: Updated Ukranian translation.
438
439 2018-01-13  Nick Clifton  <nickc@redhat.com>
440
441         * po/gold.pot: Regenerated.
442
443 2018-01-13  Nick Clifton  <nickc@redhat.com>
444
445         2.30 branch created.
446
447 2018-01-12  Cary Coutant  <ccoutant@gmail.com>
448
449         * NEWS: Add new features in 1.15.
450         * version.cc (version_string): Bump to 1.15.
451
452 2018-01-12  Sterling Augustine  <saugustine@google.com>
453
454         * cref.cc (Cref_inputs::Cref_table_compare::operator): Add
455         conditionals and calls to is_forwarder.
456
457 2018-01-03  Alan Modra  <amodra@gmail.com>
458
459         Update year range in copyright notice of all files.
460
461 For older changes see ChangeLog-2017
462 \f
463 Copyright (C) 2018 Free Software Foundation, Inc.
464
465 Copying and distribution of this file, with or without modification,
466 are permitted in any medium without royalty provided the copyright
467 notice and this notice are preserved.
468
469 Local Variables:
470 mode: change-log
471 left-margin: 8
472 fill-column: 74
473 version-control: never
474 End: