Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support build-id generation from compressed ELF files #653

Merged
merged 2 commits into from Apr 10, 2019

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Apr 2, 2019

The prime use-case is build-id generation for compressed kernel modules, see https://bugzilla.redhat.com/show_bug.cgi?id=1650072 for background.

The first commit is independent in that it simply improves the detection of kernel modules, the second part actually enables compressed ELF via use of dwelf_elf_begin().

Caveat: I haven't actually tested it with a kernel module due to not having a sane reproducer (rebuilding the entire kernel just for this is not an appetizing thought).

…ation

File extension based heuristics only work so far at best, and break
completely on compressed files with arbitrary .gz/.xz etc extension.
This isn't supposed to change any behavior as such, only provide more
reliable detection of kernel modules.
…175)

Use dwelf_elf_begin() for reading ELF files for build-id generation on
versions that have it to support compressed ELF files such as kernel
modules (RhBug:1650072,1650074). Note that debugedit still cannot handle
compressed files, this is only for build-id generation.
@pmatilai pmatilai added the RFE label Apr 2, 2019
@@ -487,6 +487,10 @@ AS_IF([test "$WITH_LIBELF" = yes],[
# If possible we also want the strtab functions from elfutils 0.167.
# But we can fall back on the (unsupported) ebl alternatives if not.
AC_CHECK_LIB(dw, dwelf_strtab_init, [HAVE_LIBDW_STRTAB=yes])
# whether libdw supports compressed ELF objects
AC_CHECK_LIB(dw, dwelf_elf_begin, [
AC_DEFINE(HAVE_DWELF_ELF_BEGIN, 1, [Have dwelf_elf_begin?])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also change previous condition to use AC_DEFINE? just to be consistent. Because it uses AM_CONDITIONAL few lines below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it ain't broken and it ain't mine, I'm not touching it. Not in autocrap land ;)

@ffesti
Copy link
Contributor

ffesti commented Apr 9, 2019

This should probably be reviewed by Mark Wielaard or some kernel person. This is all gibberish to me.

Feel free to merge if you got a positive response.

@rpm-maint
Copy link

rpm-maint commented Apr 9, 2019 via email

@rpm-maint
Copy link

rpm-maint commented Apr 9, 2019 via email

@pmatilai
Copy link
Member Author

pmatilai commented Apr 10, 2019

It isn't that bad is it?

Elf internals are a bit daunting for the uninitiated such as ourselves 😁

Anyway, thanks for the review Mark.

@pmatilai pmatilai merged commit d48981a into rpm-software-management:master Apr 10, 2019
@pmatilai pmatilai deleted the compr-elf-pr branch April 10, 2019 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants