]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Prevent illegal memory access when generating map file entries for ifuncs removed...
authorNick Clifton <nickc@redhat.com>
Fri, 30 May 2025 14:31:14 +0000 (15:31 +0100)
committerNick Clifton <nickc@redhat.com>
Fri, 30 May 2025 14:31:14 +0000 (15:31 +0100)
bfd/elf64-x86-64.c

index 8a36eef9c7dc0b504a7b34bb473cf6535f61f086..6867d4934695d9d1acf0d6b7d77927748939ad30 100644 (file)
@@ -5247,6 +5247,9 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
                           + got_offset);
          if (PLT_LOCAL_IFUNC_P (info, h))
            {
+             if (h->root.u.def.section == NULL)
+               return false;
+
              info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"),
                                      h->root.root.string,
                                      h->root.u.def.section->owner);
@@ -5415,6 +5418,9 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
                }
              if (SYMBOL_REFERENCES_LOCAL_P (info, h))
                {
+                 if (h->root.u.def.section == NULL)
+                   return false;
+
                  info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"),
                                          h->root.root.string,
                                          h->root.u.def.section->owner);