[llvm-commits] [llvm] r119060 - in /llvm/trunk: lib/MC/MCELFStreamer.cpp test/MC/ELF/common.s
Rafael Espindola
rafael.espindola at gmail.com
Sun Nov 14 11:40:55 PST 2010
Author: rafael
Date: Sun Nov 14 13:40:55 2010
New Revision: 119060
URL: http://llvm.org/viewvc/llvm-project?rev=119060&view=rev
Log:
Fix the type of a symbol created with .comm and no corresponding .type.
Modified:
llvm/trunk/lib/MC/MCELFStreamer.cpp
llvm/trunk/test/MC/ELF/common.s
Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=119060&r1=119059&r2=119060&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Sun Nov 14 13:40:55 2010
@@ -409,6 +409,7 @@
if (!BindingExplicitlySet.count(Symbol)) {
SetBinding(SD, ELF::STB_GLOBAL);
SD.setExternal(true);
+ SetType(SD, ELF::STT_OBJECT);
}
if (GetBinding(SD) == ELF_STB_Local) {
Modified: llvm/trunk/test/MC/ELF/common.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/common.s?rev=119060&r1=119059&r2=119060&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/common.s (original)
+++ llvm/trunk/test/MC/ELF/common.s Sun Nov 14 13:40:55 2010
@@ -61,3 +61,15 @@
// CHECK-NEXT: ('st_shndx', 0x0000fff2)
// CHECK-NEXT: ('st_value', 0x00000010)
// CHECK-NEXT: ('st_size', 0x00000028)
+
+ .comm common5,4,4
+
+// CHECK: # Symbol 0x00000008
+// CHECK-NEXT: (('st_name', 0x00000025) # 'common5'
+// CHECK-NEXT: ('st_bind', 0x00000001)
+// CHECK-NEXT: ('st_type', 0x00000001)
+// CHECK-NEXT: ('st_other', 0x00000000)
+// CHECK-NEXT: ('st_shndx', 0x0000fff2)
+// CHECK-NEXT: ('st_value', 0x00000004)
+// CHECK-NEXT: ('st_size', 0x00000004)
+// CHECK-NEXT: ),
More information about the llvm-commits
mailing list