mbox series

[v2,0/3] btf: fix BTF for extern items [PR106773]

Message ID 20221213184426.8861-1-david.faust@oracle.com
Headers show
Series btf: fix BTF for extern items [PR106773] | expand

Message

David Faust Dec. 13, 2022, 6:44 p.m. UTC
[Changes from v1:
 - Remove #defines for LINKAGE_* values, instead mirror enums from
   linux/btf.h to include/btf.h and use those.
 - Fix BTF generation for extern variable with both non-defining and
   defining decls in the same CU. Add a test for this.
 - Update several comments per review feedback. ]

Hi,

This series fixes the issues reported in target/PR106773. I decided to
split it into three commits, as there are ultimately three distinct
issues and fixes. See each patch for details.

Tested on bpf-unknown-none and x86_64-linux-gnu, no known regressions.

OK to push?
Thanks.

David Faust (3):
  btf: add 'extern' linkage for variables [PR106773]
  btf: fix 'extern const void' variables [PR106773]
  btf: correct generation for extern funcs [PR106773]

 gcc/btfout.cc                                 | 184 +++++++++++++-----
 .../gcc.dg/debug/btf/btf-datasec-2.c          |  28 +++
 .../gcc.dg/debug/btf/btf-function-6.c         |  19 ++
 gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c |  25 +++
 .../gcc.dg/debug/btf/btf-variables-4.c        |  24 +++
 .../gcc.dg/debug/btf/btf-variables-5.c        |  19 ++
 include/btf.h                                 |  29 ++-
 7 files changed, 276 insertions(+), 52 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-datasec-2.c
 create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-function-6.c
 create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c
 create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-variables-4.c
 create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-variables-5.c

Comments

Indu Bhagat Dec. 14, 2022, 7:08 a.m. UTC | #1
On 12/13/22 10:44, David Faust wrote:
> [Changes from v1:
>   - Remove #defines for LINKAGE_* values, instead mirror enums from
>     linux/btf.h to include/btf.h and use those.
>   - Fix BTF generation for extern variable with both non-defining and
>     defining decls in the same CU. Add a test for this.
>   - Update several comments per review feedback. ]
> 
> Hi,
> 
> This series fixes the issues reported in target/PR106773. I decided to
> split it into three commits, as there are ultimately three distinct
> issues and fixes. See each patch for details.
> 
> Tested on bpf-unknown-none and x86_64-linux-gnu, no known regressions.
> 
> OK to push?
> Thanks.
> 

Hi David,

LGTM.

Thanks

> David Faust (3):
>    btf: add 'extern' linkage for variables [PR106773]
>    btf: fix 'extern const void' variables [PR106773]
>    btf: correct generation for extern funcs [PR106773]
> 
>   gcc/btfout.cc                                 | 184 +++++++++++++-----
>   .../gcc.dg/debug/btf/btf-datasec-2.c          |  28 +++
>   .../gcc.dg/debug/btf/btf-function-6.c         |  19 ++
>   gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c |  25 +++
>   .../gcc.dg/debug/btf/btf-variables-4.c        |  24 +++
>   .../gcc.dg/debug/btf/btf-variables-5.c        |  19 ++
>   include/btf.h                                 |  29 ++-
>   7 files changed, 276 insertions(+), 52 deletions(-)
>   create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-datasec-2.c
>   create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-function-6.c
>   create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-pr106773.c
>   create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-variables-4.c
>   create mode 100644 gcc/testsuite/gcc.dg/debug/btf/btf-variables-5.c
>