This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold][aarch64] Make gold accept long form of mapping symbols
- From: Han Shen <shenhan at google dot com>
- To: Cary Coutant <ccoutant at gmail dot com>, Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>, binutils <binutils at sourceware dot org>
- Cc: Luis Lozano <llozano at google dot com>, Andrew Hsieh <andrewhsieh at google dot com>, Bhaskar <bjanakiraman at google dot com>
- Date: Mon, 6 Jul 2015 15:49:48 -0700
- Subject: [gold][aarch64] Make gold accept long form of mapping symbols
- Authentication-results: sourceware.org; auth=none
Hi Cary, here is a short patch to make gold aarch64 accept long form
of mapping symbols.
AArch64 ELF ABI allows 2 kinds of mapping symbols. In addition to
"$x", "$d", we now accept "$x.<any...>" and "$d.<any..>" as mapping
symbols.
Tested:
- build on boath x86_64 and aarch64 host.
- passed local gold test.
gold/ChangeLog:
2015-07-06 Han Shen <shenhan@google.com>
* aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
of longer form of mapping symbols.
Ok for trunk?
--
Han Shen
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index e32f003..0d86d05 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -1829,14 +1829,21 @@ AArch64_relobj<size, big_endian>::do_count_local_symbols(
{
elfcpp::Sym<size, big_endian> sym(psyms);
Symbol_value<size>& lv((*plocal_values)[i]);
AArch64_address input_value = lv.input_value();
- // Check to see if this is a mapping symbol.
+ // Check to see if this is a mapping symbol. AArch64 mapping symbols are
+ // defined in "ELF for the ARM 64-bit Architecture", Table 4-4, Mapping
+ // symbols.
+ // Mapping symbols could be one of the following 4 forms -
+ // a) $x
+ // b) $x.<any...>
+ // c) $d
+ // d) $d.<any...>
const char* sym_name = pnames + sym.get_st_name();
if (sym_name[0] == '$' && (sym_name[1] == 'x' || sym_name[1] == 'd')
- && sym_name[2] == '\0')
+ && (sym_name[2] == '\0' || sym_name[2] == '.'))
{
bool is_ordinary;
unsigned int input_shndx =
this->adjust_sym_shndx(i, sym.get_st_shndx(), &is_ordinary);
gold_assert(is_ordinary);