aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-14 10:19:30 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-14 10:20:30 -0700
commit62cd30f167be56e68cb0a37789d400b47bbdbc6c (patch)
treeff8b437aa7a573a8e62b50b96b25a8d6d32ef846 /bfd/elf-bfd.h
parent824dfcc311958af08c25d29956da2bab99e240c9 (diff)
downloadgdb-62cd30f167be56e68cb0a37789d400b47bbdbc6c.zip
gdb-62cd30f167be56e68cb0a37789d400b47bbdbc6c.tar.gz
gdb-62cd30f167be56e68cb0a37789d400b47bbdbc6c.tar.bz2
Move UNDEFWEAK_NO_DYNAMIC_RELOC to elf-bfd.h
Move UNDEFWEAK_NO_DYNAMIC_RELOC to elf-bfd.h so that it can be used by other ELF linker backends. * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ... * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here. * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index c3560ce..f0229d4 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -266,6 +266,13 @@ struct elf_link_hash_entry
#define SYMBOL_CALLS_LOCAL(INFO, H) \
_bfd_elf_symbol_refs_local_p (H, INFO, 1)
+/* Whether an undefined weak symbol should resolve to its link-time
+ value, even in PIC or PIE objects. */
+#define UNDEFWEAK_NO_DYNAMIC_RELOC(INFO, H) \
+ ((H)->root.type == bfd_link_hash_undefweak \
+ && (ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT \
+ || (INFO)->dynamic_undefined_weak == 0))
+
/* Common symbols that are turned into definitions don't have the
DEF_REGULAR flag set, so they might appear to be undefined.
Symbols defined in linker scripts also don't have DEF_REGULAR set. */