aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-mips.c')
-rw-r--r--bfd/elf64-mips.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 7ed54fa..3eeb341 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -3354,3 +3354,36 @@ extern bfd_boolean bfd_elf64_archive_write_armap
/* Include the target file again for this target. */
#include "elf64-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_elf64_tradlittlemips_freebsd_vec
+#define TARGET_LITTLE_NAME "elf64-tradlittlemips-freebsd"
+#define TARGET_BIG_SYM bfd_elf64_tradbigmips_freebsd_vec
+#define TARGET_BIG_NAME "elf64-tradbigmips-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 elf64_bed
+#define elf64_bed elf64_fbsd_tradbed
+
+#include "elf64-target.h"