openbsd: address link/Elf.zig comments

- restore correct behaviour on Android target for appending "crtend_android.o"
- some nits
master
Sébastien Marie 2020-10-11 10:12:40 +00:00
parent 97ec9fdd79
commit 9ff51f22b4
1 changed files with 5 additions and 5 deletions

View File

@ -1448,14 +1448,14 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
};
try argv.append(try comp.get_libc_crt_file(arena, crt1o));
if (target_util.libc_needs_crti_crtn(target)) {
const crtio: []const u8 = o: {
const crti_o = o: {
if (target.os.tag == .openbsd) {
break :o "crtbegin.o";
} else {
break :o "crti.o";
}
};
try argv.append(try comp.get_libc_crt_file(arena, crtio));
try argv.append(try comp.get_libc_crt_file(arena, crti_o));
}
}
@ -1599,8 +1599,8 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
// crt end
if (link_in_crt) {
if (target_util.libc_needs_crti_crtn(target)) {
const crtno: []const u8 = o: {
if (target.isAndroid() or target_util.libc_needs_crti_crtn(target)) {
const crtn_o = o: {
if (target.os.tag == .openbsd) {
break :o "crtend.o";
} else if (target.isAndroid()) {
@ -1609,7 +1609,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
break :o "crtn.o";
}
};
try argv.append(try comp.get_libc_crt_file(arena, crtno));
try argv.append(try comp.get_libc_crt_file(arena, crtn_o));
}
}