Skip to content

Commit dc93b11

Browse files
committed
[profile] Delete zero-size dummy sections
They were added so that if no metadata section is present, `__start_llvm_prf_*` references would not cause "undefined symbol" errors. By switching to undefined weak symbols in D96936, the dummy sections are not needed. This patch is also needed to work around https://sourceware.org/bugzilla/show_bug.cgi?id=27490 Differential Revision: https://reviews.llvm.org/D97648
1 parent 5419b67 commit dc93b11

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

compiler-rt/lib/profile/InstrProfilingPlatformLinux.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ extern char PROF_NAME_STOP COMPILER_RT_VISIBILITY COMPILER_RT_WEAK;
3838
extern ValueProfNode PROF_VNODES_START COMPILER_RT_VISIBILITY COMPILER_RT_WEAK;
3939
extern ValueProfNode PROF_VNODES_STOP COMPILER_RT_VISIBILITY COMPILER_RT_WEAK;
4040

41-
/* Add dummy data to ensure the section is always created. Add used attribute so
42-
* that they are linker GC roots on supported ELF platforms.
43-
*/
44-
__llvm_profile_data __prof_data_sect_data[0] COMPILER_RT_SECTION(
45-
INSTR_PROF_DATA_SECT_NAME) COMPILER_RT_USED;
46-
uint64_t __prof_cnts_sect_data[0] COMPILER_RT_SECTION(INSTR_PROF_CNTS_SECT_NAME)
47-
COMPILER_RT_USED;
48-
uint32_t __prof_orderfile_sect_data[0] COMPILER_RT_SECTION(
49-
INSTR_PROF_ORDERFILE_SECT_NAME) COMPILER_RT_USED;
50-
const char __prof_nms_sect_data[0] COMPILER_RT_SECTION(
51-
INSTR_PROF_NAME_SECT_NAME) COMPILER_RT_USED;
52-
ValueProfNode __prof_vnodes_sect_data[0] COMPILER_RT_SECTION(
53-
INSTR_PROF_VNODES_SECT_NAME) COMPILER_RT_USED;
54-
5541
COMPILER_RT_VISIBILITY const __llvm_profile_data *
5642
__llvm_profile_begin_data(void) {
5743
return &PROF_DATA_START;

0 commit comments

Comments
 (0)