elflink.c: remove duplicate dynobj assignment

Alan Modra <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
	* elfnn-kvx.c (kvx_elf_create_got_section): Don't set dynobj.
	* elfnn-loongarch.c (loongarch_elf_check_relocs): Don't repeat
	dynobj assignment already done.
---
 bfd/elfnn-kvx.c       | 5 -----
 bfd/elfnn-loongarch.c | 3 ---
 2 files changed, 8 deletions(-)

diff --git a/bfd/elfnn-kvx.c b/bfd/elfnn-kvx.c
index f664251e76e..d3fa7f874b7 100644
--- a/bfd/elfnn-kvx.c
+++ b/bfd/elfnn-kvx.c
@@ -3198,11 +3198,6 @@ kvx_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
   /* The first bit of the global offset table is the header.  */
   s->size += bed->got_header_size;
 
-  /* we still need to handle got content when doing static link with PIC */
-  if (bfd_link_executable (info) && !bfd_link_pic (info)) {
-    htab->dynobj = abfd;
-  }
-
   return true;
 }
 
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index 4bdc3f26285..a930b4b4d74 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -1191,9 +1191,6 @@ loongarch_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
 
       if (h && h->type == STT_GNU_IFUNC)
 	{
-	  if (htab->elf.dynobj == NULL)
-	    htab->elf.dynobj = abfd;
-
 	  /* Create 'irelifunc' in PIC object.  */
 	  if (bfd_link_pic (info)
 	      && !_bfd_elf_create_ifunc_sections (htab->elf.dynobj, info))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.