aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-06 00:50:12 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-06 00:51:40 -0700
commitff38b4cc55dade4c9970cac2149a946d5dc0adc7 (patch)
tree6fbd0e348a7ea54ee89be918a589d5e630af7768 /bfd/elfxx-x86.h
parentf3180fa9ee8917fa9547cd5f79c822761f5d87a0 (diff)
downloadgdb-ff38b4cc55dade4c9970cac2149a946d5dc0adc7.zip
gdb-ff38b4cc55dade4c9970cac2149a946d5dc0adc7.tar.gz
gdb-ff38b4cc55dade4c9970cac2149a946d5dc0adc7.tar.bz2
x86: Add VERIFY_COPY_RELOC
Add VERIFY_COPY_RELOC to verify that symbol supports copy relocation. * elfxx-x86.h (VERIFY_COPY_RELOC): 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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index b81e145..ca270de 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -208,6 +208,15 @@
|| (RELPLT) == NULL) \
abort ();
+/* Verify that the symbol supports copy relocation. */
+#define VERIFY_COPY_RELOC(H, HTAB) \
+ if ((H)->dynindx == -1 \
+ || ((H)->root.type != bfd_link_hash_defined \
+ && (H)->root.type != bfd_link_hash_defweak) \
+ || (HTAB)->elf.srelbss == NULL \
+ || (HTAB)->elf.sreldynrelro == NULL) \
+ abort ();
+
/* x86 ELF linker hash entry. */
struct elf_x86_link_hash_entry