문제

I am working on a very complex Linux driver. I am moving some files around trying to "cut the fat" a little bit. I have 4 "undefined!" symbols at the linking stage. I have searched my source code and I really don't know where these symbols are getting included.

I thought that if I did an objdump -DS on my compiled .ko and searched for the symbols, I might be able to tell from the surrounding decompiled source where they were coming from. But, when I search for the symbols, they aren't even found!

Is there a way to tell WHERE or HOW undefined symbols are getting included?

도움이 되었습니까?

해결책

Ok, I figured out a good way to do this.

I used nm -u to list the undefined symbols from my object files. (the .o files)

nm - list symbols from object files

Doing that one by one on each .o and searching for the symbols I knew were undefined showed me what file they were coming from. Then I had a starting place for finding the symbol in my actual .c file, or a header file included from that .c file.

Now it's not a needle in a haystack, but rather a needle in a chunk of hay that broke off of the haystack.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top