[llvm-dev] How to rewrite custom function in dfsan?
罗正雄 via llvm-dev
llvm-dev at lists.llvm.org
Thu May 9 01:54:38 PDT 2019
I am trying to rewrite the custom function __dfsw_read in
compiler-rt/lib/dfsan/dfsan_custom.cc, I wrote the function __dfsw_read
__dfsw_read (int __fd, void *__buf, size_t __nbytes,
dfsan_label __fd_label, dfsan_label __buf_label, dfsan_label
ssize_t ret = read(__fd, __buf, __nbytes);
if(ret != -1)
assign_taint_labels_exf(__buf, fd, ret, __nbytes);
fd += ret;
*ret_label = 0;
with following ABI List:
Then, I pack the lib with
clang -Wall -fPIC -fsanitize-blacklist=./dfsan_abilist.txt -o dfsan_lib.o
ar -rc dfsan_lib.o dfsan_lib.a
And then compile with my test program test.c
clang -fsanitize=dataflow -fsanitize-blacklist=./dfsan_abilist.txt -fPIC
Then error occurs which says that "__dfsw_read" has been defined in
Is there something I am missing or doing wrong in my steps?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev