aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2023-12-25LoongArch: Add testsuit for DESC and tls transition and tls relaxation.Lulu Cai13-0/+258
2023-12-25LoongArch: Add support for TLS LD/GD/DESC relaxationmengqinggang2-252/+259
The pcalau12i + addi.d of TLS LD/GD/DESC relax to pcaddi. Relaxation is only performed when the TLS model transition is not possible.
2023-12-22LoongArch: Add support for the third expression of .align for R_LARCH_ALIGNmengqinggang8-4/+35
If the symbol index is not zero, the addend is used to represent the first and the third expressions of the .align. The lowest 8 bits are used to represent the first expression. Other bits are used to represent the third expression. The addend of R_LARCH_ALIGN for ".align 5, ,4" is 0x405. The addend of R_LARCH_ALIGN for ".balign 32, ,4" is 0x405.
2023-12-21ld: Add lib32 directories for 32-bit emulation on FreeBSD/amd64Rainer Orth2-0/+13
GNU ld currently fails to link 32-bit executables on FreeBSD/amd64 when the linked libraries have dependencies on shared objects themselves: $ gcc -m32 -o ei ei.c -lexecinfo /var/gcc/binutils/amd64/lib/gcc/amd64-pc-freebsd14.0/13.2.0/../../../../amd64-pc-freebsd14.0/bin/ld: warning: libelf.so.2, needed by /usr/lib/../lib32/libexecinfo.so, not found (try using -rpath or -rpath-link) /var/gcc/binutils/amd64/lib/gcc/amd64-pc-freebsd14.0/13.2.0/../../../../amd64-pc-freebsd14.0/bin/ld: /usr/lib/../lib32/libexecinfo.so: undefined reference to `elf_begin@R1.0' [...] Fixed by handling FreeBSD/amd64 like Linux/x86. Tested on amd64-pc-freebsd14.0.
2023-12-18ld: Print 0 size in B and not in GBTorbjörn SVENSSON3-1/+5
When using --print-memory-usage, the printed size can be zero and in that case, the unit should be B and not GB. ld/ * ldlang.c (lang_print_memory_size) Print 0 B instead of 0 GB. * testsuite/ld-scripts/print-memory-usage-1.l: Validate emplty region. * testsuite/ld-scripts/print-memory-usage-1.t: Define empty region. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2023-12-18PR31162, Memory Leak in ldwrite.cAlan Modra1-6/+11
This isn't a particularly worrying memory leak, but fix it anyway. PR 31162 * ldwrite.c (build_link_order): Use bfd_alloc rather than xmalloc. Add %E to error messages.
2023-12-18LoongArch: Add call36 and tail36 pseudo instructions for medium code modelmengqinggang1-0/+2
For tail36, it is necessary to explicitly indicate the temporary register. Therefore, the compiler and users will know that the tail will use a register. call36 func pcalau18i $ra, %call36(func) jirl $ra, $ra, 0; tail36 $t0, func pcalau18i $t0, %call36(func) jirl $zero, $t0, 0;
2023-12-18LoongArch: Add new relocation R_LARCH_CALL36mengqinggang2-0/+19
R_LARCH_CALL36 is used for medium code model function call pcaddu18i+jirl, and these two instructions must adjacent. The LoongArch ABI v2.20 at here: https://github.com/loongson/la-abi-specs.
2023-12-18PR31177: Let region text start at __TEXT_REGION_ORIGIN___Georg-Johann Lay1-1/+2
The start of MEMORY region text currently starts hard-coded at 0. The linker can produce more exact diagnostics when it knows the exact placements of the memory regions. For some old devices, program memory starts at 0x8000, so allow to specify program memory start at __TEXT_REGION_ORIGIN__ similar to how the data region is described. If ok, please apply to master. This one is also fine to back-port. Johann -- AVR: Use __TEXT_REGION_ORIGIN__ as start for MEMORY region text. ld/ PR 31177 * scripttempl/avr.sc (__TEXT_REGION_ORIGIN__): New symbol. (MEMORY): Use as start address for the text region.
2023-12-15Addendum to PR31124Georg-Johann Lay1-23/+37
This is a small addendum to PR31124 "rodata in flash for more AVR devices". It adds some symbols so the startup code can set a lock on the FLMAP bit field as specified by the user. New symbols are introduced because otherwise, all the computations / decisions would have to be performed at run-time. It approved, please apply to master. Johann -- ld/ PR 31124 * scripttempl/avr.sc: Adjust comments. [MAYBE_FLMAP]: Add symbols __flmap_value and __flmap_value_with_lock. Remove __flmap_lsl4.
2023-12-15regen ld POTFILESAlan Modra1-0/+2
2023-12-13Update Make const_1_mode print $1 in AT&T syntaxH.J. Lu1-1/+1
commit b70a487d5945b13e5ab503be4fc37b964819ec0e Author: Cui, Lili <lili.cui@intel.com> Date: Wed Dec 13 06:07:36 2023 +0000 Make const_1_mode print $1 in AT&T syntax changes disassembler output from d1 f8 sar %eax to d1 f8 sar $1,%eax Adjust pe-x86-64-6.od accordingly. * testsuite/ld-x86-64/pe-x86-64-6.od: Adjusted.
2023-12-12Support rodata in flash for more AVR devicesGeorg-Johann Lay9-5/+202
PR 31124 * Makefile.am (ALL_EMULATION_SOURCES): Add eavrxmega2_flmap.c and eavrxmega4_flmap.c. * Makefile.in: Regenerate. * configure.tgt: Add eavrxmega2_flmap and eavrxmega4_flmap to avr's targ_extra_emuls list. * emulparams/avrxmega2.sh (MAYBE_FLMAP): Define. * emulparams/avrxmega2_flmap.sh: New file. * emulparams/avrxmega4.sh (MAYBE_FLMAP): Define. * emulparams/avrxmega4_flmap.sh: New file. * scripttempl/avr.sc: Add support for HAVE_FLMAP.
2023-12-11R_MICROMIPS_GPREL7_S2Alan Modra2-2/+2
This reloc is meant for the 16-bit LWGP instruction, 0x6400/0xfc00 match/mask encoding in `micromips_opcodes'. It is correctly specified to operate on a half-word by the howtos in elf32-mips.c, elfn32-mips.c and elf64-mips.c, but is incorrectly subject to shuffle/unshuffle in code like _bfd_mips_elf32_gprel16_reloc. Current behaviour when applying the reloc to .byte 0x11,0x22,0x33,0x44 is to apply the reloc to byte 0x22 when big-endian, and to byte 0x33 when little-endian. Big-endian behaviour is unchanged after this patch and little-endian correctly applies the reloc to byte 0x11. The patch also corrects REL addend extraction from section contents, and overflow checking. gold had all of the bfd problems with this reloc and additionally did not apply the rightshift by two. bfd/ * elfxx-mips.c (micromips_reloc_shuffle_p): Return false for R_MICROMIPS_GPREL7_S2. (mips_elf_calculate_relocation): Correct sign extension and overflow calculation for R_MICROMIPS_GPREL7_S2. (_bfd_mips_elf_relocate_section): Update small-data overflow message. gold/ * mips.cc (Mips_relocate_functions::should_shuffle_micromips_reloc): Return false for R_MICROMIPS_GPREL7_S2. (Mips_relocate_functions::mips_reloc_unshuffle): Update comment. (Mips_relocate_functions::relgprel): Remove R_MICROMIPS_GPREL7_S2 handling. (Mips_relocate_functions::relgprel7): New function. (Target_mips::Relocate::relocate): Adjust to suit. ld/ * testsuite/ld-mips-elf/reloc-4.d: Adjust expected error. * testsuite/ld-mips-elf/reloc-5.d: Likewise.
2023-12-05aarch64-elf: FAIL: indirect call stub to BTI stub relaxationAlan Modra1-26/+25
aarch64-elf fails the ld-aarch64/bfd-far-3.d test, due to the stubs being emitted in a different order to that of aarch64-linux. They are emitted in a different order due to stub names for local symbols having the section id in the stub name. aarch64-linux-ld generates one more section than aarch64-elf-ld. That section is .gnu.hash. So the stub names differ and are hashed to different slots in stub_hash_table. Fix this by running the test with --hash-style=sysv, and adjust expected output. I've also changed the branch over stubs emitted at the start of a group of stubs to not care about the symbol, for all groups not just the one that needed changing. * ld-aarch64/bti-far-3.d: Add --hash-style=sysv. Adjust expected output.
2023-12-01Fix ld/x86: reduce testsuite dependency on system object filesH.J. Lu1-10/+10
commit eab996435fe65a421541f59557c5f1fd427573a3 Author: Jan Beulich <jbeulich@suse.com> Date: Tue Nov 7 13:58:32 2023 +0100 ld/x86: reduce testsuite dependency on system object files changed some C compiler tests to assembler/linker tests which introduced 2 problems: 1. It broke x32 binutils tests since --64 was passed to assembler, but -m elf_x86_64 wasn't passed to linker. 2. -nostdlib was passed to C compiler driver to exclude standard run-time files which should be avoided with -r option for linker tests. Fix them by passing -m elf_x86_64 to linker and removing -nostdlib for linker tests with -r. PR ld/30722 * testsuite/ld-x86-64/x86-64.exp: Pass -m elf_x86_64 to linker for tests with --64. Remove -nostdlib for tests with -r.
2023-12-01ld: fix build with old makeinfoJan Beulich1-0/+1
Makeinfo 4.12 is unhappy about the new "Special Sections" without that also having a @chapter line.
2023-11-28libiberty, ld: Use x86 HW optimized sha1Jakub Jelinek2-1/+7
The following patch attempts to use x86 SHA ISA if available to speed up in my testing about 2.5x sha1 build-id processing (in my case on AMD Ryzen 5 3600) while producing the same result. I believe AArch64 has similar HW acceleration for SHA1, perhaps it could be added similarly. Note, seems lld uses BLAKE3 rather than md5/sha1. I think it would be a bad idea to lie to users, if they choose --buildid=sha1, we should be using SHA1, not some other checksum, but perhaps we could add some other --buildid= styles and perhaps make one of the new the default. Tested on x86_64-linux, both on Intel i9-7960X (which doesn't have sha_ni ISA support) without/with the patch and on AMD Ryzen 5 3600 (which does have it) without/with the patch. 2023-11-28 Jakub Jelinek <jakub@redhat.com> include/ * sha1.h (sha1_process_bytes_fn): New typedef. (sha1_choose_process_bytes): Declare. libiberty/ * configure.ac (HAVE_X86_SHA1_HW_SUPPORT): New check. * sha1.c: If HAVE_X86_SHA1_HW_SUPPORT is defined, include x86intrin.h and cpuid.h. (sha1_hw_process_bytes, sha1_hw_process_block, sha1_choose_process_bytes): New functions. * config.in: Regenerated. * configure: Regenerated. ld/ * ldbuildid.c (generate_build_id): Use sha1_choose_process_bytes () instead of &sha1_process_bytes.
2023-11-28New Romanian translation for ldNick Clifton2-0/+6921
2023-11-21Fix: symbols eliminated by --gc-sections still trigger warnings for ↵Nick Clifton1-6/+6
gnu.warning.SYM PR 31067 Fix typo in previous delta: defined -> referenced.
2023-11-21Fix: symbols eliminated by --gc-sections still trigger warnings for ↵Nick Clifton2-0/+52
gnu.warning.SYM PR 31067 * linker.c (_bfd_generic_link_add_one_symbol): When issuing a warning message, also display a message about the warning not being affected by garbage colleciton. * ld.texi (Special Sections): New entry in the linker manual. Describes how the .gnu.warning and .gnu.warning.SYM sections behave.
2023-11-17LoongArch: Add more relaxation testcasesmengqinggang4-5/+103
1. .so relaxation testcase 2. ld --no-relax testcase 3. segment alignment testcase
2023-11-17LoongArch: Modify link_info.relax_pass from 3 to 2mengqinggang1-1/+1
The first pass handles R_LARCH_RELAX relocations, the second pass handles R_LARCH_ALIGN relocations.
2023-11-17LoongArch: Remove "elf_seg_map (info->output_bfd) == NULL" relaxation conditionmengqinggang1-0/+18
Previously the condition prevented shared objects from being relaxed. To remove the limitation, we need to update program header size and .eh_frame_hdr size before relaxation.
2023-11-15Finalized intl-update patchesArsen Arsenovi?6-2234/+4471
* intl: Remove directory. Replaced with out-of-tree GNU gettext. * .gitignore: Add '/gettext*'. * configure.ac (host_libs): Replace intl with gettext. (hbaseargs, bbaseargs, baseargs): Split baseargs into {h,b}baseargs. (skip_barg): New flag. Skips appending current flag to bbaseargs. <library exemptions>: Exempt --with-libintl-{type,prefix} from target and build machine argument passing. * configure: Regenerate. * Makefile.def (host_modules): Replace intl module with gettext module. (configure-ld): Depend on configure-gettext. * Makefile.in: Regenerate. * src-release.sh: Remove references to the intl/ directory.
2023-11-14Fix another linker command line option that was not being recognised in its ↵Nick Clifton2-1/+7
long form. PR 28910 * lexsup.c (ld_options): Ensure that the --mri-script option is correctly recognised.
2023-11-13GNU-ld: ARM: Issues when trying to set target output architectureNick Clifton2-1/+7
PR 28910 * lexsup.c (ld_options): Ensure that the --format option is correctly recognised.
2023-11-13Regenerate gas/config.in and ld/configureMark Wielaard1-2/+6
commit d173146d9 "MIPS: Change all E_MIPS_* to EF_MIPS_*" changed gas/config.in to rename USE_E_MIPS_ABI_O32 to USE_EF_MIPS_ABI_O32 this new name sorts differently when regenerating gas/config.in commit e922d1eaa "Add ability to change linker warning messages into errors when reporting executable stacks and/or executable segments." Introduced two new help strings for --enable-error-execstack and --enable-error-rwx-segments in configure.ac which weren't included in ld/configure when regenerated. * gas/config.in: Regenerate. * ld/configure: Likewise.
2023-11-13Fix redundant space typo in linker documentation.Chung-Ju Wu2-1/+5
2023-11-10Add ability to change linker warning messages into errors when reporting ↵Nick Clifton78-118/+370
executable stacks and/or executable segments. include * bfdlink.h (struct bfd_link_info): Update descriptions of the 'execstack', 'noexecstack' and 'warn_execstack' fields. Add 'error_exectack' and 'warn_is_error_for_rwx_segments' fields. bfd * elf.c (assign_file_positions_except_relocs): Turn warnings about executable segments into errors if so requested. * elflink.c (bfd_elf_size_dynamic_sections): Turn warnings about executable stacks into errors if so requested. ld * ldlex.h (enum option_values): Add OPTION_ERROR_EXECSTACK, OPTION_NO_ERROR_EXECSTACK, OPTION_WARN_EXECSTACK_OBJECTS, OPTION_ERROR_RWX_SEGMENTS and OPTION_NO_ERROR_RWX_SEGMENTS. (struct ld_option): Add new long options. (parse_args): Parse new long options. (elf_static_list_options): Display the new options. * ld.texi: Document the new command line options. * configure.ac (error-execstack): New configuration option. (error-rwx-segments): New configuration option. * emultempl/elf.em (_before_parse): Initialse the new linkinfo fields. * NEWS: Mention the new features. * config.in: Regenerate. * configure: Regenerate. * testsuite/ld-elf/commonpage2.d: Disable errors for RWX segments and/or executable stacks. * testsuite/ld-elf/elf.exp: Likewise. * testsuite/ld-elf/header.d: Likewise. * testsuite/ld-elf/loadaddr1.d: Likewise. * testsuite/ld-elf/loadaddr2.d: Likewise. * testsuite/ld-elf/maxpage4.d: Likewise. * testsuite/ld-elf/nobits-1.d: Likewise. * testsuite/ld-elf/note-1.d: Likewise. * testsuite/ld-elf/orphan-10.d: Likewise. * testsuite/ld-elf/orphan-11.d: Likewise. * testsuite/ld-elf/orphan-12.d: Likewise. * testsuite/ld-elf/orphan-5.d: Likewise. * testsuite/ld-elf/orphan-7.d: Likewise. * testsuite/ld-elf/orphan-8.d: Likewise. * testsuite/ld-elf/orphan-9.d: Likewise. * testsuite/ld-elf/orphan-region.d: Likewise. * testsuite/ld-elf/orphan.d: Likewise. * testsuite/ld-elf/pr19539.d: Likewise. * testsuite/ld-elf/pr26256-1a.d: Likewise. * testsuite/ld-elf/pr26907.d: Likewise. * testsuite/ld-elf/pr28597.d: Likewise. * testsuite/ld-elf/retain2.d: Likewise. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elf/size-1.d: Likewise. * testsuite/ld-elf/textaddr7.d: Likewise. * testsuite/ld-elf/warn1.d: Likewise. * testsuite/ld-elf/warn2.d: Likewise. * testsuite/ld-i386/discarded1.d: Likewise. * testsuite/ld-i386/pr19175.d: Likewise. * testsuite/ld-i386/pr19539.d: Likewise. * testsuite/ld-i386/pr23189.d: Likewise. * testsuite/ld-plugin/lto-3r.d: Likewise. * testsuite/ld-plugin/lto-5r.d: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-powerpc/ppc476-shared.d: Likewise. * testsuite/ld-powerpc/ppc476-shared2.d: Likewise. * testsuite/ld-powerpc/pr28827-2.d: Likewise. * testsuite/ld-s390/s390.exp: Likewise. * testsuite/ld-scripts/align2a.d: Likewise. * testsuite/ld-scripts/align2b.d: Likewise. * testsuite/ld-scripts/align5.d: Likewise. * testsuite/ld-scripts/alignof.exp: Likewise. * testsuite/ld-scripts/crossref.exp: Likewise. * testsuite/ld-scripts/defined2.d: Likewise. * testsuite/ld-scripts/defined3.d: Likewise. * testsuite/ld-scripts/defined5.d: Likewise. * testsuite/ld-scripts/pr14962.d: Likewise. * testsuite/ld-scripts/pr18963.d: Likewise. * testsuite/ld-scripts/pr20302.d: Likewise. * testsuite/ld-scripts/print-memory-usage.exp: Likewise. * testsuite/ld-scripts/rgn-at1.d: Likewise. * testsuite/ld-scripts/rgn-at10.d: Likewise. * testsuite/ld-scripts/rgn-at4.d: Likewise. * testsuite/ld-scripts/rgn-at6.d: Likewise. * testsuite/ld-scripts/rgn-at8.d: Likewise. * testsuite/ld-scripts/rgn-at9.d: Likewise. * testsuite/ld-scripts/rgn-over1.d: Likewise. * testsuite/ld-scripts/rgn-over2.d: Likewise. * testsuite/ld-scripts/rgn-over4.d: Likewise. * testsuite/ld-scripts/rgn-over5.d: Likewise. * testsuite/ld-scripts/rgn-over6.d: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/sizeof.exp: Likewise. * testsuite/ld-scripts/sort-file.d: Likewise. * testsuite/ld-x86-64/discarded1.d: Likewise. * testsuite/ld-x86-64/pr19175.d: Likewise. * testsuite/ld-x86-64/pr19539a.d: Likewise. * testsuite/ld-x86-64/pr19539b.d: Likewise. * testsuite/ld-x86-64/pr23189.d: Likewise.
2023-11-10Move new features above the 'Changes in 2.41' commentNick Clifton1-6/+6
2023-11-09ld: aarch64: Use lp64 abi in recent BTI stub testsSzabolcs Nagy5-8/+4
The tests are not compatible with ilp32 abi: the GNU property note is ABI dependent (size changes) and the disasm is ABI dependent too. Making the test portable between the ABIs is not trivial. For now force lp64 abi.
2023-11-09ld: aarch64: Add BTI stub insertion test PR30930Szabolcs Nagy6-0/+172
The test creates a large shared library and covers a number of BTI stub insertion cases.
2023-11-08ld: print branch fixups into the map file for ppc elf targetsClément Chigot1-0/+11
In a safety context, it could interesting to track the trampolines being generated, ensuring there are expected or not. bfd/ChangeLog: * elf32-ppc.c (ppc_elf_relax_section): Log branch fixups. ld/ChangeLog: * ld.texi (--print-map): Add new item about fixups.
2023-11-07ld/x86: reduce testsuite dependency on system object filesJan Beulich4-94/+131
PR ld/30722 Tests looking for certain .note-section recorded properties may not involve object files from the underlying platform (e.g. via using the C compiler for linking): Such object files may themselves have similar note sections, and hence they may influence the overall outcome. For now convert just the tests known to be affected by crt*.o coming with "ISA v3 needed" notes. Eventually other tests ought to be converted, too.
2023-11-07Revert "ld x86_64 tests: Accept x86-64-v3 as a needed ISA"Jan Beulich4-3/+10
This reverts commit bf77f42f6708d8b5ba92336d876042826d8d29c1. It wrongly altered testcase expectations; the issue will need taking care of differently.
2023-11-06ld: =fillexp different behaviors for hexidecimal literalNick Clifton5-1/+89
PR 30865 * ld.texi: Update description of the FILL command. * testsuite/ld-scripts/fill2.d: New test. * testsuite/ld-scripts/fill2.t: New test source. * testsuite/ld-scripts/data.exp: Run the new test.
2023-11-02ld x86_64 tests: Accept x86-64-v3 as a needed ISANick Clifton4-3/+10
* testsuite/ld-x86-64/property-3.r: Update regexp to allow for targets which support x86-64-v3. * testsuite/ld-x86-64/property-4.r: Likewise. * testsuite/ld-x86-64/property-5.r: Likewise.
2023-11-01Fix typo in recent update to the ld/NEWS fileNick Clifton1-2/+2
2023-11-01ld: Support input section description keyword: REVERSENick Clifton18-39/+274
PR 27565 * ldlex.l: Add REVERSE. * ldgram.y: Allow REVERSE to be used wherever a sorting command can be used. * ld.h (struct wildcard_spec): Add 'reversed' field. * ldlang.h (lang_wild_statement_struct): Add 'filenames_reversed' field. * ldlang.c (compare_sections): Add reversed parameter. (wild_sort): Reverse the comparison if requested. (print_wild_statement): Handle the reversed field. * ld.texi: Document the new feature. * NEWS: Mention the new feature. * testsuite/ld-scripts/sort-file-reversed-1.d: New test driver. * testsuite/ld-scripts/sort-file-reversed-1.t: New test source. * testsuite/ld-scripts/sort-file-reversed-2.t: New test source. * testsuite/ld-scripts/sort-file-reversed-2.d: New test driver. * testsuite/ld-scripts/sort-sections-reversed-1.d: New test driver. * testsuite/ld-scripts/sort-sections-reversed-1.t: New test source. * testsuite/ld-scripts/sort-sections-reversed-2.t: New test source. * testsuite/ld-scripts/sort-sections-reversed-2.d: New test driver. * testsuite/ld-scripts/sort-sections-reversed-3.d: New test driver. * testsuite/ld-scripts/sort-sections-reversed-3.t: New test source.
2023-10-30New Georgian translation for the ld sub-directoryNick Clifton2-0/+6620
2023-10-20PR30984, assertion fail elf.c:8485Alan Modra1-0/+1
PR 30984 * ldelf.c (ldelf_place_orphan): Don't allow bfd_abs_section as a potential output section.
2023-10-19ld: fix typo in ld.texi metdata->metadataJose E. Marchesi2-1/+5
2023-10-17Update the documentation of the LINKER_VERSIOn script command to actually ↵Nick Clifton1-4/+4
mention the name of the command.
2023-10-16Fix: GNU-ld: ARM: Issues when trying to set target output architectureNick Clifton2-1/+8
PR 28910 * lexsup.c (ld_options): Require that the --architecture option is given exactly two dashes, so that it does not become confused with the -a option.
2023-10-13ld: replace wrong bfd_malloc in nto.emClément Chigot1-1/+1
xmalloc should be called in ld instead of bfd_malloc. ld/ChangeLog: * emultempl/nto.em (nto_lookup_QNX_note_section): Replace bfd_malloc by xmalloc.
2023-10-13ld: warn when duplicated QNX stack note are detectedClément Chigot1-4/+18
This warning is triggered only when a stack parameter is given to the linker. ld/ChangeLog: * emultempl/nto.em: Add warning when several QNX .note are detected.
2023-10-13ld: correctly handle QNX --lazy-stack without -zstack-sizeClément Chigot1-4/+4
The warning was skipped if -zstack-size is not provided. ld/ChangeLog: * emultempl/nto.em: Move --lazy-stack warning before missing -zstack-size skip.
2023-10-13ld: allow update of existing QNX stack noteClément Chigot4-32/+116
Up to now, the linker would always create a QNX stack note from scratch. However, object files could already have such note, ending up into duplicates. QNX loader doesn't handle that. Update the mechanism to first search through the input files for a .note section holding a QNX stack note. If none are found, then a new section is created into the stub file as before. This requires this search to be done once the file have been opened, moving the whole logic a bit later in the emulation process. As part for this update, also allow to request an executable stack without necessarily having to provide its size as well. In this case, s etup a default lazy stack of 0x1000. ld/ChangeLog: * emultempl/nto.em (nto_create_QNX_note_section): New Function. (nto_lookup_QNX_note_section): New Function. (nto_add_note_section): Move the creation of the note section in the above new functions. (nto_create_output_section_statements): rename nto_after_open * testsuite/ld-aarch64/aarch64-nto.exp: add new test. * testsuite/ld-aarch64/nto-stack-note-3.d: New test. * testsuite/ld-aarch64/nto-stack-note.s: New test.
2023-10-09Fix: Null pointer dereference in ldlex.lNick Clifton2-1/+4
PR 30951 * ldlex.l (yy_input): Check for YY_CURRENT_BUFFER being NULL.