This is a discussion on path component not found (errno = ENOENT) within the AIX Operating System forums, part of the Unix Operating Systems category; --> I've got this error while loading some shared libs. I search for missing symbol problem but did not find ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I've got this error while loading some shared libs. I search for missing symbol problem but did not find anything. I remember that when there is a missing symbol, I got the error `` the lib is not in exec format''. We deliver ``instruments'' which are in fact a series of shared libraries. They are all linked with a -blibpath=/usr/lib. When the main application wants to load the ``instrument'' shared lib, it looks at a specific file calld <shared-libname>.preload where each lines contains lib to load one after the other. So the LIBPATH is not in fault. This works fine for several instrument. One instrument is different and requires additional libs. Our problem raises only for this one. What does mean path component not found (errno = ENOENT) ? BTW we have three targets plateforms, solaris, aix and NT. Solaris is fine but neither aix nor NT works ... I did not find any missing symbol. Any suggestion ? .... I got more and more confused ... |
| |||
| christophe.delarue@gmail.com wrote: > We deliver ``instruments'' which are in fact a series of shared > libraries. They are all linked with a -blibpath=/usr/lib. When the main > application wants to load the ``instrument'' shared lib, it looks at a > specific file calld <shared-libname>.preload where each lines contains > lib to load one after the other. So the LIBPATH is not in fault. > > This works fine for several instrument. One instrument is different and > requires additional libs. Our problem raises only for this one. > > What does mean path component not found (errno = ENOENT) ? It means something wasn't found. The dependents of the lib to be loaded must be in an accessible location. I.e. your file points to your instrument, probably with a path, but the dependents of the instrument must also be found. This is usually done by (a) having them in a known location (like /usr/lib) or (b) having the parent module (your instrument) contain path information that points to it's dependents. So, the library search path is the issue, and you'll have to either use well-known locations when you build this one module, or link the dependents into /usr/lib or some other known directory. -- Gary R. Hook __________________________________________________ ______________________ Vocatus atque non vocatus deus aderit |
| |||
| Hi, The path is known : let foo.a be the shared lib to be loaded, there is a foo.preload : ---------- libbar.a libbrar2.a --------- each lib bar is read one after the other with ((void *) dlopen( file.c_str(), RTLD_LAZY | RTLD_GLOBAL ) ) ; The script I wrote to parse the symbols is : ----------------------------------------- #! /usr/bin/env python import os, commands, re, sys from optparse import OptionParser if __name__ == '__main__': parser = OptionParser() parser.add_option("-c" , "--check", help="The librarie where undef symbols has to be found", type="string", dest="check") parser.add_option("-l" , "--libraries", help="The librarie names where symbols can be found", type="string", action="append", dest="libraries") options, arg = parser.parse_args() # Get the undef symbols by grepping the undef in dump status, SYMLines=commands.getstatusoutput("dump -HTv " + options.check + " | grep undef | grep -v libc.a | grep -v libC.a") SYMLines = SYMLines.split('\n') if len(SYMLines) == 1 and SYMLines[0] == "": print "All syms are resolved", SYMLines sys.exit(-1) if status != 0: print "dump failed", commands.getstatusoutput("dump -HTv " + options.check) sys.exit(-1) syms = [aLine.split()[-1] for aLine in SYMLines] print "Finding %s undef symbols from %s\n" % (len(syms),os.path.basename(options.check)) symbols= {} for lib in options.libraries: symbols[lib] = [] # Check wether to use dump or nm depeding of shared lir or not shared = commands.getoutput("/usr/bin/dump -ov " + lib + " | head -10 | grep SHROBJ") if shared == "": res=commands.getoutput("nm -C " + lib) symbols[lib] = re.findall(re.compile("^\.([A-Za-z_0-9]+)[ \t]+T+[ \t]+[0-9]+$",re.MULTILINE), res) else: cmd = "/usr/bin/dump -HTv " + lib #print cmd res= commands.getoutput(cmd) # Defined symbols are founded on line with EXP and either DS or RW ? symbols[lib] = re.findall("EXP[ \t]+[DSRW]+[ \t]+\w+[ \t]+\[noIMid\][ \t]+(?P<sym>[A-Za-z0-9_]+)", res) print "Founded symbols in %-40s : %5d" %(os.path.basename(lib),len(symbols[lib])) for sym in syms: #print "Finding", sym, found = None for lib in options.libraries: if sym in symbols[lib]: #print "in", lib found = 1 break if not found: print sym, "not founded" ----------------------------------------- Is this enough to find missing/defined symbols ... thank's |