|
Post by benjamin on Dec 9, 2013 9:45:51 GMT -5
Hello, first of all, sorry for the maybe not best english here ;D. I have a problem with a simple test using multiple functions. I get the messages in the attachment when trying to build. In the function i want to test I use 2 other functions. So in my testape-test, I use in the EXECUTE statement in the testmain, I have the EXPECT makro with the 2 functions, so 2 makros. Then I call the function which uses the 2 other. This I compile, but it wont work. If i only use 1 Expect statement, doesnt matter which, it will work. But it never works if i use both. Attachments:
|
|
|
Post by Martin Nielsen on Dec 9, 2013 12:33:42 GMT -5
Hi Benjamin
Thanks for your feedback. I can see that you have used the -o option. It will save some files, that will help me analyze the problem.
Could you mail me these files please (martin [at] testape.com )
testape.c testape.err testape.log testape_prelink_args testape_prelink_result
Br, Martin
|
|
|
Post by Martin Nielsen on Dec 10, 2013 16:28:09 GMT -5
Hi
Thank you for the files.
testape.c which is generated by the instrumenter is incomplete. It do not contain stubs for all the unresolved externals.
This is the output
c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x7): undefined reference to `add$$tah' c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x44): undefined reference to `mult$$tah' c:\TEMP\ccd7BDhO.o: bad reloc address 0x20 in section `.eh_frame'
It should have looked like this
c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x7): undefined reference to `add$$tah' c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x44): undefined reference to `mult$$tah' c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x7): undefined reference to `testape_build_info' c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x44): undefined reference to `testape_error_handler' c:\TEMP\ccd7BDhO.o:mytestfunction_testape.c:(.text+0x7): undefined reference to `testape_validate_fp_accuracy'
I notice this is your output -->
c:\TEMP\ccd7BDhO.o: bad reloc address 0x20 in section `.eh_frame'
Which I think causes the linker to abort the linkage prematurely (before processing the testape.a). After having updated my version of mingw to the most recent version, I too have exactly the same problem locally with the files you send me. So, you're not doing anything wrong :-)
It might be a bit premature conclusion and without understanding the problem completely, I can't help feel that this is caused by an error in lastest mgw distribution.
I will continue to investigate, but currently I have not identifed a workaround that you can use.
Br, Martin
|
|
|
Post by Martin Nielsen on Dec 22, 2013 17:29:29 GMT -5
Hi Benjamin
I may have identified a workaround
if you modify the mytestfunction_testape.c like this -->
extern int testape_error_handler; extern int testape_validate_fp_accuracy; extern int testape_build_info;
void test_testfunktion4(void) { int dummy = testape_error_handler+ testape_validate_fp_accuracy+testape_build_info; EXPECT(add); EXPECT(mult); VALIDATE(myown_main(),0); }
Then your sample will run
The problem is related to testape.a not beeing a complete archieve and perhaps the order of the object files inside testape.a
Br, Martin
|
|