summaryrefslogtreecommitdiffstats
path: root/libelf/libelfP.h
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/libelfP.h')
-rw-r--r--libelf/libelfP.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 7da23709..52cf7457 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -587,4 +587,8 @@ extern uint32_t __libelf_crc32 (uint32_t crc, unsigned char *buf, size_t len)
/* Align offset to 4 bytes as needed for note name and descriptor data. */
#define NOTE_ALIGN(n) (((n) + 3) & -4U)
+/* Convenience macro. */
+#define INVALID_NDX(ndx, type, data) \
+ unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
+
#endif /* libelfP.h */