aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2018-02-15RISC-V: Give error for ignored pcrel_lo addend.Jim Wilson4-0/+29
bfd/ * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous when pcrel_lo reloc has an addend. Use reloc_dangerous callback for bfd_reloc_dangerous. Use einfo instead of warning callback for errors. Add %X%P to error messages. ld/ * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run pcrel-lo-addend test. * testsuite/ld-riscv-elf/pcrel-lo-addend.d: New. * testsuite/ld-riscv-elf/pcrel-lo-addend.s: New.
2018-02-14x86-64: Use PLT address for PC-relative relocH.J. Lu9-0/+162
Since PLT in PDE and PC-relative PLT in PIE can be used as function address, there is no need for dynamic PC-relative relocation against a dynamic function definition in PIE. Linker should resolve PC-relative reference to its PLT address. NB: i386 has non-PIC PLT and PIC PLT. Only non-PIC PLT in PDE can be used as function address. PIC PLT in PIE can't be used as function address. bfd/ PR ld/22842 * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non PC-relative PLT to NEED_DYNAMIC_RELOCATION_P. * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for R_X86_64_PC32 reloc against dynamic function in data section. Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P. (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc against dynamic function in data section. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as function address only if pcrel_plt is true. (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt. * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for PC-relative PLT. If PLT is PC-relative, don't generate dynamic PC-relative relocation against a function definition in data secton in PIE. Remove the obsolete comments. (elf_x86_link_hash_table): Add pcrel_plt. ld/ PR ld/22842 * testsuite/ld-i386/i386.exp: Run PR ld/22842 tests. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr22842a.c: New file. * testsuite/ld-i386/pr22842b.S: Likewise. * testsuite/ld-x86-64/pr22842a.c: Likewise. * testsuite/ld-x86-64/pr22842a.rd: Likewise. * testsuite/ld-x86-64/pr22842b.S: Likewise. * testsuite/ld-x86-64/pr22842b.rd: Likewise.
2018-02-14LD: Remove a stale `ldlex_command' prototypeMaciej W. Rozycki2-1/+4
Complement commit d4e5e3c330d5 ("Use getopt instead of lex and yacc to parse the command line.") and remove a stale `ldlex_command' prototype for an inexistent function removed back in 1994. ld/ * ldlex.h (ldlex_command): Remove prototype.
2018-02-13x86-64: Use pr22393-3a.so and pr22393-3a-now.soH.J. Lu2-2/+7
They should be pr22393-3a.so and pr22393-3a-now.so, not pr22393-2a.so and pr22393-2a-now.so. Since ld-elf/shared.exp creates pr22393-2a.so and pr22393-2a-now.so, we won't notice the problem if x86-64.exp runs after ld-elf/shared.exp. * testsuite/ld-x86-64/x86-64.exp: Replace pr22393-2a.so and pr22393-2a-now.so with pr22393-3a.so and pr22393-3a-now.so.
2018-02-14PR22836 testcasesAlan Modra4-0/+25
PR 22836 * testsuite/ld-elf/pr22836-1.s: New file. * testsuite/ld-elf/pr22836-1a.d: Likewise. * testsuite/ld-elf/pr22836-1b.d: Likewise.
2018-02-13x86-64: Generate branch with PLT32 relocationH.J. Lu10-1/+106
Since there is no need to prepare for PLT branch on x86-64, generate R_X86_64_PLT32, instead of R_X86_64_PC32, if possible, which can be used as a marker for 32-bit PC-relative branches. To compile Linux kernel, this patch: From: "H.J. Lu" <hjl.tools@gmail.com> Subject: [PATCH] x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 On i386, there are 2 types of PLTs, PIC and non-PIC. PIE and shared objects must use PIC PLT. To use PIC PLT, you need to load _GLOBAL_OFFSET_TABLE_ into EBX first. There is no need for that on x86-64 since x86-64 uses PC-relative PLT. On x86-64, for 32-bit PC-relative branches, we can generate PLT32 relocation, instead of PC32 relocation, which can also be used as a marker for 32-bit PC-relative branches. Linker can always reduce PLT32 relocation to PC32 if function is defined locally. Local functions should use PC32 relocation. As far as Linux kernel is concerned, R_X86_64_PLT32 can be treated the same as R_X86_64_PC32 since Linux kernel doesn't use PLT. is needed. It is available on hjl/plt32/master branch at https://github.com/hjl-tools/linux bfd/ PR gas/22791 * elf64-x86-64.c (is_32bit_relative_branch): Removed. (elf_x86_64_relocate_section): Check PIC relocations in PIE. Remove is_32bit_relative_branch usage. Disallow PC32 reloc against protected function in shared object. gas/ PR gas/22791 * config/tc-i386.c (need_plt32_p): New function. (output_jump): Generate BFD_RELOC_X86_64_PLT32 if possible. (md_estimate_size_before_relax): Likewise. * testsuite/gas/i386/reloc64.d: Updated. * testsuite/gas/i386/x86-64-jump.d: Likewise. * testsuite/gas/i386/x86-64-mpx-branch-1.d: Likewise. * testsuite/gas/i386/x86-64-mpx-branch-2.d: Likewise. * testsuite/gas/i386/x86-64-relax-2.d: Likewise. * testsuite/gas/i386/x86-64-relax-3.d: Likewise. * testsuite/gas/i386/ilp32/reloc64.d: Likewise. * testsuite/gas/i386/ilp32/x86-64-branch.d: Likewise. ld/ PR gas/22791 * testsuite/ld-x86-64/mpx1c.rd: Updated. * testsuite/ld-x86-64/pr22791-1.err: New file. * testsuite/ld-x86-64/pr22791-1a.c: Likewise. * testsuite/ld-x86-64/pr22791-1b.s: Likewise. * testsuite/ld-x86-64/pr22791-2.rd: Likewise. * testsuite/ld-x86-64/pr22791-2a.s: Likewise. * testsuite/ld-x86-64/pr22791-2b.c: Likewise. * testsuite/ld-x86-64/pr22791-2c.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run PR ld/22791 tests.
2018-02-13PR22836, "-r -s" doesn't work with -g3 using GCC 7Alan Modra3-0/+20
This fixes the case where all of a group is removed with ld -r, the situation in the PR, and failures where part of a group is removed that contain relocs. bfd/ PR 22836 * elf.c (_bfd_elf_fixup_group_sections): Account for removed relocation sections. If size reduces to just the flag word, remove that too and mark with SEC_EXCLUDE. * elflink.c (bfd_elf_final_link): Strip empty group sections. binutils/ * testsuite/binutils-all/group-7.s, * testsuite/binutils-all/group-7a.d, * testsuite/binutils-all/group-7b.d, * testsuite/binutils-all/group-7c.d: New tests. * testsuite/binutils-all/objcopy.exp: Run them. ld/ * testsuite/ld-elf/pr22836-2.d, * testsuite/ld-elf/pr22836-2.s: New test.
2018-02-13PR22829, objcopy/strip removes PT_GNU_RELRO from lld binariesAlan Modra2-1/+5
lld lays out the relro segment differently to GNU ld, not bothering to include the first few bytes of .got.plt and padding out to a page at the end of the segment. This patch teaches binutils to recognize the different (and somewhat inferior) layout as valid. bfd/ PR 22829 * elf.c (assign_file_positions_for_non_load_sections): Rewrite PT_GNU_RELRO setup. ld/ * testsuite/ld-x86-64/pr14207.d: Adjust relro p_filesz.
2018-02-07Revert "PowerPC PLT speculative execution barriers"Alan Modra8-61/+27
This reverts most of commit 1be5d8d3bb. Left in place are addition of --no-plt-align to some ppc32 ld tests and the ld.texinfo --no-plt-thread-safe fix.
2018-02-06Fix PR ld/22263 on SPARC.Eric Botcazou6-21/+230
This is -fpie -pie generating dynamic relocations in the text section, simply because no TLS transitions are applied in PIE mode. The meat of the patch is to turn calls to bfd_link_pic (info) in TLS-related code into !bfd_link_executable (info) and there are quite a lot of them... bfd/ * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic into call to !bfd_link_executable and tidy up. (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up. <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to !bfd_link_executable. <R_SPARC_TLS_IE_HI22>: Likewise. <GOT relocations>: Remove useless code, tidy and merge blocks. <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to !bfd_link_executable. <R_SPARC_WPLT30>: Tidy up. (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to !bfd_link_executable. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up. <R_SPARC_TLS_GD_HI22>: Merge into... <R_SPARC_TLS_GD_LO10>: ...this. Adjust 4th argument in call to sparc_elf_tls_transition and remove redundant code. <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to !bfd_link_executable. <R_SPARC_TLS_LDO_HIX22>: Likewise. <R_SPARC_TLS_LE_HIX22>: Likewise. Tidy up. <R_SPARC_TLS_LDM_CALL>: Likewise. <R_SPARC_TLS_GD_CALL>: Likewise. Tidy up. <R_SPARC_TLS_GD_ADD>: Likewise. <R_SPARC_TLS_LDM_ADD>: Likewise. <R_SPARC_TLS_LDO_ADD>: Likewise. <R_SPARC_TLS_IE_LD>: Likewise. ld/ * testsuite/ld-elf/tls.exp (AFLAGS_PIC): Define on SPARC. (pr22263-1): Pass AFLAGS_PIC to the assembler. * testsuite/ld-sparc/tlspie32.s: Add test for other 3 transitions. * testsuite/ld-sparc/tlspie32.dd: Adjust to above. * testsuite/ld-sparc/tlspie64.s: Add test for other 3 transitions. * testsuite/ld-sparc/tlspie64.dd: Adjust to above.
2018-02-05[PR22764][LD][AARCH64]Allow R_AARCH64_ABS16 and R_AARCH64_ABS32 against ↵Renlin Li6-2/+37
absolution symbol or undefine symbol in shared object. The assumption that R_AARCH64_ABS16 and R_AARCH64_ABS32 relocation in LP64 abi will be used to generate an address does not hold for absolute symbol. In this case, it is a value fixed at static linking time. The condition to check the relocations is relax to allow absolute symbol and undefined symbol case. bfd/ 2018-02-05 Renlin Li <renlin.li@arm.com> PR ld/22764 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the check for writeable section as well. ld/ 2018-02-05 Renlin Li <renlin.li@arm.com> PR ld/22764 * testsuite/ld-aarch64/emit-relocs-258.s: Define symbol as an address. * testsuite/ld-aarch64/emit-relocs-259.s: Likewise. * testsuite/ld-aarch64/aarch64-elf.exp: Run new test. * testsuite/ld-aarch64/pr22764.s: New. * testsuite/ld-aarch64/pr22764.d: New.
2018-02-05x86: Remove the unused _GLOBAL_OFFSET_TABLE_H.J. Lu16-238/+323
Since _GLOBAL_OFFSET_TABLE_ may be referenced implicitly on x86, checking ref_regular_nonweak leaves the unused _GLOBAL_OFFSET_TABLE_ in output. This patch checks explicit GOT references instead. ld-i386/discarded1.s and ld-x86-64/discarded1.s are updated to avoid linker optimization which removes GOT references. bfd/ PR ld/22782 * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve undefined weak symbol to 0. * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced if _GLOBAL_OFFSET_TABLE_ is referenced. * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check got_referenced instead of ref_regular_nonweak. Remove the unused _GLOBAL_OFFSET_TABLE_ from symbol table. * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced. ld/ PR ld/22782 * testsuite/ld-i386/discarded1.s: Replace mov with div. * testsuite/ld-x86-64/discarded1.s: Likewise. * testsuite/ld-i386/i386.exp: Run pr22782. * testsuite/ld-i386/load1-nacl.d: Updated for removing _GLOBAL_OFFSET_TABLE_ from output. * testsuite/ld-i386/load1.d: Likewise. * testsuite/ld-x86-64/load1a-nacl.d: Likewise. * testsuite/ld-x86-64/load1a.d: Likewise. * testsuite/ld-x86-64/load1b-nacl.d: Likewise. * testsuite/ld-x86-64/load1b.d: Likewise. * testsuite/ld-i386/pr22782.d: New file. * testsuite/ld-i386/pr22782.s: Likewise. * testsuite/ld-x86-64/pr22782.s: Likewise. * testsuite/ld-x86-64/pr22782a.d: Likewise. * testsuite/ld-x86-64/pr22782b.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr22782a and pr22782b.
2018-02-05Updated Brazillian portuguese and Russian translationNick Clifton2-3/+7
2018-02-04ld/testsuite: Replace -Sw with -SW for readelfH.J. Lu10-9/+21
-Sw is a typo. It should be -SW for readelf. * testsuite/ld-i386/lea1d.d: Replace -Sw with -SW. * testsuite/ld-i386/lea1e.d: Likewise. * testsuite/ld-i386/lea1f.d: Likewise. * testsuite/ld-x86-64/lea1g.d: Likewise. * testsuite/ld-x86-64/lea1h.d: Likewise. * testsuite/ld-x86-64/lea1i.d: Likewise. * testsuite/ld-x86-64/lea1j.d: Likewise. * testsuite/ld-x86-64/lea1k.d: Likewise. * testsuite/ld-x86-64/lea1l.d: Likewise.
2018-02-03Remove PROVIDE() qualifiers from definition of __CTOR_LIST__ and ↵Nick Clifton4-8/+56
__DTOR_LIST__ symbols in PE linker scripts. PR 22762 * scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and __DTOR_LIST__ symbols. Add a comment explaining why this is necessary. * scripttemp/pep.sc: Likewise. * ld.texinfo (PROVIDE): Add a note about the effect of common symbols.
2018-02-02Disable -shared support in nios2-elf-ld.Sandra Loosemore2-1/+4
2018-02-03 Sandra Loosemore <sandra@codesourcery.com> * emulparams/nios2elf.sh (GENERATE_SHLIB_SCRIPT): Don't set.
2018-02-02LD/testsuite: Pass $AFLAGS_PIC to GAS for PIC assemblyMaciej W. Rozycki2-55/+59
Add $AFLAGS_PIC flags for PIC assembly to a number of tests missing them and remove `tic6x-*-*' XFAIL annotations from them, previously added to paper over: .../ld-new: warning: generating a shared library containing non-PID code error messages produced due to `-mpic -mpid=near' GAS options having not been used. Such errors now do not happen anymore, removing: XFAIL: Build shared library for pr14170 XFAIL: PR ld/21703 shared XFAIL: Build shared library for broken linker script test XFAIL: Build pr17068.so XFAIL: -Bsymbolic-functions XFAIL: Build pr20995.so XFAIL: Build pr22374 shared library with `tic6x-elf' and `tic6x-uclinux' targets. These tests now pass all except for: FAIL: PR ld/21703 shared which is now due to a different reason, as follows: extra regexps in .../ld/testsuite/ld-elf/pr21703-shared.sd starting with "^Symbol table '\.dynsym' contains [0-9]+ entries:$" EOF from dump.out FAIL: PR ld/21703 shared The addition of $AFLAGS_PIC requires the affected test cases to use the `list' command rather than `{}' characters to create a list, to avoid the quoting property `{}' also have in TCL. Consequently the change is slightly more extensive than it could otherwise be. ld/ * testsuite/ld-elf/shared.exp: Add $AFLAGS_PIC throughout to PIC assembly builds where missing and remove `tic6x-*-*' XFAIL markings accordingly.
2018-02-01Fix compile time warnings building the binutils with clang.Simon Marchi2-2/+7
bfdI would like to fix instances of the following warning, when building with clang with no special CFLAGS other than -g3 -O0. /home/emaisin/src/binutils-gdb/bfd/elflink.c:5425:45: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] return (struct elf_link_hash_entry *) 0 - 1; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ Replacing those with "(struct elf_link_hash_entry *) -1" gets rid of the warning. I wanted to check that it didn't change the resulting code, so I tried to build this: $ cat test.c int *before() { return (int *) 0 - 1; } int *after() { return (int *) - 1; } $ gcc -c test.c -g $ objdump -d test.o test.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <before>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 48 c7 c0 fc ff ff ff mov $0xfffffffffffffffc,%rax b: 5d pop %rbp c: c3 retq 000000000000000d <after>: d: 55 push %rbp e: 48 89 e5 mov %rsp,%rbp 11: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax 18: 5d pop %rbp 19: c3 retq This shows that the previous code doesn't actually return -1 as the function documentation says, but the new one does, so it's kind of a bugfix. bfd * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer arithmetic on NULL pointer. * elflink.c (_bfd_elf_archive_symbol_lookup, elf_link_add_archive_symbols): Likewise. ld * ldexp.c (fold_name, exp_fold_tree_1): Avoid pointer arithmetic on NULL pointer.
2018-01-31Fix testsuite/ld-elf/pr21964-5.cH.J. Lu2-1/+5
Mark my_var as used. Otherwise it fails at -O2. * testsuite/ld-elf/pr21964-5.c (my_var): Mark as used.
2018-01-31LD/testsuite: Fix a typo s/scrip/script/ in `note-3.so' build test nameMaciej W. Rozycki2-1/+5
ld/ * testsuite/ld-elf/shared.exp: Fix a typo s/scrip/script/.
2018-01-31MIPS/LD/testsuite: Correct dynamic links with VR4100, VR4300 and VR5000Maciej W. Rozycki6-11/+51
Correct LD test suite failures with VR4100, VR4300 and VR5000 bare metal MIPS/ELF targets which do not default to linking with shared libraries, which leads to link failures like: .../ld/ld-new: cannot find -lcomm-data FAIL: Common symbol override test or: .../ld/ld-new: attempted static link of dynamic object `tmpdir/pr14170.so' FAIL: PR ld/14170 removing: FAIL: Build pr22471b.so FAIL: Build pr22471 FAIL: Build pr22649-2b.so FAIL: Build pr22649-2d.so FAIL: Build pr22150 FAIL: PR ld/14170 FAIL: --gc-sections with __gxx_personality test failures. ld/ * testsuite/ld-elf/comm-data.exp: Pass `-call_shared' to links involving a shared library for `mips*vr4100*-*-elf*', `mips*vr4300*-*-elf*' and `mips*vr5000*-*-elf*' targets. * testsuite/ld-elf/provide-hidden.exp: Likewise. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-mips-elf/comm-data.exp: Likewise.
2018-01-31LD/testsuite: Move ELF shared library tests from elf.exp to shared.expMaciej W. Rozycki3-155/+162
Move those ELF shared library tests that are in ld-elf/elf.exp over to ld-elf/shared.exp, to keep them all together and make the maintenance of extra flags needed with some targets and shared library builds easier, and also removing the need for the large: if { [check_shared_lib_support] } then { [...] } conditional block and consequently reducing indentation, which always helps with TCL code. No functional change, except for the order of individual test case execution which has changed accordingly, i.e. the test results are shuffled. ld/ * testsuite/ld-elf/elf.exp: Move shared library tests over to... * testsuite/ld-elf/shared.exp: ... here.
2018-01-31bfd_elf_define_start_stop: Fix checkMichael Matz3-0/+34
We really need to check for a dynamic def, not only a ref. See added testcase. bfd/ * elflink.c (bfd_elf_define_start_stop): Fix check of def_dynamic. ld/ * testsuite/ld-elf/pr21964-5.c: New test. * testsuite/ld-elf/shared.exp: Run it.
2018-01-31Check if __start/__stop symbols are referenced by shared objectsH.J. Lu3-0/+40
Define __start/__stop symbols if they are referenced by shared objects, not if they are also defined in shared objects. bfd/ PR ld/21964 * elflink.c (bfd_elf_define_start_stop): Check if __start and __stop symbols are referenced by shared objects. ld/ PR ld/21964 * testsuite/ld-elf/pr21964-4.c: New file. * testsuite/ld-elf/shared.exp: Run pr21964-4 test on Linux.
2018-01-30Add --gc-sections test checking removal of __start/__stop symbols.Alan Modra4-0/+25
Well, just __stop__foo but that should be good enough. * testsuite/ld-gc/stop.d, * testsuite/ld-gc/stop.s: New test. * testsuite/ld-gc/gc.exp: Run it.
2018-01-30MIPS/LD/testsuite: Correct PR ld/22649 test case failuresMaciej W. Rozycki4-4/+27
Fix commit d664fd41e15f ("Ignore dynamic references on forced local symbols") and use alternative test actions and match patterns to correctly handle messages like: .../ld/ld-new: Removing unused section '.reginfo' in file 'tmpdir/pr22649-2b.o' or: .../ld/ld-new: Removing unused section '.MIPS.options' in file 'tmpdir/pr22649-2b.o' produced by LD on MIPS targets, removing: FAIL: Build pr22649-2c.so FAIL: Build pr22649-2d.so test suite failures and tightening checks made with `pr22649-2a.so' and `pr22649-2b.so' test cases. Keep the original empty action with `pr22649-2c.so' and `pr22649-2d.so' links and MIPS/ELF targets though, because for them the linker does not garbage-collect the `.reginfo' section. This is because the section has its flags set differently by code in GAS in `md_begin': if (strncmp (TARGET_OS, "elf", 3) != 0) flags |= SEC_ALLOC | SEC_LOAD; and consequently BFD linker code in `_bfd_elf_gc_mark_extra_sections': else if (((isec->flags & SEC_DEBUGGING) != 0 || (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0) && elf_next_in_group (isec) == NULL) isec->gc_mark = 1; marks these sections to be kept due to their SEC_ALLOC, SEC_LOAD and SEC_RELOC flags all being zero (`.reginfo' sections never have relocations attached). ld/ PR ld/22649 * testsuite/ld-elf/pr22649-2ab-mips.msg: New stderr output. * testsuite/ld-elf/pr22649-2cd-mips.msg: New stderr output. * testsuite/ld-elf/shared.exp: Use the new outputs with `mips*-*-*' targets.
2018-01-30MIPS/LD/testsuite: Adjust match patterns for special section indexesMaciej W. Rozycki3-4/+10
Update `readelf' symbol table dump match patterns to handle SHN_MIPS_DATA and SHN_MIPS_TEXT special section indexes produced by the IRIX ELF format variation used with a number of MIPS targets and printed by `readelf' as PRC[0xff02] and PRC[0xff01] respectively, correcting LD test suite failures: extra regexps in .../ld/testsuite/ld-elf/comm-data1.sd starting with "^ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo$" EOF from dump.out FAIL: Common symbol override test (auxiliary shared object build) extra regexps in .../ld/testsuite/ld-elf/pr21703-shared.sd starting with "^ +[0-9]+: +[0-9a-f]+ +4 +FUNC +GLOBAL +DEFAULT +[0-9] +foo@FOO$" EOF from dump.out FAIL: PR ld/21703 shared extra regexps in .../ld/testsuite/ld-elf/comm-data1.sd starting with "^ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo$" EOF from dump.out FAIL: MIPS o32/copyreloc common symbol override test (auxiliary shared object build) extra regexps in .../ld/testsuite/ld-elf/comm-data1.sd starting with "^ +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo$" EOF from dump.out FAIL: MIPS o32/nocopyreloc common symbol override test (auxiliary shared object build) observed due to file contents like: 7: 5ffe02e8 0 OBJECT GLOBAL DEFAULT PRC[0xff02] foo shown by `readelf -s' vs: +[0-9]+: +[0-9a-f]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +foo pattern expected, triggered by widening testing to these targets by commit 05a5feafdd38 ("Rewrite check_shared_lib_support"). ld/ * testsuite/ld-elf/comm-data1.sd: Alternatively accept `PRC[0xff02]' in place of a regular section index. * testsuite/ld-elf/pr21703-shared.sd: Likewise `PRC[0xff01]'.
2018-01-30Make __start/__stop symbols dynamic and add testcaseAlan Modra4-0/+40
bfd/ * elflink.c (bfd_elf_define_start_stop): Make __start and __stop symbols dynamic. ld/ * testsuite/ld-elf/pr21964-3a.c: New file. * testsuite/ld-elf/pr21964-3c.c: New file. * testsuite/ld-elf/shared.exp: Run new __start/__stop testcase.
2018-01-30 Adjust test for PR ld/22269.Eric Botcazou2-1/+10
On the SPARC architecture, you need to pass a special flag to GNU as when you're assembling PIC/PIE code or else you get a wrong relocation for the GOT symbol. ld/ * testsuite/ld-elf/shared.exp (AFLAGS_PIC): Define on SPARC. (pr22269-1): Pass AFLAGS_PIC to the assembler.
2018-01-30Fix PR gas/22738 (.dc.a directive has wrong size on SPARC 64-bit).Eric Botcazou2-1/+5
The .dc.a directive has wrong size (32 bits) on SPARC 64-bit because the assembler sets the correct BFD architecture only at the very end of the processing and it's too late for the directive. It's fixed by defining TARGET_MACH and making it return a sensible default value. gas/ * config/tc-sparc.h (sparc_mach): Declare. (TARGET_MACH): Define to above. * config/tc-sparc.c (sparc_mach): New function. (sparc_md_end): Minor tweak. ld/ * testsuite/ld-elf/pr22450.d: Remove reference to SPARC64.
2018-01-29MIPS/LD/testsuite: Correct comm-data.exp test ABI/emul/endian arrangementMaciej W. Rozycki2-2/+89
Update the ld-mips-elf/comm-data.exp test script to correctly select emulations for targets using non-traditional MIPS emulation and also correctly select ABIs for targets that do not support all of them, and finally use the default endianness selection to benefit targets which support only one, complementing commit 05a5feafdd38 ("Rewrite check_shared_lib_support") and removing numerous test failures such as: FAIL: MIPS o32/copyreloc common symbol override test (auxiliary shared object build) FAIL: MIPS o32/copyreloc common symbol override test FAIL: MIPS o32/nocopyreloc common symbol override test (auxiliary shared objectbuild) FAIL: MIPS o32/nocopyreloc common symbol override test FAIL: MIPS n32/copyreloc common symbol override test (auxiliary shared object build) FAIL: MIPS n32/copyreloc common symbol override test FAIL: MIPS n32/nocopyreloc common symbol override test (auxiliary shared objectbuild) FAIL: MIPS n32/nocopyreloc common symbol override test due to: .../ld/ld-new: unrecognised emulation mode: elf32btsmip Supported emulations: elf64btsmip elf64ltsmip or: .../ld/ld-new: unrecognised emulation mode: elf32btsmip Supported emulations: elf32ebmip or: .../ld/ld-new: unrecognised emulation mode: elf32btsmip Supported emulations: elf32l4300 etc., and: ERROR: -n32 -march=mips3 -EB -call_shared .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data1.s: assembly failed UNRESOLVED: MIPS n32/copyreloc common symbol override test (auxiliary shared object build) ERROR: -n32 -march=mips3 -EB -call_nonpic .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data2.s: assembly failed UNRESOLVED: MIPS n32/copyreloc common symbol override test ERROR: -n32 -march=mips3 -EB -call_shared .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data1.s: assembly failed UNRESOLVED: MIPS n32/nocopyreloc common symbol override test (auxiliary shared object build) ERROR: -n32 -march=mips3 -EB -call_nonpic .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data2.s: assembly failed UNRESOLVED: MIPS n32/nocopyreloc common symbol override test due to: Assembler messages: Fatal error: selected target format 'elf32-nbigmips' unknown and: ERROR: -64 -march=mips3 -EB -call_shared .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data1.s: assembly failed UNRESOLVED: MIPS n64/copyreloc common symbol override test (auxiliary shared object build) ERROR: -64 -march=mips3 -EB --defsym ELF64=1 -call_nonpic .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data2.s:assembly failed UNRESOLVED: MIPS n64/copyreloc common symbol override test ERROR: -64 -march=mips3 -EB -call_shared .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data1.s: assembly failed UNRESOLVED: MIPS n64/nocopyreloc common symbol override test (auxiliary shared object build) ERROR: -64 -march=mips3 -EB --defsym ELF64=1 -call_nonpic .../ld/testsuite/ld-mips-elf/../ld-elf/comm-data2.s:assembly failed UNRESOLVED: MIPS n64/nocopyreloc common symbol override test due to: Assembler messages: Fatal error: no compiled in support for 64 bit object file format ld/ * testsuite/ld-mips-elf/comm-data.exp: Correct support for targets using non-traditional MIPS emulation or having a limited selection of ABIs available. Don't force big endianness, use defaults.
2018-01-29ld: Skip unsupported static executable testsH.J. Lu5-12/+87
Skip static executable tests if static executable is unsupported. Tested on Linux/x86 without libc.a. PR ld/22732 * testsuite/config/default.exp (STATIC_LDFLAGS): New. Set to "-static" if target compiler supports it. * testsuite/ld-bootstrap/bootstrap.exp: Skip static executable tests if target compiler doesn't support it. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Likewise. (run_cc_link_tests): Likewise.
2018-01-27Add a testcase for PR ld/22751H.J. Lu5-2/+77
Since dummy.o must be placed before -Wl,--whole-archive tmpdir/pr22751.a -Wl,--no-whole-archive to trigger the bug, this patch adds an optional trailing ld options to run_ld_link_exec_tests. PR ld/22751 * testsuite/config/default.exp (INT128_CFLAGS): New. * testsuite/ld-plugin/lto.exp (INT128_CFLAGS): New. Run ld/22751 tests. * testsuite/ld-plugin/pr22751.c: New file. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Add ld trailing options.
2018-01-28PR22751, LTO broken for libgcc libcallsAlan Modra2-1/+8
So what was happening was that the file added from libgcc.a during the rescan was not put on file_chain. map_input_to_output_sections then doesn't see the file and its sections are treated as discarded. The file_chain list pointer bug was caused by that fact that an archive element claimed by the plugin does not have my_archive set. Or more correctly, the actual archive element does have my_archive set, but this bfd is replaced with a dummy bfd that doesn't have my_archive set. PR 22751 * ldlang.c (find_rescan_insertion): Look past bfds with claim_archive set.
2018-01-26MIPS/LD: Correct `mips-*-windiss' target emulation configurationMaciej W. Rozycki2-0/+6
Fix an issue with commit 73934d319dae ("Disable .gnu.hash on MIPS targets"), <https://sourceware.org/ml/binutils/2006-07/msg00341.html>, which in turn caused a regression with commit 861fb55ab50a ("Defer allocation of R_MIPS_REL32 GOT slots"), <https://sourceware.org/ml/binutils/2008-08/msg00096.html>, and use `mipself.em' as the extra emulation file for `mips-*-windiss' targets, removing a segmentation fault triggered as `_bfd_mips_elf_final_link' calls `htab_traverse' to process LA25 stubs with `htab->la25_stubs' being NULL. This is in turn due to `_bfd_mips_elf_init_stubs' not having been called, which is only done by `mipself.em'. No LA25 stubs are supposed to be produced for `mips-*-windiss' targets, however the internal data structures have to be initialized. ld/ * emulparams/elf32mipswindiss.sh (EXTRA_EM_FILE): Set to `mipself'.
2018-01-25Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC).Eric Botcazou13-122/+238
There are actually 2 different bugs: 1. TLS transition is broken in PIE mode. 2. TLS is broken in PIC/PIE mode when the __tls_get_addr symbol is versioned (as is the case on Linux and Solaris at least). The 1st bug is fixed by reverting the problematic change for now (note that the associated test doesn't pass on SPARC because of another issue so there is no formal regression in the testsuite). The 2nd bug is fixed by changing the call to _bfd_generic_link_add_one_symbol on __tls_get_addr into a mere lookup in _bfd_sparc_elf_check_relocs. bfd/ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>: Do a mere lookup of the __tls_get_addr symbol instead of adding it. Revert 2017-10-19 H.J. Lu <hongjiu.lu@intel.com> PR ld/22263 * elfxx-sparc.c (sparc_elf_tls_transition): Replace bfd_link_pic with !bfd_link_executable, !bfd_link_pic with bfd_link_executable for TLS check. (_bfd_sparc_elf_check_relocs): Likewise. (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * testsuite/ld-sparc/sparc.exp (32-bit: Helper shared library): Link with a version script. (32-bit: TLS -fpie): New test. (64-bit: Helper shared library): Link with a version script. (64-bit: TLS -fpie): New test. (64-bit: GOTDATA relocations): Pass -Av9 to the assembler. * testsuite/ld-sparc/tlslib.ver: New file. * testsuite/ld-sparc/tlspie32.dd: Likewise. * testsuite/ld-sparc/tlspie32.s: Likewise. * testsuite/ld-sparc/tlspie64.dd: Likewise. * testsuite/ld-sparc/tlspie64.s: Likewise. * testsuite/ld-sparc/tlssunbin32.dd: Adjust for versioned symbol. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.sd: Likewise. * testsuite/ld-sparc/tlssunbin64.dd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.sd: Likewise.
2018-01-24[LD][AARCH64]Add group relocations to create PC-relative offset.Renlin Li22-16/+161
This is a patch to add linker support for group relocations to create a 16, 32, 48, or 64 bit PC-relative offset inline. The following relocations are added along with the test cases: BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3. bfd/ 2018-01-24 Renlin Li <renlin.li@arm.com> * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3. * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. (_bfd_aarch64_elf_resolve_relocation): Likewise. ld/ 2018-01-24 Renlin Li <renlin.li@arm.com> * testsuite/ld-aarch64/aarch64-elf.exp: Run new testes. * testsuite/ld-aarch64/emit-relocs-287.s: Fix test case. * testsuite/ld-aarch64/emit-relocs-287.d: Fix expected output. * testsuite/ld-aarch64/emit-relocs-287-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-287-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-288.d: New. * testsuite/ld-aarch64/emit-relocs-288.s: New. * testsuite/ld-aarch64/emit-relocs-289.d: New. * testsuite/ld-aarch64/emit-relocs-289.s: New. * testsuite/ld-aarch64/emit-relocs-289-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-289-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-290.d: New. * testsuite/ld-aarch64/emit-relocs-290.s: New. * testsuite/ld-aarch64/emit-relocs-291.d: New. * testsuite/ld-aarch64/emit-relocs-291.s: New. * testsuite/ld-aarch64/emit-relocs-291-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-291-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-292.d: New. * testsuite/ld-aarch64/emit-relocs-292.s: New. * testsuite/ld-aarch64/emit-relocs-293.d: New. * testsuite/ld-aarch64/emit-relocs-293.s: New.
2018-01-20x86: Check the versioned __tls_get_addr symbolH.J. Lu5-0/+56
We need to check the versioned __tls_get_addr symbol when looking up "__tls_get_addr". bfd/ PR ld/22721 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the versioned __tls_get_addr symbol. ld/ PR ld/22721 * testsuite/ld-plugin/lto.exp: Run PR ld/22721 tests. * testsuite/ld-plugin/pr22721.t: New file. * testsuite/ld-plugin/pr22721a.s: Likewise. * testsuite/ld-plugin/pr22721b.c: Likewise.
2018-01-18Also xfail ld-elf/group1.d for SolarisH.J. Lu2-1/+5
Also xfail ld-elf/group1.d for Solaris since _GLOBAL_OFFSET_TABLE_ is always generated for Solaris as a global symbol after .*: 0+1000 +0 +(NOTYPE|OBJECT) +WEAK +DEFAULT +. foo instead of appending "#..." which will weaken the test. * testsuite/ld-elf/group1.d: Also xfail Solaris.
2018-01-18x86: Update ld-elf/linkinfo1[ab].d for Solaris/x86H.J. Lu3-4/+10
Update ld-elf/linkinfo1[ab].d to accommodate slightly different PLT/GOT order/layout for Solaris/x86 targets. * testsuite/ld-elf/linkinfo1a.d: Updated for slightly different PLT/GOT order/layout for Solaris/x86 targets. * testsuite/ld-elf/linkinfo1b.d: Likewise.
2018-01-18solaris2.em: Fold after_allocation into before_allocationH.J. Lu2-41/+35
Since all ELF linkers call check_relocs after opening all inputs, we can fold after_allocation into before_allocation so that local dynamic symbols will be placed before global dynamic symbols in .dynsym section. This fixed: FAIL: Common symbol override test (auxiliary shared object build) FAIL: ld-elf/pr19617a FAIL: ld-elf/pr19698 for i386-solaris2.12 and x86_64-solaris2.12 targets. PR ld/22728 * emultempl/solaris2.em (elf_solaris2_after_allocation): Fold into ... (elf_solaris2_before_allocation): This. (LDEMUL_AFTER_ALLOCATION): Removed.
2018-01-18PowerPC PLT stub alignment fixesAlan Modra3-4/+18
Asking for ppc32 plt call stubs to be aligned at 32 byte boundaries didn't quite work. For ld.bfd they were spaced 32 bytes apart, but only started on a 16 byte boundary. ld.gold also didn't get it right. Finding that bug made me check over the ppc64 plt stub alignment, where I found that negative values for alignment (meaning align to minimize boundary crossing) were not accepted. Since no one has complained about that, I guess I could have removed the feature from ld.bfd documentation, but I've opted instead to correct the code. I've also added an optional alignment paramenter for ppc32 --plt-align, for some consistency with gold and ppc64 ld.bfd. bfd/ * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink. * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align. (ppc64_elf_build_stubs): Likewise. gold/ * powerpc.cc (param_plt_align): New function supplying default --plt-align values. Use it.. (Stub_table::plt_call_align): ..here, and.. (Output_data_glink::global_entry_align): ..here. (Stub_table::stub_align): Correct 32-bit minimum alignment. ld/ * emultempl/ppc32elf.em: Support optional --plt-align arg. * emultempl/ppc64elf.em: Support negative --plt-align arg.
2018-01-17PowerPC PLT speculative execution barriersAlan Modra8-17/+84
Spectre variant 2 mitigation for PowerPC and PowerPC64. bfd/ * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier. (CRSETEQ, BEQCTRM): Define. (is_nonpic_glink_stub): Don't check bctr. (ppc_elf_link_hash_table_create): Init new ppc_elf_params field. (ppc_elf_relax_section): Size speculation barrier. (output_bctr): New function. (write_glink_stub): Use output_bctr. (ppc_elf_relocate_section): Use output_bctr for long branch stub. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_finish_dynamic_sections): Use output_bctr. * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps. * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define. (GLINK_PLTRESOLVE_SIZE): Size speculation barrier. (size_global_entry_stubs): Handle speculation barrier sizing. (plt_stub_size): Likewise. (output_bctr): New function. (build_plt_stub, build_tls_get_addr_stub): Output speculation barrier. (ppc_build_one_stub): Likewise for ppc_stub_plt_branch. (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch. (build_global_entry_stubs): Output speculation barrier. (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub. * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps. gold/ * options.h (speculate_indirect_jumps): New option. * powerpc.cc (beqctrm, beqctrlm, crseteq): New insn constants. (output_bctr): New function. (Stub_table::plt_call_size): Add space for speculation barrier. (Stub_table::branch_stub_size): Likewise. (Output_data_glink::pltresolve_size): Likewise. (Stub_table::do_write): Output speculation barriers. ld/ * emultempl/ppc32elf.em (params): Init new field. (OPTION_SPECULATE_INDIRECT_JUMPS): Define. (OPTION_NO_SPECULATE_INDIRECT_JUMPS): Define. (PARSE_AND_LIST_LONGOPTS): Handle new options. (PARSE_AND_LIST_ARGS_CASES): Likewise. (PARSE_AND_LIST_OPTIONS): Likewise. * emultempl/ppc64elf.em (params): Init new field. (OPTION_SPECULATE_INDIRECT_JUMPS): Define. (OPTION_NO_SPECULATE_INDIRECT_JUMPS): Define. (PARSE_AND_LIST_LONGOPTS): Handle --speculate-indirect-jumps. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Likewise. * ld.texinfo (--no-plt-thread-safe): Correct itemx. (--speculate-indirect-jumps): Document. * testsuite/ld-powerpc/elfv2exe.d, * testsuite/ld-powerpc/elfv2so.d, * testsuite/ld-powerpc/relbrlt.d, * testsuite/ld-powerpc/powerpc.exp: Disable plt alignment and speculation barriers on various tests.
2018-01-17PowerPC PLT stub tidyAlan Modra17-96/+141
This is in preparation for the next patch adding Spectre variant 2 mitigation for PowerPC and PowerPC64. Besides tidying code involved in stub output (to reduce the number of places where bctr is output), the patch adds some user visible features: 1) PowerPC64 ELFv2 global entry stubs now are aligned under the control of --plt-align, with a default alignment of 32 bytes. 2) PowerPC64 __glink_PLTresolve is no longer padded out with nops. 3) PowerPC32 PLT stubs are aligned under the control of --plt-align, with the default alignment being 16 bytes as before. 4) The PowerPC32 branch/nop table emitted before __glink_PLTresolve is now smaller in many cases. It was sized incorrectly when the __tls_get_addr_opt stub was used, and unnecessarily included space for local ifuncs. bfd/ * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle __tls_get_addr_opt, and alignment sizing. (TLS_GET_ADDR_GLINK_SIZE): Delete. (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE. (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6, or 8 insns. (ppc_elf_link_hash_table_create): Init new ppc_elf_params field. (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE. (ppc_elf_size_dynamic_sections): Likewise. Size branch table by PLT reloc count. (write_glink_stub): Handle __tls_get_addr_opt stub. Pad out to size given by GLINK_ENTRY_SIZE. (ppc_elf_relocate_section): Adjust write_glink_stub call. (ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_finish_dynamic_sections): Write PLTresolve without using insn array since so many need rewriting. * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align. * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from GLINK_CALL_STUB_SIZE. Add htab param and evaluate to size without nops. Adjust all uses. (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE in glink_vma calculation. (struct ppc_link_hash_table): Add global_entry section pointer. (create_linkage_sections): Create separate section for global entry stubs. (PPC_LO, PPC_HI, PPC_HA): Move earlier. (size_global_entry_stubs): Handle sizing for aligned stubs. (ppc64_elf_size_dynamic_sections): Handle global_entry alloc, and don't stash end of glink branch table in rawsize. (ppc_build_one_stub): Rewrite stub size calculations. (build_global_entry_stubs): Use new section. (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops. Build lazy link stubs out to end of section. Build global entry stubs in new section. gold/ * options.h (plt_align): Support for PowerPC32 too. * powerpc.cc (Stub_table::stub_align): Heed --plt-align for 32-bit. (Stub_table::plt_call_size, branch_stub_size): Tidy. (Stub_table::plt_call_align): Implement using stub_align. (Output_data_glink::global_entry_align): New function. (Output_data_glink::global_entry_off): New function. (Output_data_glink::global_entry_address): Use global_entry_off. (Output_data_glink::pltresolve_size): New function, replacing pltresolve_size_ constant. Update all uses. (Output_data_glink::add_global_entry): Align offset. (Output_data_glink::set_final_data_size): Use global_entry_align. (Stub_table::do_write): Don't pad __glink_PLTrelsolve with nops. Tidy stub output. Use global_entry_off. ld/ * emultempl/ppc32elf.em (params): Init new field. (enum ppc32_opt): New enum to define OPTION_* values. Add OPTION_PLT_ALIGN and OPTION_NO_PLT_ALIGN. (PARSE_AND_LIST_LONGOPTS): Handle new options. (PARSE_AND_LIST_ARGS_CASES): Likewise. (PARSE_AND_LIST_OPTIONS): Likewise. Break up help output. * emultempl/ppc64elf.em (ppc_add_stub_section): Init alignment correctly for negative --plt-stub-align. * testsuite/ld-powerpc/elfv2exe.d, * testsuite/ld-powerpc/elfv2so.d, * testsuite/ld-powerpc/relbrlt.d, * testsuite/ld-powerpc/relbrlt.s, * testsuite/ld-powerpc/tlsexe.d, * testsuite/ld-powerpc/tlsexe.r, * testsuite/ld-powerpc/tlsexe32.d, * testsuite/ld-powerpc/tlsexe32.g, * testsuite/ld-powerpc/tlsexe32.r, * testsuite/ld-powerpc/tlsexetoc.d, * testsuite/ld-powerpc/tlsexetoc.r, * testsuite/ld-powerpc/tlsopt5_32.d, * testsuite/ld-powerpc/tlsso.d, * testsuite/ld-powerpc/tlstocso.d: Update for changed stub order.
2018-01-16Update translations for various binutils components.Nick Clifton2-236/+334
ld * po/pt_BR.po: Updated Brazilian Portugese translation. opcodes * po/pt_BR.po: Updated Brazilian Portugese translation. * po/de.po: Updated German translation. gas * po/fr.po: Updated French translation. binutils* po/fr.po: Updated French translation.
2018-01-15Update Ukranian translations for bfd, binutils, gas, gold, ld and opcodesNick Clifton2-252/+352
2018-01-13Update pot filesNick Clifton2-228/+327
2018-01-13Bump version number to 2.30.51Nick Clifton2-10/+14
bfd/ * version.m4: Bump version to 2.30.51 * configure: Regenerate. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. gprof/ * configure: Regenerate. ld/ * configure: Regenerate. opcodes/ * configure: Regenerate.
2018-01-13Add note about 2.30 branch creation to changelogsNick Clifton1-0/+1
2018-01-13Add 2.30 markers to NEWS files.Nick Clifton2-0/+6
binutils/ * NEWS: Add marker for 2.30. gas/ * NEWS: Add marker for 2.30. ld/ * NEWS: Add marker for 2.30.