Slightly reorganize code in the linker_load_dependancies() function to make

codepath more straightforward.
This commit is contained in:
bp 2001-03-22 07:55:33 +00:00
parent cc245046cd
commit 14549fec64

View File

@ -1313,7 +1313,8 @@ linker_load_dependancies(linker_file_t lf)
deps = (struct linker_set*)
linker_file_lookup_symbol(lf, MDT_SETNAME, 0);
if (deps != NULL) {
if (deps == NULL)
return 0;
for (i = 0; i < deps->ls_length; i++) {
mp = linker_reloc_ptr(lf, deps->ls_items[i]);
if (mp->md_type != MDT_VERSION)
@ -1324,8 +1325,6 @@ linker_load_dependancies(linker_file_t lf)
return EEXIST;
}
}
}
if (deps != NULL) {
for (i = 0; i < deps->ls_length; i++) {
mp = linker_reloc_ptr(lf, deps->ls_items[i]);
if (mp->md_type != MDT_DEPEND)
@ -1359,8 +1358,8 @@ linker_load_dependancies(linker_file_t lf)
}
}
}
if (error == 0 && deps) {
if (error)
return error;
for (i = 0; i < deps->ls_length; i++) {
mp = linker_reloc_ptr(lf, deps->ls_items[i]);
if (mp->md_type != MDT_VERSION)
@ -1373,6 +1372,5 @@ linker_load_dependancies(linker_file_t lf)
mod->name = modname;
TAILQ_INSERT_TAIL(&found_modules, mod, link);
}
}
return error;
}