aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>1996-08-08 22:26:12 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1996-08-08 22:26:12 +0000
commit581bc4de55b720e9d4b53d7ca6297d0f07b622ca (patch)
tree1db7c8a39605563962c64a7d775a48c11304993a
parent2eee5e3abbb8563230dd9a12a5323b8e201e6f01 (diff)
downloadgcc-581bc4de55b720e9d4b53d7ca6297d0f07b622ca.zip
gcc-581bc4de55b720e9d4b53d7ca6297d0f07b622ca.tar.gz
gcc-581bc4de55b720e9d4b53d7ca6297d0f07b622ca.tar.bz2
Fix for G++ not knowing whether a vtable will be private or public when the TOC reference is updated
From-SVN: r12605
-rw-r--r--gcc/config/rs6000/rs6000.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 00ec109..33a544c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4128,7 +4128,23 @@ output_toc (file, x, labelno)
fputs ("[TC],", file);
}
- output_addr_const (file, x);
+
+ /* Currently C++ toc references to vtables can be emitted before it
+ is decided whether the vtable is public or private. If this is
+ the case, then the linker will eventually complain that there is
+ a TOC reference to an unknown section. Thus, for vtables only,
+ we emit the TOC reference to reference the symbol and not the
+ section. */
+ if (!strncmp ("_vt.", real_name, 4))
+ {
+ RS6000_OUTPUT_BASENAME (file, real_name);
+ if (offset < 0)
+ fprintf (file, "%d", offset);
+ else if (offset > 0)
+ fprintf (file, "+%d", offset);
+ }
+ else
+ output_addr_const (file, x);
putc ('\n', file);
}