Skip to content

program links to libstdc++, not instructmented libc++ #146

@xiaozhouqi

Description

@xiaozhouqi

Firstly, I haved follow the guide to recompile instructmented libc++ for symbolic execution.
Secondly, Here is my demo program for testing c++ feature.
compiling command: sym++ vec.cpp -o vec.
I use ldd command to see the dependend so.
The exes link to the gun's libstdc++, not the instructmented libc++ i compiled.
Can somebody help me to solve this problem? very thank you.

~/workspace/symcc_demo/vector_case$ ldd vec
linux-vdso.so.1 (0x00007ffe32de8000)
libachk.so => /lib/libachk.so (0x00007f23e11f9000)
libSymRuntime.so => /home/q00502037/software/symcc/build/SymRuntime-prefix/src/SymRuntime-build/libSymRuntime.so (0x00007f23e0d23000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f23e099a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f23e05fc000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f23e03e4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f23dfff3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f23dfdef000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f23dfbd0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f23df9c8000)
libz3.so.4.12 => /usr/local/lib/libz3.so.4.12 (0x00007f23ddfa8000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f23ddd7e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f23e13ff000)

------------Deomo---------------
#include
#include
#include
#include

using namespace std;

class People
{
public:
People(string name, int age, vector entry) : name(name), age(age), entry(entry) {}
public:
string name;
int age;
vector entry;

};

bool FunA(People *p)
{
if (p->entry[0] == 1234) {
return true;
} else if (p->entry[1] == 1234) {
return true;
} else {
return false;
}
}

int main(int argc, char **argv)
{
// char *file = argv[1];
// string file = "./seed";
// ifstream ifile(cin, ios::in);
string temp;
vector res;
while(getline(cin, temp)) {
res.push_back(temp);
}
string name = res[0];
int age = stoi(res[1]);
vector entry;
for (int i = 2; i < res.size(); ++i) {
entry.push_back(stoi(res[i]));
}
People p(name, age, entry);
cout << p.name << " " << p.age << endl;
for (auto &i : p.entry) {
cout << i << endl;
}
FunA(&p);
// for (string &it : res) {
// cout << it << endl;
// }
return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions