public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/20194] New: Intel void* idiom has wrong size
@ 2016-01-01  0:00 woodard at redhat dot com
  2016-01-01  0:00 ` [Bug default/20194] Fail to recognize void type represented by DW_TAG_base_type dodji at redhat dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: woodard at redhat dot com @ 2016-01-01  0:00 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 20194
           Summary: Intel void* idiom has wrong size
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: woodard at redhat dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Created attachment 9306
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9306&action=edit
Intel compiled object

[C]'function void* _elf_mmap(Elf*)' at input.c:87:1 has some indirect sub-type
changes:
    return type changed:
      entity changed from 'void*' to 'void'
      type size changed from 64 to 0 bits

GCC
 <1><1dc71>: Abbrev Number: 29 (DW_TAG_subprogram)
    <1dc72>   DW_AT_external    : 1
    <1dc72>   DW_AT_name        : (indirect string, offset: 0xa0a): _elf_mmap
    <1dc76>   DW_AT_decl_file   : 1
    <1dc77>   DW_AT_decl_line   : 87
    <1dc78>   DW_AT_prototyped  : 1
    <1dc78>   DW_AT_type        : <0x1d2f2>
    <1dc7c>   DW_AT_low_pc      : 0xab80
    <1dc84>   DW_AT_high_pc     : 0x63 0x0
    <1dc8c>   DW_AT_frame_base  : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <1dc8e>   Unknown AT value: 2117: 1
    <1dc8e>   DW_AT_sibling     : <0x1dcd3>

 <1><1d2f2>: Abbrev Number: 5 (DW_TAG_pointer_type)
    <1d2f3>   DW_AT_byte_size   : 8

Intel:
 <1><1532e>: Abbrev Number: 6 (DW_TAG_subprogram)
    <1532f>   DW_AT_decl_line   : 87
    <15330>   DW_AT_decl_file   : 1
    <15331>   DW_AT_type        : <0x14ac4>
    <15335>   DW_AT_prototyped  : 1
    <15336>   DW_AT_name        : (indirect string, offset: 0x11b2): _elf_mmap
    <1533a>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0x11b2):
_elf_mmap
    <1533e>   DW_AT_low_pc      : 0xebd0
    <15346>   DW_AT_high_pc     : 0xec20
    <1534e>   DW_AT_external    : 1

 <1><14ac4>: Abbrev Number: 2 (DW_TAG_pointer_type)
    <14ac5>   DW_AT_type        : <0x14ac9>
 <1><14ac9>: Abbrev Number: 3 (DW_TAG_base_type)
    <14aca>   DW_AT_byte_size   : 0
    <14acb>   DW_AT_encoding    : 5     (signed)
    <14acc>   DW_AT_name        : (indirect string, offset: 0x2cf): void

This one looks to me sort of like a libabigail bug but I'm not versed enough
with DWARF to know for sure.

It looks to me like the idiom for a void* in GCC is a pointer type with no
type. On the other hand Intel points to a the base type which is void and has a
zero length. Can you assume that any pointer is 8 due to the architecture or
something else in the DWARF? Right now it looks to me like libabigail is using
the size of the base_type in place of the assumed size of a pointer.

The next error that I started to look into seems related:

  [C]'function void* _elf_read(Elf*, void*, size_t, size_t)' at input.c:56:1
has some indirect sub-\
type changes:
    parameter 2 of type 'void*' changed:
      entity changed from 'void*' to 'typedef size_t' at stddef.h:44:1
    parameter 4 of type 'typedef size_t' was removed

When you look at how intel describes it, 

<1><14af2>: Abbrev Number: 6 (DW_TAG_subprogram)
    <14af3>   DW_AT_decl_line   : 56
    <14af4>   DW_AT_decl_file   : 1
    <14af5>   DW_AT_type        : <0x14ac4>
    <14af9>   DW_AT_prototyped  : 1
    <14afa>   DW_AT_name        : (indirect string, offset: 0x11a2): _elf_read
    <14afe>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0x11a2):
_elf_read
    <14b02>   DW_AT_low_pc      : 0xeaa0
    <14b0a>   DW_AT_high_pc     : 0xebd0
    <14b12>   DW_AT_external    : 1
 <2><14b13>: Abbrev Number: 7 (DW_TAG_formal_parameter)
    <14b14>   DW_AT_decl_line   : 56
    <14b15>   DW_AT_decl_file   : 1
    <14b16>   DW_AT_type        : <0x14ba8>
    <14b1a>   DW_AT_name        : elf
    <14b1e>   DW_AT_location    : 1 byte block: 55      (DW_OP_reg5)
 <2><14b20>: Abbrev Number: 8 (DW_TAG_formal_parameter)
    <14b21>   DW_AT_decl_line   : 56
    <14b22>   DW_AT_decl_file   : 1
    <14b23>   DW_AT_type        : <0x14ac4>
    <14b27>   DW_AT_name        : (indirect string, offset: 0x994): buffer
    <14b2b>   DW_AT_location    : 1 byte block: 54      (DW_OP_reg4)
 <2><14b2d>: Abbrev Number: 7 (DW_TAG_formal_parameter)
    <14b2e>   DW_AT_decl_line   : 56
    <14b2f>   DW_AT_decl_file   : 1
    <14b30>   DW_AT_type        : <0x14dff>
    <14b34>   DW_AT_name        : off
    <14b38>   DW_AT_location    : 1 byte block: 51      (DW_OP_reg1)
 <2><14b3a>: Abbrev Number: 7 (DW_TAG_formal_parameter)
    <14b3b>   DW_AT_decl_line   : 56
    <14b3c>   DW_AT_decl_file   : 1
    <14b3d>   DW_AT_type        : <0x14dff>
    <14b41>   DW_AT_name        : len
    <14b45>   DW_AT_location    : 1 byte block: 52      (DW_OP_reg2)

it looks like libabigail is tripping over the void* in the middle which points
back to our old friend 14ac4 the idiomatically defined void*. However, once you
get past that it looks like the abi is the same.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-07-05 17:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-01  0:00 [Bug default/20194] New: Intel void* idiom has wrong size woodard at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Fail to recognize void type represented by DW_TAG_base_type dodji at redhat dot com
2016-01-01  0:00 ` dodji at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Intel void* idiom has wrong size woodard at redhat dot com
2016-01-01  0:00 ` woodard at redhat dot com
2016-01-01  0:00 ` woodard at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Fail to recognize void type represented by DW_TAG_base_type woodard at redhat dot com
2016-01-01  0:00 ` dodji at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Intel void* idiom has wrong size mjw at redhat dot com
2016-01-01  0:00 ` woodard at redhat dot com
2016-01-01  0:00 ` woodard at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Fail to recognize void type represented by DW_TAG_base_type woodard at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Intel void* idiom has wrong size woodard at redhat dot com
2016-01-01  0:00 ` [Bug default/20194] Fail to recognize void type represented by DW_TAG_base_type dodji at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).