Handle 64-bit Solaris/x86 ld.so.1

Message ID yddh8ionqwz.fsf@CeBiTec.Uni-Bielefeld.DE
State New, archived
Headers

Commit Message

Rainer Orth Sept. 17, 2018, 2:23 p.m. UTC
  The next patch from the solaris-userland github repo
(007-solib-svr4.patch) is equally trivial, creating partity between
Solaris/SPARC and x86.

Tested on amd64-pc-solaris2.11, ok for master?

	Rainer
  

Comments

Joel Brobecker Sept. 17, 2018, 6:37 p.m. UTC | #1
Hello Rainer,

> 2018-06-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	* solib-svr4.c (svr4_same_1): Also handle amd64 ld.so.1.

Looks good to me. OK to push, but trying to have the correct
author in the ChangeLog file.

> # HG changeset patch
> # Parent  24bcd64cb0c1824acde40384274e58fa9bf13438
> Handle 64-bit Solaris/x86 ld.so.1
> 
> diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
> --- a/gdb/solib-svr4.c
> +++ b/gdb/solib-svr4.c
> @@ -153,8 +153,12 @@ svr4_same_1 (const char *gdb_so_name, co
>        && strcmp (inferior_so_name, "/lib/ld.so.1") == 0)
>      return 1;
>  
> -  /* Similarly, we observed the same issue with sparc64, but with
> +  /* Similarly, we observed the same issue with amd64 and sparcv9, but with
>       different locations.  */
> +  if (strcmp (gdb_so_name, "/usr/lib/amd64/ld.so.1") == 0
> +      && strcmp (inferior_so_name, "/lib/amd64/ld.so.1") == 0)
> +    return 1;
> +
>    if (strcmp (gdb_so_name, "/usr/lib/sparcv9/ld.so.1") == 0
>        && strcmp (inferior_so_name, "/lib/sparcv9/ld.so.1") == 0)
>      return 1;
  
Rainer Orth Sept. 19, 2018, 9:10 a.m. UTC | #2
Hi Joel,

> Hello Rainer,
>
>> 2018-06-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>> 
>> 	* solib-svr4.c (svr4_same_1): Also handle amd64 ld.so.1.
>
> Looks good to me. OK to push, but trying to have the correct
> author in the ChangeLog file.

this proved to be a bit more difficult this time:

* The earliest trace in the solaris-userland repo is for the import of
  gdb 6.8 by George Vasick (gdb.solib-svr4.patch), at which point the
  patch contained both amd64 and sparcv9 parts.

  The sparcv9 part was committed (independently discovered, I suppose)
  by yourself:

	https://sourceware.org/ml/gdb-patches/2008-02/msg00026.html

* However, the gdb 6.8 part goes back to the OpenSolaris sfw repo, which
  to the best of my knowledge has never been available outside of Sun.
  I happend to have some old tarballs of the sources around, though,
  where the patch is present in sfw-src-b147-20100818.tar.bz2 (still gdb
  6.8), but missing in the earlier sfw-src-b101a-20081022.tar.bz2 (gdb
  6.3).

* Information from my contacts within Oracle seems to confirm George's
  authorship, so this seems to be the best we can do here.

I believe that's enough software archaeology for today ;-)

	Rainer
  

Patch

# HG changeset patch
# Parent  24bcd64cb0c1824acde40384274e58fa9bf13438
Handle 64-bit Solaris/x86 ld.so.1

diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -153,8 +153,12 @@  svr4_same_1 (const char *gdb_so_name, co
       && strcmp (inferior_so_name, "/lib/ld.so.1") == 0)
     return 1;
 
-  /* Similarly, we observed the same issue with sparc64, but with
+  /* Similarly, we observed the same issue with amd64 and sparcv9, but with
      different locations.  */
+  if (strcmp (gdb_so_name, "/usr/lib/amd64/ld.so.1") == 0
+      && strcmp (inferior_so_name, "/lib/amd64/ld.so.1") == 0)
+    return 1;
+
   if (strcmp (gdb_so_name, "/usr/lib/sparcv9/ld.so.1") == 0
       && strcmp (inferior_so_name, "/lib/sparcv9/ld.so.1") == 0)
     return 1;