aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-powerpc/tlsso.r
AgeCommit message (Collapse)AuthorFilesLines
2021-07-24Revert: PowerPC: Don't generate unused section symbolsAlan Modra1-0/+12
Blindly following x86 broke linux kernel builds. bfd/ * elf32-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define as true. * elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Likewise. gas/ * testsuite/gas/ppc/power4.d: Adjust for section sym change. * testsuite/gas/ppc/test1elf32.d: Likewise. * testsuite/gas/ppc/test1elf64.d: Likewise. ld/ * testsuite/ld-powerpc/tlsexe.r: Adjust for section sym change. * testsuite/ld-powerpc/tlsexe32.r: Likewise. * testsuite/ld-powerpc/tlsexe32no.r: Likewise. * testsuite/ld-powerpc/tlsexeno.r: Likewise. * testsuite/ld-powerpc/tlsexenors.r: Likewise. * testsuite/ld-powerpc/tlsexers.r: Likewise. * testsuite/ld-powerpc/tlsexetoc.r: Likewise. * testsuite/ld-powerpc/tlsexetocrs.r: Likewise. * testsuite/ld-powerpc/tlsget.d: Likewise. * testsuite/ld-powerpc/tlsget.wf: Likewise. * testsuite/ld-powerpc/tlsget2.d: Likewise. * testsuite/ld-powerpc/tlsget2.wf: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise. * testsuite/ld-powerpc/tlstocso.r: Likewise.
2021-04-21Adjust readelf's output so that section symbols without a name as shown with ↵Nick Clifton1-2/+2
their section name. binutils* readelf.c (print_dynamic_symbol): Print the section name for section symbols without a name of their own. * testsuite/binutils-all/mips/global-local-symtab-sort-n64t.d: Adjust expected output to allow for named section symbols. * testsuite/binutils-all/mips/global-local-symtab-sort-o32t.d: Likewise. * testsuite/binutils-all/readelf.s-64: Likewise. * testsuite/binutils-all/readelf.ss-64-unused: Likewise. * testsuite/binutils-all/readelf.ss-tmips: Likewise. * testsuite/binutils-all/readelf.ss-unused: Likewise. ld * testsuite/ld-aarch64/variant_pcs-now.d: Adjust expected output to allow for named section symbols. * testsuite/ld-aarch64/variant_pcs-r.d: Likewise. * testsuite/ld-aarch64/variant_pcs-shared.d: Likewise. * testsuite/ld-alpha/tlsbin.rd: Likewise. * testsuite/ld-alpha/tlsbinr.rd: Likewise. * testsuite/ld-alpha/tlspic.rd: Likewise. * testsuite/ld-arm/rodata-merge-map.sym: Likewise. * testsuite/ld-arm/script-type.sym: Likewise. * testsuite/ld-cris/libdso-2.d: Likewise. * testsuite/ld-cris/pr16044.d: Likewise. * testsuite/ld-elf/sec64k.exp: Likewise. * testsuite/ld-ia64/tlsbin.rd: Likewise. * testsuite/ld-ia64/tlspic.rd: Likewise. * testsuite/ld-mips-elf/global-local-symtab-sort-n64t.d: Likewise. * testsuite/ld-mips-elf/global-local-symtab-sort-o32t.d: Likewise. * testsuite/ld-mmix/bspec1.d: Likewise. * testsuite/ld-mmix/bspec2.d: Likewise. * testsuite/ld-mmix/local1.d: Likewise. * testsuite/ld-mmix/local3.d: Likewise. * testsuite/ld-mmix/local5.d: Likewise. * testsuite/ld-mmix/local7.d: Likewise. * testsuite/ld-mmix/undef-3.d: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise. * testsuite/ld-powerpc/tlstocso.r: Likewise. * testsuite/ld-s390/tlsbin.rd: Likewise. * testsuite/ld-s390/tlsbin_64.rd: Likewise. * testsuite/ld-s390/tlspic.rd: Likewise. * testsuite/ld-s390/tlspic_64.rd: Likewise. * testsuite/ld-sparc/gotop32.rd: Likewise. * testsuite/ld-sparc/gotop64.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunnopic32.rd: Likewise. * testsuite/ld-sparc/tlssunnopic64.rd: Likewise. * testsuite/ld-sparc/tlssunpic32.rd: Likewise. * testsuite/ld-sparc/tlssunpic64.rd: Likewise. * testsuite/ld-tic6x/common.d: Likewise. * testsuite/ld-tic6x/shlib-1.rd: Likewise. * testsuite/ld-tic6x/shlib-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. * testsuite/ld-tic6x/static-app-1.rd: Likewise. * testsuite/ld-tic6x/static-app-1b.rd: Likewise. * testsuite/ld-tic6x/static-app-1r.rd: Likewise. * testsuite/ld-tic6x/static-app-1rb.rd: Likewise. gas * testsuite/gas/aarch64/dwarf.d: Adjust expected output to allow for named section symbols. * testsuite/gas/arm/thumbver.d: Likewise. * testsuite/gas/bfin/loop_temps.d: Likewise. * testsuite/gas/elf/section2.e-arc: Likewise. * testsuite/gas/elf/section2.e-arm: Likewise. * testsuite/gas/elf/section2.e-csky: Likewise. * testsuite/gas/elf/section2.e-m32r: Likewise. * testsuite/gas/elf/section2.e-mips: Likewise. * testsuite/gas/elf/section2.e-msp430: Likewise. * testsuite/gas/elf/section2.e-riscv: Likewise. * testsuite/gas/elf/section2.e-rl78: Likewise. * testsuite/gas/elf/section2.e-rx: Likewise. * testsuite/gas/elf/section2.e-score: Likewise. * testsuite/gas/elf/section2.e-tic6x: Likewise. * testsuite/gas/elf/section2.e-unused: Likewise. * testsuite/gas/elf/section2.e-v850: Likewise. * testsuite/gas/elf/section2.e-xtensa: Likewise. * testsuite/gas/ia64/alias-ilp32.d: Likewise. * testsuite/gas/ia64/alias.d: Likewise. * testsuite/gas/ia64/global.d: Likewise. * testsuite/gas/microblaze/relax_size.elf: Likewise. * testsuite/gas/microblaze/relax_size2.elf: Likewise. * testsuite/gas/mips/global-local-symtab-sort-n64t.d: Likewise. * testsuite/gas/mips/global-local-symtab-sort-o32t.d: Likewise. * testsuite/gas/mmix/bspec-1.d: Likewise. * testsuite/gas/mmix/byte-1.d: Likewise. * testsuite/gas/mmix/comment-1.d: Likewise. * testsuite/gas/mmix/loc-1.d: Likewise. * testsuite/gas/mmix/loc-2.d: Likewise. * testsuite/gas/mmix/loc-3.d: Likewise. * testsuite/gas/mmix/loc-4.d: Likewise. * testsuite/gas/mmix/loc-5.d: Likewise. * testsuite/gas/tic6x/scomm-directive-4.d: Likewise.
2021-01-20PowerPC: Don't generate unused section symbolsAlan Modra1-12/+0
PowerPC version of git commit d1bcae833b. bfd/ * elf32-ppc.c: Delete outdated comment. (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define. * elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define. gas/ * testsuite/gas/ppc/power4.d: Adjust for removal of section sym. * testsuite/gas/ppc/test1elf32.d: Likewise. * testsuite/gas/ppc/test1elf64.d: Likewise. ld/ * testsuite/ld-powerpc/relbrlt.s: Make symbols global. * testsuite/ld-powerpc/relbrlt.d: Adjust to suit. * testsuite/ld-powerpc/tlsget.d: Adjust for reordered stubs. * testsuite/ld-powerpc/tlsget.wf: Likewise. * testsuite/ld-powerpc/tlsget2.d: Likewise. * testsuite/ld-powerpc/tlsget2.wf: Likewise. * testsuite/ld-powerpc/tlsexe.r: Adjust for removed section syms. * testsuite/ld-powerpc/tlsexe32.r: Likewise. * testsuite/ld-powerpc/tlsexe32no.r: Likewise. * testsuite/ld-powerpc/tlsexeno.r: Likewise. * testsuite/ld-powerpc/tlsexenors.r: Likewise. * testsuite/ld-powerpc/tlsexers.r: Likewise. * testsuite/ld-powerpc/tlsexetoc.r: Likewise. * testsuite/ld-powerpc/tlsexetocrs.r: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise. * testsuite/ld-powerpc/tlstocso.r: Likewise.
2019-10-07PowerPC TLS testsAlan Modra1-0/+1
This patch adds some --no-tls-optimize tests and performs some of the existing dynamic tests with tls markers in order to catch any regression in PLT counting. * testsuite/ld-powerpc/tlsexe.r: Adjust for added TLSMARK symbol. * testsuite/ld-powerpc/tlsexe32.r: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise. * testsuite/ld-powerpc/tls32no.d, * testsuite/ld-powerpc/tls32no.g: New test files. * testsuite/ld-powerpc/tlsexe32no.d, * testsuite/ld-powerpc/tlsexe32no.g, * testsuite/ld-powerpc/tlsexe32no.r: New test files. * testsuite/ld-powerpc/tlsexeno.d, * testsuite/ld-powerpc/tlsexeno.g, * testsuite/ld-powerpc/tlsexeno.r: New test files. * testsuite/ld-powerpc/tlsexetocno.d, * testsuite/ld-powerpc/tlsexetocno.g: New test files. * testsuite/ld-powerpc/tlsno.d, * testsuite/ld-powerpc/tlsno.g: New test files. * testsuite/ld-powerpc/tlstocno.d, * testsuite/ld-powerpc/tlstocno.g: New test files. * testsuite/ld-powerpc/powerpc.exp: Run new tests.
2019-10-04PowerPC PIC vs. DLL TLS issuesAlan Modra1-2/+4
1) GOT entries generated for any of the GOT TLS relocations don't need dynamic relocations for locally defined symbols in PIEs. In the case of a tls_index doubleword, the dtpmod entry is known to be 1, and the dtprel entry is also known at link time and relative. Similarly, dtprel and tprel words are known at link time and relative. (GOT entries for other than TLS symbols are not relative and thus need dynamic relocations in PIEs.) 2) Local dynamic TLS code is really only meant for accesses local to the current binary. There was a cheapskate test for this before using the common tlsld_got slot, but the test wasn't exactly correct and might confuse anyone looking at the code. The proper test, SYMBOL_REFERENCES_LOCAL isn't so expensive that it should be avoided. 3) The same cheap test for local syms when optimising TLS sequences should be SYMBOL_REFERENCES_LOCAL too. bfd/ * elf64-ppc.c (ppc64_elf_check_relocs): Move initialisation of vars. (ppc64_elf_tls_optimize): Correct is_local condition. (allocate_got): Don't reserve dynamic relocations for any of the tls got relocs in PIEs when the symbol is local. (allocate_dynrelocs): Correct validity test for local sym using tlsld_got slot. (ppc64_elf_size_dynamic_sections): Don't reserve dynamic relocations for any of the tls got relocs in PIEs. (ppc64_elf_layout_multitoc): Likewise. (ppc64_elf_relocate_section): Correct validity test for local sym using tlsld_got slot. Don't emit dynamic relocations for any of the tls got relocs in PIEs when the symbol is local. * elf32-ppc.c (ppc_elf_tls_optimize): Correct is_local condition. (got_relocs_needed): Delete. (allocate_dynrelocs): Correct validity test for local sym using tlsld_got slot. Don't reserve dynamic relocations for any of the tls got relocs in PIEs when the symbol is local. (ppc_elf_size_dynamic_sections): Don't reserve dynamic relocations for any of the tls got relocs in PIEs. (ppc_elf_relocate_section): Correct validity test for local sym using tlsld_got slot. Don't emit dynamic relocations for any of the tls got relocs in PIEs when the symbol is local. ld/ * testsuite/ld-powerpc/tlsso.d: Adjust to suit tlsld_got usage change. * testsuite/ld-powerpc/tlsso.g: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.d: Likewise. * testsuite/ld-powerpc/tlsso32.g: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise.
2019-07-13Dynamic TLS section symbolsAlan Modra1-4/+4
It is possible to create shared libraries on PowerPC using -ftls-model=inital-exec or -ftls-model=local-exec. The first is half reasonable, getting you a shared library that can't be dlopen'd but otherwise is reasonable. The second is quite bad. Not only do you lose being able to dlopen, the library also has dynamic text relocations. Worse, the TPREL16_LO, TPREL16_HA and other TPREL16 dynamic relocs emitted were wrong, resulting in wrong values being applied by ld.so. Using the first TLS section symbol in dynamic relocations for local TLS symbols doesn't work. It's wrong because TLS symbols used by TLS relocs have values relative to the TLS segment, whereas the TLS section symbols are addresses. This patch instead uses a symbol index of zero which is used elsewhere by PowerPC on dynamic TLS relocs. It's not strictly ABI compliant to use a non-TLS symbol with TLS relocs but symbol index zero can be interpreted as "no symbol". Not using the first TLS section symbol means it doesn't need to be dynamic. The patch also fixes a further problem with PowerPC32 dynamic TPREL16* relocs, which shouldn't have the symbol value in the addend as we do for non-TLS symbols. bfd/ * elflink.c (_bfd_elf_omit_section_dynsym_default): Don't keep tls_sec. (_bfd_elf_init_1_index_section): Prefer not using TLS sections. (_bfd_elf_init_2_index_sections): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): When emitting dynamic relocations for local TLS symbols, use STN_UNDEF as the relocation symbol. * elf32-ppc.c (ppc_elf_relocate_section): Likewise, and don't leave TLS symbol value in the addend. ld/ * testsuite/ld-powerpc/tlsso.r: Update. * testsuite/ld-powerpc/tlsso32.g: Update. * testsuite/ld-powerpc/tlsso32.r: Update. * testsuite/ld-powerpc/tlstocso.r: Update. * testsuite/ld-cris/tls-dso-dtpoffd2.d: Update. * testsuite/ld-cris/tls-dso-dtpoffd4.d: Update. * testsuite/ld-cris/tls-dso-tpoffgotcomm1.d: Update. * testsuite/ld-cris/tls-gd-1.d: Update. * testsuite/ld-cris/tls-gd-1h.d: Update. * testsuite/ld-cris/tls-gd-2.d: Update. * testsuite/ld-cris/tls-gd-2h.d: Update. * testsuite/ld-cris/tls-ie-10.d: Update. * testsuite/ld-cris/tls-ie-11.d: Update. * testsuite/ld-cris/tls-ie-8.d: Update. * testsuite/ld-cris/tls-ie-9.d: Update. * testsuite/ld-cris/tls-js1.d: Update. * testsuite/ld-cris/tls-ld-4.d: Update. * testsuite/ld-cris/tls-ld-5.d: Update. * testsuite/ld-cris/tls-ld-6.d: Update. * testsuite/ld-cris/tls-ld-7.d: Update. * testsuite/ld-cris/tls-ldgd-14.d: Update. * testsuite/ld-cris/tls-ldgd-15.d: Update. * testsuite/ld-cris/tls-ldgdx-14.d: Update. * testsuite/ld-cris/tls-ldgdx-15.d: Update. * testsuite/ld-cris/tls-local-54.d: Update. * testsuite/ld-cris/tls-local-60.d: Update. * testsuite/ld-cris/tls-local-61.d: Update. * testsuite/ld-cris/tls-local-63.d: Update. * testsuite/ld-cris/tls-local-64.d: Update. * testsuite/ld-cris/tls-ok-30.d: Update. * testsuite/ld-cris/tls-ok-32.d: Update. * testsuite/ld-cris/tls-ok-34.d: Update. * testsuite/ld-mips-elf/tls-multi-got-1.got: Update. * testsuite/ld-mips-elf/tls-multi-got-1.r: Update. * testsuite/ld-mips-elf/tlsdyn-pie-o32.d: Update. * testsuite/ld-mips-elf/tlsdyn-pie-o32.got: Update. * testsuite/ld-mips-elf/tlslib-o32-hidden.got: Update. * testsuite/ld-mips-elf/tlslib-o32-ver.got: Update. * testsuite/ld-mips-elf/tlslib-o32.got: Update. * testsuite/ld-s390/tlspic.rd: Update. * testsuite/ld-s390/tlspic_64.rd: Update. * testsuite/ld-sparc/tlssunnopic32.rd: Update. * testsuite/ld-sparc/tlssunnopic64.rd: Update. * testsuite/ld-sparc/tlssunpic32.rd: Update. * testsuite/ld-sparc/tlssunpic64.rd: Update.
2018-06-08Define various symbols conditionally in shared librariesAlan Modra1-7/+1
The values of symbols in shared libraries like _end, _edata, and __bss_start are generally not that useful outside of the shared library. This patch defines them conditionally with PROVIDE, since a shared library might need the local value. An example is glibc ld.so local access to "_begin", "_etext" and "_end". (ld.so gains access to the local values by making the references using hidden visibility. That makes the definitions hidden too.) We can't use PROVIDE_HIDDEN in the linker scripts because the shared library might need the value of the symbol in the executable. An example is freebsd libc dynamic access to "_end". PR ld/23161 * emulparams/aarch64cloudabi.sh: PROVIDE __bss_start__, _bss_end__, and __end__ in shared libraries. * emulparams/aarch64fbsd.sh: Likewise. * emulparams/aarch64linux.sh: Likewise. * emulparams/aarch64linux32.sh: Likewise. * emulparams/armelf_fuchsia.sh: Likewise. * emulparams/armelf_linux.sh: Likewise. * emulparams/armelf_phoenix.sh: Likewise. * emulparams/aarch64elf.sh: Likewise, and __data_start * emulparams/aarch64elf32.sh: Likewise. * emulparams/armelf.sh: Likewise. * emulparams/armnto.sh: Likewise. * emulparams/elf32bmip.sh: Remove duplicate ". = ." from OTHER_GOT_SYMBOLS. PROVIDE _ftext, _fdata, and _fbss in shared libs. * emulparams/elf32bmipn32-defs.sh: Likewise. * emulparams/elf32frv.sh: PROVIDE __end and __data_start in shared libs. * emulparams/elf32lriscv-defs.sh: Tidy. * emulparams/elf32mcore.sh: PROVIDE __bss_start and _bss_end in shared libs * emulparams/elf32ppccommon.sh: PROVIDE __end in shared libs. * emulparams/elf32rl78.sh: Tidy. * emulparams/i386nto.sh: PROVIDE _btext in shared libs. * emulparams/shelf_nto.sh: Likewise. * emulparams/shlelf_nto.sh: Likewise. * emulparams/score3_elf.sh: PROVIDE _gp, _bss_start__, _bss_end__, __bss_end__, __end__, _fdata, _sdata_begin, and _bss_start in shared libs. * scripttempl/elf.sc: Don't use EXECUTABLE_SYMBOLS for shared libraries. PROVIDE _edata, edata, __bss_start, and _end in shared libraries. * testsuite/ld-elf/pr23161.map, * testsuite/ld-elf/pr23161a.c, * testsuite/ld-elf/pr23161b.c, * testsuite/ld-elf/pr23161c.c, * testsuite/ld-elf/pr23161a.rd, * testsuite/ld-elf/pr23161b.rd, * testsuite/ld-elf/pr23161c.rd, * testsuite/ld-elf/pr23161d.rd: New tests. * testsuite/ld-elf/shared.exp: Run ld/23161 tests. * testsuite/ld-elf/pr23162.rd, * testsuite/ld-aarch64/ifunc-1-local.d, * testsuite/ld-aarch64/ifunc-1.d, * testsuite/ld-aarch64/ifunc-2-local.d, * testsuite/ld-aarch64/ifunc-2.d, * testsuite/ld-aarch64/ifunc-21.d, * testsuite/ld-aarch64/ifunc-3a.d, * testsuite/ld-alpha/tlsbin.rd, * testsuite/ld-alpha/tlsbin.sd, * testsuite/ld-alpha/tlsbinr.rd, * testsuite/ld-alpha/tlspic.rd, * testsuite/ld-alpha/tlspic.sd, * testsuite/ld-cris/dso-pltdis1.d, * testsuite/ld-cris/dso-pltdis2.d, * testsuite/ld-cris/dso12-pltdis.d, * testsuite/ld-cris/gotplt1.d, * testsuite/ld-cris/gotplt2.d, * testsuite/ld-cris/gotplt3.d, * testsuite/ld-cris/hiddef1.d, * testsuite/ld-cris/libdso-1.d, * testsuite/ld-cris/libdso-10.d, * testsuite/ld-cris/libdso-11.d, * testsuite/ld-cris/libdso-12.d, * testsuite/ld-cris/libdso-12b.d, * testsuite/ld-cris/libdso-12c.d, * testsuite/ld-cris/libdso-13.d, * testsuite/ld-cris/libdso-13b.d, * testsuite/ld-cris/libdso-14.d, * testsuite/ld-cris/libdso-15.d, * testsuite/ld-cris/libdso-15b.d, * testsuite/ld-cris/libdso-1c.d, * testsuite/ld-cris/libdso-1d.d, * testsuite/ld-cris/libdso-2.d, * testsuite/ld-cris/pic-gc-72.d, * testsuite/ld-cris/pic-gc-73.d, * testsuite/ld-cris/pr16044.d, * testsuite/ld-cris/pv32-1.d, * testsuite/ld-cris/tls-dso-dtpoffd2.d, * testsuite/ld-cris/tls-dso-dtpoffd4.d, * testsuite/ld-cris/tls-dso-tpoffgotcomm1.d, * testsuite/ld-cris/tls-gc-71.d, * testsuite/ld-cris/tls-gd-1.d, * testsuite/ld-cris/tls-gd-1h.d, * testsuite/ld-cris/tls-gd-2.d, * testsuite/ld-cris/tls-gd-2h.d, * testsuite/ld-cris/tls-ie-10.d, * testsuite/ld-cris/tls-ie-11.d, * testsuite/ld-cris/tls-ie-78.d, * testsuite/ld-cris/tls-ie-8.d, * testsuite/ld-cris/tls-ie-9.d, * testsuite/ld-cris/tls-js1.d, * testsuite/ld-cris/tls-ld-4.d, * testsuite/ld-cris/tls-ld-5.d, * testsuite/ld-cris/tls-ld-6.d, * testsuite/ld-cris/tls-ld-7.d, * testsuite/ld-cris/tls-ldgd-14.d, * testsuite/ld-cris/tls-ldgd-15.d, * testsuite/ld-cris/tls-ldgdex-14.d, * testsuite/ld-cris/tls-ldgdex-15.d, * testsuite/ld-cris/tls-ldgdx-14.d, * testsuite/ld-cris/tls-ldgdx-15.d, * testsuite/ld-cris/tls-legdx-16.d, * testsuite/ld-cris/tls-legdx-17.d, * testsuite/ld-cris/tls-local-54.d, * testsuite/ld-cris/tls-local-60.d, * testsuite/ld-cris/tls-local-61.d, * testsuite/ld-cris/tls-local-63.d, * testsuite/ld-cris/tls-local-64.d, * testsuite/ld-cris/tls-ok-30.d, * testsuite/ld-cris/tls-ok-32.d, * testsuite/ld-cris/tls-ok-34.d, * testsuite/ld-cris/tls-und-38.d, * testsuite/ld-cris/tls-und-42.d, * testsuite/ld-cris/tls-und-46.d, * testsuite/ld-cris/tls-und-50.d, * testsuite/ld-cris/weakhiddso.d, * testsuite/ld-cris/weakref2.d, * testsuite/ld-frv/fdpic-shared-1.d, * testsuite/ld-frv/fdpic-shared-2.d, * testsuite/ld-frv/fdpic-shared-3.d, * testsuite/ld-frv/fdpic-shared-4.d, * testsuite/ld-frv/fdpic-shared-5.d, * testsuite/ld-frv/fdpic-shared-7.d, * testsuite/ld-frv/fdpic-shared-8.d, * testsuite/ld-frv/tls-dynamic-2.d, * testsuite/ld-i386/ibt-plt-1.d, * testsuite/ld-i386/ibt-plt-2a.d, * testsuite/ld-i386/ibt-plt-2b.d, * testsuite/ld-i386/ibt-plt-2c.d, * testsuite/ld-i386/ibt-plt-2d.d, * testsuite/ld-i386/ibt-plt-3a.d, * testsuite/ld-i386/ibt-plt-3b.d, * testsuite/ld-i386/ibt-plt-3c.d, * testsuite/ld-i386/ibt-plt-3d.d, * testsuite/ld-i386/plt2.dd, * testsuite/ld-i386/pr20830.d, * testsuite/ld-i386/tlsbin-nacl.rd, * testsuite/ld-i386/tlsbin.rd, * testsuite/ld-i386/tlsbin2-nacl.rd, * testsuite/ld-i386/tlsbin2.rd, * testsuite/ld-i386/tlsbindesc-nacl.rd, * testsuite/ld-i386/tlsbindesc.rd, * testsuite/ld-i386/tlsdesc-nacl.rd, * testsuite/ld-i386/tlsdesc.rd, * testsuite/ld-i386/tlsgdesc-nacl.rd, * testsuite/ld-i386/tlsgdesc.rd, * testsuite/ld-i386/tlsnopic-nacl.rd, * testsuite/ld-i386/tlsnopic.dd, * testsuite/ld-i386/tlsnopic.rd, * testsuite/ld-i386/tlsnopic.sd, * testsuite/ld-i386/tlspic-nacl.rd, * testsuite/ld-i386/tlspic.rd, * testsuite/ld-i386/tlspic2-nacl.rd, * testsuite/ld-i386/tlspic2.rd, * testsuite/ld-ia64/merge1.d, * testsuite/ld-ia64/merge2.d, * testsuite/ld-ia64/merge3.d, * testsuite/ld-ia64/merge4.d, * testsuite/ld-ia64/merge5.d, * testsuite/ld-ia64/tlsbin.rd, * testsuite/ld-ia64/tlspic.rd, * testsuite/ld-ifunc/ifunc-2-i386-now.d, * testsuite/ld-ifunc/ifunc-2-local-i386-now.d, * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d, * testsuite/ld-ifunc/ifunc-2-local-x86-64.d, * testsuite/ld-ifunc/ifunc-2-x86-64-now.d, * testsuite/ld-ifunc/ifunc-2-x86-64.d, * testsuite/ld-ifunc/pr17154-i386-now.d, * testsuite/ld-ifunc/pr17154-i386.d, * testsuite/ld-ifunc/pr17154-x86-64-now.d, * testsuite/ld-ifunc/pr17154-x86-64.d, * testsuite/ld-m68k/tls-def-1.d, * testsuite/ld-m68k/tls-gd-1.d2, * testsuite/ld-metag/shared.d, * testsuite/ld-metag/stub_pic_app.d, * testsuite/ld-mips-elf/rel32-n32.d, * testsuite/ld-mips-elf/rel32-o32.d, * testsuite/ld-mips-elf/rel64.d, * testsuite/ld-powerpc/ambiguousv1.d, * testsuite/ld-powerpc/ambiguousv1b.d, * testsuite/ld-powerpc/ambiguousv2.d, * testsuite/ld-powerpc/ambiguousv2b.d, * 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/tlsso.d, * testsuite/ld-powerpc/tlsso.r, * testsuite/ld-powerpc/tlsso32.g, * testsuite/ld-powerpc/tlsso32.r, * testsuite/ld-powerpc/tlstocso.d, * testsuite/ld-powerpc/tlstocso.g, * testsuite/ld-powerpc/tlstocso.r, * testsuite/ld-s390/gotreloc_31-1.dd, * testsuite/ld-s390/tlsbin.dd, * testsuite/ld-s390/tlsbin.rd, * testsuite/ld-s390/tlsbin_64.dd, * testsuite/ld-s390/tlsbin_64.rd, * testsuite/ld-s390/tlspic.rd, * testsuite/ld-s390/tlspic_64.rd, * testsuite/ld-sh/tlsbin-2.d, * testsuite/ld-sh/tlspic-2.d, * testsuite/ld-sparc/gotop32.rd, * testsuite/ld-sparc/gotop64.rd, * testsuite/ld-sparc/tlssunbin32.rd, * testsuite/ld-sparc/tlssunbin64.rd, * testsuite/ld-sparc/tlssunnopic32.rd, * testsuite/ld-sparc/tlssunnopic64.rd, * testsuite/ld-sparc/tlssunpic32.rd, * testsuite/ld-sparc/tlssunpic64.rd, * testsuite/ld-x86-64/bnd-branch-1-now.d, * testsuite/ld-x86-64/bnd-ifunc-1-now.d, * testsuite/ld-x86-64/bnd-ifunc-2-now.d, * testsuite/ld-x86-64/bnd-ifunc-2.d, * testsuite/ld-x86-64/bnd-plt-1-now.d, * testsuite/ld-x86-64/bnd-plt-1.d, * testsuite/ld-x86-64/ibt-plt-1-x32.d, * testsuite/ld-x86-64/ibt-plt-1.d, * testsuite/ld-x86-64/ibt-plt-2a-x32.d, * testsuite/ld-x86-64/ibt-plt-2a.d, * testsuite/ld-x86-64/ibt-plt-2b-x32.d, * testsuite/ld-x86-64/ibt-plt-2b.d, * testsuite/ld-x86-64/ibt-plt-2c-x32.d, * testsuite/ld-x86-64/ibt-plt-2c.d, * testsuite/ld-x86-64/ibt-plt-2d-x32.d, * testsuite/ld-x86-64/ibt-plt-2d.d, * testsuite/ld-x86-64/ibt-plt-3a-x32.d, * testsuite/ld-x86-64/ibt-plt-3a.d, * testsuite/ld-x86-64/ibt-plt-3b-x32.d, * testsuite/ld-x86-64/ibt-plt-3b.d, * testsuite/ld-x86-64/ibt-plt-3c-x32.d, * testsuite/ld-x86-64/ibt-plt-3c.d, * testsuite/ld-x86-64/ibt-plt-3d-x32.d, * testsuite/ld-x86-64/ibt-plt-3d.d, * testsuite/ld-x86-64/ilp32-4-nacl.d, * testsuite/ld-x86-64/ilp32-4.d, * testsuite/ld-x86-64/load1c-nacl.d, * testsuite/ld-x86-64/load1c.d, * testsuite/ld-x86-64/load1d-nacl.d, * testsuite/ld-x86-64/load1d.d, * testsuite/ld-x86-64/mpx3n.dd, * testsuite/ld-x86-64/mpx4.dd, * testsuite/ld-x86-64/mpx4n.dd, * testsuite/ld-x86-64/plt2.dd, * testsuite/ld-x86-64/pr14207.d, * testsuite/ld-x86-64/pr19162.d, * testsuite/ld-x86-64/pr20253-1f.d, * testsuite/ld-x86-64/pr20253-1l.d, * testsuite/ld-x86-64/pr20830a-now.d, * testsuite/ld-x86-64/pr20830a.d, * testsuite/ld-x86-64/pr20830b-now.d, * testsuite/ld-x86-64/pr20830b.d, * testsuite/ld-x86-64/pr21038a-now.d, * testsuite/ld-x86-64/pr21038a.d, * testsuite/ld-x86-64/pr21038b-now.d, * testsuite/ld-x86-64/pr21038b.d, * testsuite/ld-x86-64/pr21038c-now.d, * testsuite/ld-x86-64/pr21038c.d, * testsuite/ld-x86-64/tlsbin-nacl.rd, * testsuite/ld-x86-64/tlsbin.rd, * testsuite/ld-x86-64/tlsbin2-nacl.rd, * testsuite/ld-x86-64/tlsbin2.rd, * testsuite/ld-x86-64/tlsbindesc-nacl.rd, * testsuite/ld-x86-64/tlsbindesc.rd, * testsuite/ld-x86-64/tlsdesc-nacl.rd, * testsuite/ld-x86-64/tlsdesc.rd, * testsuite/ld-x86-64/tlsgdesc-nacl.rd, * testsuite/ld-x86-64/tlsgdesc.rd, * testsuite/ld-x86-64/tlspic-nacl.rd, * testsuite/ld-x86-64/tlspic.rd, * testsuite/ld-x86-64/tlspic2-nacl.rd, * testsuite/ld-x86-64/tlspic2.rd: Update.
2018-04-09Support PLT16 relocs against local symbolsAlan Modra1-1/+1
Necessary if gcc is to use PLT16 relocs to implement -mlongcall, and there isn't a good technical reason why local symbols should be excluded from PLT16 support. Non-ifunc local symbol PLT entries go in a separate section to other PLT entries. In a fixed position executable they won't need to be relocated, and in a PIE or shared library I chose to not implement lazy relocation. bfd/ * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define. (struct ppc_stub_hash_entry): Add symtype field. (PLT_KEEP): Define. (struct ppc_link_hash_table): Add pltlocal and relpltlocal. (create_linkage_sections): Create pltlocal and relpltlocal. (ppc64_elf_check_relocs): Allow PLT relocs on local symbols. Set PLT_KEEP. (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls. (allocate_dynrelocs): Allocate pltlocal and relpltlocal. (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal. Keep PLT entries for inline calls against locals. (ppc_build_one_stub): Use pltlocal as appropriate. (ppc_size_one_stub): Likewise. (ppc64_elf_size_stubs): Set symtype. (build_global_entry_stubs_and_plt): Init pltlocal and write relpltlocal for globals. (write_plt_relocs_for_local_syms): Likewise for local syms. (ppc64_elf_relocate_section): Support PLT for local syms. * elf32-ppc.c (PLT_KEEP): Define. (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal. (ppc_elf_create_glink): Create pltlocal and relpltlocal. (ppc_elf_check_relocs): Allow PLT relocs on local symbols. Set PLT_KEEP. Adjust update_local_sym_info call. (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls. (allocate_dynrelocs): Allocate pltlocal and relpltlocal. (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal. (ppc_elf_relocate_section): Support PLT16 relocs for local syms. (write_global_sym_plt): Init pltlocal and write relpltlocal. (ppc_finish_symbols): Likewise for locals. ld/ * emulparams/elf32ppc.sh (OTHER_RELRO_SECTIONS_2): Add .branch_lt. (OTHER_GOT_RELOC_SECTIONS): Add .rela.branch_lt. * testsuite/ld-powerpc/elfv2so.d: Update for symbol/stub reordering. * testsuite/ld-powerpc/relbrlt.d: Likewise. * testsuite/ld-powerpc/relbrlt.s: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlstocso.r: Likewise. gold/ * powerpc.cc (Target_powerpc::lplt_): New variable. (Target_powerpc::lplt_section): Associated accessor. (Target_powerpc::plt_off): Handle local non-ifunc symbols. (Target_powerpc::make_lplt_section): New function. (Target_powerpc::make_local_plt_entry): New function. (Powerpc_relobj::do_relocate_sections): Write out lplt. (Output_data_plt_powerpc::first_plt_entry_offset): Zero for lplt. (Output_data_plt_powerpc::add_local_entry): New function. (Output_data_plt_powerpc::do_write): Ignore lplt. (Target_powerpc::make_iplt_section): Make lplt first. (Target_powerpc::make_brlt_section): Make .branch_lt relro. (Target_powerpc::Scan::local): Handle PLT16 relocs.
2017-11-07readelf ngettext fixesAlan Modra1-1/+1
This patch is a first pass at fixing readelf message pluralization. I've deliberately not fixed the "out of memory" errors since it's very unlikely that they will ever be complaining about not being able to allocate for a single entry, and a few others where the size is very unlikely to be 1 byte. Then there are messages like this one: "Out of %lu items there are %zu bucket clashes (longest of %zu entries).\n" I suppose this could be split into three parts, "Of %lu items ", "there are %zu bucket clashes ", and "(longest of %zu entries).\n", each part being printed separately, but that might not be ideal for sentence construction in other languages. For now I'm punting on this one. Changes to readelf output require lots of testsuite adjustment.. binutils/ * dwarf.c (read_uleb128): Properly pluralize messages. (display_debug_lines_raw, display_debug_loc): Likewise. (display_debug_names, process_cu_tu_index): Likewise. * od-macho.c (dump_code_signature_superblob): Likewise. * readelf.c (process_program_headers): Likewise. (process_section_header, process_relocs): Likewise. (hppa_process_unwind, arm_process_unwind): Likewise. (process_dynamic_section, process_version_sections): Likewise. (process_symbol_table, process_syminfo): Likewise. (apply_relocations, process_mips_specific): Likewise. (process_gnu_liblist, process_notes_at): Likewise. (process_archive): Likewise. * testsuite/binutils-all/dw2-1.W, * testsuite/binutils-all/dw2-3.W, * testsuite/binutils-all/dw2-3gabi.W, * testsuite/binutils-all/dw5.S, * testsuite/binutils-all/dw5.W, * testsuite/binutils-all/i386/compressed-1a.d, * testsuite/binutils-all/libdw2-compressedgabi.out, * testsuite/binutils-all/objdump.W, * testsuite/binutils-all/readelf.r, * testsuite/binutils-all/readelf.r-64, * testsuite/binutils-all/x86-64/compressed-1a.d: Update for pluralization fixes. gas/ * testsuite/gas/arm/got_prel.d, * testsuite/gas/elf/dwarf2-1.d, * testsuite/gas/elf/dwarf2-2.d, * testsuite/gas/elf/dwarf2-3.d, * testsuite/gas/elf/dwarf2-5.d, * testsuite/gas/elf/dwarf2-6.d, * testsuite/gas/i386/debug1.d, * testsuite/gas/i386/dw2-compress-1.d, * testsuite/gas/i386/dw2-compress-3a.d, * testsuite/gas/i386/dw2-compress-3b.d, * testsuite/gas/i386/dw2-compressed-1.d, * testsuite/gas/i386/dw2-compressed-3a.d, * testsuite/gas/i386/dw2-compressed-3b.d, * testsuite/gas/i386/ilp32/x86-64-localpic.d, * testsuite/gas/i386/localpic.d, * testsuite/gas/i386/x86-64-localpic.d, * testsuite/gas/ia64/pr13167.d, * testsuite/gas/mips/loc-swap-2.d, * testsuite/gas/mips/loc-swap.d, * testsuite/gas/mips/micromips@loc-swap-2.d, * testsuite/gas/mips/micromips@loc-swap.d, * testsuite/gas/mips/mips16-dwarf2-n32.d, * testsuite/gas/mips/mips16-dwarf2.d, * testsuite/gas/mips/mips16@loc-swap-2.d, * testsuite/gas/mips/mips16@loc-swap.d, * testsuite/gas/mips/mips16e@loc-swap.d, * testsuite/gas/mmix/bspec-1.d, * testsuite/gas/mmix/bspec-2.d, * testsuite/gas/tic6x/unwind-1.d, * testsuite/gas/tic6x/unwind-2.d, * testsuite/gas/tic6x/unwind-3.d: Update for pluralization fixes. ld/ * testsuite/ld-aarch64/ifunc-13.d, * testsuite/ld-aarch64/ifunc-15.d, * testsuite/ld-aarch64/ifunc-20.d, * testsuite/ld-alpha/tlsbin.rd, * testsuite/ld-alpha/tlspic.rd, * testsuite/ld-arm/ifunc-3.rd, * testsuite/ld-arm/ifunc-9.rd, * testsuite/ld-arm/unwind-mix.d, * testsuite/ld-arm/unwind-rel.d, * testsuite/ld-cris/hiddef1.d, * testsuite/ld-cris/libdso-13.d, * testsuite/ld-cris/libdso-2.d, * testsuite/ld-cris/pr16044.d, * testsuite/ld-cris/tls-local-63.d, * testsuite/ld-cris/tls-local-64.d, * testsuite/ld-cris/tls-und-38.d, * testsuite/ld-cris/tls-und-42.d, * testsuite/ld-cris/tls-und-46.d, * testsuite/ld-cris/tls-und-50.d, * testsuite/ld-cris/weakref3.d, * testsuite/ld-cris/weakref4.d, * testsuite/ld-elf/comm-data2r.rd, * testsuite/ld-elf/discard1.d, * testsuite/ld-elf/discard2.d, * testsuite/ld-elf/pr19539.d, * testsuite/ld-elf/pr22374-1.r, * testsuite/ld-elf/pr22374-2.r, * testsuite/ld-i386/combreloc.d, * testsuite/ld-i386/emit-relocs-nacl.rd, * testsuite/ld-i386/emit-relocs.rd, * testsuite/ld-i386/pr13302.d, * testsuite/ld-i386/pr17709-nacl.rd, * testsuite/ld-i386/pr17709.rd, * testsuite/ld-i386/pr19539.d, * testsuite/ld-i386/pr19615.d, * testsuite/ld-i386/pr19636-1a.d, * testsuite/ld-i386/pr19636-1e.d, * testsuite/ld-i386/pr19636-1f.d, * testsuite/ld-i386/pr19636-2a.d, * testsuite/ld-i386/pr19636-2b.d, * testsuite/ld-i386/pr19636-2d-nacl.d, * testsuite/ld-i386/pr19636-2e-nacl.d, * testsuite/ld-i386/pr19636-3a.d, * testsuite/ld-i386/pr19636-3d.d, * testsuite/ld-i386/pr19636-3e.d, * testsuite/ld-i386/pr19636-4a.d, * testsuite/ld-i386/pr19645.d, * testsuite/ld-i386/pr19827-nacl.rd, * testsuite/ld-i386/pr19827.rd, * testsuite/ld-i386/pr20253-4a.d, * testsuite/ld-i386/pr20253-4b.d, * testsuite/ld-i386/pr20253-5.d, * testsuite/ld-i386/tlsbin-nacl.rd, * testsuite/ld-i386/tlsbin.rd, * testsuite/ld-i386/tlspic-nacl.rd, * testsuite/ld-i386/tlspic.rd, * testsuite/ld-i386/undefweakb.d, * testsuite/ld-ia64/tlsbin.rd, * testsuite/ld-ia64/tlspic.rd, * testsuite/ld-ifunc/ifunc-13-i386.d, * testsuite/ld-ifunc/ifunc-13-x86-64.d, * testsuite/ld-ifunc/ifunc-15-i386.d, * testsuite/ld-ifunc/ifunc-15-x86-64.d, * testsuite/ld-ifunc/ifunc-20-i386.d, * testsuite/ld-ifunc/ifunc-20-x86-64.d, * testsuite/ld-ifunc/ifunc-23a-x86.d, * testsuite/ld-ifunc/ifunc-23b-x86.d, * testsuite/ld-ifunc/ifunc-23c-x86.d, * testsuite/ld-ifunc/ifunc-24a-x86.d, * testsuite/ld-ifunc/ifunc-24b-x86.d, * testsuite/ld-ifunc/ifunc-24c-x86.d, * testsuite/ld-ifunc/ifunc-25a-x86.d, * testsuite/ld-ifunc/ifunc-25b-x86.d, * testsuite/ld-ifunc/ifunc-25c-x86.d, * testsuite/ld-m68k/got-1.d, * testsuite/ld-mips-elf/vxworks1.rd, * testsuite/ld-powerpc/ambiguousv1.d, * testsuite/ld-powerpc/ambiguousv1b.d, * testsuite/ld-powerpc/ambiguousv2.d, * testsuite/ld-powerpc/ambiguousv2b.d, * testsuite/ld-powerpc/tlsexe.r, * testsuite/ld-powerpc/tlsexe32.r, * testsuite/ld-powerpc/tlsexetoc.r, * testsuite/ld-powerpc/tlsso.r, * testsuite/ld-powerpc/tlsso32.r, * testsuite/ld-powerpc/tlstocso.r, * testsuite/ld-powerpc/vle-multiseg-1.d, * testsuite/ld-powerpc/vle-multiseg-2.d, * testsuite/ld-powerpc/vle-multiseg-3.d, * testsuite/ld-s390/tlsbin.rd, * testsuite/ld-s390/tlsbin_64.rd, * testsuite/ld-s390/tlspic.rd, * testsuite/ld-s390/tlspic_64.rd, * testsuite/ld-sh/ld-r-1.d, * testsuite/ld-sh/sh64/gotplt.d, * testsuite/ld-sh/shared-1.d, * testsuite/ld-sh/tlsbin-2.d, * testsuite/ld-sh/tlspic-2.d, * testsuite/ld-sparc/gotop32.rd, * testsuite/ld-sparc/gotop64.rd, * testsuite/ld-sparc/tlssunpic32.rd, * testsuite/ld-sparc/tlssunpic64.rd, * testsuite/ld-sparc/vxworks1-lib.rd, * testsuite/ld-tic6x/shlib-app-1.rd, * testsuite/ld-tic6x/shlib-app-1b.rd, * testsuite/ld-tic6x/shlib-app-1r.rd, * testsuite/ld-tic6x/shlib-app-1rb.rd, * testsuite/ld-tic6x/shlib-noindex.rd, * testsuite/ld-vax-elf/export-class-data.rd, * testsuite/ld-x86-64/pr13082-1a.d, * testsuite/ld-x86-64/pr13082-1b.d, * testsuite/ld-x86-64/pr13082-2a.d, * testsuite/ld-x86-64/pr13082-2b.d, * testsuite/ld-x86-64/pr13082-3a.d, * testsuite/ld-x86-64/pr13082-3c.d, * testsuite/ld-x86-64/pr13082-4a.d, * testsuite/ld-x86-64/pr13082-5a.d, * testsuite/ld-x86-64/pr13082-5b.d, * testsuite/ld-x86-64/pr13082-6a.d, * testsuite/ld-x86-64/pr13082-6b.d, * testsuite/ld-x86-64/pr17709-nacl.rd, * testsuite/ld-x86-64/pr17709.rd, * testsuite/ld-x86-64/pr19539a.d, * testsuite/ld-x86-64/pr19539b.d, * testsuite/ld-x86-64/pr19615.d, * testsuite/ld-x86-64/pr19636-1a.d, * testsuite/ld-x86-64/pr19636-1d.d, * testsuite/ld-x86-64/pr19636-1e.d, * testsuite/ld-x86-64/pr19636-2a.d, * testsuite/ld-x86-64/pr19636-2e.d, * testsuite/ld-x86-64/pr19636-2f.d, * testsuite/ld-x86-64/pr19636-3a.d, * testsuite/ld-x86-64/pr19645.d, * testsuite/ld-x86-64/pr19807-2b.d, * testsuite/ld-x86-64/pr19807-2d.d, * testsuite/ld-x86-64/pr19827-nacl.rd, * testsuite/ld-x86-64/pr19827.rd, * testsuite/ld-x86-64/pr20253-4a.d, * testsuite/ld-x86-64/pr20253-4b.d, * testsuite/ld-x86-64/pr20253-4d.d, * testsuite/ld-x86-64/pr20253-4e.d, * testsuite/ld-x86-64/pr20253-5a.d, * testsuite/ld-x86-64/pr20253-5b.d, * testsuite/ld-x86-64/tlsbin-nacl.rd, * testsuite/ld-x86-64/tlsbin.rd, * testsuite/ld-x86-64/tlspic-nacl.rd, * testsuite/ld-x86-64/tlspic.rd, * testsuite/ld-x86-64/tlspic2-nacl.rd: Update for pluralization fixes.
2016-08-19Place .shstrtab section after .symtab and .strtab, thus restoring ↵Nick Clifton1-1/+1
monotonically increasing section offsets. bfd * elf.c (assign_section_numbers): Assign number for the .shstrtab section after the symbol table and string table sections. binutils * testsuite/binutils-all/readelf.s: Adjust expected ordering of sections. * testsuite/binutils-all/readelf.s-64: Likewise. gas * testsuite/gas/i386/ilp32/x86-64-unwind.d: Adjust expected ordering of sections. * testsuite/gas/i386/x86-64-unwind.d: Likewise. * testsuite/gas/ia64/alias-ilp32.d: Likewise. * testsuite/gas/ia64/alias.d: Likewise. * testsuite/gas/ia64/group-1.d: Likewise. * testsuite/gas/ia64/group-2.d: Likewise. * testsuite/gas/ia64/secname-ilp32.d: Likewise. * testsuite/gas/ia64/secname.d: Likewise. * testsuite/gas/ia64/unwind-ilp32.d: Likewise. * testsuite/gas/ia64/unwind.d: Likewise. * testsuite/gas/ia64/xdata-ilp32.d: Likewise. * testsuite/gas/ia64/xdata.d: Likewise. * testsuite/gas/mmix/bspec-1.d: Likewise. * testsuite/gas/mmix/bspec-2.d: Likewise. * testsuite/gas/mmix/byte-1.d: Likewise. * testsuite/gas/mmix/loc-1.d: Likewise. * testsuite/gas/mmix/loc-2.d: Likewise. * testsuite/gas/mmix/loc-3.d: Likewise. * testsuite/gas/mmix/loc-4.d: Likewise. * testsuite/gas/mmix/loc-5.d: Likewise. * testsuite/gas/tic6x/scomm-directive-4.d: Likewise. ld * testsuite/ld-alpha/tlsbin.rd: Adjust expected ordering of sections. * testsuite/ld-alpha/tlsbinr.rd: Likewise. * testsuite/ld-alpha/tlspic.rd: Likewise. * testsuite/ld-cris/libdso-2.d: Likewise. * testsuite/ld-i386/nogot1.d: Likewise. * testsuite/ld-i386/pr12718.d: Likewise. * testsuite/ld-i386/pr12921.d: Likewise. * testsuite/ld-i386/tlsbin-nacl.rd: Likewise. * testsuite/ld-i386/tlsbin.rd: Likewise. * testsuite/ld-i386/tlsbin2-nacl.rd: Likewise. * testsuite/ld-i386/tlsbin2.rd: Likewise. * testsuite/ld-i386/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsbindesc.rd: Likewise. * testsuite/ld-i386/tlsdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsdesc.rd: Likewise. * testsuite/ld-i386/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-i386/tlsgdesc.rd: Likewise. * testsuite/ld-i386/tlsnopic-nacl.rd: Likewise. * testsuite/ld-i386/tlsnopic.rd: Likewise. * testsuite/ld-i386/tlspic-nacl.rd: Likewise. * testsuite/ld-i386/tlspic.rd: Likewise. * testsuite/ld-i386/tlspic2-nacl.rd: Likewise. * testsuite/ld-i386/tlspic2.rd: Likewise. * testsuite/ld-ia64/tlsbin.rd: Likewise. * testsuite/ld-ia64/tlspic.rd: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-10.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-50.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-60.d: Likewise. * testsuite/ld-mips-elf/attr-gnu-4-70.d: Likewise. * testsuite/ld-mmix/bspec1.d: Likewise. * testsuite/ld-mmix/bspec2.d: Likewise. * testsuite/ld-mmix/local1.d: Likewise. * testsuite/ld-mmix/local3.d: Likewise. * testsuite/ld-mmix/local5.d: Likewise. * testsuite/ld-mmix/local7.d: Likewise. * testsuite/ld-mmix/undef-3.d: Likewise. * testsuite/ld-powerpc/tlsexe.r: Likewise. * testsuite/ld-powerpc/tlsexe32.r: Likewise. * testsuite/ld-powerpc/tlsexetoc.r: Likewise. * testsuite/ld-powerpc/tlsso.r: Likewise. * testsuite/ld-powerpc/tlsso32.r: Likewise. * testsuite/ld-powerpc/tlstocso.r: Likewise. * testsuite/ld-s390/tlsbin.rd: Likewise. * testsuite/ld-s390/tlsbin_64.rd: Likewise. * testsuite/ld-s390/tlspic.rd: Likewise. * testsuite/ld-s390/tlspic_64.rd: Likewise. * testsuite/ld-sh/sh64/crange1.rd: Likewise. * testsuite/ld-sh/sh64/crange2.rd: Likewise. * testsuite/ld-sh/sh64/crange3-cmpct.rd: Likewise. * testsuite/ld-sh/sh64/crange3-media.rd: Likewise. * testsuite/ld-sh/sh64/crange3.rd: Likewise. * testsuite/ld-sh/sh64/crangerel1.rd: Likewise. * testsuite/ld-sh/sh64/crangerel2.rd: Likewise. * testsuite/ld-sh/tlsbin-2.d: Likewise. * testsuite/ld-sh/tlspic-2.d: Likewise. * testsuite/ld-sparc/gotop32.rd: Likewise. * testsuite/ld-sparc/gotop64.rd: Likewise. * testsuite/ld-sparc/tlssunbin32.rd: Likewise. * testsuite/ld-sparc/tlssunbin64.rd: Likewise. * testsuite/ld-sparc/tlssunnopic32.rd: Likewise. * testsuite/ld-sparc/tlssunnopic64.rd: Likewise. * testsuite/ld-sparc/tlssunpic32.rd: Likewise. * testsuite/ld-sparc/tlssunpic64.rd: Likewise. * testsuite/ld-tic6x/common.d: Likewise. * testsuite/ld-tic6x/shlib-1.rd: Likewise. * testsuite/ld-tic6x/shlib-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise. * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise. * testsuite/ld-tic6x/shlib-noindex.rd: Likewise. * testsuite/ld-tic6x/static-app-1.rd: Likewise. * testsuite/ld-tic6x/static-app-1b.rd: Likewise. * testsuite/ld-tic6x/static-app-1r.rd: Likewise. * testsuite/ld-tic6x/static-app-1rb.rd: Likewise. * testsuite/ld-x86-64/ilp32-4-nacl.d: Likewise. * testsuite/ld-x86-64/ilp32-4.d: Likewise. * testsuite/ld-x86-64/nogot1.d: Likewise. * testsuite/ld-x86-64/pr12718.d: Likewise. * testsuite/ld-x86-64/pr12921.d: Likewise. * testsuite/ld-x86-64/split-by-file-nacl.rd: Likewise. * testsuite/ld-x86-64/split-by-file.rd: Likewise. * testsuite/ld-x86-64/tlsbin-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin.rd: Likewise. * testsuite/ld-x86-64/tlsbin2-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbin2.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc.rd: Likewise. * testsuite/ld-x86-64/tlsdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsdesc.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc-nacl.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc.rd: Likewise. * testsuite/ld-x86-64/tlspic-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic.rd: Likewise. * testsuite/ld-x86-64/tlspic2-nacl.rd: Likewise. * testsuite/ld-x86-64/tlspic2.rd: Likewise. * testsuite/ld-xtensa/tlsbin.rd: Likewise. * testsuite/ld-xtensa/tlspic.rd: Likewise.
2015-04-23Align .TOC. for PowerPC64Alan Modra1-1/+1
This change, with prerequisite 0e5fabeb, provides a toc base aligned to 256 bytes rather than 8 bytes. This is necessary for a minor gcc optimisation, allowing use of d-form instructions to correctly access toc-relative items larger than 8 bytes. bfd/ * elf64-ppc.c (TOC_BASE_ALIGN): Define. (ppc64_elf_next_toc_section): Align multi-got toc base. (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol. ld/ * emulparams/elf64ppc.sh (GOT): Align. ld/testsuite/ * ld-powerpc/ambiguousv1b.d: Update for aligned .got. * ld-powerpc/defsym.d: Likewise. * ld-powerpc/elfv2-2exe.d: Likewise. * ld-powerpc/elfv2exe.d: Likewise. * ld-powerpc/elfv2so.d: Likewise. * ld-powerpc/relbrlt.d: Likewise. * ld-powerpc/tls.g: Likewise. * ld-powerpc/tlsexe.d: Likewise. * ld-powerpc/tlsexe.g: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.d: Likewise. * ld-powerpc/tlsexetoc.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstoc.g: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tocopt.d: Likewise. * ld-powerpc/tocopt2.d: Likewise. * ld-powerpc/tocopt3.d: Likewise. * ld-powerpc/tocopt4.d: Likewise. * ld-powerpc/tocopt5.d: Likewise.
2015-02-19Strip undefined symbols from .symtabAlan Modra1-1/+0
bfd/ PR ld/4317 * elflink.c (elf_link_input_bfd): Drop undefined local syms. (elf_link_output_extsym): Drop local and global undefined syms. Tidy. Expand comment. ld/testsuite/ PR ld/4317 * ld-aarch64/gc-tls-relocs.d, * ld-cris/locref2.d, * ld-elf/ehdr_start-weak.d, * ld-elf/group1.d, * ld-i386/compressed1.d, * ld-ia64/error1.d, * ld-ia64/error2.d, * ld-ia64/error3.d, * ld-mips-elf/pic-and-nonpic-1.nd, * ld-mmix/undef-3.d, * ld-powerpc/tlsexe.r, * ld-powerpc/tlsexetoc.r, * ld-powerpc/tlsso.r, * ld-powerpc/tlstocso.r, * ld-x86-64/compressed1.d, * ld-x86-64/pie1.d: Update.
2015-02-18Properly place the NULL STT_FILE symbol revistitedAlan Modra1-1/+1
I was having a little closer look at what is going on here and noticed that HJ unconditionally emits a NULL STT_FILE symbol before emitting forced local symbols. That means we really don't need a second pass over forced local symbols. The only reason for two passes is when some forced local symbol can be emitted before the NULL STT_FILE. So I set about removing the second pass, updating the testsuite all over again. It's also unnecessary to emit the NULL STT_FILE when no previous file symbol has been emitted. bfd/ PR ld/17975 * elflink.c (struct elf_outext_info): Remove need_second_pass and second_pass. (elf_link_output_extsym): Delete code handling second forced local pass. Move code emitting NULL STT_FILE symbol later, so that it can be omitted if forced local is stripped. Don't emit the NULL STT_FILE if no file symbols have been output. (bfd_elf_final_link): Remove second forced local pass. * elf32-ppc.c (add_stub_sym): Set linker_def on linker syms. (ppc_elf_size_dynamic_sections): Likewise. * elf64-ppc.c (ppc_build_one_stub): Likewise. (build_global_entry_stubs): Likewise. (ppc64_elf_build_stubs): Likewise. ld/testsuite/ PR ld/17975 * ld-aarch64/gc-tls-relocs.d, * ld-alpha/tlspic.rd, * ld-cris/libdso-2.d, * ld-i386/tlsdesc-nacl.rd, * ld-i386/tlsdesc.rd, * ld-i386/tlsnopic-nacl.rd, * ld-i386/tlsnopic.rd, * ld-i386/tlspic-nacl.rd, * ld-i386/tlspic.rd, * ld-ia64/tlspic.rd, * ld-powerpc/tlsexe.r, * ld-powerpc/tlsexetoc.r, * ld-powerpc/tlsso.r, * ld-powerpc/tlstocso.r, * ld-s390/tlspic.rd, * ld-s390/tlspic_64.rd, * ld-sparc/tlssunnopic32.rd, * ld-sparc/tlssunnopic64.rd, * ld-sparc/tlssunpic32.rd, * ld-sparc/tlssunpic64.rd, * ld-tic6x/shlib-1.rd, * ld-tic6x/shlib-1b.rd, * ld-tic6x/shlib-1r.rd, * ld-tic6x/shlib-1rb.rd, * ld-tic6x/shlib-noindex.rd, * ld-x86-64/tlsdesc-nacl.rd, * ld-x86-64/tlsdesc.rd, * ld-x86-64/tlspic-nacl.rd, * ld-x86-64/tlspic.rd: Update.
2015-02-16Update more ld testcases after PR ld/17975 fixH.J. Lu1-2/+2
* ld-alpha/tlspic.rd: Updated. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-sparc/gotop32.dd: Likewise. * ld-sparc/gotop64.dd: Likewise. * ld-sparc/tlssunnopic32.rd: Likewise. * ld-sparc/tlssunnopic64.rd: Likewise. * ld-sparc/tlssunpic32.rd: Likewise. * ld-sparc/tlssunpic64.rd: Likewise. * ld-tic6x/shlib-1.rd: Likewise. * ld-tic6x/shlib-1b.rd: Likewise. * ld-tic6x/shlib-1r.rd: Likewise. * ld-tic6x/shlib-1rb.rd: Likewise. * ld-tic6x/shlib-noindex.rd: Likewise.
2015-01-20Reorder more powerpc64 sections for -z relroAlan Modra1-2/+2
This moves .got too, which requires .sdata and .sbss to move with it, because these sections share addressing via the toc pointer and with small-model code must be within a 16-bit signed offset. .plt, .iplt and .branch_lt must also be moved since they are addressed via a 32-bit offset from the toc pointer, and we might have a very large .data section. This change means we may have some bss style sections before the data segment, necessitating another PT_LOAD header. Also, since _edata is defined at the end of the data segment it's possible with an empty .data to have _edata at the end of .plt which looks a little unusual since .plt is a bss style section. That should only happen rarely in real world binaries, but does occur in the ld testsuite. ld/ * emulparams/elf64ppc.sh (BSS_PLT): Don't define. (OTHER_READWRITE_SECTIONS): Move .branch_lt to.. (OTHER_RELRO_SECTIONS_2): ..here. (DATA_GOT, SEPARATE_GOTPLT, DATA_SDATA, DATA_PLT, PLT_BEFORE_GOT): Define. * scripttempl/elf.sc: Handle DATA_SDATA and DATA_GOT/DATA_PLT/ PLT_BEFORE_GOT combination. (DATA_GOT, SDATA_GOT): Don't define if either is already defined. ld/testsuite/ * ld-powerpc/ambiguousv1.d, * ld-powerpc/ambiguousv1b.d, * ld-powerpc/ambiguousv2.d, * ld-powerpc/ambiguousv2b.d, * ld-powerpc/elfv2exe.d, * ld-powerpc/elfv2so.d, * ld-powerpc/tlsexe.r, * ld-powerpc/tlsexetoc.r, * ld-powerpc/tlsso.r, * ld-powerpc/tlstocso.r: Update.
2013-10-30Change plt stubs to have destination in r12.Alan Modra1-28/+32
This change is to support the new ELFv2 ABI, which uses the value in r12 on function entry to calculate the got/toc pointer. bfd/ * elf64-ppc.c (build_plt_stub): Switch stubs to use r11 as base reg and r12 as destination. (ppc_build_one_stub): Likewise. (ppc64_elf_build_stubs): Likewise for glink. ld/testsuite/ * ld-powerpc/tls.s: Add proper .opd entry for _start. * ld-powerpc/tlstoc.s: Likewise. * ld-powerpc/relbrlt.d: Update for changed stubs. * ld-powerpc/tls.d: Update for changed stubs and _start .opd entry. * ld-powerpc/tls.g: Likewise. * ld-powerpc/tlsexe.d: Likewise. * ld-powerpc/tlsexe.g: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.d: Likewise. * ld-powerpc/tlsexetoc.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstoc.d: Likewise. * ld-powerpc/tlstoc.g: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-powerpc/tlstocso.r: Likewise.
2013-04-22bfd/Alan Modra1-1/+1
* elf64-ppc.c (ppc64_elf_check_relocs): Don't call create_linkage_sections here.. (ppc64_elf_init_stub_bfd): ..do so here. Return status. (create_linkage_sections): Move earlier in file. (ppc64_elf_setup_section_lists): Remove now useless htab->brlt test. * elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto. ld/ * emultempl/ppc64elf.em (ppc_create_output_section_statements): Check return from ppc64_elf_init_stub_bfd. ld/testsuite/ * ld-powerpc/tlsexe.d: Adjust. * ld-powerpc/tlsexe.r: Adjust. * ld-powerpc/tlsexetoc.d: Adjust. * ld-powerpc/tlsexetoc.r: Adjust. * ld-powerpc/tlsso.d: Adjust. * ld-powerpc/tlsso.r: Adjust. * ld-powerpc/tlstocso.d: Adjust. * ld-powerpc/tlstocso.r: Adjust.
2013-01-31bfd/Alan Modra1-1/+1
* elf64-ppc.c (ppc_stub_name): Trim off trailing "+0". ld/testsuite/ * ld-powerpc/tlsexe.d: Update for changed stub names. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.d: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.r: Likewise.
2013-01-15bfd/Alan Modra1-3/+3
* elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to plt-thread-safe. gold/ * powerpc.cc (Target_powerpc::do_relax): Default shared libs to plt-thread-safe. ld/testsuite/ * ld-powerpc/tlsso.d: Adjust for plt-thread-safe stubs. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.g: Likewise.
2012-10-29 * ld-powerpc/powerpc.exp: Modify emulation option passed to ldAlan Modra1-1/+1
when little-endian. * ld-powerpc/apuinfo-nul.rd: Update for le output. * ld-powerpc/apuinfo.rd: Likewise. * ld-powerpc/plt1.d: Likewise. * ld-powerpc/relax.d: Likewise. * ld-powerpc/relaxr.d: Likewise. * ld-powerpc/sdadyn.d: Likewise. * ld-powerpc/tls.d: Likewise. * ld-powerpc/tls.g: Likewise. * ld-powerpc/tls.t: Likewise. * ld-powerpc/tls32.d: Likewise. * ld-powerpc/tls32.g: Likewise. * ld-powerpc/tls32.t: Likewise. * ld-powerpc/tlsexe.d: Likewise. * ld-powerpc/tlsexe.g: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexe.t: Likewise. * ld-powerpc/tlsexe32.d: Likewise. * ld-powerpc/tlsexe32.g: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexe32.t: Likewise. * ld-powerpc/tlsexetoc.d: Likewise. * ld-powerpc/tlsexetoc.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsexetoc.t: Likewise. * ld-powerpc/tlsmark.d: Likewise. * ld-powerpc/tlsmark32.d: Likewise. * ld-powerpc/tlsopt1.d: Likewise. * ld-powerpc/tlsopt1_32.d: Likewise. * ld-powerpc/tlsopt2.d: Likewise. * ld-powerpc/tlsopt2_32.d: Likewise. * ld-powerpc/tlsopt3.d: Likewise. * ld-powerpc/tlsopt3_32.d: Likewise. * ld-powerpc/tlsopt4.d: Likewise. * ld-powerpc/tlsopt4_32.d: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.t: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlstoc.d: Likewise. * ld-powerpc/tlstoc.g: Likewise. * ld-powerpc/tlstoc.t: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-powerpc/tlstocso.t: Likewise. * ld-powerpc/tocopt.out: Likewise.
2012-06-15ld/Alan Modra1-6/+6
* ldlang.h (lang_output_section_statement_type): Add after_end field. (lang_abs_symbol_at_beginning_of, lang_abs_symbol_at_end_of): Delete. (section_for_dot): Declare. * ldlang.c (lang_size_sections_1): Correct comment. (current_section): Move earlier. (current_assign, prefer_next_section): New static vars. (lang_do_assignments_1): Add found_end param. Detect _end assignment to set found_end. Set os->after_end. Set above statics. (lang_do_assignments): Adjust lang_do_assignments_1 call. Init vars. (section_for_dot): New function. (lang_set_startof): Don't make an absolute symbol. (lang_abs_symbol_at_beginning_of, lang_abs_symbol_at_end_of): Delete. * ldexp.c (new_rel_from_abs): Use section_for_dot. * emultempl/lnk960.em (symbol_at_beginning_of): New function. (symbol_at_end_of): Likewise. (lnk960_after_allocation): Use them. * scripttempl/elf.sc: Precede OTHER_GOT_SYMBOLS with . = .; and likewise before __bss_start. ld/testsuite/ Update far too many tests.
2012-06-06bfd/Alan Modra1-1/+3
* elflink.c (elf_link_input_bfd): Provide a file symbol for each input file with local syms, if the input lacks such. (bfd_elf_final_link): Add a file symbol to mark end of locals for which we can associate with input files. (struct elf_final_link_info): Add filesym_count field. (struct elf_outext_info): Add need_second_pass and second_pass. (elf_link_output_extsym): Detect symbols defined in the output file, emit them on second pass over locals. ld/testsuite/ Update to suit added STT_FILE symbols.
2012-05-17bfd/Alan Modra1-1/+1
* elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make _DYNAMIC, _GLOBAL_OFFSET_TABLE_ or _PROCEDURE_LINKAGE_TABLE_ absolute. * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Don't make _DYNAMIC absolute. ld/testsuite/ * ld-powerpc/tlsso.r: Update for dynamic sym changes. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise.
2012-05-12Adjust testcases for readelf addend changeH.J. Lu1-4/+4
gas/testsuite/ * gas/mips/elf-rel10.d: Updated. * gas/mips/elf-rel22.d: Likewise. * gas/mmix/comment-1.d: Likewise. ld/testsuite/ * ld-alpha/tlspic.rd: Updated. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/vxworks1-lib.rd: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-sh/shared-1.d: Likewise. * ld-sh/tlspic-2.d: Likewise. * ld-sparc/tlssunnopic32.rd: Likewise. * ld-sparc/tlssunnopic64.rd: Likewise. * ld-sparc/tlssunpic32.rd: Likewise. * ld-sparc/tlssunpic64.rd: Likewise.
2011-10-10ld/Alan Modra1-3/+3
* emultempl/ppc64elf.em (ppc_add_stub_section): Align to 32 bytes. ld/testsuite/ * ld-powerpc/relbrlt.d: Update for stub alignment change. * ld-powerpc/tlsexe.g: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsso.r: Likewise.
2011-08-05bfd/Alan Modra1-3/+1
* elf64-ppc.c (maybe_strip_output): New function. (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame. ld/testsuite/ * ld-powerpc/tlsexe.r: Update for stripped .branch_lt. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.r: Likewise.
2010-07-20include/elf/Alan Modra1-1/+1
* internal.h (ELF_TBSS_SPECIAL): New macro, extracted from.. (ELF_SECTION_SIZE): ..here. (ELF_SECTION_IN_SEGMENT_1): Add "strict" arg. (ELF_SECTION_IN_SEGMENT_STRICT): New macro. bfd/ * elf.c (assign_file_positions_for_load_sections): Check that zero size sections are allocated in segments too. (assign_file_positions_for_non_load_sections): Warn if zero size alloc sections are found here. (copy_elf_program_header): Don't drop zero size sections from segment map. (copy_private_bfd_data): Check for changes in zero size sections. binutils/ * readelf.c (process_program_headers): Don't ignore all zero size sections. ld/testsuite/ * ld-powerpc/tlsexe.r: Update. * ld-powerpc/tlsexetoc.r: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.r: Update.
2009-10-02ld/Alan Modra1-0/+2
* emultempl/ppc32elf.em (emit_stub_syms): Init to -1. (ppc_after_open): Set emit_stubs_syms by default when shared. (OPTION_NO_STUBSYMS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Handle --no-emit-stub-syms. * emultempl/ppc64elf.em (emit_stub_syms): Init to -1. (gld${EMULATION_NAME}_finish): Set emit_stubs_syms by default. (OPTION_NO_STUBSYMS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Handle --no-emit-stub-syms. ld/testsuite/ * ld-powerpc/tlsexe.d: Update. * ld-powerpc/tlsexe.r: Update. * ld-powerpc/tlsexetoc.d: Update. * ld-powerpc/tlsexetoc.r: Update. * ld-powerpc/tlsso.d: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.d: Update. * ld-powerpc/tlstocso.r: Update.
2009-09-24bfd/H.J. Lu1-1/+1
2009-09-24 H.J. Lu <hongjiu.lu@intel.com> PR ld/10630 * elflink.c (elf_link_output_extsym): Turn off visibility on local symbol. (bfd_elf_final_link): Turn off visibility on dynamic local symbol. ld/testsuite/ 2009-09-24 H.J. Lu <hongjiu.lu@intel.com> PR ld/10630 * ld-alpha/tlsbin.rd: Remove HIDDEN/.hidden on local symbols. * ld-alpha/tlsbinr.rd: Likewise. * ld-alpha/tlspic.rd: Likewise. * ld-cris/libdso-2.d: Likewise. * ld-cris/locref1.d: Likewise. * ld-cris/locref2.d: Likewise. * ld-cris/tls-e-20a.d: Likewise. * ld-cris/tls-e-20.d: Likewise. * ld-cris/tls-e-80.d: Likewise. * ld-cris/tls-gc-68.d: Likewise. * ld-cris/tls-gc-69.d: Likewise. * ld-cris/tls-gc-70.d: Likewise. * ld-cris/tls-gc-75.d: Likewise. * ld-cris/tls-gc-76.d: Likewise. * ld-cris/tls-gc-79.d: Likewise. * ld-cris/tls-gd-1h.d: Likewise. * ld-cris/tls-gd-2h.d: Likewise. * ld-cris/tls-ld-4.d: Likewise. * ld-cris/tls-ld-5.d: Likewise. * ld-cris/tls-ld-6.d: Likewise. * ld-cris/tls-ld-7.d: Likewise. * ld-cris/tls-ldgd-14.d: Likewise. * ld-cris/tls-ldgd-15.d: Likewise. * ld-cris/tls-local-63.d: Likewise. * ld-cris/tls-local-64.d: Likewise. * ld-elf/pr9676.rd: Likewise. * ld-elf/pr9679.rd: Likewise. * ld-elfvsb/hidden2.d: Likewise. * ld-i386/tlsbindesc.rd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsdesc.rd: Likewise. * ld-i386/tlsgdesc.rd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlspic.rd: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-sparc/gotop32.rd: Likewise. * ld-sparc/gotop64.rd: Likewise. * ld-sparc/tlssunbin32.rd: Likewise. * ld-sparc/tlssunbin64.rd: Likewise. * ld-sparc/tlssunnopic32.rd: Likewise. * ld-sparc/tlssunnopic64.rd: Likewise. * ld-sparc/tlssunpic32.rd: Likewise. * ld-sparc/tlssunpic64.rd: Likewise. * ld-x86-64/tlsbindesc.rd: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-x86-64/tlsdesc.rd: Likewise. * ld-x86-64/tlsgdesc.rd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-xtensa/tlsbin.rd: Likewise. * ld-xtensa/tlspic.rd: Likewise. * ld-elf/local1.d: New. * ld-elf/local1.map: Likewise. * ld-elf/local1.s: Likewise. * ld-ia64/local1.d: Likewise. * ld-ia64/local1.map: Likewise. * ld-ia64/local1.s: Likewise.
2009-09-23Tolerate some whitespace differences in readelf output.Alan Modra1-44/+44
2009-09-18bfd/Alan Modra1-1/+1
* elf64-ppc.c (follow_link, elf_follow_link, ppc_follow_link): New functions. Use throughout. (ppc64_elf_copy_indirect_symbol): Set direct symbol "oh" field from indirect symbol. (lookup_fdh): Rename from get_fdh. Follow indirect sym links. (add_symbol_adjust): Simplify. (defined_code_entry, defined_func_desc): New functions. (ppc64_elf_gc_keep): Follow indirect sym links. Use defined_code_entry. (ppc64_elf_gc_mark_dynamic_ref): Use defined_func_desc and defined_code_entry to follow indirect sym links. (ppc64_elf_gc_mark_hook, func_desc_adjust): Likewise. (ppc_type_of_stub): Follow indirect sym links. (toc_adjusting_stub_needed): Likewise. (ppc_build_one_stub): Likewise. Make undefined dot-symbols weak rather than defining them at stub. (ppc64_elf_relocate_section): Rewrite call test to avoid multiple assignments in test. ld/testsuite/ * ld-powerpc/tlsso.d: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.d: Update. * ld-powerpc/tlstocso.r: Update.
2007-11-06bfd/Alan Modra1-1/+1
* elf64-ppc.c (ppc64_elf_check_relocs): Don't refcount tlsld_got here.. (ppc64_elf_gc_sweep_hook): ..or here.. (ppc64_elf_tls_optimize): ..or here. Make two passes through the relocs, ensuring that tls_get_addr calls follow gd and ld relocs. (allocate_dynrelocs): Refcount tlsld_got here. (ppc64_elf_size_dynamic_sections): Allocate local got and call allocate_dynrelocs before allocating tlsld_got. (ppc64_elf_relocate_section): Remove check that a tls_get_addr call follows gd and ld relocs. ld/testsuite/ * ld-powerpc/tlsso.d: Update for changed got alloc order. * ld-powerpc/tlsso.r: Likewise.
2007-09-302007-09-29 Mike Frysinger <vapier@gentoo.org>Mike Frysinger1-20/+20
* ld-alpha/tlsbin.rd: Use [0-9]+ to match section header count and 0x[0-9a-f]+ to match section header offset. Match section indexes with \[[ 0-9]+\]. Use [0-9]+ to match program header count and 0x[0-9a-f]+ to match program header offset. Match .dynsym and .symtab entry counts with [0-9]+. * ld-alpha/tlsbinr.rd: Likewise. * ld-alpha/tlspic.rd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbindesc.rd: Likewise. * ld-i386/tlsdesc.rd: Likewise. * ld-i386/tlsgdesc.rd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlspic.rd: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-sparc/tlssunbin32.rd: Likewise. * ld-sparc/tlssunbin64.rd: Likewise. * ld-sparc/tlssunnopic32.rd: Likewise. * ld-sparc/tlssunnopic64.rd: Likewise. * ld-sparc/tlssunpic32.rd: Likewise. * ld-sparc/tlssunpic64.rd: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-x86-64/tlsbindesc.rd: Likewise. * ld-x86-64/tlsdesc.rd: Likewise. * ld-x86-64/tlsgdesc.rd: Likewise. * ld-x86-64/tlspic.rd: Likewise.
2007-08-13bfd/Alan Modra1-3/+3
* elf64-ppc.c (ADDI_R12_R12, LD_R11_0R2, LD_R2_0R2): Define. Update stub comments. (build_plt_stub): Build two variants, one without "addis". (ppc_build_one_stub): Build stubs without "addis" if possible. (ppc_size_one_stub): Size new stubs. ld/testsuite/ * ld-powerpc/relbrlt.s (.text.pad2): Adjust space. * ld-powerpc/relbrlt.d: Update. * ld-powerpc/tlsexe.d: Update. * ld-powerpc/tlsexe.g: Update. * ld-powerpc/tlsexe.r: Update. * ld-powerpc/tlsexetoc.d: Update. * ld-powerpc/tlsexetoc.g: Update. * ld-powerpc/tlsexetoc.r: Update. * ld-powerpc/tlsso.d: Update. * ld-powerpc/tlsso.g: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.d: Update. * ld-powerpc/tlstocso.g: Update.
2007-02-13bfd/Alan Modra1-2/+2
* elf64-ppc.c (create_linkage_sections): Use section ".branch_lt" for branch lookup table. ld/ * emulparams/elf64ppc.sh (OTHER_READWRITE_SECTIONS): Add ".branch_lt". * emultempl/ppc64elf.em (ppc_add_stub_section): Create without SEC_RELOC flag set. ld/testsuite/ * ld-powerpc/relbrlt.d: Update. * ld-powerpc/tlsexe.r: Update. * ld-powerpc/tlsexetoc.r: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.r: Update.
2006-10-17bfd/Alan Modra1-5/+3
* elf-bfd.h (struct elf_link_hash_table): Reorder. Add text_index_section and data_index_section. (struct elf_backend_data): Add elf_backend_init_index_section. (_bfd_elf_init_1_index_section): Declare. (_bfd_elf_init_2_index_sections): Declare. * elfxx-target.h (elf_backend_init_index_section): Define. (elfNN_bed): Init new field. * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls section and text_index_section plus data_index_section. (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. (_bfd_elf_init_1_index_section): New function. (_bfd_elf_init_2_index_sections): New function. (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. (elf_link_input_bfd): When emitting relocs, use text_index_section and data_index_section for removed sections. * elf-m10300.c (elf_backend_omit_section_dynsym): Define. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-sh.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section and data_index_section sym for relocs against sections with no dynamic section sym. (elf_backend_init_index_section): Define. * elf32-cris.c: Similarly. * elf32-hppa.c: Similarly. * elf32-i370.c: Similarly. * elf32-m68k.c: Similarly. * elf32-mips.c: Similarly. * elf32-ppc.c: Similarly. * elf32-s390.c: Similarly. * elf32-sparc.c: Similarly. * elf32-vax.c: Similarly. * elf64-mips.c: Similarly. * elf64-ppc.c: Similarly. * elf64-s390.c: Similarly. * elf64-sparc.c: Similarly. * elf64-x86-64.c: Similarly. * elfn32-mips.c: Similarly. * elfxx-mips.c: Similarly. * elfxx-sparc.c: Similarly. * linker.c (fix_syms): Base symbols in removed sections on previous section in preference to using absolute section. ld/ * ldlang.c (strip_excluded_output_sections): Do strip sections that define syms, but don't ignore them. * ld.texinfo (Output Section Discarding): Revise. * emultempl/armcoff.em (gld${EMULATION_NAME}_finish): Always call finish_default. ld/testsuite/ Update for section sym changes.
2006-07-10include/Jakub Jelinek1-3/+3
* bfdlink.h (struct bfd_link_info): Add emit_hash and emit_gnu_hash bitfields. include/elf/ * common.h (SHT_GNU_HASH, DT_GNU_HASH): Define. ld/ * scripttempl/elf.sc: Add .gnu.hash section. * emultempl/elf32.em (OPTION_HASH_STYLE): Define. (gld${EMULATION_NAME}_add_options): Register --hash-style option. (gld${EMULATION_NAME}_handle_option): Handle it. (gld${EMULATION_NAME}_list_options): Document it. * ldmain.c (main): Initialize emit_hash and emit_gnu_hash. * ld.texinfo: Document --hash-style option. bfd/ * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH. (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers): Handle SHT_GNU_HASH. (special_sections_g): Include .gnu.hash section. (bfd_elf_gnu_hash): New function. * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes. (struct elf_backend_data): Add elf_hash_symbol method. * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash only if info->emit_hash, create .gnu.hash section if info->emit_gnu_hash. (struct collect_gnu_hash_codes): New type. (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, _bfd_elf_hash_symbol): New functions. (compute_bucket_count): Don't compute HASHCODES array, instead add that and NSYMS as arguments. Use bed->s->sizeof_hash_entry instead of bed->s->arch_size / 8. Fix .hash size estimation. When not optimizing, use the number of hashed symbols rather than dynsymcount. (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash, and ADD DT_GNU_HASH if info->emit_gnu_hash. (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash, adjust compute_bucket_count caller. Create and populate .gnu.hash section if info->emit_gnu_hash. (elf_link_output_extsym): Only populate .hash section if finfo->hash_sec != NULL. (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH. * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined. (elfNN_bed): Add elf_backend_hash_symbol. * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function. (elf_backend_hash_symbol): Define. * elf32-i386.c (elf_i386_hash_symbol): New function. (elf_backend_hash_symbol): Define. binutils/ * readelf.c (get_dynamic_type): Handle DT_GNU_HASH. (get_section_type_name): Handle SHT_GNU_HASH. (dynamic_info_DT_GNU_HASH): New variable. (process_dynamic_section): Handle DT_GNU_HASH. (process_symbol_table): Print also DT_GNU_HASH histogram. ld/testsuite/ * ld-powerpc/tlsso32.r: Adjust. * ld-powerpc/tlsso32.d: Adjust. * ld-powerpc/tlsso32.g: Adjust. * ld-powerpc/tlsso.r: Adjust. * ld-powerpc/tlsso.g: Adjust. * ld-powerpc/tlstocso.g: Adjust.
2006-06-02 * ld-powerpc/tlsexe.r: Update for removal of some section syms.Alan Modra1-4/+1
* ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise.
2006-02-02Updo the last change to binutils and ld/testsuite.H.J. Lu1-1/+1
2006-02-02binutils/H.J. Lu1-1/+1
2006-02-02 H.J. Lu <hongjiu.lu@intel.com> * readelf.c (process_program_headers): Undo the change made on 2004-09-22. Match PT_DYNAMIC segment only with SHT_DYNAMIC sections. ld/testsuite/ 2006-02-02 H.J. Lu <hongjiu.lu@intel.com> * ld-i386/tlsbin.rd: Update for changed segment map. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlspic.rd: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-sh/tlsbin-2.d: Likewise. * ld-sh/tlspic-2.d: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-x86-64/tlspic.rd: Likewise.
2005-08-15Adjust for dynamic sym changes.Alan Modra1-82/+81
2005-07-08 * ld-cris/pv32.s: Give expobj a size.Alan Modra1-46/+46
* ld-cris/pv32-1.d: Update. * ld-alpha/tlsbin.dd: Update for empty section removal change. * ld-alpha/tlsbin.sd: Likewise. * ld-alpha/tlsbin.td: Likewise. * ld-alpha/tlsbinr.dd: Likewise. * ld-alpha/tlsbinr.rd: Likewise. * ld-alpha/tlspic.dd: Likewise. * ld-alpha/tlspic.rd: Likewise. * ld-alpha/tlspic.sd: Likewise. * ld-alpha/tlspic.td: Likewise. * ld-arm/tls-lib.d: Likewise. * ld-arm/tls-lib.r: Likewise. * ld-cris/gotplt2.d: Likewise. * ld-cris/gotplt3.d: Likewise. * ld-cris/hiddef1.d: Likewise. * ld-cris/libdso-10.d: Likewise. * ld-cris/libdso-11.d: Likewise. * ld-cris/libdso-12.d: Likewise. * ld-cris/libdso-14.d: Likewise. * ld-cris/libdso-2.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-i386/tlspic.rd: Likewise. * ld-mmix/bpo-10.d: Likewise. * ld-mmix/bpo-22.d: Likewise. * ld-mmix/sec-7m.d: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-powerpc/tlstocso.r: Likewise.
2005-03-21ld/Alan Modra1-18/+10
* emultempl/ppc64elf.em (ppc_finish): Rename from gld${EMULATION_NAME}_finish. Call gld${EMULATION_NAME}_finish. (LDEMUL_FINISH): Update. * emultempl/hppaelf.em (hppaelf_finish, LDEMUL_FINISH): Likewise. * emultempl/m68hc1xelf.em (m68hc11elf_finish, LDEMUL_FINISH): Likewise. ld/testsuite/ * ld-powerpc/tlsexe.r: Update. * ld-powerpc/tlsexetoc.r: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.r: Update.
2005-02-01bfd/Alan Modra1-2/+2
* elf64-ppc.c (func_desc_adjust): Move code creating func desc sym to.. (make_fdh): ..here. New function. Don't set BSF_OBJECT for undefined syms. (struct add_symbol_adjust_data): New. (add_symbol_adjust): Make an undefweak func desc for old ABI objects to link with --as-needed shared libs. Return fail status. Don't adjust old ABI func entry sym to weak if func desc syms isn't defined. (ppc64_elf_check_directives): Adjust call to add_symbol_adjust, and return status. ld/testsuite/ * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.r: Update.
2004-10-01 * ld-powerpc/tls.s (gd, ld): Set tls type for undefined syms.Alan Modra1-4/+4
* ld-powerpc/tls32.s (gd, ld): Likewise. * ld-powerpc/tlstoc.s (gd, ld): Likewise. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlsso32.r: Update. * ld-powerpc/tlstocso.r: Update.
2004-09-22binutils/Alan Modra1-2/+2
* readelf.c (process_program_headers): Don't include .tbss in non-TLS segments. ld/testsuite/ * ld-i386/tlsbin.rd: Update for changed segment map. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlspic.rd: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-sh/tlsbin-2.d: Likewise. * ld-sh/tlspic-2.d: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-x86-64/tlspic.rd: Likewise.
2004-05-11bfd/Jakub Jelinek1-114/+105
* elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-05 * ld-powerpc/tlsexe.r: Update sh_info to decimal.Alan Modra1-3/+3
* ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise.
2003-07-29 * ld-powerpc/tlsso.r: Update.Alan Modra1-2/+2
* ld-powerpc/tlstocso.r: Update.
2003-07-252003-07-24 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-1/+1
* ld-powerpc/tlsexe.r: .sbss is NOBITS, not PROGBITS. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.r: Likewise.