public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  users/jkratoch/dwarf5gcc: Merge remote-tracking branch 'gdb/master' into dwarf5gcc
Date: Mon, 07 Nov 2016 22:51:00 -0000	[thread overview]
Message-ID: <20161107225103.126727.qmail@sourceware.org> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 12963 bytes --]

The branch, users/jkratoch/dwarf5gcc has been updated
       via  3e11dd8696f156b8e79f5b2188be1cf8f894e85b (commit)
       via  7a34932bce1342c970a03128bbccc5a81ae3da6b (commit)
       via  e680a6b69b4bd173a180419e973a9bf18a000151 (commit)
       via  9af89fbaecca21b2ca34c142584165066807fb10 (commit)
       via  b93bfa1980fa4d1229874067dd36acd9ac5685cd (commit)
      from  db2060bfd45fedf12db5495376c2bee5526acc6c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 3e11dd8696f156b8e79f5b2188be1cf8f894e85b
Merge: db2060b 7a34932
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Nov 7 21:58:39 2016 +0100

    Merge remote-tracking branch 'gdb/master' into dwarf5gcc

commit 7a34932bce1342c970a03128bbccc5a81ae3da6b
Author: Loïc Yhuel <loic.yhuel@softathome.com>
Date:   Mon Nov 7 08:00:21 2016 -0800

    Add missing '$' in configure.ac.
    
    2016-11-04  Loïc Yhuel <loic.yhuel@softathome.com>
    
    gold/
            * configure.ac: add missing '$'.
            * configure: Regenerate.

commit e680a6b69b4bd173a180419e973a9bf18a000151
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Nov 7 15:05:34 2016 +0000

    Fix infinite loop when processing rpath tokens.
    
    	PR ld/20784
    	* emultempl/elf32.em (search_needed): Fix infinite loop when
    	unable to process a token.  Add support for curly braced enclosed
    	tokens.
    	* ld.texinfo (--rpath-link): Document supprot for $ORIGIN and
    	$LIB.

commit 9af89fbaecca21b2ca34c142584165066807fb10
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Nov 7 12:28:16 2016 +0000

    Note that the linker's --compress-debug-sections option overrides the compression status of any input debug sections.
    
    	* ld.texinfo (--compress-debug-sections): Expand documentation of
    	this option.

commit b93bfa1980fa4d1229874067dd36acd9ac5685cd
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Mon Nov 7 00:00:23 2016 +0000

    Automatic date update in version.in

-----------------------------------------------------------------------

Summary of changes:
 bfd/version.h         |    2 +-
 gold/ChangeLog        |    5 +++
 gold/configure        |    2 +-
 gold/configure.ac     |    2 +-
 ld/ChangeLog          |   14 +++++++++
 ld/emultempl/elf32.em |   75 +++++++++++++++++++++++++++++++-----------------
 ld/ld.texinfo         |   43 +++++++++++++++++++++-------
 7 files changed, 102 insertions(+), 41 deletions(-)

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index f2750d9..fd3d5fd 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20161106
+#define BFD_VERSION_DATE 20161107
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 08b4a0a..0013288 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2016-11-04  Loïc Yhuel <loic.yhuel@softathome.com>
+
+	* configure.ac: add missing '$'.
+	* configure: Regenerate.
+
 2016-10-21  Gergely Nagy  <ngg@tresorit.com>
 
 	PR gold/17704
diff --git a/gold/configure b/gold/configure
index 343a407..a3ed5c9 100755
--- a/gold/configure
+++ b/gold/configure
@@ -3266,7 +3266,7 @@ fi
 
 sysroot_relocatable=0
 if test -n "$sysroot"; then
-  case "sysroot" in
+  case "$sysroot" in
     "${prefix}" | "${prefix}/"* | \
     "${exec_prefix}" | "${exec_prefix}/"* | \
     '${prefix}' | '${prefix}/'*| \
diff --git a/gold/configure.ac b/gold/configure.ac
index de3b630..ff9f1fd 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -49,7 +49,7 @@ fi
 
 sysroot_relocatable=0
 if test -n "$sysroot"; then
