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.
This commit is contained in:
Maciej W. Rozycki 2020-07-29 20:56:41 +01:00
parent 3f1b17bbf0
commit c77cb2a09c
34 changed files with 354 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* 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.
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* elf-bfd.h (elf_backend_data): Add

View File

@ -12268,6 +12268,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (info->strip != strip_all || emit_relocs)
{
bfd_boolean name_local_sections;
const char *name;
file_ptr off = elf_next_file_pos (abfd);
_bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE);
@ -12290,10 +12293,15 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
/* Output a symbol for each section. We output these even if we are
discarding local symbols, since they are used for relocs. These
symbols have no names. We store the index of each one in the
index field of the section, so that we can find it again when
symbols usually have no names. We store the index of each one in
the index field of the section, so that we can find it again when
outputting relocs. */
name_local_sections
= (bed->elf_backend_name_local_section_symbols
&& bed->elf_backend_name_local_section_symbols (abfd));
name = NULL;
elfsym.st_size = 0;
elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
elfsym.st_other = 0;
@ -12308,7 +12316,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
elfsym.st_shndx = i;
if (!bfd_link_relocatable (info))
elfsym.st_value = o->vma;
if (elf_link_output_symstrtab (&flinfo, NULL, &elfsym, o,
if (name_local_sections)
name = o->name;
if (elf_link_output_symstrtab (&flinfo, name, &elfsym, o,
NULL) != 1)
goto error_return;
}

View File

@ -7262,7 +7262,7 @@ _bfd_mips_elf_eh_frame_address_size (bfd *abfd, const asection *sec)
bfd_boolean
_bfd_mips_elf_name_local_section_symbols (bfd *abfd)
{
return SGI_COMPAT (abfd);
return elf_elfheader (abfd)->e_type == ET_REL && SGI_COMPAT (abfd);
}
/* Work over a section just before writing it out. This routine is

View File

@ -1,3 +1,25 @@
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* 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.
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* testsuite/binutils-all/mips/global-local-symtab-o32.d: New

View File

@ -0,0 +1,9 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (fully linked) (n32)
#as: -n32 -mno-pdr -mips3
#ld: -e 0 -T ../../../../ld/testsuite/ld-mips-elf/global-local-symtab.ld
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,9 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (fully linked) (n64)
#as: -64 -mno-pdr -mips3
#ld: -e 0 -T ../../../../ld/testsuite/ld-mips-elf/global-local-symtab.ld
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
#dump: global-local-symtab-sort-n64t.d

View File

@ -0,0 +1,9 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (fully linked) (o32)
#as: -32 -mno-pdr
#ld: -e 0 -T ../../../../ld/testsuite/ld-mips-elf/global-local-symtab.ld
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,8 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (relocatable) (n32)
#as: -n32 -mno-pdr -mips3
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
#dump: global-local-symtab-sort-o32.d

View File

@ -0,0 +1,8 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (relocatable) (n32)
#as: -n32 -mno-pdr -mips3
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,14 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (relocatable) (n64)
#as: -64 -mno-pdr -mips3
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
Symbol table '\.symtab' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 \.data
2: 0000000000000004 4 OBJECT LOCAL DEFAULT 1 bar
3: 0000000000000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -0,0 +1,14 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (relocatable) (n64)
#as: -64 -mno-pdr -mips3
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
Symbol table '\.symtab' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000004 4 OBJECT LOCAL DEFAULT 1 bar
3: 0000000000000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -0,0 +1,14 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (relocatable) (o32)
#as: -32 -mno-pdr
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
Symbol table '\.symtab' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1 \.data
2: 00000000 4 OBJECT GLOBAL DEFAULT 1 foo
3: 00000004 4 OBJECT LOCAL DEFAULT 1 bar

View File

@ -0,0 +1,14 @@
#PROG: objcopy
#DUMPPROG: readelf
#name: MIPS symbol table sort and section symbol names (relocatable) (o32)
#as: -32 -mno-pdr
#objcopy: -j .data -j .symtab -j .strtab -j .shstrtab
#readelf: -s
#source: ../../../../gas/testsuite/gas/mips/global-local-symtab.s
Symbol table '\.symtab' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1
2: 00000004 4 OBJECT LOCAL DEFAULT 1 bar
3: 00000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -252,3 +252,9 @@ run_dump_test_n32 "mips-reginfo-n32"
run_dump_test_o32 "global-local-symtab-o32${tmips}"
run_dump_test_n32 "global-local-symtab-n32${tmips}"
run_dump_test_n64 "global-local-symtab-n64"
run_dump_test_o32 "global-local-symtab-sort-o32${tmips}"
run_dump_test_n32 "global-local-symtab-sort-n32${tmips}"
run_dump_test_n64 "global-local-symtab-sort-n64${tmips}"
run_dump_test_o32 "global-local-symtab-final-o32" useld
run_dump_test_n32 "global-local-symtab-final-n32" useld
run_dump_test_n64 "global-local-symtab-final-n64" useld

View File

@ -1,3 +1,13 @@
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* 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.
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* testsuite/gas/mips/global-local-symtab-o32.d: New test.

View File

@ -0,0 +1,6 @@
#DUMPPROG: readelf
#readelf: -s
#name: MIPS global/local symbol table sort and section symbol names (n32)
#as: -n32 -mno-pdr -mips3
#source: global-local-symtab.s
#dump: global-local-symtab-sort-o32.d

View File

@ -0,0 +1,6 @@
#DUMPPROG: readelf
#readelf: -s
#name: MIPS global/local symbol table sort and section symbol names (n32)
#as: -n32 -mno-pdr -mips3
#source: global-local-symtab.s
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,17 @@
#DUMPPROG: readelf
#readelf: -s
#name: MIPS global/local symbol table sort and section symbol names (n64)
#as: -64 -mno-pdr -mips3
#source: global-local-symtab.s
Symbol table '\.symtab' contains 9 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 \.text
2: 0000000000000000 0 SECTION LOCAL DEFAULT 2 \.data
3: 0000000000000000 0 SECTION LOCAL DEFAULT 3 \.bss
4: 0000000000000004 4 OBJECT LOCAL DEFAULT 2 bar
5: 0000000000000000 0 SECTION LOCAL DEFAULT 4 \.MIPS\.options
6: 0000000000000000 0 SECTION LOCAL DEFAULT 5 \.MIPS\.abiflags
7: 0000000000000000 0 SECTION LOCAL DEFAULT 6 \.gnu\.attributes
8: 0000000000000000 4 OBJECT GLOBAL DEFAULT 2 foo

View File

@ -0,0 +1,17 @@
#DUMPPROG: readelf
#readelf: -s
#name: MIPS global/local symbol table sort and section symbol names (n64)
#as: -64 -mno-pdr -mips3
#source: global-local-symtab.s
Symbol table '\.symtab' contains 9 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000000 0 SECTION LOCAL DEFAULT 2
3: 0000000000000000 0 SECTION LOCAL DEFAULT 3
4: 0000000000000004 4 OBJECT LOCAL DEFAULT 2 bar
5: 0000000000000000 0 SECTION LOCAL DEFAULT 4
6: 0000000000000000 0 SECTION LOCAL DEFAULT 5
7: 0000000000000000 0 SECTION LOCAL DEFAULT 6
8: 0000000000000000 4 OBJECT GLOBAL DEFAULT 2 foo

View File

@ -0,0 +1,17 @@
#DUMPPROG: readelf
#readelf: -s
#name: MIPS global/local symbol table sort and section symbol names (o32)
#as: -32 -mno-pdr
#source: global-local-symtab.s
Symbol table '\.symtab' contains 9 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1 \.text
2: 00000000 0 SECTION LOCAL DEFAULT 2 \.data
3: 00000000 0 SECTION LOCAL DEFAULT 3 \.bss
4: 00000000 0 SECTION LOCAL DEFAULT 4 \.reginfo
5: 00000000 0 SECTION LOCAL DEFAULT 5 \.MIPS\.abiflags
6: 00000000 0 SECTION LOCAL DEFAULT 6 \.gnu\.attributes
7: 00000000 4 OBJECT GLOBAL DEFAULT 2 foo
8: 00000004 4 OBJECT LOCAL DEFAULT 2 bar

View File

@ -0,0 +1,17 @@
#DUMPPROG: readelf
#readelf: -s
#name: MIPS global/local symbol table sort and section symbol names (o32)
#as: -32 -mno-pdr
#source: global-local-symtab.s
Symbol table '\.symtab' contains 9 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1
2: 00000000 0 SECTION LOCAL DEFAULT 2
3: 00000000 0 SECTION LOCAL DEFAULT 3
4: 00000004 4 OBJECT LOCAL DEFAULT 2 bar
5: 00000000 0 SECTION LOCAL DEFAULT 4
6: 00000000 0 SECTION LOCAL DEFAULT 5
7: 00000000 0 SECTION LOCAL DEFAULT 6
8: 00000000 4 OBJECT GLOBAL DEFAULT 2 foo

View File

@ -2094,8 +2094,11 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "insn-isa-mode"
run_dump_test "insn-isa-mode"
run_dump_test "global-local-symtab-o32${tmips}"
run_dump_test "global-local-symtab-sort-o32${tmips}"
if $has_newabi {
run_dump_test "global-local-symtab-n32${tmips}"
run_dump_test "global-local-symtab-n64"
run_dump_test "global-local-symtab-sort-n32${tmips}"
run_dump_test "global-local-symtab-sort-n64${tmips}"
}
}

View File

@ -1,3 +1,27 @@
2020-07-29 Maciej W. Rozycki <macro@linux-mips.org>
* 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 Maciej W. Rozycki <macro@linux-mips.org>
* testsuite/ld-mips-elf/global-local-symtab-o32.d: New test.

View File

@ -145,7 +145,7 @@ if { ![istarget "m32r-*-*"] } then {
puts $ofd " \\\[65279\\\] (.rel\[a\]?)?\\.foo\\.\[0-9\]+ .*"
puts $ofd " \\\[65280\\\] (.rel\[a\]?)?\\.foo\\.\[0-9\]+ .*"
puts $ofd "#..."
puts $ofd " 340..: 0+\[ \]+0\[ \]+SECTION\[ \]+LOCAL\[ \]+DEFAULT\[ \]+68... "
puts $ofd " 340..: 0+\[ \]+0\[ \]+SECTION\[ \]+LOCAL\[ \]+DEFAULT\[ \]+68... .*"
puts $ofd "#..."
puts $ofd " 340..: 0+(2|4|8)\[ \]+0\[ \]+NOTYPE\[ \]+LOCAL\[ \]+DEFAULT\[ \]+\[2-7\] bar_1$"
puts $ofd "#..."

View File

@ -0,0 +1,6 @@
#name: MIPS symbol table sort and section symbol names (fully linked) (n32)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -e 0 -T global-local-symtab.ld
#readelf: -sW
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,6 @@
#name: MIPS symbol table sort and section symbol names (fully linked) (n64)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -e 0 -T global-local-symtab.ld
#readelf: -sW
#dump: global-local-symtab-sort-n64t.d

View File

@ -0,0 +1,6 @@
#name: MIPS symbol table sort and section symbol names (fully linked) (n32)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -e 0 -T global-local-symtab.ld
#readelf: -sW
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,6 @@
#name: MIPS symbol table sort and section symbol names (relocatable) (n32)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -r -T global-local-symtab.ld
#readelf: -sW
#dump: global-local-symtab-sort-o32.d

View File

@ -0,0 +1,6 @@
#name: MIPS symbol table sort and section symbol names (relocatable) (n32)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -r -T global-local-symtab.ld
#readelf: -sW
#dump: global-local-symtab-sort-o32t.d

View File

@ -0,0 +1,13 @@
#name: MIPS symbol table sort and section symbol names (relocatable) (n64)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -r -T global-local-symtab.ld
#readelf: -sW
Symbol table '\.symtab' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 \.data
2: 0000000000000000 0 FILE LOCAL DEFAULT ABS tmpdir/global-local-symtab\.o
3: 0000000000000004 4 OBJECT LOCAL DEFAULT 1 bar
4: 0000000000000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -0,0 +1,13 @@
#name: MIPS symbol table sort and section symbol names (relocatable) (n64)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -r -T global-local-symtab.ld
#readelf: -sW
Symbol table '\.symtab' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000000 0 FILE LOCAL DEFAULT ABS tmpdir/global-local-symtab\.o
3: 0000000000000004 4 OBJECT LOCAL DEFAULT 1 bar
4: 0000000000000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -0,0 +1,13 @@
#name: MIPS symbol table sort and section symbol names (relocatable) (n32)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -r -T global-local-symtab.ld
#readelf: -sW
Symbol table '\.symtab' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1 \.data
2: 00000000 0 FILE LOCAL DEFAULT ABS tmpdir/global-local-symtab\.o
3: 00000004 4 OBJECT LOCAL DEFAULT 1 bar
4: 00000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -0,0 +1,13 @@
#name: MIPS symbol table sort and section symbol names (relocatable) (n32)
#source: ../../../gas/testsuite/gas/mips/global-local-symtab.s
#as: -mno-pdr
#ld: -r -T global-local-symtab.ld
#readelf: -sW
Symbol table '\.symtab' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1
2: 00000000 0 FILE LOCAL DEFAULT ABS tmpdir/global-local-symtab\.o
3: 00000004 4 OBJECT LOCAL DEFAULT 1 bar
4: 00000000 4 OBJECT GLOBAL DEFAULT 1 foo

View File

@ -1663,3 +1663,9 @@ run_dump_test_o32 "reloc-pcrel-r6"
run_dump_test_o32 "global-local-symtab-o32${tmips}"
run_dump_test_n32 "global-local-symtab-n32${tmips}"
run_dump_test_n64 "global-local-symtab-n64"
run_dump_test_o32 "global-local-symtab-sort-o32${tmips}"
run_dump_test_n32 "global-local-symtab-sort-n32${tmips}"
run_dump_test_n64 "global-local-symtab-sort-n64${tmips}"
run_dump_test_o32 "global-local-symtab-final-o32"
run_dump_test_n32 "global-local-symtab-final-n32"
run_dump_test_n64 "global-local-symtab-final-n64"