From 8ae12900587ebb3590f266e48ccb0f2bf87dd378 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 16 Feb 2016 16:12:06 +0000 Subject: [PATCH] Merge multiple tdata.* into a single section. llvm-svn: 260977 --- lld/ELF/Writer.cpp | 2 +- lld/test/ELF/section-name.s | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 8bb719a..30fec49 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -734,7 +734,7 @@ StringRef Writer::getOutputSectionName(InputSectionBase *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; diff --git a/lld/test/ELF/section-name.s b/lld/test/ELF/section-name.s index 3d82085..f470c48 100644 --- a/lld/test/ELF/section-name.s +++ b/lld/test/ELF/section-name.s @@ -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 -- 2.7.4