diff options
author | Alan Modra <amodra@gmail.com> | 2014-03-25 12:01:09 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-03-25 12:01:09 +1030 |
commit | 3e60bf4df86f323dde4281886a355589488149aa (patch) | |
tree | 25bfe501a679ff45526fb3d27968b436c1e4e07d /gas | |
parent | 01672a570af3899a85d12293bc7da38b0715e4a5 (diff) | |
download | gdb-3e60bf4df86f323dde4281886a355589488149aa.zip gdb-3e60bf4df86f323dde4281886a355589488149aa.tar.gz gdb-3e60bf4df86f323dde4281886a355589488149aa.tar.bz2 |
Revert "Remove magic treatment of toc symbols for powerpc ELF"
It turns out that glibc's sysdeps/powerpc/powerpc64/start.S uses this
feature. :-(
* config/tc-ppc.c (ppc_is_toc_sym): Revert 2014-03-05.
(md_assemble): Likewise. Warn.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 23 |
2 files changed, 24 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index ef4b686..d8d89f0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2014-03-25 Alan Modra <amodra@gmail.com> + + * config/tc-ppc.c (ppc_is_toc_sym): Revert 2014-03-05. + (md_assemble): Likewise. Warn. + 2014-03-21 David Weatherford <weath@cadence.com> Max Filippov <jcmvbkbc@gmail.com> diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 8609ce7..9f24f3f 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2530,16 +2530,25 @@ parse_toc_entry (enum toc_size_qualifier *toc_kind) } #endif -#ifdef OBJ_XCOFF +#if defined (OBJ_XCOFF) || defined (OBJ_ELF) /* See whether a symbol is in the TOC section. */ static int ppc_is_toc_sym (symbolS *sym) { +#ifdef OBJ_XCOFF return (symbol_get_tc (sym)->symbol_class == XMC_TC || symbol_get_tc (sym)->symbol_class == XMC_TC0); -} #endif +#ifdef OBJ_ELF + const char *sname = segment_name (S_GET_SEGMENT (sym)); + if (ppc_obj64) + return strcmp (sname, ".toc") == 0; + else + return strcmp (sname, ".got") == 0; +#endif +} +#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */ #ifdef OBJ_ELF @@ -3167,11 +3176,17 @@ md_assemble (char *str) && operand->shift == 0) { reloc = BFD_RELOC_16; -#ifdef OBJ_XCOFF +#if defined OBJ_XCOFF || defined OBJ_ELF /* Note: the symbol may be not yet defined. */ if ((operand->flags & PPC_OPERAND_PARENS) != 0 && ppc_is_toc_sym (ex.X_add_symbol)) - reloc = BFD_RELOC_PPC_TOC16; + { + reloc = BFD_RELOC_PPC_TOC16; +#ifdef OBJ_ELF + as_warn (_("assuming %s on symbol"), + ppc_obj64 ? "@toc" : "@xgot"); +#endif + } #endif } |