public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Solaris x86-64 fixes for binutils
@ 2007-03-19 19:55 Alex Bennee
  2007-03-19 20:07 ` [PATCH] 1/4 Constants Alex Bennee
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 19:55 UTC (permalink / raw)
  To: binutils

Hi,

The following patches are a port of some work done by a colleague that
were needed to get 64bit Solaris binaries working correctly in a cross
compiled environment:

0001-Added-some-version-defines.txt

Just defines some constants for Solaris sections

0002-Ensure-we-apply-the-correct-suffix-to-the-lib-path-for-64-bits-libs.txt

The lib64 path on the test Solaris 10 box is /lib/amd64. However
Solaris10 does symlink /lib/64 to this path. I assume my college came
along a box where this was not so.

Given Sun are likely to ship intel boxes this part of the patch may be
redundant.

0003-To-support-linking-for-Solaris-targets-we-need-to-specify-a-seperate.txt  

This fixes a definite problem. There is no ld64.so on Solaris so this
ensure we set the correct interpreter. This is done by adding a new
variant.

0004-Added-support-for-solaris-sections.txt 

This adds in support for some sections ld skipped.

Unfortunately to get all this tested I'm still waiting for my cross
compiled gcc to build. However I thought it would be worth posting the
patches up for comment. I'm at the UKUUG for the next 2 days but I
should have access to email over the next few days.

-- 
Alex, homepage: http://www.bennee.com/~alex/
"Boy, life takes a long time to live -- Steven Wright

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] 1/4 Constants
  2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
@ 2007-03-19 20:07 ` Alex Bennee
  2007-03-19 20:09 ` [PATCH] 2/4 Lib path suffix fix Alex Bennee
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 20:07 UTC (permalink / raw)
  To: binutils

On Mon, 2007-03-19 at 19:55 +0000, Alex Bennee wrote:

From: Alex Bennee
Date: Fri, 16 Mar 2007 15:43:16 +0000
Subject: [PATCH] Added some version defines

---
 include/elf/common.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/elf/common.h b/include/elf/common.h
index b11171b..d417521 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -343,13 +343,20 @@
 /* The next three section types are defined by Solaris, and are named
    SHT_SUNW*.  We use them in GNU code, so we also define SHT_GNU*
    versions.  */
+
+#define SHT_SUNW_dof 0x6ffffff4 /* Dtrace object format */
+#define SHT_SUNW_syminfo 0x6ffffffc /* Additional Symbol information */
 #define SHT_SUNW_verdef	0x6ffffffd	/* Versions defined by file */
 #define SHT_SUNW_verneed 0x6ffffffe	/* Versions needed by file */
 #define SHT_SUNW_versym	0x6fffffff	/* Symbol versions */
+#define SHT_SUNW_signature 0x6ffffff6 /* RSA signature thing */
 
+#define SHT_GNU_dof SHT_SUNW_dof
+#define SHT_GNU_syminfo SHT_SUNW_syminfo
 #define SHT_GNU_verdef	SHT_SUNW_verdef
 #define SHT_GNU_verneed	SHT_SUNW_verneed
 #define SHT_GNU_versym	SHT_SUNW_versym
+#define SHT_GNU_signature	SHT_SUNW_signature
 
 #define SHT_LOPROC	0x70000000	/* Processor-specific semantics, lo */
 #define SHT_HIPROC	0x7FFFFFFF	/* Processor-specific semantics, hi */
-- 
1.4.3.4


-- 
Alex, homepage: http://www.bennee.com/~alex/
Good night to spend with family, but avoid arguments with your mate's
new lover.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] 2/4 Lib path suffix fix
  2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
  2007-03-19 20:07 ` [PATCH] 1/4 Constants Alex Bennee
@ 2007-03-19 20:09 ` Alex Bennee
  2007-03-19 20:10 ` [PATCH] 3/4 Set correct .interp Alex Bennee
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 20:09 UTC (permalink / raw)
  To: binutils

