m68hc11 %hi relocate problem with carry

Alan Modra amodra@gmail.com
Fri Mar 2 23:06:00 GMT 2012


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.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list