x86: Skip undefined symbol when finishing DT_RELR
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 5 Feb 2022 15:26:31 +0000 (07:26 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 5 Feb 2022 15:34:12 +0000 (07:34 -0800)
Don't abort for undefined symbol when finishing DT_RELR.  Instead, skip
undefined symbol.  Undefined symbol will be reported by relocate_section.

* elfxx-x86.c (elf_x86_size_or_finish_relative_reloc): Skip
undefined symbol in finishing phase.

bfd/elfxx-x86.c

index da8a488db3688b0b1324ed5344e5d7eca7c8e309..7ac2411fc80d2f23eff352629c8e9bd275fe63bc 100644 (file)
@@ -1484,11 +1484,13 @@ elf_x86_size_or_finish_relative_reloc
                }
              else
                {
-                 /* Allow undefined symbol only at the sizing phase.  */
+                 /* Allow undefined symbol only at the sizing phase.
+                    Otherwise skip undefined symbol here.  Undefined
+                    symbol will be reported by relocate_section.  */
                  if (outrel == NULL)
                    relocation = 0;
                  else
-                   abort ();
+                   continue;
                }
            }
          else