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

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