aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-06 00:46:56 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-06 00:48:26 -0700
commitf3180fa9ee8917fa9547cd5f79c822761f5d87a0 (patch)
tree0053e9d7ac0506a307b9c912491e5f504cb7ed12 /bfd/elfxx-x86.h
parente74399c47c76b8111651f41b52a05401852cf799 (diff)
downloadgdb-f3180fa9ee8917fa9547cd5f79c822761f5d87a0.zip
gdb-f3180fa9ee8917fa9547cd5f79c822761f5d87a0.tar.gz
gdb-f3180fa9ee8917fa9547cd5f79c822761f5d87a0.tar.bz2
x86: Add VERIFY_PLT_ENTRY
Add VERIFY_PLT_ENTRY to verify that symbol has an entry in the procedure linkage table. * elfxx-x86.h (VERIFY_PLT_ENTRY): New. * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it. * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r--bfd/elfxx-x86.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index be438c0..b81e145 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -196,6 +196,18 @@
&& (H)->dynindx == -1 \
&& (TLS_TYPE & GOT_TLS_IE))
+/* Verify that the symbol has an entry in the procedure linkage table. */
+#define VERIFY_PLT_ENTRY(INFO, H, PLT, GOTPLT, RELPLT, LOCAL_UNDEFWEAK) \
+ if (((H)->dynindx == -1 \
+ && !LOCAL_UNDEFWEAK \
+ && !(((H)->forced_local || bfd_link_executable (INFO)) \
+ && (H)->def_regular \
+ && (H)->type == STT_GNU_IFUNC)) \
+ || (PLT) == NULL \
+ || (GOTPLT) == NULL \
+ || (RELPLT) == NULL) \
+ abort ();
+
/* x86 ELF linker hash entry. */
struct elf_x86_link_hash_entry