[PATCH, V5 00/10] Definition and Implementation of CTF Frame format

Jose E. Marchesi jose.marchesi@oracle.com
Wed Jul 20 16:19:23 GMT 2022


Hi people.

Any chance we can have a review for this patch series?
If it helps, we could push it to an user branch in the git repo.

> This is version 5 of the previously sent RFC series.
>
> Initial (V1) posting contains necessary introductions:
> https://sourceware.org/pipermail/binutils/2022-May/120731.html
> V2 posting with some improvements:
> https://sourceware.org/pipermail/binutils/2022-May/120899.html
> V3 posting with further improvements:
> https://sourceware.org/pipermail/binutils/2022-June/121245.html
> V4 posting with further improvements and bugfixes:
> https://sourceware.org/pipermail/binutils/2022-June/121478.html
>
> The commit log of each patch in the current patch series specifies the changes
> from the version V4 of the respective patch.  Briefly, following are the main 
> changes in the current version V5 as compared to V4:
>
> 1. Assembler testsuite has additional testcases.  In general, the
> as/ld/unwinder support for CTF Frame format has been further tested in this
> version of the patch series for both x86_64 and aarch64.
> 2. libctfbacktrace is the library which provides a simple unwinder based on CTF
> Frame.  The current patch series now includes a testsuite for the unwinder
> based on CTF Frame.
>
> CTF Frame support V5 patch series has been regression tested on a host of
> targets with no regressions.
>
> Important note: libctfframe/configure has NOT been included in the patch
> series, as it causes the size of some patches to go beyond the allowed limit.
> Please regenerate the libctfframe/configure after applying the series.
>
> Please comment and provide feedback, it will help shape the format.  One of the
> outstanding item where feedback from folks will help is:
>
> 1. What is a good place for an unwinder based on CTF Frame format ? Currently
> to facilitate discussion, it is presented in a library of its own:
> libctfbacktrace which, in turn, uses the libctfframe library for decoding the
> .ctf_frame section for unwinding.  We brainstormed a bit about the possible
> candidates being libbacktace, libgcc or libunwind ? Are there any
> recommendations ?
>
> Thanks,
>
> Indu Bhagat (7):
>   ctf-frame.h: Add CTF Frame format definition
>   gas: add new command line option --gctf-frame
>   gas: generate .ctf_frame
>   libctfframe: add GNU poke pickles for CTF Frame
>   bfd: linker: merge .ctf_frame sections
>   readelf/objdump: support for CTF Frame section
>   gdb: sim: buildsystem changes to accommodate libctfframe
>
> Weimin Pan (3):
>   libctfframe: add the CTF Frame library
>   unwinder: generate backtrace using CTF Frame format
>   unwinder: Add CTF Frame unwinder tests
>
>  Makefile.def                                  |    5 +
>  Makefile.in                                   | 1289 +++++++++++++-
>  bfd/Makefile.am                               |    6 +-
>  bfd/Makefile.in                               |    7 +-
>  bfd/bfd-in2.h                                 |    1 +
>  bfd/configure                                 |    2 +-
>  bfd/configure.ac                              |    2 +-
>  bfd/elf-bfd.h                                 |   55 +
>  bfd/elf-ctf-frame.c                           |  529 ++++++
>  bfd/elf.c                                     |   32 +
>  bfd/elf64-x86-64.c                            |   97 +-
>  bfd/elflink.c                                 |   52 +
>  bfd/elfxx-x86.c                               |  379 +++-
>  bfd/elfxx-x86.h                               |   46 +
>  bfd/section.c                                 |    1 +
>  binutils/Makefile.am                          |   10 +-
>  binutils/Makefile.in                          |   10 +-
>  binutils/doc/binutils.texi                    |    4 +
>  binutils/doc/ctfframe.options.texi            |   10 +
>  binutils/objdump.c                            |   76 +
>  binutils/readelf.c                            |   47 +
>  config/ctf-frame.m4                           |   16 +
>  configure                                     |    2 +-
>  configure.ac                                  |    2 +-
>  gas/Makefile.am                               |    3 +
>  gas/Makefile.in                               |   23 +-
>  gas/as.c                                      |   10 +-
>  gas/as.h                                      |   13 +-
>  gas/config/tc-aarch64.c                       |   42 +
>  gas/config/tc-aarch64.h                       |   29 +
>  gas/config/tc-i386.c                          |   46 +
>  gas/config/tc-i386.h                          |   26 +
>  gas/config/tc-xtensa.c                        |    1 +
>  gas/ctf-frame-opt.c                           |  158 ++
>  gas/doc/as.texi                               |   19 +-
>  gas/dw2gencfi.c                               |   30 +
>  gas/dw2gencfi.h                               |    1 +
>  gas/gen-ctf-frame.c                           | 1297 ++++++++++++++
>  gas/gen-ctf-frame.h                           |  142 ++
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-aarch64-1.d |   20 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-aarch64-1.s |   61 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-1.d  |   17 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-1.s  |    3 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-2.d  |   17 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-2.s  |    2 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-3.d  |   17 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-3.s  |    4 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-4.d  |   21 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-4.s  |    8 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-5.d  |   21 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-5.s  |    7 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-6.d  |   21 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-6.s  |    7 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-7.d  |   21 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-7.s  |    7 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-8.d  |   20 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-common-8.s  |   12 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-x86_64-1.d  |   22 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf-x86_64-1.s  |   30 +
>  gas/testsuite/gas/cfi-ctf/cfi-ctf.exp         |   58 +
>  gas/testsuite/gas/cfi-ctf/common-empty-1.d    |   14 +
>  gas/testsuite/gas/cfi-ctf/common-empty-1.s    |    5 +
>  gas/testsuite/gas/cfi-ctf/common-empty-2.d    |   14 +
>  gas/testsuite/gas/cfi-ctf/common-empty-2.s    |    8 +
>  gas/testsuite/gas/cfi-ctf/common-empty-3.d    |   14 +
>  gas/testsuite/gas/cfi-ctf/common-empty-3.s    |    9 +
>  gas/testsuite/gas/cfi-ctf/common-empty-4.d    |   14 +
>  gas/testsuite/gas/cfi-ctf/common-empty-4.s    |   18 +
>  gas/write.c                                   |   13 +
>  gdb/Makefile.in                               |    8 +-
>  gdb/acinclude.m4                              |    4 +-
>  gdb/configure                                 |   35 +-
>  gdb/configure.ac                              |   11 +
>  include/ctf-backtrace-api.h                   |   57 +
>  include/ctf-frame-api.h                       |  213 +++
>  include/ctf-frame.h                           |  281 +++
>  include/elf/common.h                          |    1 +
>  include/elf/internal.h                        |    1 +
>  ld/Makefile.am                                |    2 +
>  ld/Makefile.in                                |    2 +
>  ld/configure                                  |    8 +-
>  ld/configure.ac                               |    3 +
>  ld/ld.texi                                    |    4 +-
>  ld/scripttempl/elf.sc                         |    2 +
>  ld/testsuite/ld-aarch64/aarch64-elf.exp       |    2 +
>  ld/testsuite/ld-aarch64/ctf-frame-bar.s       |    7 +
>  ld/testsuite/ld-aarch64/ctf-frame-foo.s       |   10 +
>  ld/testsuite/ld-aarch64/ctf-frame-simple-1.d  |   26 +
>  ld/testsuite/ld-bootstrap/bootstrap.exp       |    8 +-
>  ld/testsuite/ld-ctf-frame/ctf-frame-empty.d   |   10 +
>  ld/testsuite/ld-ctf-frame/ctf-frame-empty.s   |    2 +
>  ld/testsuite/ld-ctf-frame/ctf-frame.exp       |   47 +
>  ld/testsuite/ld-ctf-frame/discard.d           |   10 +
>  ld/testsuite/ld-ctf-frame/discard.ld          |    9 +
>  ld/testsuite/ld-ctf-frame/discard.s           |   13 +
>  ld/testsuite/ld-x86-64/ctf-frame-bar.s        |   31 +
>  ld/testsuite/ld-x86-64/ctf-frame-foo.s        |   37 +
>  ld/testsuite/ld-x86-64/ctf-frame-plt-1.d      |   29 +
>  ld/testsuite/ld-x86-64/ctf-frame-simple-1.d   |   35 +
>  ld/testsuite/ld-x86-64/x86-64.exp             |    2 +
>  ld/testsuite/lib/ld-lib.exp                   |   45 +
>  libctfframe/Makefile.am                       |   84 +
>  libctfframe/Makefile.in                       | 1050 +++++++++++
>  libctfframe/aclocal.m4                        | 1242 +++++++++++++
>  libctfframe/config.h.in                       |  144 ++
>  libctfframe/configure.ac                      |   82 +
>  libctfframe/ctf-backtrace-err.c               |   46 +
>  libctfframe/ctf-backtrace.c                   |  617 +++++++
>  libctfframe/ctf-frame-dump.c                  |  181 ++
>  libctfframe/ctf-frame-dump.pk                 |   68 +
>  libctfframe/ctf-frame-error.c                 |   49 +
>  libctfframe/ctf-frame-impl.h                  |   55 +
>  libctfframe/ctf-frame.c                       | 1584 +++++++++++++++++
>  libctfframe/ctf-frame.pk                      |  200 +++
>  libctfframe/testsuite/config/default.exp      |   60 +
>  libctfframe/testsuite/lib/ctfframe-lib.exp    |  333 ++++
>  .../testsuite/libctfframe.decode/DATA1        |  Bin 0 -> 59 bytes
>  .../testsuite/libctfframe.decode/DATA2        |  Bin 0 -> 91 bytes
>  .../testsuite/libctfframe.decode/DATA_BIGE    |  Bin 0 -> 59 bytes
>  .../libctfframe.decode/bigendian_data.c       |  110 ++
>  .../libctfframe.decode/bigendian_data.lk      |    3 +
>  .../testsuite/libctfframe.decode/decode.exp   |   38 +
>  .../testsuite/libctfframe.decode/frecnt_1.c   |  108 ++
>  .../testsuite/libctfframe.decode/frecnt_1.lk  |    3 +
>  .../testsuite/libctfframe.decode/frecnt_2.c   |  113 ++
>  .../testsuite/libctfframe.decode/frecnt_2.lk  |    3 +
>  .../testsuite/libctfframe.encode/encode.exp   |   38 +
>  .../testsuite/libctfframe.encode/encode_1.c   |  173 ++
>  .../testsuite/libctfframe.encode/encode_1.lk  |    3 +
>  .../testsuite/libctfframe.unwind/backtrace.c  |  101 ++
>  .../testsuite/libctfframe.unwind/backtrace.lk |    3 +
>  .../libctfframe.unwind/inline-cmds.c          |  135 ++
>  .../libctfframe.unwind/inline-cmds.lk         |    3 +
>  .../testsuite/libctfframe.unwind/inline.c     |   97 +
>  .../testsuite/libctfframe.unwind/inline.lk    |    3 +
>  .../testsuite/libctfframe.unwind/solib-lib1.c |    8 +
>  .../testsuite/libctfframe.unwind/solib-lib2.c |   50 +
>  .../testsuite/libctfframe.unwind/solib-main.c |   47 +
>  .../testsuite/libctfframe.unwind/solib.exp    |   68 +
>  .../testsuite/libctfframe.unwind/solib_lib1.h |    3 +
>  .../testsuite/libctfframe.unwind/solib_lib2.h |    3 +
>  .../testsuite/libctfframe.unwind/tailcall.c   |  103 ++
>  .../testsuite/libctfframe.unwind/tailcall.lk  |    3 +
>  .../testsuite/libctfframe.unwind/ttest.c      |  127 ++
>  .../testsuite/libctfframe.unwind/ttest.lk     |    3 +
>  .../testsuite/libctfframe.unwind/unwind.exp   |  189 ++
>  libctfframe/ttest.c                           |   78 +
>  sim/common/Make-common.in                     |    7 +-
>  148 files changed, 13340 insertions(+), 58 deletions(-)
>  create mode 100644 bfd/elf-ctf-frame.c
>  create mode 100644 binutils/doc/ctfframe.options.texi
>  create mode 100644 config/ctf-frame.m4
>  create mode 100644 gas/ctf-frame-opt.c
>  create mode 100644 gas/gen-ctf-frame.c
>  create mode 100644 gas/gen-ctf-frame.h
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-aarch64-1.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-aarch64-1.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-1.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-1.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-2.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-2.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-3.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-3.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-4.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-4.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-5.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-5.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-6.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-6.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-7.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-7.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-8.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-common-8.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-x86_64-1.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf-x86_64-1.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/cfi-ctf.exp
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-1.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-1.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-2.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-2.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-3.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-3.s
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-4.d
>  create mode 100644 gas/testsuite/gas/cfi-ctf/common-empty-4.s
>  create mode 100644 include/ctf-backtrace-api.h
>  create mode 100644 include/ctf-frame-api.h
>  create mode 100644 include/ctf-frame.h
>  create mode 100644 ld/testsuite/ld-aarch64/ctf-frame-bar.s
>  create mode 100644 ld/testsuite/ld-aarch64/ctf-frame-foo.s
>  create mode 100644 ld/testsuite/ld-aarch64/ctf-frame-simple-1.d
>  create mode 100644 ld/testsuite/ld-ctf-frame/ctf-frame-empty.d
>  create mode 100644 ld/testsuite/ld-ctf-frame/ctf-frame-empty.s
>  create mode 100644 ld/testsuite/ld-ctf-frame/ctf-frame.exp
>  create mode 100644 ld/testsuite/ld-ctf-frame/discard.d
>  create mode 100644 ld/testsuite/ld-ctf-frame/discard.ld
>  create mode 100644 ld/testsuite/ld-ctf-frame/discard.s
>  create mode 100644 ld/testsuite/ld-x86-64/ctf-frame-bar.s
>  create mode 100644 ld/testsuite/ld-x86-64/ctf-frame-foo.s
>  create mode 100644 ld/testsuite/ld-x86-64/ctf-frame-plt-1.d
>  create mode 100644 ld/testsuite/ld-x86-64/ctf-frame-simple-1.d
>  create mode 100644 libctfframe/Makefile.am
>  create mode 100644 libctfframe/Makefile.in
>  create mode 100644 libctfframe/aclocal.m4
>  create mode 100644 libctfframe/config.h.in
>  create mode 100644 libctfframe/configure.ac
>  create mode 100644 libctfframe/ctf-backtrace-err.c
>  create mode 100644 libctfframe/ctf-backtrace.c
>  create mode 100644 libctfframe/ctf-frame-dump.c
>  create mode 100644 libctfframe/ctf-frame-dump.pk
>  create mode 100644 libctfframe/ctf-frame-error.c
>  create mode 100644 libctfframe/ctf-frame-impl.h
>  create mode 100644 libctfframe/ctf-frame.c
>  create mode 100644 libctfframe/ctf-frame.pk
>  create mode 100644 libctfframe/testsuite/config/default.exp
>  create mode 100644 libctfframe/testsuite/lib/ctfframe-lib.exp
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/DATA1
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/DATA2
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/DATA_BIGE
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/bigendian_data.c
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/bigendian_data.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/decode.exp
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/frecnt_1.c
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/frecnt_1.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/frecnt_2.c
>  create mode 100644 libctfframe/testsuite/libctfframe.decode/frecnt_2.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.encode/encode.exp
>  create mode 100644 libctfframe/testsuite/libctfframe.encode/encode_1.c
>  create mode 100644 libctfframe/testsuite/libctfframe.encode/encode_1.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/backtrace.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/backtrace.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/inline-cmds.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/inline-cmds.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/inline.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/inline.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/solib-lib1.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/solib-lib2.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/solib-main.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/solib.exp
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/solib_lib1.h
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/solib_lib2.h
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/tailcall.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/tailcall.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/ttest.c
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/ttest.lk
>  create mode 100644 libctfframe/testsuite/libctfframe.unwind/unwind.exp
>  create mode 100644 libctfframe/ttest.c


More information about the Binutils mailing list