[RFC,01/11] x86-64, elf: make elf_machine_lazy_rel() ignore R_X86_64_NONE
diff mbox series

Message ID cc52a3f3e6c0a5449e04168b158efe31612bc307.1568219399.git.isaku.yamahata@gmail.com
State New
Headers show
Series
  • Library OS support
Related show

Commit Message

Isaku Yamahata Sept. 11, 2019, 9:03 p.m. UTC
This adds a check of R_X86_64_NONE to ignore it on lazy relocation to
elf_machine_lazy_rel().
LibOS may also do relocation and change the relocation entry to NONE.
So elf_machine_lazy_rel() may see R_X86_64_NONE in this code path in
addition to elf_machine_rela().

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
---
 sysdeps/x86_64/dl-machine.h | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 95a13b35b5..50db45c082 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -578,6 +578,8 @@  elf_machine_lazy_rel (struct link_map *map,
 	value = ((ElfW(Addr) (*) (void)) value) ();
       *reloc_addr = value;
     }
+  else if (__glibc_unlikely (r_type == R_X86_64_NONE))
+    return;
   else
     _dl_reloc_bad_type (map, r_type, 1);
 }