This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PowerPC64] Fix reference to toc symbol
- From: Alan Modra <amodra at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 25 Mar 2014 12:09:06 +1030
- Subject: [PowerPC64] Fix reference to toc symbol
- Authentication-results: sourceware.org; auth=none
https://sourceware.org/ml/binutils/2014-03/msg00033.html removes the
"magic" treatment of symbols defined in a .toc section. This results
in glibc failing to build correctly on powerpc64. Fixed as follows.
This change is compatible with older binutils.
(Discovering this glibc bug led me to revert the binutils change since
it's a bit rude to prevent older glibc from building, but glibc still
ought to be fixed.)
* sysdeps/powerpc/powerpc64/start.S: Add @toc to toc symbol reference.
diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
index 15e29d9..934c558 100644
--- a/sysdeps/powerpc/powerpc64/start.S
+++ b/sysdeps/powerpc/powerpc64/start.S
@@ -74,7 +74,7 @@ ENTRY(_start)
/* put the address of start_addresses in r8... **
** PPC64 ABI uses R13 for thread local, so we leave it alone */
- ld r8,.L01(r2)
+ ld r8,.L01@toc(r2)
/* and continue in libc-start, in glibc. */
b JUMPTARGET(__libc_start_main)
--
Alan Modra
Australia Development Lab, IBM