]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Silence -fsanitize=undefined
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Jun 2020 13:32:24 +0000 (06:32 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Jun 2020 13:32:24 +0000 (06:32 -0700)
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)".

bfd/ChangeLog
bfd/elfxx-x86.h

index e60cfac5be2105bfe0a2b4412c6af84d72e56655..2fa19f8130d756dfb43fffcdd0788a1f68a0cab0 100644 (file)
@@ -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
index b64c41390aceb93a7d5b88a219bcc955d50b951b..c717cd16e56ed18749fd9589410cad42adada3b9 100644 (file)
        || ((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 \