4 * dynobj.cc (Versions::Versions): Change init for needs_base_version_.
5 (Versions::record_version): Add verdefs for both shared objects and
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
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.
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.
41 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add *.stderr.
42 * testsuite/Makefile.in: Regenerate.
46 * configure.ac: Remove AC_PREREQ, add missing quoting and usage
48 * Makefile.in: Re-generate.
49 * aclocal.m4: Re-generate.
50 * configure: Re-generate.
51 * testsuite/Makefile.in: Re-generate.
55 * aarch64.cc (Target_aarch64::do_finalize_sections): Use size of
56 .got section for the _GLOBAL_OFFSET_TABLE_ symbol computation.
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.
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.
88 * gc.h (gc_process_relocs): Pass target to
89 scan.local_reloc_may_be_function_pointer.
93 * po/es.po: Updated Spanish translation.
98 * gc.h (gc_process_relocs): Pass target to
99 scan.global_reloc_may_be_function_pointer.
103 * configure: Regenerate.
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.
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.
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.
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
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.
176 * target-reloc.h (relocate_section): Add local symbol index or global
177 symbol name to warning about relocation that refers to discarded
182 Revert previous patch and apply revised patch.
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.
194 * mips.cc (Mips_got_info::record_got_page_entry): Fetch existing
195 page entries for the object's GOT.
199 * powerpc.cc (Target_powerpc::make_brlt_section): Make .branch_lt relro.
203 * po/es.po: Updated Spanish translation.
208 * incremental.cc (can_incremental_update): Check for unwind section
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
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
221 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
223 (Sized_relobj_file::layout_section): Add sh_type parameter; pass it
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.
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.
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.
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
267 * Makefile.in: Regenerate.
268 * aclocal.m4: Regenerate.
269 * configure: Regenerate.
270 * testsuite/Makefile.in: Regenerate.
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.
284 * testsuite/split_x86_64.sh: Fix bad regexp.
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.
299 * plugin.cc (link_or_copy_file): Remove newlines from warning messages.
300 Add pedantic check for return value from ::write.
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.
325 * layout.cc (Layout::default_section_order): Check for text section
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.
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
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.
359 * expression.cc (Symbol_expression::set_expr_sym_in_real_elf):
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.
386 * options.h: Remove --speculate-indirect-jumps support.
387 * powerpc.cc: Likewise.
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.
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.
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.
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.
433 * options.h (-fuse-ld): Add correct helparg.
437 * po/uk.po: Updated Ukranian translation.
441 * po/gold.pot: Regenerated.
449 * NEWS: Add new features in 1.15.
450 * version.cc (version_string): Bump to 1.15.
454 * cref.cc (Cref_inputs::Cref_table_compare::operator): Add
455 conditionals and calls to is_forwarder.
459 Update year range in copyright notice of all files.
461 For older changes see ChangeLog-2017
463 Copyright (C) 2018 Free Software Foundation, Inc.
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.
473 version-control: never