-  case "sysroot" in
+  case "$sysroot" in
     "${prefix}" | "${prefix}/"* | \
     "${exec_prefix}" | "${exec_prefix}/"* | \
     '${prefix}' | '${prefix}/'*| \
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 0513d2e..9d04123 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,17 @@
+2016-11-07  Nick Clifton  <nickc@redhat.com>
+
+	PR ld/20784
+	* emultempl/elf32.em (search_needed): Fix infinite loop when
+	unable to process a token.  Add support for curly braced enclosed
+	tokens.
+	* ld.texinfo (--rpath-link): Document supprot for $ORIGIN and
+	$LIB.
+
+2016-11-07  Nick Clifton  <nickc@redhat.com>
+
+	* ld.texinfo (--compress-debug-sections): Expand documentation of
+	this option.
+
 2016-11-04  Nick Clifton  <nickc@redhat.com>
 
 	* emultempl/elf32.em (search_needed): Remove use of getauxval and
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 57252da..8c63638 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -495,6 +495,7 @@ gld${EMULATION_NAME}_search_needed (const char *path,
   len = strlen (name);
   while (1)
     {
+      unsigned offset = 0;
       char * var;
       char *filename, *sset;
 
@@ -527,8 +528,10 @@ gld${EMULATION_NAME}_search_needed (const char *path,
       /* PR 20535: Support the same pseudo-environment variables that
 	 are supported by ld.so.  Namely, $ORIGIN, $LIB and $PLATFORM.
          Since there can be more than one occurrence of these tokens in
-	 the path we loop until no more are found.  */
-      while ((var = strchr (filename, '$')) != NULL)
+	 the path we loop until no more are found.  Since we might not
+	 be able to substitute some of the tokens we maintain an offset
+	 into the filename for where we should begin our scan.  */
+      while ((var = strchr (filename + offset, '$')) != NULL)
 	{
 	  /* The ld.so manual page does not say, but I am going to assume that
 	     these tokens are terminated by a directory seperator character
@@ -536,13 +539,14 @@ gld${EMULATION_NAME}_search_needed (const char *path,
 	     $ORIGIN should only be used at the start of a path, but that is
 	     not enforced here.
 
-	     FIXME: The ld.so manual page also states that it allows ${ORIGIN}
-	     ${LIB} and ${PLATFORM}.  We should support these variants too.
+	     The ld.so manual page also states that it allows ${ORIGIN},
+	     ${LIB} and ${PLATFORM}, so these are supported as well.
 
 	     FIXME: The code could be a lot cleverer about allocating space
 	     for the processed string.  */
 	  char *    end = strchr (var, '/');
 	  char *    replacement = NULL;
+	  char *    v = var + 1;
 	  char *    freeme = NULL;
 	  unsigned  flen = strlen (filename);
 
@@ -550,16 +554,27 @@ gld${EMULATION_NAME}_search_needed (const char *path,
 	    /* Temporarily terminate the filename at the end of the token.  */
 	    * end = 0;
 
-	  switch (var[1])
+	  if (*v == '{')
+	    ++ v;
+	  switch (*v++)
 	    {
 	    case 'O':
-	      if (strcmp (var + 2, "RIGIN") == 0)
+	      if (strcmp (v, "RIGIN") == 0 || strcmp (v, "RIGIN}") == 0)
 		{
 		  /* ORIGIN - replace with the full path to the directory
 		     containing the program or shared object.  */
 		  if (needed.by == NULL)
-		    break;
-		  replacement = bfd_get_filename (needed.by);
+		    {
+		      if (link_info.output_bfd == NULL)
+			{
+			  break;
+			}
+		      else
+			replacement = bfd_get_filename (link_info.output_bfd);
+		    }
+		  else
+		    replacement = bfd_get_filename (needed.by);
+
 		  if (replacement)
 		    {
 		      char * slash;
@@ -582,7 +597,7 @@ gld${EMULATION_NAME}_search_needed (const char *path,
 	      break;
 
 	    case 'L':
-	      if (strcmp (var + 2, "IB") == 0)
+	      if (strcmp (v, "IB") == 0 || strcmp (v, "IB}") == 0)
 		{
 		  /* LIB - replace with "lib" in 32-bit environments
 		     and "lib64" in 64-bit environments.  */
@@ -603,17 +618,12 @@ gld${EMULATION_NAME}_search_needed (const char *path,
 	      break;
 
 	    case 'P':
-	      if (strcmp (var + 2, "LATFORM") == 0)
-		{
-		  /* Supporting $PLATFORM in a cross-hosted environment is not
-		     possible.  Supporting it in a native environment involves
-		     loading the <sys/auxv.h> header file which loads the
-		     system <elf.h> header file, which conflicts with the
-		     "include/elf/mips.h" header file.  */
-		  replacement = NULL;
-		}
-	      break;
-
+	      /* Supporting $PLATFORM in a cross-hosted environment is not
+		 possible.  Supporting it in a native environment involves
+		 loading the <sys/auxv.h> header file which loads the
+		 system <elf.h> header file, which conflicts with the
+		 "include/elf/mips.h" header file.  */
+	      /* Fall through.  */
 	    default:
 	      break;
 	    }
@@ -623,14 +633,20 @@ gld${EMULATION_NAME}_search_needed (const char *path,
 	      char * filename2 = xmalloc (flen + strlen (replacement));
 
 	      if (end)
-		sprintf (filename2, "%.*s%s/%s",
-			 (int)(var - filename), filename,
-			 replacement, end + 1);
+		{
+		  sprintf (filename2, "%.*s%s/%s",
+			   (int)(var - filename), filename,
+			   replacement, end + 1);
+		  offset = (var - filename) + 1 + strlen (replacement);
+		}
 	      else
-		sprintf (filename2, "%.*s%s",
-			 (int)(var - filename), filename,
-			 replacement);
-		
+		{
+		  sprintf (filename2, "%.*s%s",
+			   (int)(var - filename), filename,
+			   replacement);
+		  offset = var - filename + strlen (replacement);
+		}
+
 	      free (filename);
 	      filename = filename2;
 	      /* There is no need to restore the path separator (when
@@ -647,12 +663,17 @@ gld${EMULATION_NAME}_search_needed (const char *path,
 	      if (end)
 		/* Restore the path separator.  */
 		* end = '/';
+
+	      /* PR 20784: Make sure that we resume the scan
+	         *after* the token that we could not replace.  */
+	      offset = (var + 1) - filename;
 	    }
 
 	  free (freeme);
 	}
 
       needed.name = filename;
+
       if (gld${EMULATION_NAME}_try_needed (&needed, force))
 	return TRUE;
 
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 500fda6..d4f33b7 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1865,6 +1865,16 @@ specifies the first set of directories to search.  The
 either by specifying a list of names separated by colons, or by
 appearing multiple times.
 
+The tokens @var{$ORIGIN} and @var{$LIB} can appear in these search
+directories.  They will be replaced by the full path to the directory
+containing the program or shared object in the case of @var{$ORIGIN}
+and either @samp{lib} - for 32-bit binaries - or @samp{lib64} - for
+64-bit binaries - in the case of @var{$LIB}.
+
+The alternative form of these tokens - @var{$@{ORIGIN@}} and
+@var{$@{LIB@}} can also be used.  The token @var{$PLATFORM} is not
+supported.
+
 This option should be used with caution as it overrides the search path
 that may have been hard compiled into a shared library. In such a case it
 is possible to use unintentionally a different search path than the
@@ -2319,17 +2329,28 @@ hash tables.  The default is @code{sysv}.
 @itemx --compress-debug-sections=zlib
 @itemx --compress-debug-sections=zlib-gnu
 @itemx --compress-debug-sections=zlib-gabi
-On ELF platforms , these options control how DWARF debug sections are
-compressed using zlib.  @option{--compress-debug-sections=none} doesn't
-compress DWARF debug sections.
-@option{--compress-debug-sections=zlib-gnu} compresses DWARF debug
-sections and rename debug section names to begin with @samp{.zdebug}
-instead of @samp{.debug}.  @option{--compress-debug-sections=zlib}
-and @option{--compress-debug-sections=zlib-gabi}
-compress DWARF debug sections with SHF_COMPRESSED from the ELF ABI.
-The default behaviour varies depending upon the target involved and
-the configure options used to build the toolchain.  The default can be
-determined by examing the output from the linker's @option{--help} option.
+On ELF platforms, these options control how DWARF debug sections are
+compressed using zlib.
+
+@option{--compress-debug-sections=none} doesn't compress DWARF debug
+sections.  @option{--compress-debug-sections=zlib-gnu} compresses
+DWARF debug sections and renames them to begin with @samp{.zdebug}
+instead of @samp{.debug}.  @option{--compress-debug-sections=zlib-gabi}
+also compresses DWARF debug sections, but rather than renaming them it
+sets the SHF_COMPRESSED flag in the sections' headers.
+
+The @option{--compress-debug-sections=zlib} option is an alias for
+@option{--compress-debug-sections=zlib-gabi}.
+
+Note that this option overrides any compression in input debug
+sections, so if a binary is linked with @option{--compress-debug-sections=none}
+for example, then any compressed debug sections in input files will be
+uncompressed before they are copied into the output binary.
+
+The default compression behaviour varies depending upon the target
+involved and the configure options used to build the toolchain.  The
+default can be determined by examining the output from the linker's
+@option{--help} option.
 
 @kindex --reduce-memory-overheads
 @item --reduce-memory-overheads


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2016-11-07 22:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 22:51 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-01-02 21:49 jkratoch
2016-12-24 20:30 jkratoch
2016-12-17 15:04 jkratoch
2016-11-28 20:19 jkratoch
2016-11-23 22:20 jkratoch
2016-11-20 20:10 jkratoch
2016-11-19  8:49 jkratoch
2016-11-18 19:20 jkratoch
2016-11-16 17:58 jkratoch
2016-11-13 16:02 jkratoch
2016-11-06 18:03 jkratoch
2016-11-02 20:55 jkratoch
2016-11-02 20:46 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161107225103.126727.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).