2007-02-05 Dave Brolley <brolley@redhat.com>
[deliverable/binutils-gdb.git] / bfd / elf64-sparc.c
index 550274411835bb4176eb04f158978e28ebdcd730..0eefc95c125eb982c9df3420b4bd5fdf32f259c9 100644 (file)
@@ -16,7 +16,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include "bfd.h"
 #include "sysdep.h"
@@ -814,6 +814,7 @@ const struct elf_size_info elf64_sparc_size_info =
 #define TARGET_BIG_NAME        "elf64-sparc"
 #define ELF_ARCH       bfd_arch_sparc
 #define ELF_MAXPAGESIZE 0x100000
+#define ELF_COMMONPAGESIZE 0x2000
 
 /* This is the official ABI value.  */
 #define ELF_MACHINE_CODE EM_SPARCV9
@@ -888,6 +889,8 @@ const struct elf_size_info elf64_sparc_size_info =
   _bfd_sparc_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook \
   _bfd_sparc_elf_gc_sweep_hook
+#define elf_backend_init_index_section \
+  _bfd_elf_init_1_index_section
 
 #define elf_backend_can_gc_sections 1
 #define elf_backend_can_refcount 1
@@ -901,3 +904,33 @@ const struct elf_size_info elf64_sparc_size_info =
 #define elf_backend_plt_alignment 8
 
 #include "elf64-target.h"
+
+/* FreeBSD support */
+#undef  TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf64_sparc_freebsd_vec
+#undef  TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf64-sparc-freebsd"
+
+/* The kernel recognizes executables as valid only if they carry a
+   "FreeBSD" label in the ELF header.  So we put this label on all
+   executables and (for simplicity) also all other object files.  */
+
+static void
+elf64_sparc_fbsd_post_process_headers (bfd *abfd,
+                                       struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+  Elf_Internal_Ehdr *i_ehdrp;  /* ELF file header, internal form.  */
+
+  i_ehdrp = elf_elfheader (abfd);
+
+  /* Put an ABI label supported by FreeBSD >= 4.1 */
+  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+}
+
+#undef  elf_backend_post_process_headers
+#define elf_backend_post_process_headers       elf64_sparc_fbsd_post_process_headers
+#undef  elf64_bed
+#define elf64_bed                              elf64_sparc_fbsd_bed
+
+#include "elf64-target.h"
+
This page took 0.028919 seconds and 4 git commands to generate.