summaryrefslogtreecommitdiff
path: root/libdw/memory-access.h
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2014-09-12 19:03:33 +0200
committerPetr Machata <pmachata@redhat.com>2014-09-12 19:55:53 +0200
commit1498f541290f072ade0b783c298c358e9da74937 (patch)
treed371353f7896147e127b859409be03d8f53a6bcc /libdw/memory-access.h
parent476feb1c7db2c6dfa217f8a18d2eb1af2789cbb0 (diff)
downloadelfutils-1498f541290f072ade0b783c298c358e9da74937.tar.gz
Rename read_ubyte_unaligned_inc to read_addr_unaligned_inc
- The behavior of this function has been changed to read only address-sized quantities, i.e. the size of 2 is no longer allowed. (Size of 1 never was.) The two outstanding uses, both in readelf.c, which actually do use this call to read address-sized units, were updated, rejecting fields that indicate weird address sizes. - The three related calls, read_sbyte_unaligned_inc, read_ubyte_unaligned and read_sbyte_unaligned were dropped. There are currently no uses for these calls. Signed-off-by: Petr Machata <pmachata@redhat.com>
Diffstat (limited to 'libdw/memory-access.h')
-rw-r--r--libdw/memory-access.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/libdw/memory-access.h b/libdw/memory-access.h
index f41f783d..6a4ce885 100644
--- a/libdw/memory-access.h
+++ b/libdw/memory-access.h
@@ -219,17 +219,6 @@ read_8sbyte_unaligned_1 (bool other_byte_order, const void *p)
#endif /* allow unaligned */
-#define read_ubyte_unaligned(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2ubyte_unaligned (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4ubyte_unaligned (Dbg, Addr) \
- : read_8ubyte_unaligned (Dbg, Addr))
-
-#define read_sbyte_unaligned(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2sbyte_unaligned (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4sbyte_unaligned (Dbg, Addr) \
- : read_8sbyte_unaligned (Dbg, Addr))
-
-
#define read_2ubyte_unaligned_inc(Dbg, Addr) \
({ uint16_t t_ = read_2ubyte_unaligned (Dbg, Addr); \
Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 2); \
@@ -258,14 +247,9 @@ read_8sbyte_unaligned_1 (bool other_byte_order, const void *p)
t_; })
-#define read_ubyte_unaligned_inc(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2ubyte_unaligned_inc (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \
- : read_8ubyte_unaligned_inc (Dbg, Addr))
-
-#define read_sbyte_unaligned_inc(Nbytes, Dbg, Addr) \
- ((Nbytes) == 2 ? read_2sbyte_unaligned_inc (Dbg, Addr) \
- : (Nbytes) == 4 ? read_4sbyte_unaligned_inc (Dbg, Addr) \
- : read_8sbyte_unaligned_inc (Dbg, Addr))
+#define read_addr_unaligned_inc(Nbytes, Dbg, Addr) \
+ (assert ((Nbytes) == 4 || (Nbytes) == 8), \
+ ((Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \
+ : read_8ubyte_unaligned_inc (Dbg, Addr)))
#endif /* memory-access.h */