diff options
author | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-11-28 15:13:41 +0000 |
---|---|---|
committer | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-12-17 21:18:42 +0000 |
commit | 3dd4cd56e7843e01a8ab147a0d102cd4f6d732c1 (patch) | |
tree | 932edc2b4764d6c36aa1e876c303a748affef531 /usr/src/lib/libctf/common/ctf_dwarf.c | |
parent | 73197b540cc5f0434c409b68ca9e1a514a6ce91b (diff) | |
download | illumos-joyent-3dd4cd56e7843e01a8ab147a0d102cd4f6d732c1.tar.gz |
13342 ctfconvert could encode _Float128 for 32-bit objects
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Rich Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libctf/common/ctf_dwarf.c')
-rw-r--r-- | usr/src/lib/libctf/common/ctf_dwarf.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/usr/src/lib/libctf/common/ctf_dwarf.c b/usr/src/lib/libctf/common/ctf_dwarf.c index 6897dd3047..58a0f5f4a7 100644 --- a/usr/src/lib/libctf/common/ctf_dwarf.c +++ b/usr/src/lib/libctf/common/ctf_dwarf.c @@ -681,7 +681,7 @@ ctf_dwarf_member_location(ctf_cu_t *cup, Dwarf_Die die, Dwarf_Unsigned *valp) if (sign < 0) { (void) snprintf(cup->cu_errbuf, cup->cu_errlen, "encountered negative member data " - "location: %d\n", sign); + "location: %lld\n", sign); } *valp = (Dwarf_Unsigned)sign; return (0); @@ -879,7 +879,7 @@ typedef struct ctf_dwarf_fpent { typedef struct ctf_dwarf_fpmap { uint_t cdf_mach; - ctf_dwarf_fpent_t cdf_ents[4]; + ctf_dwarf_fpent_t cdf_ents[5]; } ctf_dwarf_fpmap_t; static const ctf_dwarf_fpmap_t ctf_dwarf_fpmaps[] = { @@ -905,6 +905,17 @@ static const ctf_dwarf_fpmap_t ctf_dwarf_fpmaps[] = { { 4, { CTF_FP_SINGLE, CTF_FP_CPLX, CTF_FP_IMAGRY } }, { 8, { CTF_FP_DOUBLE, CTF_FP_DCPLX, CTF_FP_DIMAGRY } }, { 12, { CTF_FP_LDOUBLE, CTF_FP_LDCPLX, CTF_FP_LDIMAGRY } }, + /* + * ISO/IEC TS-18661-3:2015 defines several types with analogues + * to existing C types. However, in the i386 ABI there is no + * corresponding type for a _Float128. While, ideally we would + * add this as a discrete type, when C2x formally standardizes + * this and a number of additional extensions, we'll want to + * change that around. In the interim, we'll encode it as a + * weirdly sized long-double, even though not all the tools + * will expect an off-abi encoding. + */ + { 16, { CTF_FP_LDOUBLE, CTF_FP_LDCPLX, CTF_FP_LDIMAGRY } }, { 0, { 0 } } } }, { EM_X86_64, { @@ -985,7 +996,7 @@ ctf_dwarf_float_base(ctf_cu_t *cup, Dwarf_Signed type, ctf_encoding_t *enc) } (void) snprintf(cup->cu_errbuf, cup->cu_errlen, - "failed to find valid fp mapping for encoding %d, size %d bits\n", + "failed to find valid fp mapping for encoding %lld, size %d bits\n", type, enc->cte_bits); return (EINVAL); } @@ -1033,7 +1044,7 @@ ctf_dwarf_dwarf_base(ctf_cu_t *cup, Dwarf_Die die, int *kindp, break; default: (void) snprintf(cup->cu_errbuf, cup->cu_errlen, - "encountered unknown DWARF encoding: %d\n", type); + "encountered unknown DWARF encoding: %lld\n", type); return (ECTF_CONVBKERR); } |