]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Allow IFUNC relocation against unrelocated shared library
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 2 Feb 2017 21:14:43 +0000 (13:14 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 2 Feb 2017 21:14:59 +0000 (13:14 -0800)
IFUNC relocation against definition in unrelocated shared library
will lead to segfault when the IFUNC function is called.  This
patch allows such IFUNC relocations with a warning.  This isn't
a real fix for

https://sourceware.org/bugzilla/show_bug.cgi?id=21041

It simply allows the program to load.  The program will segfault
when longjmp is called.

* sysdeps/i386/dl-machine.h (elf_machine_rel): Replace
_dl_fatal_printf with _dl_error_printf for IFUNC relocation
against unrelocated shared library.
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.

ChangeLog
sysdeps/i386/dl-machine.h
sysdeps/x86_64/dl-machine.h

index a210e631f4a531fcedbcfadb6d8fc4b396842bf1..9b5b2eb908bebe9b3e4a02ee6ced7144347ffbc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-02-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/i386/dl-machine.h (elf_machine_rel): Replace
+       _dl_fatal_printf with _dl_error_printf for IFUNC relocation
+       against unrelocated shared library.
+       * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
+
 2017-02-02  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
        * sysdeps/generic/unsecvars.h: Add GLIBC_TUNABLES.
index 6eca69d567fa043c062f79814a31fd1141fedefb..99a72f68f4988457fcb8fa020043a26942b211c0 100644 (file)
@@ -329,7 +329,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
            {
              const char *strtab
                = (const char *) D_PTR (map, l_info[DT_STRTAB]);
-             _dl_fatal_printf ("\
+             _dl_error_printf ("\
 %s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
                                RTLD_PROGNAME, map->l_name,
                                sym_map->l_name,
index 3e7ae22c67abfa6c6e8e34d7436d24d5682fc82d..daf4d8c0703eb801f6ce78fcbc56cd0596687ef6 100644 (file)
@@ -339,7 +339,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
            {
              const char *strtab
                = (const char *) D_PTR (map, l_info[DT_STRTAB]);
-             _dl_fatal_printf ("\
+             _dl_error_printf ("\
 %s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
                                RTLD_PROGNAME, map->l_name,
                                sym_map->l_name,