From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3yYKdXggKCkAocgppkejiqqing.eqonkdcdkicknuqwtegyctg.qti@flex--maennich.bounces.google.com> Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id 38ACD386EC6D for ; Mon, 20 Apr 2020 11:08:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 38ACD386EC6D Received: by mail-wm1-x34a.google.com with SMTP id y1so4040653wmj.3 for ; Mon, 20 Apr 2020 04:08:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=MsoKLy1fj4jvGA289OoQV+Oooh55yW9tZLRfCA59WgY=; b=Pi4twg1rzF9gS1zzuzVlGbNkVpQgBYg3/f0txJBEW0AfftK2FioDQSwD12xIQDgZqX JxbroLHDH4NFTCt5s1qiKYpSCNZIyAjGxeRKZDBITSRqKJxlHaWqMJwP3lbIUvke6aFJ 2v79+r2xATJ02KThJQWUBlNaAXrSLdHrx3AhaLmqdam8x2aV1Yg9QV4gSlP327ONNIWI BMIPWeOqggs8qXiRWK9DYorjPt7UlOXiz86Z3AzG3PFMx1JuXAKuw89A36fe8gTHN18Q 2hAyRHwZLzF13MynSjTobG/Yk+eWHUiGZj/dl9Pe+sDCNwvdw9djlr9hTStsoYDHrN8P R0dg== X-Gm-Message-State: AGi0PubzM9dBaQnAL5pc8QmQCAzHIEkMNZ7bABpkAhdJGJUufxdy4Dyg qyNqd5Ia1Z9gMUqknPYwtukJUm6J2kr4Ak/9moQblPRGkiMAbc+qsMm9NF25pHPqtutnLJ+aukT QXQ0GJHyyExzYdIkm4CXFk1ygtNcvoZlDjqG+tNj1UBWzZYgn991IPDb36cWH0yKCq9XHvmI= X-Google-Smtp-Source: APiQypJcB+xMx2ApEQDZx08YKVnrqAF7tcTgjifyxSw7PAE3Zajt24z492Fvj0ETMLCP+VAXKv49kosioZnP9A== X-Received: by 2002:a5d:420d:: with SMTP id n13mr19812949wrq.204.1587380937973; Mon, 20 Apr 2020 04:08:57 -0700 (PDT) Date: Mon, 20 Apr 2020 13:08:38 +0200 Message-Id: <20200420110846.218792-1-maennich@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog Subject: [PATCH 0/8] Refactor dwarf-reader: split out ELF helpers From: Matthias Maennich To: libabigail@sourceware.org Cc: dodji@seketeli.org, gprocida@google.com, kernel-team@android.com, maennich@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-25.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 11:09:00 -0000 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 -- 2.26.1.301.g55bc3eb7cb9-goog