Message ID | 20200420110846.218792-1-maennich@google.com |
---|---|
Headers |
From: maennich@google.com (Matthias Maennich) Date: Mon, 20 Apr 2020 13:08:38 +0200 Subject: [PATCH 0/8] Refactor dwarf-reader: split out ELF helpers Message-ID: <20200420110846.218792-1-maennich@google.com> |
Series |
Refactor dwarf-reader: split out ELF helpers
|
|
Message
Matthias Männich
April 20, 2020, 11:08 a.m. UTC
The abg-dwarf-reader.cc has grown into a large compilation unit with a lot of responsibilities. This does not only affect the compilation time, but also readability of the various implementation details. Hence it makes sense to attempt a refactoring of parts of it. To overcome the above and as a preparation for my future work on the symtab reading part, this splits out functionality from the dwarf reader into a new set of source files: src/elf-helpers.{h,cc} along with a test that so far only serves the purpose of ensuring that the header file can be compiled on its own. The elf-helpers, sensibly not named elf-utils, contain functionality like looking up sections, converting values or deducting information and properties in some way from an Elf* handle. They are not exposed to libabigail users as they are an implementation detail of libabigail. This set of changes is only a refactoring with minor cleanups and renames and any change to the functionality would be unintentional. Cheers, Matthias Matthias Maennich (8): abg-dwarf-reader split: create abg-elf-helpers.{h,cc} and test case abg-elf-helpers: move some elf helpers from abg-dwarf-reader abg-elf-helpers: move some versioning helpers from abg-dwarf-reader abg-elf-helpers: move some kernel helpers from abg-dwarf-reader abg-elf-helpers: consolidate the is_linux_kernel* helpers abg-dwarf-reader: migrate more ELF helpers to elf-helpers abg-elf-helpers: migrate more elf helpers (architecture specific helpers) abg-elf-helpers: migrate maybe_adjust_et_rel_sym_addr_to_abs_addr src/Makefile.am | 2 + src/abg-dwarf-reader.cc | 1209 ++----------------------------------- src/abg-elf-helpers.cc | 1031 +++++++++++++++++++++++++++++++ src/abg-elf-helpers.h | 183 ++++++ tests/.gitignore | 1 + tests/Makefile.am | 6 +- tests/test-elf-helpers.cc | 30 + 7 files changed, 1295 insertions(+), 1167 deletions(-) create mode 100644 src/abg-elf-helpers.cc create mode 100644 src/abg-elf-helpers.h create mode 100644 tests/test-elf-helpers.cc
Comments
The abg-dwarf-reader.cc has grown into a large compilation unit with a lot of responsibilities. This does not only affect the compilation time, but also readability of the various implementation details. Hence it makes sense to attempt a refactoring of parts of it. To overcome the above and as a preparation for my future work on the symtab reading part, this splits out functionality from the dwarf reader into a new set of source files: src/elf-helpers.{h,cc} along with a test that so far only serves the purpose of ensuring that the header file can be compiled on its own. The elf-helpers, sensibly not named elf-utils, contain functionality like looking up sections, converting values or deducting information and properties in some way from an Elf* handle. They are not exposed to libabigail users as they are an implementation detail of libabigail. This set of changes is only a refactoring with minor cleanups and renames and any change to the functionality would be unintentional. Cheers, Matthias --- v2: Address Giuliano's comments. (Thanks!) Mostly reworking the commit messages. Matthias Maennich (8): abg-dwarf-reader split: create abg-elf-helpers.{h,cc} and test case abg-elf-helpers: move some elf helpers from abg-dwarf-reader abg-elf-helpers: move some versioning helpers from abg-dwarf-reader abg-elf-helpers: move some kernel helpers from abg-dwarf-reader abg-elf-helpers: consolidate the is_linux_kernel* helpers abg-dwarf-reader: migrate more ELF helpers to elf-helpers abg-elf-helpers: migrate more elf helpers (architecture specific helpers) abg-elf-helpers: migrate maybe_adjust_et_rel_sym_addr_to_abs_addr src/Makefile.am | 2 + src/abg-dwarf-reader.cc | 1209 ++----------------------------------- src/abg-elf-helpers.cc | 1031 +++++++++++++++++++++++++++++++ src/abg-elf-helpers.h | 183 ++++++ tests/.gitignore | 1 + tests/Makefile.am | 6 +- tests/test-elf-helpers.cc | 30 + 7 files changed, 1295 insertions(+), 1167 deletions(-) create mode 100644 src/abg-elf-helpers.cc create mode 100644 src/abg-elf-helpers.h create mode 100644 tests/test-elf-helpers.cc