aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-06-03 06:32:24 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-06-03 06:32:24 -0700
commit433953ffa1a59531a5537327a4e3ce24565e609c (patch)
tree864e26646db745dc18b6d48fb969bab45e3d3962
parentbbd2d6bf2d6627f64569a03ef290965c06e60b27 (diff)
downloadbinutils-433953ffa1a59531a5537327a4e3ce24565e609c.zip
binutils-433953ffa1a59531a5537327a4e3ce24565e609c.tar.gz
binutils-433953ffa1a59531a5537327a4e3ce24565e609c.tar.bz2
x86: Silence -fsanitize=undefined
Replace "&(EH)->elf" with "(struct elf_link_hash_entry *) (EH)" to silence -fsanitize=undefined. * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Replace "&(EH)->elf" with "(struct elf_link_hash_entry *) (EH)".
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-x86.h6
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e60cfac..2fa19f8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
+ -fsanitize=undefined.
+
2020-06-03 Alan Modra <amodra@gmail.com>
PR 26069
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index b64c413..c717cd1 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -133,9 +133,9 @@
|| ((ELF_ST_VISIBILITY ((EH)->elf.other) == STV_DEFAULT \
&& (!(RESOLVED_TO_ZERO) || PC32_RELOC)) \
|| (EH)->elf.root.type != bfd_link_hash_undefweak)) \
- && ((!X86_PCREL_TYPE_P (R_TYPE) \
- && !X86_SIZE_TYPE_P (R_TYPE)) \
- || ! SYMBOL_CALLS_LOCAL ((INFO), &(EH)->elf))) \
+ && ((!X86_PCREL_TYPE_P (R_TYPE) && !X86_SIZE_TYPE_P (R_TYPE)) \
+ || ! SYMBOL_CALLS_LOCAL ((INFO), \
+ (struct elf_link_hash_entry *) (EH)))) \
|| (ELIMINATE_COPY_RELOCS \
&& !bfd_link_pic (INFO) \
&& (EH) != NULL \