[lld] r265478 - Delete broken code.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 5 15:08:40 PDT 2016
Author: rafael
Date: Tue Apr 5 17:08:39 2016
New Revision: 265478
URL: http://llvm.org/viewvc/llvm-project?rev=265478&view=rev
Log:
Delete broken code.
A synthetic symbol can be global or local, and with the current
infrastructure we don't need any special code for it.
Fixes PR27228.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/Writer.cpp
lld/trunk/test/ELF/pre_init_fini_array.s
lld/trunk/test/ELF/startstop-shared.s
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=265478&r1=265477&r2=265478&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Apr 5 17:08:39 2016
@@ -1515,8 +1515,6 @@ uint8_t SymbolTableSection<ELFT>::getSym
uint8_t Visibility = Body->getVisibility();
if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
return STB_LOCAL;
- if (isa<DefinedSynthetic<ELFT>>(Body))
- return STB_LOCAL;
return Body->Binding;
}
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=265478&r1=265477&r2=265478&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Apr 5 17:08:39 2016
@@ -1196,9 +1196,9 @@ template <class ELFT> void Writer<ELFT>:
auto Define = [&](StringRef Start, StringRef End,
OutputSectionBase<ELFT> *OS) {
if (OS) {
- Symtab.addSynthetic(Start, *OS, 0, STV_DEFAULT);
+ Symtab.addSynthetic(Start, *OS, 0, STV_HIDDEN);
Symtab.addSynthetic(End, *OS, DefinedSynthetic<ELFT>::SectionEnd,
- STV_DEFAULT);
+ STV_HIDDEN);
} else {
Symtab.addIgnored(Start);
Symtab.addIgnored(End);
Modified: lld/trunk/test/ELF/pre_init_fini_array.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/pre_init_fini_array.s?rev=265478&r1=265477&r2=265478&view=diff
==============================================================================
--- lld/trunk/test/ELF/pre_init_fini_array.s (original)
+++ lld/trunk/test/ELF/pre_init_fini_array.s Tue Apr 5 17:08:39 2016
@@ -67,7 +67,9 @@ _start:
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [
+// CHECK-NEXT: STV_HIDDEN
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: .fini_array
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
@@ -76,7 +78,9 @@ _start:
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [
+// CHECK-NEXT: STV_HIDDEN
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: .fini_array
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
@@ -85,7 +89,9 @@ _start:
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [
+// CHECK-NEXT: STV_HIDDEN
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: .init_array
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
@@ -94,7 +100,9 @@ _start:
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [
+// CHECK-NEXT: STV_HIDDEN
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: .init_array
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
@@ -103,7 +111,9 @@ _start:
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [
+// CHECK-NEXT: STV_HIDDEN
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: .preinit_array
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
@@ -112,7 +122,9 @@ _start:
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [
+// CHECK-NEXT: STV_HIDDEN
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: .preinit_array
// CHECK-NEXT: }
Modified: lld/trunk/test/ELF/startstop-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/startstop-shared.s?rev=265478&r1=265477&r2=265478&view=diff
==============================================================================
--- lld/trunk/test/ELF/startstop-shared.s (original)
+++ lld/trunk/test/ELF/startstop-shared.s Tue Apr 5 17:08:39 2016
@@ -16,3 +16,10 @@
// CHECK: Name: __start_bar
// CHECK-NEXT: Value: 0x[[ADDR]]
+// CHECK-NEXT: Size:
+// CHECK-NEXT: Binding: Local
+
+// CHECK: Name: __start_foo
+// CHECK-NEXT: Value:
+// CHECK-NEXT: Size:
+// CHECK-NEXT: Binding: Global
More information about the llvm-commits
mailing list