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

A problem about using vxWorks's loader function loadModule?

484 views
Skip to first unread message

Lize,Wang

unread,
Apr 30, 2004, 8:32:02 AM4/30/04
to
After Configuring vxWorks with #define INCLUDE_LOADER,I use the code
segments to download a object module from host machine:

int fd,result,err;
netDevCreate("wrs:", "host", 1);/*1 means use ftp*/
fd = open("wrs:D:/Tornado/target/proj/Project6/I80486gnu/test.o",O_RDWR,0);
result = loadModule(fd, LOAD_GLOBAL_SYMBOLS);
err = errnoGet();
printErrno(err);

Having used Tornado's debugger,I got the following
result,result=0,err=0x3d0001,printErrno=""S_objLib_OBJ_ID_ERROR".can

somebody explain me what the meaning of "S_objLib_OBJ_ID_ERROR",:
loadAoutLib error: can't add 'test.o_text' to system symbol table -
error = 0x3d
0001.
loadAoutLib error: can't add 'test.o_data' to system symbol table -
error = 0x3d
0001.
loadAoutLib error: can't add 'test.o_bss' to system symbol table -
error = 0x3d0
001.
loadAoutLib error: can't add '_test' to system symbol table - error =
0x3d0001.
undefined symbol: _printf
S_objLib_OBJ_ID_ERROR

Joe Durusau

unread,
May 1, 2004, 9:30:06 AM5/1/04
to

Well, first of all, re-write the code to check the return from each
and every system call. That will tell you whether netDevCreate,
open, or loadModule is the source of the error. This kind of error
is usually the result of permissions being incorrect or something
of that sort, but that's only a guess at this point.


Speaking only for myself,

Joe Durusau

Lize,Wang

unread,
May 5, 2004, 7:00:12 AM5/5/04
to
Joe Durusau <dur...@bellsouth.net> wrote in message news:<4093A65E...@bellsouth.net>...

Hi Mr Joe Durusau,
I followed your advise and used the following fragment code:
cd("host:E:/bootvx/");
pwd();
err = errnoGet();// [1]
printErrno(err);
fdsrc = open("test.o",O_RDONLY, 0);
err = errnoGet();// [2]
printErrno(err);
result = loadModule(fdsrc, LOAD_GLOBAL_SYMBOLS);
err = errnoGet();// [3]
printErrno(err);
close(fdsrc);
Then I got the debugger's virtual console output:
OK.
host:E:/bootvx
Unknown errno = 0xdd.
Unknown errno = 0xdd.


loadAoutLib error: can't add 'test.o_text' to system symbol table -
error = 0x3d
0001.
loadAoutLib error: can't add 'test.o_data' to system symbol table -
error = 0x3d
0001.
loadAoutLib error: can't add 'test.o_bss' to system symbol table -
error = 0x3d0
001.
loadAoutLib error: can't add '_test' to system symbol table - error =
0x3d0001.

S_objLib_OBJ_ID_ERROR
This time,I got two errors.Form place [2], the error code is
0xdd,and place [3],0x3d0001.Though module test.o cannot be loaded
indeed,I got an MODULE_ID=535245644.
I think I must seek help from you,thanks a lot.

joe durusau

unread,
May 5, 2004, 7:57:36 AM5/5/04
to

"Lize,Wang" wrote:

Don't check errno unless a function has returned ERROR, or whatever it
returns in the event of error. errno is not valid unless a system function has
returned error. You cannot do anything at all (at least in terms of
system calls) between the function that fails and saving of errno somewhere.

i.e.

fdsrc = open("test.o",O_RDONLY, 0);

if(fdsrc == ERROR)
{
printf("errno was %08X\n",errno);
}
else
{
printf("open was OK\n");
}

...

BTW, 0xdd == 221, which I believe is some sort of a status return from FTP.
I've never used FTP to transfer files with vxWorks, but other have. You might
want to search google for ftp problems with vxWorks. It seems to me that
you may need a patch.

0 new messages