diff options
author | liuzhensong <liuzhensong@loongson.cn> | 2022-08-04 14:30:39 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2022-09-30 14:00:47 +0800 |
commit | c4a7e6b56218e1d5a858682186b542e2eae01a4a (patch) | |
tree | cc3a1b9f8227ed91cea78da16773225743d1ebc5 /gas | |
parent | 0d94a8735055432029237612a6eb9165db1ec9dd (diff) | |
download | gdb-c4a7e6b56218e1d5a858682186b542e2eae01a4a.zip gdb-c4a7e6b56218e1d5a858682186b542e2eae01a4a.tar.gz gdb-c4a7e6b56218e1d5a858682186b542e2eae01a4a.tar.bz2 |
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 'gas')
-rw-r--r-- | gas/config/tc-loongarch.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 5bb8d31..60149a6 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -143,13 +143,13 @@ md_parse_option (int c, const char *arg) char ilp32[256] = ""; unsigned char *suf = (unsigned char *)arg; - lp64['s'] = lp64['S'] = EF_LOONGARCH_ABI_LP64_SOFT_FLOAT; - lp64['f'] = lp64['F'] = EF_LOONGARCH_ABI_LP64_SINGLE_FLOAT; - lp64['d'] = lp64['D'] = EF_LOONGARCH_ABI_LP64_DOUBLE_FLOAT; + lp64['s'] = lp64['S'] = EF_LOONGARCH_ABI_SOFT_FLOAT; + lp64['f'] = lp64['F'] = EF_LOONGARCH_ABI_SINGLE_FLOAT; + lp64['d'] = lp64['D'] = EF_LOONGARCH_ABI_DOUBLE_FLOAT; - ilp32['s'] = ilp32['S'] = EF_LOONGARCH_ABI_ILP32_SOFT_FLOAT; - ilp32['f'] = ilp32['F'] = EF_LOONGARCH_ABI_ILP32_SINGLE_FLOAT; - ilp32['d'] = ilp32['D'] = EF_LOONGARCH_ABI_ILP32_DOUBLE_FLOAT; + ilp32['s'] = ilp32['S'] = EF_LOONGARCH_ABI_SOFT_FLOAT; + ilp32['f'] = ilp32['F'] = EF_LOONGARCH_ABI_SINGLE_FLOAT; + ilp32['d'] = ilp32['D'] = EF_LOONGARCH_ABI_DOUBLE_FLOAT; switch (c) { @@ -216,24 +216,24 @@ void loongarch_after_parse_args () { /* Set default ABI/ISA LP64D. */ - if (!EF_LOONGARCH_IS_LP64(LARCH_opts.ase_abi) - && !EF_LOONGARCH_IS_ILP32(LARCH_opts.ase_abi)) + if (!LARCH_opts.ase_ilp32) { if (strcmp (default_arch, "loongarch64") == 0) { - LARCH_opts.ase_abi = EF_LOONGARCH_ABI_LP64_DOUBLE_FLOAT; + LARCH_opts.ase_abi = EF_LOONGARCH_ABI_DOUBLE_FLOAT; LARCH_opts.ase_ilp32 = 1; LARCH_opts.ase_lp64 = 1; } else if (strcmp (default_arch, "loongarch32") == 0) { - LARCH_opts.ase_abi = EF_LOONGARCH_ABI_ILP32_DOUBLE_FLOAT; + LARCH_opts.ase_abi = EF_LOONGARCH_ABI_DOUBLE_FLOAT; LARCH_opts.ase_ilp32 = 1; } else as_bad ("unknown default architecture `%s'", default_arch); } + LARCH_opts.ase_abi |= EF_LOONGARCH_OBJABI_V1; /* Set default ISA double-float. */ if (!LARCH_opts.ase_nf && !LARCH_opts.ase_sf |