Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

symFindByName can't find symbol in system symbol table

720 views
Skip to first unread message

tsuru...@gmail.com

unread,
Mar 21, 2013, 12:37:01 AM3/21/13
to
Hi,

I am developing a C program for VxWorks6.4 in cross-compiling environment (WindRiver Workbench),and having a problem in symFindByName library function.

The below program should find the name "symbol_search" in the system symbol table but the function returns the errno meaning the name can't be found.

#include <stdio.h>
#include <symLib.h>
#include <sysSymTbl.h>

void symbol_search(void)
{
STATUS st;
char* name = "symbol_search";
char* value;
SYM_TYPE type;


st = symFindByName(sysSymTbl, name, &value, &type);
if (st == ERROR) {
printf("Can't find the symbol:%s\n", name);
printf("errno=%x\n", errno);
} else {
printf("Symbol:%s was found\n", name);
}
}

I loaded the program to the target and executed it from the shell on the target not on the host. Below is the screenshot of the target. As you see, the name CAN be found with lkup shell command but can't be found with the program. Any suggestions are great help.

VxWorks login: target
Password:
->
->
-> ld < /RAM/Sample/symbol_search.out
value = 1228675140 = 0x493c1844
->
->
-> symbol_search
Can't find the symbol:symbol_search
errno=1c0001
value = 13 = 0xd
->
->
-> lkup "symbol_search"
symbol_search 0x49ce6e30 text (symbol_search.out)
value = 0 = 0x0
->

Tom Tsuruta

tsuru...@gmail.com

unread,
Apr 4, 2013, 4:53:48 PM4/4/13
to
I realized that VxWorks put "_" before the symbol appearing in the source code when registering it to system symbol table. In above case, it will work if I change the line to

char* name = "_symbol_search";

Tom Tsuruta
0 new messages