Skip to content

Commit f66b9fe

Browse files
committed
[crt] Remove __USER_LABEL_PREFIX__
The .init_array code is ELF specific. For ELF platforms, `__USER_LABEL_PREFIX__` is defined as "". Make the simplification so that downstream ELF targets can build this file even if `__USER_LABEL_PREFIX__` is undefined. Reviewed By: barannikov88 Differential Revision: https://reviews.llvm.org/D147093
1 parent 0efe111 commit f66b9fe

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

compiler-rt/lib/crt/crtbegin.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@ __attribute__((section(".init_array"),
5050
used)) static void (*__init)(void) = __do_init;
5151
#elif defined(__i386__) || defined(__x86_64__)
5252
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
53-
"call " __USER_LABEL_PREFIX__ "__do_init\n\t"
54-
".popsection");
53+
"call __do_init\n\t"
54+
".popsection");
5555
#elif defined(__riscv)
5656
__asm__(".pushsection .init,\"ax\",%progbits\n\t"
57-
"call " __USER_LABEL_PREFIX__ "__do_init\n\t"
57+
"call __do_init\n\t"
5858
".popsection");
5959
#elif defined(__arm__) || defined(__aarch64__)
6060
__asm__(".pushsection .init,\"ax\",%progbits\n\t"
61-
"bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
62-
".popsection");
61+
"bl __do_init\n\t"
62+
".popsection");
6363
#elif defined(__powerpc__) || defined(__powerpc64__)
6464
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
65-
"bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
66-
"nop\n\t"
67-
".popsection");
65+
"bl __do_init\n\t"
66+
"nop\n\t"
67+
".popsection");
6868
#elif defined(__sparc__)
6969
__asm__(".pushsection .init,\"ax\",@progbits\n\t"
70-
"call " __USER_LABEL_PREFIX__ "__do_init\n\t"
71-
".popsection");
70+
"call __do_init\n\t"
71+
".popsection");
7272
#else
7373
#error "crtbegin without .init_fini array unimplemented for this architecture"
7474
#endif // CRT_HAS_INITFINI_ARRAY
@@ -103,25 +103,25 @@ __attribute__((section(".fini_array"),
103103
used)) static void (*__fini)(void) = __do_fini;
104104
#elif defined(__i386__) || defined(__x86_64__)
105105
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
106-
"call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
107-
".popsection");
106+
"call __do_fini\n\t"
107+
".popsection");
108108
#elif defined(__arm__) || defined(__aarch64__)
109109
__asm__(".pushsection .fini,\"ax\",%progbits\n\t"
110-
"bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
111-
".popsection");
110+
"bl __do_fini\n\t"
111+
".popsection");
112112
#elif defined(__powerpc__) || defined(__powerpc64__)
113113
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
114-
"bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
115-
"nop\n\t"
116-
".popsection");
114+
"bl __do_fini\n\t"
115+
"nop\n\t"
116+
".popsection");
117117
#elif defined(__riscv)
118118
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
119-
"call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
119+
"call __do_fini\n\t"
120120
".popsection");
121121
#elif defined(__sparc__)
122122
__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
123-
"call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
124-
".popsection");
123+
"call __do_fini\n\t"
124+
".popsection");
125125
#else
126126
#error "crtbegin without .init_fini array unimplemented for this architecture"
127127
#endif // CRT_HAS_INIT_FINI_ARRAY

0 commit comments

Comments
 (0)