[Bug tools/24550] eu-readelf does not know about DW_AT_GNU_{bias,numerator,denumerator}

tromey at sourceware dot org sourceware-bugzilla@sourceware.org
Wed May 15 18:02:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=24550

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
> > There are three things that surprised me about this.
> > First that the byte_size is 1, are these types really using a full byte and
> > not 2 or 6 bits?
> 
> I'm not totally sure what is going on here.  Maybe the type needs to be
> used in a packed record to see it actually shrink?  I will see if I can write
> a test for this.

Thanks for noticing this.  I think the DWARF is incorrect here in a few
ways -- I am going to update the internal bug about it to get it fixed.

Meanwhile here is the updated test case I am using

--  Copyright 2019 Free Software Foundation, Inc.
--
--  This program is free software; you can redistribute it and/or modify
--  it under the terms of the GNU General Public License as published by
--  the Free Software Foundation; either version 3 of the License, or
--  (at your option) any later version.
--
--  This program is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.

procedure Bias is
   type Small is range -7 .. -4;
   for Small'Size use 2;
   Y : Small := -5;
   Y1 : Small := -7;

   type Byte is mod 256;
   type Repeat_Count_T is new Byte range 1 .. 2 ** 6;
   for Repeat_Count_T'Size use 6;
   X : Repeat_Count_T := 64;
   X1 : Repeat_Count_T := 1;

   type Char_Range is range 65 .. 68;
   for Char_Range'Size use 2;
   Cval : Char_Range := 65;

   type SomePackedRecord is record
      R: Small;
      S: Small;
   end record;
   pragma Pack (SomePackedRecord);
   SPR : SomePackedRecord := (R => -4, S => -5);

   type Packed_Array is array (1 .. 3) of Small;
   pragma pack (Packed_Array);
   A : Packed_Array := (-7, -5, -4);

begin
   null;
end Bias;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Elfutils-devel mailing list