aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2022-12-23ld: Write linker symbols in PDBMark Harmstone3-34/+327
2022-12-23ld: Copy other symbols into PDB fileMark Harmstone5-0/+1076
2022-12-23ld: Write globals stream in PDBMark Harmstone9-40/+2230
2022-12-23ld: Parse LF_UDT_SRC_LINE records when creating PDB fileMark Harmstone8-10/+459
2022-12-23ld: Write types into IPI stream of PDBMark Harmstone8-18/+699
2022-12-23ld: Write types into TPI stream of PDBMark Harmstone8-22/+2270
2022-12-23ld: Write DEBUG_S_LINES entries in PDB fileMark Harmstone5-6/+204
2022-12-23ld: Fix segfault in populate_publics_streamMark Harmstone1-0/+3
2022-12-23ld: Write DEBUG_S_FILECHKSMS entries in PDBsMark Harmstone8-12/+709
2022-12-23ld: Generate PDB string tableMark Harmstone6-6/+472
2022-12-23pdb build fixesAlan Modra5-101/+156
Enable compilation of ld/pdb.c just for x86, as is done for bfd/pdb.c. This reduces the size of ld and is necessary with the following patches that call a COFF-only bfd function from ld/pdb.c. Without it we'd break every non-COFF target build.
2022-12-23COFF build-id writes uninitialised data to fileAlan Modra3-9/+5
1) The first write in write_build_id wrote rubbish past the struct external_IMAGE_DEBUG_DIRECTORY, which was later overwritten with correct data. No user visible problem there, except that tools like valgrind complain. 2) The size for the pdb name was incorrectly calculated. * emultempl/pe.em (write_build_id): Write the debug directory, not the entire section contents. (setup_build_id): Add size for the base name of pdb_name, not the full path. * emultempl/pep.em: Likewise. * testsuite/ld-pe/pdb2-section-contrib.d: Update.
2022-12-21Keep the .drectve section when performing a relocateable link.Nick Clifton3-2/+9
PR 29900 * scripttempl/pe.sc: Keep the .drectve section when performing a relocateable link. * scripttempl/pep.sc: Likewise.
2022-12-21enable-non-contiguous-regions warningsAlan Modra7-14/+40
The warning about discarded sections in elf_link_input_bfd doesn't belong there since the code is dealing with symbols. Multiple symbols in a discarded section will result in multiple identical warnings about the section. Move the warning to a new function in ldlang.c. The patch also tidies the warning quoting of section and file names, consistently using `%pA' and `%pB'. I'm no stickler for one style of section and file name quoting, but they ought to be consistent within a warning, eg. see the first one fixed in ldlang.c, and when a warning is emitted for multiple targets they all ought to use exactly the same format string to reduce translation work. elf64-ppc.c loses the build_one_stub errors since we won't get there before hitting the fatal errors in size_one_stub. bfd/ * elflink.c (elf_link_input_bfd): Don't warn here about discarded sections. * elf32-arm.c (arm_build_one_stub): Use consistent style in --enable-non-contiguous-regions error. * elf32-csky.c (csky_build_one_stub): Likewise. * elf32-hppa.c (hppa_build_one_stub): Likewise. * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise. * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise. * elf32-metag.c (metag_build_one_stub): Likewise. * elf32-nios2.c (nios2_build_one_stub): Likewise. * elfnn-aarch64.c (aarch64_build_one_stub): Likewise. * xcofflink.c (xcoff_build_one_stub): Likewise. * elf64-ppc.c (ppc_size_one_stub): Likewise. (ppc_build_one_stub): Delete dead code. ld/ * ldlang.c (lang_add_section): Use consistent style in --enable-non-contiguous-regions warnings. (size_input_section): Likewise. (warn_non_contiguous_discards): New function. (lang_process): Call it. * testsuite/ld-arm/non-contiguous-arm.d: Update. * testsuite/ld-arm/non-contiguous-arm4.d: Update. * testsuite/ld-arm/non-contiguous-arm7.d: Add --enable-non-contiguous-regions-warnings. * testsuite/ld-arm/non-contiguous-arm7.err: New. * testsuite/ld-powerpc/non-contiguous-powerpc.d: Update. * testsuite/ld-powerpc/non-contiguous-powerpc64.d: Update.
2022-12-20bfd: Discard symbol regardless of warning flagTorbjörn SVENSSON4-0/+53
The discard of symbols should be performed whether the warning for the discard is enabled or not. Without this patch, ld would segfault in bfd_section_removed_from_list, called in the if-statement right after this block, as the argument isec->output_section can be NULL. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
2022-12-18ld bootstrap test in build dir with path containing symlinksAlan Modra1-1/+1
This allows the bootstrap test to run if you have a symlink somewhere in the build path directory. $ld depends on $base_dir which is set via tcl [pwd], collapsing the symlink like /usr/bin/pwd, while $objdir contains the symlink. * testsuite/ld-bootstrap/bootstrap.exp: Normalize paths when checking for ld build directory.
2022-12-14Fix haiku ld dependenciesAlan Modra5-8/+8
I noticed after commit 8ad93045ed, "ld, gold: remove support for -z bndplt (MPX prefix)", that some of my builds were failing with eelf_x86_64_haiku.c:650:9: error: no member named 'bndplt' in 'struct elf_linker_x86_params' params.bndplt = true; ~~~~~~ ^ * emulparams/aarch64haiku.sh: Use "source_sh" rather than ".". * emulparams/armelf_haiku.sh: Likewise. * emulparams/elf32ppchaiku.sh: Likewise. * emulparams/elf_mipsel_haiku.sh: Likewise. * emulparams/elf_x86_64_haiku.sh: Likewise.
2022-12-14ld, gold: remove support for -z bndplt (MPX prefix)Martin Liska47-1378/+2
bfd/ChangeLog: * elf-linker-x86.h (struct elf_linker_x86_params): Remove bndplt. * elf64-x86-64.c (elf_x86_64_scan_relocs): Ignore R_X86_64_PLT32_BND. (elf_x86_64_relocate_section): Similarly here. (elf_x86_64_link_setup_gnu_properties): Ignore bndplt. * elfxx-x86.c: Likewise. * elfxx-x86.h: Likewise. gold/ChangeLog: * NEWS: Document -z bndplt. * options.h (class General_options): Remove bndplt option. * x86_64.cc (class Output_data_plt_x86_64_bnd): Remove. (Target_x86_64::do_make_data_plt): Do not use Output_data_plt_x86_64_bnd. (Target_x86_64::Scan::get_reference_flags): Likewise. (Target_x86_64::Scan::check_non_pic): Likewise. (Target_x86_64::Scan::local): Likewise. (Target_x86_64::Scan::global): Likewise. ld/ChangeLog: * NEWS: Document -z bndplt. * emulparams/elf_x86_64.sh: Remove bndplt option. * ld.texi: Likewise. * testsuite/ld-x86-64/x86-64.exp: * testsuite/ld-x86-64/bnd-branch-1-now.d: Removed. * testsuite/ld-x86-64/bnd-branch-1.d: Removed. * testsuite/ld-x86-64/bnd-branch-1.s: Removed. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-1.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-1.s: Removed. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-2.d: Removed. * testsuite/ld-x86-64/bnd-ifunc-2.s: Removed. * testsuite/ld-x86-64/bnd-plt-1-now.d: Removed. * testsuite/ld-x86-64/bnd-plt-1.d: Removed. * testsuite/ld-x86-64/mpx.exp: Removed. * testsuite/ld-x86-64/mpx1.out: Removed. * testsuite/ld-x86-64/mpx1a.c: Removed. * testsuite/ld-x86-64/mpx1a.rd: Removed. * testsuite/ld-x86-64/mpx1b.c: Removed. * testsuite/ld-x86-64/mpx1c.c: Removed. * testsuite/ld-x86-64/mpx1c.rd: Removed. * testsuite/ld-x86-64/mpx2.out: Removed. * testsuite/ld-x86-64/mpx2a.c: Removed. * testsuite/ld-x86-64/mpx2a.rd: Removed. * testsuite/ld-x86-64/mpx2b.c: Removed. * testsuite/ld-x86-64/mpx2c.c: Removed. * testsuite/ld-x86-64/mpx2c.rd: Removed. * testsuite/ld-x86-64/mpx3.dd: Removed. * testsuite/ld-x86-64/mpx3a.s: Removed. * testsuite/ld-x86-64/mpx3b.s: Removed. * testsuite/ld-x86-64/mpx3n.dd: Removed. * testsuite/ld-x86-64/mpx4.dd: Removed. * testsuite/ld-x86-64/mpx4a.s: Removed. * testsuite/ld-x86-64/mpx4b.s: Removed. * testsuite/ld-x86-64/mpx4n.dd: Removed. * testsuite/ld-x86-64/pr20800a.S: Removed. * testsuite/ld-x86-64/pr20800b.S: Removed. * testsuite/ld-x86-64/pr21038a-now.d: Removed. * testsuite/ld-x86-64/pr21038a.d: Removed. * testsuite/ld-x86-64/pr21038a.s: Removed. * testsuite/ld-x86-64/pr21038b-now.d: Removed. * testsuite/ld-x86-64/pr21038b.d: Removed. * testsuite/ld-x86-64/pr21038b.s: Removed. * testsuite/ld-x86-64/pr21038c-now.d: Removed. * testsuite/ld-x86-64/pr21038c.d: Removed. * testsuite/ld-x86-64/pr21038c.s: Removed.
2022-12-08x86-64: Remove BND from 64-bit IBT PLTH.J. Lu12-69/+57
Since MPX support has been removed from x86-64 psABI, remove BND from 64-bit IBT PLT by using x32 IBT PLT. bfd/ PR ld/29851 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Also check x32 IBT PLT for 64-bit. (elf_x86_64_link_setup_gnu_properties): Always use x32 IBT PLT. ld/ PR ld/29851 * testsuite/ld-x86-64/ibt-plt-1.d: Updated. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d.d: Likewise. * testsuite/ld-x86-64/plt-main-ibt-x32.dd: Moved to ... * testsuite/ld-x86-64/plt-main-ibt.dd: This. * testsuite/ld-x86-64/x86-64.exp: Don't use plt-main-ibt-x32.dd.
2022-12-08Update the description of the linker script's TYPE directive.Nick Clifton2-0/+30
PR 29861 * ld.texi (Output Section Type): Note that setting the output section type only works if the section contains untyped data.
2022-12-07Compression tidy and fixesAlan Modra4-13/+23
Tidies: - Move stuff from bfd-in.h and libbfd.c to compress.c - Delete COMPRESS_DEBUG from enum compressed_debug_section_type - Move compress_debug field out of link_info to ld_config. Fixes: - Correct test in bfd_convert_section_setup to use obfd flags, not ibfd. - Apply bfd_applicable_file_flags to compression bfd flags added by gas and ld to the output bfd. bfd/ * bfd-in.h (enum compressed_debug_section_type), (struct compressed_type_tuple), (bfd_get_compression_algorithm), (bfd_get_compression_algorithm_name), * libbfd.c (compressed_debug_section_names), (bfd_get_compression_algorithm), (bfd_get_compression_algorithm_name): Move.. * compress.c: ..to here, deleting COMPRESS_DEBUG from enum compressed_debug_section_type. (bfd_convert_section_setup): Test obfd flags not ibfd for compression flags. * elf.c (elf_fake_sections): Replace link_info->compress_debug test with abfd->flags test. * bfd-in2.h: Regenerate. binutils/ * objcopy.c (copy_file): Tidy setting of bfd compress flags. Expand comment. gas/ * write.c (compress_debug): Test bfd compress flags rather than flag_compress_debug. (write_object_file): Apply bfd_applicable_file_flags to compress debug flags added to output bfd. include/ * bfdlink.h (struct bfd_link_info): Delete compress_debug. ld/ * ld.h (ld_config_type): Add compress_debug. * emultempl/elf.em: Replace references to link_info.compress_debug with config.compress_debug. * lexsup.c (elf_static_list_options): Likewise. * ldmain.c (main): Likewise. Apply bfd_applicable_file_flags to compress debug flags added to output bfd.
2022-12-05Prevent an illegal memory access when comparing the prefix of a section name ↵Nick Clifton2-5/+27
regexp. PR 29849 * ldlang.c (spec_match): Check that there is sufficient length in the target name to match the spec's prefix.
2022-12-03Revert "ld: Add .note.GNU-stack to ld-plugin/dummy.s"H.J. Lu1-1/+1
This reverts commit 44e59b5a7d8a874f6546a1471b8a003911853aa0. It works only for ELF targets.
2022-12-03ld: Add .note.GNU-stack to ld-plugin/dummy.sH.J. Lu1-1/+1
* testsuite/ld-plugin/dummy.s: Add .note.GNU-stack.
2022-11-30section-select: Fix exclude-file-3Michael Matz2-4/+7
this testcase wasn't correctly testing everything, it passed, even though sections from an excluded file were included. Fixing this reveals a problem in the new section selector. This fixes that as well.
2022-11-30section-select: Remove unused codeMichael Matz2-509/+1
walk_wild_file, hence walk_wild_section and walk_wild_section_handler aren't called with the prefix tree. Hence initialization of the latter and all potential special cases for it aren't used anymore. That also removes the need to handler_data[] and some associated helper functions. So, remove all of that.
2022-11-30section-select: Implement a prefix-treeMichael Matz2-33/+316
Now that we have a list of potentially matching sections per wild statement we can actually pre-fill that one by going once over all input sections and match their names against a prefix-tree that points to the potentially matching wild statements. So instead of looking at all sections names for each glob for each wild statement we now look at the sections only once and then only check against those globs that have a possibility of a match at all (usually only one or two). This pushes the whole section selection off the profiles.
2022-11-30section-select: Completely rebuild matchesMichael Matz1-0/+22
The check_relocs callback (and others) might have created new section behind our back and some of them (e.g. on powerpc the "linker stubs" .got) need to come in front of all others, despite being created late (a symptom would be "TOC opt*" failing on powerpc). This resets all section matches before updating for newly created sections (i.e. completely rebuilds the matches).
2022-11-30section-select: Lazily resolve section matchesMichael Matz2-1/+99
and remember the results. Before this the order of section matching is basically: foreach script-wild-stmt S foreach pattern P of S foreach inputfile I foreach section S of I match S against P if match: do action for S And this process is done three or four times: for each top-level call to walk_wild() or wild(), that is: check_input_sections, lang_gc_sections, lang_find_relro_sections and of course map_input_to_output_sections. So we iterate over all sections of all files many many times (for each glob). Reality is a bit more complicated (some special glob types don't need the full iteration over all sections, only over all files), but that's the gist of it. For future work this shuffles the whole ordering a bit by lazily doing the matching process and memoizing results, trading a little memory for a 75% speedup of the overall section selection process. This lazy resolution introduces a problem with sections added late that's corrected in the next patch.
2022-11-30Correct ordering problem in comm-data.expAlan Modra1-20/+19
* testsuite/ld-elf/comm-data.exp: Build libcomm-data.so before attempting to read it to set ELF64.
2022-11-28xtensa: allow dynamic configurationMax Filippov1-9/+1
Import include/xtensa-dynconfig.h that defines XCHAL_* macros as fields of a structure returned from the xtensa_get_config_v<x> function call. Define that structure and fill it with default parameter values specified in the include/xtensa-config.h. Define reusable function xtensa_load_config that tries to load configuration and return an address of an exported object from it. Define functions xtensa_get_config_v{1,2} that use xtensa_load_config to get structures xtensa_config_v{1,2}, either dynamically configured or the default. bfd/ * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Append xtensa-dynconfig.c. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac (xtensa_elf32_be_vec, xtensa_elf32_le_vec): Add xtensa-dynconfig.lo to the tb. * elf32-xtensa.c (xtensa-config.h): Replace #include with xtensa-dynconfig.h. (XSHAL_ABI, XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): Remove definitions. * xtensa-dynconfig.c: New file. * xtensa-isa.c (xtensa-dynconfig.h): New #include. (xtensa_get_modules): New function. (xtensa_isa_init): Call xtensa_get_modules instead of taking address of global xtensa_modules. gas/ * config/tc-xtensa.c (xtensa-config.h): Replace #include with xtensa-dynconfig.h. (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0, XTENSA_MARCH_EARLIEST): Remove definitions. * config/tc-xtensa.h (xtensa-config.h): Replace #include with xtensa-dynconfig.h. * config/xtensa-relax.c (xtensa-config.h): Replace #include with xtensa-dynconfig.h. (XCHAL_HAVE_WIDE_BRANCHES): Remove definition. include/ * xtensa-dynconfig.h: New file. ld/ * emultempl/xtensaelf.em (xtensa-config.h): Replace #include with xtensa-dynconfig.h. (XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): Remove definitions.
2022-11-28Only use wild_sort_fastMichael Matz6-178/+163
there's no reason why the tree-based variant can't always be used when sorting is required, it merely needs to also support filename sorting and have a fast path for insertion at end (aka rightmost tree leaf). The filename sorting isn't tested anywhere and the only scripttempl that uses it is avr (for 'SORT(*)(.ctors)'), and I believe even there it was a mistake. Either way, this adds a testcase for filename sorting as well. Then the non-BST based sorting can be simplified to only support the fast case of no sorting required at all (at the same time renaming the two variants to _sort and _nosort).
2022-11-28Special case more simple patternsMichael Matz2-33/+95
fnmatch is slow, so avoiding it in more cases is good. This implements a more generic version of match_simple_wild which needs some pre-processing of patterns. In particular it supports patterns of the form PREFIX*SUFFIX (where all parts are optional), i.e. a super set of what's handled now. Most section matchers of this form and hence don't need any calls to fnmatch anymore. We retain the implementation of match_simple_wild for the filename matchers (they aren't called often enough to matter).
2022-11-28Use bfd_rename_section in msp430.emAlan Modra2-1/+7
* emultempl/msp430.em (add_region_prefix <REGION_EITHER>): Use bfd_rename_section. * testsuite/ld-msp430-elf/msp430-tiny-rom.ld: Handle varian data and bss input sections.
2022-11-23ld: Add section contributions substream to PDB filesMark Harmstone6-5/+162
2022-11-22x86: Don't define _TLS_MODULE_BASE_ for ld -rH.J. Lu3-0/+19
bfd/ PR ld/29820 * elfxx-x86.c (_bfd_x86_elf_always_size_sections): Don't define _TLS_MODULE_BASE_ for ld -r. ld/ PR ld/29820 * testsuite/ld-x86-64/pr29820.d: New file. * testsuite/ld-x86-64/pr29820.s: Likewise. * testsuite/ld-x86-64/x86-64.ex: Run pr29820.
2022-11-17ld: Always call elf_backend_output_arch_local_symsH.J. Lu2-0/+36
Always call elf_backend_output_arch_local_syms since only the backend knows if elf_backend_output_arch_local_syms is needed when all symbols are striped. elf_backend_output_arch_local_syms is defined only for x86, ARM and AARCH64. On x86, elf_backend_output_arch_local_syms must be called to handle local IFUNC symbols even if all symbols are striped. Update ARM and AARCH64 to skip elf_backend_output_arch_local_syms when symbols aren't needed. bfd/ PR ld/29797 * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip if symbols aren't needed. * elfnn-aarch64.c (elfNN_aarch64_output_arch_local_syms): Likewise. * elflink.c (bfd_elf_final_link): Always call elf_backend_output_arch_local_syms if available. ld/ PR ld/29797 * testsuite/ld-elf/linux-x86.exp: Run PR ld/29797 test. * testsuite/ld-elf/pr29797.c: New file.
2022-11-15bfd: linker: merge .sframe sectionsIndu Bhagat23-7/+342
The linker merges all the input .sframe sections. When merging, the linker verifies that all the input .sframe sections have the same abi/arch. The linker uses libsframe library to perform key actions on the .sframe sections - decode, read, and create output data. This implies buildsystem changes to make and install libsframe before libbfd. The linker places the output .sframe section in a new segment of its own: PT_GNU_SFRAME. A new segment is not added, however, if the generated .sframe section is empty. When a section is discarded from the final link, the corresponding entries in the .sframe section for those functions are also deleted. The linker sorts the SFrame FDEs on start address by default and sets the SFRAME_F_FDE_SORTED flag in the .sframe section. This patch also adds support for generation of SFrame unwind information for the .plt* sections on x86_64. SFrame unwind info is generated for IBT enabled PLT, lazy/non-lazy PLT. The existing linker option --no-ld-generated-unwind-info has been adapted to include the control of whether .sframe unwind information will be generated for the linker generated sections like PLT. Changes to the linker script have been made as necessary. ChangeLog: * Makefile.def: Add install dependency on libsframe for libbfd. * Makefile.in: Regenerated. * bfd/Makefile.am: Add elf-sframe.c * bfd/Makefile.in: Regenerated. * bfd/bfd-in2.h (SEC_INFO_TYPE_SFRAME): Regenerated. * bfd/configure: Regenerate. * bfd/configure.ac: Add elf-sframe.lo. * bfd/elf-bfd.h (struct sframe_func_bfdinfo): New struct. (struct sframe_dec_info): Likewise. (struct sframe_enc_info): Likewise. (struct elf_link_hash_table): New member for encoded .sframe object. (struct output_elf_obj_tdata): New member. (elf_sframe): New access macro. (_bfd_elf_set_section_sframe): New declaration. * bfd/elf.c (get_segment_type): Handle new segment PT_GNU_SFRAME. (bfd_section_from_phdr): Likewise. (get_program_header_size): Likewise. (_bfd_elf_map_sections_to_segments): Likewise. * bfd/elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Add contents to the .sframe sections or .plt* entries. * bfd/elflink.c (elf_section_ignore_discarded_relocs): Handle SEC_INFO_TYPE_SFRAME. (_bfd_elf_default_action_discarded): Handle .sframe section. (elf_link_input_bfd): Merge .sframe section. (bfd_elf_final_link): Write the output .sframe section. (bfd_elf_discard_info): Handle discarding .sframe section. * bfd/elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Create .sframe section for .plt and .plt.sec. (_bfd_x86_elf_finish_dynamic_sections): Handle .sframe from .plt* sections. * bfd/elfxx-x86.h (PLT_SFRAME_FDE_START_OFFSET): New definition. (SFRAME_PLT0_MAX_NUM_FRES): Likewise. (SFRAME_PLTN_MAX_NUM_FRES): Likewise. (struct elf_x86_sframe_plt): New structure. (struct elf_x86_link_hash_table): New member. (struct elf_x86_init_table): New members for .sframe creation. * bfd/section.c: Add new definition SEC_INFO_TYPE_SFRAME. * binutils/readelf.c (get_segment_type): Handle new segment PT_GNU_SFRAME. * ld/ld.texi: Update documentation for --no-ld-generated-unwind-info. * ld/scripttempl/elf.sc: Support .sframe sections. * ld/Makefile.am (TESTSFRAMELIB): Use it. (check-DEJAGNU): Likewise. * ld/Makefile.in: Regenerated. * ld/configure.ac (TESTSFRAMELIB): Set to the .so or .a like TESTBFDLIB. * ld/configure: Regenerated. * bfd/elf-sframe.c: New file. include/ChangeLog: * elf/common.h (PT_GNU_SFRAME): New definition. * elf/internal.h (struct elf_segment_map): Handle new segment type PT_GNU_SFRAME. ld/testsuite/ChangeLog: * ld/testsuite/ld-bootstrap/bootstrap.exp: Add SFRAMELIB. * ld/testsuite/ld-aarch64/aarch64-elf.exp: Add new test sframe-simple-1. * ld/testsuite/ld-aarch64/sframe-bar.s: New file. * ld/testsuite/ld-aarch64/sframe-foo.s: Likewise. * ld/testsuite/ld-aarch64/sframe-simple-1.d: Likewise. * ld/testsuite/ld-sframe/sframe-empty.d: New test. * ld/testsuite/ld-sframe/sframe-empty.s: New file. * ld/testsuite/ld-sframe/sframe.exp: New testsuite. * ld/testsuite/ld-x86-64/sframe-bar.s: New file. * ld/testsuite/ld-x86-64/sframe-foo.s: Likewise. * ld/testsuite/ld-x86-64/sframe-simple-1.d: Likewise. * ld/testsuite/ld-x86-64/sframe-plt-1.d: Likewise. * ld/testsuite/ld-x86-64/sframe-simple-1.d: Likewise. * ld/testsuite/ld-x86-64/x86-64.exp: Add new tests - sframe-simple-1, sframe-plt-1. * ld/testsuite/lib/ld-lib.exp: Add new proc to check if assembler supports SFrame section. * ld/testsuite/ld-sframe/discard.d: New file. * ld/testsuite/ld-sframe/discard.ld: Likewise. * ld/testsuite/ld-sframe/discard.s: Likewise.
2022-11-14pru: bfd: Correct default to no execstackDimitar Dimitrov1-0/+1
Data and instruction memories are strictly separated, so it is not possible to execute instructions from the stack memory on PRU. I don't see any difference in testsuite results with or without this change. bfd/ChangeLog: * elf32-pru.c (elf_backend_default_execstack): Define as 0. ld/ChangeLog: * testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Return 0 for pru. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-11-10ld/testsuite: skip ld-size when -shared is not supportedClément Chigot1-0/+6
ld/ChangeLog: * testsuite/ld-size/size.exp: Skip when -shared is not supported.
2022-11-10ld: Add module information substream to PDB filesMark Harmstone5-44/+427
2022-11-07configure: require libzstd >= 1.4.0Christophe Lyon1-10/+10
gas uses ZSTD_compressStream2 which is only available with libzstd >= 1.4.0, leading to build errors when an older version is installed. This patch updates the check libzstd presence to check its version is >= 1.4.0. However, since gas seems to be the only component requiring such a recent version this may imply that we disable ZSTD support for all components although some would still benefit from an older version. I ran 'autoreconf -f' in all directories containing a configure.ac file, using vanilla autoconf-2.69 and automake-1.15.1. I noticed several errors from autoheader in readline, as well as warnings in intl, but they are unrelated to this patch. This should fix some of the buildbots. OK for trunk? Thanks, Christophe
2022-11-07ld/testsuite: skip tests related to -shared when disabledClément Chigot3-0/+15
Call the helper function "check_shared_lib_support" to ensure -shared is enabled before launching ld-shared, ld-elfweak and ld-elfvers. This allows to catch custom targets explicitly disabling it. ld/ChangeLog: * testsuite/ld-elfvers/vers.exp: Call check_shared_lib_support. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise.
2022-11-03V850 Linker: do not complain about RWX segments.Nick Clifton2-2/+9
PR 29748 * configure.tgt (ac_default_ld_warn_rwx_segments): Set to 0 for the V850.
2022-11-03AVR Linker: Allow the start of the data region to be specified on the linker ↵Nick Clifton1-1/+1
command line. [Fix PR number in ChangeLog entry] PR 29741 * scripttempl/avr.sc (__DATA_REGION_ORIGIN__): Define. If a value has not been provided on the command line then use DATA_ORIGIN. (MEMORY): Use __DATA_REGION_ORIGIN__ as the start of the data region.
2022-11-03AVR Linker: Allow the start of the data region to specified on the command line.Nick Clifton2-1/+10
PR 29471 * scripttempl/avr.sc (__DATA_REGION_ORIGIN__): Define. If a value has not been provided on the command line then use DATA_ORIGIN. (MEMORY): Use __DATA_REGION_ORIGIN__ as the start of the data region.
2022-11-02arm: PR 29739 Fix typo where ';' should not have been replaced with '@'Christophe Lyon3-3/+3
';' does not always indicate the start of a comment, and commit 8cb6e17571f3fb66ccd4fa19f881602542cd06fc incorrectly replaced 3 instances of ';' with '@' in expected diagnostics, leading to tests failures. This patch restores the original ';' as needed in these testcases. Fixes bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29739
2022-11-01opcodes/arm: use '@' consistently for the comment characterAndrew Burgess115-1209/+1209
Looking at the ARM disassembler output, every comment seems to start with a ';' character, so I assumed this was the correct character to start an assembler comment. I then spotted a couple of places where there was no ';', but instead, just a '@' character. I thought that this was a case of a missing ';', and proposed a patch to add the missing ';' characters. Turns out I was wrong, '@' is actually the ARM assembler comment character, while ';' is the statement separator. Thus this: nop ;@ comment is two statements, the first is the 'nop' instruction, while the second contains no instructions, just the '@ comment' comment text. This: nop @ comment is a single 'nop' instruction followed by a comment. And finally, this: nop ; comment is two statements, the first contains the 'nop' instruction, while the second contains the instruction 'comment', which obviously isn't actually an instruction at all. Why this matters is that, in the next commit, I would like to add libopcodes syntax styling support for ARM. The question then is how should the disassembler style the three cases above? As '@' is the actual comment start character then clearly the '@' and anything after it can be styled as a comment. But what about ';' in the second example? Style as text? Style as a comment? And the third example is even harder, what about the 'comment' text? Style as an instruction mnemonic? Style as text? Style as a comment? I think the only sensible answer is to move the disassembler to use '@' consistently as its comment character, and remove all the uses of ';'. Then, in the next commit, it's obvious what to do. There's obviously a *lot* of tests that get updated by this commit, the only actual code changes are in opcodes/arm-dis.c.
2022-10-31Updated Romainain translation for the binutils sub-directory and Swedish ↵Nick Clifton1-2180/+2911
translations for the ld and opcodes sub-directories.
2022-10-31ld: Add publics stream to PDB filesMark Harmstone6-8/+559