Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
SystemAdmin
SystemAdmin
549 Posts
ACCEPTED ANSWER

Pinned topic On AIX 7.1, linker not seeing all .o's when run with kernel extension

‏2013-02-03T02:43:30Z |
Hello all,
I am porting from AIX 5.3 to AIX 7.1 a kernel extension for a virtual file system. It can be mounted over a directory in another file system. When you request a file in a directory in the file system, the kernel extension searches for the file along a given set of directories. I've fixed a few problems with help from others and have run into another one where I'd like some help again.

When I try to link multiple .o's to create a binary, it appears the main part of the link operation is passed only the first .o. The link fails because the symbols from the all the other .o's are unresolved.

For example, I run this command, and from output from the loadmap, from truss and from the kernel extension trace facility, I see only the first .o is passed. However, I can't tell why this is so. Any ideas why the subsequent .o's aren't being passed? I can provide more trace information if needed.

/usr/vacpp/bin/xlC_r HelloWorld.o HelloWorldFunc.o -blibpath:/usr/vacpp/lib:/usr/lib:/lib -o HelloWorld
Loadmap output:
exec: export(export,XL_CONFIG=/etc/vac.cfg.71:xlC_r,NULL)
exec: /bin/ld(ld,-b32,/lib/crt0.o,/lib/crti.o,-bpT:0x10000000,-bpD:0x20000000,HelloWorld.o,HelloWorldFunc.o,-blibpath:/usr/vacpp/lib:/usr/lib:/lib,-o,HelloWorld,-bloadmap:myloadmap,-bnoquiet,-bcdtors:all:0:s,-btmplrename,-L/usr/vac/lib,-lxlopt,-lxlipa,-lxl,-L/usr/vacpp/lib,-lC,-lpthreads,-lm,-lc,NULL) |
exec: /usr/vacpp/bin/c++filt(c++filt,-S,NULL) |
exec: /bin/sed(sed,/317.::virtual-fn-table-ptr$/ s/^\(.: \)*{*\(^}\)\(}.*\)::virtual-fn-table-ptr$/\1Virtual table for class "\2": Some possible causes are: first non-inline virtual function in "\2" is not defined; or the class is a template instantiation and an explicit instantiation definition of the class is missing./,NULL)
ld: 0711-317 ERROR: Undefined symbol: .sayHello()
(ld): halt 4
(ld): setopt tmplrename
(ld): setfflag 4
(ld): cdtors 0 all 0 s
(ld): savename HelloWorld
(ld): filelist 10 1 <<<<< This should be 11 instead of 10.
(ld): i /lib/crt0.o
(ld): i /lib/crti.o
(ld): i HelloWorld.o <<<<< HelloWorldFunc.o isn't here.
(ld): lib /usr/vac/lib/libxlopt.a
(ld): lib /usr/vac/lib/libxlipa.a
(ld): lib /usr/vac/lib/libxl.a
(ld): lib /usr/vacpp/lib/libC.a
(ld): lib /usr/lib/libpthreads.a
(ld): lib /usr/lib/libm.a
(ld): lib /usr/lib/libc.a
...

It may not matter...but from the kernel extension trace, I was surprised to see that the command seemed to be looking for "-oHelloWorld" and "-blibpath:" as if they are filenames.

Thank you very much for any help.
Curtis P. Meier
cmeier@us.ibm.com