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