public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] DWARF reader: Comment ARM32 ELF address interpretation
@ 2021-03-10 12:22 Giuliano Procida
  2021-03-11  9:11 ` Dodji Seketeli
  2021-03-11 17:16 ` Mark Wielaard
  0 siblings, 2 replies; 4+ messages in thread
From: Giuliano Procida @ 2021-03-10 12:22 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich, mark

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(-)

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())
-- 
2.30.1.766.gb4fecdf3b7-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] DWARF reader: Comment ARM32 ELF address interpretation
  2021-03-10 12:22 [PATCH] DWARF reader: Comment ARM32 ELF address interpretation Giuliano Procida
@ 2021-03-11  9:11 ` Dodji Seketeli
  2021-03-11 17:16 ` Mark Wielaard
  1 sibling, 0 replies; 4+ messages in thread
From: Dodji Seketeli @ 2021-03-11  9:11 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, kernel-team, maennich, mark

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,

-- 
		Dodji

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] DWARF reader: Comment ARM32 ELF address interpretation
  2021-03-10 12:22 [PATCH] DWARF reader: Comment ARM32 ELF address interpretation Giuliano Procida
  2021-03-11  9:11 ` Dodji Seketeli
@ 2021-03-11 17:16 ` Mark Wielaard
  2021-03-12  9:39   ` Giuliano Procida
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2021-03-11 17:16 UTC (permalink / raw)
  To: Giuliano Procida, libabigail; +Cc: dodji, kernel-team, maennich

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] DWARF reader: Comment ARM32 ELF address interpretation
  2021-03-11 17:16 ` Mark Wielaard
@ 2021-03-12  9:39   ` Giuliano Procida
  0 siblings, 0 replies; 4+ messages in thread
From: Giuliano Procida @ 2021-03-12  9:39 UTC (permalink / raw)
  To: Mark Wielaard
  Cc: Giuliano Procida via Libabigail, Dodji Seketeli, kernel-team,
	Matthias Männich

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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-12  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 12:22 [PATCH] DWARF reader: Comment ARM32 ELF address interpretation Giuliano Procida
2021-03-11  9:11 ` Dodji Seketeli
2021-03-11 17:16 ` Mark Wielaard
2021-03-12  9:39   ` Giuliano Procida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).