From: Alex Bennee
Date: Fri, 16 Mar 2007 15:54:43 +0000
Subject: [PATCH] Ensure we apply the correct suffix to the lib path for
64 bits libs

---
 ld/emulparams/elf_x86_64.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index 35240df..dd443f0 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -24,10 +24,15 @@ fi
 
 # Linux modify the default library search path to first include
 # a 64-bit specific directory.
+#
+# Solaris has a 64bit library directory in /lib/amd64
 case "$target" in
   x86_64*-linux*)
     case "$EMULATION_NAME" in
       *64*) LIBPATH_SUFFIX=64 ;;
     esac
     ;;
+  i[3-7]86-*-solaris2*)
+    LIBPATH_SUFFIX=/amd64
+    ;;
 esac
-- 
1.4.3.4



-- 
Alex, homepage: http://www.bennee.com/~alex/
Command, n.: Statement presented by a human and accepted by a computer
in such a manner as to make the human feel as if he is in control.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] 3/4 Set correct .interp
  2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
  2007-03-19 20:07 ` [PATCH] 1/4 Constants Alex Bennee
  2007-03-19 20:09 ` [PATCH] 2/4 Lib path suffix fix Alex Bennee
@ 2007-03-19 20:10 ` Alex Bennee
  2007-03-19 20:11 ` [PATCH] 4/4 Additional Sections Alex Bennee
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 20:10 UTC (permalink / raw)
  To: binutils

From: Alex Bennee
Date: Mon, 19 Mar 2007 16:07:27 +0000
Subject: [PATCH] To support linking for Solaris targets we need to
specify a seperate
.interp section which points at the 64 bit interpreter
(/lib/amd64/ldld64.so.1)

  * Created new bfd_elf64_x86_64_solaris_vec
  * Commonised sections of elf64_x86_64_size_dynamic_sections
  * Configure tweaks for all of this
---
 bfd/ChangeLog      |    3 +
 bfd/config.bfd     |    2 +-
 bfd/configure.in   |    1 +
 bfd/elf64-x86-64.c |  125
+++++++++++++++++++++++++++++++++++++++++-----------
 bfd/targets.c      |    2 +
 5 files changed, 106 insertions(+), 27 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f2f9990..e98499a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,6 @@
+2007-03-19  Alex Bennee <alex@bennee.com>
+	* Added bfd_elf64_x86_64_solaris_vec for solaris targets
+		
 2006-06-23  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* configure.in: Update version to 2.17.
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 4fd72c1..cc40c43 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -455,7 +455,7 @@ case "${targ}" in
   i[3-7]86-*-solaris2*)
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=i386coff_vec
-    targ64_selvecs=bfd_elf64_x86_64_vec
+    targ64_selvecs=bfd_elf64_x86_64_solaris_vec
     want64=true
     ;;
   i[3-7]86-*-kaos*)
diff --git a/bfd/configure.in b/bfd/configure.in
index 212f961..bb9ddef 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -708,6 +708,7 @@ do
     bfd_elf64_tradbigmips_vec)	tb="$tb elf64-mips.lo elf64.lo
elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo";
target_size=64 ;;
     bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo
elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo";
target_size=64 ;;
     bfd_elf64_x86_64_vec)	tb="$tb elf64-x86-64.lo elf64.lo $elf";
target_size=64 ;;
+    bfd_elf64_x86_64_solaris_vec) tb="$tb elf64-x86-64.lo elf64.lo
$elf"; target_size=64 ;;
     bfd_mmo_vec)		tb="$tb mmo.lo" target_size=64 ;;
     bfd_powerpc_pe_vec)         tb="$tb pe-ppc.lo peigen.lo
cofflink.lo" ;;
     bfd_powerpc_pei_vec)        tb="$tb pei-ppc.lo peigen.lo
cofflink.lo" ;;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 9befd69..92de0ee 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -325,8 +325,8 @@ elf64_x86_64_grok_psinfo (bfd *abfd, Elf
 /* Functions for the x86-64 ELF linker.	 */
 
 /* The name of the dynamic interpreter.	 This is put in the .interp
-   section.  */
-
+   section.
+*/
 #define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
 
 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
@@ -1700,32 +1700,13 @@ readonly_dynrelocs (struct elf_link_hash
 /* Set the sizes of the dynamic sections.  */
 
 static bfd_boolean
-elf64_x86_64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
-				    struct bfd_link_info *info)
+elf64_x86_64_size_dynamic_sections_common(struct bfd_link_info *info,
+					  struct elf64_x86_64_link_hash_table *htab,
+					  bfd *dynobj)
 {
-  struct elf64_x86_64_link_hash_table *htab;
-  bfd *dynobj;
-  asection *s;
-  bfd_boolean relocs;
   bfd *ibfd;
-
-  htab = elf64_x86_64_hash_table (info);
-  dynobj = htab->elf.dynobj;
-  if (dynobj == NULL)
-    abort ();
-
-  if (htab->elf.dynamic_sections_created)
-    {
-      /* Set the contents of the .interp section to the interpreter.
*/
-      if (info->executable)
-	{
-	  s = bfd_get_section_by_name (dynobj, ".interp");
-	  if (s == NULL)
-	    abort ();
-	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
-	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
-	}
-    }
+  bfd_boolean relocs;
+  asection *s;
 
   /* Set up .got offsets for local syms, and space for local dynamic
      relocs.  */
@@ -1978,6 +1959,41 @@ elf64_x86_64_size_dynamic_sections (bfd
 #undef add_dynamic_entry
 
   return TRUE;
+
+}
+
+/*
+  This calls a common function to share with the solaris varient which
+  uses a different interpreter
+*/
+
+static bfd_boolean
+elf64_x86_64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+				    struct bfd_link_info *info)
+{
+  struct elf64_x86_64_link_hash_table *htab;
+  bfd *dynobj;
+  asection *s;
+
+  htab = elf64_x86_64_hash_table (info);
+  dynobj = htab->elf.dynobj;
+  if (dynobj == NULL)
+    abort ();
+
+  if (htab->elf.dynamic_sections_created)
+  {
+    /* Set the contents of the .interp section to the interpreter.  */
+    if (info->executable)
+      {
+	s = bfd_get_section_by_name (dynobj, ".interp");
+	if (s == NULL)
+	  abort ();
+	s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+	s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+      }
+  }
+
+  return elf64_x86_64_size_dynamic_sections_common(info, htab, dynobj);
 }
 
 static bfd_boolean
@@ -3687,3 +3703,60 @@ static const struct bfd_elf_special_sect
   elf64_x86_64_additional_program_headers
 
 #include "elf64-target.h"
+
+\f
+/* Solaris support.  */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM		bfd_elf64_x86_64_solaris_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME		"elf64-x86-64-solaris"
+
+#undef ELF_DYNAMIC_INTERPRETER
+#define SOLARIS_ELF_DYNAMIC_INTERPRETER	"/lib/amd64/ldld64.so.1"
+
+/*
+  sets the size of the dynamic sections
+
+  The only current difference solaris puts it's interpreter in a
+  different place. We then call the same common code as
+  elf64_x86_64_size_dynamic_sections.
+*/
+
+static bfd_boolean
+elf64_x86_64_solaris_size_dynamic_sections (bfd *output_bfd
ATTRIBUTE_UNUSED,
+					    struct bfd_link_info *info)
+{
+  struct elf64_x86_64_link_hash_table *htab;
+  bfd *dynobj;
+  asection *s;
+
+  htab = elf64_x86_64_hash_table (info);
+  dynobj = htab->elf.dynobj;
+  if (dynobj == NULL)
+    abort ();
+
+  if (htab->elf.dynamic_sections_created)
+  {
+    /* Set the contents of the .interp section to the interpreter.  */
+    if (info->executable)
+      {
+	s = bfd_get_section_by_name (dynobj, ".interp");
+	if (s == NULL)
+	  abort ();
+	s->size = sizeof SOLARIS_ELF_DYNAMIC_INTERPRETER;
+	s->contents = (unsigned char *) SOLARIS_ELF_DYNAMIC_INTERPRETER;
+      }
+  }
+
+  return elf64_x86_64_size_dynamic_sections_common(info, htab, dynobj);
+}
+
+#undef elf_backend_size_dynamic_sections
+#define elf_backend_size_dynamic_sections
elf64_x86_64_solaris_size_dynamic_sections
+
+/* this defines a new variant */
+
+#undef elf64_bed
+#define elf64_bed	elf64_solaris_bed
+#include "elf64-target.h"
diff --git a/bfd/targets.c b/bfd/targets.c
index 849eb94..49eb5b9 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -669,6 +669,7 @@ extern const bfd_target bfd_elf64_sparc_
 extern const bfd_target bfd_elf64_tradbigmips_vec;
 extern const bfd_target bfd_elf64_tradlittlemips_vec;
 extern const bfd_target bfd_elf64_x86_64_vec;
