File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 66|*
77\*===----------------------------------------------------------------------===*/
88
9+ // This file defines profile data symbols for ELF, wasm, XCOFF. It assumes
10+ // __start_ and __stop_ symbols for profile data point at the beginning and
11+ // end of the sections in question. (This is technically a linker feature,
12+ // not a file format feature, but linkers for these targets support it.)
13+ //
14+ // MachO (MacOS/iOS) and PE-COFF (Windows) have a similar support, but the
15+ // identifiers are different, so the support is in separate files.
16+ //
17+ // Support for targets which don't have linker support is in
18+ // InstrProfilingPlatformOther.c.
19+ //
20+ // This file also contains code to extract ELF build IDs from the ELF file,
21+ // to identify the build which generated the file.
22+
923#if defined(__linux__ ) || defined(__FreeBSD__ ) || defined(__Fuchsia__ ) || \
1024 (defined(__sun__ ) && defined(__svr4__ )) || defined(__NetBSD__ ) || \
1125 defined(_AIX ) || defined(__wasm__ ) || defined(__HAIKU__ ) || \
1226 defined(COMPILER_RT_PROFILE_BAREMETAL )
1327
14- #ifndef COMPILER_RT_PROFILE_BAREMETAL
15- #if !defined(_AIX ) && !defined(__wasm__ )
28+ #if !defined(_AIX ) && !defined(__wasm__ ) && \
29+ !defined(COMPILER_RT_PROFILE_BAREMETAL )
30+ // Includes for non-baremetal ELF targets, used to output build IDs.
1631#include <elf.h>
1732#include <link.h>
18- #endif
1933#include <stdlib.h>
2034#include <string.h>
2135#endif
Original file line number Diff line number Diff line change 66|*
77\*===----------------------------------------------------------------------===*/
88
9+ // This file defines a fallback implementation to compute the locations of
10+ // profile data sections, for targets that don't have linker support. No
11+ // commonly used targets use this codepath.
12+ //
13+ // This implementation expects the compiler instrumentation pass to define a
14+ // constructor in each file which calls into this file.
15+
916#if !defined(__APPLE__ ) && !defined(__linux__ ) && !defined(__FreeBSD__ ) && \
1017 !defined(__Fuchsia__ ) && !(defined(__sun__ ) && defined(__svr4__ )) && \
1118 !defined(__NetBSD__ ) && !defined(_WIN32 ) && !defined(_AIX ) && \
You can’t perform that action at this time.
0 commit comments