Merge multiple tdata.* into a single section.

llvm-svn: 260977
This commit is contained in:
Rafael Espindola 2016-02-16 16:12:06 +00:00
parent 1492820aaa
commit 8ae1290058
2 changed files with 4 additions and 2 deletions

View File

@ -734,7 +734,7 @@ StringRef Writer<ELFT>::getOutputSectionName(InputSectionBase<ELFT> *S) const {
StringRef Name = S->getSectionName();
for (StringRef V : {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.",
".init_array.", ".fini_array.", ".ctors.", ".dtors.",
".tbss.", ".gcc_except_table."})
".tbss.", ".gcc_except_table.", ".tdata."})
if (Name.startswith(V))
return V.drop_back();
return Name;

View File

@ -22,13 +22,15 @@ _start:
.section .data.rel.ro.local,"aw",%progbits
.section .data.rel.ro.local.a,"aw",%progbits
.section .tbss.foo,"aGwT",@nobits,foo,comdat
.section .gcc_except_table._Z1fIiEvv,"aG",@progbits,_Z1fIiEvv,comdat
.section .gcc_except_table.foo,"aG",@progbits,foo,comdat
.section .tdata.foo,"aGwT",@progbits,foo,comdat
// CHECK-NOT: Name: .rodata.a
// CHECK: Name: .rodata
// CHECK: Name: .gcc_except_table ({{.*}})
// CHECK-NOT: Name: .text.a
// CHECK: Name: .text
// CHECK: Name: .tdata ({{.*}})
// CHECK: Name: .tbss ({{.*}})
// CHECK-NOT: Name: .data.rel.ro.a
// CHECK-NOT: Name: .data.rel.ro.local.a