aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-06 00:43:31 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-06 00:44:38 -0700
commite74399c47c76b8111651f41b52a05401852cf799 (patch)
treefbb5f6b6bd0784f3e5177087b6112131d0b4174d /bfd/elfxx-x86.h
parentaebcc8ffd201adbee973b414818b01876dabe1a0 (diff)
downloadgdb-e74399c47c76b8111651f41b52a05401852cf799.zip
gdb-e74399c47c76b8111651f41b52a05401852cf799.tar.gz
gdb-e74399c47c76b8111651f41b52a05401852cf799.tar.bz2
x86: Add COPY_INPUT_RELOC_P
Add COPY_INPUT_RELOC_P which returns TRUE if input relocation should be copied to output. * elfxx-x86.h (COPY_INPUT_RELOC_P): New. * elf32-i386.c (elf_i386_relocate_section): Use it. * elf64-x86-64.c (elf_x86_64_relocate_section): 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 cef2eba..be438c0 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -143,6 +143,15 @@
&& (((EH)->elf.def_dynamic && !(EH)->elf.def_regular) \
|| (EH)->elf.root.type == bfd_link_hash_undefined)))
+/* TRUE if this input relocation should be copied to output. H->dynindx
+ may be -1 if this symbol was marked to become local. */
+#define COPY_INPUT_RELOC_P(INFO, H, R_TYPE) \
+ ((H) != NULL \
+ && (H)->dynindx != -1 \
+ && (X86_PCREL_TYPE_P (R_TYPE) \
+ || !(bfd_link_executable (INFO) || SYMBOLIC_BIND ((INFO), (H))) \
+ || !(H)->def_regular))
+
/* TRUE if this is actually a static link, or it is a -Bsymbolic link
and the symbol is defined locally, or the symbol was forced to be
local because of a version file. */