Re: [PATCH dwarves 0/4] BTF ELF writing changes
From: Arnaldo Carvalho de Melo <acme@kernel.org>
Date: 2021-01-27 14:09:21
Em Mon, Jan 25, 2021 at 01:06:21PM +0000, Giuliano Procida escreveu:
Hi. This follows on from my change to improve the error handling around llvm-objcopy in libbtf.c. Note on recipients: Please let me know if I should adjust To or CC. Note on style: I've generally placed declarations as allowed by C99, closest to point of use. Let me know if you'd prefer otherwise. 1. Improve ELF error reporting
applied
2. Add .BTF section using libelf This shows the minimal amount of code needed to drive libelf. However, it leaves layout up to libelf, which is almost certainly not wanted. As an unexpcted side-effect, vmlinux is larger than before. It seems llvm-objcopy likes to trim down .strtab.
We have to test this thoroughly, I'm adding support to gcc's -gdwarf-5 DW_AT_data_bit_offset, I think I should get that done and release 1.20, if some bug is still left on that new code, we can just fallback to -gdwarf-4. Then get back to the last 2 patches in your series, ok? - Arnaldo
3. Manually lay out updated ELF sections This does full layout of new and updated ELF sections. If the update ELF sections were not the last ones in the file by offset, then it can leave gaps between sections. 4. Align .BTF section to 8 bytes This was my original aim. Regards. Giuliano Procida (4): btf_encoder: Improve ELF error reporting btf_encoder: Add .BTF section using libelf btf_encoder: Manually lay out updated ELF sections btf_encoder: Align .BTF section to 8 bytes libbtf.c | 222 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 175 insertions(+), 47 deletions(-) -- 2.30.0.280.ga3ce27912f-goog
-- - Arnaldo