-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Labels
LTOLink time optimization (regular/full LTO or ThinLTO)Link time optimization (regular/full LTO or ThinLTO)compiler-rt:cfiControl Flow IntegrityControl Flow Integrity
Description
cat ../a.c
__attribute__((alias("g"), visibility("default"))) void f(void);
__attribute__((visibility("default"))) void g(void) {}
cat ../b.c
__attribute__((weak, visibility("default"))) void f(void) { }
int main(int argc, char **argv) {
argv[0] = (char *)f;
void (*fp)(void) = (void (*)(void))argv[0];
fp();
}
clang ../a.c ../b.c -fsanitize=cfi-icall -flto=thin -fvisibility=hidden -fuse-ld=lld -o x -Wl,-save-temps -Wl,--thinlto-jobs=1
ld.lld: error: undefined hidden symbol: f.cfi
>>> referenced by ld-temp.o
>>> x.lto.o:(f)
>>> did you mean: g.cfi
>>> defined in: /tmp/x.lto.a-3b6dcc.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Metadata
Metadata
Assignees
Labels
LTOLink time optimization (regular/full LTO or ThinLTO)Link time optimization (regular/full LTO or ThinLTO)compiler-rt:cfiControl Flow IntegrityControl Flow Integrity