// freebsd.h -- FreeBSD support for gold -*- C++ -*-
-// Copyright 2009, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2009-2019 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
// If we see a FreeBSD input file, mark the output file as using
// FreeBSD.
virtual Target*
- do_recognize(int, int osabi, int)
+ do_recognize(Input_file*, off_t, int, int osabi, int)
{
Target* ret = this->instantiate_target();
if (osabi == elfcpp::ELFOSABI_FREEBSD)
ret->set_osabi(static_cast<elfcpp::ELFOSABI>(osabi));
return ret;
}
-
+
// Recognize two names.
virtual Target*
do_recognize_by_bfd_name(const char* name)
names->push_back(this->freebsd_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_FREEBSD
+ ? this->freebsd_bfd_name_
+ : this->bfd_name_);
+ }
+
private:
// The BFD name for the non-Freebsd target.
const char* bfd_name_;