[llvm-commits] ELF sections in X86AsmTargetAsm.cpp

Dan Gohman djg at cray.com
Tue May 1 06:50:46 PDT 2007


The attached patch sets the section names for fixed-size constants for
ELF on x86 to match what GCC uses, and it uses the mergeable flag so
that duplicate constants can be merged.

This works for me with GAS; are there other assemblers (or linkers?)
being used with LLVM on x86 ELF targets that don't support this?
It looks like nasm/yasm wouldn't accept some of the other things
that LLVM currently emits anyway..

Dan

-- 
Dan Gohman, Cray Inc.
-------------- next part --------------
Index: lib/Target/X86/X86TargetAsmInfo.cpp
===================================================================
RCS file: /var/cvs/llvm/llvm/lib/Target/X86/X86TargetAsmInfo.cpp,v
retrieving revision 1.38
diff -u -r1.38 X86TargetAsmInfo.cpp
--- lib/Target/X86/X86TargetAsmInfo.cpp
+++ lib/Target/X86/X86TargetAsmInfo.cpp
@@ -106,6 +106,11 @@
     // HasDotFile - True if target asm supports .file directives.
     // bool HasDotFile; // Defaults to false.
     ReadOnlySection = "\t.section\t.rodata\n";
+    FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4";
+    EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\", at progbits,8";
+    SixteenByteConstantSection =
+                             "\t.section\t.rodata.cst16,\"aM\", at progbits,16";
+    CStringSection = "\t.section\t.rodata.str1.1,\"aMS\", at progbits,1";
     PrivateGlobalPrefix = ".L";
     WeakRefDirective = "\t.weak\t";
     SetDirective = "\t.set\t";


More information about the llvm-commits mailing list