[compiler-rt] r299804 - [cfi] Accept weak definition of __cfi_check.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 15:52:09 PDT 2017


Author: eugenis
Date: Fri Apr  7 17:52:08 2017
New Revision: 299804

URL: http://llvm.org/viewvc/llvm-project?rev=299804&view=rev
Log:
[cfi] Accept weak definition of __cfi_check.

https://reviews.llvm.org/D31796 results in LLD emitting __cfi_check
as a weak symbol, while Gold keeps it strong. Accept both.

Modified:
    compiler-rt/trunk/lib/cfi/cfi.cc

Modified: compiler-rt/trunk/lib/cfi/cfi.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/cfi/cfi.cc?rev=299804&r1=299803&r2=299804&view=diff
==============================================================================
--- compiler-rt/trunk/lib/cfi/cfi.cc (original)
+++ compiler-rt/trunk/lib/cfi/cfi.cc Fri Apr  7 17:52:08 2017
@@ -231,7 +231,8 @@ uptr find_cfi_check_in_dso(dl_phdr_info
     if (p->st_name >= strsz) break;
     char *name = (char*)(strtab + p->st_name);
     if (strcmp(name, "__cfi_check") == 0) {
-      assert(p->st_info == ELF32_ST_INFO(STB_GLOBAL, STT_FUNC));
+      assert(p->st_info == ELF32_ST_INFO(STB_GLOBAL, STT_FUNC) ||
+             p->st_info == ELF32_ST_INFO(STB_WEAK, STT_FUNC));
       uptr addr = info->dlpi_addr + p->st_value;
       return addr;
     }




More information about the llvm-commits mailing list