aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
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.
2023-10-09Fix: A potential null_pointer_deference bugNick Clifton2-0/+9
PR 30954 * ldlang.c (map_input_to_output_sections): Check that os is non NULL before using it.
2023-10-05Fix: ld: Test case pr28158 fails on x86_64-linux-musl when index is > 19A. Wilcox2-6/+12
PR 30905 * testsuite/ld-elf/pr28158.rd: Adjust regexp to allow for section indicies larger than 9.
2023-10-05Fix: ld testsuite: glibc-specific DT_RELR tests should not be run on musl ↵A. Wilcox2-0/+9
systems PR 30917 * testsuite/ld-elf/dt-relr.exp: Skip for MUSL targets.
2023-10-05Fix: ld testsuite: non-PIC shared tests fail on powerpc-linux-muslA. Wilcox2-0/+8
PR 30918 * testsuite/ld-shared/shared.exp: Add XFAILs for tests that fail with the MUSL library.
2023-10-05Fix: ld testsuite: Thumb PLT and GOT tests should be skipped on musl armhf ↵A. Wilcox3-2/+9
targets PR 30923 * testsuite/ld-arm/thumb-plt-got.d: Skip test for configurations using the MUSL library. * testsuite/ld-arm/thumb-plt.d: Likewise.
2023-10-05Fix: ld testsuite: pr22001-1 test segfaults on musl/x86A. Wilcox2-11/+24
PR 30925 PR 22001 * testsuite/ld-i386/i386.exp: Skip the pr22001 test with TEXTREL relocations enabled on configurations using the MUSL library.
2023-10-05Fix: ld testsuite: 'Version' pattern grabs 'Version5 EABI', breaking test on ↵A. Wilcox2-2/+10
arm-linux-musleabihf PR 30924 * testsuite/ld-elfvers/vers.exp (objdump_emptyverstuff): Handle EABI version information in objdump's output.
2023-10-04ld: microblaze: ignore rwx segmentsNeal Frager1-0/+1
The linker will generate warnings if it is creating an executable stack or a segment with all three read, write and execute permissions. These settings are not appropriate for all targets including MicroBlaze. Signed-off-by: Neal Frager <neal.frager@amd.com> Signed-off-by: Michael J. Eager <eager@eagercon.com>
2023-10-02Use bfd_get_current_time in places where it is suitableNick Clifton2-9/+6
2023-09-29x86-64: Add -z mark-plt and -z nomark-pltH.J. Lu14-0/+154
The PLT entry in executables and shared libraries contains an indirect branch, like jmp *foo@GOTPCREL(%rip) push $index_foo jmp .PLT0 or endbr64 jmp *foo@GOTPCREL(%rip) NOP padding which is used to branch to the function, foo, defined in another object. Each R_X86_64_JUMP_SLOT relocation has a corresponding PLT entry. The dynamic tags have been added to the x86-64 psABI to mark such PLT entries: https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/6d824a52a42d173eb838b879616c1be5870b593e Add an x86-64 linker option, -z mark-plt, to mark PLT entries with #define DT_X86_64_PLT (DT_LOPROC + 0) #define DT_X86_64_PLTSZ (DT_LOPROC + 1) #define DT_X86_64_PLTENT (DT_LOPROC + 3) 1. DT_X86_64_PLT: The address of the procedure linkage table. 2. DT_X86_64_PLTSZ: The total size, in bytes, of the procedure linkage table. 3. DT_X86_64_PLTENT: The size, in bytes, of a procedure linkage table entry. and set the r_addend field of the R_X86_64_JUMP_SLOT relocation to the memory offset of the indirect branch instruction. The dynamic linker can use these tags to update the PLT section to direct branch. bfd/ * elf-linker-x86.h (elf_linker_x86_params): Add mark_plt. * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Set the r_addend of R_X86_64_JUMP_SLOT to the indirect branch offset in PLT entry for -z mark-plt. * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Add DT_X86_64_PLT, DT_X86_64_PLTSZ and DT_X86_64_PLTENT for -z mark-plt. (_bfd_x86_elf_finish_dynamic_sections): Set DT_X86_64_PLT, DT_X86_64_PLTSZ and DT_X86_64_PLTENT. (_bfd_x86_elf_get_synthetic_symtab): Ignore addend for JUMP_SLOT relocation. (_bfd_x86_elf_link_setup_gnu_properties): Set plt_indirect_branch_offset. * elfxx-x86.h (elf_x86_plt_layout): Add plt_indirect_branch_offset. binutils/ * readelf.c (get_x86_64_dynamic_type): New function. (get_dynamic_type): Call get_x86_64_dynamic_type. include/ * elf/x86-64.h (DT_X86_64_PLT): New. (DT_X86_64_PLTSZ): Likewise. (DT_X86_64_PLTENT): Likewise. ld/ * ld.texi: Document -z mark-plt and -z nomark-plt. * emulparams/elf32_x86_64.sh: Source x86-64-plt.sh. * emulparams/elf_x86_64.sh: Likewise. * emulparams/x86-64-plt.sh: New file. * testsuite/ld-x86-64/mark-plt-1.s: Likewise. * testsuite/ld-x86-64/mark-plt-1a-x32.d: Likewise. * testsuite/ld-x86-64/mark-plt-1a.d: Likewise. * testsuite/ld-x86-64/mark-plt-1b-x32.d: Likewise. * testsuite/ld-x86-64/mark-plt-1b.d: Likewise. * testsuite/ld-x86-64/mark-plt-1c-x32.d: Likewise. * testsuite/ld-x86-64/mark-plt-1c.d: Likewise. * testsuite/ld-x86-64/mark-plt-1d-x32.d: Likewise. * testsuite/ld-x86-64/mark-plt-1d.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run -z mark-plt tests.
2023-09-27Fix: Output section type does not been applied to section forced output by ↵Hsinyuan Xavier2-2/+24
`. = .` assignment PR 30875 * ldlang.c (get_os_init_flag): New function. (exp_init_os, map_input_to_output_sections): Use it.
2023-09-25Revert "arc: Add new LD tests for ARCv3."Claudiu Zissulescu11-183/+0
This reverts commit 6e467e9a94c1135bd11d985e9263d43204a9258b.
2023-09-25Revert "arc: Add new linker emulation and scripts for ARCv3 ISA."Claudiu Zissulescu10-103/+35
This reverts commit 4deb1ee57fdb711cac6f36fed75b3c8cb5112d99.
2023-09-25Revert "arc: Update NEWS files"Claudiu Zissulescu1-2/+0
This reverts commit a47d304b1229ecf8912fac17ee9c48d1bf3c729a.
2023-09-25RISC-V: Protect .got with relroAndreas Schwab3-1/+5
Move .got before .data so that it can be protected with -zrelro. Also separate .got.plt from .got if -znow is not in effect; the first two words of .got.plt are placed within the relro region. ld: PR ld/30877 * emulparams/elf32lriscv-defs.sh (DATA_GOT, SEPARATE_GOTPLT): Define. * emulparams/elf64lriscv-defs.sh (SEPARATE_GOTPLT): Define. * testsuite/ld-elf/binutils.exp (binutils_test): Remove riscv*-*-* from relro_got expression.
2023-09-25arc: Update NEWS filesClaudiu Zissulescu1-0/+2
Add ARCv3 support in NEWS files. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2023-09-25arc: Add new linker emulation and scripts for ARCv3 ISA.Claudiu Zissulescu10-35/+103
Add ARCv3's linker bits. Remove obsolete tests. ld/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * ld/Makefile.am: Add ARC64 targets. * ld/configure.tgt: Likewise. * ld/Makefile.in: Regenerate. * ld/emulparams/arc64elf32.sh: New file. * ld/emulparams/arc64elf64.sh: Likewise. * ld/emulparams/arc64linux32.sh: Likewise. * ld/emulparams/arc64linux64.sh: Likewise. * ld/scripttempl/elfarc.sc: Update stack and heap definitions. * ld/testsuite/ld-arc/got-weak.d: Deleted file. * ld/testsuite/ld-arc/got-weak.s: Likewise. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2023-09-25arc: Add new LD tests for ARCv3.Claudiu Zissulescu11-0/+183
Add new linker tests for ARCv3 ISA. All the new tests are added in a distinct new folder named arc64. ld/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * ld/testsuite/ld-arc64/arcv3_64-reloc-near-exe.dd: New file. * ld/testsuite/ld-arc64/arcv3_64-reloc-near-so.dd: Likewise. * ld/testsuite/ld-arc64/arcv3_64-reloc-near.s: Likewise. * ld/testsuite/ld-arc64/arcv3_64.exp: Likewise. * ld/testsuite/ld-arc64/bl34.dd: Likewise. * ld/testsuite/ld-arc64/bl34.s: Likewise. * ld/testsuite/ld-arc64/linkscript.ld: Likewise. * ld/testsuite/ld-arc64/plt34-got.dd: Likewise. * ld/testsuite/ld-arc64/plt34-got.s: Likewise. * ld/testsuite/ld-arc64/plt34-reloc.dd: Likewise. * ld/testsuite/ld-arc64/plt34-reloc.s: Likewise. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2023-09-21ld: write resolved path to included file to dependency-fileThomas Weißschuh1-3/+4
In ldfile_open_command_file_1() name written to the dependency files is the name as specified passed to the "INCLUDE" directive. This is before include-path processing so the tracked dependency location is most likely wrong. Instead track the opened file at the point where the resolved path is actually available, in try_open(). Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-09-04arm: Make 'conflicting CPU architectures' error message more user-friendlyChristophe Lyon2-2/+2
Error messages such as "conflicting CPU architectures 10/16" are not very to understand, so this patch replaces the numbers with the description they actually mean: "conflicting CPU architectures ARM v7E-M vs Pre v4" 2023-09-01 Christophe Lyon <christophe.lyon@linaro.org> bfd/ * elf32-arm.c (tag_cpu_arch_combine): Add name_table parameter and use it. (elf32_arm_merge_eabi_attributes): Update call to tag_cpu_arch_combine. ld/ * testsuite/ld-arm/attr-merge-9.out: Update expected error message. * testsuite/ld-arm/attr-merge-arch-2.d: Likewise.
2023-09-01RISC-V: move various alias entriesJan Beulich7-10/+10
For disassembly to only use spec-mandated aliases, respective non-alias entries need to come ahead of their alias ones. Since identical mnemonics need to stay together, whole groups are moved up where necessary. This partly reverts 839189bc932e ("RISC-V: re-arrange opcode table for consistent alias handling"), but then also goes beyond a plain revert. Reviewed-by: Tsukasa OI <research_trasio@irq.a4lg.com> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-09-01Fix ld Makefile variable naming: ELF_CLFAGS -> ELF_CFLAGSJerry Zhang Jian2-4/+4
Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
2023-08-31elf: Adjust PR ld/30791 testsH.J. Lu2-0/+7
Adjust PR ld/30791 tests: 1. Generic linker targets don't comply with all orhpan section merging rules. 2. z80 fails since a, b, c, d are registers for z80. 3. hppa fails since .text sections aren't merged for relocatable link. PR ld/30791 * testsuite/ld-elf/pr30791a.d: Xfail for generic and z80 targets. * testsuite/ld-elf/pr30791b.d: Xfail for hppa and z80 targets.
2023-08-31arc: Update elfarcv2 script templateClaudiu Zissulescu1-7/+11
Update ARC's elfarcv2 script template with: - The .ivt section (Interrupt Vector Table) is mapped at the begining of STARTUP_MEMORY when ivtbase_addr is not defined. Previously, it was pointing to 0x00. - MEMORY_FILE is a new emulation paramter and sets the name for the linker script file which holds the MEMORY commands required by arcv2elfx emulation. - Four new linker variables are introduced available when arcv2elf emulation is used: * __TEXT_REGION_ORIGIN__ Once defined it is setting the text region origin. By default it points to zero. * __TEXT_REGION_LENGTH__ Once defined it is setting the text region length. By default it is set to 2M. * __DATA_REGION_ORIGIN__ Once defined it is setting the data region origin. By default it is set to 0x80000000. * __DATA_REGION_LENGTH__ Once defined it is setting the data region length. By default it is set to 2M. ld/ChangeLog: * scripttempl/elfarcv2.sc: Update script template. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>