* elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a
authorIan Lance Taylor <ian@airs.com>
Wed, 30 Jun 1999 18:16:46 +0000 (18:16 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 30 Jun 1999 18:16:46 +0000 (18:16 +0000)
relocateable link.  From Ralf Baechle <ralf@uni-koblenz.de>.

bfd/ChangeLog
bfd/elf32-mips.c

index 9bb3cee970ed04a585ef58a989b0c6fd56634e23..80c13e81e94caa0aeb70db58158f82fc29820505 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-30  Ian Lance Taylor  <ian@zembu.com>
+
+       * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a
+       relocateable link.  From Ralf Baechle <ralf@uni-koblenz.de>.
+
 1999-06-04  Philip Blundell  <philb@gnu.org>
 
        * elf32-arm.h (elf_backend_got_header_size): Define.
index c152e8af5fd89345d71bdf899636ea9bdacfc0bc..fa69ab5f95357bc9c67f85515f2b9b8ec28482a5 100644 (file)
@@ -4175,11 +4175,12 @@ mips_elf_final_link (abfd, info)
   /* If all the things we linked together were PIC, but we're
      producing an executable (rather than a shared object), then the
      resulting file is CPIC (i.e., it calls PIC code.)  */
-  if (!info->shared && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
+  if (!info->shared
+      && !info->relocateable
+      && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
     {
       elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC;
       elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC;
-      
     }
 
   /* On IRIX5, we omit the .options section.  On IRIX6, however, we