[klee-dev] .equ directive handling & KLEE linking process

Gleb Popov 6yearold at gmail.com
Fri Nov 22 07:23:12 GMT 2019


Hello.

I'm working on adding support for following module-level inline asm in KLEE:

module asm ".weak foo"
module asm ".equ foo, foo_stub"

@foo = external global i32
@foo_stub = global i32 0

I've added code to KModule to parse such asm statements and do
@foo->replaceAllUsesWith(@foo_stub). However, it turned out that KLEE
doesn't link a bitcode module containing definition of @foo_stub, because
it uses "smart" linking procedure that decides that the module is "unused"
and there is no point linking it.

Before hacking on GetAllUndefinedSymbols() from ModuleUtil.cpp I checked
what's current state of Linker in LLVM itself, since GetAllUndefinedSymbols
was borrowed from there. It turned out, that there is no such function
anymore.

Why can't we just use plain LLVM Linker class to linker .bca contents?
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the klee-dev mailing list