RPM

Comment 11 for bug 633667

Revision history for this message
In , Jeff (jeff-redhat-bugs) wrote :

I should point out the fundamental flaw with -debuginfo and
debugedit in case anyone _REALLY- wishes to fix.

When an ELF binary is built, debugging symbols are written
into various ELF sections (details don't matter).

The process undertaken by debugedit is that the sections are moved
from their original per-executable sections. The sections in the
executable are marked invalid, and the debugging symbols
are written into a detached section that is then packaged up
in a -debuginfo package automagically (again details matter little).

The flaw (in debugedit) is that paths to sources are rewritten
DIRECTLY IN THE ORGINAL ELF SECTION.

The corollary to rewriting paths in a fixed size object is that
only shorter paths can be substituted.

Go try building on a very short path (like /X/NAME) and watch
the whole process go tits up with the problem being reported
with this error message:

    debugedit.c: "canonicalization unexpectedly shrank by one character");

or other insanities.

The whole process done by debugedit is essentially
the same as running sed on executables to change
path prefixes (modulo details that _DO_ matter)

NAd this from "professional" programmers who know the issue
and are quite able to understand why you CANNOT put longer
strings into a fixed size ELF section.

The ELF cabal could/should resize the section that contains file
paths so that the paths do NOT always have to be shorter.

Please note that its the process and implementation for -debuginfo
package production that hasn't been repaired for years.

Using a buildid, and having detached debugging symbols and
attempting transsparent -debuginfo production are savable.

But the flaw in debugedit is just sad and pathethic, particularly since
there's no essential change to a quick and dirty hack >5 years later.