This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PPC assembler problem
- From: Alan Modra <amodra at gmail dot com>
- To: Gunther Nikl <gnikl at users dot sourceforge dot net>
- Cc: binutils at sourceware dot org
- Date: Thu, 29 Apr 2010 18:41:59 +0930
- Subject: Re: PPC assembler problem
- References: <4BD93B90.7010207@users.sourceforge.net>
On Thu, Apr 29, 2010 at 09:56:00AM +0200, Gunther Nikl wrote:
> Hello,
>
> I am using a cross GCC 4.5.0 configured for a PPC-ELF target. The
> compiler generates code like this:
>
> -- snip --
> lis 0,symbol+520@ha
> addic 4,0,symbol@l+520
> -- snip --
>
> FWIW, GCC 4.4 generates similar code for the same source file. GAS
> (a very old one, but that shouldn't matter) assembles this without
> a complaint. Using a non-GNU assembler yields in an error for the
> addic instruction. That assembler doesn't like the addition _after_
> the @l reloc. In the lis instruction the addition is emitted before
> the reloc. Is the placement of the addition after the @l reloc a GCC
> bug and GAS is simply to lenient?
Yes, I think this is a gcc bug. In fact, I ran into something like
this when working on bigtoc support.
--
Alan Modra
Australia Development Lab, IBM