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.
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\",@progbits,4"; + EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\",@progbits,8"; + SixteenByteConstantSection = + "\t.section\t.rodata.cst16,\"aM\",@progbits,16"; + CStringSection = "\t.section\t.rodata.str1.1,\"aMS\",@progbits,1"; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t";
_______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits