Page MenuHomeFreeBSD

libdwarf: Support consumption of compressed ELF sections
ClosedPublic

Authored by markj on Nov 27 2021, 1:30 AM.
Tags
None
Referenced Files
F155011691: D33139.diff
Thu, Apr 30, 4:28 PM
Unknown Object (File)
Mon, Apr 27, 1:06 PM
Unknown Object (File)
Sat, Apr 25, 9:08 AM
Unknown Object (File)
Wed, Apr 15, 9:57 AM
Unknown Object (File)
Wed, Apr 15, 6:30 AM
Unknown Object (File)
Tue, Apr 14, 8:50 PM
Unknown Object (File)
Thu, Apr 9, 7:18 PM
Unknown Object (File)
Tue, Apr 7, 12:47 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42992
Build 39880: arc lint + arc unit

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