+extern const bfd_target bfd_elf64_x86_64_solaris_vec;
 extern const bfd_target bfd_mmo_vec;
 extern const bfd_target bfd_powerpc_pe_vec;
 extern const bfd_target bfd_powerpc_pei_vec;
@@ -985,6 +986,7 @@ static const bfd_target * const _bfd_tar
 	&bfd_elf64_tradbigmips_vec,
 	&bfd_elf64_tradlittlemips_vec,
 	&bfd_elf64_x86_64_vec,
+	&bfd_elf64_x86_64_solaris_vec,
 	&bfd_mmo_vec,
 #endif
 	&bfd_powerpc_pe_vec,
-- 
1.4.3.4



-- 
Alex, homepage: http://www.bennee.com/~alex/
Happiness isn't something you experience; it's something you remember.
-- Oscar Levant

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] 4/4 Additional Sections
  2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
                   ` (2 preceding siblings ...)
  2007-03-19 20:10 ` [PATCH] 3/4 Set correct .interp Alex Bennee
@ 2007-03-19 20:11 ` Alex Bennee
  2007-03-19 21:01   ` H. J. Lu
  2007-03-19 20:14 ` [PATCH] Solaris x86-64 fixes for binutils John Levon
  2007-03-19 20:35 ` Michael Wetherell
  5 siblings, 1 reply; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 20:11 UTC (permalink / raw)
  To: binutils

From: Alex Bennee
Date: Mon, 19 Mar 2007 18:39:44 +0000
Subject: [PATCH] Added support for solaris sections

---
 bfd/elf-bfd.h |    9 +++++++++
 bfd/elf.c     |   18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 3fba1c2..cf3df1b 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1254,11 +1254,17 @@ struct elf_obj_tdata
   Elf_Internal_Shdr dynversym_hdr;
   Elf_Internal_Shdr dynverref_hdr;
   Elf_Internal_Shdr dynverdef_hdr;
+  Elf_Internal_Shdr syminfo_shndx_hdr;
   Elf_Internal_Shdr symtab_shndx_hdr;
+  Elf_Internal_Shdr rsa_signature_hdr;
+  Elf_Internal_Shdr dtrace_dof_hdr;
   unsigned int symtab_section, shstrtab_section;
   unsigned int strtab_section, dynsymtab_section;
   unsigned int symtab_shndx_section;
+  unsigned int syminfo_shndx_section;
   unsigned int dynversym_section, dynverdef_section, dynverref_section;
+  unsigned int dtrace_dof_section;
+  unsigned int rsa_signature_section;
   file_ptr next_file_pos;
   bfd_vma gp;				/* The gp value */
   unsigned int gp_size;			/* The gp size */
