diff options
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 6f9d737..e0b7e57 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -707,30 +707,49 @@ struct elf_link_hash_table asection *dynsym; }; +/* Returns TRUE if the hash table is a struct elf_link_hash_table. */ + +static inline bool +is_elf_hash_table (const struct bfd_link_hash_table *htab) +{ + return htab->type == bfd_link_elf_hash_table; +} + /* Look up an entry in an ELF linker hash table. */ -#define elf_link_hash_lookup(table, string, create, copy, follow) \ - ((struct elf_link_hash_entry *) \ - bfd_link_hash_lookup (&(table)->root, (string), (create), \ - (copy), (follow))) +static inline struct elf_link_hash_entry * +elf_link_hash_lookup (struct elf_link_hash_table *table, const char *string, + bool create, bool copy, bool follow) +{ + return (struct elf_link_hash_entry *) + bfd_link_hash_lookup (&table->root, string, create, copy, follow); +} /* Traverse an ELF linker hash table. */ -#define elf_link_hash_traverse(table, func, info) \ - (bfd_link_hash_traverse \ - (&(table)->root, \ - (bool (*) (struct bfd_link_hash_entry *, void *)) (func), \ - (info))) +static inline void +elf_link_hash_traverse (struct elf_link_hash_table *table, + bool (*f) (struct elf_link_hash_entry *, void *), + void *info) +{ + bfd_link_hash_traverse (&table->root, + (bool (*) (struct bfd_link_hash_entry *, void *)) f, + info); +} /* Get the ELF linker hash table from a link_info structure. */ -#define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash)) - -#define elf_hash_table_id(table) ((table) -> hash_table_id) +static inline struct elf_link_hash_table * +elf_hash_table (const struct bfd_link_info *info) +{ + return (struct elf_link_hash_table *) info->hash; +} -/* Returns TRUE if the hash table is a struct elf_link_hash_table. */ -#define is_elf_hash_table(htab) \ - (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table) +static inline enum elf_target_id +elf_hash_table_id (const struct elf_link_hash_table *table) +{ + return table->hash_table_id; +} /* Constant information held for an ELF backend. */ |