[RFC 0/3] pahole: Workaround dwarf bug for function encoding

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

 



hi,
because of gcc bug [1] we can no longer rely on DW_AT_declaration
attribute to filter out declarations and end up with just
one copy of the function in the BTF data.

It seems this bug is not easy to fix, but regardless if the
it's coming soon, it's probably good idea not to depend so
much only on dwarf data and make some extra checks.

Thus for function encoding we are now doing following checks:
  - argument names are defined for the function
  - there's symbol and address defined for the function
  - function is generated only once

These checks ensure that we encode function with defined
symbol/address and argument names.

I marked this post as RFC, because with this workaround in
place we are also encoding assembly functions, which were
not present when using the previous gcc version.

Full functions diff to previous gcc working version:

  http://people.redhat.com/~jolsa/functions.diff.txt

I'm not sure this does not break some rule for functions in
BTF data, becuse those assembly functions are not attachable
by bpf trampolines, so I don't think there's any use for them.

thoughts?
jirka


[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060
---
Jiri Olsa (3):
      btf_encoder: Move find_all_percpu_vars in generic config function
      btf_encoder: Change functions check due to broken dwarf
      btf_encoder: Include static functions to BTF data

 btf_encoder.c | 221 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------
 elf_symtab.h  |   8 +++++
 2 files changed, 170 insertions(+), 59 deletions(-)




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

  Powered by Linux