/* MIPS-specific support for 32-bit ELF
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_DTPMOD32", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_DTPREL32", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_GD", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_LDM", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_DTPREL_HI16", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_DTPREL_LO16", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_GOTTPREL", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_TPREL32", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_TPREL_HI16", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
complain_overflow_signed, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_TPREL_LO16", /* name */
- TRUE, /* partial_inplace */
+ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
when we do the relocation, because the symbol manipulations done
by the linker may cause us to lose track of the input BFD. */
if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
- && (r_type == (unsigned int) R_MIPS_GPREL16
- || r_type == (unsigned int) R_MIPS_LITERAL))
+ && (gprel16_reloc_p (r_type) || r_type == (unsigned int) R_MIPS_LITERAL))
cache_ptr->addend = elf_gp (abfd);
}
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
};
\f
#define ELF_ARCH bfd_arch_mips
+#define ELF_TARGET_ID MIPS_ELF_DATA
#define ELF_MACHINE_CODE EM_MIPS
#define elf_backend_collect TRUE
#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
#define bfd_elf32_bfd_get_relocated_section_contents \
_bfd_elf_mips_get_relocated_section_contents
-#define bfd_elf32_mkobject _bfd_mips_elf_mkobject
#define bfd_elf32_bfd_link_hash_table_create \
_bfd_mips_elf_link_hash_table_create
#define bfd_elf32_bfd_final_link _bfd_mips_elf_final_link
/* Include the target file again for this target. */
#include "elf32-target.h"
+
+
+/* FreeBSD support. */
+
+#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_NAME
+#undef TARGET_BIG_SYM
+#undef TARGET_BIG_NAME
+
+#define TARGET_LITTLE_SYM bfd_elf32_ntradlittlemips_freebsd_vec
+#define TARGET_LITTLE_NAME "elf32-ntradlittlemips-freebsd"
+#define TARGET_BIG_SYM bfd_elf32_ntradbigmips_freebsd_vec
+#define TARGET_BIG_NAME "elf32-ntradbigmips-freebsd"
+
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_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
+elf_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info)
+{
+ _bfd_elf_set_osabi (abfd, info);
+}
+
+#undef elf_backend_post_process_headers
+#define elf_backend_post_process_headers elf_fbsd_post_process_headers
+#undef elf32_bed
+#define elf32_bed elf32_fbsd_tradbed
+
+#include "elf32-target.h"