summaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorliuzhensong <liuzhensong@loongson.cn>2022-08-04 14:30:39 +0800
committerliuzhensong <liuzhensong@loongson.cn>2022-09-30 14:00:47 +0800
commitc4a7e6b56218e1d5a858682186b542e2eae01a4a (patch)
treecc3a1b9f8227ed91cea78da16773225743d1ebc5 /binutils
parent0d94a8735055432029237612a6eb9165db1ec9dd (diff)
downloadbinutils-gdb-c4a7e6b56218e1d5a858682186b542e2eae01a4a.tar.gz
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
Diffstat (limited to 'binutils')
-rw-r--r--binutils/readelf.c10
1 files changed, 5 insertions, 5 deletions
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;
}
}