#include "target-reloc.h"
#include "target-select.h"
#include "tls.h"
+#include "freebsd.h"
namespace
{
// http://people.redhat.com/drepper/tls.pdf
// http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
-class Target_x86_64 : public Sized_target<64, false>
+class Target_x86_64 : public Target_freebsd<64, false>
{
public:
// In the x86_64 ABI (p 68), it says "The AMD64 ABI architectures
typedef Output_data_reloc<elfcpp::SHT_RELA, true, 64, false> Reloc_section;
Target_x86_64()
- : Sized_target<64, false>(&x86_64_info),
+ : Target_freebsd<64, false>(&x86_64_info),
got_(NULL), plt_(NULL), got_plt_(NULL), rela_dyn_(NULL),
copy_relocs_(elfcpp::R_X86_64_COPY), dynbss_(NULL),
got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
// Do a relocation. Return false if the caller should not issue
// any warnings about this relocation.
inline bool
- relocate(const Relocate_info<64, false>*, Target_x86_64*, size_t relnum,
- const elfcpp::Rela<64, false>&,
+ relocate(const Relocate_info<64, false>*, Target_x86_64*, Output_section*,
+ size_t relnum, const elfcpp::Rela<64, false>&,
unsigned int r_type, const Sized_symbol<64>*,
const Symbol_value<64>*,
unsigned char*, elfcpp::Elf_types<64>::Elf_Addr,
void
Output_data_plt_x86_64::do_adjust_output_section(Output_section* os)
{
- // UnixWare sets the entsize of .plt to 4, and so does the old GNU
- // linker, and so do we.
- os->set_entsize(4);
+ os->set_entsize(plt_entry_size);
}
// Add an entry to the PLT.
// error per object file.
if (this->issued_non_pic_error_)
return;
+ gold_assert(parameters->options().output_is_position_independent());
object->error(_("requires unsupported dynamic reloc; "
"recompile with -fPIC"));
this->issued_non_pic_error_ = true;
inline bool
Target_x86_64::Relocate::relocate(const Relocate_info<64, false>* relinfo,
Target_x86_64* target,
+ Output_section*,
size_t relnum,
const elfcpp::Rela<64, false>& rela,
unsigned int r_type,
// The selector for x86_64 object files.
-class Target_selector_x86_64 : public Target_selector
+class Target_selector_x86_64 : public Target_selector_freebsd
{
public:
Target_selector_x86_64()
- : Target_selector(elfcpp::EM_X86_64, 64, false, "elf64-x86-64")
+ : Target_selector_freebsd(elfcpp::EM_X86_64, 64, false, "elf64-x86-64",
+ "elf64-x86-64-freebsd")
{ }
Target*
do_instantiate_target()
{ return new Target_x86_64(); }
+
};
Target_selector_x86_64 target_selector_x86_64;