binutils-gdb/binutils/testsuite/binutils-all/mips
Maciej W. Rozycki c77cb2a09c MIPS: Make the IRIX naming of local section symbols consistent
Make the MIPS/IRIX naming of local section symbols consistent between
files produced by generic ELF code and ELF linker code, complementing
commit 174fd7f955 ("New bfd elf hook: force naming of local section
symbols"), <https://sourceware.org/ml/binutils/2004-02/msg00072.html>.

Local section symbols have no names in the standard ELF gABI, however
the lack of a name causes problems with IRIX's MIPSpro linker.  To work
around the issue we give them names, however we do that in generic ELF
code only, based on what the `elf_backend_name_local_section_symbols'
hook returns if present.  That makes objects created by GAS or `objdump'
work correctly, however not ones created by `ld -r'.  That would not
normally cause issues with IRIX systems using GAS and `objdump' only
with the MIPSpro linker, however if GNU LD was used for whatever reason
in producing objects later fed to IRIX's MIPSpro linker, then things
would break.

Modify ELF linker code accordingly then, using the same hook.  Adjust
the `ld-elf/64ksec-r' test accordingly so that it also accepts a section
symbol with a name.

Also modify the hook itself so that only actual ET_REL objects have
names assigned to local section symbols.  Other kinds of ELF files are
not ever supposed to be relocated with the MIPSpro linker, so we can
afford producing more standard output.

Add suitable GAS, LD and `objcopy' test cases to the relevant testsuites
to keep these tools consistently verified.  This change also fixes:

FAIL: objcopy executable (pr25662)

across MIPS targets using the IRIX compatibility mode.

	bfd/
	* elflink.c (bfd_elf_final_link): Give local symbols a name if
	so requested.
	* elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): Only
	return TRUE if making ET_REL output.

	binutils/
	* testsuite/binutils-all/mips/global-local-symtab-sort-o32.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-sort-o32t.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-sort-n32.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-sort-n32t.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-sort-n64.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-sort-n64t.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-final-o32.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-final-n32.d:
	New test.
	* testsuite/binutils-all/mips/global-local-symtab-final-n64.d:
	New test.
	* testsuite/binutils-all/mips/mips.exp: Run the new tests.

	gas/
	* testsuite/gas/mips/global-local-symtab-sort-o32.d: New test.
	* testsuite/gas/mips/global-local-symtab-sort-o32t.d: New test.
	* testsuite/gas/mips/global-local-symtab-sort-n32.d: New test.
	* testsuite/gas/mips/global-local-symtab-sort-n32t.d: New test.
	* testsuite/gas/mips/global-local-symtab-sort-n64.d: New test.
	* testsuite/gas/mips/global-local-symtab-sort-n64t.d: New test.
	* testsuite/gas/mips/mips.exp: Run the new tests.

	ld/
	* testsuite/ld-elf/sec64k.exp: Also accept a section symbol with
	a name.
	* testsuite/ld-mips-elf/global-local-symtab-sort-o32.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-sort-o32t.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-sort-n32.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-sort-n32t.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-sort-n64.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-sort-n64t.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-final-o32.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-final-n32.d: New
	test.
	* testsuite/ld-mips-elf/global-local-symtab-final-n64.d: New
	test.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2020-07-29 20:56:41 +01:00
..
global-local-symtab-final-n32.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-final-n64.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-final-o32.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-n32.d MIPS/LD: Set symtab's `sh_info' correctly for IRIX emulations 2020-07-29 20:56:41 +01:00
global-local-symtab-n32t.d MIPS/LD: Set symtab's `sh_info' correctly for IRIX emulations 2020-07-29 20:56:41 +01:00
global-local-symtab-n64.d MIPS/LD: Set symtab's `sh_info' correctly for IRIX emulations 2020-07-29 20:56:41 +01:00
global-local-symtab-o32.d MIPS/LD: Set symtab's `sh_info' correctly for IRIX emulations 2020-07-29 20:56:41 +01:00
global-local-symtab-o32t.d MIPS/LD: Set symtab's `sh_info' correctly for IRIX emulations 2020-07-29 20:56:41 +01:00
global-local-symtab-sort-n32.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-sort-n32t.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-sort-n64.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-sort-n64t.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-sort-o32.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
global-local-symtab-sort-o32t.d MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
mips-ase-1.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-ase-1.s MIPS/opcodes: Also set disassembler's ASE flags from ELF structures 2016-12-14 22:12:21 +00:00
mips-ase-2.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-ase-2.s MIPS/opcodes: Also set disassembler's ASE flags from ELF structures 2016-12-14 22:12:21 +00:00
mips-ase-3.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-note-2-n32.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-note-2-n64.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-note-2.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-note-2r-n32.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-note-2r-n64.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-note-2r.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-reginfo-n32.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-reginfo.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips-reginfo.s MIPS/BFD: Correctly report unsupported `.reginfo' section size 2018-02-05 14:00:21 +00:00
mips-xpa-virt-1.d MIPS: Fix XPA base and Virtualization ASE instruction handling 2017-06-30 07:21:55 +01:00
mips-xpa-virt-2.d MIPS: Fix XPA base and Virtualization ASE instruction handling 2017-06-30 07:21:55 +01:00
mips-xpa-virt-3.d MIPS: Fix XPA base and Virtualization ASE instruction handling 2017-06-30 07:21:55 +01:00
mips-xpa-virt-4.d MIPS: Fix XPA base and Virtualization ASE instruction handling 2017-06-30 07:21:55 +01:00
mips-xpa-virt.s MIPS: Fix XPA base and Virtualization ASE instruction handling 2017-06-30 07:21:55 +01:00
mips.exp MIPS: Make the IRIX naming of local section symbols consistent 2020-07-29 20:56:41 +01:00
mips16-alias.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16-alias.s MIPS16/opcodes: Annotate instruction aliases 2017-04-25 11:55:34 +01:00
mips16-extend-insn.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16-extend-insn.s MIPS16: Handle non-extensible instructions correctly 2016-12-23 19:33:45 +00:00
mips16-extend-noinsn.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16-extend-noinsn.s MIPS16/opcodes: Reformat raw EXTEND and undecoded output 2016-12-09 23:18:06 +00:00
mips16-noalias.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16-pcrel.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16-pcrel.s MIPS16/opcodes: Fix PC-relative operation delay-slot adjustment 2016-12-08 23:30:57 +00:00
mips16-undecoded.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16-undecoded.s MIPS16e2: Add new MIPS16e2 ASE binutils and GAS tests 2017-05-15 13:57:11 +01:00
mips16e2-extend-insn.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mips16e2-undecoded.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mixed-micromips.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mixed-micromips.s
mixed-mips16-micromips.d
mixed-mips16-micromips.s
mixed-mips16.d MIPS/binutils/testsuite: Correct mips.exp test ABI/emul/endian arrangement 2020-07-26 14:43:21 +01:00
mixed-mips16.s