Re: [PATCH dwarves v2 2/4] btf_encoder: Manually lay out updated ELF sections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 1, 2021 at 9:26 AM Giuliano Procida <gprocida@xxxxxxxxxx> wrote:
>
> pahole -J needs to do the following to an ELF file:
>
> * add or update the ".BTF" section
> * maybe update the section name string table
> * update the Section Header Table (SHT)
>
> libelf either takes full control of layout or requires the user to
> specify offset, size and alignment of all new and updated sections and
> headers.
>
> To avoid libelf moving program segments in particular, we position the

It's not clear to me what's wrong with libelf handling all the layout.
Even if libelf will move program segments around, what's the harm?
Does it break anything if we just let libelf do this?

> ".BTF" and section name string table (typically named ".shstrtab")
> sections after all others. The SHT always lives at the end of the file.
>
> Note that the last section in an ELF file is normally the section name
> string table and any ".BTF" section will normally be second last.
> However, if these sections appear earlier, then we'll waste some space
> in the ELF file when we rewrite them.
>
> Signed-off-by: Giuliano Procida <gprocida@xxxxxxxxxx>
> ---
>  libbtf.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 62 insertions(+), 2 deletions(-)
>

[...]



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux