Add support for --enable-target to control which template

specializations we generate.
This commit is contained in:
Ian Lance Taylor 2007-09-04 20:00:53 +00:00
parent 64707334c7
commit 193a53d920
10 changed files with 463 additions and 50 deletions

View File

@ -37,6 +37,18 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to support 32-bit big-endian targets */
#undef HAVE_TARGET_32_BIG
/* Define to support 32-bit little-endian targets */
#undef HAVE_TARGET_32_LITTLE
/* Define to support 64-bit big-endian targets */
#undef HAVE_TARGET_64_BIG
/* Define to support 64-bit little-endian targets */
#undef HAVE_TARGET_64_LITTLE
/* Define to 1 if you have the <tr1/unordered_map> header file. */
#undef HAVE_TR1_UNORDERED_MAP

89
gold/configure vendored
View File

@ -858,6 +858,7 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-targets alternative target configurations
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-nls do not use Native Language Support
@ -1841,6 +1842,94 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
ac_config_headers="$ac_config_headers config.h:config.in"
# Check whether --enable-targets or --disable-targets was given.
if test "${enable_targets+set}" = set; then
enableval="$enable_targets"
case "${enableval}" in
yes | "")
{ { echo "$as_me:$LINENO: error: --enable-targets option must specify target names or 'all'" >&5
echo "$as_me: error: --enable-targets option must specify target names or 'all'" >&2;}
{ (exit 1); exit 1; }; }
;;
no)
enable_targets=
;;
*)
enable_targets=$enableval
;;
esac
else
# For now, enable all targets by default
enable_targets=all
fi;
# Canonicalize the enabled targets.
if test -n "$enable_targets"; then
for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
result=`$ac_config_sub $targ 2>/dev/null`
if test -n "$result"; then
canon_targets="$canon_targets $result"
else
# Permit unrecognized target names, like "all".
canon_targets="$canon_targets $targ"
fi
done
fi
# See which specific instantiations we need.
for targ in $target $canon_targets; do
targ_32_little=
targ_32_big=
targ_64_little=
targ_64_big=
if test "$targ" = "all"; then
targ_32_little=yes
targ_32_big=yes
targ_64_little=yes
targ_64_big=yes
else
case "$targ" in
i?86-*) targ_32_little=yes ;;
x86_64-*) targ_64_little=yes ;;
*)
{ { echo "$as_me:$LINENO: error: \"target $targ: unknown size and endianness\"" >&5
echo "$as_me: error: \"target $targ: unknown size and endianness\"" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
fi
done
if test -n "$targ_32_little"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TARGET_32_LITTLE 1
_ACEOF
fi
if test -n "$targ_32_big"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TARGET_32_BIG 1
_ACEOF
fi
if test -n "$targ_64_little"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TARGET_64_LITTLE 1
_ACEOF
fi
if test -n "$targ_64_big"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_TARGET_64_BIG 1
_ACEOF
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'

View File

@ -10,6 +10,75 @@ AM_INIT_AUTOMAKE(gold, 0.1)
AM_CONFIG_HEADER(config.h:config.in)
AC_ARG_ENABLE([targets],
[ --enable-targets alternative target configurations],
[case "${enableval}" in
yes | "")
AC_MSG_ERROR([--enable-targets option must specify target names or 'all'])
;;
no)
enable_targets=
;;
*)
enable_targets=$enableval
;;
esac],
[# For now, enable all targets by default
enable_targets=all
])
# Canonicalize the enabled targets.
if test -n "$enable_targets"; then
for targ in `echo $enable_targets | sed -e 's/,/ /g'`; do
result=`$ac_config_sub $targ 2>/dev/null`
if test -n "$result"; then
canon_targets="$canon_targets $result"
else
# Permit unrecognized target names, like "all".
canon_targets="$canon_targets $targ"
fi
done
fi
# See which specific instantiations we need.
for targ in $target $canon_targets; do
targ_32_little=
targ_32_big=
targ_64_little=
targ_64_big=
if test "$targ" = "all"; then
targ_32_little=yes
targ_32_big=yes
targ_64_little=yes
targ_64_big=yes
else
case "$targ" in
i?86-*) targ_32_little=yes ;;
x86_64-*) targ_64_little=yes ;;
*)
AC_MSG_ERROR("target $targ: unknown size and endianness")
;;
esac
fi
done
if test -n "$targ_32_little"; then
AC_DEFINE(HAVE_TARGET_32_LITTLE, 1,
[Define to support 32-bit little-endian targets])
fi
if test -n "$targ_32_big"; then
AC_DEFINE(HAVE_TARGET_32_BIG, 1,
[Define to support 32-bit big-endian targets])
fi
if test -n "$targ_64_little"; then
AC_DEFINE(HAVE_TARGET_64_LITTLE, 1,
[Define to support 64-bit little-endian targets])
fi
if test -n "$targ_64_big"; then
AC_DEFINE(HAVE_TARGET_64_BIG, 1,
[Define to support 64-bit big-endian targets])
fi
AC_PROG_CC
AC_PROG_CXX
AC_PROG_YACC

