This is the mail archive of the
mailing list for the binutils project.
Re: m68hc11 %hi relocate problem with carry
- From: Alan Modra <amodra at gmail dot com>
- To: James Murray <jsm at jsm-net dot demon dot co dot uk>
- Cc: binutils at sourceware dot org
- Date: Sat, 3 Mar 2012 09:36:15 +1030
- Subject: Re: m68hc11 %hi relocate problem with carry
- Authentication-results: mr.google.com; spf=pass (google.com: domain of firstname.lastname@example.org designates 10.68.226.231 as permitted sender) email@example.com; dkim=pass firstname.lastname@example.org
- References: <1330716324.30775.106.camel@jsm2>
On Fri, Mar 02, 2012 at 07:25:24PM +0000, James Murray wrote:
> I've found what appears to be a bug (or at least a limitation) when
> using a %hi assembler directive in m68hc11. This is supposed to return
> the high byte of the resolved symbol, but if the low byte overflows, the
> carry is missed.
> Could someone point me at some example code in other targets that I
> could study in order to fix m68hc11 ?
68hc11/12 is a REL target, so you'll need to find the matching lo
reloc in order to build up the reloc addend. It's easy to do if the
relocs are always adjacent, and the hi reloc comes first. It's not so
easy otherwise (eg. if the hi follows the lo reloc, applying the lo
reloc loses the original addend). See the mips backend.
Australia Development Lab, IBM