Skip to content

Commit bacee5c

Browse files
committed
[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. llvm-svn: 299804
1 parent 75631c9 commit bacee5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/cfi/cfi.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ uptr find_cfi_check_in_dso(dl_phdr_info *info) {
231231
if (p->st_name >= strsz) break;
232232
char *name = (char*)(strtab + p->st_name);
233233
if (strcmp(name, "__cfi_check") == 0) {
234-
assert(p->st_info == ELF32_ST_INFO(STB_GLOBAL, STT_FUNC));
234+
assert(p->st_info == ELF32_ST_INFO(STB_GLOBAL, STT_FUNC) ||
235+
p->st_info == ELF32_ST_INFO(STB_WEAK, STT_FUNC));
235236
uptr addr = info->dlpi_addr + p->st_value;
236237
return addr;
237238
}

0 commit comments

Comments
 (0)