summaryrefslogtreecommitdiff
path: root/gold
Commit message (Collapse)AuthorAgeFilesLines
* Updated translations for some of the binutils sub-directories.Nick Clifton2020-02-242-149/+163
|
* Updated translations for various binutils sub-directoriesNick Clifton2020-01-202-150/+164
|
* Update version to 2.34.50. Regenerate configure and .pot files.Nick Clifton2020-01-182-142/+159
|
* Add markers for 2.34 branch to the NEWS files and ChangeLogs.Nick Clifton2020-01-181-0/+4
|
* Re: Update year range in copyright notice of binutils filesAlan Modra2020-01-011-0/+4
| | | | Add the ChangeLog entry.
* Update year range in copyright notice of binutils filesAlan Modra2020-01-01479-481/+481
|
* ChangeLog rotationAlan Modra2020-01-012-276/+290
|
* Introduce new .text.sorted.* sections.Martin Liska2019-11-265-3/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | gold/ChangeLog: 2019-11-26 Martin Liska <mliska@suse.cz> * layout.cc (Layout::special_ordering_of_input_section): Add ".text.sorted". * output.cc: Special case ".text.sorted". * testsuite/section_sorting_name.cc: Cover also .text.sorted subsections. * testsuite/section_sorting_name.sh: Likewise. ld/ChangeLog: 2019-11-26 Martin Liska <mliska@suse.cz> * scripttempl/arclinux.sc: Add .text.sorted.* which is sorted by default. * scripttempl/elf.sc: Likewise. * scripttempl/elf64bpf.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * testsuite/ld-arm/arm-no-rel-plt.ld: Expect .text.sorted.* in the default linker script. * testsuite/ld-arm/fdpic-main.ld: Likewise. * testsuite/ld-arm/fdpic-shared.ld: Likewise.
* [GOLD] OSABI not set when STT_GNU_IFUNC or STB_GNU_UNIQUE symbols outputAlan Modra2019-11-194-4/+52
| | | | | | | | | | | | | | | | | | | | | | This patch arranges to have OSABI set to ELFOSABI_GNU (if not set to some other non-zero value) when gold outputs an ifunc local or global symbol, or a unique global symbol to either .dynsym or .symtab. STT_GNU_IFUNC and STB_GNU_UNIQUE have values in the LOOS to HIOS range and therefore require interpretation according to OSABI. I'm not sure why parameters->target() is const Target& while parameters->sized_target() is Sized_target*, but it's inconvenient to use the latter in Symbol_table::finalize. So this patch adds another const_cast complained about in layout.cc and gold.cc. PR 24853 * symtab.h (set_has_gnu_output, has_gnu_output_): New. * symtab.cc (Symbol_table::Symbol_table): Init has_gnu_output_. (Symbol_table::finalize): Set ELFOSABI_GNU when has_gnu_output_. (Symbol_table::set_dynsym_indexes, Symbol_table::sized_finalize): Call set_has_gnu_output for STT_GNU_IFUNC and STB_GNU_UNIQUE globals. * object.cc (Sized_relobj_file::do_finalize_local_symbols): Call set_has_gnu_output when STT_GNU_IFUNC locals will be output.
* PR24996, Gold fix for ternary operator within linker scriptsMiguel Saldivar2019-11-112-2/+9
| | | | | | | PR 24996 * expression.cc (Trinary_expression::arg2_value): Use correct integer expression when calling "eval_maybe_dot" method. (Trinary_expression::arg3_value): Likewise.
* PR16794, gold ignores R_386_GOTOFF addendAlan Modra2019-09-283-8/+14
| | | | | | | | | | | | An R_386_GOTOFF relocation has an addend, typically used when a symbol can be replaced by its section symbol plus an offset. psymval->value(object,0) is quite wrong then, fix it. PR 16794 * i386.cc (Target_i386::Relocate::relocate <R_386_GOTOFF>): Don't ignore addend, apply using pcrel32. * x86_64.cc (Target_x86_64::Relocate::relocate <R_X86_64_GOTOFF64>): Similarly use pcrel64.
* Fix building gold with gcc-10.Nick Clifton2019-09-242-0/+5
| | | | * descriptors.cc: Include <string>
* implicit conversion from enum ld_plugin_level to enum ld_plugin_statusAlan Modra2019-09-232-3/+8
| | | | | | | | This is a gcc10 warning fix. gold/ * testsuite/plugin_new_section_layout.c (new_input_hook): Correct return status enum values.
* [GOLD] Fix spurious "plugin needed to handle lto object" warningsAlan Modra2019-09-203-4/+17
| | | | | | | | | | | lto_slim_object_ was unitialized. I also thought it worth adding a sanity check on the .gnu.lto_.lto.* section size, and made some other tidies. PR 24768 * layout.cc (Layout::Layout): Init lto_slim_object_. * object.cc (Sized_relobj_file::do_layout): Wrap overlong line. Don't use C cast. Validate section size. Don't copy contents.
* PowerPC64, error on unsupported dynamic relocationAlan Modra2019-09-202-1/+6
| | | | | | | | | | | | | | | | This patch corrects the set of dynamic relocations recognised by gold as supported by glibc, and teaches ld.bfd to report an error similar to the gold error. Note that ld --noinhibit-exec can be used to produce an output, supporting older ld with newer glibc if the set of supported glibc dynamic relocations changes. bfd/ * elf64-ppc.c (ppc64_glibc_dynamic_reloc): New function. (ppc64_elf_relocate_section): Error if emitting unsupported dynamic relocations. gold/ * powerpc.cc (Target_powerpc::Scan::check_non_pic): Move REL24 to 32-bit supported.
* Re-generate many configure and Makefile.in filesSimon Marchi2019-09-182-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I get some spurious changes when running autoconf/automake for various projects in the tree. This is likely because they were generated using distro-patched tools last time. I ran `autoreconf -f` in the various automake projects of the binutils-gdb tree, and this is the result. The tools I am using have been compiled from source, from the upstream release. bfd/ChangeLog: * Makefile.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. binutils/ChangeLog: * Makefile.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. gas/ChangeLog: * Makefile.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. gold/ChangeLog: * testsuite/Makefile.in: Re-generate. gprof/ChangeLog: * Makefile.in: Re-generate. * configure: Re-generate. ld/ChangeLog: * Makefile.in: Re-generate. * configure: Re-generate. opcodes/ChangeLog: * Makefile.in: Re-generate. * configure: Re-generate.
* Add markers for 2.33 branch to NEWS and ChangeLog files.Phil Blundell2019-09-091-0/+4
|
* Fix detection of missing plugin for LTO objects.Martin Liska2019-08-162-3/+11
| | | | | | | | | | | | | | | | 2019-08-16 Martin Liska <mliska@suse.cz> PR ld/24912 * elflink.c: Report error only for not relocatable. * linker.c (_bfd_generic_link_add_one_symbol): Do not handle here lto_slim_object as it's handled in caller. 2019-08-16 Martin Liska <mliska@suse.cz> PR ld/24912 * object.cc (big_endian>::do_layout): Do not report error, but only set a flag. (big_endian>::do_add_symbols): Report error only for when relocatable.
* [GOLD] PowerPC64 pc-relative TLS supportAlan Modra2019-08-022-68/+347
| | | | | | | | | | | | | | | | Gold version of git commit c213164ad2. elfcpp/ * powerpc.h (R_PPC64_TPREL34, R_PPC64_DTPREL34), (R_PPC64_GOT_TLSGD34, R_PPC64_GOT_TLSLD34), (R_PPC64_GOT_TPREL34, R_PPC64_GOT_DTPREL34): Define. gold/ * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Set flags for new relocations, and some missing older relocs. (Target_powerpc::Scan::local): Handle new pcrel tls relocs. Call set_has_static_tls for tprel relocs. (Target_powerpc::Scan::global): Likewise. (Target_powerpc::Relocate::relocate): Handle new pcrel tls relocs.
* [GOLD] PowerPC relocation signed overflow checkAlan Modra2019-08-022-4/+17
| | | | | | | | | | Relocations with right shifts were calculating wrong overflow status. Since the addr34 split-field reloc is implemented as an 18-bit high part with value shifted right by 16 and a 16-bit low part, most of the pc-relative relocs were affected. * powerpc.cc (Powerpc_relocate_functions::rela, rela_ua): Perform signed right shift for signed overflow check.
* Support .gnu.lto_.lto section in ELF files (PR 24768).Martin Liska2019-07-293-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> PR 24768 * archive.c (_bfd_compute_and_write_armap): Come up with report_plugin_err variable. * bfd-in2.h (struct bfd): Add lto_slim_object flag. * elf.c (struct lto_section): New. (_bfd_elf_make_section_from_shdr): Parse content of .gnu_lto_.lto section. * elflink.c: Report error for a missing LTO plugin. * linker.c (_bfd_generic_link_add_one_symbol): Likewise. binutils/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> PR 24768 * nm.c (filter_symbols): Set report_plugin_err if error is reported. (display_rel_file): Report error for a missing LTO plugin. gold/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> PR 24768 * layout.h (class Layout): Add is_lto_slim_object and set_lto_slim_object. * object.cc (struct lto_section): Add lto_slim_object_. (big_endian>::do_layout): Parse content of .gnu_lto_.lto section. (big_endian>::do_add_symbols): Report error for a missing LTO plugin.
* [GOLD] PowerPC R_PPC64_PCREL_OPT supportAlan Modra2019-07-132-12/+177
| | | | | | * powerpc.cc (xlate_pcrel_opt): New function. (Target_powerpc::Relocate::relocate): Optimise PCREL34 and GOT_PCREL34 sequences marked with PCREL_OPT.
* [GOLD] PowerPC got reloc optimisationAlan Modra2019-07-132-11/+104
| | | | | | | | | | Note that gold won't remove unused GOT entries, in contrast to ld.bfd which will. * powerpc.cc (Powerpc_relobj::make_got_relative): New function. (relative_value_is_known): New functions. (Target_powerpc::Relocate::relocate): Edit code using GOT16_HA, GOT16_LO_DS, and GOT_PCREL34 relocs.
* [GOLD] PowerPC relocations for prefix insnsAlan Modra2019-07-132-12/+454
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use pc-relative instructions for notoc stubs. elfcpp/ * powerpc.h (R_PPC64_PCREL_OPT, R_PPC64_D34, R_PPC64_D34_LO), (R_PPC64_D34_HI30, R_PPC64_D34_HA30, R_PPC64_PCREL34), (R_PPC64_GOT_PCREL34, R_PPC64_PLT_PCREL34, R_PPC64_PLT_PCREL34_NOTOC), (R_PPC64_ADDR16_HIGHER34, R_PPC64_ADDR16_HIGHERA34), (R_PPC64_ADDR16_HIGHEST34, R_PPC64_ADDR16_HIGHESTA34), (R_PPC64_REL16_HIGHER34, R_PPC64_REL16_HIGHERA34), (R_PPC64_REL16_HIGHEST34, R_PPC64_REL16_HIGHESTA34), (R_PPC64_D28, R_PPC64_PCREL28): Define. gold/ * powerpc.cc (Target_powerpc): Add powerxx_stubs_ and accessor functions. (Target_powerpc::maybe_skip_tls_get_addr_call): Handle PLT_PCREL34 and PLT_PCREL34_NOTOC relocs. (Powerpc_relocate_functions): Add addr34, addr34_hi, addr34_ha, addr28, addr16_higher34, addr16_highera34, addr16_highest34, addr16_highest34a functions. (li_11_0, ori_11_11_0, sldi_11_11_34): Define. (paddi_12_pc, pld_12_pc, pnop): Define. (d34, ha34): New inline functions. (Stub_table::add_plt_call_entry): Handle powerxx_stubs. (Stub_table::add_eh_frame): Likewise. (build_powerxx_offset): New function. (Stub_table::plt_call_size): Handle powerxx_stubs. (Stub_table::branch_stub_size): Likewise. (Stub_table::do_write): Likewise. (Target_powerpc::Scan::get_reference_flags): Handle new relocs. (Target_powerpc::Scan::reloc_needs_plt_for_ifunc: Likewise. (Target_powerpc::Scan::local, global, relocate): Likewise.
* [GOLD] PowerPC notoc eh_frameAlan Modra2019-07-136-117/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating notoc call and branch stubs without the benefit of pc-relative insns, the stubs need to use LR to access the run time PC. All LR changes must be described in .eh_frame if we're to support unwinding through asynchronous exceptions. That's what this patch does. The patch has gone through way too many iterations. At first I attempted to add multiple FDEs, one for each stub. That ran into difficulties with do_plt_fde_location which is only capable of setting the address of a single FDE per Output_data section, and with removing any FDEs added on a previous do_relax pass. Removing FDEs (git commit be897fb774) went overboard in matching the FDE contents. That means either stashing the contents created for add_eh_frame_for_plt to use when calling remove_eh_frame_for_plt, or recreating contents on the fly (*) just to remove FDEs. In fact, FDE content matching is quite unnecesary. FDEs added by a previous do_relax pass are those with u_.from_linker.post_map set. So they can easily be recognised just by looking at that flag. This patch keeps that part of the multiple FDE changes. In the end I went for just one FDE per stub group to describe the call stubs. That's reasonably efficient for the common case of only needing to describe the __tls_get_addr_opt call stub. We don't expect to be making many calls using notoc stubs without pc-relative insns. *) Which has it's own set of problems. The contents must be recreated using the old stub layout, but .eh_frame size can affect stub requirements so you need to temporarily keep the old .eh_frame size when creating new stubs, then reset .eh_frame size before adding new FDEs. * ehframe.cc (Fde::operator==): Delete. (Cie::remove_fde): Delete. (Eh_frame::remove_ehframe_for_plt): Delete fde_data and fde_length parameters. Remove all post-map plt FDEs. * ehframe.h (Fde:post_map): Make const, add variant to compare plt. (Fde::operator==): Delete. (Cie::remove_fde): Implement here. (Cie::last_fde): New accessor. (Eh_frame::remove_ehframe_for_plt): Update prototype. * layout.cc (Layout::remove_eh_frame_for_plt): Delete fde_data and fde_length parameters. * layout.h (Layout::remove_eh_frame_for_plt): Update prototype. * powerpc.cc (Stub_table::tls_get_addr_opt_bctrl_): Delete. (Stub_table::plt_fde_len_, plt_fde_, init_plt_fde): Delete. (Stub_table::add_plt_call_entry): Don't set tls_get_addr_opt_bctrl_. (eh_advance): New function. (stub_sort): New function. (Stub_table::add_eh_frame): Emit eh_frame for notoc plt calls and branches as well as __tls_get_addr_opt plt call stub. (Stub_table::remove_eh_frame): Update to suit.
* [GOLD] PowerPC64 ELFv2 notoc supportAlan Modra2019-07-132-261/+746
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls from notoc functions via the PLT need different stubs. Even calls to local functions requiring a valid toc pointer must go via a stub. This patch provides the support in gold. elfcpp/ * powerpc.h (R_PPC64_PLTSEQ_NOTOC, R_PPC64_PLTCALL_NOTOC): Define. gold/ * powerpc.cc (Target_powerpc::maybe_skip_tls_get_addr_call): Handle notoc calls. (is_branch_reloc): Template on size. Return true for REL24_NOTOC. Update all callers. (max_branch_delta): Likewise. (Target_powerpc::Branch_info::make_stub): Add a stub for notoc calls to functions needing a valid toc pointer. (Target_powerpc::do_relax): Layout stubs again if any need resize. (add_12_11_12, addi_12_11, addis_12_11, ldx_12_11_12, ori_12_12_0), (oris_12_12_0, sldi_12_12_32): Define. (Stub_table::Plt_stub_ent): Add notoc_ and iter_ fields. (Stub_table::Branch_stub_key, Branch_stub_key_hash): Rename from Branch_stub_ent and Branch_stub_ent hash. Remove save_res_ from key. (Stub_table::Branch_stub_ent): New struct. (class Stub_table): Add need_resize and resizing vars. (Stub_table::need_resize, branch_size): New accessors. (Stub_table::set_resizing): New function. (Stub_table::add_plt_call_entry): Handle notoc calls and resizing on seeing such or a tocsave stubs after a normal stub using the same sym. (Stub_table::add_long_branch_entry): Similarly. (Stub_table::find_long_branch_entry): Return a Branch_stub_ent*. (Stub_table::define_stub_syms): Adjust (Stub_table::build_tls_opt_head, build_tls_opt_tail): New functions. (build_notoc_offset): New function. (Stub_table::plt_call_size): Move out of line. Handle notoc calls. (Stub_table::branch_stub_size): Similarly. (Stub_table::do_write): Separate loop for ELFv2 stubs, handling notoc calls. Simplify ELFv1 loop. Output notoc branch stubs. Use build_tls_opt_head and build_tls_opt_tail. (Target_powerpc::Scan::get_reference_flags): Handle REL24_NOTOC. (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Likewise, and PLTSEQ_NOTOC and PLTCALL_NOTOC. (Target_powerpc::Scan::local, global, relocate): Likewise.
* [GOLD] PowerPC tweak relnum testsAlan Modra2019-06-282-2/+7
| | | | | | | | | | There is a call of relocate() to perform a single relocation. In that case the "relnum" parameter is -1U and of course it isn't appropriate to consider any of the PowerPC code sequence optimisations triggered by a following relocation. * powerpc.cc (Target_powerpc::Relocate::relocate): Don't look at next/previous reloc when relnum is -1.
* [GOLD] PowerPC linkage table errorAlan Modra2019-06-282-5/+25
| | | | | | | | | | This fixes a segfault when attempring to output a "linkage table error". "object" is only non-NULL in the local symbol case. * powerpc.cc (Stub_table::plt_error): New function. (Stub_table::do_write): Use it. (Output_data_glink::do_write): Don't segfault emitting linkage table error.
* [GOLD] R_PPC64_REL16_HIGH relocsAlan Modra2019-06-282-0/+38
| | | | | | | | | | | | | | | | | These relocs have been around for quite a while. It's past time gold supported them. elfcpp/ * powerpc.h (R_PPC64_REL16_HIGH, R_PPC64_REL16_HIGHA), (R_PPC64_REL16_HIGHER, R_PPC64_REL16_HIGHERA), (R_PPC64_REL16_HIGHEST, R_PPC64_REL16_HIGHESTA): Define. gold/ * powerpc.cc (Target_powerpc::Scan::get_reference_flags): Handle REL16_HIGH* relocs. (Target_powerpc::Scan::local): Likewise. (Target_powerpc::Scan::global): Likewise. (Target_powerpc::Relocate::relocate): Likewise.
* Fix a missing include of <string>Martin Liska2019-06-102-0/+5
| | | | | | | | gold/ChangeLog: 2019-06-07 Martin Liska <mliska@suse.cz> * errors.h: Include string.
* Fix problem with ICF where diffs in EH frame info is ignored.Joshua Oreman2019-05-119-34/+438
| | | | | | | | | | | | | | | | | | | | | | | PR gold/21066 * gc.h (gc_process_relocs): Track relocations in .eh_frame sections when ICF is enabled, even though the .eh_frame sections themselves are not foldable. * icf.cc (get_section_contents): Change arguments to permit operation on just part of a section. Include extra identity regions in the referring section's contents recursively. (match_sections): Lock object here instead of in get_section_contents so that get_section_contents can operate recursively. (Icf::add_ehframe_links): New method. (Icf::find_identical_sections): Pass .eh_frame sections to add_ehframe_links(). Increase default iteration count from 2 to 3 because handling exception info typically requires one extra iteration. * icf.h (Icf::extra_identity_list_): New data member with accessor. (is_section_foldable_candidate): Include .gcc_except_table sections. * options.h: Update documentation for new default ICF iteration count. * testsuite/Makefile.am (icf_test_pr21066): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/icf_test_pr21066.cc: New source file. * testsuite/icf_test_pr21066.sh: New test script.
* Check whether symbols with MOVW_.ABS relocations require PLT entries (aarch64).Egeyar Bagcioglu2019-02-197-44/+146
| | | | | | | | | | | | | | 2019-02-19 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com> gold/ PR gold/23870 * aarch64.cc (Target_aarch64::Scan::global): Check if a symbol with R_AARCH64_MOVW_.ABS_* relocations requires a PLT entry. * testsuite/Makefile.am: Add aarch64_pr23870 test case. * testsuite/Makefile.in: Regenerate. * testsuite/aarch64_pr23870_bar.c: New file. * testsuite/aarch64_pr23870_foo.c: New file. * testsuite/aarch64_pr23870_main.S: New file.
* Updated French translation for ld/ and gold/ subdirectoriesNick Clifton2019-02-122-258/+305
|
* Updated translations for various binutils subdirectories.Nick Clifton2019-01-212-232/+279
|
* Change version to 2.32.51 and regenerate configure and pot files.Nick Clifton2019-01-192-227/+275
|
* Add markers for 2.32 branch to NEWS and ChangeLog files.Nick Clifton2019-01-191-0/+4
|
* Adjust bfd/warning.m4 egrep patternsAndrew Paprocki2019-01-092-5/+9
| | | | | | | | | | | | | | | | | | | | | Adjust the `bfd/warning.m4` `egrep` patterns to handle preprocessors that do not define `__GNUC__`, leaving the string in the output. bfd/ * warning.m4: Adjust egrep pattern for non-GNU compilers. * configure: Regenerate. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. gold/ * configure: Regenerate. gprof/ * configure: Regenerate. ld/ * configure: Regenerate. opcodes/ * configure: Regenerate.
* Update year range in copyright notice of binutils filesAlan Modra2019-01-01478-479/+483
|
* ChangeLog rotationAlan Modra2019-01-012-773/+787
|
* [GOLD] Tweak keep_text_section_prefix test for PowerPC64 ELFv1Alan Modra2018-12-183-2/+8
| | | | | | | | | | | | | | | | | | | This test checks code layout by function symbol ordering, but that doesn't work on powerpc64 ELFv1 where the function symbol is on a descriptor. A simple work-around is to have nm emit synthetic symbols marking the code entry point of functions. Since the text segment is laid out before the data segment, the synthetic symbols will have lower addresses than function descriptor symbols and be seen first in nm -n output. On other targets, nm --synthetic typically emits symbols on plt entries. Since the testcase doesn't call any of the functions of interest there shouldn't be plt entries for those functions, so there should be no potentially confusing extra symbols. * testsuite/Makefile.am (keep_text_section_prefix_nm.stdout): Pass --synthetic to nm. * testsuite/Makefile.in: Regenerate.
* [GOLD] icf_safe_so_testAlan Modra2018-12-082-24/+38
| | | | | | | | PR 21128 * testsuite/icf_safe_so_test.sh (check_fold): Rewrite to check multiple symbols at once. (arch_specific_safe_fold): Likewise, and call with the four foo* symbols expected to fold.
* gold: Provide more failed archive member info in error messageH.J. Lu2018-12-062-2/+16
| | | | | | | | | | | | | | When gold fails to get an archive member, its error message doesn't have information for 1. The failed archive member name. 2. The cause of failure: non-ELF object vs non-IR object. This patch adds the failed archive member name and non-ELF/non-IR info to gold error message. * archive.cc (Archive::get_elf_object_for_member): Also print archive member and non-ELF/non-IR info on error.
* gold won't build with gcc-9Alan Modra2018-12-052-1/+5
| | | | * symtab.h (Symbol::Symbol): Avoid -Wclass-memaccess warning.
* Restore build on x86_64-w64-mingw32.Alexey Neyman2018-12-035-4/+34
| | | | | | | | | | | gold/ PR gold/23594 * configure.ac: Add checks for link, mkdtemp. * configure: Regenerate. * config.in: Regenerate. * plugin.cc (Plugin_recorder::init): Fall back to mktemp if mkdtemp is not available. (link_or_copy_file): Fall back to copy if link() is not available.
* gold: Get alignment of uncompressed section from ch_addralignH.J. Lu2018-12-025-12/+42
| | | | | | | | | | | | | | | | | | | | | | The ELF compression header has a field (ch_addralign) that is set to the alignment of the uncompressed section. This way the section itself can have a different alignment than the decompressed section. Update decompress_input_section to get alignment of the decompressed section and use it when merging decompressed strings. PR binutils/23919 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Get addralign from decompressed_section_contents. * object.cc (build_compressed_section_map): Set info.addralign. (Object::decompressed_section_contents): Add a palign argument and store p->second.addralign in *palign if it isn't NULL. * object.h (Compressed_section_info): Add addralign. (section_is_compressed): Add a palign argument, default it to NULL, store p->second.addralign in *palign if it isn't NULL. (Object::decompressed_section_contents): Likewise. * output.cc (Output_section::add_input_section): Get addralign from section_is_compressed.
* [GOLD] justsyms_exec test fail on powerpc64Alan Modra2018-11-264-4/+11
| | | | | | | | | | | | | | This test fails on powerpc64le due to the justsyms_lib being built with exported_data at 0x2010000, apparently due to the powerpc target code generating an empty relro .branch_lt section. Since the test relies on the library having exported_data at 0x2000000, avoid the problem by linking with -z norelro. Also, the test doesn't need to avoid checking the function symbol on powerpc elfv2. * testsuite/Makefile.am (justsyms_lib): Link with -z norelro. * testsuite/Makefile.in: Regenerate. * testsuite/justsyms_exec.c (main): Do check exported_func on PowerPC64 ELFv2.
* [GOLD] support objdump -T display of st_otherAlan Modra2018-11-262-4/+9
| | | | | | | | | PowerPC64 ELFv2 uses the top 3 bits of st_other to encode a function's local entry point offset from its global entry point. Allow st_other bits except for visibility==default. * testsuite/ver_test_14.sh: Accept objdump -T display of st_other bits on powerpc64le.
* Make gold testsuite work with CC and CXX specifying -BAlan Modra2018-11-086-923/+933
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch allows the gold testsuite to pass when using something like the following configure line, which works for the rest of the binutils testsuite. At least, it does if you don't configure your gcc with any of the options that force a particular path to as or ld. gccdir="/home/alan/build/gcc/prev-" gccsrc="/home/alan/src/gcc.git" gcctarg="x86_64-linux" CC="${gccdir}gcc/xgcc -B${gccdir}gcc/" \ CXX="${gccdir}gcc/xg++ -B${gccdir}gcc/ -I${gccdir}$gcctarg/libstdc++-v3/include -I${gccdir}$gcctarg/libstdc++-v3/include/$gcctarg -I${gccsrc}/libstdc++-v3/libsupc++ -L${gccdir}$gcctarg/libstdc++-v3/src/.libs/" \ ~/src/binutils-gdb/configure ... gold's -Bgcctestdir/ option must come before the -B supplied by $CC or $CXX, in order to pick up the linker we want to test. Also when using a not-yet-installed gcc, it is necessary to provide a collect-ld in gcctestdir/ as otherwise a collect-ld script in -B${gccdir}gcc/ will be used and the wrong linker tested. Besides this, the patch fixes some bugs: The $COMPILE -D_FORTIFY_SOURCE edit was wrong (but worked for usual values), and the $CXXLINK_S edit unnecessarily but harmlessly used extra backslash quoting. See posix shell documentation regarding quoting, or www.gnu.org/software/bash/manual/bashref.html#Command-Substitution Also, -Bgcctestdir/ in one place makes it less likely a new test will be added that accidentally lacks the option. * Makefile.am (gcctestdir1/ld): Use $@ and absolute paths. (gcctestdir1/collect-ld): New. (ld1_DEPENDENCIES): Add gcctestdir1/collect-ld. (ld1_LDFLAGS): Remove -Bgcctestdir1/. (editcc1, ld1_LINK): Define. (gcctestdir2/ld, gcctestdir2/collect-ld, ld2_DEPENDENCIES), (ld2_LDFLAGS, editcc2, ld2_LINK), (ld1_r_DEPENDENCIES, ld1_r_LDFLAGS, ld1_r_LINK), (gcctestdir2-r/ld, gcctestdir2-r/collect-ld, ld2_r_DEPENDENCIES), (ld2_r_LDFLAGS, editcc2r, ld2_r_LINK), (gcctestdir3/ld, gcctestdir3/collect-ld, ld3_DEPENDENCIES), (ld3_LDFLAGS, editcc3, ld3_LINK), (gcctestdir4/ld, gcctestdir4/collect-ld, ld4_DEPENDENCIES), (ld4_LDFLAGS, editcc4, ld4_LINK): Similarly. * Makefile.in: Regenerate. * testsuite/Makefile.am (editcc): Define sed command to put our -B option first. Remove other occurrences of -Bgcctestdir/ throughout file. (editcc1): Define for -D_FORTIFY_SOURCE stripping. (editcc2): Define for -static-libgcc/libstdc++ stripping. (LINK1, CXXLINK1): Don't use CCLD or CXXLD. (CCLD, CXXLD, COMPILE, LINK, CXXCOMPILE, CXXLINK, CXXLINK_S): Define using editcc macros. (gcctestdir/collect-ld): New rule, add as a dependency of.. (gcctestdir/ld): ..this. Use $@ and abs_top_buildir. (gcctestdir/as): Use $@. * testsuite/Makefile.in: Regenerate. * testsuite/incremental_test.sh (actual): Match collect-ld too.
* [GOLD] make cleanAlan Modra2018-11-025-3/+24
| | | | | | | | | | Cleans a few more test files. * Makefile.am (MOSTLYCLEANFILES): Define. * Makefile.in: Regnerate. * testsuite/Makefile.am (MOSTLYCLEANFILES): Add ver_test_14 and gnu_property_test. * testsuite/Makefile.in: Regnerate.
* PR23769, mixing split-stack and non-split-stack error messageCherry Zhang2018-10-162-4/+15
| | | | | | | Corrects which file is reported as being split-stack. PR 23769 * gold.cc (queue_middle_tasks): Correct split-stack error message.