2000-07-19 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 20 Jul 2000 03:21:59 +0000 (03:21 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 20 Jul 2000 03:21:59 +0000 (03:21 +0000)
* elf32-arm.h (elf32_arm_size_dynamic_sections): Also set
DF_TEXTREL if DT_TEXTREL is set.
* elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
* elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
* elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
* elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
* elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
* elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
* elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
* elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise.
* elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.

* bfd/elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also
set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if
DT_RPATH is set.
Set the DT_FLAGS and DT_FLAGS_1 entries if necessary.

13 files changed:
bfd/ChangeLog
bfd/elf32-arm.h
bfd/elf32-i370.c
bfd/elf32-i386.c
bfd/elf32-m68k.c
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf32-sparc.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-ia64.c
bfd/elf64-sparc.c
bfd/elflink.h

index 210d6ad7476111da62f112a62b360456caa8ec4a..0e2a4c7e363db0ec964ec2f506e759b9e17ecac6 100644 (file)
@@ -1,3 +1,23 @@
+2000-07-19  H.J. Lu  <hjl@gnu.org>
+
+       * elf32-arm.h (elf32_arm_size_dynamic_sections): Also set
+       DF_TEXTREL if DT_TEXTREL is set.
+       * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
+       * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
+       * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
+       * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Likewise.
+       * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
+       * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
+       * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
+       * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
+       * elf64-ia64.c (elf64_ia64_size_dynamic_sections): Likewise.
+       * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
+
+       * bfd/elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also
+       set DF_SYMBOLIC for symbolic link. Also set DT_RUNPATH if
+       DT_RPATH is set.
+       Set the DT_FLAGS and DT_FLAGS_1 entries if necessary.
+
 2000-07-19  H.J. Lu  <hjl@gnu.org>
 
        * bfd-in.h (bfd_elf_set_dt_needed_soname): New.
index 828a58320bb47accb2b82789e6d359edfd8f068f..6b748ef638a55dd8fe3e5d5dcc0d434035ff54d6 100644 (file)
@@ -2991,6 +2991,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index 0715d86d08117cf2ba93171ee176a3db509eac66..67c6964cd9f7a6fc7c707c26684f62d81233ac2c 100644 (file)
@@ -959,6 +959,7 @@ i370_elf_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index 997ae5434fe07c1ce4a71f08d05f3f8e686541f1..ace82876df9680523733176fd167eb79744fc3a8 100644 (file)
@@ -1238,6 +1238,7 @@ elf_i386_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index b01523477b46a62d5dbb2529e2d0e0127ddce7d5..bee73b5a57d44a9fc799d95978cc864bcd058dde 100644 (file)
@@ -1307,6 +1307,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info)
        {
          if (!bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index 1e9e99bca1fff8b98fd91d10249a751d65320f68..27ae18abb9823ec9e0c8acf472008a9fcec9f889 100644 (file)
@@ -8319,6 +8319,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
        {
          if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
 
       if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
index 6dc3effc3f14e4a47e5711b6e31e1f476432b522..3c7999b760c7ea74e398f1cf3a1216ed4e12c6a5 100644 (file)
@@ -2044,6 +2044,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index 70d65a5f87bd3510805cf4a2e5f124c3c91efbe1..002938479db1976667887cbbad1ab34d6dbe773a 100644 (file)
@@ -1056,6 +1056,7 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index 84f3075e4c82a265f03a13f2c8a975e1b31c9b8e..b4025c0228f8ad1cda2a05d7c8767699660cdf57 100644 (file)
@@ -3312,6 +3312,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index b90b47878f00c7f28a3ee44df8cb8bed8ab5cbe1..b5edaf14578f30722cfe1eec113fabb73944a1b5 100644 (file)
@@ -1789,6 +1789,7 @@ elf64_hppa_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index cacfd6593fcd9ff00ad7c3f4910ca1881e9485c5..a8bebf219f22cf63e850cfbf32d3a7d21f8b30e3 100644 (file)
@@ -2517,6 +2517,7 @@ elf64_ia64_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
     }
 
index ca2e7c1d2f4f5355bb15d88dd7c68383fcf68406..b2b8cbf9ec0b4614be53174e4592292ee6c719a9 100644 (file)
@@ -1803,6 +1803,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
        {
          if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
            return false;
+         info->flags |= DF_TEXTREL;
        }
 
       /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER
index 7fa35a936ce0eee2f13a93babdf84117ddbe89bc..1bf366873a821a0998e92d3f612f310baeb6184c 100644 (file)
@@ -2837,6 +2837,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
        {
          if (! elf_add_dynamic_entry (info, DT_SYMBOLIC, 0))
            return false;
+         info->flags |= DF_SYMBOLIC;
        }
 
       if (rpath != NULL)
@@ -2846,7 +2847,8 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
          indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr, rpath,
                                     true, true);
          if (indx == (bfd_size_type) -1
-             || ! elf_add_dynamic_entry (info, DT_RPATH, indx))
+             || ! elf_add_dynamic_entry (info, DT_RPATH, indx)
+             || ! elf_add_dynamic_entry (info, DT_RUNPATH, indx))
            return false;
        }
 
@@ -3135,6 +3137,22 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
          elf_tdata (output_bfd)->cverdefs = cdefs;
        }
 
+      if (info->flags)
+       {
+         if (! elf_add_dynamic_entry (info, DT_FLAGS, info->flags))
+           return false;
+       }
+
+      if (info->flags_1)
+       {
+         if (! info->shared)
+           info->flags_1 &= ~ (DF_1_INITFIRST
+                               | DF_1_NODELETE
+                               | DF_1_NOOPEN);
+         if (! elf_add_dynamic_entry (info, DT_FLAGS_1, info->flags_1))
+           return false;
+       }
+
       /* Work out the size of the version reference section.  */
 
       s = bfd_get_section_by_name (dynobj, ".gnu.version_r");