]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: change --enable-new-dtags to only generate new dtags
authorMike Frysinger <vapier@gentoo.org>
Fri, 18 Jan 2013 17:43:58 +0000 (17:43 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 18 Jan 2013 17:43:58 +0000 (17:43 +0000)
The "new" dtags options have been around for 14+ years, so there
shouldn't be a need to generate both new & old tags anymore.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
bfd/ChangeLog
bfd/elflink.c
gold/ChangeLog
gold/layout.cc
ld/ChangeLog
ld/NEWS
ld/ld.texinfo

index 30fead2c1f9b7d8025769707eeeeebb57bf7c820..85b411aacd6ea91d6024baf76afe9a1ea36b76bf 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-18  Mike Frysinger  <vapier@gentoo.org>
+
+       * elflink.c (bfd_elf_size_dynamic_sections): Only add DT_RPATH
+       when new_dtags is false.  Only add DT_RUNPATH when new_dtags is
+       true.
+
 2013-01-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf32-i386.c (elf_i386_check_relocs): Count size relocation as
index 6985786e21d0055acb50b03ba999eb4873151f79..d336730e07897a247e272c604f1aa041572158c2 100644 (file)
@@ -5730,19 +5730,16 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
       if (rpath != NULL)
        {
          bfd_size_type indx;
+         bfd_vma tag;
 
          indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath,
                                      TRUE);
-         if (indx == (bfd_size_type) -1
-             || !_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx))
+         if (indx == (bfd_size_type) -1)
            return FALSE;
 
-         if  (info->new_dtags)
-           {
-             _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx);
-             if (!_bfd_elf_add_dynamic_entry (info, DT_RUNPATH, indx))
-               return FALSE;
-           }
+         tag = info->new_dtags ? DT_RUNPATH : DT_RPATH;
+         if (!_bfd_elf_add_dynamic_entry (info, tag, indx))
+           return FALSE;
        }
 
       if (filter_shlib != NULL)
index 01058c10a8edba0e8c0cca8c82648d53d581a6bc..42d2d03af0a02d45d99c8be705f8f4f9bd75bd31 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-18  Mike Frysinger  <vapier@gentoo.org>
+
+       * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
+       when enable_new_dtags is false.  Only add DT_RUNPATH when
+       enable_new_dtags is true.
+
 2013-01-17  Serge Pavlov  <serge.v.pavlov@gmail.com>
 
        * powerpc.cc (Stub_table::find_plt_call_entry): Make types
index 576d44bee2e9e8fcc3d14b4013ba474e2d9771cc..250782a92bead199a193ca48ed9c6d4b7e41c70c 100644 (file)
@@ -4647,8 +4647,9 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
            }
        }
 
-      odyn->add_string(elfcpp::DT_RPATH, rpath_val);
-      if (parameters->options().enable_new_dtags())
+      if (!parameters->options().enable_new_dtags())
+       odyn->add_string(elfcpp::DT_RPATH, rpath_val);
+      else
        odyn->add_string(elfcpp::DT_RUNPATH, rpath_val);
     }
 
index cfbe79981edddda69fdd70e2089351f3b4308b5e..190e081c5fbe21de02a48ab5fbeb5f3bcc6fc18e 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-18  Mike Frysinger  <vapier@gentoo.org>
+
+       * NEWS: Mention change in behavior with --enable-new-dtags.
+       * ld.texinfo (Options): Clarify --enable-new-dtags behavior.
+
 2013-01-14  Leif Ekblad <leif@rdos.net>
            Alan Modra  <amodra@gmail.com>
 
diff --git a/ld/NEWS b/ld/NEWS
index 9b9f4a6b25ab905683a9266ef42505ffa7071910..1e07605e00894ec512a6685efaf4fa3e0c30e9dd 100644 (file)
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -2,6 +2,8 @@
 
 * Add support for the Imagination Technologies Meta processor.
 
+* --enable-new-dtags no longer generates old dtags in addition to new dtags.
+
 Changes in 2.23:
 
 * Enable compressed debug section feature for x86/x86_64 pe-coff.
index 2429668728c9c535b0043a230fcdc43bbe9689f2..194f56aed0c6ff97a6074fd0fdd4559be4b62045 100644 (file)
@@ -2112,7 +2112,8 @@ if linker generated unwind info is supported.
 @itemx --disable-new-dtags
 This linker can create the new dynamic tags in ELF. But the older ELF
 systems may not understand them. If you specify
-@option{--enable-new-dtags}, the dynamic tags will be created as needed.
+@option{--enable-new-dtags}, the new dynamic tags will be created as needed
+and older dynamic tags will be omitted.
 If you specify @option{--disable-new-dtags}, no new dynamic tags will be
 created. By default, the new dynamic tags are not created. Note that
 those options are only available for ELF systems.