binutils-gdb/ld/ChangeLog

782 lines
27 KiB
Plaintext
Raw Normal View History

2018-02-19 Alan Modra <amodra@gmail.com>
* ldmisc.c (vfinfo) Handle %pI, %pR, %pS and %pT in place of
%I, %R, %S and %T.
* ldcref.c, * ldctor.c, * ldemul.c, * ldexp.c, * ldgram.y,
* ldlang.c, * ldlex.l, * ldmain.c, * ldmisc.c, * pe-dll.c,
* emultempl/sh64elf.em: Replace use of of %I, %R, %S and %T in
format strings passed to einfo and friends by %pI, %pR, %pS and %pT.
Use %pA and %pB in messages rather than %A and %B First step towards compiler verification of _bfd_error_handler arguments, and better verification of translated messages. bfd/ * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place of %A and %B. * aout-adobe.c: Update all messages using %A and %B. * aout-cris.c: Likewise. * aoutx.h: Likewise. * archive.c: Likewise. * binary.c: Likewise. * cache.c: Likewise. * coff-alpha.c: Likewise. * coff-arm.c: Likewise. * coff-i860.c: Likewise. * coff-mcore.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * coffswap.h: Likewise. * compress.c: Likewise. * cpu-arm.c: Likewise. * ecoff.c: Likewise. * elf-attrs.c: Likewise. * elf-eh-frame.c: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-properties.c: Likewise. * elf-s390-common.c: Likewise. * elf.c: Likewise. * elf32-arc.c: Likewise. * elf32-arm.c: Likewise. * elf32-avr.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-d10v.c: Likewise. * elf32-d30v.c: Likewise. * elf32-epiphany.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-gen.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-i960.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-mep.c: Likewise. * elf32-metag.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-moxie.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-or1k.c: Likewise. * elf32-pj.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sparc.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-v850.c: Likewise. * elf32-vax.c: Likewise. * elf32-visium.c: Likewise. * elf32-wasm32.c: Likewise. * elf32-xgate.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-gen.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfnn-riscv.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.c: Likewise. * hpux-core.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * mach-o.c: Likewise. * merge.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * peXXigen.c: Likewise. * peicode.h: Likewise. * reloc.c: Likewise. * rs6000-core.c: Likewise. * srec.c: Likewise. * stabs.c: Likewise. * vms-alpha.c: Likewise. * xcofflink.c: Likewise. ld/ * ldmisc.c (vfinfo): Handle %pA and %pB in place of %A and %B. * ldcref.c: Update all messages using %A and %B. * ldexp.c: Likewise. * ldlang.c: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * pe-dll.c: Likewise. * plugin.c: Likewise. * emultempl/beos.em: Likewise. * emultempl/cr16elf.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/xtensaelf.em: Likewise.
2018-02-19 05:51:40 +01:00
2018-02-19 Alan Modra <amodra@gmail.com>
* ldmisc.c (vfinfo): Handle %pA and %pB in place of %A and %B.
* ldcref.c: Update all messages using %A and %B.
* ldexp.c: Likewise.
* ldlang.c: Likewise.
* ldmain.c: Likewise.
* ldmisc.c: Likewise.
* pe-dll.c: Likewise.
* plugin.c: Likewise.
* emultempl/beos.em: Likewise.
* emultempl/cr16elf.em: Likewise.
* emultempl/elf32.em: Likewise.
* emultempl/m68kcoff.em: Likewise.
* emultempl/m68kelf.em: Likewise.
* emultempl/mmo.em: Likewise.
* emultempl/nds32elf.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/spuelf.em: Likewise.
* emultempl/sunos.em: Likewise.
* emultempl/xtensaelf.em: Likewise.
2018-02-19 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845
* testsuite/ld-elf/frame.exp: Skip if -shared isn't supported.
Add tests for "-z noseparate-code" and "-z separate-code".
Remove unsupported -shared check.
2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845
* testsuite/ld-elf/ehdr_start.d: Pass --build-id to ld.
2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845
* testsuite/ld-elf/binutils.exp (tls_opts): Add tests for
"-z noseparate-code" and "-z separate-code".
2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845
* ld-elf/eh4.d: Pass -z max-page-size=0x200000 -z noseparate-code
to ld.
x86-64: Add -z max-page-size=0x200000 -z noseparate-code to linker tests Add -z max-page-size=0x200000 -z noseparate-code since these tests check for exact addresses. * testsuite/ld-x86-64/bnd-branch-1-now.d: Add -z max-page-size=0x200000 -z noseparate-code. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2d.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3d.d: Likewise. * testsuite/ld-x86-64/load1a.d: Likewise. * testsuite/ld-x86-64/load1b.d: Likewise. * testsuite/ld-x86-64/load1c.d: Likewise. * testsuite/ld-x86-64/load1d.d: Likewise. * testsuite/ld-x86-64/pie3.d: Likewise. * testsuite/ld-x86-64/pr14207.d: Likewise. * testsuite/ld-x86-64/pr17618.d: Likewise. * testsuite/ld-x86-64/pr19162.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/pr20253-1b.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1f.d: Likewise. * testsuite/ld-x86-64/pr20253-1h.d: Likewise. * testsuite/ld-x86-64/pr20253-1j.d: Likewise. * testsuite/ld-x86-64/pr20253-1l.d: Likewise. * testsuite/ld-x86-64/pr20830a-now.d: Likewise. * testsuite/ld-x86-64/pr20830a.d: Likewise. * testsuite/ld-x86-64/pr20830b-now.d: Likewise. * testsuite/ld-x86-64/pr20830b.d: Likewise. * testsuite/ld-x86-64/pr21038a-now.d: Likewise. * testsuite/ld-x86-64/pr21038a.d: Likewise. * testsuite/ld-x86-64/pr21038b-now.d: Likewise. * testsuite/ld-x86-64/pr21038b.d: Likewise. * testsuite/ld-x86-64/pr21038c-now.d: Likewise. * testsuite/ld-x86-64/pr21038c.d: Likewise.
2018-02-16 19:02:00 +01:00
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-x86-64/bnd-branch-1-now.d: Add -z
max-page-size=0x200000 -z noseparate-code.
* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2b-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2b.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2d.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3b-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3b.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
* testsuite/ld-x86-64/load1a.d: Likewise.
* testsuite/ld-x86-64/load1b.d: Likewise.
* testsuite/ld-x86-64/load1c.d: Likewise.
* testsuite/ld-x86-64/load1d.d: Likewise.
* testsuite/ld-x86-64/pie3.d: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr17618.d: Likewise.
* testsuite/ld-x86-64/pr19162.d: Likewise.
* testsuite/ld-x86-64/pr19636-2d.d: Likewise.
* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
* testsuite/ld-x86-64/pr20253-1b.d: Likewise.
* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
* testsuite/ld-x86-64/pr20253-1f.d: Likewise.
* testsuite/ld-x86-64/pr20253-1h.d: Likewise.
* testsuite/ld-x86-64/pr20253-1j.d: Likewise.
* testsuite/ld-x86-64/pr20253-1l.d: Likewise.
* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
* testsuite/ld-x86-64/pr20830a.d: Likewise.
* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
* testsuite/ld-x86-64/pr20830b.d: Likewise.
* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
* testsuite/ld-x86-64/pr21038a.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038b.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-x86-64/bnd-ifunc-1.d: Updated.
* testsuite/ld-x86-64/ilp32-4.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-x86-64/mpx.exp: Add -z max-page-size=0x200000
-z noseparate-code.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-x86-64/x86-64.exp: Add -z noseparate-code
-z max-page-size=0x200000, excluding NaCl target.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-x86-64.d: Likewise.
* testsuite/ld-ifunc/ifunc-21-i386.d: Likewise.
* testsuite/ld-ifunc/ifunc-22-i386.d: Likewise.
* testsuite/ld-ifunc/pr17154-i386-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-i386.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Add
-z max-page-size=0x200000 -z noseparate-code.
* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-x86-64.d: Likewise.
* testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise.
* testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-ifunc/ifunc-1-local-x86.d: Updated for i386.
* testsuite/ld-ifunc/ifunc-1-x86.d: Likewise.
* testsuite/ld-ifunc/ifunc-3a-x86.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-ifunc/ifunc-1-local-x86.d: Updated.
* testsuite/ld-ifunc/ifunc-1-x86.d: Likewise.
* testsuite/ld-ifunc/ifunc-3a-x86.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-i386/ibt-plt-1.d: Add -z noseparate-code.
* testsuite/ld-i386/ibt-plt-2a.d: Likewise.
* testsuite/ld-i386/ibt-plt-2b.d: Likewise.
* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
* testsuite/ld-i386/ibt-plt-2d.d: Likewise.
* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
* testsuite/ld-i386/ibt-plt-3b.d: Likewise.
* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
* testsuite/ld-i386/ibt-plt-3d.d: Likewise.
* testsuite/ld-i386/load1.d: Likewise.
* testsuite/ld-i386/pie1.d: Likewise.
* testsuite/ld-i386/pr20244-1a.d: Likewise.
* testsuite/ld-i386/pr20244-1b.d: Likewise.
* testsuite/ld-i386/pr20244-2a.d: Likewise.
* testsuite/ld-i386/pr20244-2b.d: Likewise.
* testsuite/ld-i386/pr20244-2c.d: Likewise.
* testsuite/ld-i386/pr20244-4a.d: Likewise.
* testsuite/ld-i386/pr20244-4b.d: Likewise.
* testsuite/ld-i386/pr20830.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-i386/pr19636-1a.d: Updated.
* testsuite/ld-i386/pr19636-1b.d: Likewise.
* testsuite/ld-i386/pr19636-1j.d: Likewise.
* testsuite/ld-i386/pr19636-1k.d: Likewise.
* testsuite/ld-i386/pr19636-2a.d: Likewise.
* testsuite/ld-i386/pr19636-2b.d: Likewise.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-i386/i386.exp: Add -z noseparate-code.
2018-02-16 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/pr19162.d: Add -z noseparate-code.
* testsuite/ld-elf/textaddr1.d: Likewise.
* testsuite/ld-elf/textaddr2.d: Likewise.
* testsuite/ld-elf/textaddr4.d: Likewise.
* testsuite/ld-elf/textaddr6.d: Likewise.
2018-02-15 Jim Wilson <jimw@sifive.com>
* 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.
x86-64: Use PLT address for PC-relative reloc 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-14 12:50:40 +01:00
2018-02-14 H.J. Lu <hongjiu.lu@intel.com>
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-14 Maciej W. Rozycki <macro@mips.com>
* ldlex.h (ldlex_command): Remove prototype.
2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
* 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-14 H.J. Lu <hongjiu.lu@intel.com>
PR 22836
* testsuite/ld-elf/pr22836-1.s: New file.
* testsuite/ld-elf/pr22836-1a.d: Likewise.
* testsuite/ld-elf/pr22836-1b.d: Likewise.
x86-64: Generate branch with PLT32 relocation 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-13 16:34:22 +01:00
2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
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-13 Alan Modra <amodra@gmail.com>
PR 22836
* testsuite/ld-elf/pr22836-2.d,
* testsuite/ld-elf/pr22836-2.s: New test.
2018-02-13 Alan Modra <amodra@gmail.com>
* testsuite/ld-x86-64/pr14207.d: Adjust relro p_filesz.
2018-02-07 Alan Modra <amodra@gmail.com>
Revert 2018-01-17 Alan Modra <amodra@gmail.com>
* emultempl/ppc32elf.em: Remove --speculate-indirect-jumps support.
* emultempl/ppc64elf.em: Likesize
* ld.texinfo: Likewise
* testsuite/ld-powerpc/elfv2exe.d,
* testsuite/ld-powerpc/elfv2so.d,
* testsuite/ld-powerpc/relbrlt.d,
* testsuite/ld-powerpc/powerpc.exp: Likewise.
Fix PR ld/22263 on SPARC. 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-06 18:15:56 +01:00
2018-02-06 Eric Botcazou <ebotcazou@adacore.com>
* 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 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/pr22764.s: New.
* testsuite/ld-aarch64/pr22764.d: New.
x86: Remove the unused _GLOBAL_OFFSET_TABLE_ 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-05 17:38:16 +01:00
2018-02-05 H.J. Lu <hongjiu.lu@intel.com>
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-05 Nick Clifton <nickc@redhat.com>
* po/pt_BR.po: Updated Brazilian Portuguese translation.
2018-02-04 H.J. Lu <hongjiu.lu@intel.com>
* 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-03 Nick Clifton <nickc@redhat.com>
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-03 Sandra Loosemore <sandra@codesourcery.com>
* emulparams/nios2elf.sh (GENERATE_SHLIB_SCRIPT): Don't set.
2018-02-02 Maciej W. Rozycki <macro@mips.com>
* testsuite/ld-elf/shared.exp: Add $AFLAGS_PIC throughout to PIC
assembly builds where missing and remove `tic6x-*-*' XFAIL
markings accordingly.
Fix compile time warnings building the binutils with clang. 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-02-01 14:21:41 +01:00
2018-02-01 Simon Marchi <simon.marchi@ericsson.com>
* ldexp.c (fold_name, exp_fold_tree_1): Avoid pointer arithmetic
on NULL pointer.
2018-01-31 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/pr21964-5.c (my_var): Mark as used.
2018-01-31 Maciej W. Rozycki <macro@mips.com>
* testsuite/ld-elf/shared.exp: Fix a typo s/scrip/script/.
2018-01-31 Maciej W. Rozycki <macro@mips.com>
* 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-31 Maciej W. Rozycki <macro@mips.com>
* testsuite/ld-elf/elf.exp: Move shared library tests over to...
* testsuite/ld-elf/shared.exp: ... here.
2018-01-31 Michael Matz <matz@suse.de>
* testsuite/ld-elf/pr21964-5.c: New test.
* testsuite/ld-elf/shared.exp: Run it.
2018-01-31 H.J. Lu <hongjiu.lu@intel.com>
PR ld/21964
* testsuite/ld-elf/pr21964-4.c: New file.
* testsuite/ld-elf/shared.exp: Run pr21964-4 test on Linux.
2018-01-30 Alan Modra <amodra@gmail.com>
* testsuite/ld-gc/stop.d,
* testsuite/ld-gc/stop.s: New test.
* testsuite/ld-gc/gc.exp: Run it.
MIPS/LD/testsuite: Correct PR ld/22649 test case failures 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-30 02:31:23 +01:00
2018-01-30 Maciej W. Rozycki <macro@mips.com>
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.
MIPS/LD/testsuite: Adjust match patterns for special section indexes 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-30 01:38:12 +01:00
2018-01-30 Maciej W. Rozycki <macro@mips.com>
* 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-29 Alan Modra <amodra@gmail.com>
* 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-29 Eric Botcazou <ebotcazou@adacore.com>
* testsuite/ld-elf/shared.exp (AFLAGS_PIC): Define on SPARC.
(pr22269-1): Pass AFLAGS_PIC to the assembler.
2018-01-29 Eric Botcazou <ebotcazou@adacore.com>
* testsuite/ld-elf/pr22450.d: Remove reference to SPARC64.
MIPS/LD/testsuite: Correct comm-data.exp test ABI/emul/endian arrangement 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-29 21:10:19 +01:00
2018-01-29 Maciej W. Rozycki <macro@mips.com>
* 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-29 H.J. Lu <hongjiu.lu@intel.com>
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-27 H.J. Lu <hongjiu.lu@intel.com>
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-28 Alan Modra <amodra@gmail.com>
PR 22751
* ldlang.c (find_rescan_insertion): Look past bfds with claim_archive
set.
2018-01-26 Maciej W. Rozycki <macro@mips.com>
* emulparams/elf32mipswindiss.sh (EXTRA_EM_FILE): Set to
`mipself'.
Fix PR ld/22727 (TLS breakage in PIC/PIE mode on SPARC). 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-25 12:16:06 +01:00
2018-01-25 Eric Botcazou <ebotcazou@adacore.com>
* 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.
[LD][AARCH64]Add group relocations to create PC-relative offset. 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-18 13:17:55 +01:00
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-20 H.J. Lu <hongjiu.lu@intel.com>
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-18 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/group1.d: Also xfail Solaris.
2018-01-18 H.J. Lu <hongjiu.lu@intel.com>
* 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-18 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22728
* emultempl/solaris2.em (elf_solaris2_after_allocation): Fold
into ...
(elf_solaris2_before_allocation): This.
(LDEMUL_AFTER_ALLOCATION): Removed.
2018-01-18 Alan Modra <amodra@gmail.com>
* emultempl/ppc32elf.em: Support optional --plt-align arg.
* emultempl/ppc64elf.em: Support negative --plt-align arg.
PowerPC PLT speculative execution barriers 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-17 04:49:08 +01:00
2018-01-17 Alan Modra <amodra@gmail.com>
* 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.
PowerPC PLT stub tidy 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-13 09:23:41 +01:00
2018-01-17 Alan Modra <amodra@gmail.com>
* 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-16 Nick Clifton <nickc@redhat.com>
* po/pt_BR.po: Updated Brazilian Portuguese translation.
2018-01-15 Nick Clifton <nickc@redhat.com>
* po/uk.po: Updated Ukranian translation.
2018-01-13 14:56:48 +01:00
2018-01-13 Nick Clifton <nickc@redhat.com>
* po/ld.pot: Regenerated.
2018-01-13 Nick Clifton <nickc@redhat.com>
* configure: Regenerate.
2018-01-13 Nick Clifton <nickc@redhat.com>
2.30 branch created.
* NEWS: Add marker for 2.30.
2018-01-12 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/elf.exp: xfail "pr22374 function pointer
initialization" for currently failing targets.
2018-01-12 Alan Modra <amodra@gmail.com>
PR ld/22649
* testsuite/ld-elf/pr22649.msg: Allow other messages.
* testsuite/ld-elf/shared.exp: Check that --gc-sections is
supported before running ld/22649 tests.
2018-01-12 Nick Clifton <nickc@redhat.com>
* emultempl/elf32.em (_handle_option): Add support for "-z undefs"
as the opposite of "-z defs".
* ld.texinfo: Document the new option. Update the description of
the -z defs option to make it clear that it does generate an error
if an undefined symbol reference is found in an object file whilst
creating a shared library.
* NEWS: Document this new feature.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/pr22393-2a.rd: Replace "-z textonly" with
"-z separate-code".
* testsuite/ld-elf/pr22393-2b.rd: Likewise.
* testsuite/ld-x86-64/pr22393-3a.rd: Likewise.
* testsuite/ld-x86-64/pr22393-3b.rd: Likewise.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22393
* testsuite/ld-x86-64/pr22393-3a.c: New file.
* testsuite/ld-x86-64/pr22393-3a.rd: Likewise.
* testsuite/ld-x86-64/pr22393-3b.c: Likewise.
* testsuite/ld-x86-64/pr22393-3b.rd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run tests for -z separate-code
-z max-page-size=0x1000.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22393
* testsuite/ld-elf/pr16322.d: Add -z noseparate-code.
* testsuite/ld-elf/pr22393-1.s: New file.
* testsuite/ld-elf/pr22393-1a.d: Likewise.
* testsuite/ld-elf/pr22393-1b.d: Likewise.
* testsuite/ld-elf/pr22393-1c.d: Likewise.
* testsuite/ld-elf/pr22393-1d.d: Likewise.
* testsuite/ld-elf/pr22393-1e.d: Likewise.
* testsuite/ld-elf/pr22393-1f.d: Likewise.
* testsuite/ld-elf/pr22393-2a.c: Likewise.
* testsuite/ld-elf/pr22393-2a.rd: Likewise.
* testsuite/ld-elf/pr22393-2b.c: Likewise.
* testsuite/ld-elf/pr22393-2b.rd: Likewise.
* testsuite/ld-elf/shared.exp: Run tests for -z separate-code.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22393
* NEWS: Mention "-z separate-code".
* emultempl/elf32.em (gld${EMULATION_NAME}_get_script): Get
builtin linker scripts and return linker scripts from disk for
"-z separate-code".
(gld${EMULATION_NAME}_handle_option): Handle "-z separate-code"
and "-z noseparate-code".
* genscripts.sh: Generate linker scripts for "-z separate-code".
(LD_FLAG): Set to *textonly for "-z separate-code".
* ld.texinfo: Document "-z separate-code".
* lexsup.c (elf_shlib_list_options): Add linker help messsages
for "-z separate-code" and "-z noseparate-code".
* scripttempl/elf.sc (SEPARATE_TEXT): New
(TEXT_SEGMENT_ALIGN): Likewise.
Use ${TEXT_SEGMENT_ALIGN} to align and pad text segment to
${MAXPAGESIZE}.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22649
* testsuite/ld-elf/pr22649-1.s: New file.
* testsuite/ld-elf/pr22649-2a.s: Likewise.
* testsuite/ld-elf/pr22649-2b.s: Likewise.
* testsuite/ld-elf/pr22649.msg: Likewise.
* testsuite/ld-elf/shared.exp: Run ld/22649 tests.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22677
* scripttempl/elf.sc (PREINIT_ARRAY): New.
Don't add .preinit_array for ld -r.
* testsuite/ld-elf/pr22677.d: New file.
* testsuite/ld-elf/pr22677.s: Likewise.
2018-01-11 Andrew Burgess <andrew.burgess@embecosm.com>
* ldexp.h (union etree_union): Remove defsym field.
* ldexp.c (exp_assop): Remove defsym parameter, and use of defsym
parameter.
(exp_assign): Remove passing of defsym parameter.
(exp_defsym): Likewise.
(exp_provide): Likewise.
ld: Fix issue where PROVIDE overrides defined symbol In a linker script, a sequence like this: foo = ADDR (.some_section); bar = foo; PROVIDE (foo = 0); will result in 'bar = ADDR (.some_section)' and 'foo = 0', which seems like incorrect behaviour, foo is clearly defined elsewhere, and so the PROVIDE should not trigger. The problem is that an expression like this: foo = ADDR (.some_section); can't be evaluated until a late phase of the linker, due to the need for the section '.some_section' to have been placed, then the PROVIDE was being marked as being used during an earlier phase. At the end of the link, both lines: foo = ADDR (.some_section); PROVIDE (foo = 0); are active, and this causes the final value of 'foo' to be 0. The solution proposed in this commit is that, during earlier phases of the linker, when we see the expression 'foo = ADDR (.some_section);', instead of ignoring the expression, we create a "fake" definition of 'foo'. The existence of this "fake" definition prevents the PROVIDE from being marked used, and during the final phase the real definition of 'foo' will replace the "fake" definition. The new test provide-6 covers the exact case described above. The provide-7 test is similar to the above, but using constant expressions, this was never broken, but is added here to increase coverage. The provide-8 case also didn't fail before this commit, but I did manage to break this case during development of this patch. This case was only covered by a mmix test before, so I've added this here to increase coverage. ld/ChangeLog: * ldexp.c (exp_fold_tree_1): Rework condition underwhich provide nodes are ignored in the tree walk, and move the location at which we change provide nodes into provided nodes. (exp_init_os): Add etree_provided. * testsuite/ld-scripts/provide-6.d: New file. * testsuite/ld-scripts/provide-6.t: New file. * testsuite/ld-scripts/provide-7.d: New file. * testsuite/ld-scripts/provide-7.t: New file. * testsuite/ld-scripts/provide-8.d: New file. * testsuite/ld-scripts/provide-8.t: New file.
2017-04-27 19:05:08 +02:00
2018-01-11 Andrew Burgess <andrew.burgess@embecosm.com>
* ldexp.c (exp_fold_tree_1): Rework condition underwhich provide
nodes are ignored in the tree walk, and move the location at which
we change provide nodes into provided nodes.
(exp_init_os): Add etree_provided.
* testsuite/ld-scripts/provide-6.d: New file.
* testsuite/ld-scripts/provide-6.t: New file.
* testsuite/ld-scripts/provide-7.d: New file.
* testsuite/ld-scripts/provide-7.t: New file.
* testsuite/ld-scripts/provide-8.d: New file.
* testsuite/ld-scripts/provide-8.t: New file.
2018-01-11 Andrew Burgess <andrew.burgess@embecosm.com>
* testsuite/ld-scripts/provide-3.d: Add xfail directive.
* testsuite/ld-scripts/provide-4.d: Use new map file name.
* testsuite/ld-scripts/provide-5.d: Use new map file name.
* testsuite/ld-scripts/provide-4-map.d: Renamed to...
* testsuite/ld-scripts/provide-4.map: ...this.
* testsuite/ld-scripts/provide-5-map.d: Renamed to...
* testsuite/ld-scripts/provide-5.map: ...this.
* testsuite/ld-scripts/provide.exp: Move xfail into provide-3.d
file, and run tests in a loop.
2018-01-11 Andrew Burgess <andrew.burgess@embecosm.com>
* ldexp.c (exp_print_tree): Use '=' instead of ',' when printing
PROVIDE statements.
* testsuite/ld-scripts/provide-4.map: Update expected output.
* testsuite/ld-scripts/provide-5.map: Likewise.
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22696
* scripttempl/elf.sc: Fix the order of SHLIB_RODATA_ADDR.
2018-01-09 Jim Wilson <jimw@sifive.com>
* testsuite/ld-elf/eh-frame-hdr.d (#xfail): Delete
(#alltargets): Renamed from #target. Add shared.
* testsuite/lib/ld-lib.exp (run_dump_test): Document shared target.
Document alltargets option. Add support for alltargets option.
(istarget): Add support for shared target.
2018-01-08 Jim Wilson <jimw@sifive.com>
* testsuite/ld-riscv-elf/c-lui.d: Don't use -shared. Check for _start
instead of .text.
* testsuite/ld-riscv-elf/c-lui.s: Add _start label.
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Before __global_pointer$
tests, add call to check_shared_lib_support.
2018-01-05 Jim Wilson <jimw@sifive.com>
* testsuite/ld-riscv-elf/disas-jalr.d: New.
* testsuite/ld-riscv-elf/disas-jalr.s: New.
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run new testcase.
* emulparams/elf32lriscv-defs.sh (GENERATE_SHLIB_SCRIPT): Move inside
case on $target, and don't set for riscv*-elf targets.
(GENERATE_PIE_SCRIPT): Likewise.
2018-01-03 Alan Modra <amodra@gmail.com>
Update year range in copyright notice of all files.
2018-01-03 06:15:17 +01:00
For older changes see ChangeLog-2017
2018-01-03 06:15:17 +01:00
Copyright (C) 2018 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
Local Variables:
mode: change-log
left-margin: 8
fill-column: 74
version-control: never
End: