builtins: cleanup constant data section selection

Each of the object formats use a different directive for selecting the constant
section.  Use a macro to avoid the duplication across a number of files.  Also
correct a small macro mismatch on the Windows case (HIDDEN_DIRECTIVE -> HIDDEN).

Patch by Vadim Chugunov!

llvm-svn: 223910
This commit is contained in:
Saleem Abdulrasool 2014-12-10 02:36:22 +00:00
parent 20962292e8
commit 1fe0c18914
8 changed files with 14 additions and 58 deletions

View File

@ -28,6 +28,7 @@
// tell linker it can break up file at label boundaries
#define FILE_LEVEL_DIRECTIVE .subsections_via_symbols
#define SYMBOL_IS_FUNC(name)
#define CONST_SECTION .const
#elif defined(__ELF__)
@ -39,10 +40,11 @@
#else
#define SYMBOL_IS_FUNC(name) .type name,@function
#endif
#define CONST_SECTION .section .rodata
#else // !__APPLE__ && !__ELF__
#define HIDDEN_DIRECTIVE(name)
#define HIDDEN(name)
#define LOCAL_LABEL(name) .L ## name
#define FILE_LEVEL_DIRECTIVE
#define SYMBOL_IS_FUNC(name) \
@ -50,6 +52,7 @@
.scl 2 SEPARATOR \
.type 32 SEPARATOR \
.endef
#define CONST_SECTION .section .rdata,"rd"
#endif

View File

@ -7,13 +7,7 @@
#ifdef __i386__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
twop52:

View File

@ -17,13 +17,7 @@
#ifdef __i386__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
twop52:

View File

@ -18,7 +18,7 @@
#ifdef __i386__
.const
CONST_SECTION
.balign 3
.quad 0x43f0000000000000
@ -52,13 +52,7 @@ END_COMPILERRT_FUNCTION(__floatundisf)
#ifdef __i386__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
twop52:

View File

@ -7,13 +7,7 @@
#ifdef __i386__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
twop52:

View File

@ -17,13 +17,7 @@
#ifdef __x86_64__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
twop52:

View File

@ -7,13 +7,7 @@
#ifdef __x86_64__
#if defined(__APPLE__)
.literal4
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
two:

View File

@ -7,13 +7,7 @@
#ifdef __x86_64__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.section .rodata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 16
twop64:
@ -42,13 +36,8 @@ END_COMPILERRT_FUNCTION(__floatundixf)
#ifdef __x86_64__
#if defined(__APPLE__)
.const
#elif defined(__ELF__)
.rdata
#else
.section .rdata,"rd"
#endif
CONST_SECTION
.balign 4
twop52:
.quad 0x4330000000000000