ld:
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Fri, 22 Oct 2010 12:08:32 +0000 (12:08 +0000)
committerRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Fri, 22 Oct 2010 12:08:32 +0000 (12:08 +0000)
* emulparams/elf32_sparc_sol2.sh (OUTPUT_FORMAT): Set to
elf32-sparc-sol2.
* emulparams/elf64_sparc_sol2.sh (OUTPUT_FORMAT): Set to
elf64-sparc-sol2.

gas:
* config/tc-sparc.h [TE_SOLARIS] (ELF_TARGET_FORMAT): Define as
elf32-sparc-sol2.
(ELF64_TARGET_FORMAT): Define as elf64-sparc-sol2.

bfd:
* elfxx-sparc.c (tpoff): Define bed, static_tls_size.
Consider static_tls_alignment.

* elf32-sparc.c (TARGET_BIG_SYM): Redefine to
bfd_elf32_sparc_sol2_vec.
(TARGET_BIG_NAME): Redefine to elf32-sparc-sol2.
(elf32_bed): Redefine to elf32_sparc_sol2_bed.
(elf_backend_static_tls_alignment): Redefine to 8.
Include elf32-target.h.
(elf_backend_static_tls_alignment): Undef again for VxWorks.

* elf64-sparc.c (TARGET_BIG_SYM): Redefine to
bfd_elf64_sparc_sol2_vec.
(TARGET_BIG_NAME): Redefine to elf64-sparc-sol2.
(ELF_OSABI): Undef.
(elf64_bed): Redefine to elf64_sparc_sol2_bed.
(elf_backend_static_tls_alignment): Redefine to 16.
Include elf64-target.h.

* config.bfd (sparc-*-solaris2.[0-6]): Split from sparc-*-elf*.
Set targ_defvec to bfd_elf32_sparc_sol2_vec.
[BFD64] (sparc-*-solaris2*): Set targ_defvec to
bfd_elf32_sparc_sol2_vec.
Replace bfd_elf64_sparc_vec by bfd_elf64_sparc_sol2_vec in
targ_selvecs.

* configure.in: Handle bfd_elf32_sparc_sol2_vec,
bfd_elf64_sparc_sol2_vec.
* configure: Regenerate.

* targets.c (bfd_elf32_sparc_sol2_vec): Declare.
(bfd_elf64_sparc_sol2_vec): Declare.
(_bfd_target_vector): Add bfd_elf32_sparc_sol2_vec,
bfd_elf64_sparc_sol2_vec.

13 files changed:
bfd/ChangeLog
bfd/config.bfd
bfd/configure
bfd/configure.in
bfd/elf32-sparc.c
bfd/elf64-sparc.c
bfd/elfxx-sparc.c
bfd/targets.c
gas/ChangeLog
gas/config/tc-sparc.h
ld/ChangeLog
ld/emulparams/elf32_sparc_sol2.sh
ld/emulparams/elf64_sparc_sol2.sh

