Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld-elf2flt: behave properly when called with a name different from TA… #8

Merged
merged 1 commit into from
Dec 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions ld-elf2flt.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,15 @@ int main(int argc, char *argv[])
the host while those in <TARGET_ALIAS>/lib are for the target.
Make bindir point to the bin dir for bin/<TARGET_ALIAS>-foo.
Make tooldir point to the bin dir for <TARGET_ALIAS>/bin/foo. */
if (streqn(elf2flt_progname, TARGET_ALIAS)) {
tmp = concat(argv0_dir, "../" TARGET_ALIAS "/bin", NULL);
if (streqn(elf2flt_progname, "ld")) {
tmp = concat(argv0_dir, "../../bin", NULL);
if (stat(tmp, &buf) == 0 && S_ISDIR(buf.st_mode)) {
tooldir = concat(tmp, "/", NULL);
bindir = concat(tmp, "/", NULL);
}
} else {
tmp = concat(argv0_dir, "../../bin", NULL);
tmp = concat(argv0_dir, "../" TARGET_ALIAS "/bin", NULL);
if (stat(tmp, &buf) == 0 && S_ISDIR(buf.st_mode)) {
bindir = concat(tmp, "/", NULL);
tooldir = concat(tmp, "/", NULL);
}
}

Expand Down