From c4a7e6b56218e1d5a858682186b542e2eae01a4a Mon Sep 17 00:00:00 2001 From: liuzhensong Date: Thu, 4 Aug 2022 14:30:39 +0800 Subject: LoongArch: Update ELF e_flags handling according to specification. Update handling of e_flags according to the documentation update [1] (discussions [2][3]). Object file bitness is now represented in the EI_CLASS byte. The e_flags field is now interpreted as follows: e_flags[2:0]: Base ABI modifier - 0x1: soft-float - 0x2: single-precision hard-float - 0x3: double-precision hard-float e_flags[7:6]: ELF object ABI version - 0x0: v0 - 0x1: v1 [1]: https://github.com/loongson/LoongArch-Documentation/blob/main/docs/LoongArch-ELF-ABI-EN.adoc#e_flags-identifies-abi-type-and-version [2]: https://github.com/loongson/LoongArch-Documentation/pull/61 [3]: https://github.com/loongson/LoongArch-Documentation/pull/47 --- binutils/readelf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'binutils/readelf.c') diff --git a/binutils/readelf.c b/binutils/readelf.c index b1dbcad06f5..351571c8abb 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4343,11 +4343,6 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine) } break; case EM_LOONGARCH: - if (EF_LOONGARCH_IS_LP64 (e_flags)) - strcat (buf, ", LP64"); - else if (EF_LOONGARCH_IS_ILP32 (e_flags)) - strcat (buf, ", ILP32"); - if (EF_LOONGARCH_IS_SOFT_FLOAT (e_flags)) strcat (buf, ", SOFT-FLOAT"); else if (EF_LOONGARCH_IS_SINGLE_FLOAT (e_flags)) @@ -4355,6 +4350,11 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine) else if (EF_LOONGARCH_IS_DOUBLE_FLOAT (e_flags)) strcat (buf, ", DOUBLE-FLOAT"); + if (EF_LOONGARCH_IS_OBJ_V0 (e_flags)) + strcat (buf, ", OBJ-v0"); + else if (EF_LOONGARCH_IS_OBJ_V1 (e_flags)) + strcat (buf, ", OBJ-v1"); + break; } } -- cgit v1.2.3