PowerPC: Don't generate unused section symbols
[binutils-gdb.git] / bfd / elf32-nds32.h
index 83547b2cffcc3569c6f2a57e2716b4b111d47e58..e7853cf129f78609d9485d5ff53b3adc361567b2 100644 (file)
@@ -1,5 +1,5 @@
 /* NDS32-specific support for 32-bit ELF.
-   Copyright (C) 2012-2020 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
    Contributed by Andes Technology Corporation.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -104,10 +104,10 @@ extern void          bfd_elf32_nds32_set_target_option (struct bfd_link_info *,
                                                      int, int, FILE *,
                                                      int, int, int);
 
-#define nds32_elf_hash_table(info) \
-  (elf_hash_table_id ((struct elf_link_hash_table *) ((info)->hash)) \
-   == NDS32_ELF_DATA ? \
-   ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL)
+#define nds32_elf_hash_table(p) \
+  ((is_elf_hash_table ((p)->hash)                                      \
+    && elf_hash_table_id (elf_hash_table (p)) == NDS32_ELF_DATA)       \
+   ? (struct elf_nds32_link_hash_table *) (p)->hash : NULL)
 
 #define elf32_nds32_compute_jump_table_size(htab) \
   ((htab)->next_tls_desc_index * 4)