From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/24468] New: dwz -m generates partial unit without import
Date: Tue, 01 Jan 2019 00:00:00 -0000 [thread overview]
Message-ID: <bug-24468-11298@http.sourceware.org/bugzilla/> (raw)
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.
next reply other threads:[~2019-04-19 19:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-01 0:00 vries at gcc dot gnu.org [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-24468-11298@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=dwz@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).