public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs
@ 2019-01-01  0:00 vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/24345] " vries at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ 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=24345

            Bug ID: 24345
           Summary: Dwz invalidates debug sections generated by
                    --emit-relocs
           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: ---

When compiling hello world, we can keep the relocations in the executable using
linker option --emit-relocs:
...
$ gcc hello.c -g -Wl,--emit-relocs
...

So we have:
...
  [35] .debug_info       PROGBITS         0000000000000000  000011a0
       00000000000005bb  0000000000000000           0     0     1
  [36] .rela.debug_info  RELA             0000000000000000  00003138
       0000000000000c78  0000000000000018   I      44    35     8
...

Using readelf, we find f.i. this string relocation:
...
$ readelf -r -w a.out
Relocation section '.rela.debug_info' at offset 0x3138 contains 133 entries:
  Offset          Info           Type           Sym. Value    Sym. Name +
Addend
000000000024  00200000000a R_X86_64_32       0000000000000000 .debug_str + 1a
...
for this location:
...
    <24>   DW_AT_comp_dir    : (indirect string, offset: 0x1a):
/home/abuild/rpmbuild/BUILD/glibc-2.26/csu
...

However, if we run dwz, then .debug_info is modified: 
...
    <24>   DW_AT_encoding    : 5        (signed)
...
but .rela.debug_info is not.

So, dwz breaks the validity of .rela.debug_info.

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

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

* [Bug default/24345] Dwz invalidates debug sections generated by --emit-relocs
  2019-01-01  0:00 [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs 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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ 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=24345

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
I'm not sure how this should be addressed.

Refusing to optimize when finding debug .rela sections would fix this, but it
would also hurt linux kernel debug info compression, so that's probably not a
good idea.

I suppose ideally, we'd update the .rela sections (see also PR24344).

For now, we could drop the .rela sections, since they're broken.

At the very least, we have to emit a warning letting the user know that debug
.rela sections are broken.

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

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

* [Bug default/24345] Dwz invalidates debug sections generated by --emit-relocs
  2019-01-01  0:00 [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/24345] " vries at gcc dot gnu.org
@ 2019-01-01  0:00 ` vries at gcc dot gnu.org
  2020-09-13 14:50 ` mark at klomp dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ 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=24345

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

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

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

* [Bug default/24345] Dwz invalidates debug sections generated by --emit-relocs
  2019-01-01  0:00 [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs vries at gcc dot gnu.org
  2019-01-01  0:00 ` [Bug default/24345] " vries at gcc dot gnu.org
  2019-01-01  0:00 ` vries at gcc dot gnu.org
@ 2020-09-13 14:50 ` mark at klomp dot org
  2021-02-12 14:31 ` mark at klomp dot org
  2021-02-12 14:35 ` mark at klomp dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2020-09-13 14:50 UTC (permalink / raw)
  To: dwz

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=24344

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

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

* [Bug default/24345] Dwz invalidates debug sections generated by --emit-relocs
  2019-01-01  0:00 [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-09-13 14:50 ` mark at klomp dot org
@ 2021-02-12 14:31 ` mark at klomp dot org
  2021-02-12 14:35 ` mark at klomp dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2021-02-12 14:31 UTC (permalink / raw)
  To: dwz

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vt at altlinux dot org

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
*** Bug 27029 has been marked as a duplicate of this bug. ***

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

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

* [Bug default/24345] Dwz invalidates debug sections generated by --emit-relocs
  2019-01-01  0:00 [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-02-12 14:31 ` mark at klomp dot org
@ 2021-02-12 14:35 ` mark at klomp dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2021-02-12 14:35 UTC (permalink / raw)
  To: dwz

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #3 from Mark Wielaard <mark at klomp dot org> ---
See also this gcc discussion about --emit-relocs:
https://gcc.gnu.org/pipermail/gcc/2020-December/234405.html
And this elfutils one:
https://sourceware.org/pipermail/elfutils-devel/2020q4/003237.html

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

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

end of thread, other threads:[~2021-02-12 14:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [Bug default/24345] New: Dwz invalidates debug sections generated by --emit-relocs vries at gcc dot gnu.org
2019-01-01  0:00 ` [Bug default/24345] " vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2020-09-13 14:50 ` mark at klomp dot org
2021-02-12 14:31 ` mark at klomp dot org
2021-02-12 14:35 ` mark at klomp dot 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).