@@ -1378,9 +1384,12 @@ struct elf_obj_tdata
 #define elf_onesymtab(bfd)	(elf_tdata(bfd) -> symtab_section)
 #define elf_symtab_shndx(bfd)	(elf_tdata(bfd) -> symtab_shndx_section)
 #define elf_dynsymtab(bfd)	(elf_tdata(bfd) -> dynsymtab_section)
+#define elf_dynsyminfo(bfd)	(elf_tdata(bfd) -> syminfo_shndx_section) 
 #define elf_dynversym(bfd)	(elf_tdata(bfd) -> dynversym_section)
 #define elf_dynverdef(bfd)	(elf_tdata(bfd) -> dynverdef_section)
 #define elf_dynverref(bfd)	(elf_tdata(bfd) -> dynverref_section)
+#define elf_dtracedof(bfd)	(elf_tdata(bfd) -> dtrace_dof_section)
+#define elf_rsasignature(bfd)	(elf_tdata(bfd) -> rsa_signature_section)
 #define elf_num_locals(bfd)	(elf_tdata(bfd) -> num_locals)
 #define elf_num_globals(bfd)	(elf_tdata(bfd) -> num_globals)
 #define elf_section_syms(bfd)	(elf_tdata(bfd) -> section_syms)
diff --git a/bfd/elf.c b/bfd/elf.c
index 9e48f66..ed23149 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2101,6 +2101,18 @@ bfd_section_from_shdr (bfd *abfd, unsign
       }
       break;
 
+    case SHT_GNU_dof:
+      elf_dtracedof (abfd) = shindex;
+      elf_tdata (abfd)->dtrace_dof_hdr = *hdr;
+      return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex);
+      break;
+
+    case SHT_GNU_syminfo:
+      elf_dynsyminfo (abfd) = shindex;
+      elf_tdata (abfd)->syminfo_shndx_hdr = *hdr;
+      return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex);
+      break;
+
     case SHT_GNU_verdef:
       elf_dynverdef (abfd) = shindex;
       elf_tdata (abfd)->dynverdef_hdr = *hdr;
@@ -2121,6 +2133,12 @@ bfd_section_from_shdr (bfd *abfd, unsign
       return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex);
       break;
 
+    case SHT_GNU_signature:
+      elf_rsasignature (abfd) = shindex;
+      elf_tdata (abfd)->rsa_signature_hdr = *hdr;
+      return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
shindex);
+      break;
+
     case SHT_SHLIB:
       return TRUE;
 
-- 
1.4.3.4


-- 
Alex, homepage: http://www.bennee.com/~alex/
Put your Nose to the Grindstone! -- Amalgamated Plastic Surgeons and
Toolmakers, Ltd.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Solaris x86-64 fixes for binutils
  2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
                   ` (3 preceding siblings ...)
  2007-03-19 20:11 ` [PATCH] 4/4 Additional Sections Alex Bennee
@ 2007-03-19 20:14 ` John Levon
  2007-03-19 20:19   ` Alex Bennee
  2007-03-19 20:35 ` Michael Wetherell
  5 siblings, 1 reply; 12+ messages in thread
From: John Levon @ 2007-03-19 20:14 UTC (permalink / raw)
  To: Alex Bennee; +Cc: binutils

On Mon, Mar 19, 2007 at 07:55:25PM +0000, Alex Bennee wrote:

> 0002-Ensure-we-apply-the-correct-suffix-to-the-lib-path-for-64-bits-libs.txt
> 
> The lib64 path on the test Solaris 10 box is /lib/amd64. However
> Solaris10 does symlink /lib/64 to this path. I assume my college came
> along a box where this was not so.
> 
> Given Sun are likely to ship intel boxes this part of the patch may be
> redundant.

That will not affect the name of these directories, "amd64" has been
defined as a stable name even for Intel's EM64T implementations. I'm
surprised there's a box where a 64 symlink doesn't exist though, that
sounds like a broken machine to me.

regards
john

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Solaris x86-64 fixes for binutils
  2007-03-19 20:14 ` [PATCH] Solaris x86-64 fixes for binutils John Levon
