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