Merge branch 'upstream-master' into 'master'

* aosp/upstream-master:
  reporting: include symbol kind in symbol descriptions
  reporting: tweak ELF symbol type descriptions
  post-processing: relax symbol description regexes
  scc_test.cc: remove special printing of SCCs
  rename all PrintSmth functions to SmthToString
  ELF loader: fix symbol visibility attribute fetch
  print version information in `ElfSymbol` description
  store symbol information in the separate `VersionInfo` structure

Bug: 243637100
Change-Id: I69509775fee2ecf8fe54477bb805a4734f287e32
Signed-off-by: Giuliano Procida <gprocida@google.com>
tree: 781074c04a9c4be6e92fa99de26f680606d2a164
  1. doc/
  2. fuzz/
  3. testdata/
  4. abigail_reader.cc
  5. abigail_reader.h
  6. Android.bp
  7. btf_reader.cc
  8. btf_reader.h
  9. catch.cc
  10. CONTRIBUTING.md
  11. crc.h
  12. Dockerfile
  13. elf_loader.cc
  14. elf_loader.h
  15. elf_reader.cc
  16. elf_reader.h
  17. error.h
  18. error_test.cc
  19. id.h
  20. LICENSE
  21. Makefile
  22. METADATA
  23. MODULE_LICENSE_LLVM
  24. order.h
  25. order_test.cc
  26. OWNERS
  27. post_processing.cc
  28. post_processing.h
  29. README.md
  30. reporting.cc
  31. reporting.h
  32. scc.h
  33. scc_test.cc
  34. stg.cc
  35. stg.h
  36. stgdiff.cc
  37. stgdiff_test.cc
  38. stginfo.cc
README.md

Symbol-Type Graph (STG)

The STG (symbol-type graph) is an ABI representation and this project contains tools for the creation and comparison of such representations. At present parsers exist for libabigail's ABI XML (C types only) and BTF. The ABI diff tool, stgdiff, supports multiple reporting options.

This software currently depends on libxml2 for XML parsing, on libelf to find .BTF sections and on Linux UAPI headers for BTF types.

How to build the project

To build from source, you will need a few dependencies:

DebianRedHat
libelf-develfutils-devel
libxml2-devlibxml2-devel
linux-libc-devkernel-headers

Instructions are included for local and Docker builds.

Local Build

You can build as follows:

$ make

Docker Build

A Dockerfile is provided to build a container with libabigail to easily compile the STG tools:

$ docker build -t stg .

And then enter the container:

$ docker run -it stg

If you want to bind your development code to the container:

$ docker run -it $PWD:/src -it stg

The source code is added to /src, so when your code is bound you can edit on your host and re-compile in the container.

Note that the Dockerfile can provide a development environment (non multi-stage build with the source code) or a production image (a multi-stage build with only the final binary). By default we provide the first, and you can uncomment the final lines of the file for the latter.

Contributions

See CONTRIBUTING.md for details.