@ 2007-03-19 20:19   ` Alex Bennee
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 20:19 UTC (permalink / raw)
  To: John Levon; +Cc: binutils

On Mon, 2007-03-19 at 20:18 +0000, John Levon wrote:
> On Mon, Mar 19, 2007 at 07:55:25PM +0000, Alex Bennee wrote:
> >
> > Given Sun are likely to ship intel boxes this part of the patch may be
> > redundant.
> 
> That will not affect the name of these directories, "amd64" has been
> defined as a stable name even for Intel's EM64T implementations. I'm
> surprised there's a box where a 64 symlink doesn't exist though, that
> sounds like a broken machine to me.

Well the original target machine had been a Solaris Express machine
upgraded a few time to OpenSolaris builds. It may well of been b0rked in
the process.

As I'm targeting stable Solaris 10 machines I guess I can drop this
patch if they all should have the symlink.

-- 
Alex, homepage: http://www.bennee.com/~alex/
In 1750 Issac Newton became discouraged when he fell up a flight of
stairs.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Solaris x86-64 fixes for binutils
  2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
                   ` (4 preceding siblings ...)
  2007-03-19 20:14 ` [PATCH] Solaris x86-64 fixes for binutils John Levon
@ 2007-03-19 20:35 ` Michael Wetherell
  2007-03-19 20:46   ` Alex Bennee
  5 siblings, 1 reply; 12+ messages in thread
From: Michael Wetherell @ 2007-03-19 20:35 UTC (permalink / raw)
  To: binutils

On Monday 19 Mar 2007 19:55, Alex Bennee wrote:
> The following patches are a port of some work done by a colleague
> that were needed to get 64bit Solaris binaries working correctly in a
> cross compiled environment:

You're repeating work that was already done a few months ago. As I 
already said it should already work if you just try the latest.

Regards,
Mike

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Solaris x86-64 fixes for binutils
  2007-03-19 20:35 ` Michael Wetherell
@ 2007-03-19 20:46   ` Alex Bennee
  2007-03-19 20:57     ` H. J. Lu
  2007-03-19 21:37     ` Michael Wetherell
  0 siblings, 2 replies; 12+ messages in thread
From: Alex Bennee @ 2007-03-19 20:46 UTC (permalink / raw)
  To: Michael Wetherell; +Cc: binutils

On Mon, 2007-03-19 at 20:35 +0000, Michael Wetherell wrote:
> On Monday 19 Mar 2007 19:55, Alex Bennee wrote:
> > The following patches are a port of some work done by a colleague
> > that were needed to get 64bit Solaris binaries working correctly in a
> > cross compiled environment:
> 
> You're repeating work that was already done a few months ago. As I 
> already said it should already work if you just try the latest.

I have got the latest cvs although having to rebuild gcc with the new
binutils each time is currently slowing my testing.

However looking at the CVS code I couldn't find:

* The correct .interp setting for the linker
* The additional sections

Hence I thought it best to post the patches I had so far for comment.
Have you tested on 64 bit binaries? Of course it could be that our
subject app triggered some additional stuff when my colleague was
bootstraping this stuff last year.

I'll be quite happy if none of the patches are needed :-)

-- 
Alex, homepage: http://www.bennee.com/~alex/
"The most difficult thing in the world is to know how to do a thing and
to watch someone else do it wrong without comment." -- Theodore H. White

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Solaris x86-64 fixes for binutils
  2007-03-19 20:46   ` Alex Bennee
@ 2007-03-19 20:57     ` H. J. Lu
  2007-03-19 21:37     ` Michael Wetherell
  1 sibling, 0 replies; 12+ messages in thread
From: H. J. Lu @ 2007-03-19 20:57 UTC (permalink / raw)
  To: Alex Bennee; +Cc: Michael Wetherell, binutils

