Saturday, January 31, 2009

Linking errors

At work I am porting some software from Linux to VxWorks. The code has already been ported to VxWorks once, but that was several years ago with a different compiler and IDE. The code base has also evolved since that time, so there is code rot. The process has been slower than I would have liked, but it is coming along.

A problem I initially had was that the project would compile in the WindRiver Workbench IDE without any errors, but then it would not find things it was expecting for linking when I downloaded it to the PPC board. For the majority of the errors I could tell by the name what I needed to include in the module, but for one I was stymied.

That is, I was stymied until I remembered readelf -s. That command prints out the symbol table of the compiled code. I used the PPC version of this command on my module and the x86 version on the original linux port compiled with debug flags. Combined, that gave me the file name of the offending function call.

No comments: