[llvm-commits] [llvm] r122568 - in /llvm/trunk: lib/MC/ELFObjectWriter.cpp lib/MC/MCParser/ELFAsmParser.cpp lib/MC/MCSectionELF.cpp test/MC/ELF/section.s
Rafael Espindola
rafael.espindola at gmail.com
Sun Dec 26 13:30:59 PST 2010
Author: rafael
Date: Sun Dec 26 15:30:59 2010
New Revision: 122568
URL: http://llvm.org/viewvc/llvm-project?rev=122568&view=rev
Log:
Add support for @note. Patch by Jörg Sonnenberger.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
llvm/trunk/lib/MC/MCSectionELF.cpp
llvm/trunk/test/MC/ELF/section.s
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=122568&r1=122567&r2=122568&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Sun Dec 26 15:30:59 2010
@@ -1265,6 +1265,7 @@
case ELF::SHT_PROGBITS:
case ELF::SHT_STRTAB:
case ELF::SHT_NOBITS:
+ case ELF::SHT_NOTE:
case ELF::SHT_NULL:
case ELF::SHT_ARM_ATTRIBUTES:
// Nothing to do.
Modified: llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp?rev=122568&r1=122567&r2=122568&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp Sun Dec 26 15:30:59 2010
@@ -335,6 +335,8 @@
Type = MCSectionELF::SHT_NOBITS;
else if (TypeName == "progbits")
Type = MCSectionELF::SHT_PROGBITS;
+ else if (TypeName == "note")
+ Type = MCSectionELF::SHT_NOTE;
else
return TokError("unknown section type");
}
Modified: llvm/trunk/lib/MC/MCSectionELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionELF.cpp?rev=122568&r1=122567&r2=122568&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCSectionELF.cpp (original)
+++ llvm/trunk/lib/MC/MCSectionELF.cpp Sun Dec 26 15:30:59 2010
@@ -92,6 +92,8 @@
OS << "preinit_array";
else if (Type == MCSectionELF::SHT_NOBITS)
OS << "nobits";
+ else if (Type == MCSectionELF::SHT_NOTE)
+ OS << "note";
else if (Type == MCSectionELF::SHT_PROGBITS)
OS << "progbits";
Modified: llvm/trunk/test/MC/ELF/section.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/section.s?rev=122568&r1=122567&r2=122568&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/section.s (original)
+++ llvm/trunk/test/MC/ELF/section.s Sun Dec 26 15:30:59 2010
@@ -12,7 +12,7 @@
// CHECK: ('sh_name', 0x00000033) # '.note.GNU-'
// CHECK: ('sh_name', 0x0000003e) # '-.note.GNU'
-// Test that the dafults are used
+// Test that the defaults are used
.section .init
.section .fini
@@ -67,6 +67,19 @@
// CHECK-NEXT: ('sh_entsize', 0x00000000)
// CHECK-NEXT: ),
+.section .note.test,"", at note
+// CHECK: (('sh_name', 0x00000061) # '.note.test'
+// CHECK-NEXT: ('sh_type', 0x00000007)
+// CHECK-NEXT: ('sh_flags', 0x00000000)
+// CHECK-NEXT: ('sh_addr', 0x00000000)
+// CHECK-NEXT: ('sh_offset', 0x00000050)
+// CHECK-NEXT: ('sh_size', 0x00000000)
+// CHECK-NEXT: ('sh_link', 0x00000000)
+// CHECK-NEXT: ('sh_info', 0x00000000)
+// CHECK-NEXT: ('sh_addralign', 0x00000001)
+// CHECK-NEXT: ('sh_entsize', 0x00000000)
+// CHECK-NEXT: ),
+
// Test that we can parse these
foo:
bar:
More information about the llvm-commits
mailing list