From 737e1d25692ff57699fddb379d62dd6ec1cb2006 Mon Sep 17 00:00:00 2001 From: zhaixiaojuan Date: Fri, 3 Feb 2023 11:47:27 +0800 Subject: [PATCH] loongarch64: calculate the ELF header flags --- compiler/rustc_codegen_ssa/src/back/metadata.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 19485175fd1..8ee7d8cf6d0 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -192,6 +192,10 @@ pub(crate) fn create_object_file(sess: &Session) -> Option { + // Source: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version + elf::EF_LARCH_OBJABI_V1 | elf::EF_LARCH_ABI_DOUBLE_FLOAT + } _ => 0, }; // adapted from LLVM's `MCELFObjectTargetWriter::getOSABI`