Page MenuHomeFreeBSD

libdwarf: Support consumption of compressed ELF sections
ClosedPublic

Authored by markj on Nov 27 2021, 1:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 23, 7:06 PM
Unknown Object (File)
Mon, Sep 23, 6:27 AM
Unknown Object (File)
Thu, Sep 19, 5:39 PM
Unknown Object (File)
Thu, Sep 19, 10:13 AM
Unknown Object (File)
Thu, Sep 19, 5:53 AM
Unknown Object (File)
Wed, Sep 18, 8:43 AM
Unknown Object (File)
Tue, Sep 17, 9:29 PM
Unknown Object (File)
Mon, Sep 16, 10:24 PM
Subscribers

Details

Summary

This lets ctfcovert work on userland code after commit c910570e7573
("Use compressed debug in standalone userland debug files by default").

Reported by: avg
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Nov 27 2021, 1:30 AM
contrib/elftoolchain/libdwarf/libdwarf_elf_init.c
232

Got a compilation error here on amd64 when building lib32. &size has an incompatible pointer type.
Changing csize type to unsigned long fixed the build.

Other than the lib32 error, everything seems to have worked fine.

contrib/elftoolchain/libdwarf/libdwarf_elf_init.c
232

Full error, just in case:

/usr/devel/git/trant/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:232:31: error: incompatible pointer types passing 'size_t *' (aka 'unsigned int *') to parameter of type 'uLongf *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
        if (uncompress(ed->ed_alloc, &csize, (char *)ed->ed_data->d_buf + hsize,
                                     ^~~~~~
/usr/obj/trant/usr/devel/git/trant/amd64.amd64/obj-lib32/tmp/usr/include/zlib.h:1266:59: note: passing argument to parameter 'destLen' here
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
                                                          ^
1 error generated.
This revision is now accepted and ready to land.Nov 29 2021, 6:39 AM
markj marked 2 inline comments as done.

size_t -> unsigned long

This revision now requires review to proceed.Nov 29 2021, 2:44 PM

Gentle ping, in case anyone else is planning on reviewing this.

Do other libelf/libdwarf implementations provide the same functionality?

Do other libelf/libdwarf implementations provide the same functionality?

Not sure about libelf, but the SGI-derived libdwarf supports compressed sections, yes.

This revision is now accepted and ready to land.Dec 6 2021, 2:52 PM