Re: RFC: Add ET_DEBUG

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: RFC: Add ET_DEBUG

Mark Wielaard
On Fri, 2020-06-26 at 23:35 +0200, Florian Weimer wrote:

> * H. J. Lu via Libc-alpha:
>
> > We need a way to identify "debug" info files, which appear like they
> > are ELF files but if inspected are actually missing a lot of
> > information and can't be properly parsed without the original DSO or
> > executable.
> > We propose
> >
> > #define ET_DEBUG        5       /* Debug information file */
> >
> > Consumers should skip ET_DEBUG files if they don't know how to
> > handle them.  Debuggers should process ET_DEBUG files to extract
> > debug info.
>
> I would like to see a change like this.
>
> For background: These separate debuginfo files contain the same program
> headers as the original object file, but all the loadable segments are
> missing from the file (including the dynamic segment).  Tools compare
> these program headers for consistency, so we cannot change them in the
> separate debuginfo.
>
> In the dynamic loader, we only have ready access to the loadable
> segments.  This means the ELF header is the only area of overlap, and
> the information to tell the two apart has to be located there.

Note that this is only true for separate debug file for ET_EXEC and
ET_DYN ELF files. Some debug files, like stripped ET_REL ELF files,
split-dwarf .dwo files, supplementary debug files (dwz multi files),
don't contain any program headers. Should those also be marked ET_DEBUG
or not? I think they should. And then the above description should
simply say "may contain the same program headers as the associated
(original) object file...".

Cheers,

Mark
Reply | Threaded
Open this post in threaded view
|

Re: RFC: Add ET_DEBUG

Sourceware - binutils list mailing list
On Wed, Jul 15, 2020 at 7:02 AM Mark Wielaard <[hidden email]> wrote:

>
> On Fri, 2020-06-26 at 23:35 +0200, Florian Weimer wrote:
> > * H. J. Lu via Libc-alpha:
> >
> > > We need a way to identify "debug" info files, which appear like they
> > > are ELF files but if inspected are actually missing a lot of
> > > information and can't be properly parsed without the original DSO or
> > > executable.
> > > We propose
> > >
> > > #define ET_DEBUG        5       /* Debug information file */
> > >
> > > Consumers should skip ET_DEBUG files if they don't know how to
> > > handle them.  Debuggers should process ET_DEBUG files to extract
> > > debug info.
> >
> > I would like to see a change like this.
> >
> > For background: These separate debuginfo files contain the same program
> > headers as the original object file, but all the loadable segments are
> > missing from the file (including the dynamic segment).  Tools compare
> > these program headers for consistency, so we cannot change them in the
> > separate debuginfo.
> >
> > In the dynamic loader, we only have ready access to the loadable
> > segments.  This means the ELF header is the only area of overlap, and
> > the information to tell the two apart has to be located there.
>
> Note that this is only true for separate debug file for ET_EXEC and
> ET_DYN ELF files. Some debug files, like stripped ET_REL ELF files,
> split-dwarf .dwo files, supplementary debug files (dwz multi files),
> don't contain any program headers. Should those also be marked ET_DEBUG
> or not? I think they should. And then the above description should
> simply say "may contain the same program headers as the associated
> (original) object file...".
>
> Cheers,
>

https://gitlab.com/x86-psABIs/Linux-ABI/-/merge_requests/3


--
H.J.