summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingWriter.c
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-02-26 02:49:41 +0000
committerVedant Kumar <vsk@apple.com>2016-02-26 02:49:41 +0000
commit637ea58edc2dceb16b7b5f1fd4c90de408ee9833 (patch)
tree5e98b8c7e2c826b2f82c894df116b08122a87247 /lib/profile/InstrProfilingWriter.c
parente315ca2ddacbcc8b83a805dafe6508327505831d (diff)
[profile] Compute number of data entries correctly
Compiler-rt miscalculates the number of entries in the __llvm_prf_data section on i386 Darwin. This results in a number of test failures (which we started catching after r261344). The fix we attempted earlier is insufficient (r261683). It caused some tests to start passing again, but that hid the fact that we drop some data entries. This patch should fix the real problem. It fixes the way we compute DataSize by taking into account the way the Darwin linker lays out __llvm_prf_data. Differential Revision: http://reviews.llvm.org/D17623 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingWriter.c')
-rw-r--r--lib/profile/InstrProfilingWriter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingWriter.c b/lib/profile/InstrProfilingWriter.c
index a07bc538e..93879bbc8 100644
--- a/lib/profile/InstrProfilingWriter.c
+++ b/lib/profile/InstrProfilingWriter.c
@@ -144,7 +144,7 @@ COMPILER_RT_VISIBILITY int llvmWriteProfDataImpl(
const char *NamesBegin, const char *NamesEnd) {
/* Calculate size of sections. */
- const uint64_t DataSize = DataEnd - DataBegin;
+ const uint64_t DataSize = __llvm_profile_get_data_size(DataBegin, DataEnd);
const uint64_t CountersSize = CountersEnd - CountersBegin;
const uint64_t NamesSize = NamesEnd - NamesBegin;
const uint64_t Padding = __llvm_profile_get_num_padding_bytes(NamesSize);