Fix error while linking Tizen Apps
authorDongkyun Son <dongkyun.s@samsung.com>
Thu, 24 Sep 2020 06:13:49 +0000 (15:13 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 3 May 2023 09:47:26 +0000 (18:47 +0900)
cherry-picked from RS-TizenStudio/gcc-9.2/pull/10

Change-Id: I30e8222f838680785c22527ab9295bb9c2f9e902
Signed-off-by: Karthik Bhat <kv.bhat@samsung.com>
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
bfd/elflink.c

index 7bf337c..7705b03 100644 (file)
@@ -4809,6 +4809,11 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
          if (elf_bad_symtab (abfd))
            continue;
 
+         /* Dynamic object relocations are not processed by ld, so
+            ld won't run into the problem mentioned above.  */
+         if (dynamic)
+           continue;
+
          /* If we aren't prepared to handle locals within the globals
             then we'll likely segfault on a NULL symbol hash if the
             symbol is ever referenced in relocations.  */
@@ -4819,10 +4824,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
                              abfd, name, (long) (isym - isymbuf + extsymoff),
                              (long) extsymoff);
 
-         /* Dynamic object relocations are not processed by ld, so
-            ld won't run into the problem mentioned above.  */
-         if (dynamic)
-           continue;
+
          bfd_set_error (bfd_error_bad_value);
          goto error_free_vers;