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)
Wed, Nov 20, 9:09 AM
Unknown Object (File)
Fri, Nov 15, 5:05 AM
Unknown Object (File)
Thu, Nov 14, 2:15 AM
Unknown Object (File)
Mon, Nov 11, 6:54 PM
Unknown Object (File)
Mon, Nov 11, 6:39 PM
Unknown Object (File)
Sat, Nov 2, 10:06 AM
Unknown Object (File)
Oct 19 2024, 11:22 AM
Unknown Object (File)
Oct 4 2024, 2:56 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