3 * configure.ac: Remove AC_PREREQ, add missing quoting and usage
5 * Makefile.in: Re-generate.
6 * aclocal.m4: Re-generate.
7 * configure: Re-generate.
8 * testsuite/Makefile.in: Re-generate.
12 * aarch64.cc (Target_aarch64::do_finalize_sections): Use size of
13 .got section for the _GLOBAL_OFFSET_TABLE_ symbol computation.
19 * gc.h (gc_process_relocs): Flag STT_SECTION symbols in symvec.
20 * icf.cc (get_section_contents): For merge sections, ignore the
21 addend for relocations against non-section symbols.
26 * dynobj.cc (Versions::symbol_section_contents): Don't set
27 VERSYM_HIDDEN flag for undefined symbols.
28 * symtab.cc (Symbol_table::add_from_object): Don't override default
29 version definition with a different default version.
30 * symtab.h (Symbol::from_dyn): New method.
31 * testsuite/plugin_test.c (struct sym_info): Add ver field.
32 (claim_file_hook): Pass symbol version to plugin API.
33 (parse_readelf_line): Parse symbol version.
34 * testsuite/Makefile.am (ver_test_pr16504): New test case.
35 * testsuite/Makefile.in: Regenerate.
36 * testsuite/ver_test_pr16504.sh: New test script.
37 * testsuite/ver_test_pr16504_a.c: New source file.
38 * testsuite/ver_test_pr16504_a.script: New version script.
39 * testsuite/ver_test_pr16504_b.c: New source file.
40 * testsuite/ver_test_pr16504_b.script: New version script.
45 * gc.h (gc_process_relocs): Pass target to
46 scan.local_reloc_may_be_function_pointer.
50 * po/es.po: Updated Spanish translation.
55 * gc.h (gc_process_relocs): Pass target to
56 scan.global_reloc_may_be_function_pointer.
60 * configure: Regenerate.
64 * powerpc.cc (Target_powerpc::Track_tls::maybe_skip_tls_get_addr_call):
65 Handle inline plt sequence relocs.
66 (Stub_table::Plt_stub_key::Plt_stub_key): Likewise.
67 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Likewise.
68 (Target_powerpc::Relocate::relocate): Likewise.
72 * powerpc.cc (Target_powerpc::lplt_): New variable.
73 (Target_powerpc::lplt_section): Associated accessor.
74 (Target_powerpc::plt_off): Handle local non-ifunc symbols.
75 (Target_powerpc::make_lplt_section): New function.
76 (Target_powerpc::make_local_plt_entry): New function.
77 (Powerpc_relobj::do_relocate_sections): Write out lplt.
78 (Output_data_plt_powerpc::first_plt_entry_offset): Zero for lplt.
79 (Output_data_plt_powerpc::add_local_entry): New function.
80 (Output_data_plt_powerpc::do_write): Ignore lplt.
81 (Target_powerpc::make_iplt_section): Make lplt first.
82 (Target_powerpc::make_brlt_section): Make .branch_lt relro.
83 (Target_powerpc::Scan::local): Handle PLT16 relocs.
87 * powerpc.cc (Target_powerpc::plt_off): New functions.
88 (is_plt16_reloc): New function.
89 (Stub_table::plt_off): Use Target_powerpc::plt_off.
90 (Stub_table::plt_call_size): Use plt_off.
91 (Stub_table::do_write): Likewise.
92 (Target_powerpc::Scan::get_reference_flags): Return RELATIVE_REF
93 for PLT16 relocations.
94 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Return true
95 for PLT16 relocations.
96 (Target_powerpc::Scan::global): Make a PLT entry for PLT16 relocations.
97 (Target_powerpc::Relocate::relocate): Support PLT16 relocations.
98 (Powerpc_scan_relocatable_reloc::global_strategy): Return RELOC_SPECIAL
99 for ppc32 plt16 relocs.
103 * object.cc (Sized_relobj_file::include_section_group): Store
104 reference to Kept_section info for discarded comdat sections
105 regardless of size. Move size checking to map_to_kept_section.
106 (Sized_relobj_file::include_linkonce_section): Likewise.
107 (Sized_relobj_file::map_to_kept_section): Add section name parameter.
108 Insert size checking logic from above functions.
109 (Sized_relobj_file::find_kept_section_object): New method.
110 (Sized_relobj_file::get_symbol_name): New method.
111 * object.h (Sized_relobj_file::map_to_kept_section): Add section_name
112 parameter. Adjust all callers.
113 (Sized_relobj_file::find_kept_section_object): New method.
114 (Sized_relobj_file::get_symbol_name): New method.
115 (Sized_relobj_file::Kept_comdat_section): Replace object and shndx
116 fields with sh_size, kept_section, symndx, and is_comdat fields.
117 (Sized_relobj_file::set_kept_comdat_section): Replace kept_object
118 and kept_shndx parameters with is_comdat, symndx, sh_size, and
120 (Sized_relobj_file::get_kept_comdat_section): Likewise.
121 * target-reloc.h (enum Comdat_behavior): Change CB_WARNING to CB_ERROR.
122 Adjust all references.
123 (issue_undefined_symbol_error): New function template.
124 (relocate_section): Pass section name to map_to_kept_section.
125 Move discarded section code to new function above.
126 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Move
127 declaration for gsym out one level. Call issue_discarded_error.
128 * arm.cc (Target_arm::scan_reloc_section_for_stubs): Likewise.
129 * powerpc.cc (Relocate_comdat_behavior): Change CB_WARNING to CB_ERROR.
133 * target-reloc.h (relocate_section): Add local symbol index or global
134 symbol name to warning about relocation that refers to discarded
139 Revert previous patch and apply revised patch.
142 * mips.cc (Mips_got_info::record_got_page_entry): Don't insert
143 Got_page_entry for object's GOT.
144 (Mips_got_info::add_got_page_entries): Add all pages from from's GOT.
145 Rename to add_got_page_count.
146 (Got_page_entry): Remove num_pages.
151 * mips.cc (Mips_got_info::record_got_page_entry): Fetch existing
152 page entries for the object's GOT.
156 * powerpc.cc (Target_powerpc::make_brlt_section): Make .branch_lt relro.
160 * po/es.po: Updated Spanish translation.
165 * incremental.cc (can_incremental_update): Check for unwind section
167 * layout.h (Layout::layout): Add sh_type parameter.
168 * layout.cc (Layout::layout): Likewise.
169 (Layout::layout_reloc): Create new output reloc section if data
170 section does not already have one.
171 (Layout::layout_eh_frame): Check for unwind section type.
172 (Layout::make_eh_frame_section): Use unwind section type for .eh_frame
174 * object.h (Sized_relobj_file::Shdr_write): New typedef.
175 (Sized_relobj_file::layout_section): Add sh_type parameter.
176 (Sized_relobj_file::Deferred_layout::Deferred_layout): Add sh_type
178 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
180 (Sized_relobj_file::layout_section): Add sh_type parameter; pass it
182 (Sized_relobj_file::do_layout): Make local copy of sh_type.
183 Force .eh_frame sections to unwind section type.
184 Pass sh_type to layout_section.
185 (Sized_relobj_file<size, big_endian>::do_layout_deferred_sections):
186 Pass sh_type to layout_section.
187 * output.cc (Output_section::Output_section): Initialize reloc_section_.
188 * output.h (Output_section::reloc_section): New method.
189 (Output_section::set_reloc_section): New method.
190 (Output_section::reloc_section_): New data member.
191 * target.h (Target::unwind_section_type): New method.
192 (Target::Target_info::unwind_section_type): New data member.
194 * aarch64.cc (aarch64_info): Add unwind_section_type.
195 * arm.cc (arm_info, arm_nacl_info): Likewise.
196 * i386.cc (i386_info, i386_nacl_info, iamcu_info): Likewise.
197 * mips.cc (mips_info, mips_nacl_info): Likewise.
198 * powerpc.cc (powerpc_info): Likewise.
199 * s390.cc (s390_info): Likewise.
200 * sparc.cc (sparc_info): Likewise.
201 * tilegx.cc (tilegx_info): Likewise.
202 * x86_64.cc (x86_64_info, x86_64_nacl_info): Likewise.
204 * testsuite/Makefile.am (pr23016_1, pr23016_2): New test cases.
205 * testsuite/Makefile.in: Regenerate.
206 * testsuite/testfile.cc: Add unwind_section_type.
207 * testsuite/pr23016_1.sh: New test script.
208 * testsuite/pr23016_1a.s: New source file.
209 * testsuite/pr23016_1b.s: New source file.
210 * testsuite/pr23016_2.sh: New test script.
211 * testsuite/pr23016_2a.s: New source file.
212 * testsuite/pr23016_2b.s: New source file.
218 * configure.ac: Call AC_USE_SYSTEM_EXTENSIONS.
219 Replace check for --enable-plugins with AC_PLUGINS.
220 * options.cc (parse_plugin, parse_plugin_opt): Remove #ifdef.
221 (General_options::finalize): Check if plugins enabled.
222 * options.h (--plugin, --plugin-opt): Define even if plugins not
224 * Makefile.in: Regenerate.
225 * aclocal.m4: Regenerate.
226 * configure: Regenerate.
227 * testsuite/Makefile.in: Regenerate.
232 * aarch64-reloc.def: Add TLSLE_LDST* relocations.
233 * aarch64.cc (Target_aarch64::optimize_tls_reloc): Likewise.
234 (Target_aarch64::Scan::local): Likewise.
235 (Target_aarch64::Scan::global): Likewise.
236 (Target_aarch64::Relocate::relocate): Likewise.
237 (Target_aarch64::Relocate::relocate_tls): Likewise.
241 * testsuite/split_x86_64.sh: Fix bad regexp.
246 * plugin.cc (Sized_pluginobj::do_add_symbols): Use a real section
247 index instead of SHN_ABS for defined symbols.
248 * testsuite/Makefile.am (plugin_pr22868): New test case.
249 * testsuite/Makefile.in: Regenerate
250 * testsuite/plugin_pr22868.sh: New test script.
251 * testsuite/plugin_pr22868_a.c: New source file.
252 * testsuite/plugin_pr22868_b.c: New source file.
256 * plugin.cc (link_or_copy_file): Remove newlines from warning messages.
257 Add pedantic check for return value from ::write.
261 * debug.h (DEBUG_PLUGIN): New constant.
262 (DEBUG_ALL): Add DEBUG_PLUGIN.
263 (debug_string_to_enum): Likewise.
264 * plugin.cc (make_sized_plugin_object): Add filename parameter.
265 (Plugin_recorder): New class.
266 (Plugin_manager::~Plugin_manager): Delete recorder_.
267 (Plugin_manager::load_plugins): Create and initialize recorder_.
268 (Plugin_manager::claim_file): Record claimed and unclaimed files.
269 (Plugin_manager::make_plugin_object): Use object name as name for
270 plugin object, if available.
271 (Plugin_manager::add_input_file): Record replacement files.
272 (Sized_pluginobj::do_add_symbols): Record plugin symbols.
273 (Plugin_finish::run): Call Plugin_recorder::finish().
274 (make_sized_plugin_object): Add filename parameter and pass to
275 Sized_pluginobj constructor.
276 * plugin.h (Plugin::filename): New method.
277 (Plugin::recorder): New method.
278 (Plugin::recorder_): New data member.
282 * layout.cc (Layout::default_section_order): Check for text section
284 (Layout::text_section_name_mapping): New static member.
285 (Layout::text_section_name_mapping_count): New static member.
286 (Layout::match_section_name): New static function.
287 (Layout::output_section_name): Check for text section prefixes.
288 * layout.h (Output_section_order::ORDER_TEXT_HOT): New enum value.
289 (Output_section_order::ORDER_TEXT_STARTUP): New enum value.
290 (Output_section_order::ORDER_TEXT_EXIT): New enum value.
291 (Output_section_order::ORDER_TEXT_UNLIKELY): New enum value.
292 (Layout::text_section_name_mapping): New static member.
293 (Layout::text_section_name_mapping_count): New static member.
294 (Layout::match_section_name): New static function.
295 * options.h (keep_text_section_prefix): New -z option.
296 * testsuite/Makefile.am (keep_text_section_prefix): New test.
297 * testsuite/Makefile.in: Regenerate.
298 * testsuite/keep_text_section_prefix.cc: New test source.
299 * testsuite/keep_text_section_prefix.sh: New test script.
303 * plugin.cc (get_wrap_symbols): New plugin interface.
304 (load): Add get_wrap_symbols to transfer vector.
305 * plugin-api.h (ld_plugin_get_wrap_symbols): New plugin interface.
306 * testsuite/plugin_test.c (onload): Call and check get_wrap_symbols
308 * testsuite/plugin_test_wrap_symbols.sh: New test script.
309 * testsuite/plugin_test_wrap_symbols_1.cc: New file.
310 * testsuite/plugin_test_wrap_symbols_2.cc: New file.
311 * testsuite/Makefile.am (plugin_test_wrap_symbols): New test.
312 * testsuite/Makefile.in: Regenerate.
316 * expression.cc (Symbol_expression::set_expr_sym_in_real_elf):
318 (Unary_expression::set_expr_sym_in_real_elf): New method.
319 (Binary_expression::set_expr_sym_in_real_elf): New method.
320 (Trinary_expression::set_expr_sym_in_real_elf): New method.
321 * plugin.cc (get_symbol_resolution_info): Fix symbol resolution if
322 defined or used in defsyms.
323 * plugin.h (Plugin_manager::is_defsym_def): New method.
324 (Plugin_manager::Plugin_manager): Initialize defsym_defines_set_.
325 (Plugin_manager::defsym_defines_set_): New member.
326 (Plugin_manager::Defsym_defines_set): New typedef.
327 * script.cc (Script_options::set_defsym_uses_in_real_elf): New method.
328 (Script_options::find_defsym_defs): New method.
329 * script.h (Expression::set_expr_sym_in_real_elf): New method.
330 (Symbol_assignment::is_defsym): New method.
331 (Symbol_assignment::value): New method.
332 (Script_options::find_defsym_defs): New method.
333 (Script_options::set_defsym_uses_in_real_elf): New method.
334 * testsuite/Makefile.am (plugin_test_defsym): New test.
335 * testsuite/Makefile.in: Regenerate.
336 * testsuite/plugin_test.c: Check for new symbol resolution.
337 * testsuite/plugin_test_defsym.sh: New script.
338 * testsuite/plugin_test_defsym.c: New test source.
343 * options.h: Remove --speculate-indirect-jumps support.
344 * powerpc.cc: Likewise.
349 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog): Add
350 support for DWARF-4 line number tables.
351 * dwarf_reader.h (Sized_dwarf_line_info::max_ops_per_insn): New field.
355 * powerpc.cc (param_plt_align): New function supplying default
356 --plt-align values. Use it..
357 (Stub_table::plt_call_align): ..here, and..
358 (Output_data_glink::global_entry_align): ..here.
359 (Stub_table::stub_align): Correct 32-bit minimum alignment.
363 * options.h (speculate_indirect_jumps): New option.
364 * powerpc.cc (beqctrm, beqctrlm, crseteq): New insn constants.
365 (output_bctr): New function.
366 (Stub_table::plt_call_size): Add space for speculation barrier.
367 (Stub_table::branch_stub_size): Likewise.
368 (Output_data_glink::pltresolve_size): Likewise.
369 (Stub_table::do_write): Output speculation barriers.
373 * options.h (plt_align): Support for PowerPC32 too.
374 * powerpc.cc (Stub_table::stub_align): Heed --plt-align for 32-bit.
375 (Stub_table::plt_call_size, branch_stub_size): Tidy.
376 (Stub_table::plt_call_align): Implement using stub_align.
377 (Output_data_glink::global_entry_align): New function.
378 (Output_data_glink::global_entry_off): New function.
379 (Output_data_glink::global_entry_address): Use global_entry_off.
380 (Output_data_glink::pltresolve_size): New function, replacing
381 pltresolve_size_ constant. Update all uses.
382 (Output_data_glink::add_global_entry): Align offset.
383 (Output_data_glink::set_final_data_size): Use global_entry_align.
384 (Stub_table::do_write): Don't pad __glink_PLTrelsolve with nops.
385 Tidy stub output. Use global_entry_off.
390 * options.h (-fuse-ld): Add correct helparg.
394 * po/uk.po: Updated Ukranian translation.
398 * po/gold.pot: Regenerated.
406 * NEWS: Add new features in 1.15.
407 * version.cc (version_string): Bump to 1.15.
411 * cref.cc (Cref_inputs::Cref_table_compare::operator): Add
412 conditionals and calls to is_forwarder.
416 Update year range in copyright notice of all files.
418 For older changes see ChangeLog-2017
420 Copyright (C) 2018 Free Software Foundation, Inc.
422 Copying and distribution of this file, with or without modification,
423 are permitted in any medium without royalty provided the copyright
424 notice and this notice are preserved.
430 version-control: never