Skip to content

Commit 737e1d2

Browse files
zhaixiaojuanheiher
authored andcommitted
loongarch64: calculate the ELF header flags
1 parent b7c5323 commit 737e1d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: compiler/rustc_codegen_ssa/src/back/metadata.rs

+4
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
192192
}
193193
e_flags
194194
}
195+
Architecture::LoongArch64 => {
196+
// Source: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
197+
elf::EF_LARCH_OBJABI_V1 | elf::EF_LARCH_ABI_DOUBLE_FLOAT
198+
}
195199
_ => 0,
196200
};
197201
// adapted from LLVM's `MCELFObjectTargetWriter::getOSABI`

0 commit comments

Comments
 (0)