Closed niess closed 5 years ago
What does nm -D --defined-only ./libfoo.so
from the test directory say? There should be a GOT entry for the fn_vv, fn_ii, and fn_va functions.
Would you mind attaching here your generated libfoo.so
? (you might need to tar-gz it up first)
Hello,
In libfoo.so
, I have the following symbols:
$ nm -D --defined-only libfoo.so
0000000000201028 B __bss_start
0000000000201028 D _edata
0000000000201030 B _end
00000000000008a4 T _fini
00000000000007b2 T fn_ii
0000000000000847 T fn_ii_va
00000000000007d6 T fn_ili
00000000000007a9 T fn_iv
0000000000000799 T fn_vi
00000000000007ea T fn_vi_va
00000000000007c2 T fn_vli
0000000000000790 T fn_vv
0000000000000640 T _init
I attached gzip
s of the library and of the generated binary as well:
mmk_test.gz
libfoo.so.gz
I can reproduce this locally. It looks like the relocation type changed for these functions and they get stuffed in '.rela.dyn' instead of '.rela.plt'.
This should be fixed. Please confirm that this works on your end :)
Hello Franklin,
It works as well for me :) Thank you.
But to be honest, meanwhile I finally followed a pure C -but more invasive- mocking strategy. I have dedicated tests builds where the mocked functions are overridden with global function pointers, using macros. It does the job for me right now. But I'll keep Mimick
in mind for future uses. I would sure learn a lot from it digging further in your mixed C/assembly code :)
Cheers,
Valentin
Hello,
I am trying to use
Mimick
for unit testing some parts of my C code. I was seduced by the way it allows to plug in mock functions on the fly, without having to modify the base library, or auto-generating extra code.But, I could not get it to work so far, on Debian 9 with
gcc 6.3.0
. I always get the following error:Could not find GOT entry for function ...
. Note that I have the same when runningmmk_test
with v0.3.0. Below is how I compileMimick
and how I run the test:Am I doing something wrong? Should I pass extra options to CMake? This is what I get as ouptut: