diff options
34 files changed, 354 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 63499ef..1ac0bab 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 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 `elf_backend_elfsym_local_is_section' member. * elfxx-target.h (elf_backend_elfsym_local_is_section): New diff --git a/bfd/elflink.c b/bfd/elflink.c index 32a2d6d..ae5ff50 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -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; } diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 160febe..7bf4257 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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 diff --git a/binutils/ChangeLog b/binutils/ChangeLog index a5efafc..4e66a13 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,27 @@ 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 test. * testsuite/binutils-all/mips/global-local-symtab-o32t.d: New diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-final-n32.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-final-n32.d new file mode 100644 index 0000000..0623ddc --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-final-n32.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-final-n64.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-final-n64.d new file mode 100644 index 0000000..eaee008 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-final-n64.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-final-o32.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-final-o32.d new file mode 100644 index 0000000..580acb0 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-final-o32.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n32.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n32.d new file mode 100644 index 0000000..818d791 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n32.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n32t.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n32t.d new file mode 100644 index 0000000..a6f6548 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n32t.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n64.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n64.d new file mode 100644 index 0000000..dcb5c23 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n64.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n64t.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n64t.d new file mode 100644 index 0000000..e38f789 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-n64t.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-o32.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-o32.d new file mode 100644 index 0000000..d46fccd --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-o32.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-o32t.d b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-o32t.d new file mode 100644 index 0000000..d97322f --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/global-local-symtab-sort-o32t.d @@ -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 diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp index eed1dd1..e304737 100644 --- a/binutils/testsuite/binutils-all/mips/mips.exp +++ b/binutils/testsuite/binutils-all/mips/mips.exp @@ -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 diff --git a/gas/ChangeLog b/gas/ChangeLog index 1da85af..c83800a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,15 @@ 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. * testsuite/gas/mips/global-local-symtab-o32t.d: New test. * testsuite/gas/mips/global-local-symtab-n32.d: New test. diff --git a/gas/testsuite/gas/mips/global-local-symtab-sort-n32.d b/gas/testsuite/gas/mips/global-local-symtab-sort-n32.d new file mode 100644 index 0000000..2c78bc0 --- /dev/null +++ b/gas/testsuite/gas/mips/global-local-symtab-sort-n32.d @@ -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 diff --git a/gas/testsuite/gas/mips/global-local-symtab-sort-n32t.d b/gas/testsuite/gas/mips/global-local-symtab-sort-n32t.d new file mode 100644 index 0000000..43e8be9 --- /dev/null +++ b/gas/testsuite/gas/mips/global-local-symtab-sort-n32t.d @@ -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 diff --git a/gas/testsuite/gas/mips/global-local-symtab-sort-n64.d b/gas/testsuite/gas/mips/global-local-symtab-sort-n64.d new file mode 100644 index 0000000..220af2f --- /dev/null +++ b/gas/testsuite/gas/mips/global-local-symtab-sort-n64.d @@ -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 diff --git a/gas/testsuite/gas/mips/global-local-symtab-sort-n64t.d b/gas/testsuite/gas/mips/global-local-symtab-sort-n64t.d new file mode 100644 index 0000000..904d626 --- /dev/null +++ b/gas/testsuite/gas/mips/global-local-symtab-sort-n64t.d @@ -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 diff --git a/gas/testsuite/gas/mips/global-local-symtab-sort-o32.d b/gas/testsuite/gas/mips/global-local-symtab-sort-o32.d new file mode 100644 index 0000000..f93cbb7 --- /dev/null +++ b/gas/testsuite/gas/mips/global-local-symtab-sort-o32.d @@ -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 diff --git a/gas/testsuite/gas/mips/global-local-symtab-sort-o32t.d b/gas/testsuite/gas/mips/global-local-symtab-sort-o32t.d new file mode 100644 index 0000000..1c37cba --- /dev/null +++ b/gas/testsuite/gas/mips/global-local-symtab-sort-o32t.d @@ -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 diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index f16d1b1..69c10e5 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -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}" } } diff --git a/ld/ChangeLog b/ld/ChangeLog index 96edfb3..6b619f2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,29 @@ 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. * testsuite/ld-mips-elf/global-local-symtab-o32t.d: New test. * testsuite/ld-mips-elf/global-local-symtab-n32.d: New test. diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/sec64k.exp index 7c85979..f17a118 100644 --- a/ld/testsuite/ld-elf/sec64k.exp +++ b/ld/testsuite/ld-elf/sec64k.exp @@ -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 "#..." diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-final-n32.d b/ld/testsuite/ld-mips-elf/global-local-symtab-final-n32.d new file mode 100644 index 0000000..4110577 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-final-n32.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-final-n64.d b/ld/testsuite/ld-mips-elf/global-local-symtab-final-n64.d new file mode 100644 index 0000000..6e14ee9 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-final-n64.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-final-o32.d b/ld/testsuite/ld-mips-elf/global-local-symtab-final-o32.d new file mode 100644 index 0000000..4110577 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-final-o32.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n32.d b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n32.d new file mode 100644 index 0000000..3ea40b5 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n32.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n32t.d b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n32t.d new file mode 100644 index 0000000..0d14ddc --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n32t.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n64.d b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n64.d new file mode 100644 index 0000000..6491bca --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n64.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n64t.d b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n64t.d new file mode 100644 index 0000000..90d37ec2 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-n64t.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-sort-o32.d b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-o32.d new file mode 100644 index 0000000..1e6ff20 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-o32.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/global-local-symtab-sort-o32t.d b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-o32t.d new file mode 100644 index 0000000..9e7ceaa --- /dev/null +++ b/ld/testsuite/ld-mips-elf/global-local-symtab-sort-o32t.d @@ -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 diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index 4b257c3..388fbd3 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -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" |