#include <stddef.h>
#include <stdint.h>
-
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
-# define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
-# define __deprecated_attribute__ __attribute__ ((__deprecated__))
-#else
-# define __nonnull_attribute__(args...)
-# define __deprecated_attribute__
-#endif
-
-
-#ifdef __GNUC_STDC_INLINE__
-# define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__))
-#else
-# define __libdw_extern_inline extern __inline
-#endif
-
-
/* Mode for the session. */
typedef enum
{
/* Out-Of-Memory handler. */
-#if __GNUC__ < 4
-typedef void (*Dwarf_OOM) (void);
-#else
-typedef void (*__attribute__ ((noreturn)) Dwarf_OOM) (void);
-#endif
+typedef void (*__noreturn_attribute__ Dwarf_OOM) (void);
#ifdef __cplusplus
/* Information about the descriptor. */
/* Get ELF machine. */
-extern int ebl_get_elfmachine (Ebl *ebl) __attribute__ ((__pure__));
+extern int ebl_get_elfmachine (Ebl *ebl) __pure_attribute__;
/* Get ELF class. */
-extern int ebl_get_elfclass (Ebl *ebl) __attribute__ ((__pure__));
+extern int ebl_get_elfclass (Ebl *ebl) __pure_attribute__;
/* Get ELF data encoding. */
-extern int ebl_get_elfdata (Ebl *ebl) __attribute__ ((__pure__));
+extern int ebl_get_elfdata (Ebl *ebl) __pure_attribute__;
/* Function to call the callback functions including default ELF
#define ELFCOMPRESS_HIPROC 0x7fffffff /* End of processor-specific. */
#endif
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+# define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
+# define __deprecated_attribute__ __attribute__ ((__deprecated__))
+# define __pure_attribute__ __attribute__ ((__pure__))
+# define __const_attribute__ __attribute__ ((__const__))
+#else
+# define __nonnull_attribute__(...)
+# define __deprecated_attribute__
+# define __pure_attribute__
+# define __const_attribute__
+#endif
+
+#if __GNUC__ < 4
+#define __noreturn_attribute__
+#else
+#define __noreturn_attribute__ __attribute__ ((noreturn))
+#endif
+
+#ifdef __GNUC_STDC_INLINE__
+# define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__))
+#else
+# define __libdw_extern_inline extern __inline
+#endif
+
/* Known translation types. */
typedef enum
{
extern int64_t elf_update (Elf *__elf, Elf_Cmd __cmd);
/* Determine what kind of file is associated with ELF. */
-extern Elf_Kind elf_kind (Elf *__elf) __attribute__ ((__pure__));
+extern Elf_Kind elf_kind (Elf *__elf) __pure_attribute__;
/* Get the base offset for an object file. */
extern int64_t elf_getbase (Elf *__elf);
It was agreed to make the same functionality available under a different
name and obsolete the old name. */
extern int elf_getshnum (Elf *__elf, size_t *__dst)
- __attribute__ ((__deprecated__));
+ __deprecated_attribute__;
/* Get the section index of the section header string table in the ELF
It was agreed to make the same functionality available under a different
name and obsolete the old name. */
extern int elf_getshstrndx (Elf *__elf, size_t *__dst)
- __attribute__ ((__deprecated__));
+ __deprecated_attribute__;
/* Retrieve section header of ELFCLASS32 binary. */
The result is based on version VERSION of the ELF standard. */
extern size_t elf32_fsize (Elf_Type __type, size_t __count,
unsigned int __version)
- __attribute__ ((__const__));
+ __const_attribute__;
/* Similar but this time the binary calls is ELFCLASS64. */
extern size_t elf64_fsize (Elf_Type __type, size_t __count,
unsigned int __version)
- __attribute__ ((__const__));
+ __const_attribute__;
/* Convert data structure from the representation in the file represented
/* Compute hash value. */
extern unsigned long int elf_hash (const char *__string)
- __attribute__ ((__pure__));
+ __pure_attribute__;
/* Compute hash value using the GNU-specific hash function. */
extern unsigned long int elf_gnu_hash (const char *__string)
- __attribute__ ((__pure__));
+ __pure_attribute__;
/* Compute simple checksum from permanent parts of the ELF file. */