index 7722ff8fecaf3677562ec2923dd1fe872af5aafd..f5749a9ace3d568fa77364fcdc45debb01ef75ef 100644 (file)
@@ -1,3 +1,40 @@
+2010-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * elfxx-sparc.c (tpoff): Define bed, static_tls_size.
+       Consider static_tls_alignment.
+
+       * elf32-sparc.c (TARGET_BIG_SYM): Redefine to
+       bfd_elf32_sparc_sol2_vec.
+       (TARGET_BIG_NAME): Redefine to elf32-sparc-sol2.
+       (elf32_bed): Redefine to elf32_sparc_sol2_bed.
+       (elf_backend_static_tls_alignment): Redefine to 8.
+       Include elf32-target.h.
+       (elf_backend_static_tls_alignment): Undef again for VxWorks.
+
+       * elf64-sparc.c (TARGET_BIG_SYM): Redefine to
+       bfd_elf64_sparc_sol2_vec.
+       (TARGET_BIG_NAME): Redefine to elf64-sparc-sol2.
+       (ELF_OSABI): Undef.
+       (elf64_bed): Redefine to elf64_sparc_sol2_bed.
+       (elf_backend_static_tls_alignment): Redefine to 16.
+       Include elf64-target.h.
+
+       * config.bfd (sparc-*-solaris2.[0-6]): Split from sparc-*-elf*.
+       Set targ_defvec to bfd_elf32_sparc_sol2_vec.
+       [BFD64] (sparc-*-solaris2*): Set targ_defvec to
+       bfd_elf32_sparc_sol2_vec.
+       Replace bfd_elf64_sparc_vec by bfd_elf64_sparc_sol2_vec in
+       targ_selvecs.
+
+       * configure.in: Handle bfd_elf32_sparc_sol2_vec,
+       bfd_elf64_sparc_sol2_vec.
+       * configure: Regenerate.
+
+       * targets.c (bfd_elf32_sparc_sol2_vec): Declare.
+       (bfd_elf64_sparc_sol2_vec): Declare.
+       (_bfd_target_vector): Add bfd_elf32_sparc_sol2_vec,
+       bfd_elf64_sparc_sol2_vec.
+
 2010-10-21  Joseph Myers  <joseph@codesourcery.com>
 
        * elf32-tic6x.c (elf32_tic6x_merge_arch_attributes): Update for
index e42535f91aaed0a900ecfa66a7c3b42a37613eec..f0a03e39149d84add327389dcbf486c754b6141c 100644 (file)
@@ -1395,14 +1395,18 @@ case "${targ}" in
     targ_defvec=bfd_elf32_sparc_vec
     targ_selvecs=sparcnetbsd_vec
     ;;
-  sparc-*-elf* | sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
+  sparc-*-elf*)
     targ_defvec=bfd_elf32_sparc_vec
     targ_selvecs=sunos_big_vec
     ;;
+  sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
+    targ_defvec=bfd_elf32_sparc_sol2_vec
+    targ_selvecs=sunos_big_vec
+    ;;
 #ifdef BFD64
   sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
-    targ_defvec=bfd_elf32_sparc_vec
-    targ_selvecs="bfd_elf64_sparc_vec sunos_big_vec"
+    targ_defvec=bfd_elf32_sparc_sol2_vec
+    targ_selvecs="bfd_elf64_sparc_sol2_vec sunos_big_vec"
     want64=true
     ;;
 #endif
index 980711aa26203e3793a3ea91c169558af318825a..41009f25051d68665026abbe12b0b24ed39ca3c3 100755 (executable)
@@ -15148,6 +15148,7 @@ do
     bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shvxworks_vec)   tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)       tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+    bfd_elf32_sparc_sol2_vec)  tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_spu_vec)         tb="$tb elf32-spu.lo elf32.lo $elf" ;;
     bfd_elf32_tic6x_be_vec)    tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
@@ -15185,6 +15186,7 @@ do
     bfd_elf64_sh64nbsd_vec)    tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sparc_vec)       tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+    bfd_elf64_sparc_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
     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_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
index 13fb66f4bce18ac6d393a276e8588739df9974df..2a876bf52eee755a44b94d173dc5d6645cb9f1ae 100644 (file)
@@ -783,6 +783,7 @@ do
     bfd_elf32_shnbsd_vec)      tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shvxworks_vec)   tb="$tb elf32-sh.lo elf-vxworks.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_sparc_vec)       tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
+    bfd_elf32_sparc_sol2_vec)  tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_sparc_vxworks_vec) tb="$tb elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo $elf" ;;
     bfd_elf32_spu_vec)         tb="$tb elf32-spu.lo elf32.lo $elf" ;;
     bfd_elf32_tic6x_be_vec)    tb="$tb elf32-tic6x.lo elf32.lo $elf" ;;
@@ -820,6 +821,7 @@ do
     bfd_elf64_sh64nbsd_vec)    tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sparc_vec)       tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sparc_freebsd_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
+    bfd_elf64_sparc_sol2_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
     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_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
