This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PowerPC64] Fix reference to toc symbol
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 25 Mar 2014 16:06:26 -0300
- Subject: Re: [PowerPC64] Fix reference to toc symbol
- Authentication-results: sourceware.org; auth=none
- References: <20140325013906 dot GD18201 at bubble dot grove dot modra dot org>
On 24-03-2014 22:39, Alan Modra wrote:
> 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)
>
The patch is ok, thanks Alan.