View File

@ -1520,18 +1520,27 @@ Versions::need_section_contents(const Stringpool* dynpool,
// Instantiate the templates we need. We could use the configure
// script to restrict this to only the ones for implemented targets.
#ifdef HAVE_TARGET_32_LITTLE
template
class Sized_dynobj<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Sized_dynobj<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Sized_dynobj<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Sized_dynobj<64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Versions::symbol_section_contents<32, false>(
@ -1541,7 +1550,9 @@ Versions::symbol_section_contents<32, false>(
unsigned char**,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Versions::symbol_section_contents<32, true>(
@ -1551,7 +1562,9 @@ Versions::symbol_section_contents<32, true>(
unsigned char**,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Versions::symbol_section_contents<64, false>(
@ -1561,7 +1574,9 @@ Versions::symbol_section_contents<64, false>(
unsigned char**,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Versions::symbol_section_contents<64, true>(
@ -1571,7 +1586,9 @@ Versions::symbol_section_contents<64, true>(
unsigned char**,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Versions::def_section_contents<32, false>(
@ -1580,7 +1597,9 @@ Versions::def_section_contents<32, false>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Versions::def_section_contents<32, true>(
@ -1589,7 +1608,9 @@ Versions::def_section_contents<32, true>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Versions::def_section_contents<64, false>(
@ -1598,7 +1619,9 @@ Versions::def_section_contents<64, false>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Versions::def_section_contents<64, true>(
@ -1607,7 +1630,9 @@ Versions::def_section_contents<64, true>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Versions::need_section_contents<32, false>(
@ -1616,7 +1641,9 @@ Versions::need_section_contents<32, false>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Versions::need_section_contents<32, true>(
@ -1625,7 +1652,9 @@ Versions::need_section_contents<32, true>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Versions::need_section_contents<64, false>(
@ -1634,7 +1663,9 @@ Versions::need_section_contents<64, false>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Versions::need_section_contents<64, true>(
@ -1643,5 +1674,6 @@ Versions::need_section_contents<64, true>(
unsigned int*,
unsigned int*
ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
#endif
} // End namespace gold.

View File

@ -986,24 +986,52 @@ Layout::create_version_sections(const Target* target, const Versions* versions,
if (target->get_size() == 32)
{
if (target->is_big_endian())
this->sized_create_version_sections SELECT_SIZE_ENDIAN_NAME(32, true)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(32, true));
{
#ifdef HAVE_TARGET_32_BIG
this->sized_create_version_sections
SELECT_SIZE_ENDIAN_NAME(32, true)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(32, true));
#else
gold_unreachable();
#endif
}
else
this->sized_create_version_sections SELECT_SIZE_ENDIAN_NAME(32, false)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(32, false));
{
#ifdef HAVE_TARGET_32_LITTLE
this->sized_create_version_sections
SELECT_SIZE_ENDIAN_NAME(32, false)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(32, false));
#else
gold_unreachable();
#endif
}
}
else if (target->get_size() == 64)
{
if (target->is_big_endian())
this->sized_create_version_sections SELECT_SIZE_ENDIAN_NAME(64, true)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(64, true));
{
#ifdef HAVE_TARGET_64_BIG
this->sized_create_version_sections
SELECT_SIZE_ENDIAN_NAME(64, true)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(64, true));
#else
gold_unreachable();
#endif
}
else
this->sized_create_version_sections SELECT_SIZE_ENDIAN_NAME(64, false)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(64, false));
{
#ifdef HAVE_TARGET_64_LITTLE
this->sized_create_version_sections
SELECT_SIZE_ENDIAN_NAME(64, false)(
versions, local_symcount, dynamic_symbols, dynstr
SELECT_SIZE_ENDIAN(64, false));
#else
gold_unreachable();
#endif
}
}
else
gold_unreachable();
@ -1449,25 +1477,33 @@ Close_task_runner::run(Workqueue*)
// Instantiate the templates we need. We could use the configure
// script to restrict this to only the ones for implemented targets.
#ifdef HAVE_TARGET_32_LITTLE
template
Output_section*
Layout::layout<32, false>(Relobj* object, unsigned int shndx, const char* name,
const elfcpp::Shdr<32, false>& shdr, off_t*);
#endif
#ifdef HAVE_TARGET_32_BIG
template
Output_section*
Layout::layout<32, true>(Relobj* object, unsigned int shndx, const char* name,
const elfcpp::Shdr<32, true>& shdr, off_t*);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
Output_section*
Layout::layout<64, false>(Relobj* object, unsigned int shndx, const char* name,
const elfcpp::Shdr<64, false>& shdr, off_t*);
#endif
#ifdef HAVE_TARGET_64_BIG
template
Output_section*
Layout::layout<64, true>(Relobj* object, unsigned int shndx, const char* name,
const elfcpp::Shdr<64, true>& shdr, off_t*);
#endif
} // End namespace gold.

View File

@ -493,7 +493,7 @@ Sized_relobj<size, big_endian>::do_add_symbols(Symbol_table* symtab,
const char* sym_names =
reinterpret_cast<const char*>(sd->symbol_names->data());
symtab->add_from_relobj(this, sd->symbols->data(), symcount, sym_names,
symtab->add_from_relobj(this, sd->symbols->data(), symcount, sym_names,
sd->symbol_names_size, this->symbols_);
delete sd->symbols;
@ -909,15 +909,29 @@ make_elf_object(const std::string& name, Input_file* input_file, off_t offset,
}
if (big_endian)
{
#ifdef HAVE_TARGET_32_BIG
elfcpp::Ehdr<32, true> ehdr(p);
return make_elf_sized_object<32, true>(name, input_file,
offset, ehdr);
#else
fprintf(stderr,
_("%s: %s: not configured to support 32-bit big-endian object\n"),
program_name, name.c_str());
gold_exit(false);
#endif
}
else
{
#ifdef HAVE_TARGET_32_LITTLE
elfcpp::Ehdr<32, false> ehdr(p);
return make_elf_sized_object<32, false>(name, input_file,
offset, ehdr);
#else
fprintf(stderr,
_("%s: %s: not configured to support 32-bit little-endian object\n"),
program_name, name.c_str());
gold_exit(false);
#endif
}
}
else
@ -930,15 +944,29 @@ make_elf_object(const std::string& name, Input_file* input_file, off_t offset,
}
if (big_endian)
{
#ifdef HAVE_TARGET_64_BIG
elfcpp::Ehdr<64, true> ehdr(p);
return make_elf_sized_object<64, true>(name, input_file,
offset, ehdr);
#else
fprintf(stderr,
_("%s: %s: not configured to support 64-bit big-endian object\n"),
program_name, name.c_str());
gold_exit(false);
#endif
}
else
{
#ifdef HAVE_TARGET_64_LITTLE
elfcpp::Ehdr<64, false> ehdr(p);
return make_elf_sized_object<64, false>(name, input_file,
offset, ehdr);
#else
fprintf(stderr,
_("%s: %s: not configured to support 64-bit little-endian object\n"),
program_name, name.c_str());
gold_exit(false);
#endif
}
}
}
@ -946,28 +974,44 @@ make_elf_object(const std::string& name, Input_file* input_file, off_t offset,
// Instantiate the templates we need. We could use the configure
// script to restrict this to only the ones for implemented targets.
#ifdef HAVE_TARGET_32_LITTLE
template
class Sized_relobj<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Sized_relobj<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Sized_relobj<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Sized_relobj<64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
struct Relocate_info<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
struct Relocate_info<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
struct Relocate_info<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
struct Relocate_info<64, true>;
#endif
} // End namespace gold.

View File

@ -1574,6 +1574,7 @@ Output_file::close()
// Instantiate the templates we need. We could use the configure
// script to restrict this to only the ones for implemented targets.
#ifdef HAVE_TARGET_32_LITTLE
template
off_t
Output_section::add_input_section<32, false>(
@ -1581,7 +1582,9 @@ Output_section::add_input_section<32, false>(
unsigned int shndx,
const char* secname,
const elfcpp::Shdr<32, false>& shdr);
#endif
#ifdef HAVE_TARGET_32_BIG
template
off_t
Output_section::add_input_section<32, true>(
@ -1589,7 +1592,9 @@ Output_section::add_input_section<32, true>(
unsigned int shndx,
const char* secname,
const elfcpp::Shdr<32, true>& shdr);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
off_t
Output_section::add_input_section<64, false>(
@ -1597,7 +1602,9 @@ Output_section::add_input_section<64, false>(
unsigned int shndx,
const char* secname,
const elfcpp::Shdr<64, false>& shdr);
#endif
#ifdef HAVE_TARGET_64_BIG
template
off_t
Output_section::add_input_section<64, true>(
@ -1605,66 +1612,106 @@ Output_section::add_input_section<64, true>(
unsigned int shndx,
const char* secname,
const elfcpp::Shdr<64, true>& shdr);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
class Output_data_reloc<elfcpp::SHT_REL, false, 32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Output_data_reloc<elfcpp::SHT_REL, false, 32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Output_data_reloc<elfcpp::SHT_REL, false, 64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Output_data_reloc<elfcpp::SHT_REL, false, 64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
class Output_data_reloc<elfcpp::SHT_REL, true, 32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Output_data_reloc<elfcpp::SHT_REL, true, 32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Output_data_reloc<elfcpp::SHT_REL, true, 64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Output_data_reloc<elfcpp::SHT_REL, true, 64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
class Output_data_reloc<elfcpp::SHT_RELA, false, 32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Output_data_reloc<elfcpp::SHT_RELA, false, 32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Output_data_reloc<elfcpp::SHT_RELA, false, 64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Output_data_reloc<elfcpp::SHT_RELA, false, 64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
class Output_data_reloc<elfcpp::SHT_RELA, true, 32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Output_data_reloc<elfcpp::SHT_RELA, true, 32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Output_data_reloc<elfcpp::SHT_RELA, true, 64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Output_data_reloc<elfcpp::SHT_RELA, true, 64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
class Output_data_got<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Output_data_got<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Output_data_got<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Output_data_got<64, true>;
#endif
} // End namespace gold.

View File

@ -611,128 +611,176 @@ Copy_relocs<size, big_endian>::emit(
// Instantiate the templates we need. We could use the configure
// script to restrict this to only the ones for implemented targets.
#ifdef HAVE_TARGET_32_LITTLE
template
void
Sized_relobj<32, false>::do_read_relocs(Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Sized_relobj<32, true>::do_read_relocs(Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Sized_relobj<64, false>::do_read_relocs(Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Sized_relobj<64, true>::do_read_relocs(Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Sized_relobj<32, false>::do_scan_relocs(const General_options& options,
Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Sized_relobj<32, true>::do_scan_relocs(const General_options& options,
Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Sized_relobj<64, false>::do_scan_relocs(const General_options& options,
Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Sized_relobj<64, true>::do_scan_relocs(const General_options& options,
Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Sized_relobj<32, false>::do_relocate(const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Sized_relobj<32, true>::do_relocate(const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Sized_relobj<64, false>::do_relocate(const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Sized_relobj<64, true>::do_relocate(const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
class Copy_relocs<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
class Copy_relocs<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
class Copy_relocs<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
class Copy_relocs<64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Copy_relocs<32, false>::emit<elfcpp::SHT_REL>(
Output_data_reloc<elfcpp::SHT_REL, true, 32, false>*);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Copy_relocs<32, true>::emit<elfcpp::SHT_REL>(
Output_data_reloc<elfcpp::SHT_REL, true, 32, true>*);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Copy_relocs<64, false>::emit<elfcpp::SHT_REL>(
Output_data_reloc<elfcpp::SHT_REL, true, 64, false>*);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Copy_relocs<64, true>::emit<elfcpp::SHT_REL>(
Output_data_reloc<elfcpp::SHT_REL, true, 64, true>*);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Copy_relocs<32, false>::emit<elfcpp::SHT_RELA>(
Output_data_reloc<elfcpp::SHT_RELA , true, 32, false>*);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Copy_relocs<32, true>::emit<elfcpp::SHT_RELA>(
Output_data_reloc<elfcpp::SHT_RELA, true, 32, true>*);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Copy_relocs<64, false>::emit<elfcpp::SHT_RELA>(
Output_data_reloc<elfcpp::SHT_RELA, true, 64, false>*);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Copy_relocs<64, true>::emit<elfcpp::SHT_RELA>(
Output_data_reloc<elfcpp::SHT_RELA, true, 64, true>*);
#endif
} // End namespace gold.

View File

@ -520,14 +520,7 @@ Symbol_table::resolve(Sized_symbol<size>* to,
// script to restrict this to only the ones needed for implemented
// targets.
template
void
Symbol_table::resolve<32, true>(
Sized_symbol<32>* to,
const elfcpp::Sym<32, true>& sym,
Object* object,
const char* version);
#ifdef HAVE_TARGET_32_LITTLE
template
void
Symbol_table::resolve<32, false>(
@ -535,15 +528,19 @@ Symbol_table::resolve<32, false>(
const elfcpp::Sym<32, false>& sym,
Object* object,
const char* version);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Symbol_table::resolve<64, true>(
Sized_symbol<64>* to,
const elfcpp::Sym<64, true>& sym,
Symbol_table::resolve<32, true>(
Sized_symbol<32>* to,
const elfcpp::Sym<32, true>& sym,
Object* object,
const char* version);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Symbol_table::resolve<64, false>(
@ -551,5 +548,16 @@ Symbol_table::resolve<64, false>(
const elfcpp::Sym<64, false>& sym,
Object* object,
const char* version);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Symbol_table::resolve<64, true>(
Sized_symbol<64>* to,
const elfcpp::Sym<64, true>& sym,
Object* object,
const char* version);
#endif
} // End namespace gold.

View File

@ -809,13 +809,25 @@ Symbol_table::do_define_in_output_data(
Sized_symbol<size>* sym;
if (target->is_big_endian())
sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, true) (
target, name, version, only_if_ref
SELECT_SIZE_ENDIAN(size, true));
{
#if defined(HAVE_TARGET_32_BIG) || defined(HAVE_TARGET_64_BIG)
sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, true) (
target, name, version, only_if_ref
SELECT_SIZE_ENDIAN(size, true));
#else
gold_unreachable();
#endif
}
else
sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, false) (
target, name, version, only_if_ref
SELECT_SIZE_ENDIAN(size, false));
{
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_64_LITTLE)
sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, false) (
target, name, version, only_if_ref
SELECT_SIZE_ENDIAN(size, false));
#else
gold_unreachable();
#endif
}
if (sym == NULL)
return NULL;
@ -1494,16 +1506,7 @@ Warnings::issue_warning(const Symbol* sym, const std::string& location) const
// script to restrict this to only the ones needed for implemented
// targets.
template
void
Symbol_table::add_from_relobj<32, true>(
Sized_relobj<32, true>* relobj,
const unsigned char* syms,
size_t count,
const char* sym_names,
size_t sym_name_size,
Symbol** sympointers);
#ifdef HAVE_TARGET_32_LITTLE
template
void
Symbol_table::add_from_relobj<32, false>(
@ -1513,17 +1516,21 @@ Symbol_table::add_from_relobj<32, false>(
const char* sym_names,
size_t sym_name_size,
Symbol** sympointers);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Symbol_table::add_from_relobj<64, true>(
Sized_relobj<64, true>* relobj,
Symbol_table::add_from_relobj<32, true>(
Sized_relobj<32, true>* relobj,
const unsigned char* syms,
size_t count,
const char* sym_names,
size_t sym_name_size,
Symbol** sympointers);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Symbol_table::add_from_relobj<64, false>(
@ -1533,19 +1540,21 @@ Symbol_table::add_from_relobj<64, false>(
const char* sym_names,
size_t sym_name_size,
Symbol** sympointers);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Symbol_table::add_from_dynobj<32, true>(
Sized_dynobj<32, true>* dynobj,
Symbol_table::add_from_relobj<64, true>(
Sized_relobj<64, true>* relobj,
const unsigned char* syms,
size_t count,
const char* sym_names,
size_t sym_name_size,
const unsigned char* versym,
size_t versym_size,
const std::vector<const char*>* version_map);
Symbol** sympointers);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
Symbol_table::add_from_dynobj<32, false>(
@ -1557,11 +1566,13 @@ Symbol_table::add_from_dynobj<32, false>(
const unsigned char* versym,
size_t versym_size,
const std::vector<const char*>* version_map);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
Symbol_table::add_from_dynobj<64, true>(
Sized_dynobj<64, true>* dynobj,
Symbol_table::add_from_dynobj<32, true>(
Sized_dynobj<32, true>* dynobj,
const unsigned char* syms,
size_t count,
const char* sym_names,
@ -1569,7 +1580,9 @@ Symbol_table::add_from_dynobj<64, true>(
const unsigned char* versym,
size_t versym_size,
const std::vector<const char*>* version_map);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
Symbol_table::add_from_dynobj<64, false>(
@ -1581,5 +1594,20 @@ Symbol_table::add_from_dynobj<64, false>(
const unsigned char* versym,
size_t versym_size,
const std::vector<const char*>* version_map);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
Symbol_table::add_from_dynobj<64, true>(
Sized_dynobj<64, true>* dynobj,
const unsigned char* syms,
size_t count,
const char* sym_names,
size_t sym_name_size,
const unsigned char* versym,
size_t versym_size,
const std::vector<const char*>* version_map);
#endif
} // End namespace gold.