openbsd: crt0.o file is different when build static or dynamic mode

it is a first step for support static *and* dynamic mode for openbsd
This commit is contained in:
Sébastien Marie 2020-12-14 14:01:39 +00:00 committed by Andrew Kelley
parent 8bf5a3a5c1
commit 96e3222796

View File

@ -1441,8 +1441,14 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void {
if (link_in_crt) {
const crt1o: []const u8 = o: {
if (target.os.tag == .netbsd or target.os.tag == .openbsd) {
if (target.os.tag == .netbsd) {
break :o "crt0.o";
} else if (target.os.tag == .openbsd) {
if (self.base.options.link_mode == .Static) {
break :o "rcrt0.o";
} else {
break :o "crt0.o";
}
} else if (target.isAndroid()) {
if (self.base.options.link_mode == .Dynamic) {
break :o "crtbegin_dynamic.o";