aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2020-07-22ld, testsuite: do not run CTF tests at all on non-ELF for nowNick Alcock2-0/+9
Right now, the linker is not emitting CTF sections on (at least some) non-ELF platforms, because work similar to that done for ELF needs to be done to each platform in turn to emit linker-generated sections whose contents are programmatically derived. (Or something better needs to be done.) So, for now, the CTF tests will fail on non-ELF for lack of a .ctf section in the output: so skip the CTF tests there temporarily. (This is not the same as the permanent skip of the diags tests, which is done because the input for those is assembler that depends on the ELF syntax of pseudos like .section: this is only a temporary skip, until the linker grows support for CTF on more targets.) ld/ * testsuite/ld-ctf/ctf.exp: Skip on non-ELF for now.
2020-07-22ld: do not produce one empty output .ctf section for every input .ctfNick Alcock2-1/+9
The trick we use to prevent ld doing as it does for almost all other sections and copying the input CTF section into the output has recently broken, causing output to be produced with a valid CTF section followed by massive numbers of CTF sections, one per .ctf in the input (minus one, for the one that was filled out by ctf_link). Their size is being forcibly set to zero, but they're still present, wasting space and looking ridiculous. This is not right: ld/ld-new : section size addr .interp 28 4194984 [...] .bss 21840 6788544 .comment 92 0 .ctf 87242 0 .ctf 0 0 .ctf 0 0 [snip 131 more empty sections] .gnu.build.attributes 7704 6818576 .debug_aranges 6592 0 .debug_info 4488859 0 .debug_abbrev 150099 0 .debug_line 796759 0 .debug_str 237926 0 .debug_loc 2247302 0 .debug_ranges 237920 0 Total 10865285 The fix is to exclude these unwanted input sections from being present in the output. We tried this before and it broke things, because if you exclude all the .ctf sections there isn't going to be one in the output so there is nowhere to put the deduplicated CTF. The solution to that is really simple: set SEC_EXCLUDE on *all but one* CTF section. We don't care which one (they're all the same once their size has been zeroed), so just pick the first we see. ld/ * ldlang.c (ldlang_open_ctf): Set SEC_EXCLUDE on all but the first input .ctf section.
2020-07-22ld, testsuite: only run CTF tests when ld and GCC support CTFNick Alcock7-6/+91
The CTF testsuite runs GCC to generate CTF that it knows matches the input .c files before doing a run_dump_test over it. So we need a GCC capable of doing that, and we need to always avoid running those tests if libctf was disabled because the linker will never be capable of it. ld/ * configure.ac (enable_libctf): Substitute it. * Makefile.am (enablings.exp): New. (EXTRA_DEJAGNU_SITE_CONFIG): Add it. (DISTCLEANFILES): Likewise. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/lib/ld-lib.exp (compile_one_cc): New. (check_ctf_available): Likewise. (skip_ctf_tests): Likewise. * testsuite/ld-ctf/ctf.exp: Call skip_ctf_tests.
2020-07-22ld: new CTF testsuiteEgeyar Bagcioglu74-0/+1833
Uses the new cc option to run_dump_test to compile most tests from C code, ensuring that the types in the C code accurately describe what the .d file is testing. (Some tests, mostly those testing malformed CTF, run directly from .s, or include both .s and .c.) ld/ * testsuite/ld-ctf/ctf.exp: New file. * testsuite/ld-ctf/A-2.c: New file. * testsuite/ld-ctf/A.c: New file. * testsuite/ld-ctf/B-2.c: New file. * testsuite/ld-ctf/B.c: New file. * testsuite/ld-ctf/C-2.c: New file. * testsuite/ld-ctf/C.c: New file. * testsuite/ld-ctf/array-char.c: New file. * testsuite/ld-ctf/array-int.c: New file. * testsuite/ld-ctf/array.d: New file. * testsuite/ld-ctf/child-float.c: New file. * testsuite/ld-ctf/child-int.c: New file. * testsuite/ld-ctf/conflicting-cycle-1.B-1.d: New file. * testsuite/ld-ctf/conflicting-cycle-1.B-2.d: New file. * testsuite/ld-ctf/conflicting-cycle-1.parent.d: New file. * testsuite/ld-ctf/conflicting-cycle-2.A-1.d: New file. * testsuite/ld-ctf/conflicting-cycle-2.A-2.d: New file. * testsuite/ld-ctf/conflicting-cycle-2.parent.d: New file. * testsuite/ld-ctf/conflicting-cycle-3.C-1.d: New file. * testsuite/ld-ctf/conflicting-cycle-3.C-2.d: New file. * testsuite/ld-ctf/conflicting-cycle-3.parent.d: New file. * testsuite/ld-ctf/conflicting-enums.d: New file. * testsuite/ld-ctf/conflicting-typedefs.d: New file. * testsuite/ld-ctf/cross-tu-1.c: New file. * testsuite/ld-ctf/cross-tu-2.c: New file. * testsuite/ld-ctf/cross-tu-conflicting-2.c: New file. * testsuite/ld-ctf/cross-tu-cyclic-1.c: New file. * testsuite/ld-ctf/cross-tu-cyclic-2.c: New file. * testsuite/ld-ctf/cross-tu-cyclic-3.c: New file. * testsuite/ld-ctf/cross-tu-cyclic-4.c: New file. * testsuite/ld-ctf/cross-tu-cyclic-conflicting.d: New file. * testsuite/ld-ctf/cross-tu-cyclic-nonconflicting.d: New file. * testsuite/ld-ctf/cross-tu-into-cycle.d: New file. * testsuite/ld-ctf/cross-tu-noncyclic.d: New file. * testsuite/ld-ctf/cycle-1.c: New file. * testsuite/ld-ctf/cycle-1.d: New file. * testsuite/ld-ctf/cycle-2.A.d: New file. * testsuite/ld-ctf/cycle-2.B.d: New file. * testsuite/ld-ctf/cycle-2.C.d: New file. * testsuite/ld-ctf/diag-ctf-version-0.d: New file. * testsuite/ld-ctf/diag-ctf-version-0.s: New file. * testsuite/ld-ctf/diag-ctf-version-2-unsupported-feature.d: New file. * testsuite/ld-ctf/diag-ctf-version-2-unsupported-feature.s: New file. * testsuite/ld-ctf/diag-ctf-version-f.d: New file. * testsuite/ld-ctf/diag-ctf-version-f.s: New file. * testsuite/ld-ctf/diag-cttname-invalid.d: New file. * testsuite/ld-ctf/diag-cttname-invalid.s: New file. * testsuite/ld-ctf/diag-cttname-null.d: New file. * testsuite/ld-ctf/diag-cttname-null.s: New file. * testsuite/ld-ctf/diag-cuname.d: New file. * testsuite/ld-ctf/diag-cuname.s: New file. * testsuite/ld-ctf/diag-decompression-failure.d: New file. * testsuite/ld-ctf/diag-decompression-failure.s: New file. * testsuite/ld-ctf/diag-parlabel.d: New file. * testsuite/ld-ctf/diag-parlabel.s: New file. * testsuite/ld-ctf/diag-parname.d: New file. * testsuite/ld-ctf/diag-parname.s: New file. * testsuite/ld-ctf/diag-unsupported-flag.d: New file. * testsuite/ld-ctf/diag-unsupported-flag.s: New file. * testsuite/ld-ctf/diag-wrong-magic-number-mixed.d: New file. * testsuite/ld-ctf/diag-wrong-magic-number.d: New file. * testsuite/ld-ctf/diag-wrong-magic-number.s: New file. * testsuite/ld-ctf/enum-2.c: New file. * testsuite/ld-ctf/enum.c: New file. * testsuite/ld-ctf/function.c: New file. * testsuite/ld-ctf/function.d: New file. * testsuite/ld-ctf/slice.c: New file. * testsuite/ld-ctf/slice.d: New file. * testsuite/ld-ctf/super-sub-cycles.c: New file. * testsuite/ld-ctf/super-sub-cycles.d: New file. * testsuite/ld-ctf/typedef-int.c: New file. * testsuite/ld-ctf/typedef-long.c: New file. * testsuite/ld-ctf/union-1.c: New file.
2020-07-22ld: new options --ctf-variables and --ctf-share-typesNick Alcock7-1/+107
libctf recently changed to make it possible to not emit the CTF variables section. Make this the default for ld: the variables section is a simple name -> type mapping, and the names can be quite voluminous. Nothing in the variables section appears in the symbol table, by definition, so GDB cannot make use of them: special-purpose projects that implement their own analogues of symbol table lookup can do so, but they'll need to tell the linker to emit the variables section after all. The new --ctf-variables option does this. The --ctf-share-types option (valid values "share-duplicated" and "share-unconflicted") allow the caller to specify the CTF link mode. Most users will want share-duplicated, since it allows for more convenient debugging: but very large projects composed of many decoupled components may want to use share-unconflicted mode, which places types that appear in only one TU into per-TU dicts. (They may also want to relink the CTF using the ctf_link API and cu-mapping, to make their "components" larger than a single TU. Right now the linker does not expose the CU-mapping machinery. Perhaps it should in future to make this use case easier.) For now, giving the linker the ability to emit share-duplicated CTF lets us add testcases for that mode to the testsuite. ld/ * ldlex.h (option_values) <OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES>: New. * ld.h (ld_config_type) <ctf_variables, ctf_share_duplicated>: New fields. * ldlang.c (lang_merge_ctf): Use them. * lexsup.c (ld_options): Add ctf-variables, no-ctf-variables, ctf-share-types. (parse_args) <OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES>: New cases. * ld.texi: Document new options. * NEWS: Likewise.
2020-07-22ld: Reformat CTF errors into warnings.Egeyar Bagcioglu2-10/+19
ld/ * ldlang.c (lang_merge_ctf): Turn errors into warnings. Fix a comment typo. (lang_write_ctf): Turn an error into a warning. (ldlang_open_ctf): Reformat warnings. Fix printing file names. Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
2020-07-22libctf, ld, binutils: add textual error/warning reporting for libctfNick Alcock2-0/+33
This commit adds a long-missing piece of infrastructure to libctf: the ability to report errors and warnings using all the power of printf, rather than being restricted to one errno value. Internally, libctf calls ctf_err_warn() to add errors and warnings to a list: a new iterator ctf_errwarning_next() then consumes this list one by one and hands it to the caller, which can free it. New errors and warnings are added until the list is consumed by the caller or the ctf_file_t is closed, so you can dump them at intervals. The caller can of course choose to print only those warnings it wants. (I am not sure whether we want objdump, readelf or ld to print warnings or not: right now I'm printing them, but maybe we only want to print errors? This entirely depends on whether warnings are voluminous things describing e.g. the inability to emit single types because of name clashes or something. There are no users of this infrastructure yet, so it's hard to say.) There is no internationalization here yet, but this at least adds a place where internationalization can be added, to one of ctf_errwarning_next or ctf_err_warn. We also provide a new ctf_assert() function which uses this infrastructure to provide non-fatal assertion failures while emitting an assert-like string to the caller: to save space and avoid needlessly duplicating unchanging strings, the assertion test is inlined but the print-things-out failure case is not. All assertions in libctf will be converted to use this machinery in future commits and propagate assertion-failure errors up, so that the linker in particular cannot be killed by libctf assertion failures when it could perfectly well just print warnings and drop the CTF section. include/ * ctf-api.h (ECTF_INTERNAL): Adjust error text. (ctf_errwarning_next): New. libctf/ * ctf-impl.h (ctf_assert): New. (ctf_err_warning_t): Likewise. (ctf_file_t) <ctf_errs_warnings>: Likewise. (ctf_err_warn): New prototype. (ctf_assert_fail_internal): Likewise. * ctf-inlines.h (ctf_assert_internal): Likewise. * ctf-open.c (ctf_file_close): Free ctf_errs_warnings. * ctf-create.c (ctf_serialize): Copy it on serialization. * ctf-subr.c (ctf_err_warn): New, add an error/warning. (ctf_errwarning_next): New iterator, free and pass back errors/warnings in succession. * libctf.ver (ctf_errwarning_next): Add. ld/ * ldlang.c (lang_ctf_errs_warnings): New, print CTF errors and warnings. Assert when libctf asserts. (lang_merge_ctf): Call it. (land_write_ctf): Likewise. binutils/ * objdump.c (ctf_archive_member): Print CTF errors and warnings. * readelf.c (dump_ctf_archive_member): Likewise.
2020-07-22ld: Properly override the IR definitionH.J. Lu11-6/+158
We change the previous definition in the IR object to undefweak only after all LTO symbols have been read. include/ PR ld/26262 PR ld/26267 * bfdlink.h (bfd_link_info): Add lto_all_symbols_read. ld/ PR ld/26262 PR ld/26267 * ldlang.c (lang_process): Set lto_all_symbols_read after all LTO IR symbols have been read. * plugin.c (plugin_notice): Override the IR definition only if all LTO IR symbols have been read or the new definition is non-weak and the the IR definition is weak * testsuite/ld-plugin/lto.exp: Run PR ld/26262 and ld/26267 tests. * testsuite/ld-plugin/pr26262a.c: New file. * testsuite/ld-plugin/pr26262b.c: Likewise. * testsuite/ld-plugin/pr26262c.c: Likewise. * testsuite/ld-plugin/pr26267.err: Likewise. * testsuite/ld-plugin/pr26267a.c: Likewise. * testsuite/ld-plugin/pr26267b.c: Likewise. * testsuite/ld-plugin/pr26267c.c: Likewise.
2020-07-20Fix problem running a few PowerPC linker tests when the .data section is ↵Nick Clifton2-3/+8
retained. * testsuite/ld-powerpc/powerpc.exp (ppcelftests): Use section name .PPC.EMB.apuinfo instead of section number 2 in apuinfo tests.
2020-07-20PR26265, Spurious 'gc-sections requires ... when --init or --finiAlan Modra3-8/+29
bfd/ * elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section. ld/ PR 26265 * ldlang.c (undef_from_cmdline): Delete. (ldlang_add_undef): Mark "cmdline" param unused. (lang_end): Traverse gc_sym_list to determine whether a symbol root has been specified. Update error message. * testsuite/ld-gc/noent.d: Adjust for changed error message.
2020-07-20x86: Update PR gas/26263 linker testsH.J. Lu4-9/+17
Update and run PR gas/26263 linker tests for all x86 ELF targets to accept any program header layout. PR gas/26263 * testsuite/ld-i386/pr26263.d: Updated. * testsuite/ld-x86-64/pr26263.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run gas/26263 test for all ELF targets.
2020-07-19x86: Change PLT32 reloc against section to PC32H.J. Lu6-0/+56
Commit 292676c1 resolved PLT32 reloc aganst local symbol to section. Since PLT32 relocation must be against symbols, turn such PLT32 relocation into PC32 relocation. gas/ PR gas/26263 * config/tc-i386.c (i386_validate_fix): Change PLT32 reloc against section to PC32 reloc. * testsuite/gas/i386/relax-5.d: Updated. * testsuite/gas/i386/x86-64-relax-4.d: Likewise. ld/ PR gas/26263 * testsuite/ld-i386/i386.exp: Run PR gas/26263 test. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr26263.d: New file. * testsuite/ld-x86-64/pr26263.d: Likewise. * testsuite/ld-x86-64/pr26263.s: Likewise.
2020-07-19ld: optionally emit _etext last, before .dataHans-Peter Nilsson4-4/+21
So, here's my suggestion for making _init .. __etext cover .text + .rodata (including things like the read-only exception tables) for elf64mmix. A quick web search gives that __etext (and friends) isn't well defined, so each target can interpret the "end of text segment" to their own liking. It seems likely this change is also a better fit than the default for other ports, at least those with .rodata after .text in the same segment. The presence of a separate rodata-segment is optional (and not true for elf64mmix). This is reflected in the name as SEPARATE_TEXT / SEPARATE_CODE isn't considered, to keep it simple; each target has to make sure their settings of variables make sense. ld: * scripttempl/elf.sc (ETEXT_LAST_IN_RODATA_SEGMENT): New variable. * emulparams/elf64mmix.sh (ETEXT_LAST_IN_RODATA_SEGMENT): Define. * testsuite/ld-mmix/sec-1.d: Adjust.
2020-07-19Power10 stub selectionAlan Modra11-22/+257
This patch better supports mixing of power10 and non-power10 code, as might be seen in a cpu-optimized library using ifuncs to select functions optimized for a given cpu. Using -Wl,--no-power10-stubs isn't that good in this situation since non-power10 notoc stubs are slower and larger than the power10 variants, which you'd like to use on power10 code paths. With this change, power10 pc-relative code that makes calls marked @notoc uses power10 stubs if stubs are necessary, and other calls use non-power10 instructions in stubs. This will mean that if gcc is generating code for -mcpu=power10 but with pc-rel disabled then you'll get the older stubs even on power10 (unless you force with -Wl,--power10-stubs). That shouldn't be too big a problem: stubs that use r2 are reasonable. It's just the ones that set up addressing using "mflr 12; bcl 20,31,.+4; mflr 11; mtlr 12" that should be avoided if possible. bfd/ * elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs. (select_alt_stub): New function. (ppc_get_stub_entry): Use it here. (ppc64_elf_check_relocs): Set had_power10_relocs rather than power10_stubs. (ppc64_elf_size_stubs): Clear power10_stubs here instead. Don't merge notoc stubs with other varieties when power10_stubs is "auto". Instead dup the stub hash table entry. (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust tests of power10_stubs. ld/ * emultempl/ppc64elf.em (power10-stubs): Accept optional "auto" arg. * ld.texi (power10-stubs): Update. * testsuite/ld-powerpc/callstub-1.d: Force --power10-stubs. * testsuite/ld-powerpc/callstub-2.d: Relax branch offset comparison. * testsuite/ld-powerpc/callstub-4.d: New test. * testsuite/ld-powerpc/notoc.d: Force --no-power10-stubs. * testsuite/ld-powerpc/notoc3.d, * testsuite/ld-powerpc/notoc3.s, * testsuite/ld-powerpc/notoc3.wf: New test. * testsuite/ld-powerpc/powerpc.exp: Run new tests. Pass --no-power10-stubs for notoc link.
2020-07-17mmix ld: move .init (and _init) first.Hans-Peter Nilsson3-12/+17
This both makes the section layout more similar to that of the general default for ELF and fixes (makes true) an assumption that code and rodata is located between _init and __etext, in libgcc/config/mmix/crti.S. Sadly, that's not actually true for ELF (generally and for elf64mmix), where exception-tables and .rodata is after _etext; I'm pondering what to do about that. The original mmix simulator behavior is that memory magically appears on access, initialized with 0, which is not preferable when chasing bugs by throwing code the size of the gcc test-suite to the simulator. The code in crti.S compatibly enables simulator machinery to identify undefined memory and instead stopping the simulator with an error (going to interactive mode for interactive runs). See http://gcc.gnu.org/legacy-ml/gcc-patches/2012-10/msg01871.html for more, including the mmix-sim.ch "patch file". This fixes only one error in the gcc testsuite, gcc.c-torture/execute/pr20621-1.c with LTO, where for some reason gcc/lto chooses to move (writable) data that is only used to read 0 to .rodata. An access (sufficiently far inside a block) in an unregistered place is flagged as an invalid access. The bpo-9m test that I had to adjust, actually exposes a wart: mmo does not have the notion of symbol types (or sections) and the test-case now has leading zeros at "Main" eventually leading to it being misdiagnosed as being outside .text and .data, thus here mapped to BFD as an absolute symbol. The test is not intended to check the mmo symbol-type machinery, so I'm just tweaking it to be symbol-type-neutral for "Main". Since you have to jump through hoops to see the problem, I don't think this commit is worth putting on the 2.35-branch. ld: * scripttempt/mmo.sc: Move .init first in .text output section. * testsuite/ld-mmix/bpo-9m.d: Adjust accordingly.
2020-07-15x86: avoid attaching suffixes to unambiguous insnsJan Beulich122-584/+690
"Unambiguous" is is in particular taking as reference the assembler, which also accepts certain insns - despite them allowing for varying operand size, and hence in principle being ambiguous - without any suffix. For example, from the very beginning of the life of x86-64 I had trouble understanding why a plain and simple RET had to be printed as RETQ. In case someone really used the 16-bit form, RETW disambiguates the two quite fine.
2020-07-15mmix bfd: fix bfd_assert for R_MMIX_PUSHJ_STUBBABLE against undef'd symbolHans-Peter Nilsson5-4/+11
Spotted when inspecting gcc testsuite logs, but this already is covered by the ld-mmix testsuite, it's just that the assert is ignored since the regexp match is for a substring and not anchored. With the anchors added but not the bugfix, the ld.log shows that the asserts cause a non-match as intended: Executing on host: sh -c {./ld-new -LX/src/ld/testsuite/ld-mmix -m elf64mmix -o tmpdir/dump tmpdir/undef-2.o tmpdir/start.o 2>&1} /dev/null dump.tmp (timeout = 300) ./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845 ./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845 ./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845 ./ld-new: tmpdir/undef-2.o:(.text+0x0): undefined reference to `undefd' failed with: <./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845 ./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845 ./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845 ./ld-new: tmpdir/undef-2.o:(.text+0x0): undefined reference to `undefd'>, expected: <\A[^\n\r]*undefined reference to `undefd'\Z> FAIL: ld-mmix/undef-2 Gone with the fix of course, leaving just the intended "undefined reference" like. I'm not going to add anchors manually for all the "error:" strings in the test-suite, not even in the mmix parts. Sorry, but I'll just do it for *these* specific undefined-reference tests. Just a thought: maybe the run_dump_test "error:" string should *automatically* get anchor marks prepended and appended for a single line match as in the patch, "\A[^\n\r]*" prepended and \Z appended unless either anchor mark or \r or \n is present in the regexp? Committed. bfd: * elf64-mmix.c (mmix_elf_relax_section): Improve accounting for R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols. ld/testsuite: * testsuite/ld-mmix/undef-1.d, testsuite/ld-mmix/undef-1m.d, testsuite/ld-mmix/undef-2.d, testsuite/ld-mmix/undef-2m.d: Add start- and end-anchors to error-string to match just a single-line error-message.
2020-07-13x86_64-cygwin testsAlan Modra8-20/+29
Tests just having "xfail: x86_64-*-cygwin" aren't good, since presumably if a test fails on x86_64-cygwin then it also fails on x86_64-*-pe* and x86_64-*-mingw*. binutils/ * testsuite/lib/binutils-common.exp (is_pecoff_format): Accept optional machine-os arg. ld/ * testsuite/ld-scripts/default-script1.d: Don't skip, xfail using is_pecoff_format. * testsuite/ld-scripts/default-script2.d: Likewise. * testsuite/ld-scripts/default-script3.d: Likewise. * testsuite/ld-scripts/default-script4.d: Likewise. * testsuite/ld-scripts/pr20302.d: Remove x86_64-*-cygwin from notarget. * testsuite/ld-scripts/provide-6.d: Remove x86_64-*-cygwin from xfail. * testsuite/ld-scripts/provide-8.d: Likewise.
2020-07-10Document powerpc64 ld optionsAlan Modra2-0/+32
* ld.texi (PowerPC64 ELF64): Document --no-inline-optimize, --power10-stubs and --no-power10-stubs.
2020-07-10PowerPC64 ld --no-power10-stubsAlan Modra4-1/+68
Needed for libraries that use ifuncs or other means to support cpu-optimized versions of functions, some power10, some not, and those functions make calls using linkage stubs. bfd/ * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs. * elf64-ppc.c (struct ppc_link_hash_table): Delete power10_stubs. (ppc64_elf_check_relocs): Adjust setting of power10_stubs. (plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust uses of power10_stubs. ld/ * emultempl/ppc64elf.em (params): Init new field. (enum ppc64_opt): Add OPTION_POWER10_STUBS and OPTION_NO_POWER10_STUBS. (PARSE_AND_LIST_LONGOPTS): Support --power10-stubs and --no-power10-stubs. (PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Likewise. * testsuite/ld-powerpc/callstub-3.d: New test. * testsuite/ld-powerpc/powerpc.exp: Run it.
2020-07-09Remove powerpc PE supportAlan Modra10-282/+13
Plus some leftover powerpc lynxos support. bfd/ * coff-ppc.c: Delete. * pe-ppc.c: Delete. * pei-ppc.c: Delete. * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC. * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove PPCMAGIC code. (coff_write_object_contents): Remove PPC_PE code. * config.bfd: Move powerpcle-pe to removed targets. * configure.ac: Remove powerpc PE entries. * libcoff-in.h (ppc_allocate_toc_section): Delete. (ppc_process_before_allocation): Delete. * peXXigen.c: Remove POWERPC_LE_PE code and comments. * targets.c: Remove powerpc PE vectors. * po/SRC-POTFILES.in: Regenerate. * libcoff.h: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. binutils/ * dlltool.c: Remove powerpc PE support and comments. * configure.ac: Remove powerpc PE dlltool config. * configure: Regenerate. gas/ * config/obj-coff.h: Remove TE_PE support. * config/tc-ppc.c: Likewise. * config/tc-ppc.h: Likewise. * configure.tgt: Remove powerpc PE and powerpc lynxos. * testsuite/gas/cfi/cfi.exp (cfi-common-6): Remove powerpc PE condition. * testsuite/gas/macros/macros.exp: Don't xfail powerpc PE. include/ * coff/powerpc.h: Delete. ld/ * emulparams/ppcpe.sh: Delete. * scripttempl/ppcpe.sc: Delete. * emulparams/ppclynx.sh: Delete. * Makefile.am (ALL_EMULATION_SOURCES): Remove ppc PE and lynxos. * configure.tgt: Likewise. * emultempl/beos.em: Remove powerpc PE support. * emultempl/pe.em: Likewise. * po/BLD-POTFILES.in: Regenerate. * Makefile.in: Regenerate.
2020-07-09powerpc garbage collect testAlan Modra2-6/+8
ld's garbage collection test on powerpc64 catered for old compilers (pre -mcmodel=medium support), setting options that caused the test to fail. Which meant the test wasn't really testing anything. Get rid of that old compiler support, and avoid -fPIE fails on ppc32. * testsuite/ld-gc/gc.exp: Don't set -mminimal-toc for powerpc64, and remove powerpc64 xfail. Use -fno-PIE for ppc32.
2020-07-09pr18841 tests on powerpc64Alan Modra2-9/+14
The PR18841 test does cross-module calls from within an ifunc resolver, which is nasty, and not supported in general since the called function may not be relocated. In this case the called function (zoo) is just a stub so doesn't need relocating, but on ppc64 the function descriptor for zoo in the executable won't be relocated at the time the shared library ifunc resolver runs. That means the test will fail if your compiler generates PIEs by default. PR 18841 * testsuite/ld-ifunc/ifunc.exp: Run pr18841 tests non-pie.
2020-07-08powerpc-aix5.2 testsAlan Modra87-595/+989
git commit bbd0c8e20472 broke many of these tests, and there have been other changes that caused failures too. * testsuite/lib/ld-lib.exp (ar_simple_create): Pass options before ar command. * testsuite/ld-powerpc/aix52.exp: Run for rs6000-aix5.2. Update match files. * testsuite/ld-powerpc/aix-abs-branch-1.dd: Update. * testsuite/ld-powerpc/aix-core-sec-1.hd: Update. * testsuite/ld-powerpc/aix-gc-1-32.dd: Update. * testsuite/ld-powerpc/aix-gc-1-64.dd: Update. * testsuite/ld-powerpc/aix-glink-1-32.dd: Update. * testsuite/ld-powerpc/aix-glink-1-64.dd: Update. * testsuite/ld-powerpc/aix-glink-2-32.dd: Update. * testsuite/ld-powerpc/aix-glink-2-64.dd: Update. * testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd: Update. * testsuite/ld-powerpc/aix-ref-1-32.od: Update. * testsuite/ld-powerpc/aix-ref-1-64.od: Update. * testsuite/ld-powerpc/aix-toc-1-32.dd: Update. * testsuite/ld-powerpc/aix-toc-1-64.dd: Update. * testsuite/ld-powerpc/aix-weak-3-32.dd: Update. * testsuite/ld-powerpc/aix-weak-3-64.dd: Update. * testsuite/ld-powerpc/aix-abs-branch-1.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-abs-branch-1-32.nd, * testsuite/ld-powerpc/aix-abs-branch-1-64.nd: ..these new files. * testsuite/ld-powerpc/aix-abs-reloc-1.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-abs-reloc-1-32.nd, * testsuite/ld-powerpc/aix-abs-reloc-1-64.nd: ..these new files. * testsuite/ld-powerpc/aix-abs-reloc-1.od: Delete, replace with.. * testsuite/ld-powerpc/aix-abs-reloc-1-32.od, * testsuite/ld-powerpc/aix-abs-reloc-1-64.od: ..these new files. * testsuite/ld-powerpc/aix-export-1-all.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-export-1-all-32.dd, * testsuite/ld-powerpc/aix-export-1-all-64.dd: ..these new files. * testsuite/ld-powerpc/aix-export-1-full.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-export-1-full-32.dd, * testsuite/ld-powerpc/aix-export-1-full-64.dd: ..these new files. * testsuite/ld-powerpc/aix-export-2.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-export-2-32.nd, * testsuite/ld-powerpc/aix-export-2-64.nd: ..these new files. * testsuite/ld-powerpc/aix-gc-1.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-gc-1-32.nd, * testsuite/ld-powerpc/aix-gc-1-64.nd: ..these new files. * testsuite/ld-powerpc/aix-glink-3.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-glink-3-32.dd, * testsuite/ld-powerpc/aix-glink-3-64.dd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1a.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1a-32.dd, * testsuite/ld-powerpc/aix-lineno-1a-64.dd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1a.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1a-32.nd, * testsuite/ld-powerpc/aix-lineno-1a-64.nd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1b.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1b-32.dd, * testsuite/ld-powerpc/aix-lineno-1b-64.dd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1b.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1b-32.nd, * testsuite/ld-powerpc/aix-lineno-1b-64.nd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.dnd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.dnd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.drd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.drd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.nd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.nd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.rd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.rd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-dso.dnd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-dso-32.dnd, * testsuite/ld-powerpc/aix-weak-1-dso-64.dnd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-dso.hd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-dso-32.hd, * testsuite/ld-powerpc/aix-weak-1-dso-64.hd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-dso.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-dso-32.nd, * testsuite/ld-powerpc/aix-weak-1-dso-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-gcdso.dnd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-gcdso-32.dnd, * testsuite/ld-powerpc/aix-weak-1-gcdso-64.dnd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-gcdso.hd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-gcdso-32.hd, * testsuite/ld-powerpc/aix-weak-1-gcdso-64.hd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-gcdso.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-gcdso-32.nd, * testsuite/ld-powerpc/aix-weak-1-gcdso-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2a.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2a-32.nd, * testsuite/ld-powerpc/aix-weak-2a-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2b.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2b-32.nd, * testsuite/ld-powerpc/aix-weak-2b-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2c.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2c-32.nd, * testsuite/ld-powerpc/aix-weak-2c-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2c.od: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2c-32.od, * testsuite/ld-powerpc/aix-weak-2c-64.od: ..these new files.
2020-07-07Re: Use is_xcoff_format in ld testsuiteAlan Modra2-1/+6
git commit 7193487fa8 took h8300 out of the notarget list, resulting in h8300-elf +FAIL: ld-scripts/section-match-1 h8300-linux +FAIL: ld-scripts/section-match-1 * testsuite/ld-scripts/section-match-1.d: xfail h8300.
2020-07-07XCOFF ld testsuite fixesAlan Modra53-59/+162
* testsuite/ld-scripts/align.exp: Don't exclude xcoff. Pass -bnogc ld option for xcoff. * testsuite/ld-scripts/provide.exp: Likewise. * testsuite/ld-scripts/data.exp: Pass -bnogc ld option for xcoff. * testsuite/ld-scripts/default-script.exp: Likewise. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/empty-address.exp: Likewise. * testsuite/ld-scripts/expr.exp: Likewise. * testsuite/ld-scripts/include.exp: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/assign-loc.d: Don't exclude xcoff. * testsuite/ld-scripts/defined3.d: Likewise. * testsuite/ld-scripts/defined4.d: Likewise. * testsuite/ld-scripts/pr18963.d: Likewise. * testsuite/ld-scripts/sane1.d: Likewise. * testsuite/ld-scripts/segment-start.d: Likewise. * testsuite/ld-scripts/include-1.d: Likewise, and relax text vma. * testsuite/ld-scripts/defined5.d: Update xfail and comment. * testsuite/ld-scripts/defined5.s: Tweak "defined" to be at non-zero section offset. * testsuite/ld-scripts/fill16.d: xfail for xcoff. * testsuite/ld-scripts/provide-2.d: Accept more symbols. * testsuite/ld-scripts/provide-4.d: Likewise. * testsuite/ld-scripts/provide-5.d: Likewise. * testsuite/ld-scripts/provide-6.d: Likewise. * testsuite/ld-scripts/provide-7.d: Likewise. * testsuite/ld-scripts/align.t: Accept xcoff mapped .text and .data. * testsuite/ld-scripts/defined3.t: Likewise. * testsuite/ld-scripts/defined4.t: Likewise. * testsuite/ld-scripts/defined5.t: Likewise. * testsuite/ld-scripts/fill.t: Likewise. * testsuite/ld-scripts/include-subdata.t: Likewise. * testsuite/ld-scripts/provide-1.t: Likewise. * testsuite/ld-scripts/provide-2.t: Likewise. * testsuite/ld-scripts/provide-3.t: Likewise. * testsuite/ld-scripts/provide-4.t: Likewise. * testsuite/ld-scripts/provide-5.t: Likewise. * testsuite/ld-scripts/provide-6.t: Likewise. * testsuite/ld-scripts/provide-7.t: Likewise. * testsuite/ld-scripts/provide-8.t: Likewise. * testsuite/ld-scripts/assign-loc.t: Add required xcoff sections. * testsuite/ld-scripts/sizeof.t: Likewise. * testsuite/ld-scripts/align2.t: Likewise, and mapped sections. * testsuite/ld-scripts/align5.t: Likewise. * testsuite/ld-scripts/default-script.t: Likewise. * testsuite/ld-scripts/empty-address-1.t: Likewise. * testsuite/ld-scripts/empty-address-2a.t: Likewise. * testsuite/ld-scripts/empty-address-2b.t: Likewise. * testsuite/ld-scripts/empty-address-3a.t: Likewise. * testsuite/ld-scripts/empty-address-3b.t: Likewise. * testsuite/ld-scripts/empty-address-3c.t: Likewise. * testsuite/ld-scripts/include-sections.t: Likewise. * testsuite/ld-scripts/pr14962.t: Likewise. * testsuite/ld-scripts/sane1.t: Likewise.
2020-07-07Use is_pecoff_format in ld testsuiteAlan Modra9-25/+46
--image-base 0 is not just for x86_64 mingw. This patch fixes that, and a case where a changed LDFLAGS leaked out of one script to the next. * testsuite/ld-scripts/align.exp: Use is_pecoff_format. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/provide.exp: Likewise. * testsuite/ld-scripts/weak.exp: Likewise. * testsuite/ld-scripts/empty-address.exp: Likewise. Reset LDFLAGS on exit. * testsuite/ld-scripts/expr.exp: Set LDFLAGS earlier, and with --image-base for PE. * testsuite/ld-scripts/include.exp: Set LDFLAGS for PE. * testsuite/ld-scripts/script.exp: Use is_pecoff_format, and set LDFLAGS as well as flags.
2020-07-07Use is_xcoff_format in ld testsuiteAlan Modra11-116/+63
* testsuite/ld-checks/checks.exp: Use is_xcoff_format. * testsuite/ld-powerpc/powerpc.exp: Likewise. * testsuite/ld-scripts/print-memory-usage.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-undefined/require-defined.exp: Likewise. * testsuite/ld-scripts/expr2.d: Likewise. * testsuite/ld-scripts/section-match-1.d: Only run for ELF. * testsuite/ld-elfvers/vers.exp: Delete dead code. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise.
2020-07-07XCOFF linker script PROVIDE supportAlan Modra2-0/+6
Fixes bit rot from git commit b46a87b1606. * emultempl/aix.em (gld${EMULATION_NAME}_find_exp_assignment): Handle etree_provided.
2020-07-07sh vxworks testsAlan Modra3-2/+7
These tests were failing only due to not being updated for readelf output changes. * testsuite/ld-sh/vxworks1-lib.rd: Update expected output. * testsuite/ld-sh/vxworks4.d: Likewise.
2020-07-06Fix spelling mistakes in some of the binutils sub-directories.Nick Clifton3-1675/+1887
PR 26204 gas * config/tc-arm.c: Fix spelling mistake. * config/tc-riscv.c: Likewise. * config/tc-z80.c: Likewise. * po/gas.pot: Regenerate. ld * lexsup.c: Fix spelling mistake. * po/ld.pot: Regenerate. opcodes * arc-dis.c: Fix spelling mistake. * po/opcodes.pot: Regenerate.
2020-07-06Updated translations for various binutils sub-directoriesNick Clifton5-9165/+8217
2020-07-04Update version to 2.35.50 and regenerate filesNick Clifton2-10/+14
2020-07-04Add markers for binutils 2.35 branchNick Clifton2-0/+6
2020-07-03Re: Change readelf's display of symbol namesAlan Modra9-60/+73
Fixes some fallout from git commit 0942c7ab94e5. PR 26028 gas/ * testsuite/gas/ia64/unwind-ilp32.d: Add -T to readelf options. gold/ * testsuite/Makefile.am (file_in_many_sections.stdout): Add -W to readelf options. * testsuite/Makefile.in: Regenerate. ld/ * testsuite/ld-arm/arm-elf.exp (vxworks1): Pass --wide to readelf when dumping relocs. * testsuite/ld-i386/i386.exp (vxworks1): Likewise. * testsuite/ld-sh/sh-vxworks.exp (vxworks1): Likewise. * testsuite/ld-sparc/sparc.exp (vxworks1): Likewise. * testsuite/ld-arm/vxworks1.rd: Adjust to suit. * testsuite/ld-i386/vxworks1.rd: Adjust. * testsuite/ld-sh/vxworks1.rd: Adjust. * testsuite/ld-sparc/vxworks1.rd: Adjust.
2020-07-02Change readelf's display of symbol names (when not in --wide mode) so that ↵Nick Clifton8-12/+25
if they are going to be truncated then "[...]" is displayed at the end. Add a comment line option to disable this enhancement and restore the old behaviour. PR 26028 binutils* readelf.c (print_symbol): Handle truncation of symbol names. (options): Add -T/--silent-truncation option. (parse_args): Handle the option. (print_dynamic_symbol): Correct calculation of width available to display symbol name. * doc/binutils.texi: Document the -T option to readelf. * NEWS: Mention the new feature. gas * testsuite/gas/ia64/group-2.d: Add -T option to readelf command line. * testsuite/gas/ia64/unwind.d: Likewise. * testsuite/gas/mmix/bspec-1.d: Likewise. * testsuite/gas/mmix/bspec-2.d: Likewise. * testsuite/gas/mmix/comment-1.d: Likewise. * testsuite/gas/tic6x/scomm-directive-4.d: Likewise. ld * testsuite/ld-powerpc/powerpc.exp: Add -T option to readelf command line when running some tests. * testsuite/ld-arm/arm-elf.exp: Likewise. * testsuite/ld-mips-elf/mips-elf.exp: Likewise. * testsuite/ld-mmix/local1.d: Likewise. * testsuite/ld-mmix/local3.d: Likewise. * testsuite/ld-mmix/local5.d: Likewise. * testsuite/ld-mmix/local7.d: Likewise. * testsuite/ld-powerpc/powerpc.exp: Likewise.
2020-06-30Remove x86 NaCl target supportH.J. Lu181-3517/+241
NaCl has been deprecated: https://developer.chrome.com/native-client/migration and NaCl will completely disappear in 2021: https://lists.llvm.org/pipermail/llvm-dev/2020-April/141107.html Remove x86 NaCl target support from bfd, binutils, gas and ld. bfd/ * archures.c (bfd_mach_i386_nacl): Removed. (bfd_mach_i386_i386_nacl): Likewise. (bfd_mach_x86_64_nacl): Likewise. (bfd_mach_x64_32_nacl): Likewise. * config.bfd: Remove *-*-nacl* targets. * configure.ac: Remove x86 NaCl target vectors. * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): Removed. (bfd_x64_32_nacl_arch): Likewise. (bfd_x86_64_nacl_arch): Likewise. (bfd_i386_nacl_arch): Likewise. (bfd_x64_32_arch_intel_syntax): Updated. * elf32-i386.c: Don't include "elf-nacl.h". (elf_i386_nacl_plt): Removed. (elf_i386_nacl_plt0_entry): Likewise. (elf_i386_nacl_plt_entry): Likewise. (elf_i386_nacl_pic_plt0_entry): Likewise. (elf_i386_nacl_pic_plt_entry): Likewise. (elf_i386_nacl_eh_frame_plt): Likewise. (elf_i386_nacl_plt): Likewise. (elf32_i386_nacl_elf_object_p): Likewise. (elf_i386_get_synthetic_symtab): Updated. (elf_i386_link_setup_gnu_properties): Likewise. * elf64-x86-64.c: Don't include "elf-nacl.h". (elf_x86_64_nacl_plt): Removed. (elf64_x86_64_nacl_elf_object_p): Likewise. (elf_x86_64_nacl_plt0_entry): Likewise. (elf_x86_64_nacl_plt_entry): Likewise. (elf_x86_64_nacl_eh_frame_plt): Likewise. (elf_x86_64_nacl_plt): Likewise. (elf32_x86_64_nacl_elf_object_p): Likewise. (elf_x86_64_get_synthetic_symtab): Updated. (elf_x86_64_link_setup_gnu_properties): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Likewise. * targets.c: Remove x86 NaCl target vectors. * bfd-in2.h: Regenerated. * configure: Likewise. binutils/ * NEWS: Mention x86 NaCl target support removal. * dwarf.c (init_dwarf_regnames_by_bfd_arch_and_mach): Remove x86 NaCl target support. * testsuite/binutils-all/elfedit-1.d: Likewise. * testsuite/binutils-all/i386/i386.exp: Likewise. * testsuite/binutils-all/x86-64/objects.exp: Likewise. * testsuite/binutils-all/x86-64/pr23494a-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494a.d: Likewise. * testsuite/binutils-all/x86-64/pr23494b-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494b.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494c.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494d.d: Likewise. * testsuite/binutils-all/x86-64/pr23494e-x32.d: Likewise. * testsuite/binutils-all/x86-64/pr23494e.d: Likewise. * testsuite/binutils-all/x86-64/x86-64.exp: Likewise. gas/ * NEWS: Mention x86 NaCl target support removal. * config/tc-i386.c: Remove x86 NaCl target support. * config/tc-i386.h: Likewise. * configure.tgt: Likewise. * testsuite/gas/i386/i386.exp: Likewise. * testsuite/gas/i386/iamcu-1.d: Likewise. * testsuite/gas/i386/iamcu-2.d: Likewise. * testsuite/gas/i386/iamcu-3.d: Likewise. * testsuite/gas/i386/iamcu-4.d: Likewise. * testsuite/gas/i386/iamcu-5.d: Likewise. * testsuite/gas/i386/k1om.d: Likewise. * testsuite/gas/i386/l1om.d: Likewise. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Remove eelf_i386_nacl.c, eelf32_x86_64_nacl.c, eelf_x86_64_nacl.c. Remove x86 NaCl dep files. * NEWS: Mention x86 NaCl target support removal. * configure.tgt: Remove x86 NaCl target support. * testsuite/ld-elf/binutils.exp: Likewise. * testsuite/ld-elf/elf.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-i386/align-branch-1.d: Likewise. * testsuite/ld-i386/export-class.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/load1.d: Likewise. * testsuite/ld-i386/pie1.d: Likewise. * testsuite/ld-i386/pr12570a.d: Likewise. * testsuite/ld-i386/pr12570b.d: Likewise. * testsuite/ld-i386/pr19636-1d.d: Likewise. * testsuite/ld-i386/pr19636-1l.d: Likewise. * testsuite/ld-i386/pr19636-2c.d: Likewise. * testsuite/ld-i386/pr19636-2d.d: Likewise. * testsuite/ld-i386/pr19636-2e.d: Likewise. * testsuite/ld-i386/pr20244-1a.d: Likewise. * testsuite/ld-i386/pr20244-1b.d: Likewise. * testsuite/ld-i386/pr20244-2a.d: Likewise. * testsuite/ld-i386/pr20244-2b.d: Likewise. * testsuite/ld-i386/pr20244-2c.d: Likewise. * testsuite/ld-i386/pr20244-4a.d: Likewise. * testsuite/ld-i386/pr20244-4b.d: Likewise. * testsuite/ld-i386/pr21884.d: Likewise. * testsuite/ld-ifunc/binutils.exp: Likewise. * testsuite/ld-ifunc/ifunc-10-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-10-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-11-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-11-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-12-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-12-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-13-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-13-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14c-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14c-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14d-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14d-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14e-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14e-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-14f-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-14f-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-15-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-15-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-16-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-16-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-16-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-16-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-17a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-17a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-17b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-17b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-18b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-19a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-19a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-19b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-19b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-20-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-20-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-21-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-22-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5r-local-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-5r-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-6a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-6a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-6b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-6b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-7a-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-7a-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-7b-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-7b-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-8-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-8-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-9-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-9-x86-64.d: Likewise. * testsuite/ld-ifunc/pr17154-i386-now.d: Likewise. * testsuite/ld-ifunc/pr17154-i386.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64.d: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-x86-64/align-branch-1.d: Likewise. * testsuite/ld-x86-64/dwarfreloc.exp: Likewise. * testsuite/ld-x86-64/line.exp: Likewise. * testsuite/ld-x86-64/load1a.d: Likewise. * testsuite/ld-x86-64/load1b.d: Likewise. * testsuite/ld-x86-64/load1c.d: Likewise. * testsuite/ld-x86-64/load1d.d: Likewise. * testsuite/ld-x86-64/pie3.d: Likewise. * testsuite/ld-x86-64/pr18160.d: Likewise. * testsuite/ld-x86-64/pr19013-x32.d: Likewise. * testsuite/ld-x86-64/pr19013.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/pr20253-1b.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1f.d: Likewise. * testsuite/ld-x86-64/pr20253-1h.d: Likewise. * testsuite/ld-x86-64/pr20253-1j.d: Likewise. * testsuite/ld-x86-64/pr20253-1l.d: Likewise. * testsuite/ld-x86-64/pr21884.d: Likewise. * testsuite/ld-x86-64/pr22393-3a.rd: Likewise. * testsuite/ld-x86-64/pr22393-3b.rd: Likewise. * testsuite/ld-x86-64/tlsgd10.dd: Likewise. * testsuite/ld-x86-64/tlsgd5.dd: Likewise. * testsuite/ld-x86-64/tlsgd8.dd: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * emulparams/elf32_x86_64_nacl.sh: Removed. * emulparams/elf_i386_nacl.sh: Likewise. * emulparams/elf_x86_64_nacl.sh: Likewise. * testsuite/ld-i386/emit-relocs-nacl.rd: Likewise. * testsuite/ld-i386/load1-nacl.d: Likewise. * testsuite/ld-i386/pie1-nacl.d: Likewise. * testsuite/ld-i386/plt-nacl.pd: Likewise. * testsuite/ld-i386/plt-pic-nacl.pd: Likewise. * testsuite/ld-i386/pr17709-nacl.rd: Likewise. * testsuite/ld-i386/pr19636-1d-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2c-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2d-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2e-nacl.d: Likewise. * testsuite/ld-i386/pr19827-nacl.rd: Likewise. * testsuite/ld-i386/pr21884-nacl.d: Likewise. * testsuite/ld-i386/pr21884-nacl.t: Likewise. * testsuite/ld-i386/tlsbin-nacl.rd: Likewise. * testsuite/ld-i386/tlsbin2-nacl.rd: Likewise. * testsuite/ld-i386/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsnopic-nacl.rd: Likewise. * testsuite/ld-i386/tlspic-nacl.rd: Likewise. * testsuite/ld-i386/tlspic2-nacl.rd: Likewise. * testsuite/ld-x86-64/ilp32-4-nacl.d: Likewise. * testsuite/ld-x86-64/load1a-nacl.d: Likewise. * testsuite/ld-x86-64/load1b-nacl.d: Likewise. * testsuite/ld-x86-64/load1c-nacl.d: Likewise. * testsuite/ld-x86-64/load1d-nacl.d: Likewise. * testsuite/ld-x86-64/pie3-nacl.d: Likewise. * testsuite/ld-x86-64/plt-nacl.pd: Likewise. * testsuite/ld-x86-64/pr17709-nacl.rd: Likewise. * testsuite/ld-x86-64/pr19013-nacl.d: Likewise. * testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise. * testsuite/ld-x86-64/pr19827-nacl.rd: Likewise. * testsuite/ld-x86-64/pr21884-nacl.d: Likewise. * testsuite/ld-x86-64/pr21884-nacl.t: Likewise. * testsuite/ld-x86-64/split-by-file-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin2-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsdesc-nacl.pd: Likewise. * testsuite/ld-x86-64/tlsdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic2-nacl.rd: Likewise. * Makefile.in: Regenerated. * po/BLD-POTFILES.in: Likewise.
2020-06-30solaris XPASS ld-elf/group1Alan Modra2-1/+6
* testsuite/ld-elf/group1.d: Don't xfail all solaris targets, just ix86 and x86_64.
2020-06-30Don't xfail nds32 for ld-elf/reloc-discard testAlan Modra2-1/+5
* testsuite/ld-elf/reloc-discard.d: Don't xfail nds32.
2020-06-30microblaze-linux XPASS ld-elf/var1Alan Modra3-1/+7
microblaze-linux uses the standard ELF script, microblaze-elf its own script lacking an input section pattern needed to make this test pass. Add the missing pattern for .data, in line with most other sections that do have .* patterns. * scripttempl/elfmicroblaze.sc (.data): Add .data.* entry. * testsuite/ld-elf/var1.d: Don't xfail microblaze.
2020-06-29tic6x: Call _bfd_elf_add_dynamic_tagsH.J. Lu14-39/+56
Update tic6x linker tests to expect C6000_DSBT_BASE, C6000_DSBT_SIZE and C6000_DSBT_INDEX dynamic tags immediately before NULL dynamic tag. bfd/ * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. ld/ * testsuite/ld-tic6x/shlib-1.rd: Move C6000_DSBT_BASE, C6000_DSBT_SIZE and C6000_DSBT_INDEX dynamic tags to the last. * testsuite/ld-tic6x/shlib-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. * testsuite/ld-tic6x/static-app-1.rd: Likewise. * testsuite/ld-tic6x/static-app-1b.rd: Likewise. * testsuite/ld-tic6x/static-app-1r.rd: Likewise. * testsuite/ld-tic6x/static-app-1rb.rd: Likewise.
2020-06-29x86_64 k1om testsAlan Modra4-0/+9
On x86_64-nacl we currently see FAIL: Absolute non-overflowing relocs FAIL: ld-x86-64/protected2-k1om FAIL: ld-x86-64/protected3-k1om This limits the tests as per the l1om variants. * testsuite/ld-x86-64/abs-k1om.d: Run only on x86_64-*-linux*. * testsuite/ld-x86-64/protected2-k1om.d: Likewise. * testsuite/ld-x86-64/protected3-k1om.d: Likewise.
2020-06-26binutils, ld: work with --disable-libctfNick Alcock9-3/+140
This unfortunately means conditionalizing out all the libctf code, but the result is not too unbearably ugly, if a bit repetitive. I have stubbed out code in the !ENABLE_LIBCTF path to avoid extra redundant ifdefs where it seems that might be helpful. (The stubs are not too disruptive, but I've tried to keep them on one line where possible to avoid filling up the screen with stubs that nobody would care about. If this is too much of a coding style violation I can change it.) Changes since v2: use GCC_ENABLE rather than repeating all the AC_ARG_ENABLE stuff over and over again. ld/ * configure.ac [--enable-libctf]: New, default yes. Set ENABLE_LIBCTF accordingly. * Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF. * configure: Regenerate. * config.in: Regenerate. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * ldlang.c (ctf_output): Conditionalize on ENABLE_LIBCTF. (ldlang_open_ctf): Likewise. (lang_merge_ctf): Likewise. (ldlang_ctf_apply_strsym): Likewise. (lang_write_ctf): Likewise. (ldlang_write_ctf_late): Likewise. (ldlang_open_ctf) [!ENABLE_LIBCTF]: Warn about the presence of CTF sections. (lang_merge_ctf) [!ENABLE_LIBCTF]: New stub. (ldlang_ctf_apply_strsym) [!ENABLE_LIBCTF]: Likewise. (lang_write_ctf) [!ENABLE_LIBCTF]: Likewise. (ldlang_write_ctf_late) [!ENABLE_LIBCTF]: Likewise. * ldelfgen.c (ldelf_emit_ctf_early): Conditionalize on ENABLE_LIBCTF. (struct ctf_strsym_iter_cb_arg): Likewise. (ldelf_ctf_strtab_iter_cb): Likewise. (ldelf_ctf_symbols_iter_cb): Likewise. (ldelf_examine_strtab_for_ctf): Likewise. (ldelf_emit_ctf_early) [!ENABLE_LIBCTF]: New stub. (ldelf_examine_strtab_for_ctf) [!ENABLE_LIBCTF]: New stub. binutils/ * configure.ac [--enable-libctf]: New, default yes. Set ENABLE_LIBCTF accordingly. * Makefile.am [!ENABLE_LIBCTF]: Empty LIBCTF and LIBCTF_NOBFD. * configure: Regenerate. * config.in: Regenerate. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * objdump.c (usage): Conditionalize portions on ENABLE_LIBCTF. (option_values): Likewise. (long_options): Likewise. (main): Likewise. (dump_ctf_indent_lines): Conditionalize out when !ENABLE_LIBCTF. (make_ctfsect): Likewise. (dump_ctf_archive_member): Likewise. (dump_ctf) [ENABLE_LIBCTF]: Likewise. (dump_ctf) [!ENABLE_LIBCTF]: New empty stub. * readelf.c (options): Conditionalize portions on ENABLE_LIBCTF. (usage): Likewise. (process_section_contents): Likewise. (shdr_to_ctf_sect): Conditionalize out when !ENABLE_LIBCTF. (dump_ctf_indent_lines): Likewise. (dump_section_as_ctf) [ENABLE_LIBCTF]: Likewise.
2020-06-26ld/x86: actually invoke k1om testsJan Beulich2-0/+7
Unlike claimed by the ChangeLog entries added by 7a9068fe1646 ("Add initial Intel K1OM support") these tests did never get enabled.
2020-06-26m68k: tag floating-point ABI usedPat Bernardi14-0/+89
This patch adds GNU attribute support to m68k and utilises it to tag the floating-point calling convention used (hard-float or soft-float). It enables the linker to ensure linked objects use a consistent floating-point ABI and allows tools like GDB to infer the ABI used from the ELF file. It is based on similar work done for PowerPC. bfd/ * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function. (elf32_m68k_merge_private_bfd_data): Merge GNU attributes. binutils/ * readelf.c (display_m68k_gnu_attribute): New function. (process_arch_specific): Call display_m68k_gnu_attribute for EM_68K. gas/ * config/tc-m68k.c (m68k_elf_gnu_attribute): New function. (md_pseudo_table): Handle "gnu_attribute". * doc/as.texi: Document GNU attribute for M68K. include/ * elf/m68k.h: Add enum for GNU object attribute with floating point tag name and values. ld/ * testsuite/ld-m68k/attr-gnu-4-0.s: New file. * testsuite/ld-m68k/attr-gnu-4-1.s: Likewise. * testsuite/ld-m68k/attr-gnu-4-2.s: Likewise. * testsuite/ld-m68k/attr-gnu-4-00.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-01.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-02.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-10.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-11.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-12.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-20.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-21.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-22.d: Likewise. * testsuite/ld-m68k/m68k.exp: Run the new tests.
2020-06-24ld: Correct --dependency-file orderH.J. Lu2-2/+7
Change ld --help output to -d, -dc, -dp Force common symbols to be defined --dependency-file FILE Write dependency file instead of -d, -dc Force common symbols to be defined --dependency-file FILE, -dp Write dependency file PR ld/26165 * lexsup.c (ld_options): Correct --dependency-file order.
2020-06-24csky: Don't generate unnecessary dynamic tagsH.J. Lu3-8/+8
Dynamic tags, DT_JMPREL, PLTREL and PLTRELSZ, are needed only if there are relocation entries for PLT. Don't generate them if there are no relocation entries for PLT. bfd/ PR ld/26083 * elf32-csky.c (csky_elf_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. ld/ PR ld/26083 * testsuite/ld-csky/tls-ie-v1.d: Updated. * testsuite/ld-csky/tls-ie.d: Likewise.
2020-06-24cris: Don't generate unnecessary dynamic tagsH.J. Lu5-11/+41
Dynamic tags, DT_JMPREL, PLTREL and PLTRELSZ, are needed only if there are relocation entries for PLT. Don't generate them if there are no relocation entries for PLT. bfd/ PR ld/26083 * elf32-cris.c (elf_cris_size_dynamic_sections): Call _bfd_elf_add_dynamic_tags. ld/ PR ld/26083 * testsuite/ld-cris/libdso-15b.d: Updated. * testsuite/ld-cris/libdso-1c.d: Likewise. * testsuite/ld-cris/libdso-1d.d: Likewise. * testsuite/ld-cris/libdso-15c.d: New file.
2020-06-24ld: Set non_ir_ref_regular on source for assignmentH.J. Lu5-3/+52
We need to set non_ir_ref_regular on the source for assignment to get the correct LTO resolution: 190 a27be7f4ad90c5ce PREVAILING_DEF real_g instead of 190 30c3b2d8f967f5ea PREVAILING_DEF_IRONLY real_g PR ld/26163 * ldexp.c (exp_fold_tree_1): Set non_ir_ref_regular on the source for assignment. * testsuite/ld-plugin/lto.exp: Run ld/26163 test. * testsuite/ld-plugin/pr26163a.c: New file. * testsuite/ld-plugin/pr26163b.c: Likewise.
2020-06-24ld --help outputAlan Modra3-13/+21
It's best if help message output does not contain tabs, since we don't know tab stop settings or even if tabs are handled by the output device. This reverts some 2020-06-23 changes and fixes the csky help message. * lexsup.c (elf_shlib_list_options): Properly format help message. (elf_plt_unwind_list_options): Likewise. * emultempl/cskyelf.em (PARSE_AND_LIST_OPTIONS): Likewise.