Previously all the 'goto out' statements here returned success ratherafter the image was loaded into
than an error despite some comments asserting that these should returnmemory returned success rather than an error. This is despite comments
failure. In adindicating some of these conditionns were in fact errors, when failing to looking up the symbols for theand some of
linker set, those cases returned failure leaking memory (though it'sthese error conditions (such as missing PT_DYNAMIC) are treated as errors
clear from the original code from commit ca49b3342d1e that only thein the kernel linker.
In addition, when failing to looking up the symbols for the linker
second t, those cases returned failure leaking memory (though it's clear
from the original code from commit ca49b3342d1e that only the second
failure was intended to be an actual error).
To avoid more confusion, move the assignment of `ret` to just before
the `out` label so that `goto out` always returns an error. This is a
more consistent pattern with other code in the tree that tends to use
labels for the error case.
To minimize unexpected fallout, treat several of the currentRestructure some other code to avoid a few bogus errors.
cases in the module metadata parsing as non-fatal.Specifically, a symbol table is not required so don't treat lack of a
symbol table as an error. Also, if the start symbol for the module
metadata linker set is not found, don't treat that as an error either.