]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/i386/dl-machine.h
x86: Check IFUNC definition in unrelocated executable [BZ #20019]
[thirdparty/glibc.git] / sysdeps / i386 / dl-machine.h
index f6cfb90e21015250ea62934ff0330c2ba577ab43..1e3ef254985de17f1ecd214e8bef8957f918985e 100644 (file)
@@ -338,16 +338,22 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
        {
 # ifndef RTLD_BOOTSTRAP
          if (sym_map != map
-             && sym_map->l_type != lt_executable
              && !sym_map->l_relocated)
            {
              const char *strtab
                = (const char *) D_PTR (map, l_info[DT_STRTAB]);
-             _dl_error_printf ("\
+             if (sym_map->l_type == lt_executable)
+               _dl_fatal_printf ("\
+%s: IFUNC symbol '%s' referenced in '%s' is defined in the executable \
+and creates an unsatisfiable circular dependency.\n",
+                                 RTLD_PROGNAME, strtab + refsym->st_name,
+                                 map->l_name);
+             else
+               _dl_error_printf ("\
 %s: Relink `%s' with `%s' for IFUNC symbol `%s'\n",
-                               RTLD_PROGNAME, map->l_name,
-                               sym_map->l_name,
-                               strtab + refsym->st_name);
+                                 RTLD_PROGNAME, map->l_name,
+                                 sym_map->l_name,
+                                 strtab + refsym->st_name);
            }
 # endif
          value = ((Elf32_Addr (*) (void)) value) ();