Page MenuHomeFreeBSD

libdwarf: Support consumption of compressed ELF sections
ClosedPublic

Authored by markj on Nov 27 2021, 1:30 AM.
Tags
None
Referenced Files
F102402280: D33139.id.diff
Mon, Nov 11, 6:54 PM
F102401569: D33139.id.diff
Mon, Nov 11, 6:39 PM
Unknown Object (File)
Sat, Nov 2, 10:06 AM
Unknown Object (File)
Sat, Oct 19, 11:22 AM
Unknown Object (File)
Oct 4 2024, 2:56 PM
Unknown Object (File)
Oct 1 2024, 3:53 PM
Unknown Object (File)
Sep 30 2024, 11:35 PM
Unknown Object (File)
Sep 26 2024, 11:18 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