aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2018-07-18ld: Enable using separate linker script for -z relroAndreas Krebbel2-8/+291
With this patch dedicated linker scripts can be generated for partial relro triggered by defining GENERATE_RELRO_SCRIPT in the target specific scripts. This is necessary for e.g. S/390 where usually the .got.plt comes first and prevents the relro segment from being extended across the non-plt GOT entries. The patch started with the work from Marcin taken from the mwk user branches. However, the patch needed substantial changes due to the 'separate code' feature which got committed in the meantime. ld/ChangeLog: 2018-07-18 Andreas Krebbel <krebbel@linux.ibm.com> Marcin Kościelnicki <koriakin@0x04.net> * emultempl/elf32.em: Add code to pick dedicated linker scripts for partial relro. * genscripts.sh: Generate dedicated linker scripts for partial relro.
2018-07-18Updated French translation for gold and Spanish translation for ld.Nick Clifton2-1204/+5774
ld * po/es.po: Updated Spanish translation. gold * po/fr.po: Updated French translation.
2018-07-17LD: Export relative-from-absolute symbol marking to BFDMaciej W. Rozycki2-0/+7
It is usually possible to tell absolute and ordinary symbols apart in BFD throughout the link, by checking whether the section that owns the symbol is absolute or not. That however does not work for ordinary symbols defined in a linker script outside an output section statement. Initially such symbols are entered into to the link hash as absolute symbols, owned by the absolute section. A flag is set in the internal linker expression defining such symbols to tell the linker to convert them to section-relative ones in the final phase of the link. That flag is however not accessible to BFD linker code, including BFD target code in particular. Add a flag to the link hash then to copy the information held in the linker expression. Define a macro, `bfd_is_abs_symbol', for BFD code to use where determining whether a symbol is absolute or ordinary is required before the final link phase. This macro will correctly identify the special `__ehdr_start' symbol as ordinary throughout link, for example, even though early on it will be assigned to the absolute section. Of course this does not let BFD code identify what the symbol's ultimate section will be before the final link phase has converted this symbol (in `update_definedness'). include/ * bfdlink.h (bfd_link_hash_entry): Add `rel_from_abs' member. bfd/ * linker.c (bfd_is_abs_symbol): New macro. * bfd-in2.h: Regenerate. ld/ * ldexp.c (exp_fold_tree_1) <etree_assign, etree_provide> <etree_provided>: Copy expression's `rel_from_abs' flag to the link hash.
2018-07-12MIPS/LD/testsuite: Correct mips-elf.exp test ABI/emul/endian arrangementMaciej W. Rozycki162-757/+947
Similarly to commit 86b24e15c45b ("MIPS/LD/testsuite: Correct comm-data.exp test ABI/emul/endian arrangement") update the mips-elf.exp test script to: - correctly select emulations for targets using non-traditional MIPS emulations, - correctly select ABIs for targets that do not support all of them, - use the default endianness selection where possible to benefit targets that support only one, - simplify test invocation by providing ABI-specific `run_dump_test' wrappers, specifically `run_dump_test_o32', `run_dump_test_n32', `run_dump_test_n64' and `run_dump_test_eabi', which remove the need to use conditionals across the Expect script or to repeat ABI-specific GAS and LD flags with each invocation, removing numerous test failures for `mips-sgi-irix6', `mips64-openbsd', `mips64el-openbsd' and `mips64el-ps2-elf' targets and broadening coverage for several MIPS targets. There are some new failures for the `mips64el-ps2-elf' target with tests that were not previously run for that target: FAIL: MIPS16 link branch to absolute expression (n32) FAIL: MIPS16 link branch to absolute expression 1 (n32) FAIL: MIPS16 link branch to absolute expression 2 (n32) FAIL: microMIPS link branch to absolute expression (n32) FAIL: MIPS ELF got reloc n32 FAIL: MIPS ELF xgot reloc n32 FAIL: undefined weak symbol overflow (n32) FAIL: R_MIPS16_HI16 and R_MIPS16_LO16 relocs n32 FAIL: ld-mips-elf/attr-gnu-4-0-n32-ph FAIL: ld-mips-elf/attr-gnu-4-1-n32-ph FAIL: ld-mips-elf/attr-gnu-4-2-n32-ph FAIL: ld-mips-elf/attr-gnu-4-3-n32-ph FAIL: MIPSr6 JALR reloc unaligned/cross-mode link test (n32) which are mostly due to dump discrepancies caused by mapping differences coming from the default linker scripts used by these test cases, or sometimes because of the specific MIPS processor architecture recorded in the ELF file taking precedence over the general MIPS ISA level also recorded. Finally, the R_MIPS16_HI16/R_MIPS16_LO16 relocation test failure is a preexisting issue with the IRIX style emulation. These failures will have to be addressed separately. ld/ * testsuite/ld-mips-elf/mips-elf.exp (run_dump_test_abi) (run_dump_test_o32, run_dump_test_n32, run_dump_test_n64) (run_dump_test_eabi): New procedures. (has_newabi, has_elf32): Remove variables. (has_abi): New associative array variable. (abi_asflags, abi_ldflags): Update settings across targets. (irixemul): New variable. Replace `run_dump_test' calls where applicable throughout with `run_dump_test_o32', `run_dump_test_n32', `run_dump_test_n64' and `run_dump_test_eabi' as appropriate. Remove explicit passing of `abi_asflags' and `abi_ldflags'. Use `noarch' for tests that require their own architecture setting. Force the big endianness for tests that require it. Select the endianness required for `objdump invocation with the `reloc-2' test. Conditionalize tests run via `run_ld_link_tests' on the ABI required and use the ABI list from the `has_abi' array where appropriate. * testsuite/ld-mips-elf/attr-gnu-4-0-n32-ph.d: Remove ABI and endianness selection options from `ld' and `source' tags. Relax output format matching. * testsuite/ld-mips-elf/attr-gnu-4-0-n64-ph.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-1-n32-ph.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-1-n64-ph.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-2-n32-ph.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-2-n64-ph.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-3-n32-ph.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-3-n64-ph.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend-micromips-n32.d: Remove ABI and endianness selection options from `as', `ld', `source' tags, and also the `-march=from-abi' option. Remove the `as' tag where it would become empty. * testsuite/ld-mips-elf/bal-jalx-addend-micromips-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend-micromips.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-local-micromips-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-local-micromips-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-local-micromips.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-local-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-local-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-local.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-ignore-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-ignore.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-micromips.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-n32.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic-n64.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-pic.d: Likewise. * testsuite/ld-mips-elf/branch-absolute-addend-n32.d: Likewise. * testsuite/ld-mips-elf/branch-absolute-addend-n64.d: Likewise. * testsuite/ld-mips-elf/branch-absolute-addend.d: Likewise. * testsuite/ld-mips-elf/branch-absolute-n32.d: Likewise. * testsuite/ld-mips-elf/branch-absolute-n64.d: Likewise. * testsuite/ld-mips-elf/branch-absolute.d: Likewise. * testsuite/ld-mips-elf/dyn-sec64.d: Likewise. * testsuite/ld-mips-elf/eh-frame1-n32.d: Likewise. * testsuite/ld-mips-elf/eh-frame1-n64.d: Likewise. * testsuite/ld-mips-elf/eh-frame2-n32.d: Likewise. * testsuite/ld-mips-elf/eh-frame2-n64.d: Likewise. * testsuite/ld-mips-elf/elf-rel-got-n32-embed.d: Likewise. * testsuite/ld-mips-elf/elf-rel-got-n32.d: Likewise. * testsuite/ld-mips-elf/elf-rel-got-n64-embed.d: Likewise. * testsuite/ld-mips-elf/elf-rel-got-n64-irix.d: Likewise. * testsuite/ld-mips-elf/elf-rel-got-n64.d: Likewise. * testsuite/ld-mips-elf/elf-rel-xgot-n32-embed.d: Likewise. * testsuite/ld-mips-elf/elf-rel-xgot-n32.d: Likewise. * testsuite/ld-mips-elf/elf-rel-xgot-n64-embed.d: Likewise. * testsuite/ld-mips-elf/elf-rel-xgot-n64-irix.d: Likewise. * testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Likewise. * testsuite/ld-mips-elf/emit-relocs-1.d: Likewise. * testsuite/ld-mips-elf/got-dump-2.d: Likewise. * testsuite/ld-mips-elf/got-page-2.d: Likewise. * testsuite/ld-mips-elf/jal-global-overflow-0.d: Likewise. * testsuite/ld-mips-elf/jal-global-overflow-1.d: Likewise. * testsuite/ld-mips-elf/jal-local-overflow-0.d: Likewise. * testsuite/ld-mips-elf/jal-local-overflow-1.d: Likewise. * testsuite/ld-mips-elf/jalbal.d: Likewise. * testsuite/ld-mips-elf/jalx-addend-n32.d: Likewise. * testsuite/ld-mips-elf/jalx-addend-n64.d: Likewise. * testsuite/ld-mips-elf/jalx-addend.d: Likewise. * testsuite/ld-mips-elf/jalx-local-n32.d: Likewise. * testsuite/ld-mips-elf/jalx-local-n64.d: Likewise. * testsuite/ld-mips-elf/jalx-local.d: Likewise. * testsuite/ld-mips-elf/jr-to-b-1.d: Likewise. * testsuite/ld-mips-elf/jr-to-b-2.d: Likewise. * testsuite/ld-mips-elf/lsi-4010-isa.d: Likewise. * testsuite/ld-mips-elf/micromips-branch-absolute-addend-n32.d: Likewise. * testsuite/ld-mips-elf/micromips-branch-absolute-addend-n64.d: Likewise. * testsuite/ld-mips-elf/micromips-branch-absolute-addend.d: Likewise. * testsuite/ld-mips-elf/micromips-branch-absolute-n32.d: Likewise. * testsuite/ld-mips-elf/micromips-branch-absolute-n64.d: Likewise. * testsuite/ld-mips-elf/micromips-branch-absolute.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-2.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-3.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-1.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-2.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-addend-1.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-addend-n32-1.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-addend-n32.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-addend-n64-1.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-addend-n64.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-addend.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-n32-1.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-n32-2.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-n32.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-n64-1.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-n64-2.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute-n64.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-absolute.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-addend-2.d: Likewise. * testsuite/ld-mips-elf/mips16-branch-addend-3.d: Likewise. * testsuite/ld-mips-elf/mips16-hilo-n32.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-0.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-1.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-addend-2.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-addend-6.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-n32-0.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-n32-1.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-n64-sym32-0.d: Likewise. * testsuite/ld-mips-elf/mips16-pcrel-n64-sym32-1.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-0.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-1.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-addend-2.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-addend-6.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-n32-0.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-n32-1.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-n64-sym32-0.d: Likewise. * testsuite/ld-mips-elf/mips16e2-pcrel-n64-sym32-1.d: Likewise. * testsuite/ld-mips-elf/multi-got-1.d: Likewise. * testsuite/ld-mips-elf/multi-got-hidden-1.d: Likewise. * testsuite/ld-mips-elf/multi-got-hidden-2.d: Likewise. * testsuite/ld-mips-elf/multi-got-no-shared.d: Likewise. * testsuite/ld-mips-elf/no-shared-1-n32.d: Likewise. * testsuite/ld-mips-elf/no-shared-1-n64.d: Likewise. * testsuite/ld-mips-elf/no-shared-1-o32.d: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-2.d: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-3-error.d: Likewise. * testsuite/ld-mips-elf/pic-and-nonpic-4-error.d: Likewise. * testsuite/ld-mips-elf/pie-n32.d: Likewise. * testsuite/ld-mips-elf/pie-n64.d: Likewise. * testsuite/ld-mips-elf/pie-o32.d: Likewise. * testsuite/ld-mips-elf/rel32-n32.d: Likewise. * testsuite/ld-mips-elf/rel32-o32.d: Likewise. * testsuite/ld-mips-elf/rel64.d: Likewise. * testsuite/ld-mips-elf/relax-jalr-n32.d: Likewise. * testsuite/ld-mips-elf/reloc-1-n32.d: Likewise. * testsuite/ld-mips-elf/reloc-1-n64.d: Likewise. * testsuite/ld-mips-elf/reloc-2.d: Likewise. * testsuite/ld-mips-elf/reloc-3-n32.d: Likewise. * testsuite/ld-mips-elf/reloc-local-overflow.d: Likewise. * testsuite/ld-mips-elf/textrel-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-micromips.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-micromips.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-r6-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-r6-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-2.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-3.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-jump-micromips.d: Likewise. * testsuite/ld-mips-elf/unaligned-jump-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-jump.d: Likewise. * testsuite/ld-mips-elf/unaligned-ldpc-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-ldpc-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-lwpc-0.d: Likewise. * testsuite/ld-mips-elf/unaligned-lwpc-1.d: Likewise.
2018-07-12MIPS/LD/testsuite: Limit reloc 6 tests to DSO targetsMaciej W. Rozycki2-1/+6
Complement commit 500c05ddbe98 ("MIPS/ld/testsuite: Limit export class call reloc tests to DSO targets") and also check for target's shared library support in determining whether to run reloc 6 tests, which require it. No changes in results as all targets currently enabled for NewABI testing support shared libraries. ld/ * testsuite/ld-mips-elf/mips-elf.exp: Limit reloc 6 tests to shared library targets.
2018-07-11MIPS/BFD: Fix TLS relocation resolution for regular executablesMaciej W. Rozycki9-27/+27
Correct an issue with commit 0f20cc3522e7 ("TLS support for MIPS"), <https://sourceware.org/ml/binutils/2005-02/msg00607.html>, where a condition used to determine whether to use a dynamic symbol for GD, LD and IE TLS dynamic relocations against a symbol that has been defined locally has been incorrectly reversed. It's executables rather than dynamic shared objects where no symbol is required, because such symbols cannot be preempted and therefore their values (thread pointer offsets) are fixed at the static link time as is the associated module ID of the main executable, so the original condition should have been `shared' instead of `!shared'. This wrong condition was then later converted from `!shared' to `!bfd_link_pic', with commit 0e1862bb401f ("Add output_type to bfd_link_info"). Use the correct `bfd_link_dll' condition then, and adjust code for the dynamic symbol index possibly being -1 as with symbols that have been forced local, removing unnecessary dynamic relocations from dynamic regular executables. PIE executables are unaffected as the existing condition excluded them by chance due to the conversion mentioned above. Adjust test cases accordingly. bfd/ * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather than `!bfd_link_pic' in determining the dynamic symbol index. Avoid the index of -1. (mips_elf_initialize_tls_slots): Likewise. Flatten code by moving `dyn' to the beginning of the function block. ld/ * testsuite/ld-mips-elf/tlsdyn-o32.d: Update test for dynamic relocation removal. * testsuite/ld-mips-elf/tlsdyn-o32.got: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-1.d: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-1.got: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-2.d: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-2.got: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-3.d: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-3.got: Likewise.
2018-07-11PR ld/22570: MIPS/BFD: Fix TLS relocation resolution for PIE executablesMaciej W. Rozycki6-0/+137
Correct a commit 0e1862bb401f ("Add output_type to bfd_link_info") issue and use `bfd_link_dll' rather than `bfd_link_pic' in determining whether to fully resolve GD, LD and IE TLS relocations referring to symbols locally defined rather than deferring them to the load time by means of dynamic relocations. Such symbols cannot be preempted in PIE executables, which are necessarily PIC, and therefore their values (thread pointer offsets) are fixed at the static link time as is the associated module ID of the main executable. Given the `tlsbin-o32.s' and `tlsdyn-o32.s' sources from our test suite this removes the absolute TLS relocations from the static: DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE *ABS* 1000002c R_MIPS_TLS_TPREL32 *ABS* 10000030 R_MIPS_TLS_DTPMOD32 *ABS* 10000038 R_MIPS_TLS_DTPMOD32 *ABS* and the dynamic: DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE *ABS* 1000002c R_MIPS_TLS_TPREL32 *ABS* 10000038 R_MIPS_TLS_DTPMOD32 *ABS* 10000044 R_MIPS_TLS_DTPMOD32 *ABS* 10000030 R_MIPS_TLS_DTPMOD32 tlsvar_gd 10000034 R_MIPS_TLS_DTPREL32 tlsvar_gd 10000040 R_MIPS_TLS_TPREL32 tlsvar_ie PIE executable respectively, as reported by `objdump -R', and fills the corresponding GOT slots with the values expected, as recorded with the test cases added. The new output from `objdump -R' is: DYNAMIC RELOCATION RECORDS (none) and: DYNAMIC RELOCATION RECORDS OFFSET TYPE VALUE 00000000 R_MIPS_NONE *ABS* 10000030 R_MIPS_TLS_DTPMOD32 tlsvar_gd 10000034 R_MIPS_TLS_DTPREL32 tlsvar_gd 10000040 R_MIPS_TLS_TPREL32 tlsvar_ie for the static and the dynamic executable respectively. 2018-07-11 Maciej W. Rozycki <macro@mips.com> Rich Felker <bugdal@aerifal.cx> bfd/ PR ld/22570 * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather than `bfd_link_pic' to determine whether dynamic relocations are to be produced. (mips_elf_initialize_tls_slots): Likewise. ld/ PR ld/22570 * testsuite/ld-mips-elf/tlsbin-pie-o32.d: New test. * testsuite/ld-mips-elf/tlsbin-pie-o32.got: New test. * testsuite/ld-mips-elf/tlsdyn-pie-o32.d: New test. * testsuite/ld-mips-elf/tlsdyn-pie-o32.got: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-07-11Revise "ld testsuite use of notarget"Alan Modra6-12/+22
git commit 624940689a wrongly changed fill.d and fill16.d notarget entries to xfail, so revert that change and instead replace notarget with skip. The two tests are complementary. This patch also modifies the pr20022 test to use .data, avoiding xfails on targets that complain about dynamic relocations in .text. This shows a bug in metag which discards section _foo in pr2022.so. * testsuite/ld-elf/hash.d: Comment on mips xfail. * testsuite/ld-gc/pr20022b.s: Use .data not .text. * testsuite/ld-gc/pr20022.d: Remove xfails. * testsuite/ld-scripts/fill.d: Revert most of last patch, but use skip rather than notarget. * testsuite/ld-scripts/fill16.d: Likewise.
2018-07-11MIPS/ld/testsuite: Limit export class call reloc tests to DSO targetsMaciej W. Rozycki2-16/+25
Only run MIPS/LD export class call relocation tests with shared library targets, avoiding: .../ld/ld-new: -shared not supported linker errors and removing: FAIL: MIPS export class call relocation test (o32) regressions with `mipsel-ps2-elf' and `mips64el-ps2-elf' targets. ld/ * testsuite/ld-mips-elf/mips-elf.exp: Limit export class call relocation tests to shared library targets.
2018-07-10xgate testsuite fixesAlan Modra51-87/+122
binutils/ * testsuite/lib/binutils-common.exp (supports_gnu_unique): Return zero for xgate. ld/ * testsuite/lib/ld-lib.exp (check_gc_sections_available): Return 0 for xgate. * testsuite/ld-elf/elf.exp: Add xgate to pr21703 xfails. * testsuite/ld-elf/shared.exp: Add xgate to pr21703 xfails. * testsuite/ld-discard/extern.d: xfail xgate. * testsuite/ld-discard/start.d: Likewise. * testsuite/ld-discard/static.d: Likewise. * testsuite/ld-elf/attributes.d: Likewise. * testsuite/ld-elf/compressed1d.d: Likewise. * testsuite/ld-elf/group1.d: Likewise. * testsuite/ld-elf/group3b.d: Likewise. * testsuite/ld-elf/group8a.d: Likewise. * testsuite/ld-elf/group8b.d: Likewise. * testsuite/ld-elf/group9a.d: Likewise. * testsuite/ld-elf/group9b.d: Likewise. * testsuite/ld-elf/linkonce2.d: Likewise. * testsuite/ld-elf/merge.d: Likewise. * testsuite/ld-elf/merge2.d: Likewise. * testsuite/ld-elf/merge3.d: Likewise. * testsuite/ld-elf/orphan-10.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/orphan3.d: Likewise. * testsuite/ld-elf/pr12851.d: Likewise. * testsuite/ld-elf/pr12975.d: Likewise. * testsuite/ld-elf/pr13177.d: Likewise. * testsuite/ld-elf/pr13195.d: Likewise. * testsuite/ld-elf/pr14156b.d: Likewise. * testsuite/ld-elf/pr17550c.d: Likewise. * testsuite/ld-elf/pr17550d.d: Likewise. * testsuite/ld-elf/pr17615.d: Likewise. * testsuite/ld-elf/pr20528a.d: Likewise. * testsuite/ld-elf/pr20528b.d: Likewise. * testsuite/ld-elf/pr21562a.d: Likewise. * testsuite/ld-elf/pr21562b.d: Likewise. * testsuite/ld-elf/pr21562c.d: Likewise. * testsuite/ld-elf/pr21562d.d: Likewise. * testsuite/ld-elf/pr21562i.d: Likewise. * testsuite/ld-elf/pr21562j.d: Likewise. * testsuite/ld-elf/pr21562k.d: Likewise. * testsuite/ld-elf/pr21562l.d: Likewise. * testsuite/ld-elf/pr21562m.d: Likewise. * testsuite/ld-elf/pr21562n.d: Likewise. * testsuite/ld-elf/pr22677.d: Likewise. * testsuite/ld-elf/pr22836-1a.d: Likewise. * testsuite/ld-elf/pr22836-1b.d: Likewise. * testsuite/ld-elf/pr349.d: Likewise. * testsuite/ld-elf/warn1.d: Likewise. * testsuite/ld-elf/warn2.d: Likewise. * testsuite/ld-elf/warn3.d: Likewise.
2018-07-10xgate cleanupAlan Modra2-2/+7
elf32-xgate.c contains many functions that are only stubs and elf32-xgate.h contains unused declarations. While this might be reasonable for the initial commit of a port with subsequent work fleshing out the stubs, xgate has only had two minor target specific patches since the initial commit over six years ago. The rest of the changes have been general maintenance work applied to all ELF targets, and some of this work could have been avoided if the stubs hadn't been there. So this patch removes all the stubs. I've kept the functionality of the old elf32_xgate_add_symbol_hook, implemented in elf32_xgate_backend_symbol_processing. Presumably, that's to set the symbol st_target_internal flag for use in elf32-m68hc1x.c:elf32_m68hc11_relocate_section. The empty elf32_xgate_relocate_section meant that xgate had no linker. Or at least, no linker relocation processing. Deleting the elf_backend_relocate_section define means the target will now use the generic linker reloc processing. How good that is will depend on the accuracy of the reloc howtos.. I haven't updated the ld testsuite to xfail tests expected to fail for generic elf targets. bfd/ * elf32-xgate.h: Delete. * elf32-xgate.c: Delete unnecessary forward declarations, add two that are now needed. (xgate_elf_bfd_link_hash_table_create) (xgate_elf_bfd_link_hash_table_free) (xgate_elf_set_mach_from_flags, struct xgate_scan_param) (stub_hash_newfunc, elf32_xgate_add_symbol_hook) (elf32_xgate_setup_section_lists, elf32_xgate_size_stubs) (elf32_xgate_build_stubs, elf32_xgate_check_relocs) (elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags) (elf32_xgate_post_process_headers): Delete. (elf32_xgate_backend_symbol_processing): New function. (xgate_elf_ignore_reloc, xgate_elf_special_reloc) (_bfd_xgate_elf_print_private_bfd_data): Make static. (ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs) (elf_backend_relocate_section, elf_backend_object_p) (elf_backend_final_write_processing, elf_backend_can_gc_sections) (elf_backend_post_process_headers, elf_backend_add_symbol_hook) (bfd_elf32_bfd_link_hash_table_create) (bfd_elf32_bfd_set_private_flags) (xgate_stub_hash_lookup): Don't define. (elf_backend_symbol_processing): Define. * elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA. ld/ * emulparams/xgateelf.sh (TEMPLATE_NAME) Set to generic. (EXTRA_EM_FILE): Set to genelf.
2018-07-10ld testsuite use of notargetAlan Modra44-71/+98
Much of the time it is better to use xfail rather than notarget to hide a testsuite failure no one is planning on fixing. 1) When a target is fixed, an inappropriate xfail results in XPASS whereas notarget is silent. Leaving in an inappropriate notarget entry risks the bug reappearing later, silently. 2) Tests might be used as a template for a new test, carrying over notarget and/or xfail. Inappropriate notarget entries are silent. 3) An xfailed test that mysteriously XPASSes might actually indicate a bug. * testsuite/ld-elf/attributes.d: Use xfail rather than notarget. * testsuite/ld-elf/hash.d: Likewise. * testsuite/ld-elf/orphan-10.d: Likewise. * testsuite/ld-elf/overlay.d: Likewise. * testsuite/ld-elf/pr14926.d: Likewise. * testsuite/ld-elf/pr17550d.d: Likewise. * testsuite/ld-elf/pr19539.d: Likewise. * testsuite/ld-elf/pr22319.d: Likewise. * testsuite/ld-misc/defsym1.d: Likewise. * testsuite/ld-pe/pr19803.d: Likewise. * testsuite/ld-scripts/assign-loc.d: Likewise. * testsuite/ld-scripts/defined4.d: Likewise. * testsuite/ld-scripts/empty-address-1.d: Likewise. * testsuite/ld-scripts/empty-address-2a.d: Likewise. * testsuite/ld-scripts/empty-address-2b.d: Likewise. * testsuite/ld-scripts/fill.d: Likewise. * testsuite/ld-scripts/fill16.d: Likewise. * testsuite/ld-scripts/pr14962.d: Likewise. * testsuite/ld-scripts/pr14962-2.d: Likewise. * testsuite/ld-unique/pr21529.d: Likewise. * testsuite/ld-elf/compress1a.d: Likewise, and adjust targets. * testsuite/ld-elf/compressed1a.d: Likewise. * testsuite/ld-elf/compressed1d.d: Likewise. * testsuite/ld-elf/compressed1e.d: Likewise. * testsuite/ld-elf/eh5.d: Likewise. * testsuite/ld-elf/group8a.d: Likewise. * testsuite/ld-elf/linkonce2.d: Likewise. * testsuite/ld-elf/orphan-9.d: Likewise. * testsuite/ld-elf/pr17550a.d: Likewise. * testsuite/ld-elf/pr17550b.d: Likewise. * testsuite/ld-elf/pr17550c.d: Likewise. * testsuite/ld-elf/pr19162.d: Likewise. * testsuite/ld-elf/pr21884.d: Likewise. * testsuite/ld-gc/pr19167.d: Likewise. * testsuite/ld-gc/pr20022.d: Likewise. * testsuite/ld-gc/start.d: Likewise. * testsuite/ld-elf/orphan-11.d: Delete notarget. * testsuite/ld-elf/orphan-12.d: Likewise. * testsuite/ld-gc/stop.d: Likewise. * testsuite/ld-scripts/empty-address-3a.d: Likewise. * testsuite/ld-scripts/empty-address-3b.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64-now.d: Delete duplicate notarget. * testsuite/ld-scripts/section-match-1.d: Comment fix.
2018-07-10MIPS/LD/testsuite: Make Linux dumps for n64 GOT relocation tests the defaultMaciej W. Rozycki8-1480/+1495
The current default dumps for n64 GOT relocation tests only work for IRIX targets really, while the Linux dumps are suitable for non-Linux targets as well. Make the Linux dumps the default then and handle the IRIX ones as a special case. Define an `irix' variable as a shorthand for `[istarget *-*-irix*]' and use it for these n64 GOT relocation tests as well as export class call relocation tests. ld/ * testsuite/ld-mips-elf/elf-rel-got-n64.d: Rename to... * testsuite/ld-mips-elf/elf-rel-got-n64-irix.d: ... this. * testsuite/ld-mips-elf/elf-rel-got-n64-linux.d: Rename to... * testsuite/ld-mips-elf/elf-rel-got-n64.d: ... this. * testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Rename to... * testsuite/ld-mips-elf/elf-rel-xgot-n64-irix.d: ... this. * testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.dd: Rename to... * testsuite/ld-mips-elf/elf-rel-xgot-n64.d: ... this. * testsuite/ld-mips-elf/mips-elf.exp: Update accordingly. Define `irix' as a shorthand for `[istarget *-*-irix*]' and use it throughout.
2018-07-09MIPS/LD/testsuite: Fix IRIX dumps for n64 GOT relocation testsMaciej W. Rozycki3-0/+8
Factor in the presence of a `.gnu.attributes' section at the end of the respective dumps: Disassembly of section .gnu.attributes: 0000000000000000 <.gnu.attributes>: 0: 41000000 bc0f 4 <__dso_displacement+0x4> 4: 0f676e75 jal d9db9d4 <__dso_displacement+0xd9db9d4> 8: 00010000 sll zero,at,0x0 c: 00070401 0x70401 and also ignore any trailing output with the IRIX variant of n64 GOT relocation tests, like already done with the Linux and the embedded ones, removing: FAIL: MIPS ELF got reloc n64 FAIL: MIPS ELF xgot reloc n64 LD testsuite regressions with the `mips-sgi-irix6' target. ld/ * testsuite/ld-mips-elf/elf-rel-got-n64.d: Add `#pass' at the end. * testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
2018-07-09MIPS/BFD: Do not redirect to discarded lazy binding stubsMaciej W. Rozycki16-0/+221
Correct a MIPS/BFD linker issue with dynamic symbol and corresponding GOT entry values being redirected to lazy binding stubs where the stubs section has been discarded by assigning to the `/DISCARD/' output section in the linker script used. The issue manifests itself by the values entered being relative to the absolute section, which is what any discarded sections are internally assigned in the linker. For the `stub-dynsym-2.s' piece of code included as a test case with this change this issue results in the dynamic symbol table and the GOT looking like: Symbol table '.dynsym' contains 3 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000010 0 FUNC GLOBAL DEFAULT UND bar 2: 00000000 0 FUNC GLOBAL DEFAULT UND foo Primary GOT: Canonical gp value: 00097ff0 Reserved entries: Address Access Initial Purpose 00090000 -32752(gp) 00000000 Lazy resolver 00090004 -32748(gp) 80000000 Module pointer (GNU extension) Global entries: Address Access Initial Sym.Val. Type Ndx Name 00090008 -32744(gp) 00000010 00000010 FUNC UND bar 0009000c -32740(gp) 00000000 00000000 FUNC UND foo if assembled to regular MIPS code, or: Symbol table '.dynsym' contains 3 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000d 0 FUNC GLOBAL DEFAULT UND bar 2: 00000001 0 FUNC GLOBAL DEFAULT UND foo Primary GOT: Canonical gp value: 00097ff0 Reserved entries: Address Access Initial Purpose 00090000 -32752(gp) 00000000 Lazy resolver 00090004 -32748(gp) 80000000 Module pointer (GNU extension) Global entries: Address Access Initial Sym.Val. Type Ndx Name 00090008 -32744(gp) 0000000d 0000000d FUNC UND bar 0009000c -32740(gp) 00000001 00000001 FUNC UND foo if assembled to microMIPS code. Symbol values and GOT entries record the offset into the inexistent stubs section and the ISA bit rather than zero, which would be the case if a lazy binding stub was not used for other reasons, such as the value of the symbol being taken for a purpose other than making a function call (e.g. an R_MIPS_GOT16 relocation). Correct the issue by refraining from redirecting symbols to lazy binding stubs if the stubs section is going to be discarded. bfd/ * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set `->needs_lazy_stub' if the stubs output section is the absolute section. ld/ * testsuite/ld-mips-elf/stub-dynsym-2.dd: New test. * testsuite/ld-mips-elf/stub-dynsym-2.gd: New test. * testsuite/ld-mips-elf/stub-dynsym-2.sd: New test. * testsuite/ld-mips-elf/stub-dynsym-discard-2.gd: New test. * testsuite/ld-mips-elf/stub-dynsym-discard-2.sd: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-2.dd: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-2.gd: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-2.sd: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.dd: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.gd: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.sd: New test. * testsuite/ld-mips-elf/stub-dynsym-2.ld: New test linker script. * testsuite/ld-mips-elf/stub-dynsym-discard-2.ld: New test linker script. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-07-09LD/testsuite: run_dump_test: Report UNSUPPORTED for excluded targetsMaciej W. Rozycki2-3/+51
Bring the LD implementation of `run_dump_test' in line with its binutils and GAS counterparts and report the UNSUPPORTED status for tests the run of which has been prevented by means of one or more of `target', `alltargets' and `notarget' tags. Define `skip', `anyskip' and `noskip' tags, which do not report anything for tests that are not run. The rationale behind this is that we want to have unsupported tests reported to ensure that they have actually been attempted and have not been accidentally suppressed. Then tests which have target-specific variants that cannot be expressed with a single .d file can make use of the newly added tags to silently suppress the uninteresting variants. ld/ * testsuite/lib/ld-lib.exp (run_dump_test): Call `unsupported' if the target being tested has been excluded by means of one or more of `target', `alltargets' and `notarget' tags. Add support for `skip', `anyskip' and `noskip' tags.
2018-07-09LD/testsuite: run_dump_test: Use the intended test name ASAPMaciej W. Rozycki2-9/+14
Bring the LD implementation of `run_dump_test' in line with its binutils and GAS counterparts and use the intended test name, from the `name' tag if set, for test status reporting as soon as it is available. ld/ * testsuite/lib/ld-lib.exp (run_dump_test): Move the setting of `testname' earlier on and use it for test status reporting.
2018-07-09m68hc1* fixesAlan Modra4-3/+6
With config.sub now properly returning m68hc12-unknown-elf rather than m68hc12-unknown-none, more ELF tests run. This patch enables STB_GNU_UNIQUE processing fixing some testsuite failures that probably no m68hc12 user cares about, and removes some XPASSes. bfd/ * elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call _bfd_elf_post_process_headers. ld/ * testsuite/ld-discard/extern.d: Remove m68hc12 xfail. * testsuite/ld-discard/start.d: Likewise. * testsuite/ld-discard/static.d: Likewise.
2018-07-09[ARM] Fix warning cannot find thumb start symbolChristophe Lyon2-1/+6
In case params.thumb_entry_symbol has its default NULL value, using it to print a warning in gld${EMULATION_NAME}_finish results in a crash. Use h->root.string instead which either points to params.thumb_entry_symbol name or to entry_symbol name. 2018-07-09 Christophe Lyon <christophe.lyon@linaro.org> * emultempl/armelf.em (gld${EMULATION_NAME}_finish): Use the right symbol name in case of warning. Change-Id: Iec61a833c0ad538b1440bf326ba67834c314dd63
2018-07-05RISC-V: Add riscv-*-* configure support, and minor cleanup.Jim Wilson2-1/+6
bfd/ * config.bfd (riscv32*-*-*): Renamed from riscv32-*-*. (riscv64*-*-*): Likewise. (riscv-*-*): Add as an alias for riscv32*-*-*. ld/ * configure.tgt (riscv-*-*): Add as an alias for riscv32*-*-*.
2018-07-05MIPS/LD/testsuite: Use $linux_gnu consistently across `mips-elf.exp'Maciej W. Rozycki2-2/+7
Replace two remaining spelled-out calls to `[istarget mips*-*-linux*]' in `mips-elf.exp' with $linux_gnu, which is equivalent. ld/ * testsuite/ld-mips-elf/mips-elf.exp: Replace remaining calls to `[istarget mips*-*-linux*]' with $linux_gnu.
2018-07-05x86: Remove x86 ISA properties with empty bitsH.J. Lu15-0/+199
There is no need to generate x86 ISA properties with empty bits in linker output. bfd/ PR ld/23372 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86 ISA properties with empty bits. ld/ PR ld/23372 * testsuite/ld-i386/i386.exp: Run pr23372a and pr23372b. * testsuite/ld-i386/pr23372a.d: New file. * testsuite/ld-i386/pr23372a.s: Likewise. * testsuite/ld-i386/pr23372b.d: Likewise. * testsuite/ld-i386/pr23372b.s: Likewise. * testsuite/ld-i386/pr23372c.s: Likewise. * testsuite/ld-x86-64/pr23372a-x32.d: Likewise. * testsuite/ld-x86-64/pr23372a.d: Likewise. * testsuite/ld-x86-64/pr23372a.s: Likewise. * testsuite/ld-x86-64/pr23372b-x32.d: Likewise. * testsuite/ld-x86-64/pr23372b.d: Likewise. * testsuite/ld-x86-64/pr23372b.s: Likewise. * testsuite/ld-x86-64/pr23372c.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr23372a, pr23372a-x32, pr23372b and pr23372b-x32.
2018-07-05Updated Russian, Bulgarian, and Brazilian Portuguese translations for ↵Nick Clifton3-2470/+11651
various components of the binutuls. ld * po/bg.po: Updated Bulgarian translation. * po/pt_BR.po: Updated Brazilian Portuguese translation. binutils* po/bg.po: Updated Bulgarian translation. bfd,gas * po/ru.po: Updated Russian translation.
2018-07-05Error for mismatched powerpc ABI tagsAlan Modra9-8/+19
And report the two input files that are incompatible rather than reporting that an input file is incompatible with the output. bfd/ * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype. * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error on mismatch. Remove "warning: " from messages. Track last bfd used to set tags. (ppc_elf_merge_obj_attributes): Likewise. Handle status from _bfd_elf_ppc_merge_fp_attributes. * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status from _bfd_elf_ppc_merge_fp_attributes. ld/ * testsuite/ld-powerpc/attr-gnu-4-12.d: Update expected output. * testsuite/ld-powerpc/attr-gnu-4-13.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-21.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-23.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-31.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-32.d: Likewise. * testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise. * testsuite/ld-powerpc/attr-gnu-12-21.d: Likewise.
2018-07-04ld: Set non_ir_ref_regular for --undefined SYMBOLH.J. Lu6-7/+26
Set non_ir_ref_regular to TRUE for symbols forced into the output file so that they won't be removed by garbage collection with LTO. PR ld/23309 * ldlang.c (insert_undefined): Set non_ir_ref_regular to TRUE. * plugin.c (is_visible_from_outside): Don't scan entry_symbol. * testsuite/ld-plugin/pr23309.c: New file. * testsuite/ld-plugin/pr23309.d: Likewise.
2018-07-04ld: Properly display default for -z separate-codeH.J. Lu2-0/+13
Check DEFAULT_LD_Z_SEPARATE_CODE to display default for -z separate-code. PR ld/23358 * lexsup.c (elf_shlib_list_options): Properly display default for -z separate-code.
2018-07-02MIPS/LD/testsuite: Fix a typo in PR ld/21334 test nameMaciej W. Rozycki2-1/+6
ld/ * testsuite/ld-mips-elf/mips-elf.exp: Fix a typo in PR ld/21334 test name.
2018-07-02x86-64: Clear the R_X86_64_converted_reloc_bit bitH.J. Lu5-0/+31
We need to clear the R_X86_64_converted_reloc_bit bit after setting it to avoid leaking it out by --emit-relocs. bfd/ PR ld/23324 * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the R_X86_64_converted_reloc_bit bit. ld/ PR ld/23324 * testsuite/ld-x86-64/pr23324.s: New file. * testsuite/ld-x86-64/pr23324a.d: Likewise. * testsuite/ld-x86-64/pr23324b.d: Likewise.
2018-07-02[ARM] Update bfd's Tag_CPU_arch knowledgeThomas Preud'homme5-4/+10
BFD's bfd_get_mach () function returns a bfd specific value representing the architecture of the target which is populated from the Tag_CPU_arch build attribute value of that target. Among other users of that interfacem, objdump which uses it to print the architecture version of the binary being examinated and to decide what instruction is available if run with "-m arm" via its own mapping from bfd_mach_arm_X values to feature bits available. However, both BFD and objdump's most recent known architecture is Armv5TE. When encountering a newer architecture bfd_get_mach will return bfd_mach_arm_unknown. This is unfortunate since objdump uses that value to allow all instructions on all architectures which is already what it does by default, making the "-m arm" trick useless. This patch updates BFD and objdump's knowledge of Arm architecture versions up to the latest Armv8-M Baseline and Mainline, Armv8-R and Armv8.4-A architectures. Since several architecture versions (eg. 8.X-A) share the same Tag_CPU_arch build attribute value and bfd_mach_arm values, the mapping from bfd machine value to feature bits need to return the most featureful feature bits that would yield the given bfd machine value otherwise some instruction would not disassemble under "-m arm" mode. The patch rework that mapping to make this clearer and simplify writing the mapping rules. In particular, for simplicity all FPU instructions are allowed in all cases. Finally, the patch also rewrite the cpu_arch_ver table in GAS to use the TAG_CPU_ARCH_X macros rather than hardcode their value. 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com> bfd/ * archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ, bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M, bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R, bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define. * bfd-in2.h: Regenerate. * cpu-arm.c (arch_info_struct): Add entries for above new bfd_mach_arm values. * elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later architectures. Force assert failure for any new Tag_CPU_arch value. gas/ * config/tc-arm.c (cpu_arch_ver): Use symbolic TAG_CPU_ARCH macros rather than hardcode their values. ld/ * arm-dis.c (select_arm_features): Fix typo in heading comment. Allow all FPU features and add mapping from new bfd_mach_arm values to allowed CPU feature bits. opcodes/ * testsuite/ld-arm/tls-descrelax-be8.d: Add architecture version in expected result. * testsuite/ld-arm/tls-descrelax-v7.d: Likewise. * testsuite/ld-arm/tls-longplt-lib.d: Likewise. * testsuite/ld-arm/tls-longplt.d: Likewise.
2018-07-02Fix use of "command line X" in binutils docThomas Preud'homme4-51/+57
Binutils documentation uses a mix of spelling for the compound word "command-line X". According to [1]: "Sometimes compound words are written separately (nail polish), sometimes with a hyphen (short-sighted) and sometimes as one word (eyelashes). Often new compounds are written as two separate words and, as they become more familiar, they are either connected with a hyphen (-) or made into one word." I think command-line X is common enough in our industry that the two workds command and line should be connected. Since command-line is more common than commandline, I propose to update binutils documentation to consistently use "command-line" when this is used as an adjective to a noun (eg. command-line argument, command-line switch, command-line option and command-line flag). I've left occurences of "the command line" as is. I've also left gdb, sim and readline alone and have only touched public documentation (texi and NEWS files). [1] http://dictionary.cambridge.org/grammar/british-grammar/word-formation/compounds 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com> bfd/ * doc/bfdint.texi: Use command-line consistently when used in a compount word. * doc/bfdsumm.texi: Likewise. binutils/ * NEWS: Use command-line consistently when used in a compount word. * doc/binutils.texi: Likewise and fix trailing whitespace on same line. gas/ * NEWS: Use command-line consistently when used in a compount word. * doc/as.texi: Likewise. * doc/c-aarch64.texi: Likewise. * doc/c-alpha.texi: Likewise. * doc/c-arc.texi: Likewise. * doc/c-arm.texi: Likewise. * doc/c-avr.texi: Likewise. * doc/c-bfin.texi: Likewise. * doc/c-cris.texi: Likewise. * doc/c-epiphany.texi: Likewise. * doc/c-i386.texi: Likewise. * doc/c-ia64.texi: Likewise. * doc/c-lm32.texi: Likewise. * doc/c-m32r.texi: Likewise. * doc/c-m68k.texi: Likewise. * doc/c-mips.texi: Likewise. * doc/c-mmix.texi: Likewise. * doc/c-msp430.texi: Likewise. * doc/c-mt.texi: Likewise. * doc/c-nios2.texi: Likewise. * doc/c-ppc.texi: Likewise. * doc/c-pru.texi: Likewise. * doc/c-rl78.texi: Likewise. * doc/c-rx.texi: Likewise. * doc/c-tic6x.texi: Likewise. * doc/c-v850.texi: Likewise. * doc/c-vax.texi: Likewise. * doc/c-visium.texi: Likewise. * doc/c-xstormy16.texi: Likewise. * doc/c-xtensa.texi: Likewise. * doc/c-z80.texi: Likewise. * doc/c-z8k.texi: Likewise. * doc/internals.texi: Likewise. gprof/ * gprof.texi: Use command-line consistently when used in a compount word. ld/ * NEWS: Use command-line consistently when used in a compount word. * ld.texinfo: Likewise. * ldint.texinfo: Likewise.
2018-06-26Updated translations.Nick Clifton2-1181/+5698
gas * po/uk.po: Updated Ukranian translation. bfd * po/uk.po: Updated Ukranian translation. ld * po/uk.po: Updated Ukranian translation. gold * po/uk.po: Updated Ukranian translation. opcodes * po/uk.po: Updated Ukranian translation. * po/de.po: Updated German translation. * po/pt_BR.po: Updated Brazilian Portuguese translation. binutils* po/sv.po: Updated Swedish translation. * po/uk.po: Updated Ukranian translation.
2018-06-26PR23169 bogus testAlan Modra2-1/+20
The testcase isn't valid. If it happens to run on your target, you're lucky. PR 23169 * testsuite/ld-ifunc/ifunc.exp: Don't run pr23169 tests on powerpc. Comment.
2018-06-26Fix parens in ld bootstrap.expAlan Modra2-2/+9
Seen with tcl 8.5.13: ERROR: tcl error sourcing .../ld/testsuite/ld-bootstrap/bootstrap.exp. ERROR: expected boolean value but got " [istarget ia64-*-elf*] || [istarget ia64-*-linux*" while executing "if { "$flags" == "--static" && { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] } || [istarget mips*-*-linux*] } { # On ia64 and mips, tmpdir/l..." * testsuite/ld-bootstrap/bootstrap.exp: Use parentheses rather than curly braces in logical expression.
2018-06-26Fix spelling mistakes.Nick Clifton4-3/+9
opcodes * nfp-dis.c: Fix spelling mistake. ld * emultempl/aarch64elf.em: Fix spelling mistake. * emultempl/avrelf.em: Likewise. * emultempl/elf32.em: Likewise. binutils* doc/binutils.texi: Fix spelling mistakes. * README--how-to-make-a-release: Likewise.
2018-06-24Regenerate configure and pot files with updated binutils version number.Nick Clifton3-1030/+5508
2018-06-24Add 2.30 branch notes to ChangeLogs and NEWS files.Nick Clifton2-0/+7
2018-06-20[BFD][AARCH64]Properly truncate no overflow checking relocation value for ↵Renlin Li4-3/+9
load/store immediate. bfd/ChangeLog: 2018-06-20 Renlin Li <renlin.li@arm.com> * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC. ld/ChangeLog: 2018-06-20 Renlin Li <renlin.li@arm.com> * testsuite/ld-aarch64/emit-relocs-115.d: Update test with new value. * testsuite/ld-aarch64/emit-relocs-534.d: Likewise. * testsuite/ld-aarch64/emit-relocs-555.d: Likewise.
2018-06-20PR ld/22966: Fix n64 MIPS `.got.plt' range checksMaciej W. Rozycki14-0/+262
The addressable signed 32-bit range for n64 MIPS `.got.plt' references is from 0xffffffff7fff8000 to 0x7fff7fff, due to how the composition of an LUI and an LD instruction works for address calculation in the 64-bit addressing mode, such as when CP0.Status.UX=1. We currently have a range check in `mips_finish_exec_plt', however it is not correct as it verifies that the `.got.plt' start address referred is between 0xffffffff80000000 and 0x7fffffff. It is also implemented as an assertion rather than a proper error message despite that the situation can be triggered by user input. Additionally there is no check made for individual `.got.plt' entries referred even though they can be out of range while the `.got.plt' start address is not. Fix all these problems and use the correct range for the check, limiting it to n64 output files, and then issue a proper error message both in `mips_finish_exec_plt' and in `_bfd_mips_elf_finish_dynamic_symbol', suggesting the use of the `-Ttext-segment=...' option that will often work and with the default linker scripts in particular. Add suitable tests covering boundary cases. bfd/ PR ld/22966 * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the `.got.plt' entry referred is in range. (mips_finish_exec_plt): Correct the range check for `.got.plt' start. Replace the assertion used for that with a proper error message. ld/ PR ld/22966 * testsuite/ld-mips-elf/n64-plt-1.dd: New test. * testsuite/ld-mips-elf/n64-plt-1.gd: New test. * testsuite/ld-mips-elf/n64-plt-2.ed: New test. * testsuite/ld-mips-elf/n64-plt-3.ed: New test. * testsuite/ld-mips-elf/n64-plt-4.dd: New test. * testsuite/ld-mips-elf/n64-plt-4.gd: New test. * testsuite/ld-mips-elf/n64-plt-1.ld: New test linker script. * testsuite/ld-mips-elf/n64-plt-2.ld: New test linker script. * testsuite/ld-mips-elf/n64-plt-3.ld: New test linker script. * testsuite/ld-mips-elf/n64-plt-4.ld: New test linker script. * testsuite/ld-mips-elf/n64-plt.s: New test source. * testsuite/ld-mips-elf/n64-plt-lib.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-06-20MIPS/LD/testsuite: XFAIL DT_TEXTREL map file warning testMaciej W. Rozycki2-1/+11
Remove: FAIL: DT_TEXTREL map file warning introduced with commit 63c1f59d6655 ("readonly_dynrelocs"), coming from the lack of a "dynamic relocation against `foo' in read-only section `.rodata'" warning message produced. The cause of the failure is that for sections which have dynamic relocations attached the MIPS backend sets SHF_WRITE, in `mips_elf_create_dynamic_relocation', yielding: $ readelf -S textrel.so | grep rodata [ 8] .rodata PROGBITS 00000254 000254 000004 00 WA 0 0 1 $ so the section is read/write and therefore there is nothing to warn about. This arrangement came from commit 7403cb6305f5 ("PATCH for N32 ABI"), <https://sourceware.org/ml/binutils/1999-q2/msg00375.html>, i.e. for all practical purposes it has been there since forever, and therefore it can be considered a part of the ABI and the test case irrelevant for MIPS targets. We don't have a clean way to request UNSUPPORTED result, which would be the most appropriate here, so just XFAIL the test instead. ld/ * testsuite/ld-elf/shared.exp: XFAIL DT_TEXTREL map file warning test for `mips*-*-*'.
2018-06-19Bump to autoconf 2.69 and automake 1.15.1Simon Marchi12-1206/+1838
When trying to run the update-gnulib.sh script in gdb, I get this: Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1. Aborting. Apparently, it's an issue with a regex in automake that triggers a warning starting with Perl 5.22. It has been fixed in automake 1.15.1. So I think it's a good excuse to bump the versions of autoconf and automake used in the gnulib import. And to avoid requiring multiple builds of autoconf/automake, it was suggested that we bump the required version of those tools for all binutils-gdb. For autoconf, the 2.69 version is universally available, so it's an easy choice. For automake, different distros and distro versions have different automake versions. But 1.15.1 seems to be the most readily available as a package. In any case, it's easy to build it from source. I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ, because I don't think they are useful in our case. They only specify a lower bound for the acceptable version of automake/autoconf. That's useful if you let the user choose the version of the tool they want to use, but want to set a minimum version (because you use a feature that was introduced in that version). In our case, we force people to use a specific version anyway. For the autoconf version, we have the check in config/override.m4 that enforces the version we want. It will be one less thing to update next time we change autotools version. I hit a few categories of problems that required some changes. They are described below along with the chosen solutions. Problem 1: configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see: configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation Solution 1: Adjust the code based on the example at that URL. Problem 2 (in zlib/): Makefile.am: error: required file './INSTALL' not found Makefile.am: 'automake --add-missing' can install 'INSTALL' Makefile.am: error: required file './NEWS' not found Makefile.am: error: required file './AUTHORS' not found Makefile.am: error: required file './COPYING' not found Makefile.am: 'automake --add-missing' can install 'COPYING' Solution 2: Add the foreign option to AUTOMAKE_OPTIONS. Problem 3: doc/Makefile.am:20: error: support for Cygnus-style trees has been removed Solution 3: Remove the cygnus options. Problem 4: Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') Solution 4: Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is already defined earlier). Problem 5: doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead doc/Makefile.am: warning: Oops! doc/Makefile.am: It appears this file (or files included by it) are triggering doc/Makefile.am: an undocumented, soon-to-be-removed automake hack. doc/Makefile.am: Future automake versions will no longer place in the builddir doc/Makefile.am: (rather than in the srcdir) the generated '.info' files that doc/Makefile.am: appear to be cleaned, by e.g. being listed in CLEANFILES or doc/Makefile.am: DISTCLEANFILES. doc/Makefile.am: If you want your '.info' files to be placed in the builddir doc/Makefile.am: rather than in the srcdir, you have to use the shiny new doc/Makefile.am: 'info-in-builddir' automake option. Solution 5: Rename .texinfo files to .texi. Problem 6: doc/Makefile.am: warning: Oops! doc/Makefile.am: It appears this file (or files included by it) are triggering doc/Makefile.am: an undocumented, soon-to-be-removed automake hack. doc/Makefile.am: Future automake versions will no longer place in the builddir doc/Makefile.am: (rather than in the srcdir) the generated '.info' files that doc/Makefile.am: appear to be cleaned, by e.g. being listed in CLEANFILES or doc/Makefile.am: DISTCLEANFILES. doc/Makefile.am: If you want your '.info' files to be placed in the builddir doc/Makefile.am: rather than in the srcdir, you have to use the shiny new doc/Makefile.am: 'info-in-builddir' automake option. Solution 6: Remove the hack at the bottom of doc/Makefile.am and use the info-in-builddir automake option. Problem 7: doc/Makefile.am:35: error: required file '../texinfo.tex' not found doc/Makefile.am:35: 'automake --add-missing' can install 'texinfo.tex' Solution 7: Use the no-texinfo.tex automake option. We also have one in texinfo/texinfo.tex, not sure if we should point to that, or move it (or a newer version of it added with automake --add-missing) to top-level. Problem 8: Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory, Makefile.am:131: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. Solution 8: Use subdir-objects, that means adjusting references to some .o that will now be in config/. Problem 9: configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from... ../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from... ../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from... ../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from... ../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from... configure.ac:375: the top level Solution 9: Use AC_LANG_SOURCE, or use proper quoting. Problem 10 (in intl/): configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS /usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from... /usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from... /usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from... /usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from... /usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from... /usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from... /usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from... configure.ac:7: the top level Solution 10: Add AC_USE_SYSTEM_EXTENSIONS in configure.ac. ChangeLog: * libtool.m4: Use AC_LANG_SOURCE. * configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE. * README-maintainer-mode: Update version requirements. * ar-lib: New file. * test-driver: New file. * configure: Re-generate. bfd/ChangeLog: * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11. (INCLUDES): Rename to ... (AM_CPPFLAGS): ... this. * configure.ac: Remove AC_PREREQ. * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add info-in-builddir no-texinfo.tex. (info_TEXINFOS): Rename bfd.texinfo to bfd.texi. * doc/bfd.texinfo: Rename to ... * doc/bfd.texi: ... this. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. binutils/ChangeLog: * configure.ac: Remove AC_PREREQ. * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add info-in-builddir no-texinfo.tex. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. config/ChangeLog: * override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69. etc/ChangeLog: * configure.in: Remove AC_PREREQ. * configure: Re-generate. gas/ChangeLog: * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects. (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix. * configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles, extra_objects): Add config/ prefix. * doc/as.texinfo: Rename to... * doc/as.texi: ... this. * doc/Makefile.am: Rename as.texinfo to as.texi throughout. Remove DISTCLEANFILES hack. (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and info-in-builddir. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. * doc/Makefile.in: Re-generate. gdb/ChangeLog: * common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_STRING, PACKAGE_TARNAME): Undefine. * configure.ac: Remove AC_PREREQ, add missing quoting. * gnulib/configure.ac: Modernize usage of AC_INIT/AM_INIT_AUTOMAKE. Remove AC_PREREQ. * gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69. (AUTOMAKE_VERSION): Bump to 1.15.1. * configure: Re-generate. * config.in: Re-generate. * aclocal.m4: Re-generate. * gnulib/aclocal.m4: Re-generate. * gnulib/config.in: Re-generate. * gnulib/configure: Re-generate. * gnulib/import/Makefile.in: Re-generate. gdb/gdbserver/ChangeLog: * configure.ac: Remove AC_PREREQ, add missing quoting. * configure: Re-generate. * config.in: Re-generate. * aclocal.m4: Re-generate. gdb/testsuite/ChangeLog: * configure.ac: Remove AC_PREREQ. * configure: Re-generate. gold/ChangeLog: * configure.ac: Remove AC_PREREQ, add missing quoting and usage of AC_LANG_SOURCE. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. * testsuite/Makefile.in: Re-generate. gprof/ChangeLog: * configure.ac: Remove AC_PREREQ. * Makefile.am: Remove DISTCLEANFILES hack. (AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. * gconfig.in: Re-generate. intl/ChangeLog: * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ. * configure: Re-generate. * config.h.in: Re-generate. * aclocal.m4: Re-generate. ld/ChangeLog: * configure.ac: Remove AC_PREREQ. * Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to ld.texi, ldint.texinfo to ldint.texi throughout. (AUTOMAKE_OPTIONS): Add info-in-builddir. * README: Rename ld.texinfo to ld.texi, ldint.texinfo to ldint.texi throughout. * gen-doc.texi: Likewise. * h8-doc.texi: Likewise. * ld.texinfo: Rename to ... * ld.texi: ... this. * ldint.texinfo: Rename to ... * ldint.texi: ... this. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * config.in: Re-generate. * configure: Re-generate. libdecnumber/ChangeLog: * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * aclocal.m4. libiberty/ChangeLog: * configure.ac: Remove AC_PREREQ. * configure: Re-generate. * config.in: Re-generate. opcodes/ChangeLog: * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11. * configure.ac: Remove AC_PREREQ. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. readline/ChangeLog.gdb: * configure: Re-generate. * examples/rlfe/configure: Re-generate. sim/ChangeLog: * All configure.ac: Remove AC_PREREQ. * All configure: Re-generate. zlib/ChangeLog.bin-gdb: * configure.ac: Modernize AC_INIT call, remove AC_PREREQ. * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate.
2018-06-18Build ifunc tests when non-nativeAlan Modra5-14/+21
Plus a number of fixes to the pr23169 tests. * testsuite/lib/ld-lib.exp (check_ifunc_available): Pass without running executable when non-native. (check_ifunc_attribute_available): Likewise. * testsuite/ld-ifunc/pr23169a.rd: Remove extraneous lines. Match st_other strings. Pass when func is an ifunc. * testsuite/ld-ifunc/pr23169b.rd: Remove extraneous lines. Correct reloc regexp. Correct match-anything line. * testsuite/ld-ifunc/pr23169c.rd: Remove extraneous lines. Match st_other strings.
2018-06-14ELF dynsymsAlan Modra35-283/+311
Many ELF targets arrange to emit a number of section symbols in .dynsym for use by dynamic relocations. This happens before the dynamic relocations are output, and the need for those symbols determined. In most cases they are not needed. A proper analysis of the need for dynamic section symbols is target specific and tedious, so this patch just excludes them in the obvious case when no dynamic relocations are present. The patch also runs the new pr23161 and pr23162 tests on more targets. bfd/ * elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs". * elflink.c (_bfd_elf_init_2_index_sections): Comment fix. (_bfd_elf_add_dynamic_entry): Set "dynamic_relocs". (_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when "dynamic_relocs" is not set. * elfxx-mips.c (count_section_dynsyms): Likewise. ld/ * testsuite/ld-elf/readelf.exp: Delete DUMP and selection of variant ver_def.vd. * testsuite/ld-elf/ver_def-tic6x.vd: Delete. * testsuite/ld-elf/shared.exp: Run most pr23161 and pr23162 tests for linux, nacl and gnu targets. * testsuite/ld-mips-elf/mips-elf.exp: Set base_syms to 1. * testsuite/ld-elf/pr23161a.rd: Don't check reloc type. Allow any order of __bss_start, _edata and _end. * testsuite/ld-elf/pr23161b.rd: Don't check plt and dyn relocs. Allow and order of __bss_start, _edata and _end. * testsuite/ld-elf/pr23162.rd: Fail if __bss_start, _edata or _end relocs are present rather than testing for no relocations. * testsuite/ld-aarch64/gc-plt-relocs.d, * testsuite/ld-aarch64/ifunc-1-local.d, * testsuite/ld-aarch64/ifunc-1.d, * testsuite/ld-aarch64/ifunc-2-local.d, * testsuite/ld-aarch64/ifunc-2.d, * testsuite/ld-aarch64/ifunc-21.d, * testsuite/ld-aarch64/ifunc-3a.d, * testsuite/ld-arm/farcall-mixed-lib-v4t.d, * testsuite/ld-arm/farcall-mixed-lib.d, * testsuite/ld-arm/gc-hidden-1.d, * testsuite/ld-arm/tls-gdesc-got.d, * testsuite/ld-arm/tls-lib-loc.d, * testsuite/ld-arm/tls-longplt-lib.d, * testsuite/ld-arm/tls-thumb1.d, * testsuite/ld-cris/libdso-10.d, * testsuite/ld-cris/libdso-11.d, * testsuite/ld-cris/libdso-13b.d, * testsuite/ld-cris/libdso-14.d, * testsuite/ld-cris/libdso-15.d, * testsuite/ld-cris/pic-gc-72.d, * testsuite/ld-cris/pic-gc-73.d, * testsuite/ld-cris/tls-gc-71.d, * testsuite/ld-mips-elf/mips16-pic-4a.nd, * testsuite/ld-mips-elf/pic-and-nonpic-3a.dd, * testsuite/ld-mips-elf/pie-n32.d, * testsuite/ld-mips-elf/pie-n64.d, * testsuite/ld-mips-elf/pie-o32.d: Update for removed dynamic section symbols.
2018-06-12testsuite/ld-cris/libdso-1.d: Correct recent address pattern update.Hans-Peter Nilsson2-1/+7
2018-06-12Fix the PR22983 test so that it will work regardless of the order of the ↵Nick Clifton6-2/+49
symbols in the dynamic symbol table. See email thread starting here for more details: https://sourceware.org/ml/binutils/2018-06/msg00036.html PR 22983 * testsuite/ld-plugin/lto.exp: Use individual tests to check for the presence of each expected symbol. * testsuite/ld-plugin/pr22983.1.d: New file. * testsuite/ld-plugin/pr22983.2.d: New file. * testsuite/ld-plugin/pr22983.3.d: New file. * testsuite/ld-plugin/pr22983.4.d: New file.
2018-06-12Fix syntax error in AArch64 default linker scripts when invoked with -shared.Nick Clifton2-1/+6
* emulparams/aarch64elf.sh (OTHER_BSS_END_SYMBOLS): Make the definition of the __bss_end__ symbol conditional upon CREATE_SHLIB.
2018-06-11Updated Spanish translations for the binutils/ and ld/ subdirectories.Nick Clifton2-162/+160
* po/es.po: Updated Spanish translation.
2018-06-09MIPS/LD/testsuite: Add microMIPS lazy binding stub testsMaciej W. Rozycki12-22/+217
Adapt the existing regular MIPS lazy binding stub tests for microMIPS code verification. Check both regular and `--insn32' variants. Correct indentation issues in the conditional updated. ld/ * testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests. Fix indentation.
2018-06-09MIPS/LD/testsuite: Fix lazy binding stub test symbol count commentMaciej W. Rozycki2-1/+6
Update the symbol count in the comment associated with lazy binding stub tests to match `base_syms', complementing commit 889acb80acd5 ("MIPS/Linux/LD/testsuite: Linker script _gp scope updates"), <https://sourceware.org/ml/binutils/2012-08/msg00066.html>, and commit 2f9efdfcdbf1 ("mips/bfd/ld: Fix --as-needed on mips and update related ld tests"), <https://sourceware.org/ml/binutils/2013-09/msg00131.html>. ld/ * testsuite/ld-mips-elf/mips-elf.exp: Update symbol count in the comment associated with lazy binding stub tests.
2018-06-09MIPS/LD: Add missing `mips-*-windiss' target emulation dependencyMaciej W. Rozycki3-2/+7
As from commit 2ebd05b80b22 ("MIPS/LD: Correct `mips-*-windiss' target emulation configuration") we have: EXTRA_EM_FILE=mipself in `emulparams/elf32mipswindiss.sh', however no corresponding Makefile `mipself.em' dependency for `eelf32mipswindiss.c'. Add it. ld/ * Makefile.am (eelf32mipswindiss.c): Add `mipself.em' dependency. * Makefile.in: Regenerate.
2018-06-08ld/x86: Remove hidden _edata, __bss_start, and _endH.J. Lu2-7/+7
There is no need to put hidden _edata, __bss_start, and _end in dynamic symbol table in shared libraries. bfd/ PR ld/23161 * elfxx-x86.c (elf_x86_hide_linker_defined): New function. (_bfd_x86_elf_link_check_relocs): Use it to hide hidden __bss_start, _end and _edata in shared libraries. ld/ PR ld/23161 * testsuite/ld-elf/pr23161d.rd: Remove local _edata, __bss_start, and _end from dynamic symbol table.