On Mon, Mar 19, 2007 at 08:46:06PM +0000, Alex Bennee wrote:
> On Mon, 2007-03-19 at 20:35 +0000, Michael Wetherell wrote:
> > On Monday 19 Mar 2007 19:55, Alex Bennee wrote:
> > > The following patches are a port of some work done by a colleague
> > > that were needed to get 64bit Solaris binaries working correctly in a
> > > cross compiled environment:
> > 
> > You're repeating work that was already done a few months ago. As I 
> > already said it should already work if you just try the latest.
> 
> I have got the latest cvs although having to rebuild gcc with the new
> binutils each time is currently slowing my testing.
> 
> However looking at the CVS code I couldn't find:
> 
> * The correct .interp setting for the linker

It is in ld/emulparams/elf_x86_64.sh.


H.J.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] 4/4 Additional Sections
  2007-03-19 20:11 ` [PATCH] 4/4 Additional Sections Alex Bennee
@ 2007-03-19 21:01   ` H. J. Lu
  0 siblings, 0 replies; 12+ messages in thread
From: H. J. Lu @ 2007-03-19 21:01 UTC (permalink / raw)
  To: Alex Bennee; +Cc: binutils

On Mon, Mar 19, 2007 at 08:11:30PM +0000, Alex Bennee wrote:
> From: Alex Bennee
> Date: Mon, 19 Mar 2007 18:39:44 +0000
> Subject: [PATCH] Added support for solaris sections
> 

It isn't enough since linker doesn't know how to generate and
interpret those sections.


H.J.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Solaris x86-64 fixes for binutils
  2007-03-19 20:46   ` Alex Bennee
  2007-03-19 20:57     ` H. J. Lu
@ 2007-03-19 21:37     ` Michael Wetherell
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Wetherell @ 2007-03-19 21:37 UTC (permalink / raw)
  To: binutils

On Monday 19 Mar 2007 20:46, Alex Bennee wrote:
> > You're repeating work that was already done a few months ago. As I
> > already said it should already work if you just try the latest.
>
> I have got the latest cvs although having to rebuild gcc with the new
> binutils each time is currently slowing my testing.

I did say, so it wouldn't have hurt to check ;-)

> However looking at the CVS code I couldn't find:
>
> * The correct .interp setting for the linker

It's in ld/emulparams/elf_x86_64.sh

> * The additional sections

That's because the sections are OS specific and can't be added to the 
generic switch like that.

The way it was intended to work was that e_ident[EI_OSABI] would be set 
whenever OS specific extensions are used, indicating which OS they are 
for: http://www.cygwin.com/ml/binutils/2000-11/msg00383.html
So then it would have been possible to switch on  e_ident[EI_OSABI] 
first. But since neither GNU nor Solaris set it like that, it doesn't 
help.

In any case unrecognised OS specific sections shouldn't cause an error 
unless SHF_OS_NONCONFORMING is in the flag bits. So I just fixed that, 
which I hope is sufficient.

> Have you tested on 64 bit binaries? 

Yes native and cross.

> I'll be quite happy if none of the patches are needed :-)

And I'll be happy if you've got more fixes.

Regards,
Mike

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-03-19 21:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 19:55 [PATCH] Solaris x86-64 fixes for binutils Alex Bennee
2007-03-19 20:07 ` [PATCH] 1/4 Constants Alex Bennee
2007-03-19 20:09 ` [PATCH] 2/4 Lib path suffix fix Alex Bennee
2007-03-19 20:10 ` [PATCH] 3/4 Set correct .interp Alex Bennee
2007-03-19 20:11 ` [PATCH] 4/4 Additional Sections Alex Bennee
2007-03-19 21:01   ` H. J. Lu
2007-03-19 20:14 ` [PATCH] Solaris x86-64 fixes for binutils John Levon
2007-03-19 20:19   ` Alex Bennee
2007-03-19 20:35 ` Michael Wetherell
2007-03-19 20:46   ` Alex Bennee
2007-03-19 20:57     ` H. J. Lu
2007-03-19 21:37     ` Michael Wetherell

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).