readelf patch to recognise decimal floats

Ben Elliston bje@au1.ibm.com
Wed May 18 04:00:00 GMT 2005


The following patch allows readelf to recognise decimal floating point variables.
There is no encoding value yet assigned by the DWARF working group, although the
proposal is underway.  For now, I've chosen to use a GNU extension from the
user-defined encoding space.  I will submit a corresponding patch to GCC's dwarf2.h.

Okay for mainline?

[include/elf/ChangeLog]
2005-05-17  Ben Elliston  <bje@au.ibm.com>

       * dwarf2.h (enum dwarf_type): Assign DW_ATE_GNU_decimal_float from
       the user-defined encoding space pending inclusion in the standard.

Index: include/elf/dwarf2.h
===================================================================
RCS file: /home/bje/src-cvs/src/include/elf/dwarf2.h,v
retrieving revision 1.16
diff -u -p -r1.16 dwarf2.h
--- include/elf/dwarf2.h        10 May 2005 10:21:10 -0000      1.16
+++ include/elf/dwarf2.h        18 May 2005 01:24:55 -0000
@@ -1,7 +1,7 @@
 /* Declarations and definitions of codes relating to the DWARF2 symbolic
    debugging information format.
    Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2005 Free Software Foundation, Inc.

    Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
    Office (AJPO), Florida State University and Silicon Graphics Inc.
@@ -554,7 +554,9 @@ enum dwarf_type
     DW_ATE_HP_complex_float128   = 0x83, /* Complex floating-point (128 bit).  */
     DW_ATE_HP_floathpintel       = 0x84, /* Floating-point (82 bit IA64).  */
     DW_ATE_HP_imaginary_float80  = 0x85,
-    DW_ATE_HP_imaginary_float128 = 0x86
+    DW_ATE_HP_imaginary_float128 = 0x86,
+    /* GNU extensions.  */
+    DW_ATE_GNU_decimal_float     = 0x87  /* Pending DWARF working group.  */
   };

 #define        DW_ATE_lo_user 0x80


[binutils/ChangeLog]
2005-05-18  Ben Elliston  <bje@au.ibm.com>

       * readelf.c (read_and_display_attr_value): Handle a DW_AT_encoding
       value of DW_ATE_GNU_decimal_float.

Index: binutils/readelf.c
===================================================================
RCS file: /home/bje/src-cvs/src/binutils/readelf.c,v
retrieving revision 1.294
diff -u -p -r1.294 readelf.c
--- binutils//readelf.c 14 May 2005 05:07:20 -0000      1.294
+++ binutils//readelf.c 18 May 2005 01:24:55 -0000
@@ -8419,6 +8419,8 @@ read_and_display_attr_value (unsigned lo
        case DW_ATE_unsigned_char:      printf ("(unsigned char)"); break;
          /* DWARF 2.1 value.  */
        case DW_ATE_imaginary_float:    printf ("(imaginary float)"); break;
+         /* GNU extension.  */
+       case DW_ATE_GNU_decimal_float:  printf ("(decimal float)"); break;
        default:
          if (uvalue >= DW_ATE_lo_user
              && uvalue <= DW_ATE_hi_user)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20050518/0d538de2/attachment.sig>


More information about the Binutils mailing list