test cases: symbol: absolute object: set size and value to zero

This mirrors what we get from GNU `ld`.

PiperOrigin-RevId: 704271978
Change-Id: I20dd035b42c525241b2d0517a4cfcfc57498df1b
1 file changed
tree: 59d7507797cfc887536ef9b765670eb0f1dfa3fc
  1. cmake/
  2. doc/
  3. fuzz/
  4. test_cases/
  5. testdata/
  6. abigail_reader.cc
  7. abigail_reader.h
  8. abigail_reader_test.cc
  9. btf_reader.cc
  10. btf_reader.h
  11. catch.cc
  12. CMakeLists.txt
  13. comparison.cc
  14. comparison.h
  15. CONTRIBUTING.md
  16. deduplication.cc
  17. deduplication.h
  18. Dockerfile
  19. dwarf_processor.cc
  20. dwarf_processor.h
  21. dwarf_wrappers.cc
  22. dwarf_wrappers.h
  23. elf_dwarf_handle.cc
  24. elf_dwarf_handle.h
  25. elf_loader.cc
  26. elf_loader.h
  27. elf_reader.cc
  28. elf_reader.h
  29. elf_reader_test.cc
  30. equality.h
  31. equality_cache.h
  32. error.h
  33. error_test.cc
  34. fidelity.cc
  35. fidelity.h
  36. file_descriptor.cc
  37. file_descriptor.h
  38. file_descriptor_test.cc
  39. filter.cc
  40. filter.h
  41. filter_test.cc
  42. fingerprint.cc
  43. fingerprint.h
  44. graph.cc
  45. graph.h
  46. hashing.h
  47. hex.h
  48. hex_test.cc
  49. input.cc
  50. input.h
  51. LICENSE
  52. METADATA
  53. MODULE_LICENSE_LLVM
  54. naming.cc
  55. naming.h
  56. order.h
  57. order_test.cc
  58. OWNERS
  59. post_processing.cc
  60. post_processing.h
  61. proto_reader.cc
  62. proto_reader.h
  63. proto_writer.cc
  64. proto_writer.h
  65. reader_options.h
  66. README.md
  67. reporting.cc
  68. reporting.h
  69. reporting_test.cc
  70. runtime.cc
  71. runtime.h
  72. runtime_test.cc
  73. scc.h
  74. scc_test.cc
  75. scope.h
  76. scope_test.cc
  77. stable_hash.cc
  78. stable_hash.h
  79. stg.cc
  80. stg.proto
  81. stgdiff.cc
  82. stgdiff_test.cc
  83. substitution.h
  84. type_normalisation.cc
  85. type_normalisation.h
  86. type_resolution.cc
  87. type_resolution.h
  88. unification.cc
  89. unification.h
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.

The ABI extraction tool, stg, emits a native ABI format. Parsers exist for libabigail's XML format, BTF and ELF / DWARF.

The ABI diff tool, stgdiff, supports multiple reporting options.

STG has a versioned native file format. Older formats can be read and rewritten as the latest.

NOTE: STG is under active developement. Tool arguments and behaviour are subject to change.

Getting STG

Distributions

We intend to package STG for major distributions. Currently we have packages as follows:

DistributionPackage
Arch Linux (AUR)stg-git

Source Code

This source code is available at https://android.googlesource.com/platform/external/stg/.

Building from Source

Instructions are included for local and Docker builds.

Dependencies

STG is written in C++20. It is known to compile with GCC 11, Clang 15 or later versions. Mininum requirements for a local build are:

DependencyDebianRedHatVersion
buildcmakecmake3.14
ELF, BTFlibelf-develfutils-devel0.189
DWARFlibdw-develfutils-devel0.189
XMLlibxml2-devlibxml2-devel2.9
BTFlinux-libc-devkernel-headers5.19
native formatlibprotobuf-devprotobuf-devel3.19
native formatprotobuf-compilerprotobuf-compiler3.19
allocator[^1]libjemalloc-devjemalloc-devel5
catch2[^2]catch2catch2-devel2 (only)

[^1]: jemalloc is optional, but will likely improve performance. [^2]: catch2 is optional, but required to build the test suite.

Local Build

Build STG using CMake as follows:

$ mkdir build && cd build
$ cmake ..
$ cmake --build . --parallel

Run the STG unit test suite:

$ ctest

Docker Build

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

$ docker build -t stg .

And then enter the container:

$ docker run -it stg

Note that the Dockerfile provides only a production image. To use Docker as a development environment, you can comment out everything after the line # second stage.

After that you may 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.

Contributions

See CONTRIBUTING.md for details.

Contact Information

Please send feedback, questions and bug reports to kernel-team@android.com.