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

Make BTF for data sections optional #675

Merged
merged 7 commits into from May 23, 2022

Commits on May 13, 2022

  1. Makefile: disable journald logging in podman

    The default behaviour of podman is to drop all stdout/err it generates into
    the journal, which gets rather noisy.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed May 13, 2022
    Copy the full SHA
    5dfc4e5 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2022

  1. elf_reader: freeze all data sections with .rodata* prefix

    LoadCollectionSpecFromReader marks all .rodata* sections as data sections,
    but loadDataSections() only freezes '.rodata'.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed May 23, 2022
    Copy the full SHA
    47418e6 View commit details
    Browse the repository at this point in the history
  2. elf_reader: accept ELF data sections without a corresponding BTF datasec

    https://lore.kernel.org/bpf/CAK3+h2wcDceeGyFVDU3n7kPm=zgp7r1q4WK0=abxBsj9pyFN-g@mail.gmail.com
    
    If an anonymous value or constant (e.g. array declared in a macro) ends up
    in a data section, it will not be accompanied by debug info, resulting in
    no BTF being emitted for the value. If the section consists of only anonymous
    values, there could be no BTF for the section as a whole.
    
    A workaround was added to LLVM to always emit an empty BTF Datasec for .rodata
    specifically, but this doesn't work for special sections like .rodata.cst32
    and friends.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed May 23, 2022
    Copy the full SHA
    38cabea View commit details
    Browse the repository at this point in the history
  3. elf_reader: tolerate untyped/local map relocations from llvm 7/9

    Symbols for anonymous constants are somewhat irregular on older versions
    of LLVM. This commit relaxes the constraints on symbols those compilers
    emit map relocations against.
    
    LLVM 7:
         1: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT    16 .Lconstinit.1
    
    LLVM 9:
         1: 0000000000000000    32 OBJECT  LOCAL  DEFAULT    22 .Lconstinit.1
    
    LLVM 14 has these symbols correctly sanitized.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed May 23, 2022
    Copy the full SHA
    7d3d28d View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    d6b1820 View commit details
    Browse the repository at this point in the history
  5. collection: make RewriteConstants operate on custom .rodata* sections

    Instead of only looking for constants in .rodata, iterate over all maps with
    an .rodata prefix.
    
    Moved the datasec bytes and BTF info extraction into a method on MapSpec.
    Lifted patchValue back into RewriteConstants.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed May 23, 2022
    Copy the full SHA
    09f3e22 View commit details
    Browse the repository at this point in the history
  6. testdata: loader - declare constant in custom .rodata.test section

    This exercises support for constants in custom .rodata* sections.
    
    Signed-off-by: Timo Beckers <timo@isovalent.com>
    ti-mo committed May 23, 2022
    Copy the full SHA
    352d2b3 View commit details
    Browse the repository at this point in the history