Message ID | 20210310122254.2860952-1-gprocida@google.com |
---|---|
State | Committed, archived |
Headers |
Return-Path: <libabigail-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 122EA384BC33; Wed, 10 Mar 2021 12:23:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 122EA384BC33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615378991; bh=+CPhFu5fjQdMWt2XGWqhYcf/tuDVUFugzQ8c8yz98hY=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:Cc:From; b=bCUKzjeG/lQd+RRmtATLsP6mk+enXnc3YEx5/dnYnDCxvhxeLp52XNea06OoQN+gj OLvwlGt89YfZyLrzE3WKmiKe4ey5gjpLX1QzyofjA/Y8JmNnElvivhaMoi1xfRVN0h WiDEL11wxdCjt9WeHbFx09oDkdLXmwtIqD3aA+Io= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by sourceware.org (Postfix) with ESMTPS id 972973860C3E for <libabigail@sourceware.org>; Wed, 10 Mar 2021 12:23:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 972973860C3E Received: by mail-qk1-x749.google.com with SMTP id h20so12569345qkj.18 for <libabigail@sourceware.org>; Wed, 10 Mar 2021 04:23:06 -0800 (PST) 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=+CPhFu5fjQdMWt2XGWqhYcf/tuDVUFugzQ8c8yz98hY=; b=SQ4PmVDOoQhFQq9DhNsFIEXuA2TL73ycBU+CrFSUCKBl65L2lZ0Ke1OXhlorhXIt4P DwMDRwhWhhmqoKxN+v3vsfrQ2DzqnRr2KLlZWMv2Lx/rhEysMxaV/RNzCkegP+6ktgnk r5Jk67Yc7gVj+mF/SHaFfni7lUXVli5adKV7Z03YeIjEgsk+EwL7annslTFeyYJKYTI9 +IQWQN/fAmi+w2jVFtNjis2elNaQRjsEiPn0PryxT9oMPAT6R5XbmgXcaA0xGN29eKEL vgAWKmxreJB5wTeRESfDNCv7ASXzCJSkRlJmp5wNuKyksieui4g8r8RxwOFfRRkpgMQU G1Tg== X-Gm-Message-State: AOAM530pYci66rSnsf5+AfiHDWod8YyLwYjbQtFo0G30F/aiqmBjJ9Gu GfbROTYc+iwn31Cf5K0iEQmQe6055Yex1S2KEwF3V5WSBZrpttlTzOJGOyvCIIJ9R6gkeq47vHa UlHvMN2Kz3mmC7HrByaG9Uz6ePJg6T26j6B6xNxU6+HzY9aw/NZ2dyv/BjGBwvX20miphCTA= X-Google-Smtp-Source: ABdhPJxu/JyS/SbP/rSjEc4zDaQzPprrxb75ctzDqy+AAI0LpVhEixU8SpDqd68oWlh4/I4d5WW4kAPiDR63mg== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:110:52f:7b5d:e23d:21c7]) (user=gprocida job=sendgmr) by 2002:ad4:51c1:: with SMTP id p1mr2680832qvq.39.1615378986075; Wed, 10 Mar 2021 04:23:06 -0800 (PST) Date: Wed, 10 Mar 2021 12:22:54 +0000 Message-Id: <20210310122254.2860952-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [PATCH] DWARF reader: Comment ARM32 ELF address interpretation To: libabigail@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-22.8 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Mailing list of the Libabigail project <libabigail.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libabigail>, <mailto:libabigail-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libabigail/> List-Help: <mailto:libabigail-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libabigail>, <mailto:libabigail-request@sourceware.org?subject=subscribe> From: Giuliano Procida via Libabigail <libabigail@sourceware.org> Reply-To: Giuliano Procida <gprocida@google.com> Cc: maennich@google.com, kernel-team@android.com, mark@klomp.org Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" <libabigail-bounces@sourceware.org> |
Series |
DWARF reader: Comment ARM32 ELF address interpretation
|
|
Commit Message
Giuliano Procida
March 10, 2021, 12:22 p.m. UTC
Bug 27552 - libabigail needs to interpret ARM32 symbol addresses specially
The previous commit omitted any code commentary. This adds a link to
the relevant reference. The code is shortened slightly as well.
* src/abg-dwarf-reader.cc
(read_context::load_symbol_maps_from_symtab_section): Add
descriptive comment to ARM32 address handling; shorten
the assignment using &=.
Signed-off-by: Giuliano Procida <gprocida@google.com>
---
src/abg-dwarf-reader.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
Giuliano Procida <gprocida@google.com> a écrit: > Bug 27552 - libabigail needs to interpret ARM32 symbol addresses specially > > The previous commit omitted any code commentary. This adds a link to > the relevant reference. The code is shortened slightly as well. > > * src/abg-dwarf-reader.cc > (read_context::load_symbol_maps_from_symtab_section): Add > descriptive comment to ARM32 address handling; shorten > the assignment using &=. > > Signed-off-by: Giuliano Procida <gprocida@google.com> Applied to master, thanks. Cheers,
Hi, On Wed, 2021-03-10 at 12:22 +0000, Giuliano Procida wrote: > Bug 27552 - libabigail needs to interpret ARM32 symbol addresses > specially BTW. I tried to get this correct for elfutils when using the libdwfl dwfl_module_addrsym and dwfl_module_addrinfo functions: https://sourceware.org/bugzilla/show_bug.cgi?id=27564 Has a proposed patch that needs a bit more testing (and maybe a tweak). libabigail doesn't use these functions, but one benefit of them is that they also handle the case of ppc function descriptors (that is old style ppc32 and ppc64be). Cheers, Mark
Hi. On Thu, 11 Mar 2021 at 17:16, Mark Wielaard <mark@klomp.org> wrote: > Hi, > > On Wed, 2021-03-10 at 12:22 +0000, Giuliano Procida wrote: > > Bug 27552 - libabigail needs to interpret ARM32 symbol addresses > > specially > > BTW. I tried to get this correct for elfutils when using the libdwfl > dwfl_module_addrsym and dwfl_module_addrinfo functions: > https://sourceware.org/bugzilla/show_bug.cgi?id=27564 > Has a proposed patch that needs a bit more testing (and maybe a tweak). > > Having a library layer that does all the fixups seems a lot better than having the logic in libabigail. > libabigail doesn't use these functions, but one benefit of them is that > they also handle the case of ppc function descriptors (that is old > style ppc32 and ppc64be). > > Hopefully, they are relatively straightforward to drop in. However, Matthias has symbol table reader changes still queued up; once these are done, we can take a look. libabibgail would become dependent on libdwfl version >= X for correctness, so we'd need to assert that at compile time. Thanks, Giuliano. > Cheers, > > Mark >
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 9a8e7b34..b6b10116 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -6238,7 +6238,10 @@ public: sym); if (is_arm32) - symbol_value = symbol_value & ~1; + // Clear bit zero of ARM32 addresses as per "ELF for the Arm + // Architecture" section 5.5.3. + // https://static.docs.arm.com/ihi0044/g/aaelf32.pdf + symbol_value &= ~1; addr_elf_symbol_sptr_map_type::const_iterator it = fun_addr_sym_map_->find(symbol_value); if (it == fun_addr_sym_map_->end())