--- gas/config/te-bsdsunix.h.orig 2021-12-08 00:26:27.489693000 +1000 +++ gas/config/te-bsdsunix.h 2021-12-08 00:26:27.482616000 +1000 @@ -0,0 +1,30 @@ +/* te-bsdsunix.h -- BSDSUniX target environment declarations. + Copyright (C) 2000-2019 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* Target environment for BSDSUniX. It is the same as the generic + target, except that it arranges via the TE_BSDSUniX define to + suppress the use of "/" as a comment character. Some code in the + BSDSUniX kernel uses "/" to mean division. (What a concept!) */ +#define TE_BSDSUniX 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" --- gas/config/te-armbsdsuxeabi.h.orig 2021-12-08 00:26:27.531495000 +1000 +++ gas/config/te-armbsdsuxeabi.h 2021-12-08 00:26:27.524432000 +1000 @@ -0,0 +1,22 @@ +/* Copyright (C) 2004-2019 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3, + or (at your option) any later version. + + GAS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "te-bsdsunix.h" + +#define EABI_DEFAULT EF_ARM_EABI_VER5 --- gas/config/te-armbsdsuxvfp.h.orig 2021-12-08 00:26:27.573387000 +1000 +++ gas/config/te-armbsdsuxvfp.h 2021-12-08 00:26:27.566090000 +1000 @@ -0,0 +1,22 @@ +/* Copyright (C) 2004-2019 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3, + or (at your option) any later version. + + GAS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#include "te-armbsdsuxeabi.h" + +#define FPU_DEFAULT FPU_ARCH_VFP --- gold/bsdsunix.h.orig 2021-12-08 00:26:27.615097000 +1000 +++ gold/bsdsunix.h 2021-12-08 00:26:27.608051000 +1000 @@ -0,0 +1,103 @@ +// bsdsunix.h -- BSDSUniX support for gold -*- C++ -*- + +// Copyright (C) 2009-2019 Free Software Foundation, Inc. +// Written by Ian Lance Taylor . + +// This file is part of gold. + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// 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., 51 Franklin Street - Fifth Floor, Boston, +// MA 02110-1301, USA. + +#include "target.h" +#include "target-select.h" + +#ifndef GOLD_BSDSUNIX_H +#define GOLD_BSDSUNIX_H + +namespace gold +{ + +// BSDSUniX 4.1 and later wants the EI_OSABI field in the ELF header to +// be set to ELFOSABI_BSDSUNIX. This is a target selector for targets +// which permit combining both BSDSUniX and non-BSDSUniX object files. + +class Target_selector_bsdsunix : public Target_selector +{ + public: + Target_selector_bsdsunix(int machine, int size, bool is_big_endian, + const char* bfd_name, + const char* bsdsunix_bfd_name, + const char* emulation) + : Target_selector(machine, size, is_big_endian, NULL, emulation), + bfd_name_(bfd_name), bsdsunix_bfd_name_(bsdsunix_bfd_name) + { } + + protected: + // If we see a BSDSUniX input file, mark the output file as using + // BSDSUniX. + virtual Target* + do_recognize(Input_file*, off_t, int, int osabi, int) + { + Target* ret = this->instantiate_target(); + if (osabi == elfcpp::ELFOSABI_BSDSUNIX) + ret->set_osabi(static_cast(osabi)); + return ret; + } + + // Recognize two names. + virtual Target* + do_recognize_by_bfd_name(const char* name) + { + if (strcmp(name, this->bfd_name_) == 0) + return this->instantiate_target(); + else if (strcmp(name, this->bsdsunix_bfd_name_) == 0) + { + Target* ret = this->instantiate_target(); + ret->set_osabi(elfcpp::ELFOSABI_BSDSUNIX); + return ret; + } + else + return NULL; + } + + // Print both names in --help output. + virtual void + do_supported_bfd_names(std::vector* names) + { + names->push_back(this->bfd_name_); + names->push_back(this->bsdsunix_bfd_name_); + } + + // Return appropriate BFD name. + virtual const char* + do_target_bfd_name(const Target* target) + { + if (!this->is_our_target(target)) + return NULL; + return (target->osabi() == elfcpp::ELFOSABI_BSDSUNIX + ? this->bsdsunix_bfd_name_ + : this->bfd_name_); + } + + private: + // The BFD name for the non-Freebsd target. + const char* bfd_name_; + // The BFD name for the Freebsd target. + const char* bsdsunix_bfd_name_; +}; + +} // end namespace gold + +#endif // !defined(GOLD_BSDSUNIX_H) --- ld/emulparams/elf64_sparc_bsdsux.sh.orig 2021-12-08 00:26:27.657726000 +1000 +++ ld/emulparams/elf64_sparc_bsdsux.sh 2021-12-08 00:26:27.650571000 +1000 @@ -0,0 +1,4 @@ +source_sh ${srcdir}/emulparams/elf64_sparc.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh + +OUTPUT_FORMAT="elf64-sparc-bsdsunix" --- ld/emulparams/elf32ltsmipn32_bsdsux.sh.orig 2021-12-08 00:26:27.700568000 +1000 +++ ld/emulparams/elf32ltsmipn32_bsdsux.sh 2021-12-08 00:26:27.693378000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf32ltsmipn32.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf32-ntradlittlemips-bsdsunix" +BIG_OUTPUT_FORMAT="elf32-ntradbigmips-bsdsunix" +LITTLE_OUTPUT_FORMAT="elf32-ntradlittlemips-bsdsunix" --- ld/emulparams/elf32btsmipn32_bsdsux.sh.orig 2021-12-08 00:26:27.741961000 +1000 +++ ld/emulparams/elf32btsmipn32_bsdsux.sh 2021-12-08 00:26:27.734859000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf32ltsmipn32.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf32-ntradbigmips-bsdsunix" +BIG_OUTPUT_FORMAT="elf32-ntradbigmips-bsdsunix" +LITTLE_OUTPUT_FORMAT="elf32-ntradlittlemips-bsdsunix" --- ld/emulparams/armelf_bsdsux.sh.orig 2021-12-08 00:26:27.783910000 +1000 +++ ld/emulparams/armelf_bsdsux.sh 2021-12-08 00:26:27.776780000 +1000 @@ -0,0 +1,11 @@ +source_sh ${srcdir}/emulparams/armelf.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh + +TEXT_START_ADDR=0x00010000 + +TARGET2_TYPE=got-rel +MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" +GENERATE_PIE_SCRIPT=yes + +unset STACK_ADDR +unset EMBEDDED --- ld/emulparams/elf64_ia64_bsdsux.sh.orig 2021-12-08 00:26:27.825556000 +1000 +++ ld/emulparams/elf64_ia64_bsdsux.sh 2021-12-08 00:26:27.818337000 +1000 @@ -0,0 +1,6 @@ +source_sh ${srcdir}/emulparams/elf64_ia64.sh +TEXT_START_ADDR="0x2000000000000000" +unset DATA_ADDR +unset SMALL_DATA_CTOR +unset SMALL_DATA_DTOR +source_sh ${srcdir}/emulparams/elf_bsdsux.sh --- ld/emulparams/elf_l1om_bsdsux.sh.orig 2021-12-08 00:26:27.866813000 +1000 +++ ld/emulparams/elf_l1om_bsdsux.sh 2021-12-08 00:26:27.859709000 +1000 @@ -0,0 +1,3 @@ +source_sh ${srcdir}/emulparams/elf_l1om.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf64-l1om-bsdsunix" --- ld/emulparams/elf_k1om_bsdsux.sh.orig 2021-12-08 00:26:27.909591000 +1000 +++ ld/emulparams/elf_k1om_bsdsux.sh 2021-12-08 00:26:27.902409000 +1000 @@ -0,0 +1,3 @@ +source_sh ${srcdir}/emulparams/elf_k1om.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf64-k1om-bsdsunix" --- ld/emulparams/elf_bsdsux.sh.orig 2021-12-08 00:26:27.950729000 +1000 +++ ld/emulparams/elf_bsdsux.sh 2021-12-08 00:26:27.943580000 +1000 @@ -0,0 +1 @@ +ELF_INTERPRETER_NAME=\"/usr/libexec/ld-elf.so.1\" --- ld/emulparams/aarch64bsdsux.sh.orig 2021-12-08 00:26:27.991858000 +1000 +++ ld/emulparams/aarch64bsdsux.sh 2021-12-08 00:26:27.984761000 +1000 @@ -0,0 +1,37 @@ +ARCH=aarch64 +MACHINE= +NOP=0x1f2003d5 + +SCRIPT_NAME=elf +ELFSIZE=64 +OUTPUT_FORMAT="elf64-littleaarch64" +BIG_OUTPUT_FORMAT="elf64-bigaarch64" +LITTLE_OUTPUT_FORMAT="elf64-littleaarch64" +NO_REL_RELOCS=yes + +TEMPLATE_NAME=elf32 +EXTRA_EM_FILE=aarch64elf + +GENERATE_SHLIB_SCRIPT=yes +GENERATE_PIE_SCRIPT=yes + +MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" +SEPARATE_GOTPLT=24 +IREL_IN_PLT= + +TEXT_START_ADDR=0x400000 + +DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; + +# AArch64 does not support .s* sections. +NO_SMALL_DATA=yes + +OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__bss_start__ = .${CREATE_SHLIB+)};" +OTHER_BSS_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_bss_end__ = .${CREATE_SHLIB+)}; ${CREATE_SHLIB+PROVIDE (}__bss_end__ = .${CREATE_SHLIB+)};" +OTHER_END_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__end__ = .${CREATE_SHLIB+)};" + +OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' +ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' +# Ensure each PLT entry is aligned to a cache line. +PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} }" --- ld/emulparams/elf64alpha_bsdsux.sh.orig 2021-12-08 00:26:28.033463000 +1000 +++ ld/emulparams/elf64alpha_bsdsux.sh 2021-12-08 00:26:28.026348000 +1000 @@ -0,0 +1,3 @@ +source_sh ${srcdir}/emulparams/elf64alpha.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf64-alpha-bsdsunix" --- ld/emulparams/elf_x86_64_bsdsux.sh.orig 2021-12-08 00:26:28.075591000 +1000 +++ ld/emulparams/elf_x86_64_bsdsux.sh 2021-12-08 00:26:28.068411000 +1000 @@ -0,0 +1,3 @@ +source_sh ${srcdir}/emulparams/elf_x86_64.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf64-x86-64-bsdsunix" --- ld/emulparams/elf64ppc_bsdsux.sh.orig 2021-12-08 00:26:28.116920000 +1000 +++ ld/emulparams/elf64ppc_bsdsux.sh 2021-12-08 00:26:28.109836000 +1000 @@ -0,0 +1,6 @@ +source_sh ${srcdir}/emulparams/elf64ppc.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh + +OUTPUT_FORMAT="elf64-powerpc-bsdsunix" +DEFAULT_PLT_STATIC_CHAIN=1 + --- ld/emulparams/armelfb_bsdsux.sh.orig 2021-12-08 00:26:28.158889000 +1000 +++ ld/emulparams/armelfb_bsdsux.sh 2021-12-08 00:26:28.151747000 +1000 @@ -0,0 +1,2 @@ +source_sh ${srcdir}/emulparams/armelf_bsdsux.sh +OUTPUT_FORMAT="elf32-bigarm" --- ld/emulparams/elf_i386_bsdsux.sh.orig 2021-12-08 00:26:28.200895000 +1000 +++ ld/emulparams/elf_i386_bsdsux.sh 2021-12-08 00:26:28.194170000 +1000 @@ -0,0 +1,3 @@ +source_sh ${srcdir}/emulparams/elf_i386.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf32-i386-bsdsunix" --- ld/emulparams/aarch64bsdsuxb.sh.orig 2021-12-08 00:26:28.242179000 +1000 +++ ld/emulparams/aarch64bsdsuxb.sh 2021-12-08 00:26:28.235054000 +1000 @@ -0,0 +1,2 @@ +source_sh ${srcdir}/emulparams/aarch64bsdsux.sh +OUTPUT_FORMAT="elf64-bigaarch64" --- ld/emulparams/elf64btsmip_bsdsux.sh.orig 2021-12-08 00:26:28.283796000 +1000 +++ ld/emulparams/elf64btsmip_bsdsux.sh 2021-12-08 00:26:28.276713000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf64btsmip.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf64-tradbigmips-bsdsunix" +BIG_OUTPUT_FORMAT="elf64-tradbigmips-bsdsunix" +LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips-bsdsunix" --- ld/emulparams/elf32ltsmip_bsdsux.sh.orig 2021-12-08 00:26:28.325625000 +1000 +++ ld/emulparams/elf32ltsmip_bsdsux.sh 2021-12-08 00:26:28.318417000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf32ltsmip.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf32-tradlittlemips-bsdsunix" +BIG_OUTPUT_FORMAT="elf32-tradbigmips-bsdsunix" +LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips-bsdsunix" --- ld/emulparams/elf32ppc_bsdsux.sh.orig 2021-12-08 00:26:28.367118000 +1000 +++ ld/emulparams/elf32ppc_bsdsux.sh 2021-12-08 00:26:28.359966000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf32ppc.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh + +OUTPUT_FORMAT="elf32-powerpc-bsdsunix" + --- ld/emulparams/elf64ltsmip_bsdsux.sh.orig 2021-12-08 00:26:28.409032000 +1000 +++ ld/emulparams/elf64ltsmip_bsdsux.sh 2021-12-08 00:26:28.401895000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf64ltsmip.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf64-tradlittlemips-bsdsunix" +BIG_OUTPUT_FORMAT="elf64-tradbigmips-bsdsunix" +LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips-bsdsunix" --- ld/emulparams/elf32btsmip_bsdsux.sh.orig 2021-12-08 00:26:28.450675000 +1000 +++ ld/emulparams/elf32btsmip_bsdsux.sh 2021-12-08 00:26:28.443550000 +1000 @@ -0,0 +1,5 @@ +source_sh ${srcdir}/emulparams/elf32btsmip.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh +OUTPUT_FORMAT="elf32-tradbigmips-bsdsunix" +BIG_OUTPUT_FORMAT="elf32-tradbigmips-bsdsunix" +LITTLE_OUTPUT_FORMAT="elf32-tradlittlemips-bsdsunix" --- ld/emulparams/elf64lppc_bsdsux.sh.orig 2021-12-08 00:26:28.492387000 +1000 +++ ld/emulparams/elf64lppc_bsdsux.sh 2021-12-08 00:26:28.485170000 +1000 @@ -0,0 +1,6 @@ +source_sh ${srcdir}/emulparams/elf64lppc.sh +source_sh ${srcdir}/emulparams/elf_bsdsux.sh + +OUTPUT_FORMAT="elf64-powerpcle-bsdsunix" +DEFAULT_PLT_STATIC_CHAIN=1 + --- libiberty/config/mh-bsdsux21.orig 2021-12-08 00:26:28.533790000 +1000 +++ libiberty/config/mh-bsdsux21 2021-12-08 00:26:28.526660000 +1000 @@ -0,0 +1 @@ +EXTRA_OFILES=vasprintf.o