Age | Commit message (Collapse) | Author | Files | Lines |
|
Similarly to commit 86b24e15c45b ("MIPS/LD/testsuite: Correct
comm-data.exp test ABI/emul/endian arrangement") update the mips-elf.exp
test script to:
- correctly select emulations for targets using non-traditional MIPS
emulations,
- correctly select ABIs for targets that do not support all of them,
- use the default endianness selection where possible to benefit targets
that support only one,
- simplify test invocation by providing ABI-specific `run_dump_test'
wrappers, specifically `run_dump_test_o32', `run_dump_test_n32',
`run_dump_test_n64' and `run_dump_test_eabi', which remove the need to
use conditionals across the Expect script or to repeat ABI-specific
GAS and LD flags with each invocation,
removing numerous test failures for `mips-sgi-irix6', `mips64-openbsd',
`mips64el-openbsd' and `mips64el-ps2-elf' targets and broadening
coverage for several MIPS targets.
There are some new failures for the `mips64el-ps2-elf' target with tests
that were not previously run for that target:
FAIL: MIPS16 link branch to absolute expression (n32)
FAIL: MIPS16 link branch to absolute expression 1 (n32)
FAIL: MIPS16 link branch to absolute expression 2 (n32)
FAIL: microMIPS link branch to absolute expression (n32)
FAIL: MIPS ELF got reloc n32
FAIL: MIPS ELF xgot reloc n32
FAIL: undefined weak symbol overflow (n32)
FAIL: R_MIPS16_HI16 and R_MIPS16_LO16 relocs n32
FAIL: ld-mips-elf/attr-gnu-4-0-n32-ph
FAIL: ld-mips-elf/attr-gnu-4-1-n32-ph
FAIL: ld-mips-elf/attr-gnu-4-2-n32-ph
FAIL: ld-mips-elf/attr-gnu-4-3-n32-ph
FAIL: MIPSr6 JALR reloc unaligned/cross-mode link test (n32)
which are mostly due to dump discrepancies caused by mapping differences
coming from the default linker scripts used by these test cases, or
sometimes because of the specific MIPS processor architecture recorded
in the ELF file taking precedence over the general MIPS ISA level also
recorded. Finally, the R_MIPS16_HI16/R_MIPS16_LO16 relocation test
failure is a preexisting issue with the IRIX style emulation.
These failures will have to be addressed separately.
ld/
* testsuite/ld-mips-elf/mips-elf.exp (run_dump_test_abi)
(run_dump_test_o32, run_dump_test_n32, run_dump_test_n64)
(run_dump_test_eabi): New procedures.
(has_newabi, has_elf32): Remove variables.
(has_abi): New associative array variable.
(abi_asflags, abi_ldflags): Update settings across targets.
(irixemul): New variable.
Replace `run_dump_test' calls where applicable throughout with
`run_dump_test_o32', `run_dump_test_n32', `run_dump_test_n64'
and `run_dump_test_eabi' as appropriate. Remove explicit
passing of `abi_asflags' and `abi_ldflags'. Use `noarch' for
tests that require their own architecture setting. Force the
big endianness for tests that require it. Select the endianness
required for `objdump invocation with the `reloc-2' test.
Conditionalize tests run via `run_ld_link_tests' on the ABI
required and use the ABI list from the `has_abi' array where
appropriate.
* testsuite/ld-mips-elf/attr-gnu-4-0-n32-ph.d: Remove ABI and
endianness selection options from `ld' and `source' tags. Relax
output format matching.
* testsuite/ld-mips-elf/attr-gnu-4-0-n64-ph.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-1-n32-ph.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-1-n64-ph.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-2-n32-ph.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-2-n64-ph.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-3-n32-ph.d: Likewise.
* testsuite/ld-mips-elf/attr-gnu-4-3-n64-ph.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips-n32.d: Remove
ABI and endianness selection options from `as', `ld', `source'
tags, and also the `-march=from-abi' option. Remove the `as'
tag where it would become empty.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips-n64.d:
Likewise.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-addend-n32.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-addend-n64.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-addend.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-local-micromips-n32.d:
Likewise.
* testsuite/ld-mips-elf/bal-jalx-local-micromips-n64.d:
Likewise.
* testsuite/ld-mips-elf/bal-jalx-local-micromips.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-local-n32.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-local-n64.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-local.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n32.d:
Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n64.d:
Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips.d:
Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-n32.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-n64.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-n32.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-n64.d: Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic.d: Likewise.
* testsuite/ld-mips-elf/branch-absolute-addend-n32.d: Likewise.
* testsuite/ld-mips-elf/branch-absolute-addend-n64.d: Likewise.
* testsuite/ld-mips-elf/branch-absolute-addend.d: Likewise.
* testsuite/ld-mips-elf/branch-absolute-n32.d: Likewise.
* testsuite/ld-mips-elf/branch-absolute-n64.d: Likewise.
* testsuite/ld-mips-elf/branch-absolute.d: Likewise.
* testsuite/ld-mips-elf/dyn-sec64.d: Likewise.
* testsuite/ld-mips-elf/eh-frame1-n32.d: Likewise.
* testsuite/ld-mips-elf/eh-frame1-n64.d: Likewise.
* testsuite/ld-mips-elf/eh-frame2-n32.d: Likewise.
* testsuite/ld-mips-elf/eh-frame2-n64.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-got-n32-embed.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-got-n32.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-got-n64-embed.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-got-n64-irix.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-got-n64.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-xgot-n32-embed.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-xgot-n32.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-xgot-n64-embed.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-xgot-n64-irix.d: Likewise.
* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
* testsuite/ld-mips-elf/emit-relocs-1.d: Likewise.
* testsuite/ld-mips-elf/got-dump-2.d: Likewise.
* testsuite/ld-mips-elf/got-page-2.d: Likewise.
* testsuite/ld-mips-elf/jal-global-overflow-0.d: Likewise.
* testsuite/ld-mips-elf/jal-global-overflow-1.d: Likewise.
* testsuite/ld-mips-elf/jal-local-overflow-0.d: Likewise.
* testsuite/ld-mips-elf/jal-local-overflow-1.d: Likewise.
* testsuite/ld-mips-elf/jalbal.d: Likewise.
* testsuite/ld-mips-elf/jalx-addend-n32.d: Likewise.
* testsuite/ld-mips-elf/jalx-addend-n64.d: Likewise.
* testsuite/ld-mips-elf/jalx-addend.d: Likewise.
* testsuite/ld-mips-elf/jalx-local-n32.d: Likewise.
* testsuite/ld-mips-elf/jalx-local-n64.d: Likewise.
* testsuite/ld-mips-elf/jalx-local.d: Likewise.
* testsuite/ld-mips-elf/jr-to-b-1.d: Likewise.
* testsuite/ld-mips-elf/jr-to-b-2.d: Likewise.
* testsuite/ld-mips-elf/lsi-4010-isa.d: Likewise.
* testsuite/ld-mips-elf/micromips-branch-absolute-addend-n32.d:
Likewise.
* testsuite/ld-mips-elf/micromips-branch-absolute-addend-n64.d:
Likewise.
* testsuite/ld-mips-elf/micromips-branch-absolute-addend.d:
Likewise.
* testsuite/ld-mips-elf/micromips-branch-absolute-n32.d:
Likewise.
* testsuite/ld-mips-elf/micromips-branch-absolute-n64.d:
Likewise.
* testsuite/ld-mips-elf/micromips-branch-absolute.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-2.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-3.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-1.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-2.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-1.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-n32-1.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-n32.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-n64-1.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend-n64.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-addend.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-n32-1.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-n32-2.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-n32.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-n64-1.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-n64-2.d:
Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute-n64.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-absolute.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-addend-2.d: Likewise.
* testsuite/ld-mips-elf/mips16-branch-addend-3.d: Likewise.
* testsuite/ld-mips-elf/mips16-hilo-n32.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-0.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-1.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-addend-2.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-addend-6.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-n32-0.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-n32-1.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-n64-sym32-0.d: Likewise.
* testsuite/ld-mips-elf/mips16-pcrel-n64-sym32-1.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-0.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-1.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-addend-2.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-addend-6.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-n32-0.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-n32-1.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-n64-sym32-0.d: Likewise.
* testsuite/ld-mips-elf/mips16e2-pcrel-n64-sym32-1.d: Likewise.
* testsuite/ld-mips-elf/multi-got-1.d: Likewise.
* testsuite/ld-mips-elf/multi-got-hidden-1.d: Likewise.
* testsuite/ld-mips-elf/multi-got-hidden-2.d: Likewise.
* testsuite/ld-mips-elf/multi-got-no-shared.d: Likewise.
* testsuite/ld-mips-elf/no-shared-1-n32.d: Likewise.
* testsuite/ld-mips-elf/no-shared-1-n64.d: Likewise.
* testsuite/ld-mips-elf/no-shared-1-o32.d: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-2.d: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-3-error.d: Likewise.
* testsuite/ld-mips-elf/pic-and-nonpic-4-error.d: Likewise.
* testsuite/ld-mips-elf/pie-n32.d: Likewise.
* testsuite/ld-mips-elf/pie-n64.d: Likewise.
* testsuite/ld-mips-elf/pie-o32.d: Likewise.
* testsuite/ld-mips-elf/rel32-n32.d: Likewise.
* testsuite/ld-mips-elf/rel32-o32.d: Likewise.
* testsuite/ld-mips-elf/rel64.d: Likewise.
* testsuite/ld-mips-elf/relax-jalr-n32.d: Likewise.
* testsuite/ld-mips-elf/reloc-1-n32.d: Likewise.
* testsuite/ld-mips-elf/reloc-1-n64.d: Likewise.
* testsuite/ld-mips-elf/reloc-2.d: Likewise.
* testsuite/ld-mips-elf/reloc-3-n32.d: Likewise.
* testsuite/ld-mips-elf/reloc-local-overflow.d: Likewise.
* testsuite/ld-mips-elf/textrel-1.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch-2.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch-ignore-2.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch-ignore-micromips.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-branch-ignore-mips16.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-branch-micromips.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch-mips16.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch-r6-1.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch-r6-2.d: Likewise.
* testsuite/ld-mips-elf/unaligned-branch.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-0.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-2.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-3.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d:
Likewise.
* testsuite/ld-mips-elf/unaligned-jump-micromips.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jump-mips16.d: Likewise.
* testsuite/ld-mips-elf/unaligned-jump.d: Likewise.
* testsuite/ld-mips-elf/unaligned-ldpc-0.d: Likewise.
* testsuite/ld-mips-elf/unaligned-ldpc-1.d: Likewise.
* testsuite/ld-mips-elf/unaligned-lwpc-0.d: Likewise.
* testsuite/ld-mips-elf/unaligned-lwpc-1.d: Likewise.
|
|
Many ELF targets arrange to emit a number of section symbols in
.dynsym for use by dynamic relocations. This happens before the
dynamic relocations are output, and the need for those symbols
determined. In most cases they are not needed. A proper analysis of
the need for dynamic section symbols is target specific and tedious,
so this patch just excludes them in the obvious case when no
dynamic relocations are present.
The patch also runs the new pr23161 and pr23162 tests on more targets.
bfd/
* elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
* elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
(_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
(_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
"dynamic_relocs" is not set.
* elfxx-mips.c (count_section_dynsyms): Likewise.
ld/
* testsuite/ld-elf/readelf.exp: Delete DUMP and selection of
variant ver_def.vd.
* testsuite/ld-elf/ver_def-tic6x.vd: Delete.
* testsuite/ld-elf/shared.exp: Run most pr23161 and pr23162 tests for
linux, nacl and gnu targets.
* testsuite/ld-mips-elf/mips-elf.exp: Set base_syms to 1.
* testsuite/ld-elf/pr23161a.rd: Don't check reloc type. Allow any
order of __bss_start, _edata and _end.
* testsuite/ld-elf/pr23161b.rd: Don't check plt and dyn relocs.
Allow and order of __bss_start, _edata and _end.
* testsuite/ld-elf/pr23162.rd: Fail if __bss_start, _edata or _end
relocs are present rather than testing for no relocations.
* testsuite/ld-aarch64/gc-plt-relocs.d,
* testsuite/ld-aarch64/ifunc-1-local.d,
* testsuite/ld-aarch64/ifunc-1.d,
* testsuite/ld-aarch64/ifunc-2-local.d,
* testsuite/ld-aarch64/ifunc-2.d,
* testsuite/ld-aarch64/ifunc-21.d,
* testsuite/ld-aarch64/ifunc-3a.d,
* testsuite/ld-arm/farcall-mixed-lib-v4t.d,
* testsuite/ld-arm/farcall-mixed-lib.d,
* testsuite/ld-arm/gc-hidden-1.d,
* testsuite/ld-arm/tls-gdesc-got.d,
* testsuite/ld-arm/tls-lib-loc.d,
* testsuite/ld-arm/tls-longplt-lib.d,
* testsuite/ld-arm/tls-thumb1.d,
* testsuite/ld-cris/libdso-10.d,
* testsuite/ld-cris/libdso-11.d,
* testsuite/ld-cris/libdso-13b.d,
* testsuite/ld-cris/libdso-14.d,
* testsuite/ld-cris/libdso-15.d,
* testsuite/ld-cris/pic-gc-72.d,
* testsuite/ld-cris/pic-gc-73.d,
* testsuite/ld-cris/tls-gc-71.d,
* testsuite/ld-mips-elf/mips16-pic-4a.nd,
* testsuite/ld-mips-elf/pic-and-nonpic-3a.dd,
* testsuite/ld-mips-elf/pie-n32.d,
* testsuite/ld-mips-elf/pie-n64.d,
* testsuite/ld-mips-elf/pie-o32.d: Update for removed dynamic
section symbols.
|
|
Linker assigned symbols should be made dynamic by default only when
creating shared object or relocatable executable.
bfd/
* elflink.c (bfd_elf_record_link_assignment): Check for shared
library, instead of PIC, and don't check PDE when making linker
assigned symbol dynamic.
ld/
* testsuite/ld-frv/fdpic-pie-6.d: Updated.
* testsuite/ld-mips-elf/pie-n32.d: Likewise.
* testsuite/ld-mips-elf/pie-n64.d: Likewise.
* testsuite/ld-mips-elf/pie-o32.d: Likewise.
|
|
Since linker now sets the DF_1_PIE bit in the DT_FLAGS_1 tag for PIE,
we need to update MIPS PIE tests for it.
* ld-mips-elf/pie-n32.d: Updated.
* ld-mips-elf/pie-n64.d: Likewise.
* ld-mips-elf/pie-o32.d: Likewise.
|
|
This tag makes it possible to access the debug map when debugging position
independent executables.
bfd/
* elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
instead of !shared to indicate an application vs shared library.
(_bfd_mips_elf_size_dynamic_sections): Likewise.
(_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
(_bfd_mips_elf_get_target_dtag): Likewise.
binutils/
* readelf.c (get_mips_dynamic_type): Handle DT_MIPS_RLD_MAP_REL.
include/
* elf/mips.h (DT_MIPS_RLD_MAP_REL): New macro.
ld/testsuite/
* ld-mips-elf/pic-and-nonpic-3b.ad: Adjust for extra dynamic tag.
* ld-mips-elf/pic-and-nonpic-4b.ad: Likewise.
* ld-mips-elf/pic-and-nonpic-5b.ad: Likewise.
* ld-mips-elf/pic-and-nonpic-6-n32.ad: Likewise.
* ld-mips-elf/pic-and-nonpic-6-n64.ad: Likewise.
* ld-mips-elf/pic-and-nonpic-6-o32.ad: Likewise.
* ld-mips-elf/tlsdyn-o32-1.d: Likewise.
* ld-mips-elf/tlsdyn-o32-1.got: Likewise.
* ld-mips-elf/tlsdyn-o32-2.d: Likewise.
* ld-mips-elf/tlsdyn-o32-2.got: Likewise.
* ld-mips-elf/tlsdyn-o32-3.d: Likewise.
* ld-mips-elf/tlsdyn-o32-3.got: Likewise.
* ld-mips-elf/tlsdyn-o32.d: Likewise.
* ld-mips-elf/tlsdyn-o32.got: Likewise.
* ld-mips-elf/pie-n32.d: New file.
* ld-mips-elf/pie-n64.d: Likewise.
* ld-mips-elf/pie-o32.d: Likewise.
* ld-mips-elf/pie.s: Likewise.
* ld-mips-elf/mips-elf.exp: Add new tests.
|