# insufficient field length
continue
arch = fields[0]
- obj = fields[1]
+ obj = os.path.realpath(fields[1])
soname = fields[2]
path = fields[3].replace("${ORIGIN}", os.path.dirname(obj)).replace("$ORIGIN", os.path.dirname(obj)).split(":")
needed = fields[4].split(",")
plib_dict = plib_registry.getPreservedLibs()
for cpv in plib_dict:
plib_dict[cpv].sort()
+ # for the loop below to work correctly, we need all
+ # symlinks to come before the actual files, such that
+ # the recorded symlinks (sonames) will be resolved into
+ # their real target before the object is found not to be
+ # in the reverse NEEDED map
+ def symlink_compare(x, y):
+ if os.path.islink(x):
+ if os.path.islink(y):
+ return 0
+ else:
+ return -1
+ elif os.path.islink(y):
+ return 1
+ else:
+ return 0
+
+ plib_dict[cpv].sort(symlink_compare)
for f in plib_dict[cpv]:
if not os.path.exists(f):
continue