public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/24468] New: dwz -m generates partial unit without import
@ 2019-01-01  0:00 vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/24468] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz

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

            Bug ID: 24468
           Summary: dwz -m generates partial unit without import
           Product: dwz
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: vries at gcc dot gnu.org
                CC: dwz at sourceware dot org
  Target Milestone: ---

Say we make hello and dwz -m it:
...
$ rm -f hello
$ make hello 
cc /data/dwz/dwz.git/testsuite/dwz.tests/hello.c -o hello -g
$ cp hello 1; cp 1 2; ./dwz -m 3 1 2
...

In the original hello, we find long double in elf-init.c, as printed by gdb
info types:
...
$ gdb hello -ex "info types" -batch | egrep "long double|^File"
File /data/dwz/dwz.git/testsuite/dwz.tests/hello.c:
File /usr/include/bits/types.h:
File /usr/include/libio.h:
File /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h:
File elf-init.c:
        typedef long double;
File init.c:
...

but in the dwz-m optimized 1, it's no longer there:
...
$ gdb 1 -ex "info types" -batch | egrep "long double|^File"
File /usr/include/bits/types.h:
File /usr/include/libio.h:
File /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h:
File <unknown>:
...

Grepping the import tree:
...
$ readelf -w 1 > READELF
$ grep '<.*>:.*DW_TAG_partial_unit' READELF
 <0><b>: Abbrev Number: 31 (DW_TAG_partial_unit)
 <0><b>: Abbrev Number: 14 (DW_TAG_partial_unit)
 <0><43>: Abbrev Number: 14 (DW_TAG_partial_unit)
 <0><69>: Abbrev Number: 14 (DW_TAG_partial_unit)
 <0><2b5>: Abbrev Number: 14 (DW_TAG_partial_unit)
 <0><33b>: Abbrev Number: 14 (DW_TAG_partial_unit)
$ grep 'DW_AT_import.*:' READELF  
    <15>   DW_AT_import      : <alt 0xb>
    <1a>   DW_AT_import      : <alt 0x33b>
    <6b>   DW_AT_import      : <0xb>    [Abbrev Number: 31]
    <d0>   DW_AT_import      : <alt 0x43>
    <d5>   DW_AT_import      : <alt 0x69>
    <da>   DW_AT_import      : <0xb>    [Abbrev Number: 31]
    <2e0>   DW_AT_import      : <alt 0x43>
    <2e5>   DW_AT_import      : <alt 0x33b>
...
we find a partial unit at 2b5 that is not imported anywhere.

And indeed, that's the one defining long double:
...
  Compilation Unit @ offset 0x2aa:
   Length:        0x82 (32-bit)
   Version:       4
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><2b5>: Abbrev Number: 14 (DW_TAG_partial_unit)
    <2b6>   DW_AT_stmt_list   : 0x0
    <2ba>   DW_AT_comp_dir    : (indirect string, offset: 0x635):
/home/abuild/rpmbuild/BUILD/glibc-2.26/csu
 ...
 <1><2ca>: Abbrev Number: 24 (DW_TAG_base_type)
    <2cb>   DW_AT_byte_size   : 16
    <2cc>   DW_AT_encoding    : 4       (float)
    <2cd>   DW_AT_name        : (indirect string, offset: 0x403): long double
...

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

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

end of thread, other threads:[~2019-04-23 12:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [Bug default/24468] New: dwz -m generates partial unit without import vries at gcc dot gnu.org
2019-01-01  0:00 ` [Bug default/24468] " vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org

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).