index adfe9247180de119697cd5fa4998ae9fd16b04a6..187d46698d54f5fbd55192553f05711921e7348a 100644 (file)
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -246,6 +246,23 @@ elf32_sparc_add_symbol_hook (bfd * abfd,
 
 #include "elf32-target.h"
 
+/* Solaris 2.  */
+
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                          bfd_elf32_sparc_sol2_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                         "elf32-sparc-sol2"
+
+#undef elf32_bed
+#define elf32_bed                              elf32_sparc_sol2_bed
+
+/* The 32-bit static TLS arena size is rounded to the nearest 8-byte
+   boundary.  */
+#undef elf_backend_static_tls_alignment
+#define elf_backend_static_tls_alignment       8
+
+#include "elf32-target.h"
+
 /* A wrapper around _bfd_sparc_elf_link_hash_table_create that identifies
    the target system as VxWorks.  */
 
@@ -305,6 +322,7 @@ elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
 #undef elf_backend_final_write_processing
 #define elf_backend_final_write_processing \
   elf32_sparc_vxworks_final_write_processing
+#undef elf_backend_static_tls_alignment
 
 #undef elf32_bed
 #define elf32_bed                              sparc_elf_vxworks_bed
index 1ad0c14e09530d489ec5a11930764d1af64de77c..9f05b85fa576415af32044c3ea3dc50bb448d2bd 100644 (file)
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 64-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -934,3 +934,23 @@ const struct elf_size_info elf64_sparc_size_info =
 
 #include "elf64-target.h"
 
+/* Solaris 2.  */
+
+#undef TARGET_BIG_SYM
+#define        TARGET_BIG_SYM                          bfd_elf64_sparc_sol2_vec
+#undef TARGET_BIG_NAME
+#define        TARGET_BIG_NAME                         "elf64-sparc-sol2"
+
+/* Restore default: we cannot use ELFOSABI_SOLARIS, otherwise ELFOSABI_NONE
+   objects won't be recognized.  */
+#undef ELF_OSABI
+
+#undef elf64_bed
+#define elf64_bed                              elf64_sparc_sol2_bed
+
+/* The 64-bit static TLS arena size is rounded to the nearest 16-byte
+   boundary.  */
+#undef elf_backend_static_tls_alignment
+#define elf_backend_static_tls_alignment       16
+
+#include "elf64-target.h"
index 979505a79cd38b0a324540ac3a6b78176a0211b8..ebe040f0ffcc432e2291a97bd9ec94fb442e2885 100644 (file)
@@ -2819,11 +2819,16 @@ static bfd_vma
 tpoff (struct bfd_link_info *info, bfd_vma address)
 {
   struct elf_link_hash_table *htab = elf_hash_table (info);
+  const struct elf_backend_data *bed = get_elf_backend_data (info->output_bfd);
+  bfd_vma static_tls_size;
 
   /* If tls_sec is NULL, we should have signalled an error already.  */
   if (htab->tls_sec == NULL)
     return 0;
-  return address - htab->tls_size - htab->tls_sec->vma;
+
+  /* Consider special static TLS alignment requirements.  */
+  static_tls_size = BFD_ALIGN (htab->tls_size, bed->static_tls_alignment);
+  return address - static_tls_size - htab->tls_sec->vma;
 }
 
 /* Return the relocation value for a %gdop relocation.  */
index aaf7e99c64f75ad11c910aadc0e2ef2cbab18339..3e99754272a3891eea1b1fccf93e38590eaabe33 100644 (file)
@@ -676,6 +676,7 @@ extern const bfd_target bfd_elf32_shlvxworks_vec;
 extern const bfd_target bfd_elf32_shnbsd_vec;
 extern const bfd_target bfd_elf32_shvxworks_vec;
 extern const bfd_target bfd_elf32_sparc_vec;
+extern const bfd_target bfd_elf32_sparc_sol2_vec;
 extern const bfd_target bfd_elf32_sparc_vxworks_vec;
 extern const bfd_target bfd_elf32_spu_vec;
 extern const bfd_target bfd_elf32_tic6x_be_vec;
@@ -713,6 +714,7 @@ extern const bfd_target bfd_elf64_sh64lnbsd_vec;
 extern const bfd_target bfd_elf64_sh64nbsd_vec;
 extern const bfd_target bfd_elf64_sparc_vec;
 extern const bfd_target bfd_elf64_sparc_freebsd_vec;
+extern const bfd_target bfd_elf64_sparc_sol2_vec;
 extern const bfd_target bfd_elf64_tradbigmips_vec;
 extern const bfd_target bfd_elf64_tradlittlemips_vec;
 extern const bfd_target bfd_elf64_x86_64_freebsd_vec;
@@ -1025,6 +1027,7 @@ static const bfd_target * const _bfd_target_vector[] =
        &bfd_elf32_sh64blin_vec,
 #endif
        &bfd_elf32_sparc_vec,
+       &bfd_elf32_sparc_sol2_vec,
        &bfd_elf32_sparc_vxworks_vec,
        &bfd_elf32_spu_vec,
        &bfd_elf32_tic6x_be_vec,
@@ -1063,6 +1066,7 @@ static const bfd_target * const _bfd_target_vector[] =
        &bfd_elf64_sh64blin_vec,
        &bfd_elf64_sparc_vec,
        &bfd_elf64_sparc_freebsd_vec,
+       &bfd_elf64_sparc_sol2_vec,
        &bfd_elf64_tradbigmips_vec,
        &bfd_elf64_tradlittlemips_vec,
        &bfd_elf64_x86_64_freebsd_vec,
index 70213c4cc0ac036d1b454ab5ed055a26f3647176..817adc447a17dddc08d0a16e843901b44da77e2b 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/tc-sparc.h [TE_SOLARIS] (ELF_TARGET_FORMAT): Define as
+       elf32-sparc-sol2.
+       (ELF64_TARGET_FORMAT): Define as elf64-sparc-sol2.
+
 2010-10-21  Joseph Myers  <joseph@codesourcery.com>
 
        * config/tc-tic6x.c (tic6x_arch_attribute, tic6x_arches,
index 9054b471b83cefe5cd9fed40a18949d99a1ffa12..3d4636d5ee1d3b031338505d4472375700ecfd37 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-sparc.h - Macros and type defines for the sparc.
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008
+   1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -37,6 +37,11 @@ struct frag;
 #define ELF64_TARGET_FORMAT    "elf64-sparc-freebsd"
 #endif
 
+#ifdef TE_SOLARIS
+#define ELF_TARGET_FORMAT      "elf32-sparc-sol2"
+#define ELF64_TARGET_FORMAT    "elf64-sparc-sol2"
+#endif
+
 #ifndef ELF_TARGET_FORMAT
 #define ELF_TARGET_FORMAT      "elf32-sparc"
 #endif
index 09a1f719403d25f323e1f3489c1544caabc94880..0b0e6073932e817a60ee06832df47efb3308ab3d 100644 (file)
@@ -1,3 +1,10 @@
+2010-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * emulparams/elf32_sparc_sol2.sh (OUTPUT_FORMAT): Set to
+       elf32-sparc-sol2.
+       * emulparams/elf64_sparc_sol2.sh (OUTPUT_FORMAT): Set to
+       elf64-sparc-sol2.
+
 2010-10-22  Alan Modra  <amodra@gmail.com>
 
        * ldwrite.c (build_link_order <lang_data_statement_enum>): Don't
index 8fab990d54a1cb020235325f91da7dac43d003e4..46ca284914d43c21fe7af47dee0cef00114f9f6d 100644 (file)
@@ -1,3 +1,4 @@
 . ${srcdir}/emulparams/elf32_sparc.sh
 . ${srcdir}/emulparams/solaris2.sh
 EXTRA_EM_FILE=solaris2
+OUTPUT_FORMAT="elf32-sparc-sol2"
index 3bf09f68a9dd560d601237401a68177f84d82756..2fad634eeebe4121148b999ea7dcc3cc1f216fbb 100644 (file)
@@ -1,3 +1,4 @@
 . ${srcdir}/emulparams/elf64_sparc.sh
 . ${srcdir}/emulparams/solaris2.sh
 EXTRA_EM_FILE=solaris2
+OUTPUT_FORMAT="elf64-sparc-sol2"
This page took 0.049844 seconds and 4 git commands to generate.